configure.in 2.09 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 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

AC_PREREQ(2.13)

AC_INIT(Makeconf.in)
AC_CONFIG_AUX_DIR(${srcdir}/autoconf)

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)

#
# overide with --prefix.
# 
ac_default_prefix=/usr/testbed

#
# Okay, I know this is improper usage of --with. Too bad.
#
AC_ARG_WITH(TBDBNAME,
[  --with-TBDBNAME=name		Specify TBDB name (tbdb default)],
[
    if test "$withval" = "yes"; then
	AC_MSG_ERROR(Invalid TBDBNAME - Must specify the value)
    fi
    TBDBNAME="$withval"
],[
    TBDBNAME="tbdb"
])
AC_SUBST(TBDBNAME)

AC_ARG_WITH(LEDA,
[  --with-LEDA			Specify LEDA path (/usr/testbed default)],
[
    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 \
	db/GNUmakefile \
	discvr/GNUmakefile \
	lib/GNUmakefile \
	os/GNUmakefile os/imagezip/GNUmakefile \
	pxe/GNUmakefile pxe/proxydhcp.restart pxe/bootinfo.restart \
	security/GNUmakefile \
	tbsetup/GNUmakefile tbsetup/ir/GNUmakefile tbsetup/ns2ir/GNUmakefile \
	tbsetup/checkpass/GNUmakefile \
	tip/GNUmakefile \
	tmcd/GNUmakefile tmcd/tmcd.restart \
	www/GNUmakefile"
AC_OUTPUT($outfiles)