Commit 347d7e51 authored by Per Cederqvist's avatar Per Cederqvist

Move up AC_CONFIG_AUX_DIR so that both automake and autoconf detects

it early enough.  Remove explicit AC_SUBST of several variables that
automake handles automatically, or that was used for functionality
that automake provides in different ways: CFLAGS, CPPFLAGS, LDFLAGS,
DEPENDFLAGS, INCLUDE_CURRENT, EXTRAARFLAGS, SRCTOPDIR,
BUILDTOPDIR. Added call to AM_C_PROTOTYPES.  Rely on automakes ability
to fix dependencies automatically and handle ARFLAGS properly.  Use
CMOD_COMPILER_CC_ACCEPTS to check for a lot of warning flags to use.
Use CMOD_C_ATTRIBUTE_UNUSED.  Use AM_PROG_LEX instead of AC_PROG_LEX.
Removed check for sys/select.h, which only isc uses.  Added check for
values.h.  Run configure in src/libraries/libisc-new instead of
creating makefiles in that directory.  Generated db-crypt/Makefile and
run-support/Makefile.
parent 6246c026
dnl $Id: configure.in,v 1.42 1997/09/13 15:31:24 byers Exp $
dnl $Id: configure.in,v 1.43 1998/07/08 23:10:14 ceder Exp $
dnl Configuration for LysKOM
dnl Copyright (C) 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
dnl
......@@ -18,8 +18,11 @@ dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl Please mail bug reports to bug-lyskom@lysator.liu.se.
dnl
AC_REVISION($Revision: 1.42 $)
AC_REVISION($Revision: 1.43 $)
AC_INIT(src/server/lyskomd.h)
AC_CONFIG_AUX_DIR(scripts)
AM_INIT_AUTOMAKE(lyskom-server, 2.0.0.pcl.2)
AC_ARG_WITH([gnu-malloc],
[ --with-gnu-malloc use GNU malloc],
[use_gnu_malloc=$withval],
......@@ -30,39 +33,24 @@ AC_ARG_WITH([purify],
[use_purify=no])
AC_PREFIX_DEFAULT(/usr/lyskom)
AC_PROG_CC
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(DEPENDFLAG)
AC_SUBST(INCLUDE_CURRENT)
AC_SUBST(EXTRAARFLAGS)
EXTRAARFLAGS=
INCLUDE_CURRENT=-I.
AC_AIX
AC_ISC_POSIX
AC_MINIX
AM_C_PROTOTYPES
[if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall"
] AC_DEFINE(_GNU_SOURCE)
KOM_COMPILER_CC_ACCEPTS([-pipe]) [
DEPENDFLAG=-MM
else
case "$CC" in
*vcc) DEPENDFLAG=-Em
INCLUDE_CURRENT='-I`pwd`';;
*) if $CC -flags > conftestccflags 2>/dev/null \
&& grep '^-xM1.*depend' conftestccflags >/dev/null 2>&1
then
# SparcWorks
DEPENDFLAG=-xM1
else
# Traditional
DEPENDFLAG=-M
fi;;
esac
CFLAGS="$CFLAGS -Wall -W -Wtraditional -Wshadow -Wpointer-arith"]
dnl AC_DEFINE(_GNU_SOURCE)
CMOD_COMPILER_CC_ACCEPTS([-Wbad-function-cast])
CMOD_COMPILER_CC_ACCEPTS([-Wcast-qual])
CMOD_COMPILER_CC_ACCEPTS([-Wcast-align])
CMOD_COMPILER_CC_ACCEPTS([-Wwrite-strings])
CMOD_COMPILER_CC_ACCEPTS([-Wstrict-prototypes])
CMOD_COMPILER_CC_ACCEPTS([-Wmissing-prototypes])
CMOD_COMPILER_CC_ACCEPTS([-Wmissing-declarations])
CMOD_COMPILER_CC_ACCEPTS([-Wnested-externs])
CMOD_COMPILER_CC_ACCEPTS([-pipe]) [
fi]
AC_MSG_CHECKING([flag to get dependencies])
AC_MSG_RESULT([$DEPENDFLAG])
AC_SUBST(PURIFY)
[if test "$use_purify" = "yes"
then
......@@ -70,6 +58,7 @@ then
fi]
# Do this test early since it may define _POSIX_SOURCE, which may
# affect future tests.
# FIXME: is this needed, now that we use AM_C_PROTOTYPES?
AC_MSG_CHECKING([if <signal.h> defines struct sigaction])
AC_CACHE_VAL([kom_cv_header_posix_source_needed],
[# This default may be overridden below.
......@@ -99,8 +88,10 @@ AC_TRY_COMPILE([#include <signal.h>],
[fi]
AC_C_CONST
CMOD_C_ATTRIBUTE_UNUSED
AC_HEADER_STDC
AC_TYPE_PID_T
# FIXME: is this needed now that we use AM_C_PROTOTYPES?
AC_MSG_CHECKING([if _HPUX_SOURCE needs to be defined])
AC_CACHE_VAL([kom_cv_sys_hpux_source],
[AC_TRY_LINK(
......@@ -120,6 +111,8 @@ AC_MSG_RESULT($kom_cv_sys_hpux_source)
[if test $kom_cv_sys_hpux_source = yes ; then]
AC_DEFINE(_HPUX_SOURCE)
[fi]
dnl
dnl
AC_MSG_CHECKING([if the compiler understands __attribute__ ((format))])
AC_CACHE_VAL([kom_cv_c_attribute_format_printf],
[AC_TRY_COMPILE([extern void log (const char *f, ...)
......@@ -130,24 +123,19 @@ AC_MSG_RESULT($kom_cv_c_attribute_format_printf)
[if test $kom_cv_c_attribute_format_printf = yes ; then]
AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PRINTF)
[fi]
AC_SUBST(SRCTOPDIR)
[SRCTOPDIR=`cd $srcdir;pwd`]
AC_SUBST(BUILDTOPDIR)
[BUILDTOPDIR=`pwd`]
AC_CONFIG_AUX_DIR(scripts)
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_AWK
AC_PROG_LN_S
AC_PROG_YACC
AC_PROG_LEX
AM_PROG_LEX
AC_CHECK_PROGS(BISON, bison)
AC_CHECK_PROGS(FLEX, flex)
AC_CHECK_PROGS(SED, sed)
AC_CHECK_HEADERS(string.h memory.h strings.h sys/param.h sys/time.h)
AC_CHECK_HEADERS(stdarg.h stdlib.h stddef.h locale.h sys/resource.h)
AC_CHECK_HEADERS(crypt.h unistd.h)
AC_CHECK_HEADERS(sys/select.h) dnl Needed by ISC
AC_CHECK_HEADERS(values.h) dnl libmisc/pom.c
AC_HEADER_TIME
AC_FUNC_ALLOCA
AC_CHECK_LIB(resolv,main) dnl Host name lookup.
......@@ -196,7 +184,7 @@ dnl from a previous build attempt
[rm -f include/malloc.h lib/libgmalloc*.a]
[fi]
dnl
dnl Unencryptet passwords are no longer supported.
dnl Unencrypted passwords are no longer supported.
AC_DEFINE(ENCRYPT_PASSWORDS)
dnl
dnl Once upon a time, the server shared some code with the tty-client.
......@@ -207,24 +195,9 @@ dnl
dnl Tests for GNU getopt (used in dbck)
AC_CHECK_HEADERS(alloca.h)
dnl
dnl Tests for bad make programs
AC_MSG_CHECKING([if make defines ARFLAGS])
[echo 'foo: ; @echo BEGIN$(ARFLAGS)END' > conftestmake
case `make -f conftestmake` in
BEGINEND)]
AC_MSG_RESULT([no; setting EXTRAARFLAGS to rv])
[EXTRAARFLAGS=rv;;
BEGINrvEND)]
AC_MSG_RESULT([yes]);;
[BEGIN*END)]
AC_MSG_RESULT([yes, but to a suspicious value]);;
[*)]
AC_MSG_RESULT([probably]);;
[esac
rm conftestmake]
dnl
dnl
AC_CONFIG_SUBDIRS(src/libraries/libisc-new)
AC_OUTPUT(Makefile
db-crypt/Makefile
doc/Makefile
doc/man/Makefile
scripts/Makefile
......@@ -234,34 +207,9 @@ src/include/server/Makefile
src/libraries/Makefile
src/libraries/libansi/Makefile
src/libraries/libcommon/Makefile
src/libraries/libisc-new/Makefile
src/libraries/libisc-new/src/Makefile
src/libraries/libmisc/Makefile
src/libraries/regex/Makefile
src/libraries/gnumalloc/Makefile
src/server/Makefile
src/server/testsuite/Makefile
run-support/Makefile,
[
# make will complain unless the "dependencies" files exists.
# Worse: some make versions will abort unless they exist! The
# following lines creates them unless they already exists.
echo touching dependencies files...
touch doc/dependencies
touch doc/man/dependencies
touch run-support/dependencies
touch scripts/dependencies
touch src/include/server/dependencies
touch src/include/dependencies
touch src/libraries/libansi/dependencies
touch src/libraries/libcommon/dependencies
touch src/libraries/libisc-new/src/dependencies
touch src/libraries/libisc-new/dependencies
touch src/libraries/libmisc/dependencies
touch src/libraries/regex/dependencies
touch src/libraries/dependencies
touch src/server/testsuite/dependencies
touch src/server/dependencies
touch src/dependencies
touch dependencies
])
run-support/Makefile)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment