configure.in 10.8 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(WWWDEFS)
25
AC_SUBST(TBADMINGROUP)
26 27
AC_SUBST(TBOPSEMAIL)
AC_SUBST(TBLOGSEMAIL)
28
AC_SUBST(TBAUDITEMAIL)
29 30
AC_SUBST(TBSTATEDEMAIL)
AC_SUBST(TBTESTSUITEEMAIL)
31 32
AC_SUBST(TBACTIVEARCHIVE)
AC_SUBST(TBUSERSARCHIVE)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
33 34
AC_SUBST(DELAYCAPACITY)
AC_SUBST(IPBASE)
35 36
AC_SUBST(BOSSNODE)
AC_SUBST(USERNODE)
37
AC_SUBST(FSNODE)
38
AC_SUBST(OURDOMAIN)
39 40 41
AC_SUBST(FSDIR_PROJ)
AC_SUBST(FSDIR_GROUPS)
AC_SUBST(FSDIR_USERS)
42
AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH)
43
AC_SUBST(TIMESTAMPS)
44
AC_SUBST(UNIFIED_BOSS_AND_OPS)
45
AC_SUBST(DISABLE_NSE)
46
AC_SUBST(DISABLE_NAMED_SETUP)
47
AC_SUBST(DISABLE_EVENT_SCHED)
48 49 50
AC_SUBST(CLIENT_ETCDIR)
AC_SUBST(CLIENT_BINDIR)
AC_SUBST(CLIENT_VARDIR)
51
AC_SUBST(SNMP_RW_COMMUNITY)
52

53 54 55 56
#
# Defaults for for above variables.
# 
TBADMINGROUP="flux"
57 58 59
CLIENT_ETCDIR="/etc/emulab"
CLIENT_BINDIR="/usr/local/etc/emulab"
CLIENT_VARDIR="/var/emulab"
60

61 62 63
#
# Okay, I know this is improper usage of --with. Too bad.
#
64 65
AC_ARG_WITH(TBDEFS,
[  --with-TBDEFS=name	Specify definitions file (defs-default default)],
66 67
[
    if test "$withval" = "yes"; then
68
	AC_MSG_ERROR(Invalid TBDEFS - Must specify the value)
69
    fi
70
    TBDEFS="$withval"
71
],[
72
    TBDEFS="$srcdir/defs-default"
73
])
74 75 76 77 78 79 80 81 82

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
83

84 85 86 87 88 89 90
#
# 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")
91
AC_DEFINE_UNQUOTED(TBADMINGROUP, "$TBADMINGROUP")
92 93 94 95 96 97 98 99
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")
100 101 102
if test -n "$FSDIR_SHARE"; then
    AC_DEFINE_UNQUOTED(FSDIR_SHARE, "$FSDIR_SHARE")
fi
103

104
#
105
# The email addresses need to be be munged for perl scripts.
106 107
#
TBOPSEMAIL="`echo $TBOPSEMAIL | sed -e 's/@/\\\@/'`"
108
TBLOGSEMAIL="`echo $TBLOGSEMAIL | sed -e 's/@/\\\@/'`"
109
TBAUDITEMAIL="`echo $TBAUDITEMAIL | sed -e 's/@/\\\@/'`"
110

111 112 113 114 115 116 117 118 119 120 121
if test -n "$TBACTIVEARCHIVE"; then
    TBACTIVEARCHIVE="`echo $TBACTIVEARCHIVE | sed -e 's/@/\\\@/'`"
else
    TBACTIVEARCHIVE="$TBOPSEMAIL"
fi
if test -n "$TBUSERSARCHIVE"; then
    TBUSERSARCHIVE="`echo $TBUSERSARCHIVE | sed -e 's/@/\\\@/'`"
else
    TBUSERSARCHIVE="$TBOPSEMAIL"
fi

122 123 124
#
# LEDA library path
#
125
AC_ARG_WITH(LEDA,
126
[  --with-LEDA		Specify LEDA path (/usr/testbed default)],
127 128 129 130 131 132 133
[
    if test "$withval" = "yes"; then
        LEDA="$ac_default_prefix/LEDA/LEDA-4.0"
    else
        LEDA="$withval"
    fi
],[
134 135 136 137 138
    if test -d "$ac_default_prefix/LEDA/LEDA-4.0"; then
        LEDA="$ac_default_prefix/LEDA/LEDA-4.0"
    else
        LEDA=""
    fi
139 140 141
])
AC_SUBST(LEDA)

