/[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.9, Sat Jul 20 00:48:17 2002 UTC revision 1.16, Wed May 21 13:33:35 2008 UTC
# Line 1  Line 1 
1  dnl Configure.in script for CvsGraph  #                                               -*- Autoconf -*-
2  dnl Most of the stuff is gathered from other  # Process this file with autoconf to produce a configure script.
 dnl scripts that seem to do a pretty good job.  
3    
4  AC_INIT(cvsgraph.c)  #AC_PREREQ(2.59)
5  AC_CONFIG_HEADER(config.h)  AC_INIT(cvsgraph, 1.7.0, cvsgraph@akhphd.au.dk)
6    AM_INIT_AUTOMAKE
7  AC_PROG_CC  AC_CONFIG_SRCDIR([README])
8  AC_PROG_LEX  AC_CONFIG_HEADER([config.h])
9  AC_PROG_YACC  AC_CONFIG_FILES([Makefile contrib/Makefile cvsgraph.1 cvsgraph.conf.5 cvsgraph.spec contrib/mkimage.php contrib/cvsgraphwrapper.php ])
10    
11  LEXFLAGS="-8"  with_gd=yes
12  LEXSPEED="-Cf"  
13  INCL=""  AC_DEFUN([AX_CHECK_GD], [
14            AC_ARG_WITH(gd,
15  dnl Extra libraries 'with'-options                  AC_HELP_STRING([--with-gd(=DIR)], [use the gd library (in DIR)]),,
16  AC_ARG_WITH(gd-inc,[  --with-gd-inc=DIR       location of the gd includes],                  with_gd=yes)
17                  [INCL="${INCL} -I${withval}"  
18                  ])  
19            AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, , [$with_gd/bin:$PATH])
20  AC_ARG_WITH(gd-lib,[  --with-gd-lib=DIR       location of the gd library],          if test -n "$GDLIB_CONFIG"; then
21                  [LIBS="${LIBS} -L${withval}"                  GD_CFLAGS=`$GDLIB_CONFIG --cflags`
22                  ])                  GD_LDFLAGS=`$GDLIB_CONFIG --ldflags`
23                    GD_LIBS=`$GDLIB_CONFIG --libs`
24  LIBS="$LIBS -lgd"          elif test -d "$with_gd"; then
25  LIBPATH=""                  GD_CFLAGS="-I$with_gd/include"
26                    GD_LDFLAGS="-L$with_gd/lib"
27  AC_ARG_WITH(freetype-lib,[  --with-freetype-lib=DIR    location of freetype library],                  AC_CHECK_LIB(z, inflateReset, GD_LIBS="-lz")
28                  [LIBS="${LIBS} -L${withval}"                  AC_CHECK_LIB(png, png_check_sig, GD_LIBS="-lpng $GD_LIBS", , $GD_LIBS)
29                  ])                  AC_CHECK_LIB(jpeg, jpeg_CreateCompress, GD_LIBS="-ljpeg $GD_LIBS", , $GD_LIBS)
   
 AC_ARG_WITH(freetype2-lib,[  --with-freetype2-lib=DIR    location of freetype2 library],  
                 [LIBS="${LIBS} -L${withval}"  
                 ])  
   
 AC_ARG_WITH(png-inc,[  --with-png-inc=DIR      location of png includes],  
                 [INCL="${INCL} -I${withval}"  
                 ])  
   
 AC_ARG_WITH(png-lib,[  --with-png-lib=DIR      location of png library],  
                 [LIBS="${LIBS} -L${withval}"  
                 ])  
   
 AC_ARG_WITH(jpeg-inc,[  --with-jpeg-inc=DIR    location of jpeg includes],  
                 [INCL="${INCL} -I${withval}"  
                 ])  
   
 AC_ARG_WITH(jpeg-lib,[  --with-jpeg-lib=DIR    location of jpeg library],  
                 [LIBS="${LIBS} -L${withval}"  
                 ])  
   
 AC_ARG_WITH(z-inc,[  --with-z-inc=DIR        location of zlib includes],  
                 [INCL="${INCL} -I${withval}"  
                 ])  
   
 AC_ARG_WITH(z-lib,[  --with-z-lib=DIR        location of zlib library],  
                 [LIBS="${LIBS} -L${withval}"  
                 ])  
   
 AC_ARG_ENABLE(speed,[  --disable-speed         Turn off lex table optimization reducing speed and size of executable],  
                 [if test "$enableval" = "no"; then LEXSPEED=""; fi])  
   
 if test "x$LEXSPEED" != "x"  
 then  
   LEXFLAGS="$LEXFLAGS $LEXSPEED"  
 fi  
   
 CPPFLAGS="$CPPFLAGS $INCL"  
 CFLAGS="$CFLAGS $INCL"  
   
 dnl Tests for gcc  
 if test "x${GCC}" = "xyes"  
 then  
   CFLAGS="$CFLAGS -Wall"  
   AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,  
                   AC_TRY_RUN([  
 int main(void) {  
   static int Array[[3]];  
   unsigned int B = 3;  
   int i;  
   for(i=0; i<B; i++) Array[[i]] = i - 3;  
   exit( Array[[1]] != -2 );  
 }],  
     ac_cv_c_gcc_strength_bug="no",  
     ac_cv_c_gcc_strength_bug="yes",  
     ac_cv_c_gcc_strength_bug="yes") )  
   if test "$ac_cv_c_gcc_strength_bug" = "yes"  
   then  
     CFLAGS="$CFLAGS -fno-strength-reduce"  
   fi  
 fi  
   
 AC_CACHE_CHECK( "sizes of int and void *", ac_cv_c_size_int_ptr,  
           AC_TRY_RUN([  
 int main(void) {  
   return sizeof(int) == sizeof(void *);  
 }],  
     ac_cv_c_size_int_ptr="no",  
     ac_cv_c_size_int_ptr="yes",  
     ac_cv_c_size_int_ptr="yes") )  
 if test "$ac_cv_c_size_int_ptr" = "no"  
 then  
         echo "** The size of an integer is not equal to a pointer."  
         echo "   There are currently assumtions in the app that"  
         echo "   prevents it from running if these sizes are not"  
         echo "   equal."  
         echo "   Please configure with a compiler that uses the"  
         echo "   same sizes for ints and pointers."  
         exit 1  
 fi  
   
 dnl Check getopt.h because Solaris 8 doesn't have one  
 AC_CHECK_HEADER(getopt.h, [ AC_DEFINE(HAVE_GETOPT_H) ])  
   
 dnl Make sure the gd 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  
   
 dnl Checks for libraries.  
 AC_CHECK_LIB(m, sqrt, [  
         AC_DEFINE(LIBM)  
         MATHLIBS="-lm"  
         ])  
   
 AC_CHECK_LIB(z, compress, [  
         ac_have_libz="yes"  
         ZLIB="-lz"  
         ] , [  
         ac_have_libz="no"  
         ] , ${LIBPATH} ${MATHLIBS} )  
   
 AC_CHECK_LIB(freetype, FT_Load_Glyph, [  
         ac_have_libfreetype="yes"  
         LIBFT="-lfreetype"  
         ] , [  
         ac_have_libfreetype="no"  
         ] , ${LIBPATH} ${MATHLIBS} )  
   
 AC_CHECK_LIB(ttf, TT_Load_Glyph, [  
         ac_have_libttf="yes"  
         LIBTT="-lttf"  
         ] , [  
         ac_have_libttf="no"  
         ] , ${LIBPATH} ${MATHLIBS} )  
   
 AC_CHECK_LIB(png, png_create_read_struct , [  
         ac_have_libpng="yes"  
         LIBPNG="-lpng"  
         ] , [  
         ac_have_libpng="no"  
         ] , ${LIBPATH} ${ZLIB} ${MATHLIBS} )  
   
 AC_CHECK_LIB(jpeg, jpeg_CreateCompress, [  
         ac_have_libjpeg="yes"  
         LIBJPEG="-ljpeg"  
         ] , [  
         ac_have_libjpeg="no"  
         ] , ${LIBPATH} ${MATHLIBS} )  
   
 dnl Check which libraries we need to add  
 OLIBS="${LIBS}"  
 LIBS="${LIBS} ${MATHLIB}"  
 AC_CACHE_CHECK( "whether libpng needs -lz", ac_cv_png_needs_z,  
           AC_TRY_LINK_FUNC( png_create_read_struct, [  
         ac_cv_png_needs_z="no"  
         ] , [  
         ac_cv_png_needs_z="yes"  
         ] ) )  
 LIBS="${OLIBS}"  
   
   
 OLIBS="${LIBS}"  
 LIBS="${LIBS} ${LIBFT} ${LIBTT} ${LIBJPEG} ${MATHLIB}"  
 AC_CACHE_CHECK( "whether libgd needs -lpng", ac_cv_gd_needs_png,  
           AC_TRY_LINK_FUNC( gdImageCreate, [  
         ac_cv_gd_needs_png="no"  
         ] , [  
         ac_cv_gd_needs_png="yes"  
         ] ) )  
 LIBS="${OLIBS}"  
   
 OLIBS="${LIBS}"  
 LIBS="${LIBS} ${LIBFT} ${LIBTT} ${LIBPNG} ${LIBZ} ${MATHLIB}"  
 AC_CACHE_CHECK( "whether libgd needs -ljpeg", ac_cv_gd_needs_jpeg,  
           AC_TRY_LINK_FUNC( gdImageCreate, [  
         ac_cv_gd_needs_jpeg="no"  
         ] , [  
         ac_cv_gd_needs_jpeg="yes"  
         ] ) )  
 LIBS="${OLIBS}"  
   
 OLIBS="${LIBS}"  
 LIBS="${LIBS} ${LIBFT} ${LIBJPEG} ${LIBPNG} ${LIBZ} ${MATHLIB}"  
 AC_CACHE_CHECK( "whether libgd needs -lttf", ac_cv_gd_needs_ttf,  
           AC_TRY_LINK_FUNC( gdImageCreate, [  
         ac_cv_gd_needs_ttf="no"  
         ] , [  
         ac_cv_gd_needs_ttf="yes"  
         ] ) )  
 LIBS="${OLIBS}"  
   
 OLIBS="${LIBS}"  
 LIBS="${LIBS} ${LIBTT} ${LIBJPEG} ${LIBPNG} ${LIBZ} ${MATHLIB}"  
 AC_CACHE_CHECK( "whether libgd needs -lfreetype", ac_cv_gd_needs_freetype,  
           AC_TRY_LINK_FUNC( gdImageCreate, [  
         ac_cv_gd_needs_freetype="no"  
         ] , [  
         ac_cv_gd_needs_freetype="yes"  
         ] ) )  
 LIBS="${OLIBS}"  
   
 if test "$ac_cv_gd_needs_freetype" = "yes"  
 then  
         if test "$ac_have_libfreetype" != "yes"  
         then  
                 echo "** WARNING: Required library libfreetype not found"  
         fi  
         LIBS="${LIBS} ${LIBFT}"  
 fi  
   
 if test "$ac_cv_gd_needs_ttf" = "yes"  
 then  
         if test "$ac_have_libttf" != "yes"  
         then  
                 echo "** WARNING: Required library libttf not found"  
30          fi          fi
         LIBS="${LIBS} ${LIBTT}"  
 fi  
31    
32  if test "$ac_cv_gd_needs_jpeg" = "yes"          save_CFLAGS="$CFLAGS"
33  then          CFLAGS="$GD_CFLAGS $CFLAGS"
34          if test "$ac_have_libjpeg" != "yes"          save_LDFLAGS="$LDFLAGS"
35          then          LDFLAGS="$GD_LDFLAGS $LDFLAGS"
36                  echo "** WARNING: Required library libjpeg not found"          save_LIBS="$LIBS"
37          fi          LIBS="$GD_LIBS $LIBS"
38          LIBS="${LIBS} ${LIBJPEG}"  
39  fi          AC_CHECK_LIB(gd, gdImageCreate, [
40                    AC_DEFINE(HAVE_GD, 1, [ Define if you have gd library. ])
41                    AC_CHECK_LIB(gd, gdImageGif, AC_DEFINE(HAVE_GD_GIF, 1, [ Define if GD supports gif. ]), , "$GD_LIBS")
42                    AC_CHECK_LIB(gd, gdImageJpeg, AC_DEFINE(HAVE_GD_JPEG, 1, [ Define if GD supports jpeg. ]), , "$GD_LIBS")
43                    AC_CHECK_LIB(gd, gdImagePng, AC_DEFINE(HAVE_GD_PNG, 1, [ Define if GD supports png. ]), , "$GD_LIBS")
44                    AC_CHECK_LIB(gd, gdImagePngEx, AC_DEFINE(HAVE_GD_PNGEX, 1, [ Define if GD supports extended png. ]), , "$GD_LIBS")
45                    AC_CHECK_LIB(gd, gdImageFilledArc, AC_DEFINE(HAVE_GD_FILLEDARC, 1, [ Define if GD supports filled arcs]), , "$GD_LIBS")
46    
47  if test "$ac_cv_gd_needs_png" = "yes"                  if test "$ac_cv_lib_freetype_FT_Load_Glyph" = "yes"
 then  
         if test "$ac_have_libpng" != "yes"  
         then  
                 echo "** WARNING: Required library libpng not found"  
         fi  
         LIBS="${LIBS} ${LIBPNG}"  
         if test "$ac_cv_png_needs_z" = "yes"  
         then  
                 if test "$ac_have_libz" != "yes"  
48                  then                  then
49                          echo "** WARNING: Required library libz not found"                          AC_CHECK_LIB(gd, gdImageStringFT, AC_DEFINE(HAVE_GD_STRINGFT, 1, [ Define if GD supports truetype lib v2]), , "$GD_LIBS")
50                  fi                  fi
51                  LIBS="${LIBS} ${LIBZ}"                  if test "$ac_cv_lib_ttf_TT_Load_Glyph" = "yes"
52                    then
53                            AC_CHECK_LIB(gd, gdImageStringTTF, AC_DEFINE(HAVE_GD_STRINGTTF, 1, [ Define if GD supports truetype lib v1]), , "$GD_LIBS")
54                    fi
55                    GD_LIBS="-lgd $GD_LIBS"
56            ], , $GD_LIBS)
57    
58            CFLAGS="$save_CFLAGS"
59            LDFLAGS="$save_LDFLAGS"
60            if test -n "$GDLIB_CONFIG"; then
61                    LIBS="$GD_LIBS"
62            else
63                    LIBS="$GD_LIBS $LIBS"
64          fi          fi
65  fi          AC_SUBST(GD_CFLAGS)
66            AC_SUBST(GD_LDFLAGS)
67            AC_SUBST(GD_LIBS)
68    ])
69    
70  LIBS="${LIBS} ${MATHLIBS}"  # Checks for programs.
71    AC_PROG_CC
72    AC_PROG_LEX
73    AC_PROG_YACC
74    AC_PATH_PROG(ac_prog_pkg_config, pkg-config)
75    
76  dnl which version of gd do we have here?  AC_CHECK_LIB(m, sqrt)
 AC_CHECK_LIB(gd, gdImageGif, [  
         AC_DEFINE(HAVE_IMAGE_GIF)  
         have_gifs="yes"  
         ] ,  
         have_gifs="no"  
         )  
