configure.in 8.03 KB
Newer Older
1
dnl $Id: configure.in,v 1.56 1999/04/03 21:53:17 ceder Exp $
2
dnl Configuration for LysKOM
Per Cederqvist's avatar
Per Cederqvist committed
3
dnl Copyright (C) 1993, 1994, 1995, 1996  Lysator Academic Computer Association.
Per Cederqvist's avatar
Per Cederqvist committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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, or (at your option)
dnl 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
dnl Please mail bug reports to bug-lyskom@lysator.liu.se. 
dnl
21
AC_REVISION($Revision: 1.56 $)
Per Cederqvist's avatar
Per Cederqvist committed
22
AC_INIT(src/server/lyskomd.h)
David Byers's avatar
David Byers committed
23
AM_CONFIG_HEADER(config.h)
24
25
26
AC_CONFIG_AUX_DIR(scripts)
AM_INIT_AUTOMAKE(lyskom-server, 2.0.0.pcl.2)

27
28
29
30
31
32
33
34
35
36
AC_ARG_WITH([debug-calls],
        [  --with-debug-calls         compile debug protocol requests],
        [use_debug_calls=$withval],
        [use_debug_calls=no])

AC_ARG_WITH([efence],
        [  --with-efence              link with ElectricFence],
        [use_efence=$withval],
        [use_efence=no])

37
38
39
40
41
AC_ARG_WITH([checker],
        [  --with-checker             compile with Gnu Checker],
        [use_checker=$withval],
        [use_checker=no])

42
AC_ARG_WITH([purify],
43
	[  --with-purify              link with Purify],
44
45
	[use_purify=$withval],
	[use_purify=no])
46
47
48
49
50
51
52
53
54
55
56

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=""])

57
AC_PREFIX_DEFAULT(/usr/lyskom)
Per Cederqvist's avatar
Per Cederqvist committed
58
AC_PROG_CC
59
60
61
AC_AIX
AC_ISC_POSIX
AC_MINIX
62
63
AM_C_PROTOTYPES

64
[if test -n "$GCC"; then]
65
66
	dnl "-Wshadow" could be useful, but it gives too many false
	dnl warnings.
67
	[CFLAGS="$CFLAGS -Wall -W -Wtraditional -Wpointer-arith"]
68
69
	dnl AC_DEFINE(_GNU_SOURCE)
	CMOD_COMPILER_CC_ACCEPTS([-Wbad-function-cast])
70
71
72
73
74
	dnl
	dnl This gives too many false warnings, but it may be proper
	dnl to use this once in a while.
	dnl CMOD_COMPILER_CC_ACCEPTS([-Wcast-qual])
	dnl
75
76
77
78
79
80
81
	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]) [
82
fi]
83
84
85
86
87
AC_SUBST(PURIFY)
[if test "$use_purify" = "yes"
then
	PURIFY=purify
fi]
88

89
AC_SUBST(EFENCE)
90
91
92
[if test "$use_efence" = "yes"
then]
        AC_CHECK_LIB(efence,malloc)
93
        EFENCE=1
94
95
96
97
98
99
[fi]

AC_SUBST(DEBUG_CALLS)
[if test "$use_debug_calls" = "yes"
then]
        AC_DEFINE(DEBUG_CALLS)
100
        AC_CHECK_FUNCS(mallinfo)
101
102
[fi]

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]

115
116
# Do this test early since it may define _POSIX_SOURCE, which may
# affect future tests.
117
# FIXME: is this needed, now that we use AM_C_PROTOTYPES?
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
AC_MSG_CHECKING([if <signal.h> defines struct sigaction])
AC_CACHE_VAL([kom_cv_header_posix_source_needed],
	[# This default may be overridden below.
	kom_cv_header_posix_source_needed=no])
