configure.in 13.3 KB
Newer Older
1 2 3 4 5

AC_PREREQ(2.13)

AC_INIT(Makeconf.in)
AC_CONFIG_AUX_DIR(${srcdir}/autoconf)
6
AC_PREFIX_DEFAULT(/usr/testbed)
7
AC_CONFIG_HEADER(config.h)
8 9 10 11 12 13

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)
Robert Ricci's avatar
Robert Ricci committed
14
AC_CHECK_TOOL(SSH,ssh)
15

16 17
AC_SUBST(optional_subdirs)

18
#
19
# These get defined in the definitions file (--with-TBDEFS).
20 21
# NB: See AC_DEFINE_UNQUOTED() calls below, if you want a variable
# to appear in config.h.
22
# 
23
AC_SUBST(TBDBNAME)
24
AC_SUBST(TBADMINGROUP)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
25 26
AC_SUBST(DELAYCAPACITY)
AC_SUBST(IPBASE)
27 28
AC_SUBST(BOSSNODE)
AC_SUBST(USERNODE)
29
AC_SUBST(FSNODE)
30
AC_SUBST(OURDOMAIN)
31 32 33
AC_SUBST(FSDIR_PROJ)
AC_SUBST(FSDIR_GROUPS)
AC_SUBST(FSDIR_USERS)
34
AC_SUBST(FS_WITH_QUOTAS)
35
AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH)
36
AC_SUBST(TIMESTAMPS)
37
AC_SUBST(UNIFIED_BOSS_AND_OPS)
38
AC_SUBST(DISABLE_NSE)
39
AC_SUBST(DISABLE_NAMED_SETUP)
40
AC_SUBST(DISABLE_EVENT_SCHED)
41 42 43
AC_SUBST(CLIENT_ETCDIR)
AC_SUBST(CLIENT_BINDIR)
AC_SUBST(CLIENT_VARDIR)
44
AC_SUBST(SNMP_RW_COMMUNITY)
45 46 47 48 49 50 51 52 53 54 55
AC_SUBST(WWWHOST)
AC_SUBST(WWW)
AC_SUBST(TBBASE)
AC_SUBST(TBDOCBASE)
AC_SUBST(TBWWW)
AC_SUBST(THISHOMEBASE)
AC_SUBST(TBSECURECOOKIES)
AC_SUBST(TBCOOKIESUFFIX)
AC_SUBST(TBAUTHDOMAIN)
AC_SUBST(TBAUTHTIMEOUT)
AC_SUBST(TBMAINSITE)
56

57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
#
# 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(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)
75 76
AC_SUBST(TBAUTOMAILEMAIL)
AC_SUBST(TBAUTOMAILEMAIL_NOSLASH)
77 78 79 80 81
AC_SUBST(TBACTIVEARCHIVE)
AC_SUBST(TBACTIVEARCHIVE_NOSLASH)
AC_SUBST(TBUSERSARCHIVE)
AC_SUBST(TBUSERSARCHIVE_NOSLASH)

82 83 84 85
#
# Defaults for for above variables.
# 
TBADMINGROUP="flux"
86 87 88
CLIENT_ETCDIR="/etc/emulab"
CLIENT_BINDIR="/usr/local/etc/emulab"
CLIENT_VARDIR="/var/emulab"
89 90
TBSECURECOOKIES=1
TBMAINSITE=0
91

92 93 94
#
# Okay, I know this is improper usage of --with. Too bad.
#
95 96
AC_ARG_WITH(TBDEFS,
[  --with-TBDEFS=name	Specify definitions file (defs-default default)],
97 98
[
    if test "$withval" = "yes"; then
99
	AC_MSG_ERROR(Invalid TBDEFS - Must specify the value)
100
    fi
101
    TBDEFS="$withval"
102
],[
103
    TBDEFS="$srcdir/defs-default"
104
])
105 106 107 108 109 110 111 112 113

if test -f $TBDEFS; then
    #
    # Remove the comments and newlines.  Really, that's what it does.
    #
    eval `cat $TBDEFS | sed -n -e '{s/#.*$//;H;}; ${g;s/\n/ /g;s/  */ /g;p;}'`
else
	AC_MSG_ERROR([Definitions file $TBDEFS was not found.])
fi
114

