configure.in 5.17 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 8 9 10 11 12

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
13
AC_CHECK_TOOL(SSH,ssh)
14 15

#
16 17
# These get defined in the definitions file (--with-TBDEFS).
# 
18
AC_SUBST(TBDBNAME)
19 20 21
AC_SUBST(WWWDEFS)
AC_SUBST(TBOPSEMAIL)
AC_SUBST(TBLOGSEMAIL)
Leigh Stoller's avatar
Leigh Stoller committed
22 23
AC_SUBST(DELAYCAPACITY)
AC_SUBST(IPBASE)
24 25 26
AC_SUBST(BOSSNODE)
AC_SUBST(USERNODE)
AC_SUBST(OURDOMAIN)
27

28 29 30
#
# Okay, I know this is improper usage of --with. Too bad.
#
31 32
AC_ARG_WITH(TBDEFS,
[  --with-TBDEFS=name	Specify definitions file (defs-default default)],
33 34
[
    if test "$withval" = "yes"; then
35
	AC_MSG_ERROR(Invalid TBDEFS - Must specify the value)
36
    fi
37
    TBDEFS="$withval"
38
],[
39
    TBDEFS="$srcdir/defs-default"
40
])
41 42 43 44 45 46 47 48 49

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
50

51
#
52
# The email addresses need to be be munged for perl scripts.
53 54
#
TBOPSEMAIL="`echo $TBOPSEMAIL | sed -e 's/@/\\\@/'`"
55
TBLOGSEMAIL="`echo $TBLOGSEMAIL | sed -e 's/@/\\\@/'`"
56 57 58 59

#
# LEDA library path
#
60
AC_ARG_WITH(LEDA,
61
[  --with-LEDA		Specify LEDA path (/usr/testbed default)],
62 63 64 65 66 67 68 69 70 71 72
[
    if test "$withval" = "yes"; then
        LEDA="$ac_default_prefix/LEDA/LEDA-4.0"
    else
        LEDA="$withval"
    fi
],[
    LEDA="$ac_default_prefix/LEDA/LEDA-4.0"
])
AC_SUBST(LEDA)

Robert Ricci's avatar
Robert Ricci committed
73 74 75 76 77 78 79 80 81 82 83 84
#
# 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)

85 86 87 88 89 90 91 92 93 94 95 96
#
# 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)

97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
#
# 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)

116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
#
# 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)

132 133 134 135 136 137 138 139 140 141 142 143 144 145
# 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 \
	capture/GNUmakefile \
146
	db/GNUmakefile db/nalloc db/nfree db/if2port db/backup \
147 148
	db/webcontrol db/node_status db/genelists db/genelists.proxy \
	discvr/GNUmakefile \
149
	db/libdb.pm db/inuse db/avail db/nodeip db/showgraph \
150
	db/dhcpd_makeconf \
151
	ipod/GNUmakefile \
152
	lib/GNUmakefile \
153
	os/GNUmakefile os/split-image.sh os/imagezip/GNUmakefile \
154
	pxe/GNUmakefile pxe/proxydhcp.restart pxe/bootinfo.restart \
155 156
	security/GNUmakefile security/paperbag \
	tbsetup/GNUmakefile tbsetup/console_setup tbsetup/mkacct-ctrl \
157
	tbsetup/console_reset tbsetup/bwconfig tbsetup/power_rpc27.pm \
158
	tbsetup/os_load tbsetup/os_setup tbsetup/mkprojdir tbsetup/power \
159
	tbsetup/node_reboot tbsetup/webnscheck tbsetup/nscheck \
160
	tbsetup/resetvlans tbsetup/rmacct-ctrl tbsetup/rmproj \
161
	tbsetup/sched_reload tbsetup/sched_reserve tbsetup/reload_daemon \
162
	tbsetup/batchexp tbsetup/killbatchexp tbsetup/batch_daemon \
163
	tbsetup/webbatchexp tbsetup/webkillbatchexp tbsetup/webreport \
164
	tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \
Leigh Stoller's avatar
Leigh Stoller committed
165
	tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
166
	tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
167
	tbsetup/ns2ir/sim.tcl tbsetup/savevlans tbsetup/db2ns \
Leigh Stoller's avatar
Leigh Stoller committed
168 169 170
	tbsetup/tbprerun tbsetup/tbswapin tbsetup/tbswapout tbsetup/tbend \
	tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
	tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
171
	tbsetup/frisbeelauncher tbsetup/node_update tbsetup/webnodeupdate \
172
	tbsetup/savelogs \
173
	tip/GNUmakefile \
174
	tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/linux/GNUmakefile \
175
	tmcd/netbsd/GNUmakefile \
176
	tmcd/tmcd.restart \
177
	utils/GNUmakefile utils/vlandiff utils/vlansync utils/delay_config \
178
	utils/sshtb utils/create_image \
179
	www/GNUmakefile www/defs.php3 www/dbdefs.php3 \
180 181
	rc.d/GNUmakefile rc.d/2.mysql-server.sh rc.d/3.testbed.sh \
	rc.d/cvsupd.sh"
182 183 184 185 186 187 188 189

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

AC_OUTPUT($outfiles)