/[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.9 - (hide annotations)
Sat Jul 20 00:48:17 2002 UTC (15 years, 4 months ago) by bertho
Branch: MAIN
Changes since 1.8: +184 -47 lines
Hopefully fixed configure problems
Prepared new release 1.3.0
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 bertho 1.2 AC_CONFIG_HEADER(config.h)
7 bertho 1.1
8     AC_PROG_CC
9     AC_PROG_LEX
10     AC_PROG_YACC
11    
12 bertho 1.3 LEXFLAGS="-8"
13     LEXSPEED="-Cf"
14 bertho 1.5 INCL=""
15 bertho 1.3
16 bertho 1.1 dnl Extra libraries 'with'-options
17 bertho 1.5 AC_ARG_WITH(gd-inc,[ --with-gd-inc=DIR location of the gd includes],
18     [INCL="${INCL} -I${withval}"
19 bertho 1.4 ])
20    
21 bertho 1.5 AC_ARG_WITH(gd-lib,[ --with-gd-lib=DIR location of the gd library],
22     [LIBS="${LIBS} -L${withval}"
23 bertho 1.1 ])
24    
25 bertho 1.5 LIBS="$LIBS -lgd"
26 bertho 1.9 LIBPATH=""
27 bertho 1.5
28 bertho 1.8 AC_ARG_WITH(freetype-lib,[ --with-freetype-lib=DIR location of freetype library],
29 bertho 1.9 [LIBS="${LIBS} -L${withval}"
30 bertho 1.5 ])
31    
32 bertho 1.8 AC_ARG_WITH(freetype2-lib,[ --with-freetype2-lib=DIR location of freetype2 library],
33 bertho 1.9 [LIBS="${LIBS} -L${withval}"
34 bertho 1.5 ])
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 bertho 1.9 [LIBS="${LIBS} -L${withval}"
42 bertho 1.4 ])
43    
44 bertho 1.5 AC_ARG_WITH(jpeg-inc,[ --with-jpeg-inc=DIR location of jpeg includes],
45     [INCL="${INCL} -I${withval}"
46 bertho 1.1 ])
47    
48 bertho 1.5 AC_ARG_WITH(jpeg-lib,[ --with-jpeg-lib=DIR location of jpeg library],
49 bertho 1.9 [LIBS="${LIBS} -L${withval}"
50 bertho 1.1 ])
51    
52 bertho 1.8 AC_ARG_WITH(z-inc,[ --with-z-inc=DIR location of zlib includes],
53     [INCL="${INCL} -I${withval}"
54 bertho 1.7 ])
55    
56 bertho 1.8 AC_ARG_WITH(z-lib,[ --with-z-lib=DIR location of zlib library],
57 bertho 1.9 [LIBS="${LIBS} -L${withval}"
58 bertho 1.7 ])
59    
60 bertho 1.3 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 bertho 1.5 CPPFLAGS="$CPPFLAGS $INCL"
69     CFLAGS="$CFLAGS $INCL"
70 bertho 1.1
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 bertho 1.9 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 bertho 1.6 dnl Check getopt.h because Solaris 8 doesn't have one
113     AC_CHECK_HEADER(getopt.h, [ AC_DEFINE(HAVE_GETOPT_H) ])
114 bertho 1.1
115 bertho 1.9 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 bertho 1.1 dnl Checks for libraries.
131     AC_CHECK_LIB(m, sqrt, [
132     AC_DEFINE(LIBM)
133 bertho 1.8 MATHLIBS="-lm"
134     ])
135 bertho 1.1
136 bertho 1.9 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( gdImageCreate, [
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( gdImageCreate, [
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( gdImageCreate, [
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( gdImageCreate, [
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"
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"
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 bertho 1.8 then
243 bertho 1.9 if test "$ac_have_libjpeg" != "yes"
244 bertho 1.8 then
245 bertho 1.9 echo "** WARNING: Required library libjpeg not found"
246 bertho 1.8 fi
247 bertho 1.9 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 bertho 1.8 then
254 bertho 1.9 echo "** WARNING: Required library libpng not found"
255 bertho 1.8 fi
256 bertho 1.9 LIBS="${LIBS} ${LIBPNG}"
257     if test "$ac_cv_png_needs_z" = "yes"
258 bertho 1.8 then
259 bertho 1.9 if test "$ac_have_libz" != "yes"
260     then
261     echo "** WARNING: Required library libz not found"
262     fi
263     LIBS="${LIBS} ${LIBZ}"
264 bertho 1.8 fi
265     fi
266    
267     LIBS="${LIBS} ${MATHLIBS}"
268    
269 bertho 1.9 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 bertho 1.2 AC_DEFINE(HAVE_IMAGE_PNG)
289     ])
290 bertho 1.9 AC_CHECK_LIB(gd, gdImageJpeg, [
291 bertho 1.2 AC_DEFINE(HAVE_IMAGE_JPEG)
292 bertho 1.7 ])
293 bertho 1.9 AC_CHECK_LIB(gd, gdImageStringTTF, [
294 bertho 1.7 AC_DEFINE(HAVE_GDIMAGESTRINGTTF)
295     ])
296 bertho 1.9 AC_CHECK_LIB(gd, gdImageStringFT, [
297 bertho 1.7 AC_DEFINE(HAVE_GDIMAGESTRINGFT)
298 bertho 1.2 ])
299 bertho 1.1
300    
301 bertho 1.3 AC_SUBST(LEXFLAGS)
302 bertho 1.1
303     AC_OUTPUT(Makefile)
304    
305     echo "Configure done. Run 'make' to build CvsGraph"
306    

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0