/[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.8 - (show annotations)
Wed Jun 19 14:47:55 2002 UTC (15 years, 6 months ago) by bertho
Branch: MAIN
Changes since 1.7: +41 -10 lines
- Fix order of libraries
- Add auto-addition of libs when gifs are missing
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 AC_CONFIG_HEADER(config.h)
7
8 AC_PROG_CC
9 AC_PROG_LEX
10 AC_PROG_YACC
11
12 LEXFLAGS="-8"
13 LEXSPEED="-Cf"
14 INCL=""
15
16 dnl Extra libraries 'with'-options
17 AC_ARG_WITH(gd-inc,[ --with-gd-inc=DIR location of the gd includes],
18 [INCL="${INCL} -I${withval}"
19 ])
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 have_lib_png="no"
27 have_lib_z="no"
28 have_lib_jpeg="no"
29
30 AC_ARG_WITH(freetype-lib,[ --with-freetype-lib=DIR location of freetype library],
31 [LIBS="${LIBS} -L${withval} -lttf"
32 ])
33
34 AC_ARG_WITH(freetype2-lib,[ --with-freetype2-lib=DIR location of freetype2 library],
35 [LIBS="${LIBS} -L${withval} -lfreetype"
36 ])
37
38 AC_ARG_WITH(png-inc,[ --with-png-inc=DIR location of png includes],
39 [INCL="${INCL} -I${withval}"
40 ])
41
42 AC_ARG_WITH(png-lib,[ --with-png-lib=DIR location of png library],
43 [LIBS="${LIBS} -L${withval} -lpng"
44 have_lib_png="yes"
45 ])
46
47 AC_ARG_WITH(jpeg-inc,[ --with-jpeg-inc=DIR location of jpeg includes],
48 [INCL="${INCL} -I${withval}"
49 ])
50
51 AC_ARG_WITH(jpeg-lib,[ --with-jpeg-lib=DIR location of jpeg library],
52 [LIBS="${LIBS} -L${withval} -ljpeg"
53 have_lib_jpeg="yes"
54 ])
55
56 AC_ARG_WITH(z-inc,[ --with-z-inc=DIR location of zlib includes],
57 [INCL="${INCL} -I${withval}"
58 ])
59
60 AC_ARG_WITH(z-lib,[ --with-z-lib=DIR location of zlib library],
61 [LIBS="${LIBS} -L${withval} -lz"
62 have_lib_z="yes"
63 ])
64
65 AC_ARG_ENABLE(speed,[ --disable-speed Turn off lex table optimization reducing speed and size of executable],
66 [if test "$enableval" = "no"; then LEXSPEED=""; fi])
67
68 if test "x$LEXSPEED" != "x"
69 then
70 LEXFLAGS="$LEXFLAGS $LEXSPEED"
71 fi
72
73 CPPFLAGS="$CPPFLAGS $INCL"
74 CFLAGS="$CFLAGS $INCL"
75
76 dnl Tests for gcc
77 if test "x${GCC}" = "xyes"
78 then
79 CFLAGS="$CFLAGS -Wall"
80 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
81 AC_TRY_RUN([
82 int main(void) {
83 static int Array[[3]];
84 unsigned int B = 3;
85 int i;
86 for(i=0; i<B; i++) Array[[i]] = i - 3;
87 exit( Array[[1]] != -2 );
88 }],
89 ac_cv_c_gcc_strength_bug="no",
90 ac_cv_c_gcc_strength_bug="yes",
91 ac_cv_c_gcc_strength_bug="yes") )
92 if test "$ac_cv_c_gcc_strength_bug" = "yes"
93 then
94 CFLAGS="$CFLAGS -fno-strength-reduce"
95 fi
96 fi
97
98 dnl Check getopt.h because Solaris 8 doesn't have one
99 AC_CHECK_HEADER(getopt.h, [ AC_DEFINE(HAVE_GETOPT_H) ])
100
101 dnl Checks for libraries.
102 AC_CHECK_LIB(m, sqrt, [
103 AC_DEFINE(LIBM)
104 MATHLIBS="-lm"
105 ])
106
107 dnl which version of gd do we have here? (taken from mrtg config)
108 AC_CHECK_LIB(gd,gdImageGif,[
109 AC_DEFINE(HAVE_IMAGE_GIF)
110 ]
111 have_gifs="yes",
112 have_gifs="no",
113 $MATHLIBS )
114
115 dnl If we don't have gifs, then force png/jpeg libs to be present.
116 dnl This should be adequate for all newer libgd versions.
117 if test "$have_gifs" = "no"
118 then
119 if test "$have_lib_jpeg" = "no"
120 then
121 LIBS="${LIBS} -ljpeg"
122 fi
123 if test "$have_lib_png" = "no"
124 then
125 LIBS="${LIBS} -lpng"
126 fi
127 if test "$have_lib_z" = "no"
128 then
129 LIBS="${LIBS} -lz"
130 fi
131 fi
132
133 LIBS="${LIBS} ${MATHLIBS}"
134
135 AC_CHECK_LIB(gd,gdImagePng,[
136 AC_DEFINE(HAVE_IMAGE_PNG)
137 ])
138 AC_CHECK_LIB(gd,gdImageJpeg,[
139 AC_DEFINE(HAVE_IMAGE_JPEG)
140 ])
141 AC_CHECK_LIB(gd,gdImageStringTTF,[
142 AC_DEFINE(HAVE_GDIMAGESTRINGTTF)
143 ])
144 AC_CHECK_LIB(gd,gdImageStringFT,[
145 AC_DEFINE(HAVE_GDIMAGESTRINGFT)
146 ])
147
148
149 dnl Make sure the header is here
150 AC_CHECK_HEADER( gd.h,[ have_gd_h="yes" ],[ have_gd_h="no" ])
151
152 if test $have_gd_h != "yes"; then
153 echo
154 echo "** The GD library is required for CvsGraph to function."
155 echo " Get it from http://www.boutell.com, compile it and"
156 echo " use either --with-gd-lib=DIR and --with-gd-inc=DIR to specify"
157 echo " its location. You might also have to use --with-z-inc, --with-z-lib"
158 echo " and --with-png-inc, --with-png-lib for gd versions 1.6 and higher."
159 echo " Check config.log for more information on the problem. If your system"
160 echo " has libgd installed, you probably mis the gd.h header file."
161 exit 1
162 fi
163
164 AC_SUBST(LEXFLAGS)
165
166 AC_OUTPUT(Makefile)
167
168 echo "Configure done. Run 'make' to build CvsGraph"
169

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0