24
# When the prefix is /opt/libjpeg-turbo, we assume that an "official" binary is
25
# being created, and thus we install things into specific locations.
28
if test "x$prefix" = "xNONE" -a "x$ac_default_prefix" != "x"; then
29
prefix=$ac_default_prefix
31
DATADIR=`eval echo ${datadir}`
32
DATADIR=`eval echo $DATADIR`
33
if test "$DATADIR" = "/opt/libjpeg-turbo/share"; then
36
DATADIR=`eval echo ${datarootdir}`
37
DATADIR=`eval echo $DATADIR`
38
if test "$DATADIR" = "/opt/libjpeg-turbo/share"; then
39
datarootdir='${prefix}'
42
old_exec_prefix=${exec_prefix}
43
if test "x$exec_prefix" = "xNONE"; then
47
if test "x${libdir}" = 'x${exec_prefix}/lib' -o "x${libdir}" = 'x${prefix}/lib'; then
48
LIBDIR=`eval echo ${libdir}`
49
LIBDIR=`eval echo $LIBDIR`
50
if test "$LIBDIR" = "/opt/libjpeg-turbo/lib"; then
57
libdir='${exec_prefix}/lib64'
60
libdir='${exec_prefix}/lib32'
67
exec_prefix=${old_exec_prefix}
24
70
# Check whether compiler supports pointers to undefined structures
25
71
AC_MSG_CHECKING(whether compiler supports pointers to undefined structures)
26
72
AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], ,
29
AC_DEFINE([INCOMPLETE_TYPES_BROKEN],[1],[Compiler does not support pointers to undefined structures.])])
75
AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],
76
[Compiler does not support pointers to undefined structures.])])
31
78
if test "x${GCC}" = "xyes"; then
32
79
if test "x${SAVED_CFLAGS}" = "x"; then
61
109
AC_MSG_CHECKING([if right shift is signed])
64
int is_shifting_signed (long arg) {
67
if (res == -0x7F7E80CL)
68
return 1; /* right shift is signed */
70
/* see if unsigned-shift hack will fix it. */
71
/* we can't just test exact value since it depends on width of long... */
72
res |= (~0L) << (32-4);
73
if (res == -0x7F7E80CL)
74
return 0; /* right shift is unsigned */
76
printf("Right shift isn't acting as I expect it to.\n");
77
printf("I fear the JPEG software will not work at all.\n\n");
78
return 0; /* try it with unsigned anyway */
81
exit(is_shifting_signed(-0x7F7E80B1L));
84
AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1, [Define if shift is unsigned])],
86
[AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
112
int is_shifting_signed (long arg) {
115
if (res == -0x7F7E80CL)
116
return 1; /* right shift is signed */
118
/* see if unsigned-shift hack will fix it. */
119
/* we can't just test exact value since it depends on width of long... */
120
res |= (~0L) << (32-4);
121
if (res == -0x7F7E80CL)
122
return 0; /* right shift is unsigned */
124
printf("Right shift isn't acting as I expect it to.\n");
125
printf("I fear the JPEG software will not work at all.\n\n");
126
return 0; /* try it with unsigned anyway */
129
exit(is_shifting_signed(-0x7F7E80B1L));
132
AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1, [Define if shift is unsigned])],
133
[AC_MSG_RESULT(yes)],
134
[AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
88
136
# test whether global names are unique to at least 15 chars
89
137
AC_MSG_CHECKING([for short external names])
91
[int possibly_duplicate_function () { return 0; }
92
int possibly_dupli_function () { return 1; }], [ ],
95
AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], 1, [Define if you need short function names])])
139
[int possibly_duplicate_function () { return 0; }
140
int possibly_dupli_function () { return 1; }], [ ],
142
[AC_MSG_RESULT(short)
143
AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], 1,
144
[Define if you need short function names])])
97
146
# Checks for library functions.
98
147
AC_CHECK_FUNCS([memset memcpy], [],
99
[AC_DEFINE([NEED_BSD_STRINGS], 1,
100
[Define if you have BSD-like bzero and bcopy])])
148
[AC_DEFINE([NEED_BSD_STRINGS], 1,
149
[Define if you have BSD-like bzero and bcopy])])
102
151
AC_MSG_CHECKING([libjpeg API version])
103
152
AC_ARG_VAR(JPEG_LIB_VERSION, [libjpeg API version (62, 70, or 80)])
104
153
if test "x$JPEG_LIB_VERSION" = "x"; then
106
AC_HELP_STRING([--with-jpeg7], [Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))
108
AC_HELP_STRING([--with-jpeg8], [Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))
109
if test "x${with_jpeg8}" = "xyes"; then
155
AC_HELP_STRING([--with-jpeg7],
156
[Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))
158
AC_HELP_STRING([--with-jpeg8],
159
[Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))
160
if test "x${with_jpeg8}" = "xyes"; then
163
if test "x${with_jpeg7}" = "xyes"; then
112
if test "x${with_jpeg7}" = "xyes"; then
119
170
JPEG_LIB_VERSION_DECIMAL=`expr $JPEG_LIB_VERSION / 10`.`expr $JPEG_LIB_VERSION % 10`
120
171
AC_SUBST(JPEG_LIB_VERSION_DECIMAL)
121
172
AC_MSG_RESULT([$JPEG_LIB_VERSION_DECIMAL])
122
AC_DEFINE_UNQUOTED(JPEG_LIB_VERSION, [$JPEG_LIB_VERSION], [libjpeg API version])
173
AC_DEFINE_UNQUOTED(JPEG_LIB_VERSION, [$JPEG_LIB_VERSION],
174
[libjpeg API version])
124
AC_MSG_CHECKING([libjpeg shared library version])
125
AC_ARG_VAR(SO_MAJOR_VERSION, [Major version of the libjpeg-turbo shared library (default is determined by the API version)])
126
AC_ARG_VAR(SO_MINOR_VERSION, [Minor version of the libjpeg-turbo shared library (default is determined by the API version)])
176
AC_ARG_VAR(SO_MAJOR_VERSION,
177
[Major version of the libjpeg-turbo shared library (default is determined by the API version)])
178
AC_ARG_VAR(SO_MINOR_VERSION,
179
[Minor version of the libjpeg-turbo shared library (default is determined by the API version)])
127
180
if test "x$SO_MAJOR_VERSION" = "x"; then
128
case "$JPEG_LIB_VERSION" in
129
62) SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;
130
*) SO_MAJOR_VERSION=`expr $JPEG_LIB_VERSION / 10` ;;
181
case "$JPEG_LIB_VERSION" in
182
62) SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;
183
*) SO_MAJOR_VERSION=`expr $JPEG_LIB_VERSION / 10` ;;
133
186
if test "x$SO_MINOR_VERSION" = "x"; then
134
case "$JPEG_LIB_VERSION" in
135
80) SO_MINOR_VERSION=2 ;;
136
*) SO_MINOR_VERSION=0 ;;
139
AC_MSG_RESULT([$SO_MAJOR_VERSION:$SO_MINOR_VERSION])
187
case "$JPEG_LIB_VERSION" in
188
80) SO_MINOR_VERSION=2 ;;
189
*) SO_MINOR_VERSION=0 ;;
195
# Memory source/destination managers
197
MEM_SRCDST_FUNCTIONS=
198
if test "x${with_jpeg8}" != "xyes"; then
199
AC_MSG_CHECKING([whether to include in-memory source/destination managers])
200
AC_ARG_WITH([mem-srcdst],
201
AC_HELP_STRING([--without-mem-srcdst],
202
[Do not include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI]))
203
if test "x$with_mem_srcdst" != "xno"; then
205
AC_DEFINE([MEM_SRCDST_SUPPORTED], [1],
206
[Support in-memory source/destination managers])
208
MEM_SRCDST_FUNCTIONS="global: jpeg_mem_dest; jpeg_mem_src;";
211
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-mem-srcdst"
215
AC_MSG_CHECKING([libjpeg shared library version])
216
AC_MSG_RESULT([$SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION])
217
LIBTOOL_CURRENT=`expr $SO_MAJOR_VERSION + $SO_AGE`
218
AC_SUBST(LIBTOOL_CURRENT)
140
219
AC_SUBST(SO_MAJOR_VERSION)
141
220
AC_SUBST(SO_MINOR_VERSION)
222
AC_SUBST(MEM_SRCDST_FUNCTIONS)
143
224
AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION, [$VERSION], [libjpeg-turbo version])
189
274
AC_MSG_RESULT($ljt_cv_inline)
190
275
AC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])
277
# Arithmetic coding support
192
278
AC_MSG_CHECKING([whether to include arithmetic encoding support])
193
279
AC_ARG_WITH([arith-enc],
194
AC_HELP_STRING([--without-arith-enc], [Omit arithmetic encoding support]))
280
AC_HELP_STRING([--without-arith-enc],
281
[Do not include arithmetic encoding support]))
195
282
if test "x$with_arith_enc" = "xno"; then
284
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-enc"
198
AC_DEFINE([C_ARITH_CODING_SUPPORTED], [1], [Support arithmetic encoding])
286
AC_DEFINE([C_ARITH_CODING_SUPPORTED], [1], [Support arithmetic encoding])
201
289
AM_CONDITIONAL([WITH_ARITH_ENC], [test "x$with_arith_enc" != "xno"])
203
291
AC_MSG_CHECKING([whether to include arithmetic decoding support])
204
292
AC_ARG_WITH([arith-dec],
205
AC_HELP_STRING([--without-arith-dec], [Omit arithmetic decoding support]))
293
AC_HELP_STRING([--without-arith-dec],
294
[Do not include arithmetic decoding support]))
206
295
if test "x$with_arith_dec" = "xno"; then
297
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-dec"
209
AC_DEFINE([D_ARITH_CODING_SUPPORTED], [1], [Support arithmetic decoding])
299
AC_DEFINE([D_ARITH_CODING_SUPPORTED], [1], [Support arithmetic decoding])
212
302
AM_CONDITIONAL([WITH_ARITH_DEC], [test "x$with_arith_dec" != "xno"])
214
AM_CONDITIONAL([WITH_ARITH], [test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
304
AM_CONDITIONAL([WITH_ARITH],
305
[test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
308
AC_MSG_CHECKING([whether to build TurboJPEG C wrapper])
309
AC_ARG_WITH([turbojpeg],
310
AC_HELP_STRING([--without-turbojpeg],
311
[Do not include the TurboJPEG wrapper library and associated test programs]))
312
if test "x$with_turbojpeg" = "xno"; then
314
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-turbojpeg"
216
320
AC_ARG_VAR(JAVAC, [Java compiler command (default: javac)])
217
321
if test "x$JAVAC" = "x"; then
233
AC_ARG_VAR(JNI_CFLAGS, [C compiler flags needed to include jni.h (default: -I/System/Library/Frameworks/JavaVM.framework/Headers on OS X, '-I/usr/java/include -I/usr/java/include/solaris' on Solaris, and '-I/usr/java/default/include -I/usr/java/default/include/linux' on Linux)])
337
AC_ARG_VAR(JNI_CFLAGS,
338
[C compiler flags needed to include jni.h (default: -I/System/Library/Frameworks/JavaVM.framework/Headers on OS X, '-I/usr/java/include -I/usr/java/include/solaris' on Solaris, and '-I/usr/java/default/include -I/usr/java/default/include/linux' on Linux)])
235
AC_MSG_CHECKING([whether to build TurboJPEG/OSS Java wrapper])
340
AC_MSG_CHECKING([whether to build TurboJPEG Java wrapper])
236
341
AC_ARG_WITH([java],
237
AC_HELP_STRING([--with-java],[Build Java wrapper for the TurboJPEG/OSS library]))
342
AC_HELP_STRING([--with-java], [Build Java wrapper for the TurboJPEG library]))
343
if test "x$with_turbojpeg" = "xno"; then
241
348
if test "x$with_java" = "xyes"; then
246
DEFAULT_JNI_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
249
DEFAULT_JNI_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'
252
DEFAULT_JNI_CFLAGS='-I/usr/java/default/include -I/usr/java/default/include/linux'
255
if test "x$JNI_CFLAGS" = "x"; then
256
JNI_CFLAGS=$DEFAULT_JNI_CFLAGS
259
SAVE_CPPFLAGS=${CPPFLAGS}
260
CPPFLAGS="${CPPFLAGS} ${JNI_CFLAGS}"
261
AC_CHECK_HEADERS([jni.h], [DUMMY=1],
262
[AC_MSG_ERROR([Could not find JNI header file])])
263
CPPFLAGS=${SAVE_CPPFLAGS}
266
RPM_CONFIG_ARGS=--with-java
267
JAVA_RPM_CONTENTS_1='%dir /opt/%{name}/classes'
268
JAVA_RPM_CONTENTS_2=/opt/%{name}/classes/turbojpeg.jar
353
DEFAULT_JNI_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
356
DEFAULT_JNI_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'
359
DEFAULT_JNI_CFLAGS='-I/usr/java/default/include -I/usr/java/default/include/linux'
362
if test "x$JNI_CFLAGS" = "x"; then
363
JNI_CFLAGS=$DEFAULT_JNI_CFLAGS
366
SAVE_CPPFLAGS=${CPPFLAGS}
367
CPPFLAGS="${CPPFLAGS} ${JNI_CFLAGS}"
368
AC_CHECK_HEADERS([jni.h], [DUMMY=1],
369
[AC_MSG_ERROR([Could not find JNI header file])])
370
CPPFLAGS=${SAVE_CPPFLAGS}
373
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --with-java"
374
JAVA_RPM_CONTENTS_1='%dir %{_datadir}/classes'
375
JAVA_RPM_CONTENTS_2=%{_datadir}/classes/turbojpeg.jar
273
380
AM_CONDITIONAL([WITH_JAVA], [test "x$with_java" = "xyes"])
274
381
AC_SUBST(WITH_JAVA)
275
382
AC_SUBST(JAVA_RPM_CONTENTS_1)
276
383
AC_SUBST(JAVA_RPM_CONTENTS_2)
277
AC_SUBST(RPM_CONFIG_ARGS)
279
385
# optionally force using gas-preprocessor.pl for compatibility testing
280
386
AC_ARG_WITH([gas-preprocessor],
281
AC_HELP_STRING([--with-gas-preprocessor],[Force using gas-preprocessor.pl on ARM.]))
387
AC_HELP_STRING([--with-gas-preprocessor],
388
[Force using gas-preprocessor.pl on ARM.]))
282
389
if test "x${with_gas_preprocessor}" = "xyes"; then
359
476
# jconfig.h is a minimal version that allows this package to be built
360
477
AC_CONFIG_HEADERS([config.h])
361
478
AC_CONFIG_HEADERS([jconfig.h])
362
AC_CONFIG_FILES([pkgscripts/libjpeg-turbo.spec:release/libjpeg-turbo.spec.in])
363
AC_CONFIG_FILES([pkgscripts/makecygwinpkg:release/makecygwinpkg.in])
364
AC_CONFIG_FILES([pkgscripts/makedpkg:release/makedpkg.in])
365
AC_CONFIG_FILES([pkgscripts/makemacpkg:release/makemacpkg.in])
479
AC_CONFIG_FILES([pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.in])
480
AC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in])
481
AC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in])
482
AC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in])
366
483
AC_CONFIG_FILES([pkgscripts/Description.plist:release/Description.plist.in])
367
484
AC_CONFIG_FILES([pkgscripts/Info.plist:release/Info.plist.in])
368
AC_CONFIG_FILES([pkgscripts/uninstall:release/uninstall.in])
369
AC_CONFIG_FILES([pkgscripts/makesunpkg:release/makesunpkg.in])
370
AC_CONFIG_FILES([pkgscripts/pkginfo:release/pkginfo.in])
371
AC_CONFIG_FILES([tjbenchtest])
372
AC_CONFIG_FILES([tjexampletest])
485
AC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in])
486
if test "x$with_turbojpeg" != "xno"; then
487
AC_CONFIG_FILES([tjbenchtest])
489
if test "x$with_java" = "xyes"; then
490
AC_CONFIG_FILES([tjbenchtest.java])
491
AC_CONFIG_FILES([tjexampletest])
373
493
AC_CONFIG_FILES([libjpeg.map])
374
494
AC_CONFIG_FILES([Makefile simd/Makefile])
375
495
AC_CONFIG_FILES([java/Makefile])
496
AC_CONFIG_FILES([md5/Makefile])