1 |
# -*- Autoconf -*-
|
2 |
# Process this file with autoconf to produce a configure script.
|
3 |
|
4 |
#AC_PREREQ(2.59)
|
5 |
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
|
72 |
AC_PROG_LEX
|
73 |
AC_PROG_YACC
|
74 |
AC_PATH_PROG(ac_prog_pkg_config, pkg-config)
|
75 |
|
76 |
AC_CHECK_LIB(m, sqrt)
|
77 |
|
78 |
AC_CHECK_LIB(freetype, FT_Load_Glyph)
|
79 |
if test "$ac_cv_lib_freetype_FT_Load_Glyph" != "yes"
|
80 |
then
|
81 |
AC_CHECK_LIB(ttf, TT_Load_Glyph)
|
82 |
fi
|
83 |
|
84 |
# find out what the GD library uses
|
85 |
AX_CHECK_GD
|
86 |
|
87 |
# 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 |
# Checks for library functions.
|
98 |
AC_CHECK_FUNCS([memset strdup strtol])
|
99 |
|
100 |
AC_OUTPUT
|