diff options
Diffstat (limited to '3rdparty/libjpeg/configure.ac')
| -rw-r--r-- | 3rdparty/libjpeg/configure.ac | 231 |
1 files changed, 139 insertions, 92 deletions
diff --git a/3rdparty/libjpeg/configure.ac b/3rdparty/libjpeg/configure.ac index e2c377416a2..e06ff34faeb 100644 --- a/3rdparty/libjpeg/configure.ac +++ b/3rdparty/libjpeg/configure.ac @@ -5,7 +5,7 @@ # Configure script for IJG libjpeg # -AC_INIT([libjpeg], [8.3.0]) +AC_INIT([libjpeg], [9.2.0]) # Directory where autotools helper scripts lives. AC_CONFIG_AUX_DIR([.]) @@ -21,16 +21,13 @@ AC_CANONICAL_TARGET # Initialize Automake # Don't require all the GNU mandated files -AM_INIT_AUTOMAKE([-Wall -Werror ansi2knr no-dist foreign]) +AM_INIT_AUTOMAKE([-Wall -Werror no-dist foreign]) # Make --enable-silent-rules the default. # To get verbose build output you may configure # with --disable-silent-rules or use "make V=1". AM_SILENT_RULES([yes]) -# This is required when using the de-ANSI-fication feature. -AM_C_PROTOTYPES - # Add configure option --enable-maintainer-mode which enables # dependency checking and generation useful to package maintainers. # This is made an option to avoid confusing end users. @@ -43,6 +40,7 @@ AC_PROG_CPP AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LN_S +AM_PROG_AR # Check if LD supports linker scripts, # and define automake conditional HAVE_LD_VERSION_SCRIPT if so. @@ -72,9 +70,9 @@ fi AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") # See if compiler supports prototypes. -AC_MSG_CHECKING(for function prototypes) -AC_CACHE_VAL(ijg_cv_have_prototypes, -[AC_TRY_COMPILE([ +AC_MSG_CHECKING([for function prototypes]) +AC_CACHE_VAL([ijg_cv_have_prototypes], +[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ int testfunction (int arg1, int * arg2); /* check prototypes */ struct methods_struct { /* check method-pointer declarations */ int (*error_exit) (char *msgtext); @@ -85,25 +83,29 @@ int testfunction (int arg1, int * arg2) /* check definitions */ { return arg2[arg1]; } int test2function (void) /* check void arg list */ { return 0; } -], [ ], ijg_cv_have_prototypes=yes, ijg_cv_have_prototypes=no)]) -AC_MSG_RESULT($ijg_cv_have_prototypes) +]])], + [ijg_cv_have_prototypes=yes], + [ijg_cv_have_prototypes=no])]) +AC_MSG_RESULT([$ijg_cv_have_prototypes]) if test $ijg_cv_have_prototypes = yes; then AC_DEFINE([HAVE_PROTOTYPES],[1],[Compiler supports function prototypes.]) else - echo Your compiler does not seem to know about function prototypes. - echo Perhaps it needs a special switch to enable ANSI C mode. - echo If so, we recommend running configure like this: - echo " ./configure CC='cc -switch'" - echo where -switch is the proper switch. + AC_MSG_WARN([Your compiler does not seem to know about function prototypes. + Perhaps it needs a special switch to enable ANSI C mode. + If so, we recommend running configure like this: + ./configure CC='cc -switch' + where -switch is the proper switch.]) fi # Check header files -AC_CHECK_HEADERS(stddef.h stdlib.h locale.h) -AC_CHECK_HEADER(string.h, , AC_DEFINE([NEED_BSD_STRINGS],[1],[Compiler has <strings.h> rather than standard <string.h>.])) +AC_CHECK_HEADERS([stddef.h stdlib.h locale.h]) +AC_CHECK_HEADER([string.h], [], + [AC_DEFINE([NEED_BSD_STRINGS], [1], + [Compiler has <strings.h> rather than standard <string.h>.])]) # See whether type size_t is defined in any ANSI-standard places; # if not, perhaps it is defined in <sys/types.h>. -AC_MSG_CHECKING(for size_t) +AC_MSG_CHECKING([for size_t]) AC_TRY_COMPILE([ #ifdef HAVE_STDDEF_H #include <stddef.h> @@ -118,33 +120,42 @@ AC_TRY_COMPILE([ #include <string.h> #endif typedef size_t my_size_t; -], [ my_size_t foovar; ], ijg_size_t_ok=yes, -[ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"]) -AC_MSG_RESULT($ijg_size_t_ok) +], + [ my_size_t foovar; ], + [ijg_size_t_ok=yes], + [ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"]) +AC_MSG_RESULT([$ijg_size_t_ok]) if test "$ijg_size_t_ok" != yes; then -AC_CHECK_HEADER(sys/types.h, [AC_DEFINE([NEED_SYS_TYPES_H],[1],[Need to include <sys/types.h> in order to obtain size_t.]) -AC_EGREP_CPP(size_t, [#include <sys/types.h>], -[ijg_size_t_ok="size_t is in sys/types.h"], ijg_size_t_ok=no)], -ijg_size_t_ok=no) -AC_MSG_RESULT($ijg_size_t_ok) -if test "$ijg_size_t_ok" = no; then - echo Type size_t is not defined in any of the usual places. - echo Try putting '"typedef unsigned int size_t;"' in jconfig.h. -fi + AC_CHECK_HEADER([sys/types.h], + [AC_DEFINE([NEED_SYS_TYPES_H], [1], + [Need to include <sys/types.h> in order to obtain size_t.]) + AC_EGREP_CPP([size_t], [#include <sys/types.h>], + [ijg_size_t_ok="size_t is in sys/types.h"], + [ijg_size_t_ok=no])], + [ijg_size_t_ok=no]) + AC_MSG_RESULT([$ijg_size_t_ok]) + if test "$ijg_size_t_ok" = no; then + AC_MSG_WARN([Type size_t is not defined in any of the usual places. + Try putting '"typedef unsigned int size_t;"' in jconfig.h.]) + fi fi # Check compiler characteristics -AC_MSG_CHECKING(for type unsigned char) -AC_TRY_COMPILE(, [ unsigned char un_char; ], -[AC_MSG_RESULT(yes) -AC_DEFINE([HAVE_UNSIGNED_CHAR],[1],[Compiler supports 'unsigned char'.])], AC_MSG_RESULT(no)) -dnl -AC_MSG_CHECKING(for type unsigned short) -AC_TRY_COMPILE(, [ unsigned short un_short; ], -[AC_MSG_RESULT(yes) -AC_DEFINE([HAVE_UNSIGNED_SHORT],[1],[Compiler supports 'unsigned short'.])], AC_MSG_RESULT(no)) -dnl -AC_MSG_CHECKING(for type void) +AC_MSG_CHECKING([for type unsigned char]) +AC_TRY_COMPILE([], [ unsigned char un_char; ], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_UNSIGNED_CHAR], [1], + [Compiler supports 'unsigned char'.])], + [AC_MSG_RESULT(no)]) + +AC_MSG_CHECKING([for type unsigned short]) +AC_TRY_COMPILE([], [ unsigned short un_short; ], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_UNSIGNED_SHORT], [1], + [Compiler supports 'unsigned short'.])], + [AC_MSG_RESULT(no)]) + +AC_MSG_CHECKING([for type void]) AC_TRY_COMPILE([ /* Caution: a C++ compiler will insist on valid prototypes */ typedef void * void_ptr; /* check void * */ @@ -166,40 +177,56 @@ void test3function (arg1, arg2) arg1 = (void *) locptr; (*arg2) (1, 2); /* check call of fcn returning void */ } -], [ ], AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) -AC_DEFINE([void],[char],[Define 'void' as 'char' for archaic compilers that don't understand it.])]) +], [ ], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_DEFINE([void], [char], + [Define 'void' as 'char' for archaic compilers + that don't understand it.])]) AC_C_CONST # Check for non-broken inline under various spellings -AC_MSG_CHECKING(for inline) +AC_MSG_CHECKING([for inline]) ijg_cv_inline="" -AC_TRY_COMPILE(, [} __inline__ int foo() { return 0; } +AC_TRY_COMPILE([], [} __inline__ int foo() { return 0; } int bar() { return foo();], ijg_cv_inline="__inline__", -AC_TRY_COMPILE(, [} __inline int foo() { return 0; } +[AC_TRY_COMPILE(, [} __inline int foo() { return 0; } int bar() { return foo();], ijg_cv_inline="__inline", -AC_TRY_COMPILE(, [} inline int foo() { return 0; } -int bar() { return foo();], ijg_cv_inline="inline"))) +[AC_TRY_COMPILE(, [} inline int foo() { return 0; } +int bar() { return foo();], ijg_cv_inline="inline")])]) AC_MSG_RESULT($ijg_cv_inline) -AC_DEFINE_UNQUOTED([INLINE],[$ijg_cv_inline],[How to obtain function inlining.]) +AC_DEFINE_UNQUOTED([INLINE], [$ijg_cv_inline], + [How to obtain function inlining.]) # We cannot check for bogus warnings, but at least we can check for errors -AC_MSG_CHECKING(for broken incomplete types) -AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], , -AC_MSG_RESULT(ok), -[AC_MSG_RESULT(broken) -AC_DEFINE([INCOMPLETE_TYPES_BROKEN],[1],[Compiler does not support pointers to unspecified structures.])]) +AC_MSG_CHECKING([for broken incomplete types]) +AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], + [], + [AC_MSG_RESULT(ok)], + [AC_MSG_RESULT(broken) + AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1], + [Compiler does not support pointers to unspecified + structures.])]) # Test whether global names are unique to at least 15 chars -AC_MSG_CHECKING(for short external names) +AC_MSG_CHECKING([for short external names]) AC_TRY_LINK([ int possibly_duplicate_function () { return 0; } int possibly_dupli_function () { return 1; } -], [ ], AC_MSG_RESULT(ok), [AC_MSG_RESULT(short) -AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES],[1],[Linker requires that global names be unique in first 15 characters.])]) +], [], + [AC_MSG_RESULT(ok)], + [AC_MSG_RESULT(short) + AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], [1], + [Linker requires that global names be unique in + first 15 characters.])]) # Run-time checks -AC_MSG_CHECKING(to see if char is signed) +AC_MSG_CHECKING([to see if char is signed]) AC_TRY_RUN([ +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#include <stdio.h> #ifdef HAVE_PROTOTYPES int is_char_signed (int arg) #else @@ -220,13 +247,19 @@ char signed_char_check = (char) (-67); int main() { exit(is_char_signed((int) signed_char_check)); }], [AC_MSG_RESULT(no) -AC_DEFINE([CHAR_IS_UNSIGNED],[1],[Characters are unsigned])], AC_MSG_RESULT(yes), -[echo Assuming that char is signed on target machine. -echo If it is unsigned, this will be a little bit inefficient. + AC_DEFINE([CHAR_IS_UNSIGNED], [1], + [Characters are unsigned])], + [AC_MSG_RESULT(yes)], +[AC_MSG_WARN([Assuming that char is signed on target machine. + If it is unsigned, this will be a little bit inefficient.]) ]) -dnl -AC_MSG_CHECKING(to see if right shift is signed) + +AC_MSG_CHECKING([to see if right shift is signed]) AC_TRY_RUN([ +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#include <stdio.h> #ifdef HAVE_PROTOTYPES int is_shifting_signed (long arg) #else @@ -252,20 +285,29 @@ int is_shifting_signed (arg) } int main() { exit(is_shifting_signed(-0x7F7E80B1L)); -}], [AC_MSG_RESULT(no) -AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED],[1],[Broken compiler shifts signed values as an unsigned shift.])], AC_MSG_RESULT(yes), -AC_MSG_RESULT(Assuming that right shift is signed on target machine.)) -dnl -AC_MSG_CHECKING(to see if fopen accepts b spec) +}], + [AC_MSG_RESULT(no) + AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], [1], + [Broken compiler shifts signed values as an unsigned shift.])], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)]) + +AC_MSG_CHECKING([to see if fopen accepts b spec]) AC_TRY_RUN([ +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif #include <stdio.h> int main() { if (fopen("conftestdata", "wb") != NULL) exit(0); exit(1); -}], AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) -AC_DEFINE([DONT_USE_B_MODE],[1],[Don't open files in binary mode.])], -AC_MSG_RESULT(Assuming that it does.)) +}], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_DEFINE([DONT_USE_B_MODE], [1], + [Don't open files in binary mode.])], + [AC_MSG_RESULT(Assuming that it does.)]) # Configure libtool AC_LIBTOOL_WIN32_DLL @@ -275,9 +317,9 @@ AC_PROG_LIBTOOL # If no "-enable-maxmem", use jmemnobs MEMORYMGR='jmemnobs' MAXMEM="no" -AC_ARG_ENABLE(maxmem, +AC_ARG_ENABLE([maxmem], [ --enable-maxmem[=N] enable use of temp files, set max mem usage to N MB], -MAXMEM="$enableval") +[MAXMEM="$enableval"]) dnl [# support --with-maxmem for backwards compatibility with IJG V5.] dnl AC_ARG_WITH(maxmem, , MAXMEM="$withval") if test "x$MAXMEM" = xyes; then @@ -288,31 +330,36 @@ if test "x$MAXMEM" != xno; then AC_MSG_ERROR(non-numeric argument to --enable-maxmem) fi DEFAULTMAXMEM=`expr $MAXMEM \* 1048576` -AC_DEFINE_UNQUOTED([DEFAULT_MAX_MEM], [${DEFAULTMAXMEM}], [Maximum data space library will allocate.]) -AC_MSG_CHECKING([for 'tmpfile()']) -AC_TRY_LINK([#include <stdio.h>], [ FILE * tfile = tmpfile(); ], -[AC_MSG_RESULT(yes) -MEMORYMGR='jmemansi'], -[AC_MSG_RESULT(no) -dnl if tmpfile is not present, must use jmemname. -MEMORYMGR='jmemname' + AC_DEFINE_UNQUOTED([DEFAULT_MAX_MEM], [${DEFAULTMAXMEM}], + [Maximum data space library will allocate.]) + AC_MSG_CHECKING([for 'tmpfile()']) + AC_TRY_LINK([#include <stdio.h>], [ FILE * tfile = tmpfile(); ], + [AC_MSG_RESULT(yes) + MEMORYMGR='jmemansi'], + [AC_MSG_RESULT(no) + dnl if tmpfile is not present, must use jmemname. + MEMORYMGR='jmemname' -# Test for the need to remove temporary files using a signal handler (for cjpeg/djpeg) -AC_DEFINE([NEED_SIGNAL_CATCHER],[1],[Need signal handler to clean up temporary files.]) -AC_MSG_CHECKING([for 'mktemp()']) -AC_TRY_LINK(, [ char fname[80]; mktemp(fname); ], AC_MSG_RESULT(yes), -[AC_MSG_RESULT(no) -AC_DEFINE([NO_MKTEMP],[1],[The mktemp() function is not available.])])]) + # Test for the need to remove temporary files using a signal handler + # (for cjpeg/djpeg) + AC_DEFINE([NEED_SIGNAL_CATCHER], [1], + [Need signal handler to clean up temporary files.]) + AC_MSG_CHECKING([for 'mktemp()']) + AC_TRY_LINK([], [ char fname[80]; mktemp(fname); ], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_DEFINE([NO_MKTEMP], [1], + [The mktemp() function is not available.])])]) fi -AC_SUBST(MEMORYMGR) +AC_SUBST([MEMORYMGR]) # Extract the library version IDs from jpeglib.h. AC_MSG_CHECKING([libjpeg version number]) -[JPEG_LIB_VERSION_MAJOR=`sed -e '/^#define JPEG_LIB_VERSION_MAJOR/!d' -e 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' $srcdir/jpeglib.h`] -[JPEG_LIB_VERSION_MINOR=`sed -e '/^#define JPEG_LIB_VERSION_MINOR/!d' -e 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' $srcdir/jpeglib.h`] -[JPEG_LIB_VERSION="`expr $JPEG_LIB_VERSION_MAJOR + $JPEG_LIB_VERSION_MINOR`:0:$JPEG_LIB_VERSION_MINOR"] +[major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h` +minor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`] +AC_SUBST([JPEG_LIB_VERSION], + [`expr $major + $minor`:0:$minor]) AC_MSG_RESULT([$JPEG_LIB_VERSION]) -AC_SUBST([JPEG_LIB_VERSION]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT |
