File: configure.in

package info (click to toggle)
mrtg 2.8.9-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,716 kB
  • ctags: 912
  • sloc: perl: 15,799; ansic: 3,489; sh: 844; makefile: 153; csh: 49; exp: 16
file content (130 lines) | stat: -rw-r--r-- 3,870 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
123
124
125
126
127
128
129
130
AC_INIT(src/rateup.c)

dnl Check for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PATH_PROG(PERL, perl, no, $PATH:/usr/bin:/usr/local/bin)
if test $PERL = no; then 
   echo
   echo "** No Perl found in the PATH. A recent copy of Perl"
   echo "   is required for mrtg to work. Check www.perl.com"
   echo 
   exit 1
fi

dnl Checks for libraries.

dnl Checks for libraries.
AC_CHECK_LIB(m, acos)


AC_ARG_WITH(gd,[  --with-gd=DIR           location of the gd lib/inc],
		[LDFLAGS="${LDFLAGS} -L${withval}"
		CFLAGS="${CFLAGS} -I${withval}"
		LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"])

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

AC_ARG_WITH(gd-inc,[  --with-gd-inc=DIR       location of the gd include files],
		[CFLAGS="${CFLAGS} -I${withval}"])

LDFLAGS="${LDFLAGS} -lgd"

AC_ARG_WITH(z,[  --with-z=DIR            location of zlib lib/inc],
		[LDFLAGS="${LDFLAGS} -L${withval}"
		CFLAGS="${CFLAGS} -I${withval}"
		LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"])

AC_ARG_WITH(z-lib,[  --with-z-lib=DIR        location of zlib library],
		[LDFLAGS="${LDFLAGS} -L${withval}"
		LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"])

AC_ARG_WITH(z-inc,[  --with-z-inc=DIR        location of the zlib include files],
		[CFLAGS="${CFLAGS} -I${withval}"])

AC_ARG_WITH(png,[  --with-png=DIR         location of png lib/inc],
		[LDFLAGS="${LDFLAGS} -L${withval}"
		CFLAGS="${CFLAGS} -I${withval}"
		LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"])

AC_ARG_WITH(png-lib,[  --with-png-lib=DIR      location of png library],
		[LDFLAGS="${LDFLAGS} -L${withval}"
		LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}"])

AC_ARG_WITH(png-inc,[  --with-png-inc=DIR      location of the libpng include files],
		[CFLAGS="${CFLAGS} -I${withval}"])

LDFLAGS="${LDFLAGS} -lm"

dnl which version of gd do we have here ?
AC_CHECK_LIB(gd,gdImageGif,[
  CFLAGS="$CFLAGS -DGFORM_GD=gdImageGif"
  GDFORM_EXT=gif
                           ])
AC_CHECK_LIB(gd,gdImagePng,[
  CFLAGS="$CFLAGS -DGFORM_GD=gdImagePng"
  LDFLAGS="$LDFLAGS -lpng -lz"
  GDFORM_EXT=png
        ],:,[-lpng -lz])

if test x$GDFORM_EXT = x; then
echo
	echo "** The GD library is required for rateup to compile."
	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."
	exit 1
fi

AC_MSG_CHECKING(the weather)
AC_MSG_RESULT((cached) its fine)

dnl If CC is not set we assume gcc
AC_CACHE_CHECK(if we can use GCC-specific compiler options, rd_cv_gcc_opt,
[
oCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wall -pedantic"

AC_TRY_COMPILE( , return 0 ,
	 rd_cv_gcc_opt=yes,
	 rd_cv_gcc_opt=no )
])

if test $rd_cv_gcc_opt = no; then
	CFLAGS=$oCFLAGS
fi

AC_SUBST(PERL)
AC_SUBST(GDFORM_EXT)
AC_SUBST(LD_RUN_PATH)

AC_OUTPUT(Makefile)

echo $ac_n "ordering CD from http://cdnow.com/gift/oetiker@ee.ethz.ch $ac_c" 1>&6
sleep 1
echo $ac_n ".$ac_c" 1>&6
sleep 1
echo $ac_n ".$ac_c" 1>&6
sleep 1
echo $ac_n ".$ac_c" 1>&6
sleep 1
echo $ac_n ".$ac_c" 1>&6
sleep 1
AC_MSG_RESULT([ just kidding ;-)])
echo
echo "----------------------------------------------------------------"
echo "Config is DONE!"
echo
echo "Type 'make' to compile the software"
echo 
echo "       ... that wishlist mentioned above does realy exist. So if"
echo "you feel like showing your appreciation for rrdtool this is the"
echo "place to go. :-)"
echo 
echo "                            -- Tobi Oetiker <oetiker@ee.ethz.ch>"
echo "----------------------------------------------------------------"