File: configure.in

package info (click to toggle)
cvsgraph 1.1.2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 264 kB
  • ctags: 325
  • sloc: ansic: 1,616; yacc: 596; lex: 338; makefile: 84; php: 42
file content (122 lines) | stat: -rw-r--r-- 3,141 bytes parent folder | download
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
dnl Configure.in script for CvsGraph
dnl Most of the stuff is gathered from other
dnl scripts that seem to do a pretty good job.

AC_INIT(cvsgraph.c)
AC_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_PROG_LEX
AC_PROG_YACC

LEXFLAGS="-8"
LEXSPEED="-Cf"
INCL=""

dnl Extra libraries 'with'-options
AC_ARG_WITH(gd-inc,[  --with-gd-inc=DIR       location of the gd includes],
		[INCL="${INCL} -I${withval}"
		])

AC_ARG_WITH(gd-lib,[  --with-gd-lib=DIR       location of the gd library],
		[LIBS="${LIBS} -L${withval}"
		])

LIBS="$LIBS -lgd"

AC_ARG_WITH(z-inc,[  --with-z-inc=DIR        location of zlib includes],
		[INCL="${INCL} -I${withval}"
		])

AC_ARG_WITH(z-lib,[  --with-z-lib=DIR        location of zlib library],
		[LIBS="${LIBS} -L${withval} -lz"
		])

AC_ARG_WITH(png-inc,[  --with-png-inc=DIR      location of png includes],
		[INCL="${INCL} -I${withval}"
		])

AC_ARG_WITH(png-lib,[  --with-png-lib=DIR      location of png library],
		[LIBS="${LIBS} -L${withval} -lpng"
		])

AC_ARG_WITH(jpeg-inc,[  --with-jpeg-inc=DIR    location of jpeg includes],
		[INCL="${INCL} -I${withval}"
		])

AC_ARG_WITH(jpeg-lib,[  --with-jpeg-lib=DIR    location of jpeg library],
		[LIBS="${LIBS} -L${withval} -ljpeg"
		])

AC_ARG_ENABLE(speed,[  --disable-speed         Turn off lex table optimization reducing speed and size of executable],
		[if test "$enableval" = "no"; then LEXSPEED=""; fi])

if test "x$LEXSPEED" != "x"
then
  LEXFLAGS="$LEXFLAGS $LEXSPEED"
fi

CPPFLAGS="$CPPFLAGS $INCL"
CFLAGS="$CFLAGS $INCL"

dnl Tests for gcc
if test "x${GCC}" = "xyes"
then
  CFLAGS="$CFLAGS -Wall"
  AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
                  AC_TRY_RUN([
int main(void) {
  static int Array[[3]];
  unsigned int B = 3;
  int i;
  for(i=0; i<B; i++) Array[[i]] = i - 3;
  exit( Array[[1]] != -2 );
}],
    ac_cv_c_gcc_strength_bug="no",
    ac_cv_c_gcc_strength_bug="yes",
    ac_cv_c_gcc_strength_bug="yes") )
  if test "$ac_cv_c_gcc_strength_bug" = "yes"
  then
    CFLAGS="$CFLAGS -fno-strength-reduce"
  fi
fi


dnl Checks for libraries.
AC_CHECK_LIB(m, sqrt, [
	AC_DEFINE(LIBM)
	MATHLIBS="-lm" ])

dnl which version of gd do we have here? (taken from mrtg config)
AC_CHECK_LIB(gd,gdImageGif,[
	AC_DEFINE(HAVE_IMAGE_GIF)
	])
AC_CHECK_LIB(gd,gdImagePng,[
	AC_DEFINE(HAVE_IMAGE_PNG)
	])
AC_CHECK_LIB(gd,gdImageJpeg,[
	AC_DEFINE(HAVE_IMAGE_JPEG)
	])


dnl Make sure the header is here
AC_CHECK_HEADER( gd.h,[ have_gd_h="yes" ],[ have_gd_h="no" ])

if test $have_gd_h != "yes"; then
echo
	echo "** The GD library is required for CvsGraph to function."
	echo "   Get it from http://www.boutell.com, compile it and"
	echo "   use either --with-gd-lib=DIR and --with-gd-inc=DIR to specify"
	echo "   its location. You might also have to use --with-z-inc, --with-z-lib"
	echo "   and --with-png-inc, --with-png-lib for gd versions 1.6 and higher."
	echo "   Check config.log for more information on the problem. If your system"
        echo "   has libgd installed, you probably mis the gd.h header file."
	exit 1
fi

AC_SUBST(LEXFLAGS)

AC_OUTPUT(Makefile)

echo "Configure done. Run 'make' to build CvsGraph"