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
|
dnl $Id: d1dbddd6e1d09c4ebbce26b0bbb3f716957bea85 $
dnl
dnl Process this file with autoconf to produce a configure script.
AC_INIT(jpegoptim.c)
AC_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR(tools)
AC_CANONICAL_HOST
HOST_TYPE=$host
AC_DEFINE_UNQUOTED(HOST_TYPE,"$host")
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_ARG_WITH(libjpeg, [ --with-libjpeg=DIR libjpeg is installed in ],
[if test $withval != yes; then
jpeginfo_cv_libjpeg=$withval
fi
if test -d "${jpeginfo_cv_libjpeg}/lib"; then
LDFLAGS="-L${jpeginfo_cv_libjpeg}/lib $LDFLAGS"
CPPFLAGS="$CPPFLAGS -I${jpeginfo_cv_libjpeg}/include"
else
LDFLAGS="-L${jpeginfo_cv_libjpeg} $LDFLAGS"
CPPFLAGS="$CPPFLAGS -I${jpeginfo_cv_libjpeg}"
fi])
arith_code=0
AC_ARG_WITH(arith, [ --with-arith Enable arithmetic coding support ],
[
if test $withval == yes; then
arith_code=1
fi
])
dnl Checks for libraries.
AC_CHECK_LIB(jpeg, jpeg_read_header, ,[
echo "Cannot find libjpeg or you have too old version (v6 or later required)."
exit 1
])
dnl AC_CHECK_LIB(m, round)
AC_CHECK_LIB(m, floor)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h getopt.h string.h libgen.h math.h fcntl.h)
AC_CHECK_HEADERS(jpeglib.h,,[
echo "Cannot find jpeglib.h You need libjpeg v6 (or later)."
exit 1
])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(int)
dnl Checks for library functions.
AC_CHECK_FUNCS(getopt_long, break, [GNUGETOPT="getopt.o getopt1.o"])
AC_SUBST(GNUGETOPT)
AC_CHECK_FUNCS(mkstemps)
AC_CHECK_FUNCS(labs)
AC_CHECK_FUNCS(fileno)
AC_CHECK_FUNCS(utimensat)
AC_CHECK_MEMBERS([struct stat.st_mtim])
dnl own tests
AC_MSG_CHECKING([for broken jmorecfg.h (METHODDEF)])
AC_CACHE_VAL(jpeginfo_cv_broken_methoddef,
[AC_TRY_RUN([
#include <stdio.h>
#include <jpeglib.h>
METHODDEF(void) foo(void) { };
int main(void)
{
return 0;
}],
jpeginfo_cv_broken_methoddef=no,
jpeginfo_cv_broken_methoddef=yes,
jpeginfo_cv_broken_methoddef=no)])
if test $jpeginfo_cv_broken_methoddef = yes; then
AC_DEFINE(BROKEN_METHODDEF)
fi
AC_MSG_RESULT($jpeginfo_cv_broken_methoddef)
AC_MSG_CHECKING([Arithmetic Coding support in JPEG library])
AC_CACHE_VAL(jpegoptim_cv_arith_code_support,
[AC_TRY_RUN([
#include <stdio.h>
#include <jpeglib.h>
int main(void)
{
struct jpeg_compress_struct cinfo;
cinfo.arith_code=TRUE;
return 0;
}
],
jpegoptim_cv_arith_code_support=yes,
jpegoptim_cv_arith_code_support=no,
jpegoptim_cv_arith_code_support=no)])
if test $arith_code == 1 -a $jpegoptim_cv_arith_code_support = yes; then
arith_code_status="Enabled"
AC_DEFINE(HAVE_ARITH_CODE)
else
arith_code_status="Disabled"
fi
AC_MSG_RESULT($jpegoptim_cv_arith_code_support)
echo "Arithmetic Coding: $arith_code_status"
AC_OUTPUT(Makefile)
|