dnl dnl File: configure.in dnl Revision: $Id: 1a56a7f769d2451ea629e5372e5e7907142e6798 $ dnl Created: 1994/06/18 dnl Author: Leif Hedstrom dnl Martin S. Utesch dnl Peter W. Osel dnl R.K. Owen dnl dnl Process this file with autoconf to produce a configure script dnl You need autoconf 2.52 or better! dnl dnl --------------------------------------------------------------------------- AC_INIT(modules,3.2) AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE(1.9.6 foreign dejagnu no-installinfo dist-bzip2) AC_CONFIG_SRCDIR([version.c]) AM_CONFIG_HEADER(config.h) AC_PREREQ(2.59) dnl --------------------------------------------------------------------------- dnl Autoheader "templates" (was acconfig.h) AH_TOP([ /***** ** ** Module Header ******************************************************* ** ** ** ** Modules Revision 3.0 ** ** Providing a flexible user environment ** ** ** ** Description: config.h.in (generated by autoheader from ** ** configure.ac) ** ** ** ** ************************************************************************ ** ****/ /** ** Copyright *********************************************************** ** ** ** ** Copyright 1991-1994 by John L. Furlan. ** ** see LICENSE.GPL, which must be provided, for details ** ** ** ** ************************************************************************ **/ ]) dnl --------------------------------------------------------------------------- dnl dnl Some special substitution we need: dnl dnl --------------------------------------------------------------------------- dnl Need to know if versioning is asked for before setting certain paths dnl --enable-versioning Use modules versioning [DEF] dnl --disable-versioning Without - " - dnl --------------------------------------------------------------------------- dnl AC_SUBST(WANTS_VERSIONING) AC_SUBST(VERSIONING) AC_SUBST(NOTVERSIONING) AH_TEMPLATE([WANTS_VERSIONING],[ WANTS_VERSIONING Does the system want to use modules versions]) AC_ARG_ENABLE(versioning, AC_HELP_STRING([--enable-versioning], [use modules versioning [[yes]]]), if test "$enableval" = "yes"; then WANTS_VERSIONING=1 AC_DEFINE(WANTS_VERSIONING,1) VERSIONING="" NOTVERSIONING="#" else WANTS_VERSIONING=0 AC_DEFINE(WANTS_VERSIONING,0) VERSIONING="#" NOTVERSIONING="" fi, WANTS_VERSIONING=1 AC_DEFINE(WANTS_VERSIONING,1) VERSIONING="" NOTVERSIONING="#" ) dnl dnl --------------------------------------------------------------------------- dnl Get Modules version & date dnl --------------------------------------------------------------------------- dnl DATE Module package date dnl VERSION Module package version dnl AC_SUBST(VERSION) AC_SUBST(DATE) VERSION='(unknown)' VERSION=`sed -n -e 's/^.*version_string.*"\(.*\)";$/\1/p' ${srcdir}/version.c` AC_MSG_RESULT([VERSION = $VERSION]) DATE='(DDMmmYYYY)' DATE=`sed -n -e 's/^.*date_string.*"\(.*\)";$/\1/p' ${srcdir}/version.c` AC_MSG_RESULT([DATE = $DATE]) echo "configuring for Modules $VERSION $DATE" dnl --------------------------------------------------------------------------- dnl Set PREFIX and related based on WANTS_VERSIONING dnl --------------------------------------------------------------------------- AC_SUBST(DEFAULTPATH) AC_SUBST(BASEPREFIX) DEFAULTPATH=default AH_TEMPLATE([BASEPREFIX],[ BASEPREFIX: Usually equivalent to /usr/local]) AH_TEMPLATE([PREFIX],[ PREFIX: Usually equivalent to /usr/local/Modules[/version_number]]) AH_TEMPLATE([MODULES_INIT_DIR],[ MODULES_INIT_DIR: Directory that contains the modules init files.]) if test "$exec_prefix" != "NONE" ; then EXECPREFIX=$exec_prefix # can not have versioning if specifying exec-prefix if test "$WANTS_VERSIONING" -eq 1 ; then AC_MSG_ERROR([You can not have versioning if --exec-prefix is specified must disable with --disable-versioning ]) fi fi if test "$prefix" != "NONE" ; then if test "$WANTS_VERSIONING" -eq 1 ; then DEFAULTPATH=$prefix/Modules/default NODEFAULTPATH=$prefix/Modules/$VERSION BASEPREFIX=$prefix prefix=$BASEPREFIX/Modules/$VERSION export prefix else DEFAULTPATH=$prefix/Modules NODEFAULTPATH=$prefix/Modules BASEPREFIX=$prefix prefix=$BASEPREFIX/Modules export prefix fi PREFIX=$prefix else if test "$WANTS_VERSIONING" -eq 1 ; then DEFAULTPATH=$ac_default_prefix/Modules/default NODEFAULTPATH=$ac_default_prefix/Modules/$VERSION BASEPREFIX=$ac_default_prefix ac_default_prefix=$BASEPREFIX/Modules/$VERSION export ac_default_prefix else DEFAULTPATH=$ac_default_prefix/Modules NODEFAULTPATH=$ac_default_prefix/Modules BASEPREFIX=$ac_default_prefix ac_default_prefix=$BASEPREFIX/Modules export ac_default_prefix fi PREFIX=$ac_default_prefix fi if test "$exec_prefix" != "NONE" ; then EXECPREFIX=$exec_prefix else EXECPREFIX=$PREFIX fi MODULES_INIT_DIR=$EXECPREFIX/init dnl --------------------------------------------------------------------------- dnl --enable-use-default Use PREFIX/default/ in init scripts [DEF] dnl --disable-use-default Use PREFIX/VERSION/ in init scripts dnl --------------------------------------------------------------------------- AC_DEFINE_UNQUOTED(MODULES_INIT_DIR, "$MODULES_INIT_DIR") AC_ARG_ENABLE(use-default, AC_HELP_STRING([--enable-use-default],[use DEFAULTPATH in init scripts [[yes]]]), if test "$enableval" = "no" -o $WANTS_VERSIONING -eq 0; then DEFAULTPATH=$NODEFAULTPATH fi) AC_MSG_RESULT([DEFAULTPATH = $DEFAULTPATH]) AC_MSG_RESULT([BASEPREFIX = $BASEPREFIX]) AC_MSG_RESULT([PREFIX = $PREFIX]) AC_MSG_RESULT([EXECPREFIX = $EXECPREFIX]) AC_DEFINE_UNQUOTED(BASEPREFIX, "$BASEPREFIX") AC_DEFINE_UNQUOTED(PREFIX, "$PREFIX") export DEFAULTPATH export NODEFAULTPATH export BASEPREFIX export MODULES_INIT_DIR dnl --------------------------------------------------------------------------- dnl Some standard autoconfig stuff dnl Checks for programs dnl --------------------------------------------------------------------------- AC_PROG_CC AC_PROG_CPP AC_PROG_GCC_TRADITIONAL AC_PROG_INSTALL AM_PROG_CC_C_O AC_PROG_MAKE_SET AC_AIX AC_ISC_POSIX AC_PATH_PROG([UNAME],[uname],[""]) dnl --------------------------------------------------------------------------- dnl Checks for header files dnl --------------------------------------------------------------------------- AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(string.h memory.h stdlib.h unistd.h termio.h fcntl.h ctype.h \ stdarg.h varargs.h syslog.h stdint.h) AC_CHECK_HEADERS([sys/ioctl.h sys/termios.h sys/mode.h sys/stat.h sys/param.h \ errno.h assert.h locale.h]) dnl --------------------------------------------------------------------------- dnl Checks for typedefs, structures, and compiler characteristics. dnl --------------------------------------------------------------------------- AC_C_CONST AC_TYPE_UID_T AC_TYPE_SIZE_T AC_STRUCT_TM dnl --------------------------------------------------------------------------- dnl Checks for library functions. dnl --------------------------------------------------------------------------- AC_FUNC_STRCOLL AC_CHECK_FUNCS([strdup uname gethostname getdomainname \ mktemp tmpnam tempnam \ syslog dup2 setlocale]) dnl --------------------------------------------------------------------------- dnl Checks for libraries dnl --------------------------------------------------------------------------- dnl Solaris 2.x: This requires -lnsl and -lsocket. If AC_PATH_XTRA dnl did not search for these, search them explicitly. dnl MUST be done BEFORE AC_PATH_XTRA! dnl --------------------------------------------------------------------------- AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, t_accept) dnl --------------------------------------------------------------------------- dnl Check for X11 things dnl --------------------------------------------------------------------------- AC_PATH_X AC_PATH_XTRA if test "$no_x" != "yes"; then AH_TEMPLATE([HAS_X11LIBS],[ HAS_X11LIBS: This symbol, if defined, indicates that the C program can use X11 directly.]) AC_DEFINE(HAS_X11LIBS) AC_CHECK_LIB(X11, XMaxRequestSize,,, [-I ${ac_x_includes:-.} -L ${ac_x_libraries:-.}]) dnl AC_CHECK_LIB(Xmu, XmuGetHostname,,, dnl [-I ${ac_x_includes:-.} -L ${ac_x_libraries:-.}]) fi dnl --------------------------------------------------------------------------- AH_TEMPLATE([CPPSTDIN],[ CPPSTDIN: This symbol contains the first part of the string which will invoke the C preprocessor on the standard input and produce to standard output. Typical value of "cc -E" or "/lib/cpp".]) EM_PATH_PROG_SEARCH(_CPPSTDIN, cpp, /lib /usr/lib /usr/lang \ /usr/local/lang /usr/ccs/lib, [${CC} -E]) AC_DEFINE_UNQUOTED(CPPSTDIN, "$_CPPSTDIN") dnl AH_TEMPLATE([CPPMINUS],[ CPPMINUS: This symbol contains the second part of the string which will invoke the C preprocessor on the standard input and produce to standard output. This symbol will have the value "-" if CPPSTDIN needs a minus to specify standard input, otherwise the value is "".]) AC_DEFINE(CPPMINUS, "") dnl --------------------------------------------------------------------------- AH_TEMPLATE([PHOSTNAME],[ PHOSTNAME: Last resort to get the hostname, if uname() and gethostname() are not available.]) AC_PATH_PROG([_PHOST],[hostname],[""]) test "$_PHOST" != "" && AC_DEFINE_UNQUOTED(PHOSTNAME, "$_PHOST") AC_PATH_PROG(RUNTEST, runtest, "./not_installed") test "$RUNTEST" = "" && echo "Install DEJAGNU and rerun configure if you \ want to run the testsuite" dnl dnl Here we define some --with & --enable things: dnl dnl --with-split-size[=] With split size= [TEST] dnl --without-split-size Without - " - dnl dnl --enable-cache With directory cache dnl --disable-cache Without - " - [DEF] dnl dnl --enable-shell-funcs With sh functions [TEST] dnl --disable-shell-funcs Without - " - dnl dnl --enable-shell-alias With sh aliases [TEST] dnl --disable-shell-alias Without - " - dnl dnl --enable-shell-eval With shell alias eval dnl --disable-shell-eval Without - " - [DEF] dnl dnl --enable-free With free() calls dnl --disable-free Without - " - [DEF] dnl dnl --with-debug[=