configure.in 18 KB
Newer Older
1 2
#
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
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 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661
#
AC_PREREQ(2.13)

AC_INIT(Makeconf.in)
AC_CONFIG_AUX_DIR(${srcdir}/autoconf)
AC_PREFIX_DEFAULT(/usr/testbed)
AC_CONFIG_HEADER(config.h)

# We use separate source and obj trees in Emulab.  Configuring in a source
# tree messes it up, so throw an error.
#
# Check that $srcdir, (which defaults to the argv[0] path to the configure
# script,) is different from the current directory.
#
if test `(cd $srcdir; pwd)` = `pwd`; then
    if test "$ac_srcdir_defaulted" = yes; then
	AC_MSG_ERROR(
	    [You are running the configure script in the current directory.
Output from configure must go into an Emulab obj tree, not a source tree!
cd to the top of an obj tree, and run the configure in your source tree.])
    else
	AC_MSG_ERROR(
	    [You specified --srcdir= to be the current directory.
Output from configure should go into an Emulab obj tree, not a source tree!
cd to the top of an obj tree, and run the configure in your source tree.
Then --srcdir= will be unnecessary.])
    fi
fi
#
# Double-check that there isn't a Makeconf.in (the UNIQUE-FILE-IN-SOURCE-DIR)
# in the current directory.
#
if test -f $ac_unique_file; then
    AC_MSG_ERROR([The current directory is a source tree containing $ac_unique_file .
Output from configure should go into an Emulab obj tree, not a source tree!
cd to the top of an obj tree, and run the configure in your source tree.])
fi

for tbarch in arm/3.4.1; do
    PATH="/usr/local/$tbarch/bin:${PATH}"
done

if test x"${JAVA_HOME}" != x""; then
    PATH="${JAVA_HOME}/bin:${PATH}"
else
    for jdk in /usr/local/jdk*; do
	PATH="${jdk}/bin:${PATH}"
	break
    done
fi

AC_SUBST(PATH)

CPPFLAGS="-I/usr/local/include"

# BEGIN Python detection.
AC_PATH_PROGS(PYTHON, python python2.4 python2.3 python2.2)

if test x"$PYTHON" = x""; then
    AC_MSG_ERROR([python not detected])
fi

PYTHON_VERSION=`${PYTHON} -V 2>&1 | cut -d ' ' -f 2 | cut -d '.' -f 1,2`
PYTHON_PATH=`dirname ${PYTHON}`
if test ! -d "$PYTHON_PATH/include"; then
    PYTHON_PATH=`dirname ${PYTHON_PATH}`
fi
PYTHON_INCLUDE="${PYTHON_PATH}/include/python${PYTHON_VERSION}"
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE}"
AC_CHECK_HEADERS([Python.h],
		 [],
		 [AC_MSG_WARN("Cannot find Python.h in ${PYTHON_INCLUDE}")])
AC_SUBST(PYTHON_INCLUDE)
# END Python detection.

AC_CHECK_TOOL(CC,gcc)
AC_CHECK_TOOL(CXX,g++)
AC_CHECK_TOOL(AR,ar)
AC_CHECK_TOOL(RANLIB,ranlib)
AC_CHECK_TOOL(STRIP,strip)

AC_EXEEXT

AC_PATH_PROG(ELVIN_CONFIG,elvin-config)
AC_PATH_PROG(JAVAC,javac)
AC_PATH_PROG(JAR,jar)
AC_PATH_PROG(SUDO,sudo)

AC_CHECK_TOOL(SSH,ssh)

AC_CHECK_FUNCS(srandomdev)

AC_SUBST(optional_subdirs)