AC_CACHE_VAL([kom_cv_struct_sigaction],
AC_TRY_COMPILE([#include <signal.h>],
[struct sigaction foosig;],
[kom_cv_struct_sigaction=yes],
[kom_cv_struct_sigaction=no])
[if test $kom_cv_struct_sigaction = no ; then]
  AC_TRY_COMPILE(
  [#define _POSIX_SOURCE
  #include <signal.h>],
  [struct sigaction barsig;],
  [kom_cv_struct_sigaction=yes
  kom_cv_header_posix_source_needed=yes],
  [kom_cv_struct_sigaction=no])
[fi])
[if test $kom_cv_header_posix_source_needed = yes ; then]
  AC_MSG_RESULT([yes, but _POSIX_SOURCE was needed])
  AC_DEFINE(_POSIX_SOURCE)
[else]
  AC_MSG_RESULT($kom_cv_struct_sigaction)
[fi]
[if test $kom_cv_struct_sigaction = yes ; then]
  AC_DEFINE(HAVE_STRUCT_SIGACTION)
[fi]

Per Cederqvist's avatar
Per Cederqvist committed
146
AC_C_CONST
Per Cederqvist's avatar
Per Cederqvist committed
147
AC_C_INLINE
148
CMOD_C_ATTRIBUTE_UNUSED
Per Cederqvist's avatar
Per Cederqvist committed
149
AC_HEADER_STDC
Per Cederqvist's avatar
Per Cederqvist committed
150
AC_TYPE_PID_T
151
# FIXME: is this needed now that we use AM_C_PROTOTYPES?
Per Cederqvist's avatar
Per Cederqvist committed
152
153
154
AC_MSG_CHECKING([if _HPUX_SOURCE needs to be defined])
AC_CACHE_VAL([kom_cv_sys_hpux_source],
[AC_TRY_LINK(
155
[#include <sys/types.h>
Per Cederqvist's avatar
Per Cederqvist committed
156
157
158
159
160
#include <sys/socket.h>],
[struct sockaddr foo;],
[kom_cv_sys_hpux_source=no], dnl IF FOUND
[dnl IF NOT FOUND
AC_TRY_LINK(
Per Cederqvist's avatar
Per Cederqvist committed
161
[#define _HPUX_SOURCE
162
#include <sys/types.h>
Per Cederqvist's avatar
Per Cederqvist committed
163
164
165
166
167
168
169
170
#include <sys/socket.h>],
[struct sockaddr foo;],
[kom_cv_sys_hpux_source=yes],
[kom_cv_sys_hpux_source=no])])])
AC_MSG_RESULT($kom_cv_sys_hpux_source)
[if test $kom_cv_sys_hpux_source = yes ; then]
  AC_DEFINE(_HPUX_SOURCE)
[fi]
171
172
dnl
dnl
173
174
175
176
177
178
179
180
181
182
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, ...) 
__attribute__ ((format (printf, 1, 2)));],,
[kom_cv_c_attribute_format_printf=yes],
[kom_cv_c_attribute_format_printf=no])])
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]
Per Cederqvist's avatar
Per Cederqvist committed
183
184
185
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_AWK
Per Cederqvist's avatar
Per Cederqvist committed
186
AC_PROG_LN_S
Per Cederqvist's avatar
Per Cederqvist committed
187
AC_PROG_YACC
188
AM_PROG_LEX
189
190
AC_CHECK_PROGS(BISON, bison)
AC_CHECK_PROGS(FLEX, flex)
Per Cederqvist's avatar
Per Cederqvist committed
191
192
193
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)
194
AC_CHECK_HEADERS(crypt.h unistd.h)
195
AC_CHECK_HEADERS(values.h) dnl libmisc/pom.c
Per Cederqvist's avatar
Per Cederqvist committed
196
197
198
199
AC_HEADER_TIME
AC_FUNC_ALLOCA
AC_CHECK_LIB(resolv,main) dnl Host name lookup.
AC_CHECK_LIB(authuser,auth_tcpuser3) dnl User authentication according to RFC 931.
200
201
202
203
204
205
206
207
208
209
210
211
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]
Per Cederqvist's avatar
Per Cederqvist committed
212
AC_CHECK_LIB(i,setlocale) dnl For setlocale() on Ultrix.
213
AC_CHECK_LIB(crypt,crypt) dnl For crypt() on Sparc NetBSD 1.1
Per Cederqvist's avatar
Per Cederqvist committed
214
215
AC_CHECK_FUNCS(difftime getdtablesize sysconf strchr getcwd vfprintf)
AC_CHECK_FUNCS(setrlimit)
216
AC_REPLACE_FUNCS(memcpy strerror remove memset memchr memcmp setsid)
Per Cederqvist's avatar
Per Cederqvist committed
217
218
219
220
221
222
dnl
dnl I don't know how to test for buggy inet_ntoa functions
dnl programmatically, but the supplied substitute should always work,
dnl so we define BUGGY_INET_NTOA unconditionally.
AC_DEFINE(BUGGY_INET_NTOA)
dnl
223
dnl Unencrypted passwords are no longer supported.
Per Cederqvist's avatar
Per Cederqvist committed
224
225
226
227
228
229
230
AC_DEFINE(ENCRYPT_PASSWORDS)
dnl
dnl Once upon a time, the server shared some code with the tty-client.
dnl Because of that, you still have to define SERVER while compiling
dnl some of the files in this package.  Nowadays sharing is done by copying.
AC_DEFINE(SERVER)
dnl
231
232
dnl Tests for GNU getopt (used in dbck)
AC_CHECK_HEADERS(alloca.h)
233
234
235
236
237
238
239
240
241
242
243
dnl
dnl Check for use of Gnu checker
dnl

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

244
dnl
245
246
247
248
249
250
251
dnl
dnl Force the configure script in isc to behave as if the
dnl --enable-isc-printf switch was given to it.
dnl
[enable_isc_printf=yes
export enable_isc_printf]
dnl
252
AC_CONFIG_SUBDIRS(src/libraries/libisc-new)
Per Cederqvist's avatar
Per Cederqvist committed
253
AC_OUTPUT(Makefile
254
db-crypt/Makefile
255
db-crypt/db/Makefile
Per Cederqvist's avatar
Per Cederqvist committed
256
257
258
259
260
261
262
263
264
265
266
doc/Makefile
doc/man/Makefile
scripts/Makefile
src/Makefile
src/include/Makefile
src/include/server/Makefile
src/libraries/Makefile
src/libraries/libansi/Makefile
src/libraries/libcommon/Makefile
src/libraries/libmisc/Makefile
src/libraries/regex/Makefile
267
268
src/libraries/regex/doc/Makefile
src/libraries/regex/test/Makefile
269
src/server/Makefile
270
src/server/testsuite/Makefile
271
src/server/testsuite/config/Makefile
272
run-support/Makefile)