configure.in 8.77 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 29
AC_SUBST(TBACTIVEARCHIVE)
AC_SUBST(TBUSERSARCHIVE)
Leigh Stoller's avatar
Leigh Stoller committed
30 31
AC_SUBST(DELAYCAPACITY)
AC_SUBST(IPBASE)
32 33
AC_SUBST(BOSSNODE)
AC_SUBST(USERNODE)
34
AC_SUBST(FSNODE)
35
AC_SUBST(OURDOMAIN)
36 37 38
AC_SUBST(FSDIR_PROJ)
AC_SUBST(FSDIR_GROUPS)
AC_SUBST(FSDIR_USERS)
39

40 41 42 43 44
#
# Defaults for for above variables.
# 
TBADMINGROUP="flux"

45 46 47
#
# Okay, I know this is improper usage of --with. Too bad.
#
48 49
AC_ARG_WITH(TBDEFS,
[  --with-TBDEFS=name	Specify definitions file (defs-default default)],
50 51
[
    if test "$withval" = "yes"; then
52
	AC_MSG_ERROR(Invalid TBDEFS - Must specify the value)
53
    fi
54
    TBDEFS="$withval"
55
],[
56
    TBDEFS="$srcdir/defs-default"
57
])
58 59 60 61 62 63 64 65 66

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
67

68 69 70 71 72 73 74
#
# 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")
75
AC_DEFINE_UNQUOTED(TBADMINGROUP, "$TBADMINGROUP")
76 77 78 79 80 81 82 83 84
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")

85
#
86
# The email addresses need to be be munged for perl scripts.
87 88
#
TBOPSEMAIL="`echo $TBOPSEMAIL | sed -e 's/@/\\\@/'`"
89
TBLOGSEMAIL="`echo $TBLOGSEMAIL | sed -e 's/@/\\\@/'`"
90

91 92 93 94 95 96 97 98 99 100 101
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

102 103 104
#
# LEDA library path
#
105
AC_ARG_WITH(LEDA,
106
[  --with-LEDA		Specify LEDA path (/usr/testbed default)],
107 108 109 110 111 112 113
[
    if test "$withval" = "yes"; then
        LEDA="$ac_default_prefix/LEDA/LEDA-4.0"
    else
        LEDA="$withval"
    fi
],[
114 115 116 117 118
    if test -d "$ac_default_prefix/LEDA/LEDA-4.0"; then
        LEDA="$ac_default_prefix/LEDA/LEDA-4.0"
    else
        LEDA=""
    fi
119 120 121
])
AC_SUBST(LEDA)

122 123 124
#
# Override LEDA with assign binary.
#
125 126
AC_ARG_WITH(assignbinary,
[  --with-assignbinary	Specify assign binary (overrides LEDA, default on)],
127 128 129 130 131 132 133 134 135
[
    if test "$withval" = "yes"; then
        ASSIGN="assign.bin"
        LEDA=""
    else
        ASSIGN="$withval"
        LEDA=""
    fi
],[
136 137 138 139 140
    if test "$LEDA" = ""; then
        ASSIGN="assign.bin"
    else
        ASSIGN=""
    fi
141 142 143
])
AC_SUBST(ASSIGN)

Robert Ricci's avatar
Robert Ricci committed
144 145 146 147 148 149 150 151 152 153 154 155
#
# 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)

156 157 158 159 160 161 162 163 164 165 166 167
#
# 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)

168 169 170 171 172 173 174 175 176 177 178 179 180
#
# 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)


181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
#
# 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)

200
#
201
# Disable event system. Relies on Elvin. On by default.
202 203
# 
AC_ARG_ENABLE(events,
204
[  --disable-events       Disable events (requires Elvin libraries)])
205

206 207 208 209
if test "$enable_events" = "no"; then
	eventfiles="";
        EVENTSYS=0;
else
210 211
	eventfiles="event/GNUmakefile event/lib/GNUmakefile \
		    event/sched/GNUmakefile event/test/GNUmakefile \
212
                    event/tbgen/GNUmakefile event/tbgen/tevd.restart \
213
                    event/example/GNUmakefile event/example/tbsend.pl \
214
		    event/example/tbrecv.pl event/example/tbsend-short.pl \
215
		    event/trafgen/GNUmakefile \
216
                    event/delay-agent/GNUmakefile \
Robert Ricci's avatar
Robert Ricci committed
217
		    event/program-agent/GNUmakefile \
