]> arthur.barton.de Git - ngircd-alex.git/blob - configure.in
Updated documentation.
[ngircd-alex.git] / configure.in
1 #
2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 # Please read the file COPYING, README and AUTHORS for more information.
10 #
11 # $Id: configure.in,v 1.78 2003/01/13 12:20:16 alex Exp $
12 #
13
14 # -- Initialisierung --
15
16 AC_INIT(ngircd, CVSHEAD)
17 AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
18 AC_CANONICAL_TARGET
19 AM_INIT_AUTOMAKE
20 AM_CONFIG_HEADER(src/config.h)
21
22 # -- Templates fuer config.h --
23
24 AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
25 AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
26 AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
27 AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
28 AH_TEMPLATE([USE_SYSLOG], [Define if syslog should be used for logging])
29 AH_TEMPLATE([USE_ZLIB], [Define if zlib compression should be enabled])
30 AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
31
32 AH_TEMPLATE([TARGET_OS], [Target operating system name])
33 AH_TEMPLATE([TARGET_VENDOR], [Target system vendor])
34 AH_TEMPLATE([TARGET_CPU], [Target CPU name])
35
36 # -- C Compiler --
37
38 AC_PROG_CC
39
40 # -- Hilfsprogramme --
41
42 AC_PROG_AWK
43 AC_PROG_INSTALL
44 AC_PROG_LN_S
45 AC_PROG_MAKE_SET
46 AC_PROG_RANLIB
47
48 # -- Compiler Features --
49
50 AC_LANG_C
51
52 AM_C_PROTOTYPES
53 AC_C_CONST
54
55 # -- Defines --
56
57 if test `uname` = "A/UX"; then
58         # unter A/UX sollte _POSIX_SOURCE definiert sein.
59         AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
60         CFLAGS="$CFLAGS -D_POSIX_SOURCE"
61 fi
62
63 if test `uname` = "HP-UX"; then
64         # unter HP-UX 11.11 muss _XOPEN_SOURCE_EXTENDED definiert sein.
65         AC_MSG_RESULT([detected HP-UX, defining _XOPEN_SOURCE_EXTENDED])
66         CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
67 fi
68
69 # -- Header --
70
71 AC_HEADER_STDC
72
73 AC_HEADER_TIME
74
75 AC_HEADER_SYS_WAIT
76
77 AC_CHECK_HEADERS([ \
78         ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
79         strings.h sys/socket.h sys/time.h unistd.h \
80         ],,AC_MSG_ERROR([required C header missing!]))
81
82 AC_CHECK_HEADERS([arpa/inet.h ctype.h malloc.h stdint.h varargs.h])
83
84 # -- Datentypen --
85
86 AC_MSG_CHECKING(whether socklen_t exists)
87 AC_TRY_COMPILE([
88         #include <sys/socket.h>
89         #include <sys/types.h>
90         ],[
91         socklen_t a, b;
92         a = 2; b = 4; a += b;
93         ],[
94         AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
95         ],[
96         AC_MSG_RESULT(no)
97 ])
98
99 AC_TYPE_SIGNAL
100
101 AC_TYPE_SIZE_T
102
103 # -- Libraries --
104
105 AC_CHECK_LIB(UTIL,memmove)
106 AC_CHECK_LIB(socket,bind)
107 AC_CHECK_LIB(nsl,gethostent)
108
109 # -- Funktionen --
110
111 AC_FUNC_MALLOC
112
113 AC_FUNC_FORK
114
115 AC_FUNC_STRFTIME
116
117 AC_CHECK_FUNCS([ \
118         bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
119         memset setsockopt socket strcasecmp strchr strerror strstr waitpid \
120         ],,AC_MSG_ERROR([required function missing!]))
121
122 AC_CHECK_FUNCS(inet_aton isdigit sigaction snprintf vsnprintf strlcpy strlcat)
123
124 AC_CHECK_FUNCS(poll,[AC_CHECK_HEADER(sys/poll.h)],
125         [AC_CHECK_FUNCS(select,[AC_CHECK_HEADER(sys/select.h)],
126                 AC_MSG_ERROR([neither poll() nor select() is available!]))
127         ]
128 )
129
130 # -- Konfigurationsoptionen --
131
132 x_syslog_on=no
133 AC_ARG_ENABLE(syslog,
134         [  --disable-syslog        disable syslog (autodetected by default)],
135         [       if test "$enableval" = "yes"; then
136                         AC_CHECK_HEADER(syslog.h, x_syslog_on=yes,
137                                 AC_MSG_ERROR([Can't enable syslog: syslog.h not found!])
138                         )
139                 fi
140         ],
141         [       AC_CHECK_HEADER(syslog.h, x_syslog_on=yes) ]
142 )
143 if test "$x_syslog_on" = "yes"; then
144         AC_DEFINE(USE_SYSLOG, 1)
145         AC_CHECK_LIB(be,syslog)
146 fi
147
148 x_zlib_on=no
149 AC_ARG_ENABLE(zlib,
150         [  --disable-zlib          disable zlib compression (autodetected by default)],
151         [       if test "$enableval" = "yes"; then
152                         AC_CHECK_HEADER(zlib.h, x_zlib_on=yes,
153                                 AC_MSG_ERROR([Can't enable zlib: zlib.h not found!])
154                         )
155                 fi
156         ],
157         [       AC_CHECK_HEADER(zlib.h, x_zlib_on=yes) ]
158 )
159 if test "$x_zlib_on" = "yes"; then
160         AC_DEFINE(USE_ZLIB, 1)
161         AC_CHECK_LIB(z,deflate)
162 fi
163
164 x_ircplus_on=yes
165 AC_ARG_ENABLE(ircplus,
166         [  --disable-ircplus       disable IRC+ protocol],
167         if test "$enableval" = "no"; then x_ircplus_on=no; fi
168 )
169 if test "$x_ircplus_on" = "yes"; then
170         AC_DEFINE(IRCPLUS, 1)
171 fi
172
173 AC_ARG_ENABLE(sniffer,
174         [  --enable-sniffer        enable IRC traffic sniffer (enables debug mode)],
175         if test "$enableval" = "yes"; then
176                 AC_DEFINE(SNIFFER, 1)
177                 x_sniffer_on=yes; x_debug_on=yes
178         fi
179 )
180
181 AC_ARG_ENABLE(debug,
182         [  --enable-debug          show additional debug output],
183         if test "$enableval" = "yes"; then x_debug_on=yes; fi
184 )
185 if test "$x_debug_on" = "yes"; then
186         AC_DEFINE(DEBUG, 1)
187 fi
188
189 AC_ARG_ENABLE(strict-rfc,
190         [  --enable-strict-rfc     strict RFC conformance -- may break clients!],
191         if test "$enableval" = "yes"; then
192                 AC_DEFINE(STRICT_RFC, 1)
193                 x_strict_rfc_on=yes
194         fi
195 )
196
197
198 # -- Definitionen --
199
200 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
201 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
202 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
203
204 # -- Variablen --
205
206 if test "$GCC" = "yes"; then
207         the_CFLAGS="-Wall -Wtraditional -Wpointer-arith -Wstrict-prototypes"
208         add_CFLAGS="$CFLAGS $CFLAGS_ADD"
209 else
210         the_CFLAGS="$CFLAGS"
211         add_CFLAGS="$CFLAGS_ADD"
212 fi
213
214 CFLAGS="$the_CFLAGS $add_CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
215
216 # -- Ausgabe der Dateien --
217
218 AC_OUTPUT([ \
219         Makefile \
220         doc/Makefile \
221         doc/de/Makefile \
222         MacOSX/Makefile \
223         MacOSX/ngircd.pbproj/Makefile \
224         src/Makefile \
225         src/portab/Makefile \
226         src/tool/Makefile \
227         src/ngircd/Makefile \
228         src/testsuite/Makefile \
229         man/Makefile \
230         contrib/Makefile \
231 ])
232
233 # -- Ergebnis --
234
235 echo
236
237 # Someone please show me a better way :)  [borrowed by OpenSSH]
238 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
239 S=`eval echo ${sbindir}` ; S=`eval echo ${S}`
240 C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
241 M=`eval echo ${mandir}` ; M=`eval echo ${M}`
242
243 echo "                host: ${host}"
244 echo "            compiler: ${CC}"
245 echo "      compiler flags: ${the_CFLAGS}"
246 test -n "$add_CFLAGS" && echo "                      ${add_CFLAGS}"
247 echo "  preprocessor flags: ${CPPFLAGS}"
248 echo "        linker flags: ${LDFLAGS}"
249 echo "           libraries: ${LIBS}"
250 echo
251 echo "     'ngircd' binary: $S"
252 echo "  configuration file: $C"
253 echo "        manual pages: $M"
254 echo
255
256 echo $ECHO_N "      active options: $ECHO_C"
257 test "$x_syslog_on" = "yes"     && echo $ECHO_N "Syslog $ECHO_C"
258 test "$x_zlib_on" = "yes"       && echo $ECHO_N "zLib $ECHO_C"
259 test "$x_debug_on" = "yes"      && echo $ECHO_N "Debug $ECHO_C"
260 test "$x_sniffer_on" = "yes"    && echo $ECHO_N "Sniffer $ECHO_C"
261 test "$x_strict_rfc_on" = "yes" && echo $ECHO_N "Strict-RFC $ECHO_C"
262 test "$x_ircplus_on" = "yes"    && echo $ECHO_N "IRC+ $ECHO_C"
263 echo; echo
264
265 # -eof-