initial cleanup passing over all makefiles and configure.ac
This commit is contained in:
parent
ac705f4908
commit
6210e70c80
28 changed files with 328 additions and 641 deletions
308
configure.ac
308
configure.ac
|
@ -9,82 +9,37 @@
|
|||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
#
|
||||
# this defines the CORE version number, must be static for AC_INIT
|
||||
#
|
||||
AC_INIT(core, 5.1, core-dev@nrl.navy.mil)
|
||||
VERSION=$PACKAGE_VERSION
|
||||
CORE_VERSION=$PACKAGE_VERSION
|
||||
CORE_VERSION_DATE=m4_esyscmd_s([date +%Y%m%d])
|
||||
COREDPY_VERSION=$PACKAGE_VERSION
|
||||
CORE_MAINTAINERS="CORE Developers <core-dev@nrl.navy.mil>"
|
||||
CORE_VENDOR="CORE Developers"
|
||||
|
||||
#
|
||||
# autoconf and automake initialization
|
||||
#
|
||||
AC_CONFIG_SRCDIR([netns/version.h.in])
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
AC_CONFIG_MACRO_DIR(config)
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AM_INIT_AUTOMAKE([tar-ustar])
|
||||
|
||||
AC_SUBST(CORE_VERSION)
|
||||
AC_SUBST(CORE_VERSION_DATE)
|
||||
AC_SUBST(COREDPY_VERSION)
|
||||
AC_SUBST(CORE_MAINTAINERS)
|
||||
AC_SUBST(CORE_VENDOR)
|
||||
# define variables used for packaging and date display
|
||||
PACKAGE_DATE=m4_esyscmd_s([date +%Y%m%d])
|
||||
PACKAGE_VENDOR="CORE Developers"
|
||||
PACKAGE_MAINTAINERS="$PACKAGE_VENDOR <$PACKAGE_BUGREPORT>"
|
||||
CORE_LIB_DIR="\${prefix}/lib/core"
|
||||
# TODO: hard setting path, until support by setup.py
|
||||
CORE_CONF_DIR="/etc/core"
|
||||
CORE_DATA_DIR="\${datarootdir}/core"
|
||||
# TODO: verify there is need to hard set /var
|
||||
CORE_STATE_DIR="\${localstatedir}"
|
||||
|
||||
#
|
||||
# some of the following directory variables are not expanded at configure-time,
|
||||
# so we have special checks to expand them
|
||||
#
|
||||
|
||||
# CORE GUI files in LIBDIR
|
||||
# AC_PREFIX_DEFAULT is /usr/local, but not expanded yet
|
||||
if test "x$prefix" = "xNONE" ; then
|
||||
prefix="/usr/local"
|
||||
fi
|
||||
if test "x$exec_prefix" = "xNONE" ; then
|
||||
exec_prefix="$prefix"
|
||||
fi
|
||||
if test "$libdir" = "\${exec_prefix}/lib" ; then
|
||||
libdir="${exec_prefix}/lib"
|
||||
fi
|
||||
if test "$sbindir" = "\${exec_prefix}/sbin" ; then
|
||||
sbindir="${exec_prefix}/sbin"
|
||||
fi
|
||||
if test "$bindir" = "\${exec_prefix}/bin" ; then
|
||||
bindir="${exec_prefix}/bin"
|
||||
fi
|
||||
# this can be /usr/lib or /usr/lib64
|
||||
LIB_DIR="${libdir}"
|
||||
# don't let the Tcl files install to /usr/lib64/core
|
||||
CORE_LIB_DIR="${prefix}/lib/core"
|
||||
AC_SUBST(LIB_DIR)
|
||||
AC_SUBST(PACKAGE_DATE)
|
||||
AC_SUBST(PACKAGE_MAINTAINERS)
|
||||
AC_SUBST(PACKAGE_VENDOR)
|
||||
AC_SUBST(CORE_LIB_DIR)
|
||||
SBINDIR="${sbindir}"
|
||||
AC_SUBST(SBINDIR)
|
||||
BINDIR="${bindir}"
|
||||
AC_SUBST(BINDIR)
|
||||
|
||||
# CORE daemon configuration file (core.conf) in CORE_CONF_DIR
|
||||
if test "$sysconfdir" = "\${prefix}/etc" ; then
|
||||
sysconfdir="/etc"
|
||||
CORE_CONF_DIR="/etc/core"
|
||||
else
|
||||
CORE_CONF_DIR="$sysconfdir/core"
|
||||
fi
|
||||
AC_SUBST(CORE_CONF_DIR)
|
||||
if test "$datarootdir" = "\${prefix}/share" ; then
|
||||
datarootdir="${prefix}/share"
|
||||
fi
|
||||
CORE_DATA_DIR="$datarootdir/core"
|
||||
AC_SUBST(CORE_DATA_DIR)
|
||||
AC_SUBST(CORE_STATE_DIR)
|
||||
|
||||
# CORE GUI configuration files and preferences in CORE_GUI_CONF_DIR
|
||||
# scenario files in ~/.core/configs/
|
||||
#AC_ARG_VAR(CORE_GUI_CONF_DIR, [GUI configuration directory.])
|
||||
AC_ARG_WITH([guiconfdir],
|
||||
[AS_HELP_STRING([--with-guiconfdir=dir],
|
||||
[specify GUI configuration directory])],
|
||||
|
@ -102,91 +57,27 @@ AC_ARG_ENABLE([daemon],
|
|||
(default is yes)])],
|
||||
[], [enable_daemon=yes])
|
||||
AC_SUBST(enable_daemon)
|
||||
if test "x$enable_daemon" = "xno"; then
|
||||
want_python=no
|
||||
want_linux_netns=no
|
||||
fi
|
||||
|
||||
# CORE state files
|
||||
if test "$localstatedir" = "\${prefix}/var" ; then
|
||||
# use /var instead of /usr/local/var (/usr/local/var/log isn't standard)
|
||||
CORE_STATE_DIR="/var"
|
||||
else
|
||||
CORE_STATE_DIR="$localstatedir"
|
||||
fi
|
||||
AC_SUBST(CORE_STATE_DIR)
|
||||
SEARCHPATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin"
|
||||
|
||||
# default compiler flags
|
||||
# _GNU_SOURCE is defined to get c99 defines for lrint()
|
||||
CFLAGS="$CFLAGS -O3 -Werror -Wall -D_GNU_SOURCE"
|
||||
# debug flags
|
||||
#CFLAGS="$CFLAGS -g -Werror -Wall -D_GNU_SOURCE"
|
||||
|
||||
# Checks for programs.
|
||||
# checks for programs
|
||||
AC_PROG_AWK
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_SED
|
||||
|
||||
AM_PATH_PYTHON(2.6, want_python=yes, want_python=no)
|
||||
SEARCHPATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin"
|
||||
#
|
||||
# daemon dependencies
|
||||
#
|
||||
if test "x$enable_daemon" = "xyes" ; then
|
||||
AC_CHECK_PROG(brctl_path, brctl, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(sysctl_path, sysctl, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(ebtables_path, ebtables, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(ip_path, ip, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(tc_path, tc, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(ifconfig_path, ifconfig, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(ngctl_path, ngctl, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(vimage_path, vimage, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(mount_path, mount, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(umount_path, umount, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(convert, convert, yes, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(ovs_vs_path, ovs-vsctl, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(ovs_of_path, ovs-ofctl, $as_dir, no, $SEARCHPATH)
|
||||
fi
|
||||
want_python=no
|
||||
want_linux_netns=no
|
||||
if test "x$enable_daemon" = "xyes"; then
|
||||
want_python=yes
|
||||
want_linux_netns=yes
|
||||
|
||||
#AC_CHECK_PROG(dia, dia, yes, no)
|
||||
AC_CHECK_PROG(help2man, help2man, yes, no, $SEARCHPATH)
|
||||
if test "x$convert" = "xno" ; then
|
||||
AC_MSG_WARN([Could not locate ImageMagick convert.])
|
||||
#want_docs_missing="convert"
|
||||
fi
|
||||
#if test "x$dia" = "xno" ; then
|
||||
# AC_MSG_WARN([Could not locate dia.])
|
||||
# want_docs_missing="dia"
|
||||
#fi
|
||||
if test "x$help2man" = "xno" ; then
|
||||
AC_MSG_WARN([Could not locate help2man.])
|
||||
want_docs_missing="$want_docs_missing help2man"
|
||||
fi
|
||||
if test "x$want_docs_missing" = "x" ; then
|
||||
want_docs=yes
|
||||
else
|
||||
AC_MSG_WARN([Could not find required helper utilities (${want_docs_missing}) so the CORE documentation will not be built.])
|
||||
want_docs=no
|
||||
fi
|
||||
|
||||
# check for sphinx required during make
|
||||
AC_CHECK_PROG(sphinxapi_path, sphinx-apidoc, $as_dir, no, $SEARCHPATH)
|
||||
if test "x$sphinxapi_path" = "xno" ; then
|
||||
AC_MSG_ERROR(["Could not location sphinx-apidoc, from the python-sphinx package"])
|
||||
fi
|
||||
|
||||
#AC_PATH_PROGS(tcl_path, [tclsh tclsh8.5 tclsh8.4], no)
|
||||
#if test "x$tcl_path" = "xno" ; then
|
||||
# AC_MSG_ERROR([Could not locate tclsh. Please install Tcl/Tk.])
|
||||
#fi
|
||||
#AC_PATH_PROGS(wish_path, [wish wish8.5 wish8.4], no)
|
||||
#if test "x$wish_path" = "xno" ; then
|
||||
# AC_MSG_ERROR([Could not locate wish. Please install Tcl/Tk.])
|
||||
#fi
|
||||
|
||||
if test "x$enable_daemon" = "xyes" ; then
|
||||
# Checks for libraries.
|
||||
AC_CHECK_LIB([netgraph], [NgMkSockNode])
|
||||
|
||||
|
@ -207,73 +98,94 @@ if test "x$enable_daemon" = "xyes" ; then
|
|||
AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
AC_CHECK_FUNCS([atexit dup2 gettimeofday memset socket strerror uname])
|
||||
|
||||
AM_PATH_PYTHON(2.6)
|
||||
|
||||
AC_CHECK_PROG(brctl_path, brctl, $as_dir, no, $SEARCHPATH)
|
||||
if test "x$brctl_path" = "xno" ; then
|
||||
AC_MSG_ERROR([Could not locate brctl (from bridge-utils package).])
|
||||
fi
|
||||
AC_CHECK_PROG(sysctl_path, sysctl, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(ebtables_path, ebtables, $as_dir, no, $SEARCHPATH)
|
||||
if test "x$ebtables_path" = "xno" ; then
|
||||
AC_MSG_ERROR([Could not locate ebtables (from ebtables package).])
|
||||
fi
|
||||
AC_CHECK_PROG(ip_path, ip, $as_dir, no, $SEARCHPATH)
|
||||
if test "x$ip_path" = "xno" ; then
|
||||
AC_MSG_ERROR([Could not locate ip (from iproute package).])
|
||||
fi
|
||||
AC_CHECK_PROG(tc_path, tc, $as_dir, no, $SEARCHPATH)
|
||||
if test "x$tc_path" = "xno" ; then
|
||||
AC_MSG_ERROR([Could not locate tc (from iproute package).])
|
||||
fi
|
||||
AC_CHECK_PROG(mount_path, mount, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(umount_path, umount, $as_dir, no, $SEARCHPATH)
|
||||
AC_CHECK_PROG(convert, convert, yes, no, $SEARCHPATH)
|
||||
if test "x$convert" = "xno" ; then
|
||||
AC_MSG_WARN([Could not locate ImageMagick convert.])
|
||||
fi
|
||||
AC_CHECK_PROG(ovs_vs_path, ovs-vsctl, $as_dir, no, $SEARCHPATH)
|
||||
if test "x$ovs_vs_path" = "xno" ; then
|
||||
AC_MSG_WARN([Could not locate ovs-vsctl cannot use OVS nodes])
|
||||
fi
|
||||
AC_CHECK_PROG(ovs_of_path, ovs-ofctl, $as_dir, no, $SEARCHPATH)
|
||||
if test "x$ovs_of_path" = "xno" ; then
|
||||
AC_MSG_WARN([Could not locate ovs-ofctl cannot use OVS nodes])
|
||||
fi
|
||||
|
||||
CFLAGS_save=$CFLAGS
|
||||
CPPFLAGS_save=$CPPFLAGS
|
||||
if test "x$PYTHON_INCLUDE_DIR" = "x"; then
|
||||
PYTHON_INCLUDE_DIR=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()"`
|
||||
fi
|
||||
CFLAGS="-I$PYTHON_INCLUDE_DIR"
|
||||
CPPFLAGS="-I$PYTHON_INCLUDE_DIR"
|
||||
AC_CHECK_HEADERS([Python.h], [],
|
||||
AC_MSG_ERROR([Python bindings require Python development headers (try installing your 'python-devel' or 'python-dev' package)]))
|
||||
CFLAGS=$CFLAGS_save
|
||||
CPPFLAGS=$CPPFLAGS_save
|
||||
PKG_CHECK_MODULES(libev, libev,
|
||||
AC_MSG_RESULT([found libev using pkgconfig OK])
|
||||
AC_SUBST(libev_CFLAGS)
|
||||
AC_SUBST(libev_LIBS),
|
||||
AC_MSG_RESULT([did not find libev using pkconfig...])
|
||||
AC_CHECK_LIB([ev], ev_set_allocator,
|
||||
AC_MSG_RESULT([found libev OK])
|
||||
AC_SUBST(libev_CFLAGS)
|
||||
AC_SUBST(libev_LIBS, [-lev]),
|
||||
AC_MSG_ERROR([Python bindings require libev (try installing your 'libev-devel' or 'libev-dev' package)])))
|
||||
fi
|
||||
|
||||
# Host-specific detection
|
||||
want_linux_netns=yes
|
||||
AC_CHECK_PROG(help2man, help2man, yes, no, $SEARCHPATH)
|
||||
|
||||
if test "x$want_python" = "xno"; then
|
||||
want_linux_netns=no
|
||||
if test "x$help2man" = "xno" ; then
|
||||
AC_MSG_WARN([Could not locate help2man.])
|
||||
want_docs_missing="$want_docs_missing help2man"
|
||||
fi
|
||||
|
||||
if test "x$want_python" = "xyes"; then
|
||||
if test "x$want_linux_netns" = "xyes"; then
|
||||
CFLAGS_save=$CFLAGS
|
||||
CPPFLAGS_save=$CPPFLAGS
|
||||
if test "x$PYTHON_INCLUDE_DIR" = "x"; then
|
||||
PYTHON_INCLUDE_DIR=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()"`
|
||||
fi
|
||||
CFLAGS="-I$PYTHON_INCLUDE_DIR"
|
||||
CPPFLAGS="-I$PYTHON_INCLUDE_DIR"
|
||||
AC_CHECK_HEADERS([Python.h], [],
|
||||
AC_MSG_ERROR([Python bindings require Python development headers (try installing your 'python-devel' or 'python-dev' package)]))
|
||||
CFLAGS=$CFLAGS_save
|
||||
CPPFLAGS=$CPPFLAGS_save
|
||||
PKG_CHECK_MODULES(libev, libev,
|
||||
AC_MSG_RESULT([found libev using pkgconfig OK])
|
||||
AC_SUBST(libev_CFLAGS)
|
||||
AC_SUBST(libev_LIBS),
|
||||
AC_MSG_RESULT([did not find libev using pkconfig...])
|
||||
AC_CHECK_LIB([ev], ev_set_allocator,
|
||||
AC_MSG_RESULT([found libev OK])
|
||||
AC_SUBST(libev_CFLAGS)
|
||||
AC_SUBST(libev_LIBS, [-lev]),
|
||||
AC_MSG_ERROR([Python bindings require libev (try installing your 'libev-devel' or 'libev-dev' package)])))
|
||||
fi
|
||||
AC_SUBST(pyprefix, `eval ${PYTHON} ./python-prefix.py ${PYTHON_PREFIX} ${PYTHON_VERSION}`)
|
||||
if test "${pyprefix}" != "${PYTHON_PREFIX}"; then
|
||||
pythondir=`echo ${pythondir} | sed -e 's,[$][{]prefix[}],${pyprefix},g'`
|
||||
pyexecdir=`echo ${pyexecdir} | sed -e 's,[$][{]exec_prefix[}],${pyprefix},g'`
|
||||
fi
|
||||
if test "x$want_docs_missing" = "x" ; then
|
||||
want_docs=yes
|
||||
else
|
||||
# Namespace support requires Python support
|
||||
want_linux_netns=no
|
||||
AC_MSG_WARN([Could not find required helper utilities (${want_docs_missing}) so the CORE documentation will not be built.])
|
||||
want_docs=no
|
||||
fi
|
||||
|
||||
progs_missing=""
|
||||
if test "x$want_linux_netns" = "xyes"; then
|
||||
if test "x$brctl_path" = "xno" ; then
|
||||
progs_missing="${progs_missing}brctl "
|
||||
brctl_path="/usr/sbin"
|
||||
AC_MSG_ERROR([Could not locate brctl (from bridge-utils package).])
|
||||
fi
|
||||
if test "x$ebtables_path" = "xno" ; then
|
||||
progs_missing="${progs_missing}ebtables "
|
||||
ebtables_path="/sbin"
|
||||
AC_MSG_ERROR([Could not locate ebtables (from ebtables package).])
|
||||
fi
|
||||
if test "x$ip_path" = "xno" ; then
|
||||
progs_missing="${progs_missing}ip "
|
||||
ip_path="/sbin"
|
||||
AC_MSG_ERROR([Could not locate ip (from iproute package).])
|
||||
fi
|
||||
if test "x$tc_path" = "xno" ; then
|
||||
progs_missing="${progs_missing}tc "
|
||||
tc_path="/sbin"
|
||||
AC_MSG_ERROR([Could not locate tc (from iproute package).])
|
||||
fi
|
||||
# check for sphinx required during make
|
||||
AC_CHECK_PROG(sphinxapi_path, sphinx-apidoc, $as_dir, no, $SEARCHPATH)
|
||||
if test "x$sphinxapi_path" = "xno" ; then
|
||||
AC_MSG_ERROR(["Could not location sphinx-apidoc, from the python-sphinx package"])
|
||||
fi
|
||||
|
||||
#AC_PATH_PROGS(tcl_path, [tclsh tclsh8.5 tclsh8.4], no)
|
||||
#if test "x$tcl_path" = "xno" ; then
|
||||
# AC_MSG_ERROR([Could not locate tclsh. Please install Tcl/Tk.])
|
||||
#fi
|
||||
|
||||
#AC_PATH_PROGS(wish_path, [wish wish8.5 wish8.4], no)
|
||||
#if test "x$wish_path" = "xno" ; then
|
||||
# AC_MSG_ERROR([Could not locate wish. Please install Tcl/Tk.])
|
||||
#fi
|
||||
|
||||
AC_ARG_WITH([startup],
|
||||
[AS_HELP_STRING([--with-startup=option],
|
||||
[option=systemd,suse,none to install systemd/SUSE init scripts])],
|
||||
|
@ -288,7 +200,6 @@ AM_CONDITIONAL(WANT_DAEMON, test x$enable_daemon = xyes)
|
|||
AM_CONDITIONAL(WANT_DOCS, test x$want_docs = xyes)
|
||||
AM_CONDITIONAL(WANT_PYTHON, test x$want_python = xyes)
|
||||
AM_CONDITIONAL(WANT_NETNS, test x$want_linux_netns = xyes)
|
||||
|
||||
AM_CONDITIONAL(WANT_INITD, test x$with_startup = xinitd)
|
||||
AM_CONDITIONAL(WANT_SYSTEMD, test x$with_startup = xsystemd)
|
||||
AM_CONDITIONAL(WANT_SUSE, test x$with_startup = xsuse)
|
||||
|
@ -299,28 +210,26 @@ else
|
|||
HELP2MAN=:
|
||||
fi
|
||||
|
||||
|
||||
# Output files
|
||||
#gui/core-gui
|
||||
#scripts/core-daemon.service
|
||||
#daemon/core/constants.py
|
||||
AC_CONFIG_FILES([Makefile
|
||||
gui/core-gui
|
||||
gui/version.tcl
|
||||
gui/Makefile
|
||||
gui/icons/Makefile
|
||||
scripts/Makefile
|
||||
scripts/core-daemon.service
|
||||
scripts/perf/Makefile
|
||||
doc/Makefile
|
||||
doc/conf.py
|
||||
doc/man/Makefile
|
||||
doc/figures/Makefile
|
||||
daemon/Makefile
|
||||
daemon/core/constants.py
|
||||
daemon/doc/Makefile
|
||||
daemon/doc/conf.py
|
||||
netns/Makefile
|
||||
netns/version.h
|
||||
ns3/Makefile
|
||||
ns3/corens3/constants.py],)
|
||||
ns3/Makefile],)
|
||||
AC_OUTPUT
|
||||
|
||||
# Summary text
|
||||
|
@ -331,12 +240,12 @@ ${PACKAGE_STRING} Configuration:
|
|||
Host System Type: ${host}
|
||||
C Compiler and flags: ${CC} ${CFLAGS}
|
||||
Install prefix: ${prefix}
|
||||
Exec prefix: ${exec_prefix}
|
||||
Build GUI: ${enable_gui}
|
||||
GUI path: ${CORE_LIB_DIR}
|
||||
GUI config: ${CORE_GUI_CONF_DIR}
|
||||
Daemon path: ${SBINDIR}
|
||||
Daemon path: ${sbindir}
|
||||
Daemon config: ${CORE_CONF_DIR}
|
||||
Python install prefix: ${pyprefix}
|
||||
Python modules: ${pythondir}
|
||||
Logs: ${CORE_STATE_DIR}/log
|
||||
|
||||
|
@ -352,8 +261,3 @@ if test "x${want_linux_netns}" = "xyes" ; then
|
|||
------------------------------------------------------------------------"
|
||||
fi
|
||||
|
||||
if test "x${progs_missing}" != "x" ; then
|
||||
echo ">>> NOTE: the following programs could not be found:"
|
||||
echo " $progs_missing
|
||||
------------------------------------------------------------------------"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue