configure.in 3.32 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
dnl  ISC - networking library
dnl  Copyright (C) 1998 by Peter Eriksson and Per Cederqvist of the
dnl                     Lysator Academic Computer Association.
dnl
dnl  This program is free software; you can redistribute it and/or modify
dnl  it under the terms of the GNU General Public License as published by
dnl  the Free Software Foundation; either version 2 of the License, or
dnl  (at your option) any later version.
dnl
dnl  This program is distributed in the hope that it will be useful,
dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl  GNU General Public License for more details.
dnl
dnl  You should have received a copy of the GNU General Public License
dnl  along with this program; if not, write to the Free Software
dnl  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */

dnl Process this file with autoconf to produce a configure script.

21
AC_REVISION($Revision: 1.3 $)dnl
22 23 24 25 26 27
AC_INIT(src/isc_master.c)
AM_INIT_AUTOMAKE(isc, 0.99)

AC_ARG_ENABLE([isc-printf],
	[  --enable-isc-printf     include isc_printf support (non-portable)])

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
AC_ARG_WITH([checker],
        [  --with-checker             compile with Gnu Checker],
        [use_checker=$withval],
        [use_checker=no])

AC_ARG_WITH([gcov],
        [  --with-gcov                instrument for gcov (requires gcc)],
        [use_gcov=$withval],
        [use_gcov=no])

AC_ARG_WITH([optimization],
        [  --with-optimization        select level of optimization],
        [opt_level=$withval],
        [opt_level=""])


44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
[if test "$enable_isc_printf" = yes
then]
	AC_DEFINE(ISC_PRINTF_SUPPORT)
[	LIBOBJS="printf.o $LIBOBJS"
fi]

AC_SUBST(LIBOBJS)

dnl Checks for programs.

AC_PROG_CC
AC_AIX
AC_ISC_POSIX
AC_MINIX
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(stdlib.h stdarg.h stddef.h string.h sys/select.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AM_C_PROTOTYPES
AC_HEADER_TIME
AC_C_CONST
AC_TYPE_SIZE_T

CMOD_C_ATTRIBUTE_UNUSED

76 77 78 79
[if test -n "$GCC"; then]
    dnl "-Wtraditional" isn't really useful: we don't support
    dnl pre-c89-compilers.
    [CFLAGS="$CFLAGS -Wall -W -Wshadow -Wpointer-arith"]
80 81 82 83 84 85 86 87 88 89 90 91
    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([-Waggregate-return])
    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]

92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114

[if test "$use_gcov" = "yes" -a -n "$GCC"; then]
        CMOD_COMPILER_CC_ACCEPTS([-ftest-coverage])
        CMOD_COMPILER_CC_ACCEPTS([-fprofile-arcs])
[fi]


[if test -n "$opt_level" -a "$opt_level" != "yes" ; then
    CFLAGS=`echo "$CFLAGS" | sed "s/-O[0-9]*//"`
    if test "$opt_level" != "no" ; then
        CFLAGS="$CFLAGS -O$opt_level"
    fi
fi]

# Check for checker

[if test "$use_checker" = "yes"
then]
        AC_CHECK_PROGS(CHECKER, checker)
        [ CC="checker $CC"
          LIBS="-lchkr_m $LIBS" ]
[fi]

115
AC_OUTPUT(Makefile src/Makefile man/Makefile doc/Makefile demo/Makefile)