configure.in 4.21 KB
Newer Older
Per Cederqvist's avatar
Per Cederqvist committed
1
dnl ISC - networking library
Per Cederqvist's avatar
Per Cederqvist committed
2
dnl Copyright (C) 1998-1999, 2001 by Peter Eriksson and Per Cederqvist of the
Per Cederqvist's avatar
Per Cederqvist committed
3
dnl                         Lysator Academic Computer Association.
Per Cederqvist's avatar
Per Cederqvist committed
4
5
dnl
dnl
Per Cederqvist's avatar
Per Cederqvist committed
6
7
8
9
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Library General Public
dnl License as published by the Free Software Foundation; either
dnl version 2 of the License, or (at your option) any later version.
Per Cederqvist's avatar
Per Cederqvist committed
10
dnl
Per Cederqvist's avatar
Per Cederqvist committed
11
12
13
14
15
16
17
18
dnl This library 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 GNU
dnl Library General Public License for more details.
dnl
dnl You should have received a copy of the GNU Library General Public
dnl License along with this library; if not, write to the Free
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Per Cederqvist's avatar
Per Cederqvist committed
19
20
21

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

Per Cederqvist's avatar
Per Cederqvist committed
22
AC_REVISION($Revision: 1.14 $)dnl
23
AC_PREREQ(2.53)
Per Cederqvist's avatar
Per Cederqvist committed
24
25
26
AC_INIT(isc, 1.01)
AC_CONFIG_SRCDIR([src/isc_master.c])
AM_INIT_AUTOMAKE(isc, 1.01)
Per Cederqvist's avatar
Per Cederqvist committed
27

28
AC_ARG_WITH([checker],
Per Cederqvist's avatar
Per Cederqvist committed
29
        AC_HELP_STRING([--with-checker], [compile with Gnu Checker]),
30
31
32
33
        [use_checker=$withval],
        [use_checker=no])

AC_ARG_WITH([gcov],
Per Cederqvist's avatar
Per Cederqvist committed
34
        AC_HELP_STRING([--with-gcov], [instrument for gcov (requires gcc)]),
35
36
37
38
        [use_gcov=$withval],
        [use_gcov=no])

AC_ARG_WITH([optimization],
Per Cederqvist's avatar
Per Cederqvist committed
39
40
41
        AC_HELP_STRING([--without-optimization], 
		       [turn off optimization (default on)])
AC_HELP_STRING([--with-optimization@<:@=N@:>@],[specify level of optimization]),
42
43
44
45
        [opt_level=$withval],
        [opt_level=""])


Per Cederqvist's avatar
Per Cederqvist committed
46
47
dnl Checks for programs.

48
49
50
51
52
AC_PATH_PROG([AR], [ar], [notfound], [$PATH$PATH_SEPARATOR/usr/ccs/bin])
AC_ARG_VAR([AR], [ar program to use])
[if test "$AR" = "notfound"; then]
    AC_MSG_ERROR([cannot find ``ar''])
[fi]
Per Cederqvist's avatar
Per Cederqvist committed
53
54
55
56
57
58
59
60
61
62
63
AC_PROG_CC
AC_AIX
AC_ISC_POSIX
AC_MINIX
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)
Per Cederqvist's avatar
Per Cederqvist committed
64
AC_CHECK_HEADERS(sys/time.h)
Per Cederqvist's avatar
Per Cederqvist committed
65
66

dnl Checks for typedefs, structures, and compiler characteristics.
Per Cederqvist's avatar
Per Cederqvist committed
67
AM_PROG_CC_STDC
Per Cederqvist's avatar
Per Cederqvist committed
68
69
AC_HEADER_TIME
AC_C_CONST
Per Cederqvist's avatar
Per Cederqvist committed
70
AC_C_INLINE
Per Cederqvist's avatar
Per Cederqvist committed
71
AC_TYPE_SIZE_T
Per Cederqvist's avatar
Per Cederqvist committed
72
73
74
75
AC_CHECK_TYPE([socklen_t],AC_DEFINE([HAVE_SOCKLEN_T]),,[
#include <sys/types.h>
#include <sys/socket.h>
])
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
dnl Low-level networking code on Solaris 2.
AC_CHECK_FUNC(gethostbyname)
[if test $ac_cv_func_gethostbyname = no
then]
      AC_CHECK_LIB(nsl, gethostbyname)
[fi]
dnl socket() et c on Solaris 2.
AC_CHECK_FUNC(socket)
[if test $ac_cv_func_socket = no
then]
  AC_CHECK_LIB(socket, socket)
[fi]
AC_REPLACE_FUNCS(inet_aton)
[if test $ac_cv_func_inet_aton = no
then]
    AC_CHECK_DECL([INADDR_NONE],,
Per Cederqvist's avatar
Per Cederqvist committed
92
	AC_DEFINE([INADDR_NONE],[((uint32_t)-1)], [Error indicator for inet_addr]),
93
94
	[#include <netinet/in.h>])
[fi]
Per Cederqvist's avatar
Per Cederqvist committed
95
96
97

CMOD_C_ATTRIBUTE_UNUSED

Per Cederqvist's avatar
Per Cederqvist committed
98
99
100
[if test -n "$GCC"; then]
    dnl "-Wtraditional" isn't really useful: we don't support
    dnl pre-c89-compilers.
101
    [CFLAGS="$CFLAGS -Wall -W -Wshadow"]
Per Cederqvist's avatar
Per Cederqvist committed
102
103
104
105
106
107
108
109
110
111
    CMOD_CHECK_CC_OPT([-Wbad-function-cast], [bad_function_cast])
    CMOD_CHECK_CC_OPT([-Wcast-qual], [cast_qual])
    CMOD_CHECK_CC_OPT([-Wcast-align], [cast_align])
    CMOD_CHECK_CC_OPT([-Wwrite-strings], [write_strings])
    CMOD_CHECK_CC_OPT([-Waggregate-return], [aggregate_return])
    CMOD_CHECK_CC_OPT([-Wstrict-prototypes], [strict_prototypes])
    CMOD_CHECK_CC_OPT([-Wmissing-prototypes], [missing_prototypes])
    CMOD_CHECK_CC_OPT([-Wmissing-declarations], [missing_declarations])
    CMOD_CHECK_CC_OPT([-Wnested-externs], [nested_externs])
    CMOD_CHECK_CC_OPT([-pipe], [pipe])
Per Cederqvist's avatar
Per Cederqvist committed
112
113
[fi]

114
115

[if test "$use_gcov" = "yes" -a -n "$GCC"; then]
Per Cederqvist's avatar
Per Cederqvist committed
116
117
        CMOD_CHECK_CC_OPT([-ftest-coverage], [test_coverage])
        CMOD_CHECK_CC_OPT([-fprofile-arcs], [profile_arcs])
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
[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]

Per Cederqvist's avatar
Per Cederqvist committed
137
138
139
140
141
142
143
144
145
AC_CONFIG_FILES([
Makefile
src/Makefile
man/Makefile
doc/Makefile
demo/Makefile
])

AC_OUTPUT