File: configure.in

package info (click to toggle)
mrtg 2.9.17-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,140 kB
  • ctags: 1,517
  • sloc: perl: 22,688; ansic: 3,536; sh: 1,309; makefile: 319; php: 227; awk: 213; csh: 49; exp: 16
file content (155 lines) | stat: -rw-r--r-- 4,780 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
AC_INIT(src/rateup.c)

dnl Check for programs.
AC_PROG_CC
AC_PREFIX_DEFAULT( /usr/local/mrtg-2 )

AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_INSTALL
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

AC_PATH_PROGS(NROFF, groff nroff)

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

dnl AC_ARG_WITH(RRDs,[  --with-RRDs=DIR         location RRDtool perl module],
dnl 		[PERL5LIB="${withval}";export PERL5LIB])
dnl AC_MSG_CHECKING(availability of RRDtool / RRDs.pm)
dnl if $PERL -e 'use RRDs' >/dev/null 2>&1; then
dnl   AC_MSG_RESULT(found)
dnl  RRD_PERL=$PERL5LIB
dnl else
dnl  AC_MSG_RESULT(no)
dnl fi

AC_ARG_WITH(gd,[  --with-gd=DIR           location of the gd lib/inc],
		[LDFLAGS="${LDFLAGS} -L${withval}"
		CPPFLAGS="${CPPFLAGS} -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],
		[CPPFLAGS="${CPPFLAGS} -I${withval}"])

LDFLAGS="${LDFLAGS} -lgd"

AC_ARG_WITH(z,[  --with-z=DIR            location of zlib lib/inc],
		[LDFLAGS="${LDFLAGS} -L${withval}"
		CPPFLAGS="${CPPFLAGS} -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],
		[CPPFLAGS="${CPPFLAGS} -I${withval}"])

AC_ARG_WITH(png,[  --with-png=DIR          location of png lib/inc],
		[LDFLAGS="${LDFLAGS} -L${withval}"
		CPPFLAGS="${CPPFLAGS} -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],
		[CPPFLAGS="${CPPFLAGS} -I${withval}"])

LDFLAGS="${LDFLAGS} ${MATHLIBS}"

GDEXTRALIB=""
dnl which version of gd do we have here ?
AC_CHECK_LIB(gd,gdImageGif,[
  GDFORM_EXT=gif
                           ])

AC_CHECK_LIB(gd,gdImagePng,[
   GDFORM_EXT=png
        ],:,[-lpng -lz ${MATHLIBS}])

AC_CHECK_LIB(gd,gdImagePng_jpg,[
   GDFORM_EXT=png
   GDEXTRALIB="-ljpeg"
        ],:,[-lpng -lz -ljpeg ${MATHLIBS}])

AC_CHECK_LIB(gd,gdImagePng_jpg_ft,[
   GDFORM_EXT=png
   GDEXTRALIB="-ljpeg -lfreetype"
        ],:,[-lpng -lz -jpeg -lfreetype ${MATHLIBS}])

if test x$GDFORM_EXT = xgif; then
  CPPFLAGS="$CPPFLAGS -DGFORM_GD=gdImageGif"
fi

if test x$GDFORM_EXT = xpng; then
  CPPFLAGS="$CPPFLAGS -DGFORM_GD=gdImagePng"
  LDFLAGS="$LDFLAGS -lpng -lz ${GDEXTRALIB} ${MATHLIBS}"
fi


dnl Make sure the header is here
AC_CHECK_HEADER( gd.h,:,[ GDFORM_EXT="" ])

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. If your system"
        echo "   has libgd installed, you probably mis the gd.h header file."
        echo
        echo "   Consider following the instructions in doc/unix-guide.txt"
	exit 1
fi

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

dnl Add GCC-specific compile-time options
if test "x$GCC" = "yes"; then
  CFLAGS="$CFLAGS -Wall -pedantic"
fi


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

AC_OUTPUT(Makefile)

echo $ac_n "ordering CD from http://people.ee.ethz.ch/~oetiker/wish $ac_c" 1>&6
$PERL -e '$|=1;for (0..2){print ".\a";sleep 1}'
AC_MSG_RESULT([ just kidding ;-)])
sleep 2
echo
echo "----------------------------------------------------------------"
echo "Config is DONE!"
echo
echo "Type 'make' to compile the software"
echo 
echo "       ... that wishlist mentioned above does really exist. So if"
echo "you feel like showing your appreciation for MRTG, this is the"
echo "place to go. I just love CDs and DVDs"
echo 
echo "                            -- Tobi Oetiker <oetiker@ee.ethz.ch>"
echo "----------------------------------------------------------------"