-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.in
85 lines (61 loc) · 1.79 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
dnl $Id: configure.in,v 1.1 2002/12/04 00:25:44 tjko Exp $
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(aux)
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])
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 Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h getopt.h string.h libgen.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)
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_OUTPUT(Makefile)