/[CvsGraph]/cvsgraph/configure.in
ViewVC logotype

Annotate of /cvsgraph/configure.in

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.15 - (hide annotations)
Sat Dec 4 02:18:13 2004 UTC (12 years, 11 months ago) by bertho
Branch: MAIN
CVS Tags: REL_1_6_1, REL_1_5_2, REL_1_6_2, REL_1_6_0, source_head_20080521
Branch point for: svn-integration, automake-dev1
Changes since 1.14: +2 -2 lines
Fix the configure script to detect gd-2:
  The mystery is solved, I think. The problem seems to be a bug in the GIF
  support of gd-2.0.33. I didn't look into it further because CvsGraph was
  configured to output PNGs and shouldn't have been outputting GIFs in the
  first place. The reason it was outputting GIFs was a bug in CvsGraph's
  configure script which causes CvsGraph to be built without PNG support.
1 bertho 1.1 dnl Configure.in script for CvsGraph
2     dnl Most of the stuff is gathered from other
3     dnl scripts that seem to do a pretty good job.
4    
5     AC_INIT(cvsgraph.c)
6 bertho 1.2 AC_CONFIG_HEADER(config.h)
7 bertho 1.1
8     AC_PROG_CC
9     AC_PROG_LEX
10     AC_PROG_YACC
11    
12 bertho 1.3 LEXFLAGS="-8"
13     LEXSPEED="-Cf"
14 bertho 1.5 INCL=""
15 bertho 1.3
16 bertho 1.1 dnl Extra libraries 'with'-options
17 bertho 1.5 AC_ARG_WITH(gd-inc,[ --with-gd-inc=DIR location of the gd includes],
18     [INCL="${INCL} -I${withval}"
19 bertho 1.4 ])
20    
21 bertho 1.5 AC_ARG_WITH(gd-lib,[ --with-gd-lib=DIR location of the gd library],
22     [LIBS="${LIBS} -L${withval}"
23 bertho 1.1 ])
24    
25 bertho 1.5 LIBS="$LIBS -lgd"
26 bertho 1.9 LIBPATH=""
27 bertho 1.5
28 bertho 1.8 AC_ARG_WITH(freetype-lib,[ --with-freetype-lib=DIR location of freetype library],
29 bertho 1.9 [LIBS="${LIBS} -L${withval}"
30 bertho 1.5 ])
31    
32 bertho 1.8 AC_ARG_WITH(freetype2-lib,[ --with-freetype2-lib=DIR location of freetype2 library],
33 bertho 1.9 [LIBS="${LIBS} -L${withval}"
34 bertho 1.5 ])
35    
36     AC_ARG_WITH(png-inc,[ --with-png-inc=DIR location of png includes],
37     [INCL="${INCL} -I${withval}"
38     ])
39    
40     AC_ARG_WITH(png-lib,[ --with-png-lib=DIR location of png library],
41 bertho 1.9 [LIBS="${LIBS} -L${withval}"
42 bertho 1.4 ])
43    
44 bertho 1.5 AC_ARG_WITH(jpeg-inc,[ --with-jpeg-inc=DIR location of jpeg includes],
45     [INCL="${INCL} -I${withval}"
46 bertho 1.1 ])
47    
48 bertho 1.5 AC_ARG_WITH(jpeg-lib,[ --with-jpeg-lib=DIR location of jpeg library],
49 bertho 1.9 [LIBS="${LIBS} -L${withval}"
50 bertho 1.1 ])
51    
52 bertho 1.8 AC_ARG_WITH(z-inc,[ --with-z-inc=DIR location of zlib includes],
53     [INCL="${INCL} -I${withval}"
54 bertho 1.7 ])
55    
56 bertho 1.8 AC_ARG_WITH(z-lib,[ --with-z-lib=DIR location of zlib library],
57 bertho 1.9 [LIBS="${LIBS} -L${withval}"
58 bertho 1.7 ])
59    
60 bertho 1.3 AC_ARG_ENABLE(speed,[ --disable-speed Turn off lex table optimization reducing speed and size of executable],
61     [if test "$enableval" = "no"; then LEXSPEED=""; fi])
62    
63     if test "x$LEXSPEED" != "x"
64     then
65     LEXFLAGS="$LEXFLAGS $LEXSPEED"
66     fi
67    
68 bertho 1.5 CPPFLAGS="$CPPFLAGS $INCL"
69     CFLAGS="$CFLAGS $INCL"
70 bertho 1.1
71     dnl Tests for gcc
72     if test "x${GCC}" = "xyes"
73     then
74     CFLAGS="$CFLAGS -Wall"
75     AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
76     AC_TRY_RUN([
77     int main(void) {
78     static int Array[[3]];
79     unsigned int B = 3;
80     int i;
81     for(i=0; i<B; i++) Array[[i]] = i - 3;
82     exit( Array[[1]] != -2 );
83     }],
84     ac_cv_c_gcc_strength_bug="no",
85     ac_cv_c_gcc_strength_bug="yes",
86     ac_cv_c_gcc_strength_bug="yes") )
87     if test "$ac_cv_c_gcc_strength_bug" = "yes"
88     then
89     CFLAGS="$CFLAGS -fno-strength-reduce"
90     fi
91     fi
92    
93 bertho 1.9 AC_CACHE_CHECK( "sizes of int and void *", ac_cv_c_size_int_ptr,
94     AC_TRY_RUN([
95     int main(void) {
96     return sizeof(int) == sizeof(void *);
97     }],
98     ac_cv_c_size_int_ptr="no",
99     ac_cv_c_size_int_ptr="yes",
100     ac_cv_c_size_int_ptr="yes") )
101 bertho 1.11
102     AC_CACHE_CHECK( "sizes of long and void *", ac_cv_c_size_long_ptr,
103     AC_TRY_RUN([
104     int main(void) {
105     return sizeof(long) == sizeof(void *);
106     }],
107     ac_cv_c_size_long_ptr="no",
108     ac_cv_c_size_long_ptr="yes",
109     ac_cv_c_size_long_ptr="yes") )
110    
111     AC_CACHE_CHECK( "sizes of long long and void *", ac_cv_c_size_longlong_ptr,
112     AC_TRY_RUN([
113     int main(void) {
114     return sizeof(long long) == sizeof(void *);
115     }],
116     ac_cv_c_size_longlong_ptr="no",
117     ac_cv_c_size_longlong_ptr="yes",
118     ac_cv_c_size_longlong_ptr="yes") )
119    
120 bertho 1.9 if test "$ac_cv_c_size_int_ptr" = "no"
121     then
122 bertho 1.11 if test "$ac_cv_c_size_long_ptr" = "no"
123     then
124     if test "$ac_cv_c_size_longlong_ptr" = "no"
125     then
126     echo "** The size of an integer is not equal to a pointer."
127     echo " There are currently assumtions in the app that"
128     echo " prevents it from running if these sizes are not"
129     echo " equal."
130     echo " Please configure with a compiler that uses the"
131     echo " same sizes for ints and pointers."
132     exit 1
133     else
134     INTTYPE="long long"
135     fi
136     else
137     INTTYPE="long"
138     fi
139     else
140     INTTYPE="int"
141 bertho 1.9 fi
142    
143 bertho 1.6 dnl Check getopt.h because Solaris 8 doesn't have one
144     AC_CHECK_HEADER(getopt.h, [ AC_DEFINE(HAVE_GETOPT_H) ])
145 bertho 1.1
146 bertho 1.13 dnl Check sys/wait.h because Windows doesn't have one
147     AC_CHECK_HEADER(sys/wait.h, [ AC_DEFINE(HAVE_SYS_WAIT_H) ])
148    
149 bertho 1.9 dnl Make sure the gd header is here
150     AC_CHECK_HEADER( gd.h,[ have_gd_h="yes" ],[ have_gd_h="no" ])
151    
152     if test "$have_gd_h" != "yes"; then
153     echo
154     echo "** The GD library is required for CvsGraph to function."
155     echo " Get it from http://www.boutell.com, compile it and"
156     echo " use either --with-gd-lib=DIR and --with-gd-inc=DIR to specify"
157     echo " its location. You might also have to use --with-z-inc, --with-z-lib"
158     echo " and --with-png-inc, --with-png-lib for gd versions 1.6 and higher."
159     echo " Check config.log for more information on the problem. If your system"
160     echo " has libgd installed, you probably mis the gd.h header file."
161     exit 1
162     fi
163    
164 bertho 1.1 dnl Checks for libraries.
165     AC_CHECK_LIB(m, sqrt, [
166     AC_DEFINE(LIBM)
167 bertho 1.8 MATHLIBS="-lm"
168     ])
169 bertho 1.1
170 bertho 1.9 AC_CHECK_LIB(z, compress, [
171     ac_have_libz="yes"
172 bertho 1.15 LIBZ="-lz"
173 bertho 1.9 ] , [
174     ac_have_libz="no"
175     ] , ${LIBPATH} ${MATHLIBS} )
176    
177     AC_CHECK_LIB(freetype, FT_Load_Glyph, [
178     ac_have_libfreetype="yes"
179     LIBFT="-lfreetype"
180     ] , [
181     ac_have_libfreetype="no"
182     ] , ${LIBPATH} ${MATHLIBS} )
183    
184     AC_CHECK_LIB(ttf, TT_Load_Glyph, [
185     ac_have_libttf="yes"
186     LIBTT="-lttf"
187     ] , [
188     ac_have_libttf="no"
189     ] , ${LIBPATH} ${MATHLIBS} )
190    
191     AC_CHECK_LIB(png, png_create_read_struct , [
192     ac_have_libpng="yes"
193     LIBPNG="-lpng"
194     ] , [
195     ac_have_libpng="no"
196 bertho 1.15 ] , ${LIBPATH} ${LIBZ} ${MATHLIBS} )
197 bertho 1.9
198     AC_CHECK_LIB(jpeg, jpeg_CreateCompress, [
199     ac_have_libjpeg="yes"
200     LIBJPEG="-ljpeg"
201     ] , [
202     ac_have_libjpeg="no"
203     ] , ${LIBPATH} ${MATHLIBS} )
204    
205     dnl Check which libraries we need to add
206     OLIBS="${LIBS}"
207     LIBS="${LIBS} ${MATHLIB}"
208     AC_CACHE_CHECK( "whether libpng needs -lz", ac_cv_png_needs_z,
209     AC_TRY_LINK_FUNC( png_create_read_struct, [
210     ac_cv_png_needs_z="no"
211     ] , [
212     ac_cv_png_needs_z="yes"
213     ] ) )
214     LIBS="${OLIBS}"
215    
216    
217     OLIBS="${LIBS}"
218     LIBS="${LIBS} ${LIBFT} ${LIBTT} ${LIBJPEG} ${MATHLIB}"
219     AC_CACHE_CHECK( "whether libgd needs -lpng", ac_cv_gd_needs_png,
220 bertho 1.10 AC_TRY_LINK_FUNC( gdImagePng, [
221 bertho 1.9 ac_cv_gd_needs_png="no"
222     ] , [
223     ac_cv_gd_needs_png="yes"
224     ] ) )
225     LIBS="${OLIBS}"
226    
227     OLIBS="${LIBS}"
228     LIBS="${LIBS} ${LIBFT} ${LIBTT} ${LIBPNG} ${LIBZ} ${MATHLIB}"
229     AC_CACHE_CHECK( "whether libgd needs -ljpeg", ac_cv_gd_needs_jpeg,
230 bertho 1.10 AC_TRY_LINK_FUNC( gdImageJpeg, [
231 bertho 1.9 ac_cv_gd_needs_jpeg="no"
232     ] , [
233     ac_cv_gd_needs_jpeg="yes"
234     ] ) )
235     LIBS="${OLIBS}"
236    
237     OLIBS="${LIBS}"
238     LIBS="${LIBS} ${LIBFT} ${LIBJPEG} ${LIBPNG} ${LIBZ} ${MATHLIB}"
239     AC_CACHE_CHECK( "whether libgd needs -lttf", ac_cv_gd_needs_ttf,
240 bertho 1.10 AC_TRY_LINK_FUNC( gdImageStringTTF, [
241 bertho 1.9 ac_cv_gd_needs_ttf="no"
242     ] , [
243     ac_cv_gd_needs_ttf="yes"
244     ] ) )
245     LIBS="${OLIBS}"
246    
247     OLIBS="${LIBS}"
248     LIBS="${LIBS} ${LIBTT} ${LIBJPEG} ${LIBPNG} ${LIBZ} ${MATHLIB}"
249     AC_CACHE_CHECK( "whether libgd needs -lfreetype", ac_cv_gd_needs_freetype,
250 bertho 1.10 AC_TRY_LINK_FUNC( gdImageStringFT, [
251 bertho 1.9 ac_cv_gd_needs_freetype="no"
252     ] , [
253     ac_cv_gd_needs_freetype="yes"
254     ] ) )
255     LIBS="${OLIBS}"
256    
257     if test "$ac_cv_gd_needs_freetype" = "yes"
258     then
259 bertho 1.10 if test "$ac_have_libfreetype" != "yes" -a "$ac_have_libttf" != "yes"
260 bertho 1.9 then
261     echo "** WARNING: Required library libfreetype not found"
262     fi
263     LIBS="${LIBS} ${LIBFT}"
264     fi
265    
266     if test "$ac_cv_gd_needs_ttf" = "yes"
267     then
268 bertho 1.10 if test "$ac_have_libttf" != "yes" -a "$ac_have_libfreetype" != "yes"
269 bertho 1.9 then
270     echo "** WARNING: Required library libttf not found"
271     fi
272     LIBS="${LIBS} ${LIBTT}"
273     fi
274    
275     if test "$ac_cv_gd_needs_jpeg" = "yes"
276 bertho 1.8 then
277 bertho 1.9 if test "$ac_have_libjpeg" != "yes"
278 bertho 1.8 then
279 bertho 1.9 echo "** WARNING: Required library libjpeg not found"
280 bertho 1.8 fi
281 bertho 1.9 LIBS="${LIBS} ${LIBJPEG}"
282     fi
283    
284     if test "$ac_cv_gd_needs_png" = "yes"
285     then
286     if test "$ac_have_libpng" != "yes"
287 bertho 1.8 then
288 bertho 1.9 echo "** WARNING: Required library libpng not found"
289 bertho 1.8 fi
290 bertho 1.9 LIBS="${LIBS} ${LIBPNG}"
291     if test "$ac_cv_png_needs_z" = "yes"
292 bertho 1.8 then
293 bertho 1.9 if test "$ac_have_libz" != "yes"
294     then
295     echo "** WARNING: Required library libz not found"
296     fi
297     LIBS="${LIBS} ${LIBZ}"
298 bertho 1.8 fi
299     fi
300    
301     LIBS="${LIBS} ${MATHLIBS}"
302    
303 bertho 1.9 dnl which version of gd do we have here?
304     AC_CHECK_LIB(gd, gdImageGif, [
305     AC_DEFINE(HAVE_IMAGE_GIF)
306     have_gifs="yes"
307     ] ,
308     have_gifs="no"
309     )
310    
311 bertho 1.12 dnl The new versions of libgd include gifs again after the patent expired.
312     dnl So this check should not be required anymore.
313     dnl if test "${have_gifs}" = "yes"
314     dnl then
315     dnl echo "** You have a very old GD library. Please consider"
316     dnl echo " upgrading to a more recent version (1.8.4 or newer)."
317     dnl echo " --Note that f.x. ViewCVS needs CvsGraph to generate PNG"
318     dnl echo " images and ancient GD libraries might contain many bugs."
319     dnl echo " However, if you need GIFs, then you must stick to this"
320     dnl echo " old version."
321     dnl fi
322 bertho 1.9
323     AC_CHECK_LIB(gd, gdImagePng, [
324 bertho 1.2 AC_DEFINE(HAVE_IMAGE_PNG)
325     ])
326 bertho 1.14 AC_CHECK_LIB(gd, gdImagePngEx, [
327     AC_DEFINE(HAVE_GDIMAGEPNGEX)
328     ])
329 bertho 1.9 AC_CHECK_LIB(gd, gdImageJpeg, [
330 bertho 1.2 AC_DEFINE(HAVE_IMAGE_JPEG)
331 bertho 1.7 ])
332 bertho 1.9 AC_CHECK_LIB(gd, gdImageStringTTF, [
333 bertho 1.10 if test "$ac_have_libttf" = "yes"
334     then
335     AC_DEFINE(HAVE_GDIMAGESTRINGTTF)
336     fi
337 bertho 1.7 ])
338 bertho 1.9 AC_CHECK_LIB(gd, gdImageStringFT, [
339 bertho 1.10 if test "$ac_have_libfreetype" = "yes"
340     then
341     AC_DEFINE(HAVE_GDIMAGESTRINGFT)
342     fi
343 bertho 1.12 ])
344     AC_CHECK_LIB(gd, gdImageFilledArc, [
345     AC_DEFINE(HAVE_GDIMAGEFILLEDARC)
346 bertho 1.2 ])
347 bertho 1.1
348    
349 bertho 1.3 AC_SUBST(LEXFLAGS)
350 bertho 1.11 AC_SUBST(INTTYPE)
351 bertho 1.1
352     AC_OUTPUT(Makefile)
353    
354     echo "Configure done. Run 'make' to build CvsGraph"
355    

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0