/[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.3, Sun Mar 4 01:38:23 2001 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_CONFIG_SRCDIR([README])
8    AC_CONFIG_HEADER([config.h])
9    AC_CONFIG_FILES([Makefile contrib/Makefile cvsgraph.1 cvsgraph.conf.5 cvsgraph.spec contrib/mkimage.php contrib/cvsgraphwrapper.php ])
10    
11    with_gd=yes
12    
13    AC_DEFUN([AX_CHECK_GD], [
14            AC_ARG_WITH(gd,
15                    AC_HELP_STRING([--with-gd(=DIR)], [use the gd library (in DIR)]),,
16                    with_gd=yes)
17    
18    
19            AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, , [$with_gd/bin:$PATH])
20            if test -n "$GDLIB_CONFIG"; then
21                    GD_CFLAGS=`$GDLIB_CONFIG --cflags`
22                    GD_LDFLAGS=`$GDLIB_CONFIG --ldflags`
23                    GD_LIBS=`$GDLIB_CONFIG --libs`
24            elif test -d "$with_gd"; then
25                    GD_CFLAGS="-I$with_gd/include"
26                    GD_LDFLAGS="-L$with_gd/lib"
27                    AC_CHECK_LIB(z, inflateReset, GD_LIBS="-lz")
28                    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)
30            fi
31    
32            save_CFLAGS="$CFLAGS"
33            CFLAGS="$GD_CFLAGS $CFLAGS"
34            save_LDFLAGS="$LDFLAGS"
35            LDFLAGS="$GD_LDFLAGS $LDFLAGS"
36            save_LIBS="$LIBS"
37            LIBS="$GD_LIBS $LIBS"
38    
39            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_lib_freetype_FT_Load_Glyph" = "yes"
48                    then
49                            AC_CHECK_LIB(gd, gdImageStringFT, AC_DEFINE(HAVE_GD_STRINGFT, 1, [ Define if GD supports truetype lib v2]), , "$GD_LIBS")
50                    fi
51                    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
65            AC_SUBST(GD_CFLAGS)
66            AC_SUBST(GD_LDFLAGS)
67            AC_SUBST(GD_LIBS)
68    ])
69    
70    # Checks for programs.
71  AC_PROG_CC  AC_PROG_CC
72  AC_PROG_LEX  AC_PROG_LEX
73  AC_PROG_YACC  AC_PROG_YACC
74    AC_PATH_PROG(ac_prog_pkg_config, pkg-config)
75    
76  LEXFLAGS="-8"  AC_CHECK_LIB(m, sqrt)
 LEXSPEED="-Cf"  
77    
78  dnl Extra libraries 'with'-options  AC_CHECK_LIB(freetype, FT_Load_Glyph)
79  AC_ARG_WITH(gd,[  --with-gd=DIR           location of the gd lib/inc],  if test "$ac_cv_lib_freetype_FT_Load_Glyph" != "yes"
                 [LDFLAGS="${LDFLAGS} -L${withval}"  
                 CFLAGS="${CFLAGS} -I${withval}"  
                 ])  
   
 AC_ARG_WITH(z,[  --with-z=DIR            location of zlib lib/inc],  
                 [LDFLAGS="${LDFLAGS} -L${withval}"  
                 CFLAGS="${CFLAGS} -I${withval}"  
                 ])  
   
 AC_ARG_WITH(png,[  --with-png=DIR          location of png lib/inc],  
                 [LDFLAGS="${LDFLAGS} -L${withval}"  
                 CFLAGS="${CFLAGS} -I${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  
   
 LDFLAGS="${LDFLAGS} -lgd"  
   
   
 dnl Tests for gcc  
 if test "x${GCC}" = "xyes"  
80  then  then
81    CFLAGS="$CFLAGS -Wall"          AC_CHECK_LIB(ttf, TT_Load_Glyph)
   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  
   
   
 dnl Checks for libraries.  
 AC_CHECK_LIB(m, sqrt, [  
         AC_DEFINE(LIBM)  
         MATHLIBS="-lm" ])  
   
 dnl which version of gd do we have here? (taken from mrtg config)  
 AC_CHECK_LIB(gd,gdImageGif,[  
         AC_DEFINE(HAVE_IMAGE_GIF)  
         ])  
 AC_CHECK_LIB(gd,gdImagePng,[  
         AC_DEFINE(HAVE_IMAGE_PNG)  
         LDFLAGS="$LDFLAGS -lpng -lz ${MATHLIBS}"  
         ])  
 AC_CHECK_LIB(gd,gdImageJpeg,[  
         AC_DEFINE(HAVE_IMAGE_JPEG)  
         LDFLAGS="$LDFLAGS -ljpeg"  
         ])  
   
   
 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  
82  fi  fi
83    
84  AC_SUBST(LEXFLAGS)  # find out what the GD library uses
85    AX_CHECK_GD
86    
87  AC_OUTPUT(Makefile)  # Checks for header files.
88    AC_HEADER_STDC
89    AC_CHECK_HEADERS([getopt.h sys/wait.h gd.h])
90    
91    # 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.3  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0