/[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.8, Wed Jun 19 14:47:55 2002 UTC revision 1.9, Sat Jul 20 00:48:17 2002 UTC
# Line 23  Line 23 
23                  ])                  ])
24    
25  LIBS="$LIBS -lgd"  LIBS="$LIBS -lgd"
26  have_lib_png="no"  LIBPATH=""
 have_lib_z="no"  
 have_lib_jpeg="no"  
27    
28  AC_ARG_WITH(freetype-lib,[  --with-freetype-lib=DIR    location of freetype library],  AC_ARG_WITH(freetype-lib,[  --with-freetype-lib=DIR    location of freetype library],
29                  [LIBS="${LIBS} -L${withval} -lttf"                  [LIBS="${LIBS} -L${withval}"
30                  ])                  ])
31    
32  AC_ARG_WITH(freetype2-lib,[  --with-freetype2-lib=DIR    location of freetype2 library],  AC_ARG_WITH(freetype2-lib,[  --with-freetype2-lib=DIR    location of freetype2 library],
33                  [LIBS="${LIBS} -L${withval} -lfreetype"                  [LIBS="${LIBS} -L${withval}"
34                  ])                  ])
35    
36  AC_ARG_WITH(png-inc,[  --with-png-inc=DIR      location of png includes],  AC_ARG_WITH(png-inc,[  --with-png-inc=DIR      location of png includes],
# Line 40  Line 38 
38                  ])                  ])
39    
40  AC_ARG_WITH(png-lib,[  --with-png-lib=DIR      location of png library],  AC_ARG_WITH(png-lib,[  --with-png-lib=DIR      location of png library],
41                  [LIBS="${LIBS} -L${withval} -lpng"                  [LIBS="${LIBS} -L${withval}"
                  have_lib_png="yes"  
42                  ])                  ])
43    
44  AC_ARG_WITH(jpeg-inc,[  --with-jpeg-inc=DIR    location of jpeg includes],  AC_ARG_WITH(jpeg-inc,[  --with-jpeg-inc=DIR    location of jpeg includes],
# Line 49  Line 46 
46                  ])                  ])
47    
48  AC_ARG_WITH(jpeg-lib,[  --with-jpeg-lib=DIR    location of jpeg library],  AC_ARG_WITH(jpeg-lib,[  --with-jpeg-lib=DIR    location of jpeg library],
49                  [LIBS="${LIBS} -L${withval} -ljpeg"                  [LIBS="${LIBS} -L${withval}"
                  have_lib_jpeg="yes"  
50                  ])                  ])
51    
52  AC_ARG_WITH(z-inc,[  --with-z-inc=DIR        location of zlib includes],  AC_ARG_WITH(z-inc,[  --with-z-inc=DIR        location of zlib includes],
# Line 58  Line 54 
54                  ])                  ])
55    
56  AC_ARG_WITH(z-lib,[  --with-z-lib=DIR        location of zlib library],  AC_ARG_WITH(z-lib,[  --with-z-lib=DIR        location of zlib library],
57                  [LIBS="${LIBS} -L${withval} -lz"                  [LIBS="${LIBS} -L${withval}"
                  have_lib_z="yes"  
58                  ])                  ])
59    
60  AC_ARG_ENABLE(speed,[  --disable-speed         Turn off lex table optimization reducing speed and size of executable],  AC_ARG_ENABLE(speed,[  --disable-speed         Turn off lex table optimization reducing speed and size of executable],
# Line 95  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    if test "$ac_cv_c_size_int_ptr" = "no"
102    then
103            echo "** The size of an integer is not equal to a pointer."
104            echo "   There are currently assumtions in the app that"
105            echo "   prevents it from running if these sizes are not"
106            echo "   equal."
107            echo "   Please configure with a compiler that uses the"
108            echo "   same sizes for ints and pointers."
109            exit 1
110    fi
111    
112  dnl Check getopt.h because Solaris 8 doesn't have one  dnl Check getopt.h because Solaris 8 doesn't have one
113  AC_CHECK_HEADER(getopt.h, [ AC_DEFINE(HAVE_GETOPT_H) ])  AC_CHECK_HEADER(getopt.h, [ AC_DEFINE(HAVE_GETOPT_H) ])
114    
115    dnl Make sure the gd header is here
116    AC_CHECK_HEADER( gd.h,[ have_gd_h="yes" ],[ have_gd_h="no" ])
117    
118    if test "$have_gd_h" != "yes"; then
119    echo
120            echo "** The GD library is required for CvsGraph to function."
121            echo "   Get it from http://www.boutell.com, compile it and"
122            echo "   use either --with-gd-lib=DIR and --with-gd-inc=DIR to specify"
123            echo "   its location. You might also have to use --with-z-inc, --with-z-lib"
124            echo "   and --with-png-inc, --with-png-lib for gd versions 1.6 and higher."
125            echo "   Check config.log for more information on the problem. If your system"
126            echo "   has libgd installed, you probably mis the gd.h header file."
127            exit 1
128    fi
129    
130  dnl Checks for libraries.  dnl Checks for libraries.
131  AC_CHECK_LIB(m, sqrt, [  AC_CHECK_LIB(m, sqrt, [
132          AC_DEFINE(LIBM)          AC_DEFINE(LIBM)
133          MATHLIBS="-lm"          MATHLIBS="-lm"
134          ])          ])
135    
136  dnl which version of gd do we have here? (taken from mrtg config)  AC_CHECK_LIB(z, compress, [
137  AC_CHECK_LIB(gd,gdImageGif,[          ac_have_libz="yes"
138          AC_DEFINE(HAVE_IMAGE_GIF)          ZLIB="-lz"
139          ]          ] , [
140          have_gifs="yes",          ac_have_libz="no"
141          have_gifs="no",          ] , ${LIBPATH} ${MATHLIBS} )
142          $MATHLIBS )  
143    AC_CHECK_LIB(freetype, FT_Load_Glyph, [
144  dnl If we don't have gifs, then force png/jpeg libs to be present.          ac_have_libfreetype="yes"
145  dnl This should be adequate for all newer libgd versions.          LIBFT="-lfreetype"
146  if test "$have_gifs" = "no"          ] , [
147            ac_have_libfreetype="no"
148            ] , ${LIBPATH} ${MATHLIBS} )
149    
150    AC_CHECK_LIB(ttf, TT_Load_Glyph, [
151            ac_have_libttf="yes"
152            LIBTT="-lttf"
153            ] , [
154            ac_have_libttf="no"
155            ] , ${LIBPATH} ${MATHLIBS} )
156    
157    AC_CHECK_LIB(png, png_create_read_struct , [
158            ac_have_libpng="yes"
159            LIBPNG="-lpng"
160            ] , [
161            ac_have_libpng="no"
162            ] , ${LIBPATH} ${ZLIB} ${MATHLIBS} )
163    
164    AC_CHECK_LIB(jpeg, jpeg_CreateCompress, [
165            ac_have_libjpeg="yes"
166            LIBJPEG="-ljpeg"
167            ] , [
168            ac_have_libjpeg="no"
169            ] , ${LIBPATH} ${MATHLIBS} )
170    
171    dnl Check which libraries we need to add
172    OLIBS="${LIBS}"
173    LIBS="${LIBS} ${MATHLIB}"
174    AC_CACHE_CHECK( "whether libpng needs -lz", ac_cv_png_needs_z,
175              AC_TRY_LINK_FUNC( png_create_read_struct, [
176            ac_cv_png_needs_z="no"
177            ] , [
178            ac_cv_png_needs_z="yes"
179            ] ) )
180    LIBS="${OLIBS}"
181    
182    
183    OLIBS="${LIBS}"
184    LIBS="${LIBS} ${LIBFT} ${LIBTT} ${LIBJPEG} ${MATHLIB}"
185    AC_CACHE_CHECK( "whether libgd needs -lpng", ac_cv_gd_needs_png,
186              AC_TRY_LINK_FUNC( gdImageCreate, [
187            ac_cv_gd_needs_png="no"
188            ] , [
189            ac_cv_gd_needs_png="yes"
190            ] ) )
191    LIBS="${OLIBS}"
192    
193    OLIBS="${LIBS}"
194    LIBS="${LIBS} ${LIBFT} ${LIBTT} ${LIBPNG} ${LIBZ} ${MATHLIB}"
195    AC_CACHE_CHECK( "whether libgd needs -ljpeg", ac_cv_gd_needs_jpeg,
196              AC_TRY_LINK_FUNC( gdImageCreate, [
197            ac_cv_gd_needs_jpeg="no"
198            ] , [
199            ac_cv_gd_needs_jpeg="yes"
200            ] ) )
201    LIBS="${OLIBS}"
202    
203    OLIBS="${LIBS}"
204    LIBS="${LIBS} ${LIBFT} ${LIBJPEG} ${LIBPNG} ${LIBZ} ${MATHLIB}"
205    AC_CACHE_CHECK( "whether libgd needs -lttf", ac_cv_gd_needs_ttf,
206              AC_TRY_LINK_FUNC( gdImageCreate, [
207            ac_cv_gd_needs_ttf="no"
208            ] , [
209            ac_cv_gd_needs_ttf="yes"
210            ] ) )
211    LIBS="${OLIBS}"
212    
213    OLIBS="${LIBS}"
214    LIBS="${LIBS} ${LIBTT} ${LIBJPEG} ${LIBPNG} ${LIBZ} ${MATHLIB}"
215    AC_CACHE_CHECK( "whether libgd needs -lfreetype", ac_cv_gd_needs_freetype,
216              AC_TRY_LINK_FUNC( gdImageCreate, [
217            ac_cv_gd_needs_freetype="no"
218            ] , [
219            ac_cv_gd_needs_freetype="yes"
220            ] ) )
221    LIBS="${OLIBS}"
222    
223    if test "$ac_cv_gd_needs_freetype" = "yes"
224    then
225            if test "$ac_have_libfreetype" != "yes"
226            then
227                    echo "** WARNING: Required library libfreetype not found"
228            fi
229            LIBS="${LIBS} ${LIBFT}"
230    fi
231    
232    if test "$ac_cv_gd_needs_ttf" = "yes"
233  then  then
234          if test "$have_lib_jpeg" = "no"          if test "$ac_have_libttf" != "yes"
235          then          then
236                  LIBS="${LIBS} -ljpeg"                  echo "** WARNING: Required library libttf not found"
237          fi          fi
238          if test "$have_lib_png" = "no"          LIBS="${LIBS} ${LIBTT}"
239    fi
240    
241    if test "$ac_cv_gd_needs_jpeg" = "yes"
242    then
243            if test "$ac_have_libjpeg" != "yes"
244          then          then
245                  LIBS="${LIBS} -lpng"                  echo "** WARNING: Required library libjpeg not found"
246          fi          fi
247          if test "$have_lib_z" = "no"          LIBS="${LIBS} ${LIBJPEG}"
248    fi
249    
250    if test "$ac_cv_gd_needs_png" = "yes"
251    then
252            if test "$ac_have_libpng" != "yes"
253          then          then
254                  LIBS="${LIBS} -lz"                  echo "** WARNING: Required library libpng not found"
255            fi
256            LIBS="${LIBS} ${LIBPNG}"
257            if test "$ac_cv_png_needs_z" = "yes"
258            then
259                    if test "$ac_have_libz" != "yes"
260                    then
261                            echo "** WARNING: Required library libz not found"
262                    fi
263                    LIBS="${LIBS} ${LIBZ}"
264          fi          fi
265  fi  fi
266    
267  LIBS="${LIBS} ${MATHLIBS}"  LIBS="${LIBS} ${MATHLIBS}"
268    
269  AC_CHECK_LIB(gd,gdImagePng,[  dnl which version of gd do we have here?
270    AC_CHECK_LIB(gd, gdImageGif, [
271            AC_DEFINE(HAVE_IMAGE_GIF)
272            have_gifs="yes"
273            ] ,
274            have_gifs="no"
275            )
276    
277    if test "${have_gifs}" = "yes"
278    then
279            echo "** You have a very old GD library. Please consider"
280            echo "   upgrading to a more recent version (1.8.4 or newer)."
281            echo "   --Note that f.x. ViewCVS needs CvsGraph to generate PNG"
282            echo "     images and ancient GD libraries might contain many bugs."
283            echo "     However, if you need GIFs, then you must stick to this"
284            echo "     old version."
285    fi
286    
287    AC_CHECK_LIB(gd, gdImagePng, [
288          AC_DEFINE(HAVE_IMAGE_PNG)          AC_DEFINE(HAVE_IMAGE_PNG)
289          ])          ])
290  AC_CHECK_LIB(gd,gdImageJpeg,[  AC_CHECK_LIB(gd, gdImageJpeg, [
291          AC_DEFINE(HAVE_IMAGE_JPEG)          AC_DEFINE(HAVE_IMAGE_JPEG)
292          ])          ])
293  AC_CHECK_LIB(gd,gdImageStringTTF,[  AC_CHECK_LIB(gd, gdImageStringTTF, [
294          AC_DEFINE(HAVE_GDIMAGESTRINGTTF)          AC_DEFINE(HAVE_GDIMAGESTRINGTTF)
295          ])          ])
296  AC_CHECK_LIB(gd,gdImageStringFT,[  AC_CHECK_LIB(gd, gdImageStringFT, [
297          AC_DEFINE(HAVE_GDIMAGESTRINGFT)          AC_DEFINE(HAVE_GDIMAGESTRINGFT)
298          ])          ])
299    
300    
 dnl Make sure the header is here  
 AC_CHECK_HEADER( gd.h,[ have_gd_h="yes" ],[ have_gd_h="no" ])  
   
 if test $have_gd_h != "yes"; then  
 echo  
         echo "** The GD library is required for CvsGraph to function."  
         echo "   Get it from http://www.boutell.com, compile it and"  
         echo "   use either --with-gd-lib=DIR and --with-gd-inc=DIR to specify"  
         echo "   its location. You might also have to use --with-z-inc, --with-z-lib"  
         echo "   and --with-png-inc, --with-png-lib for gd versions 1.6 and higher."  
         echo "   Check config.log for more information on the problem. If your system"  
         echo "   has libgd installed, you probably mis the gd.h header file."  
         exit 1  
 fi  
   
301  AC_SUBST(LEXFLAGS)  AC_SUBST(LEXFLAGS)
302    
303  AC_OUTPUT(Makefile)  AC_OUTPUT(Makefile)

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0