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 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
|
dnl RRDtool AutoConf script ...
dnl ---------------------------
dnl
dnl Created by Jeff Allen, Tobi Oetiker, Blair Zajac
dnl
dnl
dnl make sure we are being executed in the right place
AC_INIT(src/rrd_tool.c)
dnl all our local stuff like install scripts and include files
dnl is in there
AC_CONFIG_AUX_DIR(config)
dnl determine the type of system we are running on
AC_CANONICAL_SYSTEM
dnl tell automake the this script is for rrdtool
AM_INIT_AUTOMAKE(rrdtool, 1.0.7)
dnl where we install our stuff ...
AC_PREFIX_DEFAULT( /usr/local/rrdtool-1.0.7 )
dnl tell automake which file to use as config header
AM_CONFIG_HEADER(config/config.h)
dnl Minimum Autoconf version required.
AC_PREREQ(2.13)
dnl Define library subdirectory names here.
CGI_LIB_DIR=cgilib-0.4
GD_LIB_DIR=gd1.3
PNG_LIB_DIR=libpng-1.0.3
ZLIB_LIB_DIR=zlib-1.1.3
dnl substitute them in all the files listed in AC_OUTPUT
AC_SUBST(CGI_LIB_DIR)
AC_SUBST(GD_LIB_DIR)
AC_SUBST(PNG_LIB_DIR)
AC_SUBST(ZLIB_LIB_DIR)
dnl Check for Perl.
AC_PATH_PROG(PERL, perl, no)
if test "x$PERL" = "nox"; then
COMP_PERL=
else
COMP_PERL="perl_piped perl_shared"
fi
AC_SUBST(COMP_PERL)
dnl Check for the compiler and static/shared library creation.
AC_PROG_CC
AC_PROG_CPP
dnl RRD_ACLOCAL_FIND_LIBTOOL
dnl don't build a shared library ... perl will do it's own magic.
dnl this can be changed when running configure
AC_DISABLE_SHARED
AM_PROG_LIBTOOL
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h malloc.h unistd.h math.h sys/time.h sys/times.h sys/resource.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
dnl Checks for libraries.
AC_CHECK_LIB(m, acos)
dnl If CC is not set we assume gcc
if test ${CC-gcc} = gcc; then
oCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wall -pedantic"
AC_CACHE_CHECK(if we can use GCC-specific compiler options, rd_cv_gcc_opt,
[
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
fi
dnl Checks for library functions.
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
dnl for each function found we get a definition in config.h
dnl of the form HAVE_FUNCTION
AC_CHECK_FUNCS(snprintf fpclass isnan finite isinf memmove strchr mktime getrusage gettimeofday)
dnl what does realloc do if it gets called with a NULL pointer
AC_CACHE_CHECK([if realloc can deal with NULL], rd_cv_null_realloc,
[AC_TRY_RUN([#include <stdlib.h>
int main(void){
char *x = NULL;
x = realloc (x,10);
if (x==NULL) return 1;
return 0;
}],
[rd_cv_null_realloc=yes],[rd_cv_null_realloc=nope],:)])
if test x"$rd_cv_null_realloc" = xnope; then
AC_DEFINE(NO_NULL_REALLOC)
fi
dnl determine how to get IEEE math to work on this box.
AC_DEFUN(AC_IEEE,
AC_CACHE_CHECK([if IEEE math works $1], [rd_cv_ieee_$2],
[AC_TRY_RUN([$3
#if (! defined(HAVE_FINITE) && defined(HAVE_ISNAN) && defined(HAVE_ISINF))
# define HAVE_FINITE 1
# define finite(a) (! isnan(a) && ! isinf(a))
#endif
#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
# define HAVE_ISINF 1
# include <ieeefp.h>
# define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
#endif
#include <stdio.h>
int main(void){
double nan,inf,c,d;
$4;
/* some math to see if we get a segfault; */
nan=0.0/0.0;
inf=1.0/0.0;
c = 1.0;
c = c / 0.0; /* try getting fpe */
c = inf + nan;
c = inf / nan;
if (! isnan(nan)) {printf ("isnan(NaN) ... "); return 1;}
if (nan == nan) {printf ("nan != nan ..."); return 1;}
if (! isinf(inf)) {printf ("isinf(oo) ... "); return 1;}
if (! isinf(-inf)) {printf ("isinf(-oo) ... "); return 1;}
if (! inf > 0) {printf ("inf > 0 ... "); return 1;}
if (! -inf < 0) {printf ("inf < 0 ... "); return 1;}
return 0;
}],
[rd_cv_ieee_$2=yes],[rd_cv_ieee_$2=no],:)]))
oCFLAGS=$CFLAGS
unset CFLAGS
AC_IEEE([out of the box],works)
if test "$rd_cv_ieee_works" != yes ; then
CFLAGS=-ieee
AC_IEEE([with the -ieee switch],switch)
if test "$rd_cv_ieee_switch" != yes ; then
CFLAGS=-mieee
AC_IEEE([with the -mieee switch],mswitch)
if test "$rd_cv_ieee_mswitch" != yes ; then
CFLAGS="-q float=rndsngl"
AC_IEEE([with the -q float=rndsngl switch],qswitch)
if test "$rd_cv_ieee_qswitch" != yes ; then
unset CFLAGS
AC_IEEE([with fpsetmask(0)],mask,[#include <floatingpoint.h>],[fpsetmask(0)])
if test "$rd_cv_ieee_mask" != yes ; then
AC_IEEE([with signal(SIGFPE,SIG_IGN)],sigfpe,[#include <signal.h>],[signal(SIGFPE,SIG_IGN)])
if test "$rd_cv_ieee_sigfpe" != yes ; then
echo "--------------------------------------------------------------"
echo "Your Compiler does not do propper IEEE math ... "
echo "Please find out how to make IEEE math work with your Compiler"
echo "and let me know (oetiker@ee.ethz.ch)"
echo "Check config.log to see what went wrong ..."
echo ""
exit 1
fi
fi
fi
fi
fi
fi
CFLAGS=$oCFLAGS
if test x$rd_cv_ieee_sigfpe = xyes; then
AC_DEFINE(MUST_DISABLE_SIGFPE)
fi
if test x$rd_cv_ieee_mask = xyes; then
AC_DEFINE(MUST_DISABLE_FPMASK)
fi
if test x$rd_cv_ieee_switch = xyes; then
CFLAGS="$CFLAGS -ieee"
fi
if test x$rd_cv_ieee_mswitch = xyes; then
CFLAGS="$CFLAGS -mieee"
fi
if test x$rd_cv_ieee_qswitch = xyes; then
CFLAGS="$CFLAGS -q float=rndsngl"
fi
AC_SUBST(CFLAGS)
AC_OUTPUT(cgilib-0.4/Makefile \
config/Makefile \
examples/shared-demo.pl \
examples/piped-demo.pl \
examples/stripes.pl \
examples/bigtops.pl \
examples/minmax.pl \
examples/cgi-demo.cgi \
examples/Makefile \
contrib/Makefile \
contrib/trytime/Makefile \
contrib/log2rrd/Makefile \
contrib/log2rrd/log2rrd.pl \
contrib/rrd-file-icon/Makefile \
doc/Makefile \
gd1.3/Makefile \
libpng-1.0.3/Makefile \
zlib-1.1.3/Makefile \
src/Makefile \
Makefile, \
[chmod +x examples/*.cgi examples/*.pl contrib/*/*.pl])
AC_MSG_CHECKING(in)
AC_MSG_RESULT(and out again)
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 and use 'make install' to "
echo "install everything to $prefix. If you want to install the perl"
echo "modules in site-perl, try 'make site-perl-install'."
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 "----------------------------------------------------------------"
|