/[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.10 - (show annotations)
Sat Jul 20 20:41:40 2002 UTC (15 years, 3 months ago) by bertho
Branch: MAIN
CVS Tags: REL_1_4_0, REL_1_3_0
Changes since 1.9: +14 -8 lines
Add rev_maxtags config to limit number of tags per revison box
Hopefully fix configure.in (finally?)
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 LIBPATH=""
27
28 AC_ARG_WITH(freetype-lib,[ --with-freetype-lib=DIR location of freetype library],
29 [LIBS="${LIBS} -L${withval}"
30 ])
31
32 AC_ARG_WITH(freetype2-lib,[ --with-freetype2-lib=DIR location of freetype2 library],
33 [LIBS="${LIBS} -L${withval}"
34 ])
35
36 AC_ARG_WITH(png-inc,[ --with-png-inc=DIR location of png includes],
37 [INCL="${INCL} -I${withval}"
38 ])
39
40 AC_ARG_WITH(png-lib,[ --with-png-lib=DIR location of png library],
41 [LIBS="${LIBS} -L${withval}"
42 ])
43
44 AC_ARG_WITH(jpeg-inc,[ --with-jpeg-inc=DIR location of jpeg includes],
45 [INCL="${INCL} -I${withval}"
46 ])
47
48 AC_ARG_WITH(jpeg-lib,[ --with-jpeg-lib=DIR location of jpeg library],
49 [LIBS="${LIBS} -L${withval}"
50 ])
51
52 AC_ARG_WITH(z-inc,[ --with-z-inc=DIR location of zlib includes],
53 [INCL="${INCL} -I${withval}"
54 ])
55
56 AC_ARG_WITH(z-lib,[ --with-z-lib=DIR location of zlib library],
57 [LIBS="${LIBS} -L${withval}"
58 ])
59
60 AC_ARG_ENABLE(speed,[ --disable-speed Turn off lex table optimization reducing speed and size of executable],
61 [if test "$enableval" = "no"; then LEXSPEED=""; fi])
62
63 if test "x$LEXSPEED" != "x"
64 then
65 LEXFLAGS="$LEXFLAGS $LEXSPEED"
66 fi
67
68 CPPFLAGS="$CPPFLAGS $INCL"
69 CFLAGS="$CFLAGS $INCL"
70
71 dnl Tests for gcc
72 if test "x${GCC}" = "xyes"
73 then
74 CFLAGS="$CFLAGS -Wall"
75 AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
76 AC_TRY_RUN([
77 int main(void) {
78 static int Array[[3]];
79 unsigned int B = 3;
80 int i;
81 for(i=0; i<B; i++) Array[[i]] = i - 3;
82 exit( Array[[1]] != -2 );
83 }],
84 ac_cv_c_gcc_strength_bug="no",
85 ac_cv_c_gcc_strength_bug="yes",
86 ac_cv_c_gcc_strength_bug="yes") )
87 if test "$ac_cv_c_gcc_strength_bug" = "yes"
88 then
89 CFLAGS="$CFLAGS -fno-strength-reduce"
90 fi
91 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
113 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.
131 AC_CHECK_LIB(m, sqrt, [
132 AC_DEFINE(LIBM)
133 MATHLIBS="-lm"
134 ])
135
136 AC_CHECK_LIB(z, compress, [
137 ac_have_libz="yes"
138 ZLIB="-lz"
139 ] , [
140 ac_have_libz="no"
141 ] , ${LIBPATH} ${MATHLIBS} )
142
143 AC_CHECK_LIB(freetype, FT_Load_Glyph, [
144 ac_have_libfreetype="yes"
145 LIBFT="-lfreetype"
146 ] , [
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( gdImagePng, [
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( gdImageJpeg, [
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( gdImageStringTTF, [
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( gdImageStringFT, [
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" -a "$ac_have_libttf" != "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
234 if test "$ac_have_libttf" != "yes" -a "$ac_have_libfreetype" != "yes"
235 then
236 echo "** WARNING: Required library libttf not found"
237 fi
238 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
245 echo "** WARNING: Required library libjpeg not found"
246 fi
247 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
254 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
265 fi
266
267 LIBS="${LIBS} ${MATHLIBS}"
268
269 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)
289 ])
290 AC_CHECK_LIB(gd, gdImageJpeg, [
291 AC_DEFINE(HAVE_IMAGE_JPEG)
292 ])
293 AC_CHECK_LIB(gd, gdImageStringTTF, [
294 if test "$ac_have_libttf" = "yes"
295 then
296 AC_DEFINE(HAVE_GDIMAGESTRINGTTF)
297 fi
298 ])
299 AC_CHECK_LIB(gd, gdImageStringFT, [
300 if test "$ac_have_libfreetype" = "yes"
301 then
302 AC_DEFINE(HAVE_GDIMAGESTRINGFT)
303 fi
304 ])
305
306
307 AC_SUBST(LEXFLAGS)
308
309 AC_OUTPUT(Makefile)
310
311 echo "Configure done. Run 'make' to build CvsGraph"
312

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0