142 143 144
#
# Override LEDA with assign binary.
#
145 146
AC_ARG_WITH(assignbinary,
[  --with-assignbinary	Specify assign binary (overrides LEDA, default on)],
147 148 149 150 151 152 153 154 155
[
    if test "$withval" = "yes"; then
        ASSIGN="assign.bin"
        LEDA=""
    else
        ASSIGN="$withval"
        LEDA=""
    fi
],[
156 157 158 159 160
    if test "$LEDA" = ""; then
        ASSIGN="assign.bin"
    else
        ASSIGN=""
    fi
161 162 163
])
AC_SUBST(ASSIGN)

Robert Ricci's avatar
Robert Ricci committed
164 165 166 167 168 169 170 171 172
#
# 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\""
173
    SSH_ARGS="$SSH_ARGS -o \"Protocol 1\""
Robert Ricci's avatar
Robert Ricci committed
174 175 176
])
AC_SUBST(SSH_ARGS)

177 178 179 180 181 182 183 184 185 186 187 188
#
# 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)

189 190 191 192 193 194 195 196 197 198 199 200 201
#
# 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)


202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
#
# 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)

221
#
222
# Disable event system. Relies on Elvin. On by default.
223 224
# 
AC_ARG_ENABLE(events,
225
[  --disable-events      Disable events (requires Elvin libraries)])
226

227 228 229 230
if test "$enable_events" = "no"; then
	eventfiles="";
        EVENTSYS=0;
else
231 232
	eventfiles="event/GNUmakefile event/lib/GNUmakefile \
		    event/sched/GNUmakefile event/test/GNUmakefile \
233
                    event/tbgen/GNUmakefile event/tbgen/tevd.restart \
234
                    event/example/GNUmakefile event/example/tbsend.pl \
235
		    event/example/tbrecv.pl event/example/tbsend-short.pl \
236
		    event/trafgen/GNUmakefile \
237
		    event/nsetrafgen/GNUmakefile \
238
                    event/delay-agent/GNUmakefile \
Robert Ricci's avatar
Robert Ricci committed
239
		    event/program-agent/GNUmakefile \
240
		    event/stated/GNUmakefile event/stated/stated";
241

242
	optional_subdirs="$optional_subdirs event";
243
        EVENTSYS=1;
244
fi
245
AC_SUBST(EVENTSYS)
246

247 248 249 250 251 252 253
#
# 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,
254
[  --enable-windows      Enable Windows XP support (requires third-party software)])
255 256 257 258 259 260 261 262 263 264 265

if test "$enable_windows" = "yes"; then
	winfiles="os/imagezip/ntfs/GNUmakefile";
	optional_subdirs="$optional_subdirs";
        WINSUPPORT=1;
else
	winfiles="";
        WINSUPPORT=0;
fi
AC_SUBST(WINSUPPORT)

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

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

296 297 298 299 300 301 302 303 304 305 306 307 308
# 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 \
309
	ssl/GNUmakefile \
310
	capture/GNUmakefile \
311
	db/GNUmakefile db/nalloc db/nfree db/if2port db/backup \
312
	db/webcontrol db/node_status db/genelists db/genelists.proxy \
313
	db/libdb.pm db/inuse db/avail db/nodeip db/showgraph \
314
	db/dhcpd_makeconf db/nodelog db/webnodelog db/unixgroups \
315
	db/dbcheck db/interswitch db/dbboot db/schemacheck \
Robert Ricci's avatar
Robert Ricci committed
316
	db/grabron db/idlecheck db/webnfree db/stategraph db/readycount \
317
	discvr/GNUmakefile \
Mike Hibler's avatar
Mike Hibler committed
318
	ipod/GNUmakefile \
319
	lib/GNUmakefile lib/libtb/GNUmakefile \
320
	os/GNUmakefile os/split-image.sh os/imagezip/GNUmakefile \
