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 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
|
#!/bin/sh
# configure - not a GNU autoconf-generated one, but looks like it
# $Id: configure,v 1.18 2003/05/15 12:04:37 remstats Exp $
# from remstats @@VERSION@@
# Copyright 1999, 2000, 2001, 2002 (c) Thomas Erskine <@@AUTHOR@@>
# See the COPYRIGHT file with the distribution.
# - - - Configuration - - -
# Guess values for system-dependent variables and create Makefiles.
# Mutilated from a configure created using autoconf version 2.13
prefix=/var/remstats
installdir='$PREFIX'
bindir='$PREFIX/bin'
datadir='$PREFIX/data'
datapagedir='$PREFIX/data/DATAPAGES'
errorlogdir='/var/log';
libdir='$PREFIX/lib'
mandir='$PREFIX/man'
mansect='1'
etcdir='$PREFIX/etc'
configdir='$PREFIX/etc/config'
htmldir='$PREFIX/html'
htmlurl=/remstats
cgidir='$PREFIX/cgi-bin'
cgiurl='/cgi-bin'
rrdlibdir=/usr/local/rrdtool/lib/perl
rrdcgi=/usr/local/rrdtool/bin/rrdcgi
webmaster='webmaster@'`hostname`
alertemail="$webmaster"
owner=remstats
group=remstats
webgroup=remstats
dirmode=0755
sendmail=/usr/lib/sendmail
domain=`hostname`
withperl=''
localnet=127.0.0.
# Initialize some other variables.
subdirs='multiping traceroute'
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# - - - Version History - - -
# version = $Revision: 1.18 $
# - - - Setup - - -
# Copied the style from an autoconf configure
echo "This is *not* a GNU autoconf-generated configure. No abbreviations please."
prev=''
for option
do
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
eval "$prev=\$option"
prev=
continue
fi
case "$option" in
-*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
case "$option" in
-prefix | --prefix )
prev=prefix ;;
-prefix=* | --prefix=* )
prefix="$optarg" ;;
-etcdir | --etcdir )
prev=etcdir ;;
-etcdir=* | --etcdir=* )
etcdir="$optarg" ;;
-rrdlibdir | --rrdlibdir )
prev=rrdlibdir ;;
-rrdlibdir=* | --rrdlibdir=* )
rrdlibdir="$optarg" ;;
-rrdcgi | --rrdcgi )
prev=rrdcgi ;;
-rrdcgi=* | --rrdcgi=* )
rrdcgi="$optarg" ;;
-configdir | --configdir )
prev=configdir ;;
-configdir=* | --configdir=* )
configdir="$optarg" ;;
-htmldir | --htmldir )
prev=htmldir ;;
-htmldir=* | --htmldir=* )
htmldir="$optarg" ;;
-htmlurl | --htmlurl )
prev=htmlurl ;;
-htmlurl=* | --htmlurl=* )
htmlurl="$optarg" ;;
-cgidir | --cgidir )
prev=cgidir ;;
-cgidir=* | --cgidir=* )
cgidir="$optarg" ;;
-cgiurl | --cgiurl )
prev=cgiurl ;;
-cgiurl=* | --cgiurl=* )
cgiurl="$optarg" ;;
-libdir | --libdir )
prev=libdir ;;
-libdir=* | --libdir=* )
libdir="$optarg" ;;
-mandir | --mandir )
prev=mandir ;;
-mandir=* | --mandir=* )
mandir="$optarg" ;;
-mansect | --mansect )
prev=mansect ;;
-mansect=* | --mansect=* )
mansect="$optarg" ;;
-bindir | --bindir )
prev=bindir ;;
-bindir=* | --bindir=* )
bindir="$optarg" ;;
-datadir | --datadir )
prev=datadir ;;
-datadir=* | --datadir=* )
datadir="$optarg" ;;
-datapagedir | --datapagedir )
prev=datapagedir ;;
-datapagedir=* | --datapagedir=* )
datapagedir="$optarg" ;;
-errorlogdir | --errorlogdir )
prev=errorlogdir ;;
-errorlogdir=* | --errorlogdir=* )
errorlogdir="$optarg" ;;
-owner | --owner )
prev=owner ;;
-owner=* | --owner=* )
owner="$optarg" ;;
-group | --group )
prev=group ;;
-group=* | --group=* )
group="$optarg" ;;
-webgroup | --webgroup )
prev=webgroup ;;
-webgroup=* | --webgroup=* )
webgroup="$optarg" ;;
-dirmode | --dirmode )
prev=dirmode ;;
-dirmode=* | --dirmode=* )
dirmode="$optarg" ;;
-domain | --domain )
prev=domain ;;
-domain=* | --domain=* )
domain="$optarg" ;;
-webmaster | --webmaster )
prev=webmaster ;;
-webmaster=* | --webmaster=* )
webmaster="$optarg" ;;
-alertemail | --alertemail )
prev=alertemail ;;
-alertemail=* | --alertemail=* )
alertemail="$optarg" ;;
-with-perl | --with-perl )
prev=with-perl ;;
-with-perl=* | --with-perl=* )
withperl="$optarg" ;;
-local-net | --local-net )
prev=local-net ;;
-local-net=* | --local-net=* )
localnet="$optarg" ;;
-help | --help )
# This message is too long to be a string in the A/UX 3.1 sh.
cat << EOF
Usage: configure [options]
Options: [defaults in brackets after descriptions]
Configuration:
--help print this message
Directory and file names:
--prefix=DIR where to put the whole installation tree [$prefix]
--bindir=DIR executables in DIR [PREFIX/bin]
--etcdir=DIR where to store configuration information [PREFIX/etc]
--configdir=DIR where is the default configuration directory [PREFIX/etc/config]
--libdir=DIR where to store perl libraries [PREFIX/lib]
--mandir=DIR where to store man-pages [PREFIX/man]
--mansect=N whhich section for man-pages [$mansect]
--datadir=DIR where to store RRDs and status files and other
variable data [PREFIX/data]
--datapagedir=DIR where to store datapages [PREFIX/data/DATAPAGES]
--htmldir=DIR where to put the web-pages [PREFIX/html]
--cgidir=DIR where to put the CGI scripts [PREFIX/cgi-bin]
--errorlogdir=DIR where servers log errors to [/var/log]
--rrdlibdir=DIR where are the rrdtool perl libraries [$rrdlibdir]
--rrdcgi=PROGRAM where is the rrdcgi interpreter [$rrdcgi]
--sendmail=PROGRAM a program to inject email [$sendmail]
Other stuff:
--with-perl=PROGRAM override automatic finding of perl
--htmlurl=URL where is cgidir as a URL [$htmlurl]
--cgiurl=URL where is cgidir as a URL [$cgiurl]
--owner=USER which user will own this installation [$owner]
--group=GROUP which group will own this installation [$group]
--webgroup=WEBGROUP which group does the web-server run as [$webgroup]
--dirmode=MODE what mode to use for directories [$dirmode]
--webmaster=EMAIL who to send email to about this web-site [$webmaster]
--alertemail=EMAIL who to send email alerts to [$alertemail]
--domain=DOMAIN to decide what email is local [$domain]
--local-net=LOCALNET to create default access config-file [$localnet]
EOF
exit 0;
;;
esac
done
if [ -n "$prev" ] ; then
echo "configure: error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2
exit 1;
fi
# - - - Mainline - - -
# for checking messages
nsize=`echo -n 'a'|wc -c`
csize=`echo 'a\c'|wc -c`
if [ "$nsize" -eq 1 ] ; then
echo0() { echo -n "$*"; }
elif [ "$csize" -eq 1 ] ; then
echo0() { echo "$*\c"; }
else
echo "I can't find a proper echo. -n=$nsize, \\c=$csize"
exit 1
fi
# Find perl
echo0 'Looking for perl...'
perl=''
for prog in $withperl /usr/local/bin/perl /usr/bin/perl `which perl` ; do
if [ -f $prog ] ; then
perl=$prog
break
elif [ -L $prog ] ; then
perl=$prog
break
# Command not found
elif [ "$prog" = 'Command' ] ; then
break
fi
done
# No automatically found perl
if [ -z "$perl" ] ; then
echo "can't find perl"
exit 1
else
echo $perl
fi
# Can we run that?
echo0 'Can we run perl...'
if $perl -v >/dev/null 2>&1 ; then
echo 'yes'
else
echo 'no'
exit 1
fi
# What version is it?
echo0 'Is it a recent enough perl...'
perl_version=`$perl -v|awk '/This is perl, version/ {print $5; next} /This is perl, v/ {v=substr($4,2); print v}'`
goodenough=`expr "$perl_version" '>=' 5.005_00`
if [ -z "$perl_version" ] ; then
echo "I don't understand which version of perl this is"
exit 1
elif [ "$goodenough" = 1 ] ; then
echo "yes ($perl_version)"
else
echo "no. Must be at least 5.005 ($perl_version)"
exit 1
fi
# How about a good version of date? (with %Y)
echo0 'Need a date that does %Y...'
date=''
for thisdate in /usr/local/bin/date /usr/bin/date /bin/date `which date` ; do
ok=`$thisdate +%Y 2>/dev/null |awk '/^[0-9][0-9][0-9][0-9]$/ {print "yes"; exit} {print "no"; exit}'`
if [ "$ok" = yes ] ; then
date=$thisdate
echo $date
break
# Command not found
elif [ "$prog" = 'Command' ] ; then
break
fi
done
if [ -z "$date" ] ; then
echo 'none'
exit 1
else
echo "using $date for date"
fi
# Where is sendmail?
echo0 'Looking for sendmail...'
sendmail=''
for prog in $sendmail /usr/lib/sendmail /usr/sbin/sendmail /var/qmail/bin/sendmail ; do
if [ -f $prog ] ; then
sendmail=$prog
break
elif [ -L $prog ] ; then
sendmail=$prog
break
fi
done
if [ -z "$sendmail" ] ; then
echo "can't find sendmail; using /usr/lib/sendmail"
sendmail='/usr/lib/sendmail'
fi
echo $sendmail
# Where are we @
echo0 'Where are we...'
hostname=`hostname`
echo $hostname
# Now make sure we have the required perl modules
echo "Looking for required perl modules..."
missing=0
for m in `cat PERL_MODULES_REQUIRED` ; do
if $perl -e "use lib '$libdir', '$rrdlibdir'; use $m;" 2>/dev/null ; then
echo " $m ok"
else
echo " $m MISSING"
#missing=1
fi
done
if [ "$missing" = 1 ] ; then
echo "Missing required perl mdules; can't continue"
exit 2
fi
# Now make sure we have the optional perl modules
echo "Looking for optional perl modules..."
missing=0
test -f FILES_MISSING_OPTIONAL_MODULES && rm -f FILES_MISSING_OPTIONAL_MODULES
for m in `cat PERL_MODULES_OPTIONAL` ; do
if $perl -e "use $m;" 2>/dev/null ; then
echo " $m ok"
else
grep -ls "$m" *.pl *.pl.in *.cgi.in *stuff.in \
>>FILES_MISSING_OPTIONAL_MODULES
echo " $m MISSING"
missing=1
fi
done
# Remove duplicates from the list
rm -rf MISSING
if [ -f FILES_MISSING_OPTIONAL_MODULES ] ; then
sort FILES_MISSING_OPTIONAL_MODULES | uniq > TMP
mv TMP FILES_MISSING_OPTIONAL_MODULES
# Make a hash-equivalent for the shell, to be used by the Makefile
mkdir MISSING
for p in `cat FILES_MISSING_OPTIONAL_MODULES`; do
touch MISSING/$p
done
rm FILES_MISSING_OPTIONAL_MODULES
fi
# Save this configuration, for automatically re-applying it
echo >config.cache #!/bin/sh
echo $0 $* | sed -e 's/\([\\\[\]()`\$\^\&\*\;\>]\)/\\\1/g' >>config.cache
chmod 755 config.cache
echo "created config.cache; to re-config the same way run 'sh config.cache'"
# Write the new fixup.config
echo ''
if [ -f fixup.config ] ; then
mv fixup.config fixup.config.old
echo "Saved old fixup.config as fixup.config.old"
fi
rm -f fixup.config.new
echo >>fixup.config.new '# This is created automatically by configure'
echo >>fixup.config.new "PERL=$perl"
echo >>fixup.config.new "PERLOPTS='-w'"
echo >>fixup.config.new "PERLCGIOPTS='-Tw'"
echo >>fixup.config.new "INSTALLDIR=$installdir"
echo >>fixup.config.new "BINDIR=$bindir"
echo >>fixup.config.new "ETCDIR=$etcdir"
echo >>fixup.config.new "LIBDIR=$libdir"
echo >>fixup.config.new "MANDIR=$mandir"
echo >>fixup.config.new "MANSECT=$mansect"
echo >>fixup.config.new "CONFIGDIR=$configdir"
echo >>fixup.config.new "DATADIR=$datadir"
echo >>fixup.config.new "DATAPAGEDIR=$datapagedir"
echo >>fixup.config.new "ERRORLOGDIR=$errorlogdir"
echo >>fixup.config.new "HTMLDIR=$htmldir"
echo >>fixup.config.new "HTMLURL=$htmlurl"
echo >>fixup.config.new "CGIDIR=$cgidir"
echo >>fixup.config.new "CGIURL=$cgiurl"
echo >>fixup.config.new "RRDLIBDIR=$rrdlibdir"
echo >>fixup.config.new "RRDCGI=$rrdcgi"
echo >>fixup.config.new "WEBMASTER=$webmaster"
echo >>fixup.config.new "ALERTEMAIL=$alertemail"
echo >>fixup.config.new "REMSTATSPORT=1957"
echo >>fixup.config.new "OWNER=$owner"
echo >>fixup.config.new "GROUP=$group"
echo >>fixup.config.new "WEBGROUP=$webgroup"
echo >>fixup.config.new "DIRMODE=$dirmode"
echo >>fixup.config.new "SENDMAIL=$sendmail"
echo >>fixup.config.new "DATEPROG=$date"
echo >>fixup.config.new "OUTSITEEMAIL='@([-a-zA-Z0-9.]+)?$domain'"
echo >>fixup.config.new "LOCALNET=$localnet"
echo >>fixup.config.new "DEBUG='#'"
if [ -f fixup.config ] ; then
mv -f fixup.config fixup.config.old
fi
sed -e "s#\$PREFIX#$prefix#g" fixup.config.new >fixup.config
rm -f fixup.config.new
echo 'configuration written to fixup.config'
./fixup Makefile.in >Makefile
cp fixup.config docs
./fixup docs/Makefile.in >docs/Makefile
echo 'wrote Makefiles'
# Now do any sub-directories
#for dir in $subdirs ; do
# echo ""; echo "=== configuring $dir ==="
# (cd $dir; ./configure)
#done
|