#
# These get defined in the definitions file (--with-TBDEFS).
# NB: See AC_DEFINE_UNQUOTED() calls below, if you want a variable
# to appear in config.h.
# 
AC_SUBST(TBDBNAME)
AC_SUBST(TBERRORLOGDBNAME)
AC_SUBST(TBADMINGROUP)
AC_SUBST(DELAYCAPACITY)
AC_SUBST(IPBASE)
AC_SUBST(JAILIPBASE)
AC_SUBST(JAILIPMASK)
AC_SUBST(BOSSNODE)
AC_SUBST(USERNODE)
AC_SUBST(FSNODE)
AC_SUBST(EVENTSERVER)
AC_SUBST(BOSSEVENTPORT)
AC_SUBST(OURDOMAIN)
AC_SUBST(USERSROOT_DIR)
AC_SUBST(PROJROOT_DIR)
AC_SUBST(GROUPSROOT_DIR)
AC_SUBST(SCRATCHROOT_DIR)
AC_SUBST(SHAREROOT_DIR)
AC_SUBST(FSDIR_PROJ)
AC_SUBST(FSDIR_GROUPS)
AC_SUBST(FSDIR_USERS)
AC_SUBST(FSDIR_SHARE)
AC_SUBST(FSDIR_SCRATCH)
AC_SUBST(FS_WITH_QUOTAS)
AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH)
AC_SUBST(TIMESTAMPS)
AC_SUBST(UNIFIED_BOSS_AND_OPS)
AC_SUBST(DISABLE_NSE)
AC_SUBST(DISABLE_NAMED_SETUP)
AC_SUBST(DISABLE_EXPORTS_SETUP)
AC_SUBST(DISABLE_EVENT_SCHED)
AC_SUBST(CLIENT_ETCDIR)
AC_SUBST(CLIENT_BINDIR)
AC_SUBST(CLIENT_VARDIR)
AC_SUBST(CLIENT_MANDIR)
AC_SUBST(SNMP_RW_COMMUNITY)
AC_SUBST(WWWHOST)
AC_SUBST(WWW)
AC_SUBST(TBBASE)
AC_SUBST(TBDEFS)
AC_SUBST(TBDOCBASE)
AC_SUBST(TBWWW)
AC_SUBST(THISHOMEBASE)
AC_SUBST(TBSECURECOOKIES)
AC_SUBST(TBCOOKIESUFFIX)
AC_SUBST(TBAUTHDOMAIN)
AC_SUBST(TBAUTHTIMEOUT)
AC_SUBST(TBMAINSITE)
AC_SUBST(FANCYBANNER)
AC_SUBST(SFSSUPPORT)
AC_SUBST(ELABINELAB)
AC_SUBST(OUTERBOSS_NODENAME)
AC_SUBST(OUTERBOSS_XMLRPCPORT)
AC_SUBST(OUTERBOSS_SSLCERTNAME)
AC_SUBST(PLABSUPPORT)
AC_SUBST(PUBSUPPORT)
AC_SUBST(WIKISUPPORT)
AC_SUBST(MAILMANSUPPORT)
AC_SUBST(BUGDBSUPPORT)
AC_SUBST(OPSDBSUPPORT)
AC_SUBST(NFSTRACESUPPORT)
AC_SUBST(TBLOGFACIL)
AC_SUBST(TESTBED_NETWORK)
AC_SUBST(EXTERNAL_TESTBED_NETWORK)
AC_SUBST(TESTBED_NETMASK)
AC_SUBST(EXTERNAL_TESTBED_NETMASK)
AC_SUBST(BOSSNODE_IP)
AC_SUBST(EXTERNAL_BOSSNODE_IP)
AC_SUBST(USERNODE_IP)
AC_SUBST(EXTERNAL_USERNODE_IP)
AC_SUBST(FSNODE_IP)
AC_SUBST(EXTERNAL_FSNODE_IP)
AC_SUBST(CONTROL_ROUTER_IP)
AC_SUBST(CONTROL_NETWORK)
AC_SUBST(CONTROL_NETMASK)
AC_SUBST(PRIVATE_NETWORK)
AC_SUBST(PRIVATE_ROUTER)
AC_SUBST(PRIVATE_NETMASK)
AC_SUBST(PUBLIC_NETWORK)
AC_SUBST(PUBLIC_ROUTER)
AC_SUBST(PUBLIC_NETMASK)
AC_SUBST(VIRTNODE_NETWORK)
AC_SUBST(VIRTNODE_NETMASK)
AC_SUBST(DHCPD_DYNRANGE)
AC_SUBST(DHCPD_CONTROLNET_DECL)
AC_SUBST(NAMED_FORWARDERS)
AC_SUBST(SSLCERT_COUNTRY)
AC_SUBST(SSLCERT_STATE)
AC_SUBST(SSLCERT_LOCALITY)
AC_SUBST(SSLCERT_ORGNAME)
AC_SUBST(FRISEBEEMCASTADDR)
AC_SUBST(FRISEBEEMCASTPORT)
AC_SUBST(WINSUPPORT)
AC_SUBST(CVSSUPPORT)
AC_SUBST(TRACSUPPORT)
AC_SUBST(CHATSUPPORT)
AC_SUBST(STAMPS)
AC_SUBST(ARCHIVESUPPORT)
AC_SUBST(MIN_UNIX_UID)
AC_SUBST(MIN_UNIX_GID)
AC_SUBST(DELAYTHRESH)
AC_SUBST(PELABSUPPORT)
AC_SUBST(ELVIN_COMPAT)
AC_SUBST(ISOLATEADMINS)
AC_SUBST(DYNAMICROOTPASSWORDS)
AC_SUBST(REMOTEWIKIDOCS)
AC_SUBST(PROTOGENI_SUPPORT)
AC_SUBST(PROTOGENI_CLEARINGHOUSE)
AC_SUBST(PROTOGENI_DOMAIN)
AC_SUBST(STANDALONE_CLEARINGHOUSE)