115 116 117 118 119 120 121
#
# 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!
#
AC_DEFINE_UNQUOTED(TBDBNAME, "$TBDBNAME")
122
AC_DEFINE_UNQUOTED(TBADMINGROUP, "$TBADMINGROUP")
123 124 125 126 127 128 129 130
AC_DEFINE_UNQUOTED(IPBASE, "$IPBASE")
AC_DEFINE_UNQUOTED(BOSSNODE, "$BOSSNODE")
AC_DEFINE_UNQUOTED(USERNODE, "$USERNODE")
AC_DEFINE_UNQUOTED(FSNODE, "$FSNODE")
AC_DEFINE_UNQUOTED(OURDOMAIN, "$OURDOMAIN")
AC_DEFINE_UNQUOTED(FSDIR_PROJ, "$FSDIR_PROJ")
AC_DEFINE_UNQUOTED(FSDIR_GROUPS, "$FSDIR_GROUPS")
AC_DEFINE_UNQUOTED(FSDIR_USERS, "$FSDIR_USERS")
131 132 133
if test -n "$FSDIR_SHARE"; then
    AC_DEFINE_UNQUOTED(FSDIR_SHARE, "$FSDIR_SHARE")
fi
134

135
#
136 137
# The email addresses need to be be munged for perl scripts. But,
# php needs them un-escaped
138
#
139
TBOPSEMAIL_NOSLASH="$TBOPSEMAIL"
140
TBOPSEMAIL="`echo $TBOPSEMAIL | sed -e 's/@/\\\@/'`"
141
TBLOGSEMAIL_NOSLASH="$TBLOGSEMAIL"
142
TBLOGSEMAIL="`echo $TBLOGSEMAIL | sed -e 's/@/\\\@/'`"
143
TBAUDITEMAIL_NOSLASH="$TBAUDITEMAIL"
144
TBAUDITEMAIL="`echo $TBAUDITEMAIL | sed -e 's/@/\\\@/'`"
145 146 147 148
TBWWWEMAIL_NOSLASH="$TBWWWEMAIL"
TBWWWEMAIL="`echo $TBWWWEMAIL | sed -e 's/@/\\\@/'`"
TBAPPROVALEMAIL_NOSLASH="$TBAPPROVALEMAIL"
TBAPPROVALEMAIL="`echo $TBAPPROVALEMAIL | sed -e 's/@/\\\@/'`"
149 150 151 152
TBSTATEDEMAIL_NOSLASH="$TBSTATEDEMAIL_NOSLASH"
TBSTATEDEMAIL="`echo $TBSTATEDEMAIL | sed -e 's/@/\\\@/'`"
TBTESTSUITEEMAIL_NOSLASH="$TBTESTSUITEEMAIL_NOSLASH"
TBTESTSUITEEMAIL="`echo $TBTESTSUITEEMAIL | sed -e 's/@/\\\@/'`"
153

154
if test -n "$TBAUTOMAILEMAIL"; then
155
    TBAUTOMAILEMAIL_NOSLASH="$TBAUTOMAILEMAIL"
156 157 158 159 160
    TBAUTOMAILEMAIL="`echo $TBAUTOMAILEMAIL | sed -e 's/@/\\\@/'`"
else
    TBAUTOMAILEMAIL_NOSLASH="$TBLOGSEMAIL_NOSLASH"
    TBAUTOMAILEMAIL="$TBLOGSEMAIL"
fi
161
if test -n "$TBACTIVEARCHIVE"; then
162
    TBACTIVEARCHIVE_NOSLASH="$TBACTIVEARCHIVE"
163 164
    TBACTIVEARCHIVE="`echo $TBACTIVEARCHIVE | sed -e 's/@/\\\@/'`"
else
165
    TBACTIVEARCHIVE_NOSLASH="$TBOPSEMAIL_NOSLASH"
166 167 168
    TBACTIVEARCHIVE="$TBOPSEMAIL"
fi
if test -n "$TBUSERSARCHIVE"; then
169
    TBUSERSARCHIVE_NOSLASH="$TBUSERSARCHIVE"
170 171
    TBUSERSARCHIVE="`echo $TBUSERSARCHIVE | sed -e 's/@/\\\@/'`"
else
172
    TBUSERSARCHIVE_NOSLASH="$TBOPSEMAIL_NOSLASH"
173 174 175
    TBUSERSARCHIVE="$TBOPSEMAIL"
fi

176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
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
if test -z "$THISHOMEBASE"; then
    THISHOMEBASE="Emulab.Net"
fi

198 199 200
#
# LEDA library path
#
201
AC_ARG_WITH(LEDA,
202
[  --with-LEDA		Specify LEDA path (/usr/testbed default)],
203 204 205 206 207 208 209
[
    if test "$withval" = "yes"; then
        LEDA="$ac_default_prefix/LEDA/LEDA-4.0"
    else
        LEDA="$withval"
    fi
],[
210 211 212 213 214
    if test -d "$ac_default_prefix/LEDA/LEDA-4.0"; then
        LEDA="$ac_default_prefix/LEDA/LEDA-4.0"
    else
        LEDA=""
    fi
215 216 217
])
AC_SUBST(LEDA)

