-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
configure.in
151 lines (122 loc) · 3.84 KB
/
configure.in
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
dnl jpegoptim
dnl
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([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 sys/wait.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_FUNCS(fork)
AC_CHECK_FUNCS(wait)
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_RUN_IFELSE([AC_LANG_SOURCE([[
#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_RUN_IFELSE([AC_LANG_SOURCE([[
#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)
AC_MSG_CHECKING([Extension settings in JPEG library])
AC_CACHE_VAL(jpegoptim_cv_extension_settings,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <jpeglib.h>
int main(void)
{
struct jpeg_compress_struct cinfo;
if (jpeg_c_int_param_supported(&cinfo, JINT_DC_SCAN_OPT_MODE))
jpeg_c_set_int_param(&cinfo, JINT_DC_SCAN_OPT_MODE, 1);
return 0;
}
]])],[jpegoptim_cv_extension_settings=yes],[jpegoptim_cv_extension_settings=no],[jpegoptim_cv_extension_settings=no])])
if test $jpegoptim_cv_extension_settings = yes; then
extension_settings_status="Present"
AC_DEFINE(HAVE_JINT_DC_SCAN_OPT_MODE)
else
extension_settings_status="Absent"
fi
AC_MSG_RESULT($jpegoptim_cv_extension_settings)
echo "--------------------------------------------------"
echo "Extension settings: $extension_settings_status"
echo "Arithmetic coding: $arith_code_status"
if test $arith_code == 0 -a "$jpegoptim_cv_arith_code_support" == "yes"; then
echo "(use --with-arith to enable Arithmetic coding support)"
fi
echo "--------------------------------------------------"
AC_CONFIG_FILES([Makefile])
AC_OUTPUT