#
# Offer both versions of the email addresses that have the @ escaped
# for perl (the default), and that don't
#
AC_SUBST(TBOPSEMAIL)
AC_SUBST(TBOPSEMAIL_NOSLASH)
AC_SUBST(TBROBOCOPSEMAIL)
AC_SUBST(TBROBOCOPSEMAIL_NOSLASH)
AC_SUBST(TBLOGSEMAIL)
AC_SUBST(TBLOGSEMAIL_NOSLASH)
AC_SUBST(TBWWWEMAIL)
AC_SUBST(TBWWWEMAIL_NOSLASH)
AC_SUBST(TBAPPROVALEMAIL)
AC_SUBST(TBAPPROVALEMAIL_NOSLASH)
AC_SUBST(TBAUDITEMAIL)
AC_SUBST(TBAUDITEMAIL_NOSLASH)
AC_SUBST(TBSTATEDEMAIL)
AC_SUBST(TBSTATEDEMAIL_NOSLASH)
AC_SUBST(TBTESTSUITEEMAIL)
AC_SUBST(TBTESTSUITEEMAIL_NOSLASH)
AC_SUBST(TBAUTOMAILEMAIL)
AC_SUBST(TBAUTOMAILEMAIL_NOSLASH)
AC_SUBST(TBACTIVEARCHIVE)
AC_SUBST(TBACTIVEARCHIVE_NOSLASH)
AC_SUBST(TBUSERSARCHIVE)
AC_SUBST(TBUSERSARCHIVE_NOSLASH)
AC_SUBST(TBERRORSEMAIL)
AC_SUBST(TBERRORSEMAIL_NOSLASH)

AC_SUBST(HAVE_MEZZANINE)
HAVE_MEZZANINE=0
AC_SUBST(GTK_CONFIG)
GTK_CONFIG=""
AC_SUBST(BRAINSTEM_DIR)
BRAINSTEM_DIR=""
AC_SUBST(HAVE_ULXMLRPCPP)
HAVE_ULXMLRPCPP=0

#
# Defaults for for above variables.
# 
TBERRORLOGDBNAME="errorlog"
TBADMINGROUP="flux"
CLIENT_ETCDIR="/etc/emulab"
CLIENT_BINDIR="/usr/local/etc/emulab"
CLIENT_VARDIR="/var/emulab"
CLIENT_MANDIR="/usr/local/man"
TBSECURECOOKIES=1
TBMAINSITE=0
FANCYBANNER=0
VIRTNODE_NETWORK=172.16.0.0
VIRTNODE_NETMASK=255.240.0.0
JAILIPBASE=$VIRTNODE_NETWORK
JAILIPMASK=$VIRTNODE_NETMASK
IPBASE=10
SFSSUPPORT=0
ELABINELAB=0
OUTERBOSS_NODENAME=""
OUTERBOSS_XMLRPCPORT=3069
OUTERBOSS_SSLCERTNAME="/etc/outer_emulab.pem"
PLABSUPPORT=0
PUBSUPPORT=0
WIKISUPPORT=0
BUGDBSUPPORT=0
OPSDBSUPPORT=0
MAILMANSUPPORT=0
WINSUPPORT=0
CVSSUPPORT=0
TRACSUPPORT=0
CHATSUPPORT=0
STAMPS=0
ARCHIVESUPPORT=0
NFSTRACESUPPORT=0
TBLOGFACIL="local5"
BOSSEVENTPORT=16505
UNIFIED_BOSS_AND_OPS=0
FRISEBEEMCASTADDR="234.5.6"
FRISEBEEMCASTPORT=3564
MIN_UNIX_UID=10000
MIN_UNIX_GID=6000
DELAYTHRESH=2
PELABSUPPORT=0
ELVIN_COMPAT=0
ISOLATEADMINS=1
DYNAMICROOTPASSWORDS=1
REMOTEWIKIDOCS=1
PROTOGENI_SUPPORT=0
PROTOGENI_CLEARINGHOUSE=0
PROTOGENI_DOMAIN="unknown"
STANDALONE_CLEARINGHOUSE=1