218 219 220
#
# Override LEDA with assign binary.
#
221 222
AC_ARG_WITH(assignbinary,
[  --with-assignbinary	Specify assign binary (overrides LEDA, default on)],
223 224 225 226 227 228 229 230 231
[
    if test "$withval" = "yes"; then
        ASSIGN="assign.bin"
        LEDA=""
    else
        ASSIGN="$withval"
        LEDA=""
    fi
],[
232 233 234 235 236
    if test "$LEDA" = ""; then
        ASSIGN="assign.bin"
    else
        ASSIGN=""
    fi
237 238 239
])
AC_SUBST(ASSIGN)

Robert Ricci's avatar
Robert Ricci committed
240 241 242 243 244 245 246 247 248
#
# 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\""
249
    SSH_ARGS="$SSH_ARGS -o \"Protocol 1\""
Robert Ricci's avatar
Robert Ricci committed
250 251 252
])
AC_SUBST(SSH_ARGS)

253 254 255 256 257 258 259 260 261 262 263 264
#
# 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)

265 266 267 268 269 270 271 272 273 274 275 276 277
#
# 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)


278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
#
# 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)

297
#
298
# Disable event system. Relies on Elvin. On by default.
299 300
# 
AC_ARG_ENABLE(events,
301
[  --disable-events      Disable events (requires Elvin libraries)])
302

303 304 305 306
if test "$enable_events" = "no"; then
	eventfiles="";
        EVENTSYS=0;
else
307 308
	eventfiles="event/GNUmakefile event/lib/GNUmakefile \
		    event/sched/GNUmakefile event/test/GNUmakefile \
309
                    event/tbgen/GNUmakefile event/tbgen/tevd.restart \
310
                    event/example/GNUmakefile event/example/tbsend.pl \
311
		    event/example/tbrecv.pl event/example/tbsend-short.pl \
312
		    event/trafgen/GNUmakefile \
313
		    event/nsetrafgen/GNUmakefile \
314
                    event/delay-agent/GNUmakefile \
Robert Ricci's avatar
Robert Ricci committed
315
		    event/program-agent/GNUmakefile \
316
		    event/stated/GNUmakefile event/stated/stated";
317

318
	optional_subdirs="$optional_subdirs event";
319
        EVENTSYS=1;
320
fi
321
AC_SUBST(EVENTSYS)
322

323 324 325 326 327 328 329
#
# Enable Windows support.
# Right now this means NTFS support in imagezip, maybe more things later.
# Relies on Linux NTFS library.
# Off by default.
# 
AC_ARG_ENABLE(windows,
330
[  --enable-windows      Enable Windows XP support (requires third-party software)])
331 332

if test "$enable_windows" = "yes"; then
333 334 335
	winfiles="os/imagezip/ntfs/GNUmakefile \
                  os/imagezip/ntfs/liblocale/GNUmakefile \
                  os/imagezip/ntfs/libntfs/GNUmakefile"
336 337 338 339 340 341 342 343
	optional_subdirs="$optional_subdirs";
        WINSUPPORT=1;
else
	winfiles="";
        WINSUPPORT=0;
fi
AC_SUBST(WINSUPPORT)

344 345 346 347 348 349 350 351 352 353 354 355 356 357
#
# Disable SFS support if SFS is not installed on ops node.
# 
AC_ARG_ENABLE(sfs,
[  --disable-sfs         Disable SFS support (SFS must be installed on ops)])

if test "$enable_sfs" = "no"; then
        SFSSUPPORT=0;
else
        SFSSUPPORT=1;
	AC_DEFINE(SFSSUPPORT)
fi
AC_SUBST(SFSSUPPORT)

358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
#
# 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
	TESTMODE=1;
else
	TESTMODE=0;
fi
AC_SUBST(TESTMODE)

374 375 376 377 378 379 380 381 382 383 384 385 386
# 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]


outfiles="$outfiles Makeconf GNUmakefile \
	assign/GNUmakefile \
387
	ssl/GNUmakefile \
388
	capture/GNUmakefile \
389
	db/GNUmakefile db/nalloc db/nfree db/if2port db/backup \
390
	db/webcontrol db/node_status db/genelists db/genelists.proxy \
Robert Ricci's avatar
Robert Ricci committed
391
	db/setsitevar db/newwanode \
392
	db/libdb.pm db/inuse db/avail db/nodeip db/showgraph \
393
	db/dhcpd_makeconf db/nodelog db/webnodelog db/unixgroups \
394
	db/dbcheck db/interswitch db/dbboot db/schemacheck \