218
		    event/stated/GNUmakefile event/stated/stated";
219

220
	optional_subdirs="$optional_subdirs event";
221
        EVENTSYS=1;
222
fi
223
AC_SUBST(EVENTSYS)
224

225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
#
# 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)

241 242 243 244 245 246 247 248 249 250 251 252 253
# 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 \
254
	ssl/GNUmakefile \
255
	capture/GNUmakefile \
256
	db/GNUmakefile db/nalloc db/nfree db/if2port db/backup \
257 258
	db/webcontrol db/node_status db/genelists db/genelists.proxy \
	discvr/GNUmakefile \
259
	db/libdb.pm db/inuse db/avail db/nodeip db/showgraph \
260
	db/dhcpd_makeconf db/nodelog db/webnodelog db/unixgroups \
261
	db/dbcheck db/interswitch db/dbboot db/schemacheck \
262
	ipod/GNUmakefile \
263
	lib/GNUmakefile lib/libtb/GNUmakefile \
264
	os/GNUmakefile os/split-image.sh os/imagezip/GNUmakefile \
265
	os/frisbee.redux/GNUmakefile \
266
	pxe/GNUmakefile pxe/proxydhcp.restart pxe/bootinfo.restart \
267
	security/GNUmakefile security/paperbag security/lastlog_daemon \
268
	security/plasticwrap \
269
	tbsetup/GNUmakefile tbsetup/console_setup tbsetup/spewlogfile \
270
	tbsetup/console_reset tbsetup/bwconfig tbsetup/power_rpc27.pm \
271
	tbsetup/os_load tbsetup/os_setup tbsetup/power \
272
	tbsetup/node_reboot tbsetup/webnscheck tbsetup/nscheck \
273
	tbsetup/resetvlans tbsetup/rmacct-ctrl tbsetup/rmproj \
274
	tbsetup/sched_reload tbsetup/sched_reserve tbsetup/reload_daemon \
275 276
	tbsetup/batchexp tbsetup/batch_daemon \
	tbsetup/webbatchexp tbsetup/webreport \
277
	tbsetup/webswapexp tbsetup/swapexp \
278
	tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \
Leigh Stoller's avatar
Leigh Stoller committed
279
	tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
280
	tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
281
	tbsetup/ns2ir/parse-ns \
282
	tbsetup/ns2ir/sim.tcl tbsetup/db2ns \
Leigh Stoller's avatar
Leigh Stoller committed
283 284 285
	tbsetup/tbprerun tbsetup/tbswapin tbsetup/tbswapout tbsetup/tbend \
	tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
	tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
286
	tbsetup/frisbeelauncher tbsetup/node_update tbsetup/webnodeupdate \
287
	tbsetup/savelogs tbsetup/setgroups tbsetup/websetgroups \
Leigh Stoller's avatar
Leigh Stoller committed
288
	tbsetup/rmgroup tbsetup/webrmgroup tbsetup/mkexpdir \
289
	tbsetup/webnodecontrol tbsetup/node_control \
290
        tbsetup/webmkgroup tbsetup/mkgroup \
291
	tbsetup/webmkacct tbsetup/mkacct tbsetup/eventsys_control \
292
	tbsetup/webmkproj tbsetup/mkproj tbsetup/libtestbed.pm \
293
	tbsetup/portstats \
294
	tbsetup/console_setup.proxy tbsetup/exports_setup.proxy \
295
	tip/GNUmakefile \
296
	tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/linux/GNUmakefile \
297
	tmcd/ron/GNUmakefile \
298
	tmcd/netbsd/GNUmakefile \
299
	tmcd/tmcd.restart \
300
	utils/GNUmakefile utils/vlandiff utils/vlansync utils/delay_config \
301
	utils/sshtb utils/create_image utils/node_admin utils/webcreateimage \
302
	utils/sshremote \
303
	www/GNUmakefile www/defs.php3 www/dbdefs.php3 \
304 305
	vis/GNUmakefile vis/vistopology vis/webvistopology vis/top2gif \
	vis/top2png vis/render \
306
	rc.d/GNUmakefile rc.d/2.mysql-server.sh rc.d/3.testbed.sh \
307
	rc.d/cvsupd.sh rc.d/2.elvind.sh \
308
	$eventfiles \
309
	apache/GNUmakefile apache/apache.conf "
310 311 312 313 314 315 316 317

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

AC_OUTPUT($outfiles)