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

Diff of /cvsgraph/configure.in

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

revision 1.1, Fri Feb 23 00:11:30 2001 UTC revision 1.14, Thu Oct 21 20:08:42 2004 UTC
# Line 3  Line 3 
3  dnl scripts that seem to do a pretty good job.  dnl scripts that seem to do a pretty good job.
4    
5  AC_INIT(cvsgraph.c)  AC_INIT(cvsgraph.c)
6    AC_CONFIG_HEADER(config.h)
7    
8  AC_PROG_CC  AC_PROG_CC
9  AC_PROG_LEX  AC_PROG_LEX
10  AC_PROG_YACC  AC_PROG_YACC
11    
12    LEXFLAGS="-8"
13    LEXSPEED="-Cf"
14    INCL=""
15    
16  dnl Extra libraries 'with'-options  dnl Extra libraries 'with'-options
17  AC_ARG_WITH(gd,[  --with-gd=DIR           location of the gd lib/inc],  AC_ARG_WITH(gd-inc,[  --with-gd-inc=DIR       location of the gd includes],
18                  [LDFLAGS="${LDFLAGS} -L${withval}"                  [INCL="${INCL} -I${withval}"
19                  CFLAGS="${CFLAGS} -I${withval}"                  ])
20    
21    AC_ARG_WITH(gd-lib,[  --with-gd-lib=DIR       location of the gd library],
22                    [LIBS="${LIBS} -L${withval}"
23                    ])
24    
25    LIBS="$LIBS -lgd"
26    LIBPATH=""
27    
28    AC_ARG_WITH(freetype-lib,[  --with-freetype-lib=DIR    location of freetype library],
29                    [LIBS="${LIBS} -L${withval}"
30                    ])
31    
32    AC_ARG_WITH(freetype2-lib,[  --with-freetype2-lib=DIR    location of freetype2 library],
33                    [LIBS="${LIBS} -L${withval}"
34                    ])
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                    [LIBS="${LIBS} -L${withval}"
42                    ])
43    
44    AC_ARG_WITH(jpeg-inc,[  --with-jpeg-inc=DIR    location of jpeg includes],
45                    [INCL="${INCL} -I${withval}"
46                  ])                  ])
47    
48  AC_ARG_WITH(z,[  --with-z=DIR            location of zlib lib/inc],  AC_ARG_WITH(jpeg-lib,[  --with-jpeg-lib=DIR    location of jpeg library],
49                  [LDFLAGS="${LDFLAGS} -L${withval}"                  [LIBS="${LIBS} -L${withval}"
                 CFLAGS="${CFLAGS} -I${withval}"  
50                  ])                  ])
51    
52  AC_ARG_WITH(png,[  --with-png=DIR          location of png lib/inc],  AC_ARG_WITH(z-inc,[  --with-z-inc=DIR        location of zlib includes],
53                  [LDFLAGS="${LDFLAGS} -L${withval}"                  [INCL="${INCL} -I${withval}"
                 CFLAGS="${CFLAGS} -I${withval}"  
54                  ])                  ])
55    
56  LDFLAGS="${LDFLAGS} -lgd"  AC_ARG_WITH(z-lib,[  --with-z-lib=DIR        location of zlib library],
57                    [LIBS="${LIBS} -L${withval}"
58                    ])
59    
60    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    CPPFLAGS="$CPPFLAGS $INCL"
69    CFLAGS="$CFLAGS $INCL"
70    
71  dnl Tests for gcc  dnl Tests for gcc
72  if test "x${GCC}" = "xyes"  if test "x${GCC}" = "xyes"
# Line 49  Line 90 
90    fi    fi
91  fi  fi
92    
93    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    
102  dnl Checks for libraries.  AC_CACHE_CHECK( "sizes of long and void *", ac_cv_c_size_long_ptr,
103  AC_CHECK_LIB(m, sqrt, [            AC_TRY_RUN([
104          AC_DEFINE(LIBM)  int main(void) {
105          MATHLIBS="-lm" ])    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  dnl which version of gd do we have here? (taken from mrtg config)  AC_CACHE_CHECK( "sizes of long long and void *", ac_cv_c_size_longlong_ptr,
112  AC_CHECK_LIB(gd,gdImageGif,[            AC_TRY_RUN([
113    CFLAGS="$CFLAGS -DGD_IMAGE_XXX=gdImageGif"  int main(void) {
114                             ])    return sizeof(long long) == sizeof(void *);
115  AC_CHECK_LIB(gd,gdImagePng,[  }],
116    CFLAGS="$CFLAGS -DGD_IMAGE_XXX=gdImagePng"      ac_cv_c_size_longlong_ptr="no",
117    LDFLAGS="$LDFLAGS -lpng -lz ${MATHLIBS}"      ac_cv_c_size_longlong_ptr="yes",
118          ],:,[-lpng -lz ${MATHLIBS}])      ac_cv_c_size_longlong_ptr="yes") )
119    
120    if test "$ac_cv_c_size_int_ptr" = "no"
121    then
122            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    fi
142    
143  dnl Make sure the header is here  dnl Check getopt.h because Solaris 8 doesn't have one
144    AC_CHECK_HEADER(getopt.h, [ AC_DEFINE(HAVE_GETOPT_H) ])
145    
146    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    dnl Make sure the gd header is here
150  AC_CHECK_HEADER( gd.h,[ have_gd_h="yes" ],[ have_gd_h="no" ])  AC_CHECK_HEADER( gd.h,[ have_gd_h="yes" ],[ have_gd_h="no" ])
151    
152  if test $have_gd_h != "yes"; then  if test "$have_gd_h" != "yes"; then
153  echo  echo
154          echo "** The GD library is required for CvsGraph to function."          echo "** The GD library is required for CvsGraph to function."
155          echo "   Get it from http://www.boutell.com, compile it and"          echo "   Get it from http://www.boutell.com, compile it and"
# Line 80  Line 161 
161          exit 1          exit 1
162  fi  fi
163    
164    dnl Checks for libraries.
165    AC_CHECK_LIB(m, sqrt, [
166            AC_DEFINE(LIBM)
167            MATHLIBS="-lm"
168            ])
169    
170    AC_CHECK_LIB(z, compress, [
171            ac_have_libz="yes"
172            ZLIB="-lz"
173            ] , [
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            ] , ${LIBPATH} ${ZLIB} ${MATHLIBS} )
197    
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              AC_TRY_LINK_FUNC( gdImagePng, [
221            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              AC_TRY_LINK_FUNC( gdImageJpeg, [
231            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              AC_TRY_LINK_FUNC( gdImageStringTTF, [
241            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              AC_TRY_LINK_FUNC( gdImageStringFT, [
251            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            if test "$ac_have_libfreetype" != "yes" -a "$ac_have_libttf" != "yes"
260            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            if test "$ac_have_libttf" != "yes" -a "$ac_have_libfreetype" != "yes"
269            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    then
277            if test "$ac_have_libjpeg" != "yes"
278            then
279                    echo "** WARNING: Required library libjpeg not found"
280            fi
281            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            then
288                    echo "** WARNING: Required library libpng not found"
289            fi
290            LIBS="${LIBS} ${LIBPNG}"
291            if test "$ac_cv_png_needs_z" = "yes"
292            then
293                    if test "$ac_have_libz" != "yes"
294                    then
295                            echo "** WARNING: Required library libz not found"
296                    fi
297                    LIBS="${LIBS} ${LIBZ}"
298            fi
299    fi
300    
301    LIBS="${LIBS} ${MATHLIBS}"
302    
303    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    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    
323    AC_CHECK_LIB(gd, gdImagePng, [
324            AC_DEFINE(HAVE_IMAGE_PNG)
325            ])
326    AC_CHECK_LIB(gd, gdImagePngEx, [
327            AC_DEFINE(HAVE_GDIMAGEPNGEX)
328            ])
329    AC_CHECK_LIB(gd, gdImageJpeg, [
330            AC_DEFINE(HAVE_IMAGE_JPEG)
331            ])
332    AC_CHECK_LIB(gd, gdImageStringTTF, [
333            if test "$ac_have_libttf" = "yes"
334            then
335                    AC_DEFINE(HAVE_GDIMAGESTRINGTTF)
336            fi
337            ])
338    AC_CHECK_LIB(gd, gdImageStringFT, [
339            if test "$ac_have_libfreetype" = "yes"
340            then
341                    AC_DEFINE(HAVE_GDIMAGESTRINGFT)
342            fi
343            ])
344    AC_CHECK_LIB(gd, gdImageFilledArc, [
345            AC_DEFINE(HAVE_GDIMAGEFILLEDARC)
346            ])
347    
348    
349    AC_SUBST(LEXFLAGS)
350    AC_SUBST(INTTYPE)
351    
352  AC_OUTPUT(Makefile)  AC_OUTPUT(Makefile)
353    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0