#
# XXX You really don't want to change these!
# They are ingrained and who knows what might break if you change them.
#
USERSROOT_DIR="/users"
PROJROOT_DIR="/proj"
GROUPSROOT_DIR="/groups"
SHAREROOT_DIR="/share"
SCRATCHROOT_DIR=""

#
# Okay, I know this is improper usage of --with. Too bad.
#
AC_ARG_WITH(TBDEFS,
[  --with-TBDEFS=name	Specify definitions file (defs-default default)],
[
    if test "$withval" = "yes"; then
	AC_MSG_ERROR([Invalid TBDEFS - Must specify the value])
    fi
    TBDEFS="$withval"
    TBPATH=`dirname $withval`
    TBPATH="$TBPATH:$srcdir"
],[
    AC_MSG_ERROR(
	[The required --with-TBDEFS= argument was not given.
The value of --with-TBDEFS= must be the path to your Emulab defs file.
Copy and modify the defs-example file for your Emulab installation.
defs-default has values for Utah, including client-side image compilations.])
])

if test -f $TBDEFS; then
    #
    # Remove the comments and newlines.  Really, that's what it does.
    #
    OLDPATH=$PATH
    PATH="$TBPATH:$PATH"
    . $TBDEFS
    PATH=$OLDPATH
else
	AC_MSG_ERROR([Definitions file $TBDEFS was not found.])
fi

# XXX this can optionally be set in the defs file
if test -n "$FSDIR_SCRATCH"; then
    SCRATCHROOT_DIR="/scratch"
fi

#
# These must come after the "eval" above, since the variables are not
# defined until the defs file is taken in.
#
# Be sure to add to config.h.in!
#
if test x"$prefix" = x"NONE"; then
    AC_DEFINE_UNQUOTED(TBROOT, "/usr/testbed")
else
    AC_DEFINE_UNQUOTED(TBROOT, "$prefix")
fi
AC_DEFINE_UNQUOTED(TBDBNAME, "$TBDBNAME")
AC_DEFINE_UNQUOTED(TBERRORLOGDBNAME, "$TBERRORLOGDBNAME")
AC_DEFINE_UNQUOTED(TBADMINGROUP, "$TBADMINGROUP")
AC_DEFINE_UNQUOTED(IPBASE, "$IPBASE")
AC_DEFINE_UNQUOTED(JAILIPBASE, "$JAILIPBASE")
AC_DEFINE_UNQUOTED(JAILIPMASK, "$JAILIPMASK")
AC_DEFINE_UNQUOTED(BOSSNODE, "$BOSSNODE")
AC_DEFINE_UNQUOTED(BOSSNODE_IP, "$BOSSNODE_IP")
AC_DEFINE_UNQUOTED(EXTERNAL_BOSSNODE_IP, "$EXTERNAL_BOSSNODE_IP")
AC_DEFINE_UNQUOTED(USERNODE, "$USERNODE")
AC_DEFINE_UNQUOTED(USERNODE_IP, "$USERNODE_IP")
AC_DEFINE_UNQUOTED(EXTERNAL_USERNODE_IP, "$EXTERNAL_USERNODE_IP")
AC_DEFINE_UNQUOTED(FSNODE, "$FSNODE")
if test -n "$FSNODE_IP"; then
	AC_DEFINE_UNQUOTED(FSNODE_IP, "$FSNODE_IP")
elif test "$USERNODE" = "$FSNODE"; then
	AC_DEFINE_UNQUOTED(FSNODE_IP, "$USERNODE_IP")
