blob: 8e75dceca0d9b87f165e069280c36ae80085061b [file] [log] [blame]
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +00001# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
DRCbf0fab92010-02-12 22:22:01 +00004AC_PREREQ([2.56])
DRC84f71222012-12-31 09:44:31 +00005AC_INIT([libjpeg-turbo], [1.2.90])
DRC079b4342010-02-15 11:32:23 +00006BUILD=`date +%Y%m%d`
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +00007
8AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
DRC8ff1f252010-02-15 11:08:57 +00009AC_PREFIX_DEFAULT(/opt/libjpeg-turbo)
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +000010
11# Always build with prototypes
12AC_DEFINE([HAVE_PROTOTYPES], 1, [Define if your compiler supports prototypes])
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +000013
14# Checks for programs.
DRCe7b699d2010-02-14 07:39:07 +000015SAVED_CFLAGS=${CFLAGS}
DRCb4a50ce2011-02-26 21:07:50 +000016SAVED_CPPFLAGS=${CPPFLAGS}
Pierre Ossman2ae181c2009-03-09 13:21:27 +000017AC_PROG_CPP
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +000018AC_PROG_CC
DRC321e0682011-05-03 08:47:43 +000019AM_PROG_AS
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +000020AC_PROG_INSTALL
21AC_PROG_LIBTOOL
22AC_PROG_LN_S
23
DRCbdb12882010-08-21 21:14:17 +000024# Check whether compiler supports pointers to undefined structures
25AC_MSG_CHECKING(whether compiler supports pointers to undefined structures)
26AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], ,
27AC_MSG_RESULT(yes),
28[AC_MSG_RESULT(no)
29AC_DEFINE([INCOMPLETE_TYPES_BROKEN],[1],[Compiler does not support pointers to undefined structures.])])
30
DRCe7b699d2010-02-14 07:39:07 +000031if test "x${GCC}" = "xyes"; then
32 if test "x${SAVED_CFLAGS}" = "x"; then
33 CFLAGS=-O3
34 fi
DRCb4a50ce2011-02-26 21:07:50 +000035 if test "x${SAVED_CPPFLAGS}" = "x"; then
36 CPPFLAGS=-Wall
37 fi
DRCe7b699d2010-02-14 07:39:07 +000038fi
39
DRC1e2f2982010-02-16 22:35:25 +000040AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
41if test "x${SUNCC}" = "xyes"; then
42 if test "x${SAVED_CFLAGS}" = "x"; then
43 CFLAGS=-xO5
44 fi
DRC1e2f2982010-02-16 22:35:25 +000045fi
46
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +000047# Checks for libraries.
48
49# Checks for header files.
50AC_HEADER_STDC
51AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
52AC_CHECK_HEADER([sys/types.h], AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you have sys/types.h]))
53
54# Checks for typedefs, structures, and compiler characteristics.
55AC_C_CONST
56AC_C_CHAR_UNSIGNED
57AC_C_INLINE
58AC_TYPE_SIZE_T
59AC_CHECK_TYPES([unsigned char, unsigned short])
60
61AC_MSG_CHECKING([if right shift is signed])
62AC_TRY_RUN(
63 [#include <stdio.h>
64 int is_shifting_signed (long arg) {
65 long res = arg >> 4;
66
67 if (res == -0x7F7E80CL)
68 return 1; /* right shift is signed */
69
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 */
75
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 */
79 }
80 int main (void) {
81 exit(is_shifting_signed(-0x7F7E80B1L));
82 }],
83 [AC_MSG_RESULT(no)
84 AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1, [Define if shift is unsigned])],
85 [AC_MSG_RESULT(yes)],
86 [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
87
88# test whether global names are unique to at least 15 chars
89AC_MSG_CHECKING([for short external names])
90AC_TRY_LINK(
91 [int possibly_duplicate_function () { return 0; }
92 int possibly_dupli_function () { return 1; }], [ ],
93 [AC_MSG_RESULT(ok)],
94 [AC_MSG_RESULT(short)
95 AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], 1, [Define if you need short function names])])
96
97# Checks for library functions.
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +000098AC_CHECK_FUNCS([memset memcpy], [],
99 [AC_DEFINE([NEED_BSD_STRINGS], 1,
100 [Define if you have BSD-like bzero and bcopy])])
101
DRC1f80a102010-10-18 00:15:31 +0000102AC_MSG_CHECKING([libjpeg API version])
103AC_ARG_VAR(JPEG_LIB_VERSION, [libjpeg API version (62, 70, or 80)])
104if test "x$JPEG_LIB_VERSION" = "x"; then
105 AC_ARG_WITH([jpeg7],
106 AC_HELP_STRING([--with-jpeg7], [Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))
107 AC_ARG_WITH([jpeg8],
DRCf38eee02011-02-18 07:00:38 +0000108 AC_HELP_STRING([--with-jpeg8], [Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))
DRC1f80a102010-10-18 00:15:31 +0000109 if test "x${with_jpeg8}" = "xyes"; then
110 JPEG_LIB_VERSION=80
DRC36a6eec2010-10-08 08:05:44 +0000111 else
DRC1f80a102010-10-18 00:15:31 +0000112 if test "x${with_jpeg7}" = "xyes"; then
113 JPEG_LIB_VERSION=70
114 else
115 JPEG_LIB_VERSION=62
116 fi
DRC36a6eec2010-10-08 08:05:44 +0000117 fi
118fi
DRC1f80a102010-10-18 00:15:31 +0000119JPEG_LIB_VERSION_DECIMAL=`expr $JPEG_LIB_VERSION / 10`.`expr $JPEG_LIB_VERSION % 10`
DRC8515d3d2010-10-19 06:38:57 +0000120AC_SUBST(JPEG_LIB_VERSION_DECIMAL)
DRC1f80a102010-10-18 00:15:31 +0000121AC_MSG_RESULT([$JPEG_LIB_VERSION_DECIMAL])
122AC_DEFINE_UNQUOTED(JPEG_LIB_VERSION, [$JPEG_LIB_VERSION], [libjpeg API version])
123
DRC1f80a102010-10-18 00:15:31 +0000124AC_ARG_VAR(SO_MAJOR_VERSION, [Major version of the libjpeg-turbo shared library (default is determined by the API version)])
125AC_ARG_VAR(SO_MINOR_VERSION, [Minor version of the libjpeg-turbo shared library (default is determined by the API version)])
126if test "x$SO_MAJOR_VERSION" = "x"; then
127 case "$JPEG_LIB_VERSION" in
128 62) SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;
129 *) SO_MAJOR_VERSION=`expr $JPEG_LIB_VERSION / 10` ;;
130 esac
131fi
132if test "x$SO_MINOR_VERSION" = "x"; then
133 case "$JPEG_LIB_VERSION" in
134 80) SO_MINOR_VERSION=2 ;;
135 *) SO_MINOR_VERSION=0 ;;
136 esac
137fi
DRCab706232013-01-18 23:42:31 +0000138
DRC6da61db2013-01-19 01:06:46 +0000139RPM_CONFIG_ARGS=
140
DRCab706232013-01-18 23:42:31 +0000141# Memory source/destination managers
142SO_AGE=0
143MEM_SRCDST_FUNCTIONS=
144if test "x${with_jpeg8}" != "xyes"; then
145 AC_MSG_CHECKING([whether to include in-memory source/destination managers])
146 AC_ARG_WITH([mem-srcdst],
147 AC_HELP_STRING([--without-mem-srcdst], [Do not include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI]))
148 if test "x$with_mem_srcdst" != "xno"; then
149 AC_MSG_RESULT(yes)
150 AC_DEFINE([MEM_SRCDST_SUPPORTED], [1], [Support in-memory source/destination managers])
151 SO_AGE=1
152 MEM_SRCDST_FUNCTIONS="global: jpeg_mem_dest; jpeg_mem_src;";
153 else
154 AC_MSG_RESULT(no)
DRC6da61db2013-01-19 01:06:46 +0000155 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-mem-srcdst"
DRCab706232013-01-18 23:42:31 +0000156 fi
157fi
158
159AC_MSG_CHECKING([libjpeg shared library version])
160AC_MSG_RESULT([$SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION])
DRC6da61db2013-01-19 01:06:46 +0000161LIBTOOL_CURRENT=`expr $SO_MAJOR_VERSION + $SO_AGE`
162AC_SUBST(LIBTOOL_CURRENT)
DRC1f80a102010-10-18 00:15:31 +0000163AC_SUBST(SO_MAJOR_VERSION)
164AC_SUBST(SO_MINOR_VERSION)
DRCab706232013-01-18 23:42:31 +0000165AC_SUBST(SO_AGE)
166AC_SUBST(MEM_SRCDST_FUNCTIONS)
DRC36a6eec2010-10-08 08:05:44 +0000167
DRCab64b622011-12-18 16:29:35 +0000168AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION, [$VERSION], [libjpeg-turbo version])
169
DRC7a0478e2010-11-07 19:12:30 +0000170VERSION_SCRIPT=yes
171AC_ARG_ENABLE([ld-version-script],
172 AS_HELP_STRING([--disable-ld-version-script],
173 [Disable linker version script for libjpeg-turbo (default is to use linker version script if the linker supports it)]),
174 [VERSION_SCRIPT=$enableval], [])
DRC8515d3d2010-10-19 06:38:57 +0000175
176AC_MSG_CHECKING([whether the linker supports version scripts])
177SAVED_LDFLAGS="$LDFLAGS"
178LDFLAGS="$LDFLAGS -Wl,--version-script,conftest.map"
179cat > conftest.map <<EOF
180VERS_1 {
181 global: *;
182};
183EOF
184AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
185 [VERSION_SCRIPT_FLAG=-Wl,--version-script,; AC_MSG_RESULT([yes (GNU style)])], [])
186if test "x$VERSION_SCRIPT_FLAG" = "x"; then
187 LDFLAGS="$SAVED_LDFLAGS -Wl,-M,conftest.map"
188 AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
189 [VERSION_SCRIPT_FLAG=-Wl,-M,; AC_MSG_RESULT([yes (Sun style)])], [])
190fi
191if test "x$VERSION_SCRIPT_FLAG" = "x"; then
192 VERSION_SCRIPT=no
193 AC_MSG_RESULT(no)
194fi
DRC8515d3d2010-10-19 06:38:57 +0000195LDFLAGS="$SAVED_LDFLAGS"
196
DRC9fa95592011-02-25 00:23:44 +0000197AC_MSG_CHECKING([whether to use version script when building libjpeg-turbo])
DRC8515d3d2010-10-19 06:38:57 +0000198AC_MSG_RESULT($VERSION_SCRIPT)
199
200AM_CONDITIONAL(VERSION_SCRIPT, test "x$VERSION_SCRIPT" = "xyes")
DRC8515d3d2010-10-19 06:38:57 +0000201AC_SUBST(VERSION_SCRIPT_FLAG)
DRC8515d3d2010-10-19 06:38:57 +0000202
DRCb4570bb2011-09-07 06:31:00 +0000203# Check for non-broken inline under various spellings
204AC_MSG_CHECKING(for inline)
205ljt_cv_inline=""
206AC_TRY_COMPILE(, [} __attribute__((always_inline)) int foo() { return 0; }
207int bar() { return foo();], ljt_cv_inline="__attribute__((always_inline))",
208AC_TRY_COMPILE(, [} __inline__ int foo() { return 0; }
209int bar() { return foo();], ljt_cv_inline="__inline__",
210AC_TRY_COMPILE(, [} __inline int foo() { return 0; }
211int bar() { return foo();], ljt_cv_inline="__inline",
212AC_TRY_COMPILE(, [} inline int foo() { return 0; }
213int bar() { return foo();], ljt_cv_inline="inline"))))
214AC_MSG_RESULT($ljt_cv_inline)
215AC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])
216
DRC211d1e72013-01-13 11:25:20 +0000217# Arithmetic coding support
DRC990e28d2011-01-04 21:40:11 +0000218AC_MSG_CHECKING([whether to include arithmetic encoding support])
DRCe3720042010-11-23 06:50:14 +0000219AC_ARG_WITH([arith-enc],
DRCcb2036f2013-01-17 21:48:11 +0000220 AC_HELP_STRING([--without-arith-enc], [Do not include arithmetic encoding support]))
DRCe3720042010-11-23 06:50:14 +0000221if test "x$with_arith_enc" = "xno"; then
222 AC_MSG_RESULT(no)
DRC6da61db2013-01-19 01:06:46 +0000223 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-enc"
DRCe3720042010-11-23 06:50:14 +0000224else
225 AC_DEFINE([C_ARITH_CODING_SUPPORTED], [1], [Support arithmetic encoding])
226 AC_MSG_RESULT(yes)
227fi
228AM_CONDITIONAL([WITH_ARITH_ENC], [test "x$with_arith_enc" != "xno"])
229
DRC990e28d2011-01-04 21:40:11 +0000230AC_MSG_CHECKING([whether to include arithmetic decoding support])
DRCe3720042010-11-23 06:50:14 +0000231AC_ARG_WITH([arith-dec],
DRCcb2036f2013-01-17 21:48:11 +0000232 AC_HELP_STRING([--without-arith-dec], [Do not include arithmetic decoding support]))
DRCe3720042010-11-23 06:50:14 +0000233if test "x$with_arith_dec" = "xno"; then
234 AC_MSG_RESULT(no)
DRC6da61db2013-01-19 01:06:46 +0000235 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-dec"
DRCe3720042010-11-23 06:50:14 +0000236else
237 AC_DEFINE([D_ARITH_CODING_SUPPORTED], [1], [Support arithmetic decoding])
238 AC_MSG_RESULT(yes)
239fi
240AM_CONDITIONAL([WITH_ARITH_DEC], [test "x$with_arith_dec" != "xno"])
241
242AM_CONDITIONAL([WITH_ARITH], [test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
243
DRC211d1e72013-01-13 11:25:20 +0000244# TurboJPEG support
DRC5039d732013-01-21 23:42:12 +0000245AC_MSG_CHECKING([whether to build TurboJPEG C wrapper])
DRC211d1e72013-01-13 11:25:20 +0000246AC_ARG_WITH([turbojpeg],
DRC5039d732013-01-21 23:42:12 +0000247 AC_HELP_STRING([--without-turbojpeg],[Do not include the TurboJPEG wrapper library and associated test programs]))
DRC211d1e72013-01-13 11:25:20 +0000248if test "x$with_turbojpeg" = "xno"; then
249 AC_MSG_RESULT(no)
DRC6da61db2013-01-19 01:06:46 +0000250 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-turbojpeg"
DRC211d1e72013-01-13 11:25:20 +0000251else
252 AC_MSG_RESULT(yes)
253fi
254
255# Java support
DRCf2602ce2011-04-01 00:20:33 +0000256AC_ARG_VAR(JAVAC, [Java compiler command (default: javac)])
257if test "x$JAVAC" = "x"; then
258 JAVAC=javac
259fi
260AC_SUBST(JAVAC)
261AC_ARG_VAR(JAVACFLAGS, [Java compiler flags])
262AC_SUBST(JAVACFLAGS)
263AC_ARG_VAR(JAR, [Java archive command (default: jar)])
264if test "x$JAR" = "x"; then
265 JAR=jar
266fi
267AC_SUBST(JAR)
268AC_ARG_VAR(JAVA, [Java runtime command (default: java)])
269if test "x$JAVA" = "x"; then
270 JAVA=java
271fi
272AC_SUBST(JAVA)
273AC_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)])
DRC063ab492011-02-04 22:16:41 +0000274
DRC5039d732013-01-21 23:42:12 +0000275AC_MSG_CHECKING([whether to build TurboJPEG Java wrapper])
DRCf2602ce2011-04-01 00:20:33 +0000276AC_ARG_WITH([java],
DRC5039d732013-01-21 23:42:12 +0000277 AC_HELP_STRING([--with-java],[Build Java wrapper for the TurboJPEG library]))
DRC211d1e72013-01-13 11:25:20 +0000278if test "x$with_turbojpeg" = "xno"; then
279 with_java=no
280fi
DRC1421a262011-02-06 15:35:38 +0000281
DRCf2602ce2011-04-01 00:20:33 +0000282WITH_JAVA=0
283if test "x$with_java" = "xyes"; then
DRCf8e00552011-02-04 11:06:36 +0000284 AC_MSG_RESULT(yes)
DRC1421a262011-02-06 15:35:38 +0000285
286 case $host_os in
287 darwin*)
DRCe08c05f2011-03-31 08:03:26 +0000288 DEFAULT_JNI_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
DRC1421a262011-02-06 15:35:38 +0000289 ;;
290 solaris*)
DRCe08c05f2011-03-31 08:03:26 +0000291 DEFAULT_JNI_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'
DRC1421a262011-02-06 15:35:38 +0000292 ;;
293 linux*)
DRCe08c05f2011-03-31 08:03:26 +0000294 DEFAULT_JNI_CFLAGS='-I/usr/java/default/include -I/usr/java/default/include/linux'
DRC1421a262011-02-06 15:35:38 +0000295 ;;
296 esac
DRCe08c05f2011-03-31 08:03:26 +0000297 if test "x$JNI_CFLAGS" = "x"; then
298 JNI_CFLAGS=$DEFAULT_JNI_CFLAGS
DRC1421a262011-02-06 15:35:38 +0000299 fi
300
DRC063ab492011-02-04 22:16:41 +0000301 SAVE_CPPFLAGS=${CPPFLAGS}
DRCe08c05f2011-03-31 08:03:26 +0000302 CPPFLAGS="${CPPFLAGS} ${JNI_CFLAGS}"
DRC063ab492011-02-04 22:16:41 +0000303 AC_CHECK_HEADERS([jni.h], [DUMMY=1],
304 [AC_MSG_ERROR([Could not find JNI header file])])
305 CPPFLAGS=${SAVE_CPPFLAGS}
DRCe08c05f2011-03-31 08:03:26 +0000306 AC_SUBST(JNI_CFLAGS)
DRC1b0c3b02011-02-06 15:51:27 +0000307
DRC6da61db2013-01-19 01:06:46 +0000308 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --with-java"
DRCf2602ce2011-04-01 00:20:33 +0000309 JAVA_RPM_CONTENTS_1='%dir /opt/%{name}/classes'
310 JAVA_RPM_CONTENTS_2=/opt/%{name}/classes/turbojpeg.jar
311 WITH_JAVA=1
DRCf8e00552011-02-04 11:06:36 +0000312else
313 AC_MSG_RESULT(no)
314fi
DRCf2602ce2011-04-01 00:20:33 +0000315AM_CONDITIONAL([WITH_JAVA], [test "x$with_java" = "xyes"])
316AC_SUBST(WITH_JAVA)
317AC_SUBST(JAVA_RPM_CONTENTS_1)
318AC_SUBST(JAVA_RPM_CONTENTS_2)
DRCf8e00552011-02-04 11:06:36 +0000319
DRC4346f912011-06-14 22:16:50 +0000320# optionally force using gas-preprocessor.pl for compatibility testing
321AC_ARG_WITH([gas-preprocessor],
322 AC_HELP_STRING([--with-gas-preprocessor],[Force using gas-preprocessor.pl on ARM.]))
323if test "x${with_gas_preprocessor}" = "xyes"; then
324 case $host_os in
325 darwin*)
326 CCAS="gas-preprocessor.pl -fix-unreq $CC"
327 ;;
328 *)
329 CCAS="gas-preprocessor.pl -no-fix-unreq $CC"
330 ;;
331 esac
332 AC_SUBST([CCAS])
333fi
334
DRC60cddeb2010-02-12 05:37:07 +0000335# SIMD is optional
336AC_ARG_WITH([simd],
DRCcb2036f2013-01-17 21:48:11 +0000337 AC_HELP_STRING([--without-simd],[Do not include SIMD extensions]))
DRC60cddeb2010-02-12 05:37:07 +0000338if test "x${with_simd}" != "xno"; then
339 # Check if we're on a supported CPU
340 AC_MSG_CHECKING([if we have SIMD optimisations for cpu type])
341 case "$host_cpu" in
DRC49597872010-05-17 20:47:57 +0000342 x86_64 | amd64)
DRC60cddeb2010-02-12 05:37:07 +0000343 AC_MSG_RESULT([yes (x86_64)])
344 AC_PROG_NASM
345 simd_arch=x86_64
346 ;;
347 i*86 | x86 | ia32)
348 AC_MSG_RESULT([yes (i386)])
349 AC_PROG_NASM
350 simd_arch=i386
351 ;;
DRC321e0682011-05-03 08:47:43 +0000352 arm*)
353 AC_MSG_RESULT([yes (arm)])
354 AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
355 AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE(
356 [AC_MSG_RESULT([yes])
357 simd_arch=arm],
358 [AC_MSG_RESULT([no])
359 with_simd=no
360 AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.])])
361 ;;
DRC60cddeb2010-02-12 05:37:07 +0000362 *)
363 AC_MSG_RESULT([no ("$host_cpu")])
DRC83f21442010-06-10 18:52:41 +0000364 AC_MSG_WARN([SIMD support not available for this CPU. Performance will suffer.])
365 with_simd=no;
DRC60cddeb2010-02-12 05:37:07 +0000366 ;;
367 esac
Pierre Ossmanba82ddf2009-06-29 11:20:42 +0000368
DRC60cddeb2010-02-12 05:37:07 +0000369 if test "x${with_simd}" != "xno"; then
370 AC_DEFINE([WITH_SIMD], [1], [Use accelerated SIMD routines.])
371 fi
DRC6da61db2013-01-19 01:06:46 +0000372else
373 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-simd"
DRC60cddeb2010-02-12 05:37:07 +0000374fi
DRC411dcf52010-02-12 04:28:29 +0000375
DRC60cddeb2010-02-12 05:37:07 +0000376AM_CONDITIONAL([WITH_SIMD], [test "x$with_simd" != "xno"])
DRC321e0682011-05-03 08:47:43 +0000377AM_CONDITIONAL([WITH_SSE_FLOAT_DCT], [test "x$simd_arch" = "xx86_64" -o "x$simd_arch" = "xi386"])
Pierre Ossmanba82ddf2009-06-29 11:20:42 +0000378AM_CONDITIONAL([SIMD_I386], [test "x$simd_arch" = "xi386"])
379AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"])
DRC321e0682011-05-03 08:47:43 +0000380AM_CONDITIONAL([SIMD_ARM], [test "x$simd_arch" = "xarm"])
DRC49597872010-05-17 20:47:57 +0000381AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd64"])
DRC211d1e72013-01-13 11:25:20 +0000382AM_CONDITIONAL([WITH_TURBOJPEG], [test "x$with_turbojpeg" != "xno"])
Pierre Ossman59a39382009-03-09 13:15:56 +0000383
DRC079b4342010-02-15 11:32:23 +0000384case "$host_cpu" in
385 x86_64)
386 RPMARCH=x86_64
DRC52a19f22010-02-15 12:06:27 +0000387 DEBARCH=amd64
DRC079b4342010-02-15 11:32:23 +0000388 ;;
389 i*86 | x86 | ia32)
390 RPMARCH=i386
DRC52a19f22010-02-15 12:06:27 +0000391 DEBARCH=i386
DRC079b4342010-02-15 11:32:23 +0000392 ;;
393esac
394
395AC_SUBST(RPMARCH)
DRC6da61db2013-01-19 01:06:46 +0000396AC_SUBST(RPM_CONFIG_ARGS)
DRC52a19f22010-02-15 12:06:27 +0000397AC_SUBST(DEBARCH)
DRC079b4342010-02-15 11:32:23 +0000398AC_SUBST(BUILD)
DRC2cdd2ae2010-10-10 06:54:21 +0000399AC_DEFINE_UNQUOTED([BUILD], "$BUILD", [Build number])
DRC079b4342010-02-15 11:32:23 +0000400
Pierre Ossmanba0ce392009-03-06 15:30:42 +0000401# jconfig.h is the file we use, but we have another before that to
402# fool autoheader. the reason is that we include this header in our
403# API headers, which can screw things up for users of the lib.
404# jconfig.h is a minimal version that allows this package to be built
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +0000405AC_CONFIG_HEADERS([config.h])
406AC_CONFIG_HEADERS([jconfig.h])
DRCb94f2de2011-03-22 09:31:25 +0000407AC_CONFIG_FILES([pkgscripts/libjpeg-turbo.spec:release/libjpeg-turbo.spec.in])
408AC_CONFIG_FILES([pkgscripts/makecygwinpkg:release/makecygwinpkg.in])
409AC_CONFIG_FILES([pkgscripts/makedpkg:release/makedpkg.in])
DRCb94f2de2011-03-22 09:31:25 +0000410AC_CONFIG_FILES([pkgscripts/makemacpkg:release/makemacpkg.in])
411AC_CONFIG_FILES([pkgscripts/Description.plist:release/Description.plist.in])
412AC_CONFIG_FILES([pkgscripts/Info.plist:release/Info.plist.in])
413AC_CONFIG_FILES([pkgscripts/uninstall:release/uninstall.in])
DRC211d1e72013-01-13 11:25:20 +0000414if test "x$with_turbojpeg" != "xno"; then
DRCcb6157b2012-01-31 11:38:13 +0000415AC_CONFIG_FILES([tjbenchtest])
DRC211d1e72013-01-13 11:25:20 +0000416fi
417if test "x$with_java" = "xyes"; then
DRCfac3bea2012-09-24 02:27:55 +0000418AC_CONFIG_FILES([tjbenchtest.java])
DRCcb6157b2012-01-31 11:38:13 +0000419AC_CONFIG_FILES([tjexampletest])
DRC211d1e72013-01-13 11:25:20 +0000420fi
DRC8515d3d2010-10-19 06:38:57 +0000421AC_CONFIG_FILES([libjpeg.map])
Pierre Ossman3a65ef42009-03-16 13:34:18 +0000422AC_CONFIG_FILES([Makefile simd/Makefile])
DRCdffd53d2011-04-01 00:37:20 +0000423AC_CONFIG_FILES([java/Makefile])
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +0000424AC_OUTPUT