Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: configure.ac

Issue 1953443002: Update to libjpeg_turbo 1.4.90 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « config.h ('k') | djpeg.1 » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.56])
5 AC_INIT([libjpeg-turbo], [1.4.90])
6
7 AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
8 AC_PREFIX_DEFAULT(/opt/libjpeg-turbo)
9
10 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11
12 # Checks for programs.
13 SAVED_CFLAGS=${CFLAGS}
14 SAVED_CPPFLAGS=${CPPFLAGS}
15 AC_PROG_CPP
16 AC_PROG_CC
17 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
18 AM_PROG_AS
19 AM_PROG_CC_C_O
20 AC_PROG_INSTALL
21 AC_PROG_LIBTOOL
22 AC_PROG_LN_S
23
24 AC_ARG_WITH([build-date], [Use custom build string to enable reproducible builds (default: YYMMDD)],
25 [BUILD="$with_build_date"],
26 [BUILD=`date +%Y%m%d`])
27
28 PKG_PROG_PKG_CONFIG
29
30 # When the prefix is /opt/libjpeg-turbo, we assume that an "official" binary is
31 # being created, and thus we install things into specific locations.
32
33 old_prefix=${prefix}
34 if test "x$prefix" = "xNONE" -a "x$ac_default_prefix" != "x"; then
35 prefix=$ac_default_prefix
36 fi
37 DATADIR=`eval echo ${datadir}`
38 DATADIR=`eval echo $DATADIR`
39 if test "$DATADIR" = "/opt/libjpeg-turbo/share"; then
40 datadir='${prefix}'
41 fi
42 DATADIR=`eval echo ${datarootdir}`
43 DATADIR=`eval echo $DATADIR`
44 if test "$DATADIR" = "/opt/libjpeg-turbo/share"; then
45 datarootdir='${prefix}'
46 fi
47 DOCDIR=`eval echo ${docdir}`
48 DOCDIR=`eval echo $DOCDIR`
49 if test "$DOCDIR" = "/opt/libjpeg-turbo/doc/libjpeg-turbo"; then
50 docdir='${datadir}/doc'
51 fi
52
53 old_exec_prefix=${exec_prefix}
54 if test "x$exec_prefix" = "xNONE"; then
55 exec_prefix=${prefix}
56 fi
57
58 AC_CHECK_SIZEOF(size_t)
59
60 if test "x${libdir}" = 'x${exec_prefix}/lib' -o "x${libdir}" = 'x${prefix}/lib'; then
61 LIBDIR=`eval echo ${libdir}`
62 LIBDIR=`eval echo $LIBDIR`
63 if test "$LIBDIR" = "/opt/libjpeg-turbo/lib"; then
64 case $host_os in
65 darwin*)
66 ;;
67 *)
68 if test "${ac_cv_sizeof_size_t}" = "8"; then
69 libdir='${exec_prefix}/lib64'
70 elif test "${ac_cv_sizeof_size_t}" = "4"; then
71 libdir='${exec_prefix}/lib32'
72 fi
73 ;;
74 esac
75 fi
76 fi
77 exec_prefix=${old_exec_prefix}
78 prefix=${old_prefix}
79
80 # Check whether compiler supports pointers to undefined structures
81 AC_MSG_CHECKING(whether compiler supports pointers to undefined structures)
82 AC_TRY_COMPILE([ typedef struct undefined_structure *undef_struct_ptr; ], ,
83 AC_MSG_RESULT(yes),
84 [AC_MSG_RESULT(no)
85 AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],
86 [Compiler does not support pointers to undefined structures.])])
87
88 if test "x${GCC}" = "xyes"; then
89 if test "x${SAVED_CFLAGS}" = "x"; then
90 CFLAGS=-O3
91 fi
92 if test "x${SAVED_CPPFLAGS}" = "x"; then
93 CPPFLAGS=-Wall
94 fi
95 fi
96
97 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
98 if test "x${SUNCC}" = "xyes"; then
99 if test "x${SAVED_CFLAGS}" = "x"; then
100 CFLAGS=-xO5
101 fi
102 fi
103
104 # Checks for libraries.
105
106 # Checks for header files.
107 AC_HEADER_STDC
108 AC_CHECK_HEADERS([stddef.h stdlib.h locale.h string.h])
109 AC_CHECK_HEADER([sys/types.h],
110 AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you need to include <sys/types.h> to get size_t.]))
111
112 # Checks for typedefs, structures, and compiler characteristics.
113 AC_C_CONST
114 AC_C_CHAR_UNSIGNED
115 AC_C_INLINE
116 AC_TYPE_SIZE_T
117 AC_CHECK_TYPES([unsigned char, unsigned short])
118
119 AC_MSG_CHECKING([if right shift is signed])
120 AC_TRY_RUN(
121 [#include <stdio.h>
122 int is_shifting_signed (long arg) {
123 long res = arg >> 4;
124
125 if (res == -0x7F7E80CL)
126 return 1; /* right shift is signed */
127
128 /* see if unsigned-shift hack will fix it. */
129 /* we can't just test exact value since it depends on width of long... */
130 res |= (~0L) << (32-4);
131 if (res == -0x7F7E80CL)
132 return 0; /* right shift is unsigned */
133
134 printf("Right shift isn't acting as I expect it to.\n");
135 printf("I fear the JPEG software will not work at all.\n\n");
136 return 0; /* try it with unsigned anyway */
137 }
138 int main (void) {
139 exit(is_shifting_signed(-0x7F7E80B1L));
140 }],
141 [AC_MSG_RESULT(no)
142 AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1,
143 [Define if your (broken) compiler shifts signed values as if they were unsi gned.])],
144 [AC_MSG_RESULT(yes)],
145 [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
146
147 # Checks for library functions.
148 AC_CHECK_FUNCS([memset memcpy], [],
149 [AC_DEFINE([NEED_BSD_STRINGS], 1,
150 [Define if you have BSD-like bzero and bcopy in <strings.h> rather than mem set/memcpy in <string.h>.])])
151
152 AC_MSG_CHECKING([libjpeg API version])
153 AC_ARG_VAR(JPEG_LIB_VERSION, [libjpeg API version (62, 70, or 80)])
154 if test "x$JPEG_LIB_VERSION" = "x"; then
155 AC_ARG_WITH([jpeg7],
156 AC_HELP_STRING([--with-jpeg7],
157 [Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatibl e with libjpeg v6b.)]))
158 AC_ARG_WITH([jpeg8],
159 AC_HELP_STRING([--with-jpeg8],
160 [Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatibl e with libjpeg v6b.)]))
161 if test "x${with_jpeg8}" = "xyes"; then
162 JPEG_LIB_VERSION=80
163 else
164 if test "x${with_jpeg7}" = "xyes"; then
165 JPEG_LIB_VERSION=70
166 else
167 JPEG_LIB_VERSION=62
168 fi
169 fi
170 fi
171 JPEG_LIB_VERSION_DECIMAL=`expr $JPEG_LIB_VERSION / 10`.`expr $JPEG_LIB_VERSION % 10`
172 AC_SUBST(JPEG_LIB_VERSION_DECIMAL)
173 AC_MSG_RESULT([$JPEG_LIB_VERSION_DECIMAL])
174 AC_DEFINE_UNQUOTED(JPEG_LIB_VERSION, [$JPEG_LIB_VERSION],
175 [libjpeg API version])
176
177 AC_ARG_VAR(SO_MAJOR_VERSION,
178 [Major version of the libjpeg-turbo shared library (default is determined by t he API version)])
179 AC_ARG_VAR(SO_MINOR_VERSION,
180 [Minor version of the libjpeg-turbo shared library (default is determined by t he API version)])
181 if test "x$SO_MAJOR_VERSION" = "x"; then
182 case "$JPEG_LIB_VERSION" in
183 62) SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;
184 *) SO_MAJOR_VERSION=`expr $JPEG_LIB_VERSION / 10` ;;
185 esac
186 fi
187 if test "x$SO_MINOR_VERSION" = "x"; then
188 case "$JPEG_LIB_VERSION" in
189 80) SO_MINOR_VERSION=2 ;;
190 *) SO_MINOR_VERSION=0 ;;
191 esac
192 fi
193
194 RPM_CONFIG_ARGS=
195
196 # Memory source/destination managers
197 SO_AGE=1
198 MEM_SRCDST_FUNCTIONS=
199 if test "x${with_jpeg8}" != "xyes"; then
200 AC_MSG_CHECKING([whether to include in-memory source/destination managers])
201 AC_ARG_WITH([mem-srcdst],
202 AC_HELP_STRING([--without-mem-srcdst],
203 [Do not include in-memory source/destination manager functions when emulat ing the libjpeg v6b or v7 API/ABI]))
204 if test "x$with_mem_srcdst" != "xno"; then
205 AC_MSG_RESULT(yes)
206 AC_DEFINE([MEM_SRCDST_SUPPORTED], [1],
207 [Support in-memory source/destination managers])
208 SO_AGE=2
209 MEM_SRCDST_FUNCTIONS="global: jpeg_mem_dest; jpeg_mem_src;";
210 else
211 AC_MSG_RESULT(no)
212 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-mem-srcdst"
213 fi
214 fi
215
216 AC_MSG_CHECKING([libjpeg shared library version])
217 AC_MSG_RESULT([$SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION])
218 LIBTOOL_CURRENT=`expr $SO_MAJOR_VERSION + $SO_AGE`
219 AC_SUBST(LIBTOOL_CURRENT)
220 AC_SUBST(SO_MAJOR_VERSION)
221 AC_SUBST(SO_MINOR_VERSION)
222 AC_SUBST(SO_AGE)
223 AC_SUBST(MEM_SRCDST_FUNCTIONS)
224
225 AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION, [$VERSION], [libjpeg-turbo version])
226
227 VERSION_SCRIPT=yes
228 AC_ARG_ENABLE([ld-version-script],
229 AS_HELP_STRING([--disable-ld-version-script],
230 [Disable linker version script for libjpeg-turbo (default is to use linker v ersion script if the linker supports it)]),
231 [VERSION_SCRIPT=$enableval], [])
232
233 AC_MSG_CHECKING([whether the linker supports version scripts])
234 SAVED_LDFLAGS="$LDFLAGS"
235 LDFLAGS="$LDFLAGS -Wl,--version-script,conftest.map"
236 cat > conftest.map <<EOF
237 VERS_1 {
238 global: *;
239 };
240 EOF
241 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
242 [VERSION_SCRIPT_FLAG=-Wl,--version-script,;
243 AC_MSG_RESULT([yes (GNU style)])],
244 [])
245 if test "x$VERSION_SCRIPT_FLAG" = "x"; then
246 LDFLAGS="$SAVED_LDFLAGS -Wl,-M,conftest.map"
247 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
248 [VERSION_SCRIPT_FLAG=-Wl,-M,;
249 AC_MSG_RESULT([yes (Sun style)])],
250 [])
251 fi
252 if test "x$VERSION_SCRIPT_FLAG" = "x"; then
253 VERSION_SCRIPT=no
254 AC_MSG_RESULT(no)
255 fi
256 LDFLAGS="$SAVED_LDFLAGS"
257
258 AC_MSG_CHECKING([whether to use version script when building libjpeg-turbo])
259 AC_MSG_RESULT($VERSION_SCRIPT)
260
261 AM_CONDITIONAL(VERSION_SCRIPT, test "x$VERSION_SCRIPT" = "xyes")
262 AC_SUBST(VERSION_SCRIPT_FLAG)
263
264 # Check for non-broken inline under various spellings
265 AC_MSG_CHECKING(for inline)
266 ljt_cv_inline=""
267 AC_TRY_COMPILE(, [} inline __attribute__((always_inline)) int foo() { return 0; }
268 int bar() { return foo();], ljt_cv_inline="inline __attribute__((always_inline)) ",
269 AC_TRY_COMPILE(, [} __inline__ int foo() { return 0; }
270 int bar() { return foo();], ljt_cv_inline="__inline__",
271 AC_TRY_COMPILE(, [} __inline int foo() { return 0; }
272 int bar() { return foo();], ljt_cv_inline="__inline",
273 AC_TRY_COMPILE(, [} inline int foo() { return 0; }
274 int bar() { return foo();], ljt_cv_inline="inline"))))
275 AC_MSG_RESULT($ljt_cv_inline)
276 AC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])
277
278 # Arithmetic coding support
279 AC_MSG_CHECKING([whether to include arithmetic encoding support])
280 AC_ARG_WITH([arith-enc],
281 AC_HELP_STRING([--without-arith-enc],
282 [Do not include arithmetic encoding support]))
283 if test "x$with_12bit" = "xyes"; then
284 with_arith_enc=no
285 fi
286 if test "x$with_arith_enc" = "xno"; then
287 AC_MSG_RESULT(no)
288 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-enc"
289 else
290 AC_DEFINE([C_ARITH_CODING_SUPPORTED], [1], [Support arithmetic encoding])
291 AC_MSG_RESULT(yes)
292 fi
293 AM_CONDITIONAL([WITH_ARITH_ENC], [test "x$with_arith_enc" != "xno"])
294
295 AC_MSG_CHECKING([whether to include arithmetic decoding support])
296 AC_ARG_WITH([arith-dec],
297 AC_HELP_STRING([--without-arith-dec],
298 [Do not include arithmetic decoding support]))
299 if test "x$with_12bit" = "xyes"; then
300 with_arith_dec=no
301 fi
302 if test "x$with_arith_dec" = "xno"; then
303 AC_MSG_RESULT(no)
304 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-dec"
305 else
306 AC_DEFINE([D_ARITH_CODING_SUPPORTED], [1], [Support arithmetic decoding])
307 AC_MSG_RESULT(yes)
308 fi
309 AM_CONDITIONAL([WITH_ARITH_DEC], [test "x$with_arith_dec" != "xno"])
310
311 AM_CONDITIONAL([WITH_ARITH],
312 [test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
313
314 # 12-bit component support
315 AC_MSG_CHECKING([whether to use 12-bit samples])
316 AC_ARG_WITH([12bit],
317 AC_HELP_STRING([--with-12bit], [Encode/decode JPEG images with 12-bit samples (implies --without-simd --without-turbojpeg --without-arith-dec --without-arith- enc)]))
318 if test "x$with_12bit" = "xyes"; then
319 AC_DEFINE([BITS_IN_JSAMPLE], [12], [use 8 or 12])
320 AC_MSG_RESULT(yes)
321 else
322 AC_MSG_RESULT(no)
323 fi
324 AM_CONDITIONAL([WITH_12BIT], [test "x$with_12bit" = "xyes"])
325
326 # TurboJPEG support
327 AC_MSG_CHECKING([whether to build TurboJPEG C wrapper])
328 AC_ARG_WITH([turbojpeg],
329 AC_HELP_STRING([--without-turbojpeg],
330 [Do not include the TurboJPEG wrapper library and associated test programs]) )
331 if test "x$with_12bit" = "xyes"; then
332 with_turbojpeg=no
333 fi
334 if test "x$with_turbojpeg" = "xno"; then
335 AC_MSG_RESULT(no)
336 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-turbojpeg"
337 else
338 AC_MSG_RESULT(yes)
339 fi
340
341 # Java support
342 AC_ARG_VAR(JAVAC, [Java compiler command (default: javac)])
343 if test "x$JAVAC" = "x"; then
344 JAVAC=javac
345 fi
346 AC_SUBST(JAVAC)
347 AC_ARG_VAR(JAVACFLAGS, [Java compiler flags])
348 AC_SUBST(JAVACFLAGS)
349 AC_ARG_VAR(JAR, [Java archive command (default: jar)])
350 if test "x$JAR" = "x"; then
351 JAR=jar
352 fi
353 AC_SUBST(JAR)
354 AC_ARG_VAR(JAVA, [Java runtime command (default: java)])
355 if test "x$JAVA" = "x"; then
356 JAVA=java
357 fi
358 AC_SUBST(JAVA)
359 AC_ARG_VAR(JNI_CFLAGS,
360 [C compiler flags needed to include jni.h (default: -I/System/Library/Framewor ks/JavaVM.framework/Headers on OS X, '-I/usr/java/include -I/usr/java/include/so laris' on Solaris, and '-I/usr/java/default/include -I/usr/java/default/include/ linux' on Linux)])
361
362 AC_MSG_CHECKING([whether to build TurboJPEG Java wrapper])
363 AC_ARG_WITH([java],
364 AC_HELP_STRING([--with-java], [Build Java wrapper for the TurboJPEG library]))
365 if test "x$with_12bit" = "xyes" -o "x$with_turbojpeg" = "xno"; then
366 with_java=no
367 fi
368
369 WITH_JAVA=0
370 if test "x$with_java" = "xyes"; then
371 AC_MSG_RESULT(yes)
372
373 case $host_os in
374 darwin*)
375 DEFAULT_JNI_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
376 ;;
377 solaris*)
378 DEFAULT_JNI_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'
379 ;;
380 linux*)
381 DEFAULT_JNI_CFLAGS='-I/usr/java/default/include -I/usr/java/default/includ e/linux'
382 ;;
383 esac
384 if test "x$JNI_CFLAGS" = "x"; then
385 JNI_CFLAGS=$DEFAULT_JNI_CFLAGS
386 fi
387
388 SAVE_CPPFLAGS=${CPPFLAGS}
389 CPPFLAGS="${CPPFLAGS} ${JNI_CFLAGS}"
390 AC_CHECK_HEADERS([jni.h], [DUMMY=1],
391 [AC_MSG_ERROR([Could not find JNI header file])])
392 CPPFLAGS=${SAVE_CPPFLAGS}
393 AC_SUBST(JNI_CFLAGS)
394
395 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --with-java"
396 JAVA_RPM_CONTENTS_1='%dir %{_datadir}/classes'
397 JAVA_RPM_CONTENTS_2=%{_datadir}/classes/turbojpeg.jar
398 WITH_JAVA=1
399 else
400 AC_MSG_RESULT(no)
401 fi
402 AM_CONDITIONAL([WITH_JAVA], [test "x$with_java" = "xyes"])
403 AC_SUBST(WITH_JAVA)
404 AC_SUBST(JAVA_RPM_CONTENTS_1)
405 AC_SUBST(JAVA_RPM_CONTENTS_2)
406
407 # optionally force using gas-preprocessor.pl for compatibility testing
408 AC_ARG_WITH([gas-preprocessor],
409 AC_HELP_STRING([--with-gas-preprocessor],
410 [Force using gas-preprocessor.pl on ARM.]))
411 if test "x${with_gas_preprocessor}" = "xyes"; then
412 case $host_os in
413 darwin*)
414 CCAS="gas-preprocessor.pl -fix-unreq $CC"
415 ;;
416 *)
417 CCAS="gas-preprocessor.pl -no-fix-unreq $CC"
418 ;;
419 esac
420 AC_SUBST([CCAS])
421 fi
422
423 # SIMD is optional
424 AC_ARG_WITH([simd],
425 AC_HELP_STRING([--without-simd], [Do not include SIMD extensions]))
426 if test "x$with_12bit" = "xyes"; then
427 with_simd=no
428 fi
429 if test "x${with_simd}" != "xno"; then
430 require_simd=no
431 if test "x${with_simd}" = "xyes"; then
432 require_simd=yes
433 fi
434 # Check if we're on a supported CPU
435 AC_MSG_CHECKING([if we have SIMD optimisations for cpu type])
436 case "$host_cpu" in
437 x86_64 | amd64)
438 AC_MSG_RESULT([yes (x86_64)])
439 AC_PROG_NASM
440 simd_arch=x86_64
441 ;;
442 i*86 | x86 | ia32)
443 AC_MSG_RESULT([yes (i386)])
444 AC_PROG_NASM
445 simd_arch=i386
446 ;;
447 arm*)
448 AC_MSG_RESULT([yes (arm)])
449 AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
450 AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE(
451 [if test "x$ac_use_gas_preprocessor" = "xyes"; then
452 AC_MSG_RESULT([yes (with gas-preprocessor)])
453 else
454 AC_MSG_RESULT([yes])
455 fi
456 simd_arch=arm],
457 [AC_MSG_RESULT([no])
458 with_simd=no])
459 if test "x${with_simd}" = "xno"; then
460 if test "x${require_simd}" = "xyes"; then
461 AC_MSG_ERROR([SIMD support can't be enabled.])
462 else
463 AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.] )
464 fi
465 fi
466 ;;
467 aarch64*)
468 AC_MSG_RESULT([yes (arm64)])
469 AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
470 AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE(
471 [if test "x$ac_use_gas_preprocessor" = "xyes"; then
472 AC_MSG_RESULT([yes (with gas-preprocessor)])
473 else
474 AC_MSG_RESULT([yes])
475 fi
476 simd_arch=aarch64],
477 [AC_MSG_RESULT([no])
478 with_simd=no])
479 if test "x${with_simd}" = "xno"; then
480 if test "x${require_simd}" = "xyes"; then
481 AC_MSG_ERROR([SIMD support can't be enabled.])
482 else
483 AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.] )
484 fi
485 fi
486 ;;
487 mips*)
488 AC_MSG_RESULT([yes (mips)])
489 AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])
490 AC_CHECK_COMPATIBLE_MIPS_ASSEMBLER_IFELSE(
491 [AC_MSG_RESULT([yes])
492 simd_arch=mips],
493 [AC_MSG_RESULT([no])
494 with_simd=no])
495 if test "x${with_simd}" = "xno"; then
496 if test "x${require_simd}" = "xyes"; then
497 AC_MSG_ERROR([SIMD support can't be enabled.])
498 else
499 AC_MSG_WARN([SIMD support can't be enabled. Performance will suffer.] )
500 fi
501 fi
502 ;;
503 powerpc*)
504 AC_MSG_RESULT([yes (powerpc)])
505 simd_arch=powerpc
506 ;;
507 *)
508 AC_MSG_RESULT([no ("$host_cpu")])
509 with_simd=no;
510 if test "x${require_simd}" = "xyes"; then
511 AC_MSG_ERROR([SIMD support not available for this CPU.])
512 else
513 AC_MSG_WARN([SIMD support not available for this CPU. Performance will suffer.])
514 fi
515 ;;
516 esac
517
518 if test "x${with_simd}" != "xno"; then
519 AC_DEFINE([WITH_SIMD], [1], [Use accelerated SIMD routines.])
520 fi
521 else
522 RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-simd"
523 fi
524
525 AM_CONDITIONAL([WITH_SIMD], [test "x$with_simd" != "xno"])
526 AM_CONDITIONAL([WITH_SSE_FLOAT_DCT], [test "x$simd_arch" = "xx86_64" -o "x$simd_ arch" = "xi386"])
527 AM_CONDITIONAL([SIMD_I386], [test "x$simd_arch" = "xi386"])
528 AM_CONDITIONAL([SIMD_X86_64], [test "x$simd_arch" = "xx86_64"])
529 AM_CONDITIONAL([SIMD_ARM], [test "x$simd_arch" = "xarm"])
530 AM_CONDITIONAL([SIMD_ARM_64], [test "x$simd_arch" = "xaarch64"])
531 AM_CONDITIONAL([SIMD_MIPS], [test "x$simd_arch" = "xmips"])
532 AM_CONDITIONAL([SIMD_POWERPC], [test "x$simd_arch" = "xpowerpc"])
533 AM_CONDITIONAL([X86_64], [test "x$host_cpu" = "xx86_64" -o "x$host_cpu" = "xamd6 4"])
534 AM_CONDITIONAL([WITH_TURBOJPEG], [test "x$with_turbojpeg" != "xno"])
535 AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"])
536
537 AC_ARG_VAR(PKGNAME, [distribution package name (default: libjpeg-turbo)])
538 if test "x$PKGNAME" = "x"; then
539 PKGNAME=$PACKAGE_NAME
540 fi
541 AC_SUBST(PKGNAME)
542
543 case "$host_cpu" in
544 x86_64)
545 RPMARCH=x86_64
546 DEBARCH=amd64
547 ;;
548 i*86 | x86 | ia32)
549 RPMARCH=i386
550 DEBARCH=i386
551 ;;
552 *)
553 RPMARCH=`uname -m`
554 DEBARCH=$RPMARCH
555 ;;
556 esac
557
558 if test "${docdir}" = ""; then
559 docdir=${datadir}/doc
560 AC_SUBST(docdir)
561 fi
562
563 AC_SUBST(RPMARCH)
564 AC_SUBST(RPM_CONFIG_ARGS)
565 AC_SUBST(DEBARCH)
566 AC_SUBST(BUILD)
567 AC_DEFINE_UNQUOTED([BUILD], "$BUILD", [libjpeg-turbo build number])
568
569 # NOTE: autoheader automatically modifies the input file of the first
570 # invocation of AC_CONFIG_HEADERS, so we put config.h first to prevent
571 # jconfig.h.in from being clobbered. config.h is used only internally, whereas
572 # jconfig.h contains macros that are relevant to external programs (macros that
573 # specify which features were built into the library.)
574 AC_CONFIG_HEADERS([config.h])
575 AC_CONFIG_HEADERS([jconfig.h])
576 AC_CONFIG_HEADERS([jconfigint.h])
577 AC_CONFIG_FILES([pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.i n])
578 AC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in])
579 AC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in])
580 AC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in])
581 AC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in])
582 AC_CONFIG_FILES([pkgscripts/libjpeg.pc:release/libjpeg.pc.in])
583 AC_CONFIG_FILES([pkgscripts/libturbojpeg.pc:release/libturbojpeg.pc.in])
584 if test "x$with_turbojpeg" != "xno"; then
585 AC_CONFIG_FILES([tjbenchtest])
586 fi
587 if test "x$with_java" = "xyes"; then
588 AC_CONFIG_FILES([tjbenchtest.java])
589 AC_CONFIG_FILES([tjexampletest])
590 fi
591 AC_CONFIG_FILES([libjpeg.map])
592 AC_CONFIG_FILES([Makefile simd/Makefile])
593 AC_CONFIG_FILES([java/Makefile])
594 AC_CONFIG_FILES([md5/Makefile])
595 AC_OUTPUT
OLDNEW
« no previous file with comments | « config.h ('k') | djpeg.1 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698