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

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 Configuration for LysKOM
dnl Copyright (C) 1993, 1994, 1995, 1996 Lysator Academic Computer Association. dnl Copyright (C) 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
dnl dnl
...@@ -18,8 +18,11 @@ dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ...@@ -18,8 +18,11 @@ dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl dnl
dnl Please mail bug reports to bug-lyskom@lysator.liu.se. dnl Please mail bug reports to bug-lyskom@lysator.liu.se.
dnl dnl
AC_REVISION($Revision: 1.42 $) AC_REVISION($Revision: 1.43 $)
AC_INIT(src/server/lyskomd.h) 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], AC_ARG_WITH([gnu-malloc],
[ --with-gnu-malloc use GNU malloc], [ --with-gnu-malloc use GNU malloc],
[use_gnu_malloc=$withval], [use_gnu_malloc=$withval],
...@@ -30,39 +33,24 @@ AC_ARG_WITH([purify], ...@@ -30,39 +33,24 @@ AC_ARG_WITH([purify],
[use_purify=no]) [use_purify=no])
AC_PREFIX_DEFAULT(/usr/lyskom) AC_PREFIX_DEFAULT(/usr/lyskom)
AC_PROG_CC 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_AIX
AC_ISC_POSIX AC_ISC_POSIX
AC_MINIX AC_MINIX
AM_C_PROTOTYPES
[if test -n "$GCC"; then [if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Wall -W -Wtraditional -Wshadow -Wpointer-arith"]
] AC_DEFINE(_GNU_SOURCE) dnl AC_DEFINE(_GNU_SOURCE)
KOM_COMPILER_CC_ACCEPTS([-pipe]) [ CMOD_COMPILER_CC_ACCEPTS([-Wbad-function-cast])
DEPENDFLAG=-MM CMOD_COMPILER_CC_ACCEPTS([-Wcast-qual])
else CMOD_COMPILER_CC_ACCEPTS([-Wcast-align])
case "$CC" in CMOD_COMPILER_CC_ACCEPTS([-Wwrite-strings])
*vcc) DEPENDFLAG=-Em CMOD_COMPILER_CC_ACCEPTS([-Wstrict-prototypes])
INCLUDE_CURRENT='-I`pwd`';; CMOD_COMPILER_CC_ACCEPTS([-Wmissing-prototypes])
*) if $CC -flags > conftestccflags 2>/dev/null \ CMOD_COMPILER_CC_ACCEPTS([-Wmissing-declarations])
&& grep '^-xM1.*depend' conftestccflags >/dev/null 2>&1 CMOD_COMPILER_CC_ACCEPTS([-Wnested-externs])
then CMOD_COMPILER_CC_ACCEPTS([-pipe]) [
# SparcWorks
DEPENDFLAG=-xM1
else
# Traditional
DEPENDFLAG=-M
fi;;
esac
fi] fi]
AC_MSG_CHECKING([flag to get dependencies])
AC_MSG_RESULT([$DEPENDFLAG])
AC_SUBST(PURIFY) AC_SUBST(PURIFY)
[if test "$use_purify" = "yes" [if test "$use_purify" = "yes"
then then
...@@ -70,6 +58,7 @@ then ...@@ -70,6 +58,7 @@ then
fi] fi]
# Do this test early since it may define _POSIX_SOURCE, which may # Do this test early since it may define _POSIX_SOURCE, which may
# affect future tests. # affect future tests.
# FIXME: is this needed, now that we use AM_C_PROTOTYPES?
AC_MSG_CHECKING([if <signal.h> defines struct sigaction]) AC_MSG_CHECKING([if <signal.h> defines struct sigaction])
AC_CACHE_VAL([kom_cv_header_posix_source_needed], AC_CACHE_VAL([kom_cv_header_posix_source_needed],
[# This default may be overridden below. [# This default may be overridden below.
...@@ -99,8 +88,10 @@ AC_TRY_COMPILE([#include <signal.h>], ...@@ -99,8 +88,10 @@ AC_TRY_COMPILE([#include <signal.h>],
[fi] [fi]
AC_C_CONST AC_C_CONST
CMOD_C_ATTRIBUTE_UNUSED
AC_HEADER_STDC AC_HEADER_STDC
AC_TYPE_PID_T 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_MSG_CHECKING([if _HPUX_SOURCE needs to be defined])
AC_CACHE_VAL([kom_cv_sys_hpux_source], AC_CACHE_VAL([kom_cv_sys_hpux_source],
[AC_TRY_LINK( [AC_TRY_LINK(
...@@ -120,6 +111,8 @@ AC_MSG_RESULT($kom_cv_sys_hpux_source) ...@@ -120,6 +111,8 @@ AC_MSG_RESULT($kom_cv_sys_hpux_source)
[if test $kom_cv_sys_hpux_source = yes ; then] [if test $kom_cv_sys_hpux_source = yes ; then]
AC_DEFINE(_HPUX_SOURCE) AC_DEFINE(_HPUX_SOURCE)
[fi] [fi]
dnl
dnl
AC_MSG_CHECKING([if the compiler understands __attribute__ ((format))]) AC_MSG_CHECKING([if the compiler understands __attribute__ ((format))])
AC_CACHE_VAL([kom_cv_c_attribute_format_printf], AC_CACHE_VAL([kom_cv_c_attribute_format_printf],
[AC_TRY_COMPILE([extern void log (const char *f, ...) [AC_TRY_COMPILE([extern void log (const char *f, ...)
...@@ -130,24 +123,19 @@ AC_MSG_RESULT($kom_cv_c_attribute_format_printf) ...@@ -130,24 +123,19 @@ AC_MSG_RESULT($kom_cv_c_attribute_format_printf)
[if test $kom_cv_c_attribute_format_printf = yes ; then] [if test $kom_cv_c_attribute_format_printf = yes ; then]
AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PRINTF) AC_DEFINE(HAVE_ATTRIBUTE_FORMAT_PRINTF)
[fi] [fi]
AC_SUBST(SRCTOPDIR)
[SRCTOPDIR=`cd $srcdir;pwd`]
AC_SUBST(BUILDTOPDIR)
[BUILDTOPDIR=`pwd`]
AC_CONFIG_AUX_DIR(scripts)
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_RANLIB AC_PROG_RANLIB
AC_PROG_AWK AC_PROG_AWK
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_YACC AC_PROG_YACC
AC_PROG_LEX AM_PROG_LEX
AC_CHECK_PROGS(BISON, bison) AC_CHECK_PROGS(BISON, bison)
AC_CHECK_PROGS(FLEX, flex) AC_CHECK_PROGS(FLEX, flex)
AC_CHECK_PROGS(SED, sed) AC_CHECK_PROGS(SED, sed)
AC_CHECK_HEADERS(string.h memory.h strings.h sys/param.h sys/time.h) 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(stdarg.h stdlib.h stddef.h locale.h sys/resource.h)
AC_CHECK_HEADERS(crypt.h unistd.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_HEADER_TIME
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
AC_CHECK_LIB(resolv,main) dnl Host name lookup. AC_CHECK_LIB(resolv,main) dnl Host name lookup.
...@@ -196,7 +184,7 @@ dnl from a previous build attempt ...@@ -196,7 +184,7 @@ dnl from a previous build attempt
[rm -f include/malloc.h lib/libgmalloc*.a] [rm -f include/malloc.h lib/libgmalloc*.a]
[fi] [fi]
dnl dnl
dnl Unencryptet passwords are no longer supported. dnl Unencrypted passwords are no longer supported.
AC_DEFINE(ENCRYPT_PASSWORDS) AC_DEFINE(ENCRYPT_PASSWORDS)
dnl dnl
dnl Once upon a time, the server shared some code with the tty-client. dnl Once upon a time, the server shared some code with the tty-client.
...@@ -207,24 +195,9 @@ dnl ...@@ -207,24 +195,9 @@ dnl
dnl Tests for GNU getopt (used in dbck) dnl Tests for GNU getopt (used in dbck)
AC_CHECK_HEADERS(alloca.h) AC_CHECK_HEADERS(alloca.h)
dnl dnl
dnl Tests for bad make programs AC_CONFIG_SUBDIRS(src/libraries/libisc-new)
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_OUTPUT(Makefile AC_OUTPUT(Makefile
db-crypt/Makefile
doc/Makefile doc/Makefile
doc/man/Makefile doc/man/Makefile
scripts/Makefile scripts/Makefile
...@@ -234,34 +207,9 @@ src/include/server/Makefile ...@@ -234,34 +207,9 @@ src/include/server/Makefile
src/libraries/Makefile src/libraries/Makefile
src/libraries/libansi/Makefile src/libraries/libansi/Makefile
src/libraries/libcommon/Makefile src/libraries/libcommon/Makefile
src/libraries/libisc-new/Makefile
src/libraries/libisc-new/src/Makefile
src/libraries/libmisc/Makefile src/libraries/libmisc/Makefile
src/libraries/regex/Makefile src/libraries/regex/Makefile
src/libraries/gnumalloc/Makefile src/libraries/gnumalloc/Makefile
src/server/Makefile src/server/Makefile
src/server/testsuite/Makefile src/server/testsuite/Makefile
run-support/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
])
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