77    
78  if test "${have_gifs}" = "yes"  AC_CHECK_LIB(freetype, FT_Load_Glyph)
79    if test "$ac_cv_lib_freetype_FT_Load_Glyph" != "yes"
80  then  then
81          echo "** You have a very old GD library. Please consider"          AC_CHECK_LIB(ttf, TT_Load_Glyph)
         echo "   upgrading to a more recent version (1.8.4 or newer)."  
         echo "   --Note that f.x. ViewCVS needs CvsGraph to generate PNG"  
         echo "     images and ancient GD libraries might contain many bugs."  
         echo "     However, if you need GIFs, then you must stick to this"  
         echo "     old version."  
82  fi  fi
83    
84  AC_CHECK_LIB(gd, gdImagePng, [  # find out what the GD library uses
85          AC_DEFINE(HAVE_IMAGE_PNG)  AX_CHECK_GD
         ])  
 AC_CHECK_LIB(gd, gdImageJpeg, [  
         AC_DEFINE(HAVE_IMAGE_JPEG)  
         ])  
 AC_CHECK_LIB(gd, gdImageStringTTF, [  
         AC_DEFINE(HAVE_GDIMAGESTRINGTTF)  
         ])  
 AC_CHECK_LIB(gd, gdImageStringFT, [  
         AC_DEFINE(HAVE_GDIMAGESTRINGFT)  
         ])  
   
86    
87  AC_SUBST(LEXFLAGS)  # Checks for header files.
88    AC_HEADER_STDC
89    AC_CHECK_HEADERS([getopt.h sys/wait.h gd.h])
90    
91  AC_OUTPUT(Makefile)  # Checks for typedefs, structures, and compiler characteristics.
92    AC_C_CONST
93    AC_C_INLINE
94    AC_TYPE_SIZE_T
95    AC_HEADER_TIME
96    
97  echo "Configure done. Run 'make' to build CvsGraph"  # Checks for library functions.
98    AC_CHECK_FUNCS([memset strdup strtol])
99    
100    AC_OUTPUT

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

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0