Mike Hibler's avatar
Mike Hibler committed
321
	os/frisbee.redux/GNUmakefile os/growdisk/GNUmakefile \
322
	pxe/GNUmakefile pxe/proxydhcp.restart pxe/bootinfo.restart \
323
	security/GNUmakefile security/paperbag security/lastlog_daemon \
324
	security/plasticwrap \
325
        sensors/GNUmakefile sensors/slothd/GNUmakefile \
326
	sensors/slothd/sdisrunning sensors/slothd/sddeploy \
327
	tbsetup/GNUmakefile tbsetup/console_setup tbsetup/spewlogfile \
328
	tbsetup/console_reset tbsetup/bwconfig tbsetup/power_rpc27.pm \
329
	tbsetup/os_load tbsetup/os_setup tbsetup/os_select tbsetup/power \
330
	tbsetup/node_reboot tbsetup/webnscheck tbsetup/nscheck \
331
	tbsetup/resetvlans tbsetup/rmacct-ctrl tbsetup/rmproj \
332
	tbsetup/sched_reload tbsetup/sched_reserve tbsetup/reload_daemon \
333
	tbsetup/batchexp tbsetup/batch_daemon \
Mac Newbold's avatar
Mac Newbold committed
334
	tbsetup/webdelay_config tbsetup/tbresize \
335
	tbsetup/webbatchexp tbsetup/webreport \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
336
	tbsetup/wanlinkinfo tbsetup/wanassign \
337
	tbsetup/webswapexp tbsetup/swapexp \
338
	tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
339
	tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
340
	tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
341
	tbsetup/ns2ir/parse-ns \
342
	tbsetup/ns2ir/sim.tcl tbsetup/db2ns \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
343 344 345
	tbsetup/tbprerun tbsetup/tbswapin tbsetup/tbswapout tbsetup/tbend \
	tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
	tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
346
	tbsetup/frisbeelauncher tbsetup/node_update tbsetup/webnodeupdate \
347
	tbsetup/savelogs tbsetup/setgroups tbsetup/websetgroups \
Leigh B. Stoller's avatar
Leigh B. Stoller committed
348
	tbsetup/rmgroup tbsetup/webrmgroup tbsetup/mkexpdir \
349
	tbsetup/webnodecontrol tbsetup/node_control \
350
        tbsetup/webmkgroup tbsetup/mkgroup tbsetup/eventsys_start \
351
	tbsetup/webmkacct tbsetup/mkacct tbsetup/eventsys_control \
352
	tbsetup/webmkproj tbsetup/mkproj tbsetup/libtestbed.pm \
353
	tbsetup/portstats tbsetup/vnode_setup tbsetup/staticroutes \
354
	tbsetup/console_setup.proxy tbsetup/exports_setup.proxy \
355
	tbsetup/checkports tbsetup/webidlecheck tbsetup/webnodereboot \
356
	tbsetup/sfskey_update tbsetup/sfskey_update.proxy \
357
	tip/GNUmakefile \
358
	tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/linux/GNUmakefile \
359
	tmcd/ron/GNUmakefile tmcd/common/GNUmakefile \
360
	tmcd/tmcd.restart \
361
	utils/GNUmakefile utils/vlandiff utils/vlansync utils/delay_config \
362
	utils/sshtb utils/create_image utils/node_admin utils/webcreateimage \
363 364
	utils/firstuser utils/export_tables \
	utils/addpubkey utils/webaddpubkey utils/cvsupd.pl \
365
	www/GNUmakefile www/defs.php3 www/dbdefs.php3 \
366
	vis/GNUmakefile vis/vistopology vis/webvistopology vis/top2gif \
Chad Barb's avatar
 
Chad Barb committed
367
	vis/dbvistopology vis/dbtopper \
368
	vis/top2png vis/render \
369
	rc.d/GNUmakefile rc.d/2.mysql-server.sh rc.d/3.testbed.sh \
370
	rc.d/2.elvind.sh \
371
	tools/GNUmakefile \
372
	tools/pcapper/GNUmakefile \
373
	$eventfiles \
374
	$winfiles \
375
	apache/GNUmakefile apache/apache.conf "
376 377 378 379 380 381 382 383

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

AC_OUTPUT($outfiles)