annotate configure.in @ 6:c390daa639ce

Improved FLTK library detection at configure time.
author jcid
date Fri, 12 Oct 2007 00:19:47 +0200
parents 6ee11bf9e3ea
children 6e6700dd252f
rev   line source
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
1 dnl Process this file with aclocal, autoconf and automake.
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
2
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
3 AC_INIT(src/dillo.cc)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
4
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
5 dnl Detect the canonical host and target build environment
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
6 AC_CANONICAL_SYSTEM
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
7
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
8 AM_INIT_AUTOMAKE(dillo, f15)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
9 AM_CONFIG_HEADER(config.h)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
10
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
11 dnl Options
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
12
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
13 AC_ARG_WITH(jpeg-lib, [ --with-jpeg-lib=DIR Specify where to find libjpeg], LIBJPEG_LIBDIR=$withval)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
14 AC_ARG_WITH(jpeg-inc, [ --with-jpeg-inc=DIR Specify where to find libjpeg's headers], LIBJPEG_INCDIR=$withval)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
15
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
16 AC_ARG_ENABLE(efence, [ --enable-efence Try to compile and run with Electric Fence],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
17 , enable_efence=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
18 AC_ARG_ENABLE(gprof, [ --enable-gprof Try to compile and run with profiling enabled],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
19 , enable_gprof=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
20 AC_ARG_ENABLE(insure, [ --enable-insure Try to compile and run with Insure++],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
21 , enable_insure=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
22 AC_ARG_ENABLE(ansi, [ --enable-ansi Try to compile and run with ANSI flags],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
23 , enable_ansi=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
24 AC_ARG_ENABLE(ipv6, [ --enable-ipv6 Build with support for IPv6], , )
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
25 AC_ARG_ENABLE(rtfl, [ --enable-rtfl Build with rtfl messages], enable_rtfl=yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
26 AC_ARG_ENABLE(cookies,[ --disable-cookies Don't compile support for cookies],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
27 , enable_cookies=yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
28 AC_ARG_ENABLE(png, [ --disable-png Disable support for PNG images],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
29 enable_png=$enableval, enable_png=yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
30 AC_ARG_ENABLE(jpeg, [ --disable-jpeg Disable support for JPEG images],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
31 enable_jpeg=$enableval, enable_jpeg=yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
32 AC_ARG_ENABLE(gif, [ --disable-gif Disable support for GIF images],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
33 enable_gif=$enableval, enable_gif=yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
34 AC_ARG_ENABLE(ssl, [ --disable-ssl Disable ssl features (eg. https)],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
35 enable_ssl=$enableval, enable_ssl=yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
36 AC_ARG_ENABLE(threaded-dns,[ --disable-threaded-dns Disable the advantage of a reentrant resolver library],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
37 enable_threaded_dns=$enableval, enable_threaded_dns=yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
38
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
39 AC_PROG_CC
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
40 AC_PROG_CXX
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
41 AM_PROG_CC_STDC
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
42 AC_PROG_RANLIB
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
43 AC_PROG_CPP
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
44
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
45 dnl ----------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
46 dnl Check our char and int types
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
47 dnl ----------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
48 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
49 AC_CHECK_SIZEOF(char)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
50 AC_CHECK_SIZEOF(short)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
51 AC_CHECK_SIZEOF(long)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
52 AC_CHECK_SIZEOF(int)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
53 AC_CHECK_SIZEOF(void *)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
54
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
55 case 2 in
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
56 $ac_cv_sizeof_short) gint16=short;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
57 $ac_cv_sizeof_int) gint16=int;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
58 esac
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
59 case 4 in
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
60 $ac_cv_sizeof_short) gint32=short;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
61 $ac_cv_sizeof_int) gint32=int;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
62 $ac_cv_sizeof_long) gint32=long;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
63 esac
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
64
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
65 cat >d_size.h <<_______EOF
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
66 #ifndef __D_SIZE_H__
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
67 #define __D_SIZE_H__
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
68
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
69
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
70 #include "config.h"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
71
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
72 #if HAVE_STDINT_H == 0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
73 #include <stdint.h>
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
74 #else
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
75 typedef signed $gint16 int16_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
76 typedef unsigned $gint16 uint16_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
77 typedef signed $gint32 int32_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
78 typedef unsigned $gint32 uint32_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
79 #endif
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
80 typedef unsigned char uchar_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
81 typedef unsigned short ushort_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
82 typedef unsigned long ulong_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
83 typedef unsigned int uint_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
84 typedef int bool_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
85
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
86
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
87 #endif /* __D_SIZE_H__ */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
88 _______EOF
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
89
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
90
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
91 dnl --------------------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
92 dnl Check whether to add /usr/local or not
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
93 dnl (this is somewhat a religious problem)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
94 dnl --------------------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
95 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
96 if test "`$CPP -v < /dev/null 2>&1 | grep '/usr/local/include' 2>&1`" = ""; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
97 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
98 LDFLAGS="$LDFLAGS -L/usr/local/lib"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
99 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
100
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
101 dnl ------------------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
102 dnl Check for socket libs (AIX, Solaris)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
103 dnl ------------------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
104 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
105 AC_CHECK_FUNCS(gethostbyname,,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
106 [AC_CHECK_LIB(nsl,gethostbyname,,[AC_CHECK_LIB(socket,gethostbyname)])])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
107 AC_CHECK_FUNCS(setsockopt,,[AC_CHECK_LIB(socket,setsockopt)])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
108
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
109 dnl --------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
110 dnl Checks for socklen_t
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
111 dnl --------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
112 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
113 AC_MSG_CHECKING([for socklen_t])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
114 ac_cv_socklen_t=""
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
115 AC_TRY_COMPILE([
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
116 #include <sys/types.h>
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
117 #include <sys/socket.h>
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
118 ],[
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
119 socklen_t a=0;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
120 getsockname(0,(struct sockaddr*)0, &a);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
121 ],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
122 ac_cv_socklen_t="socklen_t",
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
123 AC_TRY_COMPILE([
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
124 #include <sys/types.h>
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
125 #include <sys/socket.h>
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
126 ],[
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
127 int a=0;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
128 getsockname(0,(struct sockaddr*)0, &a);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
129 ],
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
130 ac_cv_socklen_t="int",
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
131 ac_cv_socklen_t="size_t"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
132 )
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
133 )
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
134 AC_MSG_RESULT($ac_cv_socklen_t)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
135 if test "$ac_cv_socklen_t" != "socklen_t"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
136 AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
137 [Define the real type of socklen_t])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
138 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
139
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
140
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
141 dnl ----------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
142 dnl Test for FLTK2 library
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
143 dnl ----------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
144 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
145 dnl For debugging and to be user friendly
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
146 AC_MSG_CHECKING([FLTK2])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
147 if sh -c "fltk2-config --version" >/dev/null 2>&1
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
148 then AC_MSG_RESULT(yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
149 LIBFLTK_CXXFLAGS=`fltk2-config --cxxflags`
6
c390daa639ce Improved FLTK library detection at configure time.
jcid
parents: 0
diff changeset
150 LIBFLTK_CFLAGS=`fltk2-config --cflags`
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
151 LIBFLTK_LIBS=`fltk2-config --use-images --ldflags`
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
152 else if sh -c "fltk-config --version" >/dev/null 2>&1
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
153 then AC_MSG_RESULT(yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
154 LIBFLTK_CXXFLAGS=`fltk-config --cxxflags`
6
c390daa639ce Improved FLTK library detection at configure time.
jcid
parents: 0
diff changeset
155 LIBFLTK_CFLAGS=`fltk-config --cflags`
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
156 LIBFLTK_LIBS=`fltk-config --ldflags`
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
157 else AC_MSG_RESULT(no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
158 AC_ERROR(FLTK2 must be installed!)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
159 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
160 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
161
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
162
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
163 dnl ----------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
164 dnl Test for libjpeg
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
165 dnl ----------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
166 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
167 if test "x$enable_jpeg" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
168 AC_CHECK_HEADER(jpeglib.h, jpeg_ok=yes, jpeg_ok=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
169
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
170 if test "x$jpeg_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
171 old_libs="$LIBS"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
172 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, jpeg_ok=yes, jpeg_ok=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
173 LIBS="$old_libs"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
174 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
175
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
176 if test "x$jpeg_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
177 LIBJPEG_LIBS="-ljpeg"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
178 if test -n "$LIBJPEG_LIBDIR"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
179 LIBJPEG_LDFLAGS="-L$LIBJPEG_LIBDIR"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
180 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
181 if test -n "$LIBJPEG_INCDIR"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
182 LIBJPEG_CPPFLAGS="-I$LIBJPEG_INCDIR"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
183 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
184 else
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
185 AC_MSG_WARN([*** No libjpeg found. Disabling jpeg images.***])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
186 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
187 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
188
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
189 if test "x$jpeg_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
190 AC_DEFINE([ENABLE_JPEG], [], [Enable JPEG images])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
191 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
192
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
193 dnl ------------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
194 dnl Test for zlib (libpng uses it)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
195 dnl ------------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
196 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
197 if test "x$enable_png" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
198 AC_CHECK_HEADER(zlib.h, libz_ok=yes, libz_ok=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
199
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
200 if test "x$libz_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
201 old_libs="$LIBS"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
202 AC_CHECK_LIB(z, zlibVersion, libz_ok=yes, libz_ok=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
203 LIBS="$old_libs"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
204 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
205
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
206 if test "x$libz_ok" = xyes; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
207 LIBZ_LIBS="-lz"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
208 else
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
209 AC_MSG_WARN([*** No libz found. Disabling PNG images ***])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
210 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
211 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
212
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
213 dnl ---------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
214 dnl Test for libpng
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
215 dnl ---------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
216 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
217 if test "x$enable_png" = "xyes" && test "x$libz_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
218 AC_MSG_CHECKING([for libpng-config])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
219
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
220 dnl Check if the user hasn't set the variable $PNG_CONFIG
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
221 if test -z "$PNG_CONFIG"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
222 PNG_CONFIG=`which libpng12-config`
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
223 if test -z "$PNG_CONFIG"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
224 PNG_CONFIG=`which libpng-config`
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
225 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
226 if test -z "$PNG_CONFIG"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
227 PNG_CONFIG=`which libpng10-config`
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
228 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
229 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
230
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
231 dnl Check if the libpng-config script was found and is executable
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
232 if test -n "$PNG_CONFIG" && test -x "$PNG_CONFIG"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
233 AC_MSG_RESULT([$PNG_CONFIG])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
234 png_ok="yes"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
235 else
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
236 AC_MSG_RESULT([missing])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
237 png_ok="no"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
238 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
239
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
240 if test "x$png_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
241 dnl For debugging and to be user friendly
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
242 AC_MSG_CHECKING([for libpng version])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
243 png_version=`$PNG_CONFIG --version`
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
244 case $png_version in
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
245 1.2.*) AC_MSG_RESULT([$png_version (newer version)]) ;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
246 1.0.*) AC_MSG_RESULT([$png_version (older version)]) ;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
247 *) AC_MSG_RESULT([ERROR]) ;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
248 esac
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
249
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
250 dnl Try to use options that are supported by all libpng-config versions...
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
251 LIBPNG_CFLAGS=`$PNG_CONFIG --cflags`
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
252 LIBPNG_LIBS=`$PNG_CONFIG --ldflags`
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
253 case $png_version in
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
254 1.2.4*) LIBPNG_LIBS="$LIBPNG_LIBS `$PNG_CONFIG --libs`" ;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
255 esac
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
256 else
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
257 dnl Try to find libpng even though libpng-config wasn't found
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
258 AC_CHECK_HEADERS(png.h libpng/png.h, png_ok=yes && break, png_ok=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
259
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
260 if test "x$png_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
261 old_libs="$LIBS"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
262 AC_CHECK_LIB(png, png_check_sig, png_ok=yes, png_ok=no, $LIBZ_LIBS -lm)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
263 LIBS="$old_libs"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
264
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
265 if test "x$png_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
266 LIBPNG_LIBS="-lpng -lm"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
267 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
268 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
269
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
270 if test "x$png_ok" = "xno"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
271 AC_MSG_WARN([*** No libpng found. Disabling PNG images ***])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
272 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
273 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
274 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
275
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
276 if test "x$png_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
277 AC_DEFINE([ENABLE_PNG], [], [Enable PNG images])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
278 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
279
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
280 dnl Check if support for GIF images should be compiled in
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
281 if test "x$enable_gif" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
282 AC_DEFINE([ENABLE_GIF], [], [Enable GIF images])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
283 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
284
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
285 dnl --------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
286 dnl Test for support for SSL
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
287 dnl --------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
288 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
289 if test "x$enable_ssl" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
290 AC_CHECK_HEADER(openssl/ssl.h, ssl_ok=yes, ssl_ok=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
291
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
292 if test "x$ssl_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
293 old_libs="$LIBS"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
294 AC_CHECK_LIB(ssl, SSL_library_init, ssl_ok=yes, ssl_ok=no, -lcrypto)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
295 LIBS="$old_libs"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
296 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
297
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
298 if test "x$ssl_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
299 LIBSSL_LIBS="-lcrypto -lssl"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
300 else
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
301 AC_MSG_WARN([*** No libssl found. Disabling ssl support.***])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
302 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
303 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
304
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
305 if test "x$ssl_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
306 AC_DEFINE([ENABLE_SSL], [], [Enable SSL support])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
307 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
308
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
309
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
310 dnl ----------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
311 dnl Test for POSIX threads
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
312 dnl ----------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
313 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
314 if test -z "$LIBPTHREAD_LIBS"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
315 case $target in
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
316 *-*-linux*|*-*-solaris*)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
317 old_libs="$LIBS"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
318 AC_CHECK_LIB(pthread, pthread_create, LIBPTHREAD_LIBS="-lpthread")
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
319 LIBS="$old_libs"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
320 ;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
321
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
322 *-*-osf1*)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
323 AC_MSG_CHECKING(whether pthreads work)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
324 LIBPTHREAD_LIBS="-lpthread -lexc -ldb"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
325 AC_MSG_WARN([*** _Untested pthreads_ try setting LIBPTHREAD_LIBS manually if it doesn't work ***])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
326 ;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
327
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
328 *)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
329 AC_MSG_CHECKING(whether threads work with -pthread)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
330 LDSAVEFLAGS=$LDFLAGS
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
331 LDFLAGS="$LDFLAGS -pthread"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
332 AC_TRY_LINK_FUNC(pthread_create, pthread_ok=yes, pthread_ok=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
333 LDFLAGS=$LDSAVEFLAGS
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
334
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
335 if test "x$pthread_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
336 AC_MSG_RESULT(yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
337 LIBPTHREAD_LDFLAGS="-pthread"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
338 else
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
339 AC_MSG_RESULT(no. Now we will try some libraries.)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
340
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
341 AC_SEARCH_LIBS(pthread_create, pthread,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
342 LIBPTHREADS_LIBS="-lpthread",
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
343 AC_SEARCH_LIBS(pthread_create, pthreads,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
344 LIBPTHREADS_LIBS="-lpthreads",
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
345 AC_SEARCH_LIBS(pthread_create, c_r,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
346 LIBPTHREADS_LIBS="-lc_r", thread_ok=no)))
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
347
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
348 if test "x$thread_ok" = "xno"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
349 AC_MSG_WARN([*** No pthreads found. ***])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
350 AC_MSG_ERROR([*** Try setting LIBPTHREAD_LIBS manually to point to your pthreads library. ***])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
351 exit 1
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
352 else
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
353 AC_MSG_WARN([found a way to link threads, but it may not work...])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
354 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
355 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
356 ;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
357
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
358 esac
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
359 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
360
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
361 dnl ------------------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
362 dnl Workaround for nanosleep and solaris
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
363 dnl ------------------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
364 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
365 case $target in
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
366 *-*-solaris*)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
367 AC_MSG_CHECKING(whether SunOS has -lrt )
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
368 LDSAVEFLAGS="$LDFLAGS"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
369 LDFLAGS="$LDFLAGS -lrt"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
370 AC_TRY_LINK_FUNC(nanosleep, rt_ok=yes, rt_ok=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
371 if test "x$rt_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
372 AC_MSG_RESULT(yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
373 else
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
374 AC_MSG_RESULT(no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
375 AC_MSG_CHECKING(whether SunOS has -lposix4 )
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
376 LDFLAGS="$LDSAVEFLAGS -lposix4"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
377 AC_TRY_LINK_FUNC(nanosleep, posix_ok=yes, posix_ok=no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
378 if test "x$posix_ok" = "xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
379 AC_MSG_RESULT(yes)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
380 else
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
381 LDFLAGS=$LDSAVEFLAGS
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
382 AC_MSG_RESULT(no)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
383 AC_MSG_WARN([*** Try setting LIBS or LDFLAGS manually to point to the library with nanosleep()***])
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
384 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
385 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
386 ;;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
387 esac
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
388
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
389 dnl --------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
390 dnl Command line options
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
391 dnl --------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
392 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
393 if test "x$enable_cookies" = "xno" ; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
394 CFLAGS="$CFLAGS -DDISABLE_COOKIES"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
395 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
396 if test "x$enable_ipv6" = "xyes" ; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
397 CFLAGS="$CFLAGS -DENABLE_IPV6"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
398 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
399 if test "x$enable_efence" = "xyes" ; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
400 LIBS="-lefence $LIBS"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
401 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
402 if test "x$enable_gprof" = "xyes" ; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
403 CFLAGS="$CFLAGS -pg"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
404 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
405 if test "x$enable_insure" = "xyes" ; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
406 CC="insure -Zoi \"compiler $CC\""
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
407 LIBS="$LIBS -lstdc++-2-libc6.1-1-2.9.0"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
408 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
409 if test "x$enable_rtfl" = "xyes" ; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
410 CFLAGS="$CFLAGS -DDBG_RTFL"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
411 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
412 if test "x$enable_threaded_dns" = "xyes" ; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
413 CFLAGS="$CFLAGS -DD_DNS_THREADED"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
414 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
415
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
416 dnl -----------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
417 dnl Checks for header files
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
418 dnl -----------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
419 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
420 AC_HEADER_STDC
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
421 AC_CHECK_HEADERS(fcntl.h unistd.h sys/uio.h)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
422
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
423 dnl --------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
424 dnl Check for compiler options
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
425 dnl --------------------------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
426 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
427 if eval "test x$GCC = xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
428 if test "`echo $CFLAGS | grep '\-D_REENTRANT' 2> /dev/null`" = ""; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
429 CFLAGS="$CFLAGS -D_REENTRANT"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
430 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
431 if test "`echo $CFLAGS | grep '\-D_THREAD_SAFE' 2> /dev/null`" = ""; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
432 CFLAGS="$CFLAGS -D_THREAD_SAFE"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
433 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
434 if test "`echo $CFLAGS | grep '\-Wall' 2> /dev/null`" = ""; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
435 CFLAGS="$CFLAGS -Wall"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
436 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
437 if test "`echo $CFLAGS | grep '\-W[^a]' 2> /dev/null`" = ""; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
438 if test "`$CC -v 2>&1 | grep 'version 3'`" != ""; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
439 CFLAGS="$CFLAGS -W -Wno-unused-parameter"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
440 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
441 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
442 if test "`echo $CFLAGS | grep '\-Waggregate-return' 2> /dev/null`" = ""; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
443 CFLAGS="$CFLAGS -Waggregate-return"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
444 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
445
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
446 if eval "test x$enable_ansi = xyes"; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
447 if test "`echo $CFLAGS | grep '\-ansi' 2> /dev/null`" = ""; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
448 CFLAGS="$CFLAGS -ansi"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
449 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
450
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
451 if test "`echo $CFLAGS | grep '\-pedantic' 2> /dev/null`" = ""; then
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
452 CFLAGS="$CFLAGS -pedantic"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
453 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
454 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
455 fi
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
456 dnl -----------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
457 dnl CXX options
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
458 dnl -----------
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
459 dnl
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
460 CXXFLAGS="$CXXFLAGS -Wall -W -Wno-unused-parameter"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
461
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
462 AC_SUBST(LIBJPEG_LIBS)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
463 AC_SUBST(LIBJPEG_LDFLAGS)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
464 AC_SUBST(LIBJPEG_CPPFLAGS)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
465 AC_SUBST(LIBPNG_LIBS)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
466 AC_SUBST(LIBPNG_CFLAGS)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
467 AC_SUBST(LIBZ_LIBS)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
468 AC_SUBST(LIBSSL_LIBS)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
469 AC_SUBST(LIBPTHREAD_LIBS)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
470 AC_SUBST(LIBPTHREAD_LDFLAGS)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
471 AC_SUBST(LIBFLTK_CXXFLAGS)
6
c390daa639ce Improved FLTK library detection at configure time.
jcid
parents: 0
diff changeset
472 AC_SUBST(LIBFLTK_CFLAGS)
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
473 AC_SUBST(LIBFLTK_LIBS)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
474 AC_SUBST(datadir)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
475 AC_SUBST(src doc)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
476
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
477 AC_OUTPUT(Makefile dlib/Makefile dpip/Makefile dpid/Makefile dpi/Makefile doc/Makefile src/Makefile src/IO/Makefile)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
478