configure.ac 49.3 KB
Newer Older
Leigh Stoller's avatar
Leigh Stoller committed
1
#
2
# Copyright (c) 2000-2015 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/>.
# 
# }}}
Leigh Stoller's avatar
Leigh Stoller committed
22
#
23
AC_PREREQ([2.68])
24

25 26 27
AC_INIT
AC_CONFIG_SRCDIR([Makeconf.in])
AC_CONFIG_AUX_DIR(autoconf)
28
AC_PREFIX_DEFAULT(/usr/testbed)
29
AC_CONFIG_HEADER(config.h)
Leigh Stoller's avatar
Leigh Stoller committed
30
AC_CANONICAL_HOST
31

32 33 34 35 36 37
# 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.
#
38
if test `(cd $srcdir; pwd)` = `pwd`; then
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    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

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
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)

Leigh Stoller's avatar
Leigh Stoller committed
77
CPPFLAGS="-I/usr/local/include"
78

Leigh Stoller's avatar
Leigh Stoller committed
79
# BEGIN Python detection. For the event library.
80
AC_PATH_PROGS(PYTHON, python python2.7 python2.6 python2.5 python2.4 python2.3 python2.2)
81 82 83 84 85 86 87

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}`
88 89 90
if test ! -d "$PYTHON_PATH/include"; then
    PYTHON_PATH=`dirname ${PYTHON_PATH}`
fi
91 92 93 94
PYTHON_INCLUDE="${PYTHON_PATH}/include/python${PYTHON_VERSION}"
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE}"
AC_CHECK_HEADERS([Python.h],
		 [],
95
		 [AC_MSG_WARN("Cannot find Python.h in ${PYTHON_INCLUDE}")])
96 97 98
AC_SUBST(PYTHON_INCLUDE)
# END Python detection.

99 100 101 102 103
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)
104

105 106
AC_EXEEXT

107
AC_PATH_PROG(DIG,dig)
108
AC_PATH_PROG(ELVIN_CONFIG,elvin-config)
109 110
AC_PATH_PROG(JAVAC,javac)
AC_PATH_PROG(JAR,jar)
111
AC_PATH_PROG(NC,nc)
112
AC_PATH_PROG(SUDO,sudo)
113
AC_PATH_PROG(UUIDGEN,uuidgen)
114

Robert Ricci's avatar
Robert Ricci committed
115
AC_CHECK_TOOL(SSH,ssh)
116

117 118
AC_CHECK_FUNCS(srandomdev)

119 120
AC_SUBST(optional_subdirs)

121
#
122
# These get defined in the definitions file (--with-TBDEFS).
123 124
# NB: See AC_DEFINE_UNQUOTED() calls below, if you want a variable
# to appear in config.h.
125
#
126
AC_SUBST(TBDBNAME)
127
AC_SUBST(TBERRORLOGDBNAME)
128
AC_SUBST(TBADMINGROUP)
Leigh Stoller's avatar
Leigh Stoller committed
129 130
AC_SUBST(DELAYCAPACITY)
AC_SUBST(IPBASE)
131 132
AC_SUBST(JAILIPBASE)
AC_SUBST(JAILIPMASK)
133 134
AC_SUBST(BOSSNODE)
AC_SUBST(USERNODE)
135
AC_SUBST(FSNODE)
136
AC_SUBST(EVENTSERVER)
137
AC_SUBST(BOSSEVENTPORT)
138
AC_SUBST(OURDOMAIN)
139 140 141 142 143
AC_SUBST(USERSROOT_DIR)
AC_SUBST(PROJROOT_DIR)
AC_SUBST(GROUPSROOT_DIR)
AC_SUBST(SCRATCHROOT_DIR)
AC_SUBST(SHAREROOT_DIR)
144 145 146
AC_SUBST(FSDIR_PROJ)
AC_SUBST(FSDIR_GROUPS)
AC_SUBST(FSDIR_USERS)
147
AC_SUBST(FSDIR_SHARE)
148
AC_SUBST(FSDIR_SCRATCH)
149
AC_SUBST(FS_WITH_QUOTAS)
150
AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH)
151
AC_SUBST(TIMESTAMPS)
152
AC_SUBST(OURTIMEZONE)
153
AC_SUBST(NODECONSOLE)
154
AC_SUBST(MFSVERSION)
155
AC_SUBST(UNIFIED_BOSS_AND_OPS)
156
AC_SUBST(DISABLE_NSE)
157 158
AC_SUBST(DISABLE_DHCPD_INSTALL)
AC_SUBST(DISABLE_NAMED_INSTALL)
159
AC_SUBST(DISABLE_NAMED_SETUP)
160
AC_SUBST(DISABLE_EXPORTS_SETUP)
161
AC_SUBST(DISABLE_EVENT_SCHED)
162 163 164
AC_SUBST(CLIENT_ETCDIR)
AC_SUBST(CLIENT_BINDIR)
AC_SUBST(CLIENT_VARDIR)
165
AC_SUBST(CLIENT_MANDIR)
166
AC_SUBST(SNMP_RW_COMMUNITY)
167 168 169
AC_SUBST(WWWHOST)
AC_SUBST(WWW)
AC_SUBST(TBBASE)
170
AC_SUBST(TBDEFS)
171 172 173 174 175 176 177 178
AC_SUBST(TBDOCBASE)
AC_SUBST(TBWWW)
AC_SUBST(THISHOMEBASE)
AC_SUBST(TBSECURECOOKIES)
AC_SUBST(TBCOOKIESUFFIX)
AC_SUBST(TBAUTHDOMAIN)
AC_SUBST(TBAUTHTIMEOUT)
AC_SUBST(TBMAINSITE)
179
AC_SUBST(FANCYBANNER)
180
AC_SUBST(SFSSUPPORT)
181
AC_SUBST(ELABINELAB)
182 183 184
AC_SUBST(OUTERBOSS_NODENAME)
AC_SUBST(OUTERBOSS_XMLRPCPORT)
AC_SUBST(OUTERBOSS_SSLCERTNAME)
185
AC_SUBST(SUBBOSS_SSLCERTNAME)
186
AC_SUBST(PLABSUPPORT)
187
AC_SUBST(PUBSUPPORT)
188
AC_SUBST(WIKISUPPORT)
189
AC_SUBST(MAILMANSUPPORT)
190
AC_SUBST(BUGDBSUPPORT)
191
AC_SUBST(OPSDBSUPPORT)
192
AC_SUBST(NFSTRACESUPPORT)
193
AC_SUBST(NTPSERVER)
194 195 196 197 198
AC_SUBST(EXTERNAL_NTPSERVER1)
AC_SUBST(EXTERNAL_NTPSERVER2)
AC_SUBST(EXTERNAL_NTPSERVER3)
AC_SUBST(EXTERNAL_NTPSERVER4)
AC_SUBST(NTPDRIFTFILE)
199
AC_SUBST(TBLOGFACIL)
200
AC_SUBST(TESTBED_NETWORK)
201
AC_SUBST(EXTERNAL_TESTBED_NETWORK)
202
AC_SUBST(TESTBED_NETMASK)
203
AC_SUBST(EXTERNAL_TESTBED_NETMASK)
204
AC_SUBST(BOSSNODE_IP)
205
AC_SUBST(EXTERNAL_BOSSNODE_IP)
206
AC_SUBST(USERNODE_IP)
207
AC_SUBST(EXTERNAL_USERNODE_IP)
208 209
AC_SUBST(FSNODE_IP)
AC_SUBST(EXTERNAL_FSNODE_IP)
210 211 212 213 214 215 216 217 218
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)
219 220 221
AC_SUBST(MANAGEMENT_NETWORK)
AC_SUBST(MANAGEMENT_NETMASK)
AC_SUBST(MANAGEMENT_ROUTER)
222 223
AC_SUBST(VIRTNODE_NETWORK)
AC_SUBST(VIRTNODE_NETMASK)
224
AC_SUBST(DHCPD_DYNRANGE)
225
AC_SUBST(DHCPD_EXTRAIFS)
226
AC_SUBST(DHCPD_CONTROLNET_DECL)
227
AC_SUBST(NAMED_FORWARDERS)
228
AC_SUBST(NAMED_ALSONOTIFY)
229 230 231 232
AC_SUBST(SSLCERT_COUNTRY)
AC_SUBST(SSLCERT_STATE)
AC_SUBST(SSLCERT_LOCALITY)
AC_SUBST(SSLCERT_ORGNAME)
233 234
AC_SUBST(FRISEBEEMCASTADDR)
AC_SUBST(FRISEBEEMCASTPORT)
235
AC_SUBST(FRISEBEENUMPORTS)
236
AC_SUBST(WINSUPPORT)
237
AC_SUBST(NSVERIFY)
238
AC_SUBST(CVSSUPPORT)
239
AC_SUBST(TRACSUPPORT)
240
AC_SUBST(CHATSUPPORT)
241
AC_SUBST(STAMPS)
242
AC_SUBST(ARCHIVESUPPORT)
243 244
AC_SUBST(MIN_UNIX_UID)
AC_SUBST(MIN_UNIX_GID)
245
AC_SUBST(DELAYTHRESH)
246
AC_SUBST(PELABSUPPORT)
247
AC_SUBST(ELVIN_COMPAT)
248 249
AC_SUBST(ISOLATEADMINS)
AC_SUBST(DYNAMICROOTPASSWORDS)
250
AC_SUBST(TPM)
251
AC_SUBST(REMOTEWIKIDOCS)
Leigh Stoller's avatar
Leigh Stoller committed
252
AC_SUBST(PROTOGENI_SUPPORT)
253 254 255
AC_SUBST(PROTOGENI_WEBSITE)
AC_SUBST(PROTOGENI_ISCLEARINGHOUSE)
AC_SUBST(PROTOGENI_EMAIL)
Leigh Stoller's avatar
Leigh Stoller committed
256
AC_SUBST(PROTOGENI_DOMAIN)
257 258
AC_SUBST(PROTOGENI_RPCPORT)
AC_SUBST(PROTOGENI_RPCNAME)
259
AC_SUBST(PROTOGENI_LOCALUSER)
260
AC_SUBST(PROTOGENI_MAXSERVERLOAD)
261
AC_SUBST(PROTOGENI_GENIWEBLOGIN)
262
AC_SUBST(GENI_PUBRPCPORT)
263
AC_SUBST(PROTOGENI_URL)
264
AC_SUBST(PROTOGENI_GENIRACK)
265
AC_SUBST(PROTOGENI_NICKNAME)
266
AC_SUBST(STANDALONE_CLEARINGHOUSE)
267
AC_SUBST(GMAP_API_KEY)
268
AC_SUBST(NODE_USAGE_SUPPORT)
269
AC_SUBST(NOSTACKMIB)
270
AC_SUBST(EXP_VIS_SUPPORT)
271
AC_SUBST(NOSHAREDFS)
272
AC_SUBST(IMPORT_TMPDIR)
273
AC_SUBST(SELFLOADER_DATA)
274
AC_SUBST(TBUSEDBI)
275
AC_SUBST(NEEDMCQUERIER)
276 277
AC_SUBST(OPSVM_ENABLE)
AC_SUBST(OPSVM_MOUNTPOINT)
278 279
AC_SUBST(PORTAL_ENABLE)
AC_SUBST(PORTAL_ISPRIMARY)
280
AC_SUBST(LINUX_FSNODE)
281 282
AC_SUBST(VPUBADDR_BASE)
AC_SUBST(VPUBADDR_BITLEN)
283 284 285 286
AC_SUBST(WINDOWS_ORGNAME)
AC_SUBST(WINDOWS_OWNER)
AC_SUBST(WINDOWS_TIMEZONE)
AC_SUBST(WINDOWS_KEY_7PRO_X86)
287 288 289 290
AC_SUBST(FIREWALL_BOSS)
AC_SUBST(FIREWALL_OPS)
AC_SUBST(FIREWALL_BOSS_LOCALRULETMPL)
AC_SUBST(FIREWALL_OPS_LOCALRULETMPL)
291
AC_SUBST(SPEWFROMOPS)
292
AC_SUBST(NOSITECHECKIN)
293
AC_SUBST(EC2META_ENABLE)
294
AC_SUBST(BROWSER_CONSOLE_ENABLE)
295 296
AC_SUBST(IPV6_ENABLED)
AC_SUBST(IPV6_SUBNET_PREFIX)
297
AC_SUBST(NFSMAPTOUSER)
298
AC_SUBST(IMAGEPROVENANCE)
299
AC_SUBST(IMAGEDELTAS)
300
AC_SUBST(PROFILEVERSIONS)
301
AC_SUBST(NOVIRTNFSMOUNTS)
302 303 304 305 306
AC_SUBST(WITHZFS)
AC_SUBST(ZFS_ROOT)
AC_SUBST(ZFS_QUOTA_USER)
AC_SUBST(ZFS_QUOTA_PROJECT)
AC_SUBST(ZFS_QUOTA_GROUP)
307
AC_SUBST(ZFS_NOEXPORT)
308
AC_SUBST(INCREMENTAL_MOUNTD)
309 310
AC_SUBST(WITHAMD)
AC_SUBST(AMD_ROOT)
311
AC_SUBST(BS_IQN_PREFIX)
312

313 314 315 316 317 318
#
# 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)
319 320
AC_SUBST(TBROBOCOPSEMAIL)
AC_SUBST(TBROBOCOPSEMAIL_NOSLASH)
321 322 323 324 325 326 327 328 329 330 331 332
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)
333 334
AC_SUBST(TBAUTOMAILEMAIL)
AC_SUBST(TBAUTOMAILEMAIL_NOSLASH)
335 336 337 338
AC_SUBST(TBACTIVEARCHIVE)
AC_SUBST(TBACTIVEARCHIVE_NOSLASH)
AC_SUBST(TBUSERSARCHIVE)
AC_SUBST(TBUSERSARCHIVE_NOSLASH)
Leigh Stoller's avatar
Leigh Stoller committed
339 340
AC_SUBST(TBERRORSEMAIL)
AC_SUBST(TBERRORSEMAIL_NOSLASH)
341

342 343 344 345 346
#
# For snmpit support of Arista switch.
#
AC_SUBST(ARISTA_SWITCH_XMLRPCPORT)

347 348
#
# Defaults for for above variables.
349
#
350
TBERRORLOGDBNAME="errorlog"
351
TBADMINGROUP="flux"
352 353 354
CLIENT_ETCDIR="/etc/emulab"
CLIENT_BINDIR="/usr/local/etc/emulab"
CLIENT_VARDIR="/var/emulab"
355
CLIENT_MANDIR="/usr/local/man"
356 357
TBSECURECOOKIES=1
TBMAINSITE=0
358
TBUSEDBI=0
359
FANCYBANNER=0
360 361 362 363
VIRTNODE_NETWORK=172.16.0.0
VIRTNODE_NETMASK=255.240.0.0
JAILIPBASE=$VIRTNODE_NETWORK
JAILIPMASK=$VIRTNODE_NETMASK
364
IPBASE=10
365
SFSSUPPORT=0
366
ELABINELAB=0
367 368 369
OUTERBOSS_NODENAME=""
OUTERBOSS_XMLRPCPORT=3069
OUTERBOSS_SSLCERTNAME="/etc/outer_emulab.pem"
370
SUBBOSS_SSLCERTNAME="/etc/subboss.pem"
371
PLABSUPPORT=0
372
PUBSUPPORT=0
373
WIKISUPPORT=0
374
BUGDBSUPPORT=0
375
OPSDBSUPPORT=0
376
MAILMANSUPPORT=0
377
WINSUPPORT=0
378
NSVERIFY=1
379
CVSSUPPORT=0
380
TRACSUPPORT=0
381
CHATSUPPORT=0
382
STAMPS=0
383
ARCHIVESUPPORT=0
384
NFSTRACESUPPORT=0
385
TBLOGFACIL="local5"
386
BOSSEVENTPORT=16505
387
NTPSERVER="ops"
388 389 390 391 392
EXTERNAL_NTPSERVER1="0.pool.ntp.org"
EXTERNAL_NTPSERVER2="1.pool.ntp.org"
EXTERNAL_NTPSERVER3="2.pool.ntp.org"
EXTERNAL_NTPSERVER4="3.pool.ntp.org"
NTPDRIFTFILE="/var/db/ntp.drift"
393
UNIFIED_BOSS_AND_OPS=0
394 395
DISABLE_NAMED_INSTALL=0
DISABLE_DHCPD_INSTALL=0
396
DISABLE_NAMED_SETUP=0
397 398
FRISEBEEMCASTADDR="234.5.6"
FRISEBEEMCASTPORT=3564
399
FRISEBEENUMPORTS=0
400 401
MIN_UNIX_UID=10000
MIN_UNIX_GID=6000
402
DELAYTHRESH=2
403
PELABSUPPORT=0
404
ELVIN_COMPAT=0
405 406
ISOLATEADMINS=1
DYNAMICROOTPASSWORDS=1
407
TPM=0
408
REMOTEWIKIDOCS=1
Leigh Stoller's avatar
Leigh Stoller committed
409
PROTOGENI_SUPPORT=0
410 411 412
PROTOGENI_ISCLEARINGHOUSE=0
PROTOGENI_EMAIL="geni-dev-utah@flux.utah.edu"
PROTOGENI_WEBSITE="www.emulab.net"
Leigh Stoller's avatar
Leigh Stoller committed
413
PROTOGENI_DOMAIN="unknown"
414 415
PROTOGENI_RPCPORT=12369
PROTOGENI_RPCNAME=""
416 417
PROTOGENI_LOCALUSER=0
PROTOGENI_GENIWEBLOGIN=0
418
PROTOGENI_MAXSERVERLOAD=12
419
GENI_PUBRPCPORT=12370
420
PROTOGENI_GENIRACK=0
421
PROTOGENI_NICKNAME="unknown"
422
STANDALONE_CLEARINGHOUSE=0
423
NODE_USAGE_SUPPORT=0
424
EXP_VIS_SUPPORT=0
425
NOSTACKMIB=0
426
NOSHAREDFS=0
427
IMPORT_TMPDIR="/q"
428
NFSRACY=1
429
SELFLOADER_DATA="__DATA__"
430
NEEDMCQUERIER=0
431 432
OPSVM_ENABLE=0
OPSVM_MOUNTPOINT="/ops"
433
OURTIMEZONE="America/Denver"
434
NODECONSOLE="sio"
435
MFSVERSION=""
436 437
PORTAL_ENABLE=0
PORTAL_ISPRIMARY=0
438
LINUX_FSNODE=0
439
DHCPD_EXTRAIFS=""
440 441
VPUBADDR_BASE="none"
VPUBADDR_BITLEN="none"
442
ARISTA_SWITCH_XMLRPCPORT=80
443 444 445 446
FIREWALL_BOSS=0
FIREWALL_OPS=0
FIREWALL_BOSS_LOCALRULETMPL=""
FIREWALL_OPS_LOCALRULETMPL=""
447
SPEWFROMOPS=0
448
NOSITECHECKIN=0
449
EC2META_ENABLE=0
450
BROWSER_CONSOLE_ENABLE=0
451 452
IPV6_ENABLED=0
IPV6_SUBNET_PREFIX=""
453 454 455
MANAGEMENT_NETWORK="10.249.249.0"
MANAGEMENT_NETMASK="255.255.255.0"
MANAGEMENT_ROUTER="10.249.249.253"
456
NFSMAPTOUSER="root"
457
IMAGEPROVENANCE=0
458
IMAGEDELTAS=0
459
PROFILEVERSIONS=0
460
NOVIRTNFSMOUNTS=0
461 462 463 464 465
WITHZFS=0
ZFS_ROOT=z
ZFS_QUOTA_USER="1G"
ZFS_QUOTA_PROJECT="100G"
ZFS_QUOTA_GROUP="10G"
466
ZFS_NOEXPORT=0
467
INCREMENTAL_MOUNTD=0
468 469
WITHAMD=0
AMD_ROOT=/.amd_mnt
470
BS_IQN_PREFIX=iqn.2000-10.net.emulab
471

472 473 474 475 476 477 478 479 480 481
#
# 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=""

Leigh Stoller's avatar
Leigh Stoller committed
482 483 484 485 486 487
#
# Flag as full Emulab build (for clientside). 
#
WITH_EMULAB=1
AC_SUBST(WITH_EMULAB)

488 489 490
#
# Okay, I know this is improper usage of --with. Too bad.
#
491 492
AC_ARG_WITH(TBDEFS,
[  --with-TBDEFS=name	Specify definitions file (defs-default default)],
493 494
[
    if test "$withval" = "yes"; then
495
	AC_MSG_ERROR([Invalid TBDEFS - Must specify the value])
496
    fi
497
    TBDEFS="$withval"
498
    TBPATH=`dirname $withval`
499
],[
500 501 502
    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.
503 504
Copy and modify the defs-example file for your Emulab installation.
defs-default has values for Utah, including client-side image compilations.])
505
])
506 507 508 509 510

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

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

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
# Try to guess ProtoGENI nickname if it wasn't specified explicitly,
# for backward compatibility (nobody used to care what they were called)
if test x"$PROTOGENI_NICKNAME" = x"unknown"; then
    case $OURDOMAIN in
    *utah.geniracks.net) PROTOGENI_NICKNAME="utah-ig";;
    *utahddc.geniracks.net) PROTOGENI_NICKNAME="utahddc-ig";;
    *gpolab.bbn.com) PROTOGENI_NICKNAME="gpo-ig";;
    *northwestern.edu) PROTOGENI_NICKNAME="northwestern-ig";;
    *lan.sdn.uky.edu) PROTOGENI_NICKNAME="uky-ig";;
    *kettering.edu) PROTOGENI_NICKNAME="kettering-ig";;
    *rnoc.gatech.edu) PROTOGENI_NICKNAME="gatech-ig";;
    *cs.princeton.edu) PROTOGENI_NICKNAME="princeton-ig";;
    *clemson.edu) PROTOGENI_NICKNAME="clemson-ig";;
    *ku.gpeni.net) PROTOGENI_NICKNAME="kansas-ig";;
    *nyu.edu) PROTOGENI_NICKNAME="nyu-ig";;
    *uidaho.edu) PROTOGENI_NICKNAME="idaho-ig";;
    *maxgigapop.net) PROTOGENI_NICKNAME="max-ig";;
    *nysernet.org) PROTOGENI_NICKNAME="nysernet-ig";;
    *sox.net) PROTOGENI_NICKNAME="sox-ig";;
    *illinois.edu) PROTOGENI_NICKNAME="illinois-ig";;
    *rnet.missouri.edu) PROTOGENI_NICKNAME="missouri-ig";;
    *wisc.edu) PROTOGENI_NICKNAME="wisconsin-ig";;
    *rutgers.edu) PROTOGENI_NICKNAME="rutgers-ig";;
    *stanford.edu) PROTOGENI_NICKNAME="stanford-ig";;
    *it.cornell.edu) PROTOGENI_NICKNAME="cornell-ig";;
    *lsu.edu) PROTOGENI_NICKNAME="lsu-ig";;
    *case.edu) PROTOGENI_NICKNAME="cwru-ig";;
    *iu.edu) PROTOGENI_NICKNAME="moxi-ig";;
    *uchicago.edu) PROTOGENI_NICKNAME="uchicago-ig";;
    *metrodatacenter.com) PROTOGENI_NICKNAME="ohmetrodc-ig";;
    *nps.edu) PROTOGENI_NICKNAME="nps-ig";;
    *osu.edu) PROTOGENI_NICKNAME="osu-ig";;
    *umkc.edu) PROTOGENI_NICKNAME="umkc-ig";;
    *idre.ucla.edu) PROTOGENI_NICKNAME="ucla-ig";;
558 559
    *washington.edu) PROTOGENI_NICKNAME="uwashington-ig";;
    *rnet.missouri.edu) PROTOGENI_NICKNAME="missouri-ig";;
560 561 562
    *pks2.sdn.uky.edu) PROTOGENI_NICKNAME="ukypks2-ig";;
    *colorado.edu) PROTOGENI_NICKNAME="colorado-ig";;
    *cenic.net) PROTOGENI_NICKNAME="cenic-ig";;
563 564 565
    esac
fi

566 567 568 569 570 571
#
# 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!
#
572
if test x"$prefix" = x"NONE"; then
573
    AC_DEFINE_UNQUOTED(TBROOT, "/usr/testbed", [FS base for Emulab files])
574
else
575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
    AC_DEFINE_UNQUOTED(TBROOT, "$prefix", [FS base for Emulab files])
fi
AC_DEFINE_UNQUOTED(TBDBNAME, "$TBDBNAME", [Emulab DB name])
AC_DEFINE_UNQUOTED(TBERRORLOGDBNAME, "$TBERRORLOGDBNAME", [Emulab errorlog DB])
AC_DEFINE_UNQUOTED(TBADMINGROUP, "$TBADMINGROUP", [Unix group of admin user])
AC_DEFINE_UNQUOTED(IPBASE, "$IPBASE", [Base of IPv4 space used for experiments])
AC_DEFINE_UNQUOTED(JAILIPBASE, "$JAILIPBASE", [Base of IPv4 space used for VMs])
AC_DEFINE_UNQUOTED(JAILIPMASK, "$JAILIPMASK", [Netmask for JAILIPBASE])
AC_DEFINE_UNQUOTED(BOSSNODE, "$BOSSNODE", [DNS name of boss node])
AC_DEFINE_UNQUOTED(BOSSNODE_IP, "$BOSSNODE_IP", [IPv4 address of boss node to be used by nodes])
AC_DEFINE_UNQUOTED(EXTERNAL_BOSSNODE_IP, "$EXTERNAL_BOSSNODE_IP", [IPv4 address of boss used from outside])
AC_DEFINE_UNQUOTED(USERNODE, "$USERNODE", [DNS name of ops node])
AC_DEFINE_UNQUOTED(USERNODE_IP, "$USERNODE_IP", [IPv4 address of ops node to be used by nodes])
AC_DEFINE_UNQUOTED(EXTERNAL_USERNODE_IP, "$EXTERNAL_USERNODE_IP", [IPv4 address of ops used from outside])
AC_DEFINE_UNQUOTED(FSNODE, "$FSNODE", [DNS name of fs node])
590
if test -n "$FSNODE_IP"; then
591
	AC_DEFINE_UNQUOTED(FSNODE_IP, "$FSNODE_IP", [IPv4 address of fs node to be used by nodes])
592
elif test "$USERNODE" = "$FSNODE"; then
593
	AC_DEFINE_UNQUOTED(FSNODE_IP, "$USERNODE_IP", [IPv4 address of fs node to be used by nodes])
594
elif test "$BOSSNODE" = "$FSNODE"; then
595 596 597 598 599 600 601 602 603 604 605 606 607
	AC_DEFINE_UNQUOTED(FSNODE_IP, "$BOSSNODE_IP", [IPv4 address of fs node to be used by nodes])
fi
AC_DEFINE_UNQUOTED(CONTROL_ROUTER_IP, "$CONTROL_ROUTER_IP", [IPv4 address of router to be used by nodes])
AC_DEFINE_UNQUOTED(CONTROL_NETWORK, "$CONTROL_NETWORK", [IPv4 node control network])
AC_DEFINE_UNQUOTED(CONTROL_NETMASK, "$CONTROL_NETMASK", [IPv4 node control network mask])
AC_DEFINE_UNQUOTED(USERSROOT_DIR, "$USERSROOT_DIR", [Root of 'users' filesystem])
AC_DEFINE_UNQUOTED(PROJROOT_DIR, "$PROJROOT_DIR", [Root of 'proj' filesystem])
AC_DEFINE_UNQUOTED(GROUPSROOT_DIR, "$GROUPSROOT_DIR", [Root of 'groups' filesystem])
AC_DEFINE_UNQUOTED(SCRATCHROOT_DIR, "$SCRATCHROOT_DIR", [Root of 'scratch' filesystem])
AC_DEFINE_UNQUOTED(SHAREROOT_DIR, "$SHAREROOT_DIR", [Root of 'share' filesystem])
AC_DEFINE_UNQUOTED(FSDIR_PROJ, "$FSDIR_PROJ", [Mount point of 'proj' filesystem on fs node])
AC_DEFINE_UNQUOTED(FSDIR_GROUPS, "$FSDIR_GROUPS", [Mount point of 'groups' filesystem on fs node])
AC_DEFINE_UNQUOTED(FSDIR_USERS, "$FSDIR_USERS", [Mount point of 'users' filesystem on fs node])
608
if test -n "$FSDIR_SHARE"; then
609
    AC_DEFINE_UNQUOTED(FSDIR_SHARE, "$FSDIR_SHARE", [Mount point of 'share' filesystem on fs node])
610
fi
611
if test -n "$FSDIR_SCRATCH"; then
612
    AC_DEFINE_UNQUOTED(FSDIR_SCRATCH, "$FSDIR_SCRATCH", [Mount point of 'scratch' filesystem on fs node])
613
fi
614 615 616 617
AC_DEFINE_UNQUOTED(BOSSEVENTPORT, "$BOSSEVENTPORT", [IPv4 address of pubsub server on boss])
AC_DEFINE_UNQUOTED(FRISEBEEMCASTADDR, "$FRISEBEEMCASTADDR", [Base IPv4 multicast address for disk imaging])
AC_DEFINE_UNQUOTED(FRISEBEEMCASTPORT, "$FRISEBEEMCASTPORT", [Base IPv4 port for disk imaging])
AC_DEFINE_UNQUOTED(FRISEBEENUMPORTS, "$FRISEBEENUMPORTS", [Number of IPv4 ports for disk imaging])
618

619 620 621 622 623 624
AC_DEFINE_UNQUOTED(NTPSERVER, "$NTPSERVER", [NTP server for nodes])
AC_DEFINE_UNQUOTED(EXTERNAL_NTPSERVER1, "$EXTERNAL_NTPSERVER1", [External NTP server for NTP node])
AC_DEFINE_UNQUOTED(EXTERNAL_NTPSERVER2, "$EXTERNAL_NTPSERVER2", [External NTP server for NTP node])
AC_DEFINE_UNQUOTED(EXTERNAL_NTPSERVER3, "$EXTERNAL_NTPSERVER3", [External NTP server for NTP node])
AC_DEFINE_UNQUOTED(EXTERNAL_NTPSERVER4, "$EXTERNAL_NTPSERVER4", [External NTP server for NTP node])
AC_DEFINE_UNQUOTED(NTPDRIFTFILE, "$NTPDRIFTFILE", [Location of NTP driftfile])
625

626 627 628
AC_DEFINE_UNQUOTED(MANAGEMENT_NETWORK, "$MANAGEMENT_NETWORK", [IPv4 node mangagement network])
AC_DEFINE_UNQUOTED(MANAGEMENT_NETMASK, "$MANAGEMENT_NETMASK", [IPv4 node management netmask])
AC_DEFINE_UNQUOTED(MANAGEMENT_ROUTER, "$MANAGEMENT_ROUTER", [IPv4 node management default GW])
629

630
if test $OPSDBSUPPORT -eq 1; then
631
    AC_DEFINE_UNQUOTED(OPSDBSUPPORT, 1, [Obsolete])
632 633
fi

634
if test $ELVIN_COMPAT -eq 1; then
635
    AC_DEFINE_UNQUOTED(ELVIN_COMPAT, 1, [Obsolete])
636 637
fi

638
if test $ELABINELAB -eq 1; then
639
    AC_DEFINE_UNQUOTED(ELABINELAB, 1, [For an Emulab-in-Emulab configuration])
640
fi
641

642
if test $ISOLATEADMINS -eq 1; then
643
    AC_DEFINE_UNQUOTED(ISOLATEADMINS, 1, [Do not allow admins and non-admins in same project])
644 645
fi
if test $DYNAMICROOTPASSWORDS -eq 1; then
646
    AC_DEFINE_UNQUOTED(DYNAMICROOTPASSWORDS, 1, [Per-node root passwords])
647
fi
648
if test $TPM -eq 1; then
649
    AC_DEFINE_UNQUOTED(TPM, 1, [Something about TPM])
650
fi
651
if test $NOSHAREDFS -eq 1; then
652
    AC_DEFINE_UNQUOTED(NOSHAREDFS, 1, [Do not allow NFS-shared filesystems])
653 654
fi
if test $NFSRACY -eq 1; then
655
    AC_DEFINE_UNQUOTED(NFSRACY, 1, [NFS server has race])
656
fi
657
if test $OPSVM_ENABLE -eq 1; then
658 659
    AC_DEFINE_UNQUOTED(OPSVM_ENABLE, 1, [ops node is a VM])
    AC_DEFINE_UNQUOTED(OPSVM_MOUNTPOINT, $OPSVM_MOUNTPOINT, [mount point on boss for ops VM FSes])
660
fi
661
if test $SPEWFROMOPS -eq 1; then
662
    AC_DEFINE_UNQUOTED(SPEWFROMOPS, 1, [Server rpm/tarballs from ops rather than boss])
663
fi
664
if test $PROTOGENI_SUPPORT -eq 1; then
665
    AC_DEFINE_UNQUOTED(PROTOGENI_SUPPORT, 1, [Support Protogeni])
666 667
fi
if test $PROTOGENI_GENIRACK -eq 1; then
668
    AC_DEFINE_UNQUOTED(PROTOGENI_GENIRACK, 1, [Support Protogeni rack])
669
fi
670
if test $IMAGEPROVENANCE -eq 1; then
671
    AC_DEFINE_UNQUOTED(IMAGEPROVENANCE, 1, [Support image versioning])
672 673
fi
if test $IMAGEDELTAS -eq 1; then
674
    AC_DEFINE_UNQUOTED(IMAGEDELTAS, 1, [Support imagezip delta images])
675
fi
676
if test $NOVIRTNFSMOUNTS -eq 1; then
677
    AC_DEFINE_UNQUOTED(NOVIRTNFSMOUNTS, 1, [Do not use NFS mounts on virtual nodes])
678 679
fi
if test $WITHZFS -eq 1; then
680
    AC_DEFINE_UNQUOTED(WITHZFS, 1, [Use ZFS on FS node for shared filesystems])
681
fi
682
if test $WITHAMD -eq 1; then
683
    AC_DEFINE_UNQUOTED(WITHAMD, 1, [Run AMD on boss node to handle shared FS mounts])
684
    AC_DEFINE_UNQUOTED(AMD_ROOT, "$AMD_ROOT", [Actual FS mount directory for AMD])
685
fi
686
AC_DEFINE_UNQUOTED(IMPORT_TMPDIR, "$IMPORT_TMPDIR", [Directory to use for imported images])
687

688
LOG_TESTBED=`echo "LOG_$TBLOGFACIL" | tr a-z A-Z`
689
AC_DEFINE_UNQUOTED(LOG_TESTBED, $LOG_TESTBED, [Syslog log facility for Emulab daemons])
690 691
AC_SUBST(LOG_TESTBED)

692 693 694 695
#
# 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!
696
#
697 698
if test "$PRIVATE_NETWORK" != "$CONTROL_NETWORK"; then
    DHCPD_CONTROLNET_DECL="subnet $PRIVATE_NETWORK netmask $PRIVATE_NETMASK {}"
699 700
fi

701
#
702 703
# The email addresses need to be be munged for perl scripts. But,
# php needs them un-escaped
704
#
705
TBOPSEMAIL_NOSLASH="$TBOPSEMAIL"
706
TBOPSEMAIL="`echo $TBOPSEMAIL | sed -e 's/@/\\\@/'`"
707 708
TBROBOCOPSEMAIL_NOSLASH="$TBROBOCOPSEMAIL"
TBROBOCOPSEMAIL="`echo $TBROBOCOPSEMAIL | sed -e 's/@/\\\@/'`"
709
TBLOGSEMAIL_NOSLASH="$TBLOGSEMAIL"
710
TBLOGSEMAIL="`echo $TBLOGSEMAIL | sed -e 's/@/\\\@/'`"
711
TBAUDITEMAIL_NOSLASH="$TBAUDITEMAIL"
712
TBAUDITEMAIL="`echo $TBAUDITEMAIL | sed -e 's/@/\\\@/'`"
713 714 715 716
TBWWWEMAIL_NOSLASH="$TBWWWEMAIL"
TBWWWEMAIL="`echo $TBWWWEMAIL | sed -e 's/@/\\\@/'`"
TBAPPROVALEMAIL_NOSLASH="$TBAPPROVALEMAIL"
TBAPPROVALEMAIL="`echo $TBAPPROVALEMAIL | sed -e 's/@/\\\@/'`"
717 718 719 720
TBSTATEDEMAIL_NOSLASH="$TBSTATEDEMAIL_NOSLASH"
TBSTATEDEMAIL="`echo $TBSTATEDEMAIL | sed -e 's/@/\\\@/'`"
TBTESTSUITEEMAIL_NOSLASH="$TBTESTSUITEEMAIL_NOSLASH"
TBTESTSUITEEMAIL="`echo $TBTESTSUITEEMAIL | sed -e 's/@/\\\@/'`"
721

722
if test -n "$TBAUTOMAILEMAIL"; then
723
    TBAUTOMAILEMAIL_NOSLASH="$TBAUTOMAILEMAIL"
724 725 726 727 728
    TBAUTOMAILEMAIL="`echo $TBAUTOMAILEMAIL | sed -e 's/@/\\\@/'`"
else
    TBAUTOMAILEMAIL_NOSLASH="$TBLOGSEMAIL_NOSLASH"
    TBAUTOMAILEMAIL="$TBLOGSEMAIL"
fi
729
if test -n "$TBACTIVEARCHIVE"; then
730
    TBACTIVEARCHIVE_NOSLASH="$TBACTIVEARCHIVE"
731 732
    TBACTIVEARCHIVE="`echo $TBACTIVEARCHIVE | sed -e 's/@/\\\@/'`"
else
733
    TBACTIVEARCHIVE_NOSLASH="$TBOPSEMAIL_NOSLASH"
734 735 736
    TBACTIVEARCHIVE="$TBOPSEMAIL"
fi
if test -n "$TBUSERSARCHIVE"; then
737
    TBUSERSARCHIVE_NOSLASH="$TBUSERSARCHIVE"
738 739
    TBUSERSARCHIVE="`echo $TBUSERSARCHIVE | sed -e 's/@/\\\@/'`"
else
740
    TBUSERSARCHIVE_NOSLASH="$TBOPSEMAIL_NOSLASH"
741 742
    TBUSERSARCHIVE="$TBOPSEMAIL"
fi
Leigh Stoller's avatar
Leigh Stoller committed
743 744 745 746 747 748 749
if test -n "$TBERRORSEMAIL"; then
    TBERRORSEMAIL_NOSLASH="$TBERRORSEMAIL"
    TBERRORSEMAIL="`echo $TBERRORSEMAIL | sed -e 's/@/\\\@/'`"
else
    TBERRORSEMAIL_NOSLASH="$TBOPSEMAIL_NOSLASH"
    TBERRORSEMAIL="$TBOPSEMAIL"
fi
750 751 752
if test -n "$PROTOGENI_EMAIL"; then
    PROTOGENI_EMAIL="`echo $PROTOGENI_EMAIL | sed -e 's/@/\\\@/'`"
fi
753

754 755 756 757 758 759 760 761 762 763
# 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
764
AC_DEFINE_UNQUOTED(OURDOMAIN, "$OURDOMAIN", [Domain name of Emulab site])
765

766 767 768 769 770 771 772 773 774 775 776 777
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
778 779 780 781 782 783
if test -z "$FSNODE_IP"; then
    FSNODE_IP=$USERNODE_IP
fi
if test -z "$EXTERNAL_FSNODE_IP"; then
    EXTERNAL_FSNODE_IP=$FSNODE_IP
fi
784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801
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
802
AC_DEFINE_UNQUOTED(TBBASE, "$TBBASE", [Base URL for Emulab files])
803

804 805 806
if test -z "$THISHOMEBASE"; then
    THISHOMEBASE="Emulab.Net"
fi
807
if test -z "$EVENTSERVER"; then
808
    EVENTSERVER="event-server"
809
fi
810
AC_DEFINE_UNQUOTED(EVENTSERVER, "$EVENTSERVER", [Emulab event server node])
811
AC_DEFINE_UNQUOTED(BS_IQN_PREFIX, "$BS_IQN_PREFIX", [IQN prefix for blockstores])
812

813 814 815 816 817
#
# Perl SelfLoader
# XXX this is a hack which enables us to disable it on versions of perl
# where there are problems with taint checking in the SelfLoader module.
#
818
AC_DEFINE_UNQUOTED(SELFLOADER_DATA, "$SELFLOADER_DATA", [Need perl SelfLoader hack])
819

820 821 822
#
# LEDA library path
#
823
AC_ARG_WITH(LEDA,
824
[  --with-LEDA		Specify LEDA path (/usr/testbed default)],
825 826 827 828 829 830 831
[
    if test "$withval" = "yes"; then
        LEDA="$ac_default_prefix/LEDA/LEDA-4.0"
    else
        LEDA="$withval"
    fi
],[
832 833 834 835 836
    if test -d "$ac_default_prefix/LEDA/LEDA-4.0"; then
        LEDA="$ac_default_prefix/LEDA/LEDA-4.0"
    else
        LEDA=""
    fi
837 838 839
])
AC_SUBST(LEDA)

840 841 842
#
# Override LEDA with assign binary.
#
843 844
AC_ARG_WITH(assignbinary,
[  --with-assignbinary	Specify assign binary (overrides LEDA, default on)],
845 846 847 848 849 850 851 852 853
[
    if test "$withval" = "yes"; then
        ASSIGN="assign.bin"
        LEDA=""
    else
        ASSIGN="$withval"
        LEDA=""
    fi
],[
854 855 856 857 858
    if test "$LEDA" = ""; then
        ASSIGN="assign.bin"
    else
        ASSIGN=""
    fi
859 860 861
])
AC_SUBST(ASSIGN)

Robert Ricci's avatar
Robert Ricci committed
862 863 864
#
# Arguments to ssh to disable strict host key checking, etc
#
865
AC_ARG_WITH(ssh-args,
Robert Ricci's avatar
Robert Ricci committed
866 867 868 869
[  --with-ssh-args	Specify ssh arguments when running from testbed scripts ],
[
    SSH_ARGS="$withval"
],[
870
    SSH_ARGS="-q -o BatchMode=yes -o StrictHostKeyChecking=no"
Robert Ricci's avatar
Robert Ricci committed
871 872 873
])
AC_SUBST(SSH_ARGS)

874 875 876 877 878 879 880 881 882 883 884 885
#
# 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)

886 887 888 889 890 891 892 893
#
# 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"
],[
Leigh Stoller's avatar
Leigh Stoller committed
894
    foo=`/usr/local/sbin/httpd -V | grep SERVER_CONFIG_FILE | grep 'apache2'`
895 896 897
    if test "$foo" = ""; then
        INSTALL_APACHE_CONFIG="/usr/local/etc/apache"
	APACHE_VERSION="1.3"
898
	APACHE_START_COMMAND="/usr/local/etc/rc.d/apache.sh"
899 900 901
    else
        INSTALL_APACHE_CONFIG="/usr/local/etc/apache22"
	APACHE_VERSION="22"
902
	APACHE_START_COMMAND="/usr/local/etc/rc.d/apache22"
903
    fi
904 905
])
AC_SUBST(INSTALL_APACHE_CONFIG)
906
AC_SUBST(APACHE_VERSION)
907
AC_SUBST(APACHE_START_COMMAND)
908

909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924
#
# Path to garcia installation
#
AC_ARG_WITH(brainstem,
[  --with-brainstem=<DIR> Specify the path to the brainstem installation.],
[
    if test x"$withval" != x""; then
	BRAINSTEM_DIR="$withval"
    else
	AC_MSG_ERROR([You must specify a brainstem directory]);
    fi
],[
    BRAINSTEM_DIR=""
])
AC_SUBST(BRAINSTEM_DIR)

925

926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944
#
# 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)

945
#
946
# Disable event system. Relies on Elvin. On by default.
947
#
948
AC_ARG_ENABLE(events,
949
[  --disable-events      Disable events (requires Elvin libraries)])
950

951 952 953 954
if test "$enable_events" = "no"; then
	eventfiles="";
        EVENTSYS=0;
else
955
	eventfiles="event/GNUmakefile clientside/lib/event/GNUmakefile \
956
		    event/etc/elvind-boss.conf event/etc/elvind-ops.conf \
957
		    event/etc/elvind-inetd.conf event/etc/GNUmakefile\
958
		    event/sched/GNUmakefile \
959
		    event/new_sched/GNUmakefile \
960
                    event/example/GNUmakefile event/example/tbsend.pl \
961
		    event/example/tbrecv.pl event/example/tbsend-short.pl \
962
                    event/example/tbsend.py event/example/tbrecv.py \
963
		    event/example/eventdebug.pl \
964
		    event/proxy/GNUmakefile \
965
		    event/monitoring/GNUmakefile \		    
966
		    event/nsetrafgen/GNUmakefile \
967
		    event/nsetrafgen/nseinput.tcl \
968
		    event/nsetrafgen/nse-makepatch \
969
		    event/stated/waitForState \
970
		    event/stated/GNUmakefile event/stated/stated"
971

972
	optional_subdirs="$optional_subdirs event";
973
        EVENTSYS=1;
974
fi
975
AC_SUBST(EVENTSYS)
976

977 978 979 980 981 982
#
# Quickie pelab support.
#
if test $PELABSUPPORT -eq 0; then
	pelabfiles="";
else
983 984 985
	pelabfiles="pelab/GNUmakefile pelab/db/GNUmakefile \
		    pelab/bgmon/GNUmakefile ";
	optional_subdirs="$optional_subdirs pelab";
986 987
fi

988 989 990 991
#
# Enable Windows support.
# Right now this means NTFS support in imagezip, maybe more things later.
# Relies on Linux NTFS library.
992
#
993
AC_ARG_ENABLE(windows,
994
[  --enable-windows      Enable Windows XP support (default)])
995

996 997
if test "$enable_windows" = "no"; then
	WINSUPPORT=0;
998 999 1000 1001 1002 1003
elif test "$enable_windows" = "yes"; then
	WINSUPPORT=1;
fi

if test $WINSUPPORT -eq 0; then
	winfiles="";
1004
else
1005 1006 1007
	if test $LINUX_FSNODE -ne 0; then
		AC_MSG_ERROR([You cannot define LINUX_FSNODE with windows support]);
	fi
1008 1009 1010 1011
	winfiles="clientside/os/imagezip/ntfs/GNUmakefile \
		  clientside/os/imagezip/ntfs/liblocale/GNUmakefile \
		  clientside/os/imagezip/ntfs/libntfs/GNUmakefile \
		  clientside/os/imagezip/fat/GNUmakefile"
1012
	optional_subdirs="$optional_subdirs";
1013
        AC_DEFINE_UNQUOTED(WINSUPPORT, 1, [Support Windows images])
1014
fi
1015

1016 1017 1018 1019 1020
#
# Check for ulsshxmlrpc header
#

AC_CHECK_HEADERS([ulxmlrpcpp/ulxr_config.h],
1021
		 [AC_DEFINE(HAVE_ULXMLRPCPP, [], [XXX])
1022 1023 1024
		  HAVE_ULXMLRPCPP="yes"])
AC_SUBST(HAVE_ULXMLRPCPP)

1025 1026 1027 1028 1029 1030 1031 1032
#
# Check for the robot vision system dependencies.
#
AC_CHECK_HEADERS([linux/videodev.h],
		 [AC_DEFINE(HAVE_LINUX_VIDEODEV_H)
		  HAVE_LINUX_VIDEODEV_H="yes"])
AC_CHECK_PROG(GTK_CONFIG, gtk-config, gtk-config)

1033 1034 1035
AC_ARG_ENABLE(mezzanine,
[  --enable-mezzanine    Enable mezzanine support])

1036
if test x"$HAVE_LINUX_VIDEODEV_H" != x"" && test x"$GTK_CONFIG" != x""; then
1037
    HAVE_MEZZANINE="$enable_mezzanine"
1038
    AC_DEFINE([HAVE_MEZZANINE], [], [Obsolete])
1039 1040 1041 1042 1043
else
    HAVE_MEZZANINE="no"
fi
AC_SUBST(HAVE_MEZZANINE)

1044
#
1045
# Check for a few things used by assign
1046
#
1047
AC_LANG_PUSH([C++])
1048 1049 1050 1051

#
# Check for Xerces (required for XML support in assign).
#
1052
AC_CHECK_HEADER([xercesc/dom/DOM.hpp],[HAVE_XERCES=yes])
1053 1054 1055 1056 1057 1058

#
# Check for newer versions of boost, which have moved some headers
#
AC_CHECK_HEADER([boost/property_map/property_map.hpp],[NEWER_BOOST=yes])

1059
AC_LANG_POP([C++])
1060
AC_SUBST(HAVE_XERCES)
1061
AC_SUBST(NEWER_BOOST)
1062

1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077
#
# Are we building with Clang?
# Taken from MesaLib configure via chromium.
#
AC_MSG_CHECKING([if compiling with clang])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[
#ifndef __clang__
       not clang
#endif
]])],
[USING_CLANG=yes], [USING_CLANG=no])
AC_MSG_RESULT([$USING_CLANG])
AC_SUBST(USING_CLANG)

1078 1079 1080 1081 1082 1083 1084 1085 1086 1087
#
# Testing mode.  In testing mode scripts should not effect hardware state.
# This is designed to be used with the testsuite software which operates
# on a test copy of the DB.
#
AC_ARG_ENABLE(testmode,
[  --enable-testmode     Enable test mode
  --disable-testmode    Disable test mode])

if test "$enable_testmode" = "yes"; then
1088
	TESTMODE=1
1089
else
1090
	TESTMODE=0
1091 1092 1093
fi
AC_SUBST(TESTMODE)

1094 1095 1096 1097 1098 1099 1100 1101 1102 1103
# 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]

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

1109 1110 1111 1112 1113 1114
# 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

1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128
#
# Get rid of old third-party distributions in the source tree since we now
# unpack them in the build tree. In the case of tg2.0, it actually breaks
# the build if the old tree exists.
#
echo -n "Checking for errant distributions in src dir ... ";
for baddir in trafgen/tg2.0 linktest/iperf/iperf-2.0.2 linktest/rude/rude-0.70; do
    if test -e "$srcdir/event/$baddir" -o -e "$srcdir/clientside/event/$baddir"; then
	rm -rf $srcdir/event/$baddir $srcdir/clientside/event/$baddir
	echo -n "$baddir "
    fi
done
echo "done"

1129 1130 1131
#
# Check for protogeni rspec.
#
1132
if test "$PROTOGENI_SUPPORT" = "1" -a $ELABINELAB = "0" -a -e "$srcdir/.git"; then
1133
   if test ! -e "$srcdir/protogeni/rspec-geni/.git"; then
1134
	AC_MSG_WARN([protogeni/rspec-geni submodule not initialized yet]);
1135 1136 1137 1138 1139 1140
	echo "Please cd into your source directory and run:"
	echo "    git submodule init"
	echo "    git submodule update"
	echo "Then rerun configure in your object tree"
	exit 1;
   fi
1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152
   module_status=`cd $srcdir; git submodule status protogeni/rspec-geni`
   if test $? -ne 0; then
       AC_MSG_WARN([Cannot get submodule status for protogeni/rspec-geni]);
       exit 1;
   fi
   if echo '$module_status' | grep -E '^\+'; then
	AC_MSG_WARN([protogeni/rspec-geni submodule is out of date]);
	echo "Please cd into your source directory and run:"
	echo "    git submodule update protogeni/rspec-geni"
	echo "Then rerun configure in your object tree"
	exit 1;
   fi
1153 1154
fi

1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167
#
# Set the Protogeni URL, which depends on the the port and name.
#
if test -z "$PROTOGENI_RPCNAME"; then
    PROTOGENI_RPCNAME=$WWW
fi

if test $PROTOGENI_RPCPORT -eq 443; then
    AC_MSG_ERROR([The ProtoGENI RPC port cannot be 443 (https)]);
else
    PROTOGENI_URL="https://$PROTOGENI_RPCNAME:$PROTOGENI_RPCPORT/protogeni/xmlrpc"
fi

1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182
#
# Determine the timezone (stupidity in PHP5, see apache/php.ini)
#
if test -e "$srcdir/utils/gettimezone.pl"; then
    echo -n "Checking to see what timezone we are ... ";
    ZONE=`$srcdir/utils/gettimezone.pl`
    if test $? -ne 0; then
        AC_MSG_WARN([Cannot find gettimezone script; defaulting to $OURTIMEZONE]);
    fi
    OURTIMEZONE=$ZONE
    echo "$OURTIMEZONE"
else
    AC_MSG_WARN([Cannot find gettimezone script; defaulting to $OURTIMEZONE]);
fi

1183 1184 1185 1186 1187 1188 1189 1190
#
# Merge build
#
MERGE_BUILD=0
MERGE_BUILD_SANDBOX=
if test -e "$srcdir/.merge-build"; then
   merge_sandbox=`grep source-tree "$srcdir/.merge-build" | cut -d' ' -f2`
   merge_tree=`grep merge-tree "$srcdir/.merge-build" | cut -d' ' -f2`
1191
   if test "$srcdir" -ef "$srcdir/$merge_sandbox/$merge_tree"; then
1192 1193 1194 1195 1196
      MERGE_BUILD=1
      MERGE_BUILD_SANDBOX=$srcdir/$merge_sandbox
      echo "#/bin/sh"   > sync
      echo              >> sync
      echo "cd \"$srcdir\"" >> sync
Kevin Atkinson's avatar
Kevin Atkinson committed
1197
      echo "utils/merge-build sync" >> sync
1198 1199 1200 1201 1202 1203 1204
      chmod +x sync
      echo "Merge-build enabled"
   fi
fi
AC_SUBST(MERGE_BUILD)
AC_SUBST(MERGE_BUILD_SANDBOX)

1205 1206
outfiles="$outfiles Makeconf GNUmakefile \
	assign/GNUmakefile \
1207
        named/GNUmakefile firewall/GNUmakefile fwrules/GNUmakefile \
1208
	ssl/GNUmakefile ssl/mksig ssl/usercert.cnf ssl/mkserial \
1209
	db/GNUmakefile \
1210 1211 1212 1213
	db/EmulabConstants.pm db/EmulabFeatures.pm db/Experiment.pm \
	db/Firewall.pm db/Group.pm db/Image.pm db/Interface.pm \
	db/Lan.pm db/Logfile.pm db/Node.pm db/NodeType.pm db/OSinfo.pm \
	db/Project.pm db/User.pm db/VirtExperiment.pm \
1214
	db/nalloc db/nfree db/if2port db/backup \
1215
	db/webcontrol db/node_status db/genelists db/genelists.proxy \
1216
	db/dumperrorlog.proxy \
1217
	db/setsitevar db/newwanode db/audit db/changeuid db/changepid \
1218
	db/libdb.pm db/libtbdb.pm db/inuse db/avail db/nodeip db/showgraph \
1219
	db/emdb.pm db/emdbi.pm db/emutil.pm \
1220
	db/dhcpd_makeconf db/nodelog db/unixgroups \
1221
	db/dbcheck db/interswitch db/dbboot db/schemacheck \
1222
	db/sitevarscheck db/dbfillcheck db/libadminctrl.pm \
1223 1224 1225 1226
	db/update_permissions \
	db/grabron db/stategraph db/readycount \
	db/idletimes db/idlemail db/xmlconvert \
	db/libdb.py db/elabinelab_bossinit \
1227
	ipod/GNUmakefile \
1228
	os/GNUmakefile os/split-image.sh \
1229
	pxe/GNUmakefile pxe/bootinfo.restart \
1230
	security/GNUmakefile security/lastlog_daemon \
Leigh Stoller's avatar
Leigh Stoller committed
1231
        sensors/GNUmakefile \
1232
	sensors/and/GNUmakefile sensors/and/and-emulab.conf \
Timothy Stack's avatar
Timothy Stack committed
1233
	sensors/powermon/GNUmakefile sensors/powermon/powermon \
1234
	sensors/nfstrace/GNUmakefile sensors/nfstrace/nfstrace.init \
1235
	sensors/nfstrace/nfsdump2/GNUmakefile \
1236
	account/GNUmakefile account/tbacct \
1237 1238
	account/addpubkey account/addsfskey account/genpubkeys \
	account/quotamail account/mkusercert account/newproj account/newuser \
1239
	backend/GNUmakefile backend/moduserinfo backend/newgroup \
1240 1241 1242
	backend/newmmlist backend/editexp backend/editimageid \
	backend/editnodetype backend/editsitevars backend/newimageid \
	backend/editgroup backend/newimageid_ez \
1243
	tbsetup/GNUmakefile tbsetup/console_setup tbsetup/spewlogfile \
1244
	tbsetup/snmpit_test/GNUmakefile  \
1245
	tbsetup/snmpit_old/GNUmakefile  \
1246
	tbsetup/spewrpmtar tbsetup/gentopofile tbsetup/power_sgmote.pm \
1247
	tbsetup/console_reset tbsetup/bwconfig tbsetup/power_rpc27.pm \
Mike Hibler's avatar
Mike Hibler committed
1248
	tbsetup/power_mail.pm tbsetup/power_whol.pm \
1249
	tbsetup/os_load tbsetup/os_setup tbsetup/os_select tbsetup/power \
1250
	tbsetup/node_reboot tbsetup/nscheck tbsetup/pxe_select \
1251
	tbsetup/resetvlans tbsetup/rmuser tbsetup/rmproj \
1252
	tbsetup/sched_reload tbsetup/sched_reserve tbsetup/reload_daemon \
1253
	tbsetup/batchexp tbsetup/batch_daemon tbsetup/repos_daemon \
1254
	tbsetup/wanlinkinfo tbsetup/wanassign \
1255
	tbsetup/swapexp	tbsetup/endexp tbsetup/elabinelab \
1256
	tbsetup/eventsys.proxy \
1257 1258
	tbsetup/snmpit.proxy \
	tbsetup/ns2ir/GNUmakefile \
1259
	tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
1260
	tbsetup/ns2ir/parse-ns tbsetup/ns2ir/parse.proxy \
Mike Hibler's avatar
Mike Hibler committed
1261
	tbsetup/ns2ir/sim.tcl tbsetup/nseswap tbsetup/nseparse/GNUmakefile \
1262
	tbsetup/nseparse/nse.parse.proxy tbsetup/nseparse/parse-nse \
1263 1264 1265 1266
	tbsetup/nseparse/nse.parse.tcl \
	tbsetup/nsverify/GNUmakefile tbsetup/nsverify/nstbparse \
	tbsetup/nsverify/verify-ns \
	tbsetup/db2ns \
Mike Hibler's avatar
Mike Hibler committed
1267
	tbsetup/tbprerun tbsetup/tbswap tbsetup/tbend tbsetup/tbrestart \
Leigh Stoller's avatar
Leigh Stoller committed
1268 1269
	tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
	tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
1270
	tbsetup/assign_wrapper2 \
1271
	tbsetup/node_update \
1272 1273 1274 1275 1276 1277
	tbsetup/savelogs tbsetup/setgroups \
	tbsetup/savelogs.proxy tbsetup/rmgroup tbsetup/mkexpdir \
	tbsetup/node_control tbsetup/node_attributes \
        tbsetup/mkgroup tbsetup/eventsys_start \
	tbsetup/eventsys_control \
	tbsetup/mkproj tbsetup/libtestbed.pm \
1278
	tbsetup/vnode_setup tbsetup/staticroutes \
1279
	tbsetup/console_setup.proxy tbsetup/exports_setup.proxy \
Mike Hibler's avatar
Mike Hibler committed
1280
	tbsetup/smbpasswd_setup.proxy \
1281
	tbsetup/checkports tbsetup/libaudit.pm \
1282
	tbsetup/libreboot.pm tbsetup/libosload.pm tbsetup/libadminmfs.pm \
1283
	tbsetup/sfskey_update tbsetup/sfskey_update.proxy \
1284 1285
	tbsetup/idleswap tbsetup/switchmac \
	tbsetup/newnode_reboot \
1286
        tbsetup/libtestbed.py \
1287
	tbsetup/libArchive.pm tbsetup/archive_control \
1288
	tbsetup/tarfiles_setup \
1289
	tbsetup/fetchtar.proxy tbsetup/webfrisbeekiller \
1290
	tbsetup/tcpp \
1291
	tbsetup/plab/GNUmakefile tbsetup/plab/libplab.py \
1292
        tbsetup/plab/mod_dslice.py tbsetup/plab/mod_PLC.py \
1293
        tbsetup/plab/mod_PLCNM.py \
Kirk Webb's avatar
Kirk Webb committed
1294
	tbsetup/plab/plabslice tbsetup/plab/plabnode tbsetup/plab/plabrenewd \
1295
        tbsetup/plab/plabrenewonce \
1296
	tbsetup/plab/plabmetrics tbsetup/plab/plabstats \
1297
	tbsetup/plab/plabmonitord tbsetup/plab/libplabmon.pm \
1298 1299
        tbsetup/plab/plabmon_badpool.pm tbsetup/plab/plabmon_goodpool.pm \
        tbsetup/plab/plablinkdata \
1300
	tbsetup/plab/libdslice/GNUmakefile tbsetup/plab/etc/GNUmakefile \
1301
	tbsetup/plab/plabdist tbsetup/plab/plabhttpd \
Kirk Webb's avatar
Kirk Webb committed
1302
	tbsetup/plab/plabdiscover tbsetup/plab/etc/netbed_files/GNUmakefile \