File: configure.in

package info (click to toggle)
cvsgraph 1.7.0-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,272 kB
  • sloc: ansic: 5,248; sh: 950; yacc: 440; lex: 212; makefile: 61
file content (100 lines) | stat: -rw-r--r-- 3,101 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

#AC_PREREQ(2.59)
AC_INIT(cvsgraph, 1.7.0, cvsgraph@akhphd.au.dk)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([README])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile contrib/Makefile cvsgraph.1 cvsgraph.conf.5 cvsgraph.spec contrib/mkimage.php contrib/cvsgraphwrapper.php ])

with_gd=yes

AC_DEFUN([AX_CHECK_GD], [
	AC_ARG_WITH(gd,
		AC_HELP_STRING([--with-gd(=DIR)], [use the gd library (in DIR)]),,
		with_gd=yes)


	AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, , [$with_gd/bin:$PATH])
	if test -n "$GDLIB_CONFIG"; then
		GD_CFLAGS=`$GDLIB_CONFIG --cflags`
		GD_LDFLAGS=`$GDLIB_CONFIG --ldflags`
		GD_LIBS=`$GDLIB_CONFIG --libs`
	elif test -d "$with_gd"; then
		GD_CFLAGS="-I$with_gd/include"
		GD_LDFLAGS="-L$with_gd/lib"
		AC_CHECK_LIB(z, inflateReset, GD_LIBS="-lz")
		AC_CHECK_LIB(png, png_check_sig, GD_LIBS="-lpng $GD_LIBS", , $GD_LIBS)
		AC_CHECK_LIB(jpeg, jpeg_CreateCompress, GD_LIBS="-ljpeg $GD_LIBS", , $GD_LIBS)
	fi

	save_CFLAGS="$CFLAGS"
	CFLAGS="$GD_CFLAGS $CFLAGS"
	save_LDFLAGS="$LDFLAGS"
	LDFLAGS="$GD_LDFLAGS $LDFLAGS"
	save_LIBS="$LIBS"
	LIBS="$GD_LIBS $LIBS"

	AC_CHECK_LIB(gd, gdImageCreate, [
		AC_DEFINE(HAVE_GD, 1, [ Define if you have gd library. ])
		AC_CHECK_LIB(gd, gdImageGif, AC_DEFINE(HAVE_GD_GIF, 1, [ Define if GD supports gif. ]), , "$GD_LIBS")
		AC_CHECK_LIB(gd, gdImageJpeg, AC_DEFINE(HAVE_GD_JPEG, 1, [ Define if GD supports jpeg. ]), , "$GD_LIBS")
		AC_CHECK_LIB(gd, gdImagePng, AC_DEFINE(HAVE_GD_PNG, 1, [ Define if GD supports png. ]), , "$GD_LIBS")
		AC_CHECK_LIB(gd, gdImagePngEx, AC_DEFINE(HAVE_GD_PNGEX, 1, [ Define if GD supports extended png. ]), , "$GD_LIBS")
		AC_CHECK_LIB(gd, gdImageFilledArc, AC_DEFINE(HAVE_GD_FILLEDARC, 1, [ Define if GD supports filled arcs]), , "$GD_LIBS")

		if test "$ac_cv_lib_freetype_FT_Load_Glyph" = "yes"
		then
			AC_CHECK_LIB(gd, gdImageStringFT, AC_DEFINE(HAVE_GD_STRINGFT, 1, [ Define if GD supports truetype lib v2]), , "$GD_LIBS")
		fi
		if test "$ac_cv_lib_ttf_TT_Load_Glyph" = "yes"
		then
			AC_CHECK_LIB(gd, gdImageStringTTF, AC_DEFINE(HAVE_GD_STRINGTTF, 1, [ Define if GD supports truetype lib v1]), , "$GD_LIBS")
		fi
		GD_LIBS="-lgd $GD_LIBS"
	], , $GD_LIBS)

	CFLAGS="$save_CFLAGS"
	LDFLAGS="$save_LDFLAGS"
	if test -n "$GDLIB_CONFIG"; then
		LIBS="$GD_LIBS"
	else
		LIBS="$GD_LIBS $LIBS"
	fi
        AC_SUBST(GD_CFLAGS)
        AC_SUBST(GD_LDFLAGS)
        AC_SUBST(GD_LIBS)
])

# Checks for programs.
AC_PROG_CC
AC_PROG_LEX
AC_PROG_YACC
AC_PATH_PROG(ac_prog_pkg_config, pkg-config)

AC_CHECK_LIB(m, sqrt)

AC_CHECK_LIB(freetype, FT_Load_Glyph)
if test "$ac_cv_lib_freetype_FT_Load_Glyph" != "yes"
then
	AC_CHECK_LIB(ttf, TT_Load_Glyph)
fi

# find out what the GD library uses
AX_CHECK_GD

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([getopt.h sys/wait.h gd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME

# Checks for library functions.
AC_CHECK_FUNCS([memset strdup strtol])

AC_OUTPUT