fi
AC_DEFINE_UNQUOTED(CONTROL_ROUTER_IP, "$CONTROL_ROUTER_IP")
AC_DEFINE_UNQUOTED(CONTROL_NETWORK, "$CONTROL_NETWORK")
AC_DEFINE_UNQUOTED(CONTROL_NETMASK, "$CONTROL_NETMASK")
AC_DEFINE_UNQUOTED(USERSROOT_DIR, "$USERSROOT_DIR")
AC_DEFINE_UNQUOTED(PROJROOT_DIR, "$PROJROOT_DIR")
AC_DEFINE_UNQUOTED(GROUPSROOT_DIR, "$GROUPSROOT_DIR")
AC_DEFINE_UNQUOTED(SCRATCHROOT_DIR, "$SCRATCHROOT_DIR")
AC_DEFINE_UNQUOTED(SHAREROOT_DIR, "$SHAREROOT_DIR")
AC_DEFINE_UNQUOTED(FSDIR_PROJ, "$FSDIR_PROJ")
AC_DEFINE_UNQUOTED(FSDIR_GROUPS, "$FSDIR_GROUPS")
AC_DEFINE_UNQUOTED(FSDIR_USERS, "$FSDIR_USERS")
if test -n "$FSDIR_SHARE"; then
    AC_DEFINE_UNQUOTED(FSDIR_SHARE, "$FSDIR_SHARE")
fi
if test -n "$FSDIR_SCRATCH"; then
    AC_DEFINE_UNQUOTED(FSDIR_SCRATCH, "$FSDIR_SCRATCH")
fi
AC_DEFINE_UNQUOTED(BOSSEVENTPORT, "$BOSSEVENTPORT")

if test $OPSDBSUPPORT -eq 1; then
    AC_DEFINE_UNQUOTED(OPSDBSUPPORT, 1)
fi

if test $ELVIN_COMPAT -eq 1; then
    AC_DEFINE_UNQUOTED(ELVIN_COMPAT, 1)
fi

if test $ELABINELAB -eq 1; then
    AC_DEFINE_UNQUOTED(ELABINELAB, 1)
fi

if test $ISOLATEADMINS -eq 1; then
    AC_DEFINE_UNQUOTED(ISOLATEADMINS, 1)
fi
if test $DYNAMICROOTPASSWORDS -eq 1; then
    AC_DEFINE_UNQUOTED(DYNAMICROOTPASSWORDS, 1)
fi

LOG_TESTBED=`echo "LOG_$TBLOGFACIL" | tr a-z A-Z`
AC_DEFINE_UNQUOTED(LOG_TESTBED, $LOG_TESTBED)
AC_SUBST(LOG_TESTBED)

#
# If the private network is different then the control network, we need
# an extra subnet decl for it in dhcpd.conf.template. This is enormously
# crude and simplistic, but works for the local case!
# 
if test "$PRIVATE_NETWORK" != "$CONTROL_NETWORK"; then
    DHCPD_CONTROLNET_DECL="subnet $PRIVATE_NETWORK netmask $PRIVATE_NETMASK {}"
fi

#
# The email addresses need to be be munged for perl scripts. But,
# php needs them un-escaped
#
TBOPSEMAIL_NOSLASH="$TBOPSEMAIL"
TBOPSEMAIL="`echo $TBOPSEMAIL | sed -e 's/@/\\\@/'`"
TBROBOCOPSEMAIL_NOSLASH="$TBROBOCOPSEMAIL"
TBROBOCOPSEMAIL="`echo $TBROBOCOPSEMAIL | sed -e 's/@/\\\@/'`"
TBLOGSEMAIL_NOSLASH="$TBLOGSEMAIL"
TBLOGSEMAIL="`echo $TBLOGSEMAIL | sed -e 's/@/\\\@/'`"
TBAUDITEMAIL_NOSLASH="$TBAUDITEMAIL"
TBAUDITEMAIL="`echo $TBAUDITEMAIL | sed -e 's/@/\\\@/'`"
TBWWWEMAIL_NOSLASH="$TBWWWEMAIL"
TBWWWEMAIL="`echo $TBWWWEMAIL | sed -e 's/@/\\\@/'`"
TBAPPROVALEMAIL_NOSLASH="$TBAPPROVALEMAIL"
TBAPPROVALEMAIL="`echo $TBAPPROVALEMAIL | sed -e 's/@/\\\@/'`"
TBSTATEDEMAIL_NOSLASH="$TBSTATEDEMAIL_NOSLASH"
TBSTATEDEMAIL="`echo $TBSTATEDEMAIL | sed -e 's/@/\\\@/'`"
TBTESTSUITEEMAIL_NOSLASH="$TBTESTSUITEEMAIL_NOSLASH"
TBTESTSUITEEMAIL="`echo $TBTESTSUITEEMAIL | sed -e 's/@/\\\@/'`"

if test -n "$TBAUTOMAILEMAIL"; then
    TBAUTOMAILEMAIL_NOSLASH="$TBAUTOMAILEMAIL"
    TBAUTOMAILEMAIL="`echo $TBAUTOMAILEMAIL | sed -e 's/@/\\\@/'`"
else
    TBAUTOMAILEMAIL_NOSLASH="$TBLOGSEMAIL_NOSLASH"
    TBAUTOMAILEMAIL="$TBLOGSEMAIL"
fi
if test -n "$TBACTIVEARCHIVE"; then
    TBACTIVEARCHIVE_NOSLASH="$TBACTIVEARCHIVE"
    TBACTIVEARCHIVE="`echo $TBACTIVEARCHIVE | sed -e 's/@/\\\@/'`"
else
    TBACTIVEARCHIVE_NOSLASH="$TBOPSEMAIL_NOSLASH"
    TBACTIVEARCHIVE="$TBOPSEMAIL"
fi
if test -n "$TBUSERSARCHIVE"; then
    TBUSERSARCHIVE_NOSLASH="$TBUSERSARCHIVE"
    TBUSERSARCHIVE="`echo $TBUSERSARCHIVE | sed -e 's/@/\\\@/'`"
else
    TBUSERSARCHIVE_NOSLASH="$TBOPSEMAIL_NOSLASH"
    TBUSERSARCHIVE="$TBOPSEMAIL"
fi
if test -n "$TBERRORSEMAIL"; then
    TBERRORSEMAIL_NOSLASH="$TBERRORSEMAIL"
    TBERRORSEMAIL="`echo $TBERRORSEMAIL | sed -e 's/@/\\\@/'`"
else
    TBERRORSEMAIL_NOSLASH="$TBOPSEMAIL_NOSLASH"
    TBERRORSEMAIL="$TBOPSEMAIL"
fi

# Default OURDOMAIN to the domain name of the boss node
# This is gross beyond all description - autoconf changes m4's quote characters
# to '[' and ']', which prevents them from working in the sed expression below.
# So, we temporarily change them to something else then change them back.
# Note: In newer versions of autoconf, this can be done with 'quadrigraphs'
changequote(START, END)dnl
if test -z "$OURDOMAIN"; then
    OURDOMAIN="`echo $BOSSNODE | sed -E -e 's/^[a-zA-Z0-9\-]+\.//'`"
fi
changequote([, ])dnl
AC_DEFINE_UNQUOTED(OURDOMAIN, "$OURDOMAIN")

if test -z "$EXTERNAL_TESTBED_NETWORK"; then
    EXTERNAL_TESTBED_NETWORK=$TESTBED_NETWORK
fi
if test -z "$EXTERNAL_TESTBED_NETMASK"; then
    EXTERNAL_TESTBED_NETMASK=$TESTBED_NETMASK
fi
if test -z "$EXTERNAL_BOSSNODE_IP"; then
    EXTERNAL_BOSSNODE_IP=$BOSSNODE_IP
fi
if test -z "$EXTERNAL_USERNODE_IP"; then
    EXTERNAL_USERNODE_IP=$USERNODE_IP
fi
if test -z "$FSNODE_IP"; then
    FSNODE_IP=$USERNODE_IP
fi
if test -z "$EXTERNAL_FSNODE_IP"; then
    EXTERNAL_FSNODE_IP=$FSNODE_IP
fi
if test -z "$TBAUTHDOMAIN"; then
    TBAUTHDOMAIN=".$OURDOMAIN"
fi
if test -z "$TBAUTHTIMEOUT"; then
    TBAUTHTIMEOUT="21600"
fi
if test -z "$WWW"; then
    WWW="$WWWHOST"
fi
if test -z "$TBBASE"; then
    TBBASE="https://$WWW"
