# # Copyright 2005-2006 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # configure.ac -- input file for configure script # # Note: make sure to run build-configure.sh when any changes are # made to this file or to any of the files in aclocal AC_PREREQ(2.57) AC_INIT(DTN2) AC_CONFIG_SRCDIR([dtn-version.h]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_AUX_DIR([tools]) AC_PREFIX_DEFAULT([/usr]) # Stick a comment in the generated file so people know what to do. AC_REVISION([-- DO NOT EDIT THIS FILE! See the instructions in configure.ac --]) AC_COPYRIGHT([ Copyright 2005-2007 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ]) AC_DEFINE(HAVE_CONFIG_STATE, 1, [always defined so code can ensure that config.h is properly included]) # This is handy to re-run configure but use any options you used before. AC_ARG_WITH( [previous-options], [AS_HELP_STRING( [--with-previous-options], [read config.status for configure options])], [ if test -r ./config.status && args=`sed -n '7s/^# [^ ]* //p' config.status` then set -x exec $0 $args fi ]) # First set srcdir and builddir, calculated above in AC_CONFIG_SRCDIR AC_MSG_CHECKING([location of source directory]) SRCDIR=`(cd $srcdir && pwd)` AC_MSG_RESULT([\"$SRCDIR\"]) AC_SUBST([SRCDIR]) builddir=`pwd` AC_MSG_CHECKING([location of build directory]) AC_MSG_RESULT([\"$builddir\"]) BUILDDIR=$builddir AC_SUBST([BUILDDIR]) # ------------------------------------------------------------------------- # Arrange to place files in /etc and /var by default, if --prefix is not used # ------------------------------------------------------------------------- if test "x$prefix" = "xNONE" ; then # possibly the value was overridden without --prefix being used. # This is a slightly imperfect test because conceivably someone might # use something like --sysconfdir=\${prefix}/etc and that will get # clobbered. case $sysconfdir in *[[$]]*) sysconfdir='/etc' ;; esac case $localstatedir in *[[$]]*) localstatedir='/var' ;; esac fi # fully expand the pathnames before they go into the config.h file oasys_save_prefix=$prefix test "x$prefix" = "xNONE" && prefix=$ac_default_prefix eval oasys_conf_dir=`echo $sysconfdir` AC_DEFINE_UNQUOTED(INSTALL_SYSCONFDIR, "$oasys_conf_dir", [directory for config files (default /etc)]) eval oasys_conf_dir=`echo $localstatedir` AC_DEFINE_UNQUOTED(INSTALL_LOCALSTATEDIR, "$oasys_conf_dir", [directory for local state (default /var)]) prefix=$oasys_save_prefix # ------------------------------------------------------------------------- # Checks for programs and libraries # ------------------------------------------------------------------------- ###################################################################### # rhansen@bbn.com: workaround to disable autoconf's default -O2, # since -O2 enables warnings that don't show up with -O0. If the # flags are empty, AC_PROG_CC and AC_PROG_CXX will set the flags to # "-O2 -g", otherwise they are left alone. We need the flags to be # set to "-g" if empty, otherwise left alone. # back up CFLAGS and CXXFLAGS oasys_save_CFLAGS="$CFLAGS" oasys_save_CXXFLAGS="$CXXFLAGS" # these macros directly or indirectly call AC_PROG_CC and AC_PROG_CXX AC_OASYS_CONFIG_GCC # now that AC_PROG_CC and AC_PROG_CXX are done, we know whether we're # using GCC. If we're not using GCC, then leave the flags alone. If # we are using GCC, and the flags were empty before, then we know that # the flags now contain "-O2 -g" so the flags should have "-O2" # removed. If the user specified flags, then leave the flags alone. if test "x$GCC" = "xyes" -a -z "$oasys_save_CFLAGS" ; then CFLAGS="-g" fi if test "x$GXX" = "xyes" -a -z "$oasys_save_CXXFLAGS" ; then CXXFLAGS="-g" fi # done with default -O2 workaround ###################################################################### AC_OASYS_SYSTEM_PROGRAMS AC_OASYS_SYSTEM_LIBRARIES AC_OASYS_SYSTEM_HEADERS AC_OASYS_SYSTEM_TYPES AC_OASYS_SYSTEM_FUNCTIONS AC_OASYS_CONFIG_ATOMIC AC_CHECK_HEADERS([sys/file.h termios.h]) AC_CHECK_FUNCS([select strpbrk]) AC_FUNC_SELECT_ARGTYPES AC_C_BIGENDIAN # ------------------------------------------------------------------------- # Dump the autoconf cache now to try to avoid redundant checks # ------------------------------------------------------------------------- AC_CACHE_SAVE # ------------------------------------------------------------------------- # Checks for dependent third-party libraries # ------------------------------------------------------------------------- AC_OASYS_CONFIG_TCL AC_OASYS_CONFIG_GOOGLE_PERFTOOLS AC_OASYS_CONFIG_BLUEZ AC_OASYS_CONFIG_BONJOUR AC_OASYS_CONFIG_EXPAT AC_OASYS_CONFIG_XERCES AC_OASYS_CONFIG_TCLREADLINE AC_OASYS_CONFIG_ZLIB AC_OASYS_CONFIG_XSD AC_OASYS_CONFIG_STORAGE AX_WITH_PYTHON AC_PYTHON_BUILD_EXT #-------------------------------------------------------------------------- # Checks for other optional features that may depend on third-party # libraries. #-------------------------------------------------------------------------- AC_CONFIG_EXTERNAL_CL AC_CONFIG_EXTERNAL_DP #-------------------------------------------------------------------------- # Check if BSP should be enabled, and if so, look for OpenSSL #-------------------------------------------------------------------------- AC_CONFIG_BSP AC_CONFIG_OPENSSL # ------------------------------------------------------------------------- # Output # ------------------------------------------------------------------------- # # We defer setting the various CFLAGS to avoid interfering with the # basic system tests. # CPPFLAGS="-I\$(SRCDIR)/servlib -I\$(SRCDIR)/oasys $OASYS_CPPFLAGS $DTN_CPPFLAGS $CPPFLAGS" LDFLAGS="-L. $OASYS_LDFLAGS $DTN_LDFLAGS $LDFLAGS" if test "x$STATIC" = "xlibs" ; then OASYS_LIBS="-Wl,-Bstatic $OASYS_LIBS -Wl,-Bdynamic" fi AC_SUBST([OASYS_LIBS]) AC_CONFIG_FILES([Rules.make:oasys/Rules.make.in]) if test ! $SRCDIR = `pwd` ; then AC_CONFIG_FILES([Makefile:oasys/Makefile-Builddir.in]) AC_CONFIG_FILES([applib/Makefile:applib/Makefile-Builddir.in]) AC_CONFIG_FILES([servlib/Makefile:servlib/Makefile-Builddir.in]) AC_CONFIG_FILES([daemon/Makefile:daemon/Makefile-Builddir.in]) AC_CONFIG_FILES([apps/Makefile:apps/Makefile-Builddir.in]) AC_CONFIG_FILES([sim/Makefile:sim/Makefile-Builddir.in]) AC_CONFIG_FILES([test/Makefile:test/Makefile-Builddir.in]) fi # # Always reconfigure oasys as well # AC_CONFIG_SUBDIRS([oasys]) AC_OUTPUT chmod oug-w Rules.make config.h config.h oasys/Rules.make oasys/config.h echo "DTN2 configure state:" echo " TARGET is: $TARGET" echo " CC is: $CC (version $oasys_cv_prog_gccver)" echo " CXX is: $CXX" echo " " echo "Options:" echo " CPPFLAGS: $CPPFLAGS" echo " LDFLAGS: $LDFLAGS" echo " LIBS: $LIBS" echo " " echo "External packages:" echo " OASYS_CPPFLAGS: $OASYS_CPPFLAGS" echo " OASYS_LDFLAGS: $OASYS_LDFLAGS" echo " OASYS_LIBS: $OASYS_LIBS"