395 396
	db/grabron db/webnfree db/stategraph db/readycount \
	db/idletimes db/idlemail db/webidlemail \
397
	discvr/GNUmakefile \
Mike Hibler's avatar
Mike Hibler committed
398
	ipod/GNUmakefile \
399
	lib/GNUmakefile lib/libtb/GNUmakefile \
400
	os/GNUmakefile os/split-image.sh os/imagezip/GNUmakefile \
Mike Hibler's avatar
Mike Hibler committed
401
	os/frisbee.redux/GNUmakefile os/growdisk/GNUmakefile \
402
	pxe/GNUmakefile pxe/proxydhcp.restart pxe/bootinfo.restart \
403
	security/GNUmakefile security/paperbag security/lastlog_daemon \
404
	security/plasticwrap \
405
        sensors/GNUmakefile sensors/slothd/GNUmakefile \
406
	sensors/slothd/sdisrunning sensors/slothd/sddeploy \
407 408 409
	account/GNUmakefile account/tbacct account/webtbacct \
	account/addpubkey account/webaddpubkey \
	account/addsfskey account/webaddsfskey \
410
	account/quotamail \
411
	tbsetup/GNUmakefile tbsetup/console_setup tbsetup/spewlogfile \
412
	tbsetup/console_reset tbsetup/bwconfig tbsetup/power_rpc27.pm \
413
	tbsetup/os_load tbsetup/os_setup tbsetup/os_select tbsetup/power \
414
	tbsetup/node_reboot tbsetup/webnscheck tbsetup/nscheck \
415
	tbsetup/resetvlans tbsetup/rmuser tbsetup/rmproj \
416
	tbsetup/sched_reload tbsetup/sched_reserve tbsetup/reload_daemon \
417
	tbsetup/batchexp tbsetup/batch_daemon \
Mac Newbold's avatar
Mac Newbold committed
418
	tbsetup/webdelay_config tbsetup/tbresize \
419
	tbsetup/webbatchexp tbsetup/webreport \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
420
	tbsetup/wanlinkinfo tbsetup/wanassign \
421
	tbsetup/webswapexp tbsetup/swapexp \
422
	tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
423
	tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
424
	tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
425
	tbsetup/ns2ir/parse-ns \
426
	tbsetup/ns2ir/sim.tcl tbsetup/db2ns \
427
	tbsetup/tbprerun tbsetup/tbswap tbsetup/tbend \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
428 429
	tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
	tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
430
	tbsetup/frisbeelauncher tbsetup/node_update tbsetup/webnodeupdate \
431
	tbsetup/savelogs tbsetup/setgroups tbsetup/websetgroups \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
432
	tbsetup/rmgroup tbsetup/webrmgroup tbsetup/mkexpdir \
433
	tbsetup/webnodecontrol tbsetup/node_control \
434
        tbsetup/webmkgroup tbsetup/mkgroup tbsetup/eventsys_start \
435
	tbsetup/eventsys_control \
436
	tbsetup/webmkproj tbsetup/mkproj tbsetup/libtestbed.pm \
437
	tbsetup/portstats tbsetup/vnode_setup tbsetup/staticroutes \
438
	tbsetup/console_setup.proxy tbsetup/exports_setup.proxy \
439
	tbsetup/checkports tbsetup/webnodereboot tbsetup/libaudit.pm \
440
	tbsetup/sfskey_update tbsetup/sfskey_update.proxy \
441
	tbsetup/idleswap tbsetup/webidleswap \
442
	tip/GNUmakefile \
443 444
	tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/openbsd/GNUmakefile \
	tmcd/linux/GNUmakefile tmcd/ron/GNUmakefile tmcd/common/GNUmakefile \
445
	tmcd/tmcd.restart \
446
	utils/GNUmakefile utils/vlandiff utils/vlansync utils/delay_config \
447
	utils/sshtb utils/create_image utils/node_admin utils/webcreateimage \
448
	utils/firstuser utils/export_tables utils/eventping \
449
	utils/cvsupd.pl \
450
	www/GNUmakefile www/defs.php3 www/dbdefs.php3 \
451 452 453
	vis/GNUmakefile vis/webvistopology \
	vis/dbvistopology \
	vis/prerender vis/prerender_all vis/render \
454
	rc.d/GNUmakefile rc.d/2.mysql-server.sh rc.d/3.testbed.sh \
455
	rc.d/2.elvind.sh \
456
	tools/GNUmakefile \
457
	tools/pcapper/GNUmakefile \
458
	$eventfiles \
459
	$winfiles \
460
	apache/GNUmakefile apache/httpd.conf \
461
	install/ops-install install/boss-install "
462 463 464 465 466 467 468 469

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

AC_OUTPUT($outfiles)