fi
if test -z "$TBDOCBASE"; then
    TBDOCBASE="http://$WWW"
fi
if test -z "$TBWWW"; then
    TBWWW="<$TBBASE/>"
fi
AC_DEFINE_UNQUOTED(TBBASE, "$TBBASE")

if test -z "$THISHOMEBASE"; then
    THISHOMEBASE="Emulab.Net"
fi
if test -z "$EVENTSERVER"; then
    EVENTSERVER="event-server"
fi
AC_DEFINE_UNQUOTED(EVENTSERVER, "$EVENTSERVER")

#
# Arguments to ssh to disable strict host key checking, etc
#
AC_ARG_WITH(ssh-args,
[  --with-ssh-args	Specify ssh arguments when running from testbed scripts ],
[
    SSH_ARGS="$withval"
],[
    SSH_ARGS="-q -o BatchMode=yes -o StrictHostKeyChecking=no"
])
AC_SUBST(SSH_ARGS)

#
# Path to install rc.d scripts in
#
AC_ARG_WITH(rcdir,
[  --with-rcdir		Specify path to install rc.d scripts (/usr/local/etc/rc.d default)],
[
    INSTALL_RCDIR="$with_rcdir"
],[
    INSTALL_RCDIR="/usr/local/etc/rc.d"
])
AC_SUBST(INSTALL_RCDIR)

#
# Path to install apache config files in
#
AC_ARG_WITH(apache-config-dir,
[  --with-apache-config	Specify path to install apache config files (/usr/local/etc/apache default)],
[
    INSTALL_APACHE_CONFIG="$withval"
],[
    INSTALL_APACHE_CONFIG="/usr/local/etc/apache"
])
AC_SUBST(INSTALL_APACHE_CONFIG)

#
# Optionally build with optimization or aggressive non-optimization
# (Actually three options: on, off or default.)
#
AC_ARG_ENABLE(debug,
[  --enable-debug        Build with debug flags (-g -DDEBUG)
  --disable-debug       Build with optimization flags (-O2 -DNDEBUG -UDEBUG)])

if test "$enable_debug" = "yes"; then
	OPT_CFLAGS="-g -DDEBUG";
else
	if test "$enable_debug" = "no"; then
		OPT_CFLAGS="-O2 -DNDEBUG -UDEBUG";
	else
		OPT_CFLAGS="-g -O";
	fi
fi
AC_SUBST(OPT_CFLAGS)

eventfiles="";
EVENTSYS=0;
AC_SUBST(EVENTSYS)

# Make sure $INSTALL is valid at any depth in our tree, i.e. make it absoulte.
# This can be needed when no valid install is found and autoconf falls back on
# the supplied install.sh, but we called 'configure' with a relative path.
AC_PROG_INSTALL
[case "$INSTALL" in
..*)
        INSTALL=`pwd`/$INSTALL
        ;;
esac]

AC_PATH_PROG(RSYNC, rsync, "", [${PATH}])
if test x"$RSYNC" = x"" || test ! -x "$RSYNC"; then
    AC_MSG_WARN([Rsync is required for logholes to work, see www.rsync.org.])
fi

# Turn on the new fancy banner - normally turned on only at Utah, but
# overridable for other sites
if test "$TBMAINSITE" = 1; then
    FANCYBANNER=1
fi

outfiles="$outfiles Makeconf GNUmakefile \
	ssl/GNUmakefile \
	db/GNUmakefile \
	db/libdb.pm db/emdbi.pm db/emutil.pm \
	account/GNUmakefile \
	account/mkusercert \
	tbsetup/GNUmakefile tbsetup/libaudit.pm \
	rc.d/GNUmakefile rc.d/2.mysql-server.sh  \
	rc.d/1.mysql-server.sh \
	apache/GNUmakefile apache/httpd.conf \
	install/GNUmakefile \
	install/clrhouse-install \
        protogeni/GNUmakefile protogeni/security/GNUmakefile \
        protogeni/xmlrpc/GNUmakefile protogeni/lib/GNUmakefile \
        protogeni/scripts/GNUmakefile protogeni/etc/GNUmakefile \
        protogeni/test/GNUmakefile"

#
# Do this for easy distclean.
#
DISTCLEAN_FILES="$outfiles"
AC_SUBST(DISTCLEAN_FILES)

AC_OUTPUT($outfiles)