configure.in 3.79 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 13 14

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)

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

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

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
46

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

#
# LEDA library path
#
56
AC_ARG_WITH(LEDA,
57
[  --with-LEDA		Specify LEDA path (/usr/testbed default)],
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
[
    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)

#
# 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)

# 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 \
102
	db/GNUmakefile db/nalloc db/nfree db/if2port db/backup \
103
	db/webcontrol db/node_status db/genelists discvr/GNUmakefile \
Leigh Stoller's avatar
Leigh Stoller committed
104
	db/libdb.pm \
105
	ipod/GNUmakefile \
106
	lib/GNUmakefile \
107
	os/GNUmakefile os/split-image.sh os/imagezip/GNUmakefile \
108
	pxe/GNUmakefile pxe/proxydhcp.restart pxe/bootinfo.restart \
109 110 111
	security/GNUmakefile security/paperbag \
	tbsetup/GNUmakefile tbsetup/console_setup tbsetup/mkacct-ctrl \
	tbsetup/os_load tbsetup/os_setup tbsetup/mkprojdir tbsetup/power \
112
	tbsetup/node_reboot tbsetup/webnscheck tbsetup/nscheck \
113
	tbsetup/resetvlans tbsetup/rmacct-ctrl tbsetup/rmproj \
Leigh Stoller's avatar
Leigh Stoller committed
114
	tbsetup/sched_reload tbsetup/reload_daemon \
115 116
	tbsetup/batchexp tbsetup/killbatchexp tbsetup/batch_daemon \
	tbsetup/webbatchexp tbsetup/webkillbatchexp \
117
	tbsetup/startexp tbsetup/endexp tbsetup/webstartexp tbsetup/webendexp \
Leigh Stoller's avatar
Leigh Stoller committed
118
	tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
119
	tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
Leigh Stoller's avatar
Leigh Stoller committed
120 121 122 123
	tbsetup/ns2ir/sim.tcl tbsetup/savevlans \
	tbsetup/tbprerun tbsetup/tbswapin tbsetup/tbswapout tbsetup/tbend \
	tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
	tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
124
	tip/GNUmakefile \
125
	tmcd/GNUmakefile tmcd/freebsd/GNUmakefile tmcd/linux/GNUmakefile \
126
	tmcd/netbsd/GNUmakefile \
127
	tmcd/tmcd.restart \
128
	utils/GNUmakefile utils/vlandiff utils/vlansync utils/delay_config \
129 130 131 132 133 134 135 136 137
	www/GNUmakefile www/defs.php3 www/dbdefs.php3"

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

AC_OUTPUT($outfiles)