/[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.1 - (hide annotations)
Fri Feb 23 00:11:30 2001 UTC (16 years, 7 months ago) by bertho
Branch: MAIN
Start to use autoconf. This makes detecting old/new libgd easier.
Also a bit more portable.
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    
7     AC_PROG_CC
8     AC_PROG_LEX
9     AC_PROG_YACC
10    
11     dnl Extra libraries 'with'-options
12     AC_ARG_WITH(gd,[ --with-gd=DIR location of the gd lib/inc],
13     [LDFLAGS="${LDFLAGS} -L${withval}"
14     CFLAGS="${CFLAGS} -I${withval}"
15     ])
16    
17     AC_ARG_WITH(z,[ --with-z=DIR location of zlib lib/inc],
18     [LDFLAGS="${LDFLAGS} -L${withval}"
19     CFLAGS="${CFLAGS} -I${withval}"
20     ])
21    
22     AC_ARG_WITH(png,[ --with-png=DIR location of png lib/inc],
23     [LDFLAGS="${LDFLAGS} -L${withval}"
24     CFLAGS="${CFLAGS} -I${withval}"
25     ])
26    
27     LDFLAGS="${LDFLAGS} -lgd"
28    
29    
30     dnl Tests for gcc
31     if test "x${GCC}" = "xyes"
32     then
33     CFLAGS="$CFLAGS -Wall"
34     AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
35     AC_TRY_RUN([
36     int main(void) {
37     static int Array[[3]];
38     unsigned int B = 3;
39     int i;
40     for(i=0; i<B; i++) Array[[i]] = i - 3;
41     exit( Array[[1]] != -2 );
42     }],
43     ac_cv_c_gcc_strength_bug="no",
44     ac_cv_c_gcc_strength_bug="yes",
45     ac_cv_c_gcc_strength_bug="yes") )
46     if test "$ac_cv_c_gcc_strength_bug" = "yes"
47     then
48     CFLAGS="$CFLAGS -fno-strength-reduce"
49     fi
50     fi
51    
52    
53     dnl Checks for libraries.
54     AC_CHECK_LIB(m, sqrt, [
55     AC_DEFINE(LIBM)
56     MATHLIBS="-lm" ])
57    
58     dnl which version of gd do we have here? (taken from mrtg config)
59     AC_CHECK_LIB(gd,gdImageGif,[
60     CFLAGS="$CFLAGS -DGD_IMAGE_XXX=gdImageGif"
61     ])
62     AC_CHECK_LIB(gd,gdImagePng,[
63     CFLAGS="$CFLAGS -DGD_IMAGE_XXX=gdImagePng"
64     LDFLAGS="$LDFLAGS -lpng -lz ${MATHLIBS}"
65     ],:,[-lpng -lz ${MATHLIBS}])
66    
67    
68     dnl Make sure the header is here
69     AC_CHECK_HEADER( gd.h,[ have_gd_h="yes" ],[ have_gd_h="no" ])
70    
71     if test $have_gd_h != "yes"; then
72     echo
73     echo "** The GD library is required for CvsGraph to function."
74     echo " Get it from http://www.boutell.com, compile it and"
75     echo " use either --with-gd-lib=DIR and --with-gd-inc=DIR to specify"
76     echo " its location. You might also have to use --with-z-inc, --with-z-lib"
77     echo " and --with-png-inc, --with-png-lib for gd versions 1.6 and higher."
78     echo " Check config.log for more information on the problem. If your system"
79     echo " has libgd installed, you probably mis the gd.h header file."
80     exit 1
81     fi
82    
83    
84     AC_OUTPUT(Makefile)
85    
86     echo "Configure done. Run 'make' to build CvsGraph"
87    

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0