-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
322 lines (299 loc) · 9.29 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
dnl# -*- Autoconf -*-
dnl# Process this file with autoconf to produce a configure script.
dnl#
dnl# (style note: lines with autoconf macros on them are ended with 'dnl'
dnl# when doing so removes an empty line in the generated configure script,
dnl# without also changing the indentation of the next non-empty line)
dnl#
# get rid of that stupid cache mechanism:
if test -e config.cache; then
rm -f config.cache 2>&1
fi
# misc. initializion things:
AC_PREREQ([2.69])dnl
AC_INIT([epeg],[0.9.0],[raster@rasterman.com])dnl
AC_CONFIG_SRCDIR([epeg.c.in])dnl
AC_CONFIG_AUX_DIR([build-aux])dnl
AC_REQUIRE_AUX_FILE([mkinstalldirs])dnl
AC_REQUIRE_AUX_FILE([depcomp])dnl
AC_CONFIG_MACRO_DIR([m4])dnl
AC_CANONICAL_TARGET
AC_OBJEXT
AC_EXEEXT
AC_USE_SYSTEM_EXTENSIONS([])dnl
AM_INIT_AUTOMAKE([1.4 gnits])
AM_SANITY_CHECK([])dnl
AM_MAINTAINER_MODE
AC_CONFIG_HEADERS([config.h])dnl
AC_SYS_LARGEFILE
AC_SYS_LONG_FILE_NAMES([])dnl
AC_SEARCH_LIBS([strerror],[cposix]) dnl# used to be AC\_ISC\_POSIX
# Checks for programs.
if test "x${CC}" = "x"; then
test -z "${CC}" || unset CC
AC_PROG_CC([])dnl
else
test -n "${CC}" && export CC
AC_SUBST([CC])
fi
AC_PROG_CC_C_O([])dnl
AC_PROG_CPP([])dnl
AC_PROG_CXX([])dnl
AC_PROG_INSTALL([])dnl
AC_PROG_LN_S
AC_PROG_MKDIR_P([])dnl
AC_DEFUN([AM_LT_PREREQS],[
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
])dnl
AM_LT_PREREQS([])dnl
LT_INIT([shared win32-dll dlopen])dnl
LT_LANG([C])dnl
LT_PREREQ([2.4.2])dnl
AC_DEFUN([AC_REQUIRE_RANLIB],[
AC_REQUIRE([AC_PROG_RANLIB])dnl
])dnl
if test "x${RANLIB}" = "x"; then
test -z "${RANLIB}" && test -z "${ac_cv_prog_ac_ct_RANLIB}"
AC_REQUIRE_RANLIB([])
else
test -n "${RANLIB}" && export RANLIB
AC_SUBST([RANLIB])
fi
AC_DEFUN([AC_REQUIRE_GREPS],[
AC_REQUIRE([AC_PROG_GREP])dnl
AC_REQUIRE([AC_PROG_EGREP])dnl
AC_REQUIRE([AC_PROG_FGREP])dnl
AC_SUBST([EGREP])dnl
])dnl
AC_REQUIRE_GREPS([])
AC_PATH_PROG([CJPEG],[cjpeg])dnl
AC_PATH_PROG([DJPEG],[djpeg])dnl
AC_PATH_PROG([JPEGTRAN],[jpegtran])dnl
AC_PATH_PROG([RDJPGCOM],[rdjpgcom])dnl
AC_PATH_PROG([WRJPGCOM],[wrjpgcom])dnl
# documentation tools:
AM_MISSING_PROG([DVIPS_PROG],[dvips])dnl
AM_MISSING_PROG([HIUTIL],[hiutil])dnl
AM_MISSING_PROG([LATEX],[latex])dnl
AM_MISSING_PROG([MAKEINDEX],[makeindex])dnl
AM_MISSING_PROG([PS2PDF],[ps2pdf])dnl
AM_MISSING_PROG([PSNUP],[psnup])dnl
AC_PATH_PROGS([PERL_BIN],[perl perl5 perl5.34 perl5.32 perl5.30 perl5.28])dnl
AC_PATH_PROG([MSCGEN_BIN],[mscgen])dnl
AC_PATH_PROG([DIA_BIN],[dia])dnl
AC_PATH_PROG([DOT_BIN],[dot])dnl
if test -n "${DOT_BIN}"; then
export HAVE_DOT="YES"
elif test -z "${DOT_BIN}"; then
export HAVE_DOT="NO"
else
export HAVE_DOT=""
fi
AC_SUBST([HAVE_DOT])dnl
# Checks for libraries.
AC_CHECK_LIB([c],[fprintf])dnl
LT_LIB_M([])dnl
AC_CHECK_LIB([jpeg],[jpeg_destroy_compress],[],[
AC_CHECK_LIB([jpeg],[main])dnl
])dnl
dnl# AX_* macros require the autoconf-archive package:
AX_CHECK_GD([])dnl
# Checks for header files.
AC_DEFUN([AC_REQUIRE_HEADER_STDC],[
AC_REQUIRE([AC_HEADER_STDC])dnl
])dnl
AC_REQUIRE_HEADER_STDC([])dnl
AC_HEADER_TIME([])dnl
AC_HEADER_STAT([])dnl
AC_CHECK_HEADERS([fcntl.h limits.h setjmp.h time.h])dnl
if test "x${ac_cv_header_stdint_h}" = "x"; then
test -z "${ac_cv_header_stdint_h}" || unset ac_cv_header_stdint_h
AC_CHECK_HEADERS([stdint.h])
fi
if test "x${ac_cv_header_stdio_h}" = "x"; then
test -z "${ac_cv_header_stdio_h}" || unset ac_cv_header_stdio_h
AC_CHECK_HEADERS([stdio.h])
fi
if test "x${ac_cv_header_unistd_h}" = "x"; then
test -z "${ac_cv_header_unistd_h}" || unset ac_cv_header_unistd_h
AC_CHECK_HEADERS([unistd.h])
fi
# jpeg-specific headers:
AC_CHECK_HEADERS([jconfig.h jerror.h jmorecfg.h jpeglib.h])dnl
# Checks for typedefs, structures, and compiler characteristics.
AC_ENABLE_SHARED([])dnl
AC_C_BIGENDIAN([])dnl
AC_C_CONST([])dnl
AC_C_PROTOTYPES([])dnl
AC_TYPE_SIZE_T([])dnl
AC_TYPE_UINTMAX_T([])dnl
dnl# FIXME: come up with a macro to simplify checks like this:
AC_CHECK_TYPES([jmp_buf],[
dnl# for some reason the sizeof check has an extra, unused parameter...
AC_CHECK_SIZEOF([jmp_buf],[],[
#ifdef HAVE_SETJMP_H
# include <setjmp.h>
#else
# if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# warning "This conftest for jmp_buf expects <setjmp.h> to be included."
# endif /* __GNUC__ && !__STRICT_ANSI__ */
#endif /* HAVE_SETJMP_H */
])dnl
dnl# unlike the size check, the alignment check does NOT have
dnl# the extra unused parameter though:
AC_CHECK_ALIGNOF([jmp_buf],[
#ifdef HAVE_SETJMP_H
# include <setjmp.h>
#else
# if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# warning "This conftest for jmp_buf expects <setjmp.h> to be included."
# endif /* __GNUC__ && !__STRICT_ANSI__ */
#endif /* HAVE_SETJMP_H */
#ifndef offsetof
# ifndef __has_builtin
# define __has_builtin(x) 0
# endif /* !__has_builtin */
# if __has_builtin(__builtin_offsetof)
# define offsetof(x, y) __builtin_offsetof(x, y)
# endif /* __has_builtin(__builtin_offsetof) */
#endif /* !offsetof */
])dnl
],[],[
#ifdef HAVE_SETJMP_H
# include <setjmp.h>
#else
# if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# warning "This conftest for jmp_buf expects <setjmp.h> to be included."
# endif /* __GNUC__ && !__STRICT_ANSI__ */
#endif /* HAVE_SETJMP_H */
])dnl
AC_CHECK_TYPES([FILE *],[
dnl# unlinke the setjmp tests, the checks for size and alignment of
dnl# file pointers do NOT need their default includes modified:
AC_CHECK_SIZEOF([FILE *])dnl
AC_CHECK_ALIGNOF([FILE *])dnl
],[],[
#ifdef HAVE_STDIO_H
# include <stdio.h>
#else
# if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# warning "This conftest for file pointers wants <stdio.h> to be included"
# endif /* __GNUC__ && !__STRICT_ANSI__ */
#endif /* HAVE_STDIO_H */
])dnl
# jpeg-specific types:
AC_CHECK_TYPES([const JOCTET *, j_common_ptr, J_COLOR_SPACE],[],[],[
#include <stdio.h>
#ifdef HAVE_JPEGLIB_H
# include <jpeglib.h>
#else
# if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# warning "This conftest for a jpeg type wants to include <jpeglib.h>"
# endif /* __GNUC__ && !__STRICT_ANSI__ */
#endif /* HAVE_JPEGLIB_H */
])dnl
# Checks for library functions.
AC_FUNC_MALLOC([])dnl
AC_FUNC_REALLOC([])dnl
dnl# I wish func checks allowed the includes to be modified, but oh well:
AC_CHECK_FUNCS([atoi calloc exit fclose fileno fmemopen fopen free fseek \
fstat ftell fwrite longjmp memcpy open_memstream printf \
rewind setjmp snprintf sscanf strchr strcmp strdup strlen \
strncmp tmpfile])dnl
# jpeg-specific functions:
AC_CHECK_FUNCS([jpeg_calc_output_dimensions \
jpeg_create_compress jpeg_create_decompress \
jpeg_destroy_compress jpeg_destroy_decompress \
jpeg_finish_compress jpeg_finish_decompress \
jpeg_read_header jpeg_read_scanlines jpeg_save_markers \
jpeg_set_defaults jpeg_set_quality \
jpeg_start_compress jpeg_start_decompress \
jpeg_std_error jpeg_stdio_dest jpeg_stdio_src jpeg_write_marker])dnl
# Checks for declarations.
AC_CHECK_DECLS([JCS_GRAYSCALE, JCS_CMYK, JCS_RGB, JCS_YCbCr, JDCT_IFAST, JDCT_ISLOW],[],[],[
#include <stdio.h>
#ifdef HAVE_JPEGLIB_H
# include <jpeglib.h>
#else
# if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# warning "This conftest for a jpeg decl wants to include <jpeglib.h>"
# endif /* __GNUC__ && !__STRICT_ANSI__ */
#endif /* HAVE_JPEGLIB_H */
])dnl
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
else
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
fi
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
else
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
fi
dnl# Set PACKAGE_BIN_DIR in config.h.
if test "x${bindir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED([PACKAGE_BIN_DIR],["${ac_default_prefix}/bin"],
[Installation directory for user executables])dnl
else
AC_DEFINE_UNQUOTED([PACKAGE_BIN_DIR],["${prefix}/bin"],
[Installation directory for user executables])dnl
fi
else
AC_DEFINE_UNQUOTED([PACKAGE_BIN_DIR],["${bindir}"],
[Installation directory for user executables])dnl
fi
dnl# Set PACKAGE_LIB_DIR in config.h.
if test "x${libdir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED([PACKAGE_LIB_DIR],["${ac_default_prefix}/lib"],
[Installation directory for libraries])dnl
else
AC_DEFINE_UNQUOTED([PACKAGE_LIB_DIR],["${prefix}/lib"],
[Installation directory for libraries])dnl
fi
else
AC_DEFINE_UNQUOTED([PACKAGE_LIB_DIR],["${libdir}"],
[Installation directory for libraries])dnl
fi
dnl# Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd ${srcdir} && pwd`
AC_DEFINE_UNQUOTED([PACKAGE_SOURCE_DIR],["${packagesrcdir}"],
[Source code directory])dnl
my_includes=""
my_libs="-ljpeg"
AC_SUBST([my_includes])dnl
AC_SUBST([my_libs])dnl
AC_CONFIG_FILES([
Doxyfile
Makefile
doc/Makefile
doc/latex/Makefile
doc/texinfo/Makefile
src/Makefile
src/lib/Makefile
src/bin/Makefile
epeg-config
])dnl
AC_CONFIG_COMMANDS([default],[
chmod +x epeg-config
touch epeg_docs.tar.gz
],[])dnl
AC_OUTPUT([])dnl