]> arthur.barton.de Git - ngircd-alex.git/blob - configure.in
- ChangeLog aktualisiert.
[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 # Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
6 # der GNU General Public License (GPL), wie von der Free Software Foundation
7 # herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
8 # der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
9 # Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
10 # der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
11 #
12 # $Id: configure.in,v 1.35 2002/03/10 17:03:18 alex Exp $
13 #
14 # $Log: configure.in,v $
15 # Revision 1.35  2002/03/10 17:03:18  alex
16 # - es werden nun die Konstanten SYSCONFDIR und LOCALSTATEDIR definiert.
17 #
18 # Revision 1.34  2002/03/10 15:40:26  alex
19 # - Anpassungen an neues GNU automake/autoconf: acconfig.h entfaellt nun.
20 #
21 # Revision 1.33  2002/03/02 03:57:56  alex
22 # - Versionsnummer auf 0.3.0-CVS angehoben.
23 #
24 # Revision 1.32  2002/03/02 03:36:14  alex
25 # - Version 0.3.0
26 #
27 # Revision 1.31  2002/02/25 11:45:28  alex
28 # - es wird auf sigaction() geprueft (u.a. fuer A/UX, welches das nicht kennt).
29 #
30 # Revision 1.30  2002/02/25 11:41:43  alex
31 # - es werden ein paar Funktionen mehr getestet: u.a. vsnprintf() und setsockopt().
32 # - libUTIL wird eingebunden, so vorhanden (unter A/UX notwendig!)
33 #
34 # Revision 1.29  2002/02/19 02:11:26  alex
35 # - auf die "libbe" wird nur noch getestet, wenn syslog ueberhaupt verwendet wird.
36 #
37 # Revision 1.28  2002/02/17 22:17:33  alex
38 # - Versionsnummer im CVS auf 0.2.2-pre angehoben ...
39 #
40 # Revision 1.27  2002/02/17 21:50:38  alex
41 # - Version 0.2.1.
42 #
43 # Revision 1.26  2002/02/17 18:47:26  alex
44 # - Tests auf netdb.h, stdlib.h, sys/wait.h, gethostbyaddr, gethostbyname,
45 #   strftime und die "libbe" unter BeOS (fuer syslog) ergaenzt.
46 #
47 # Revision 1.25  2002/02/15 14:57:21  alex
48 # - Version auf 0.2.1-pre im CVS angehoben ...
49 #
50 # Revision 1.24  2002/02/15 14:35:55  alex
51 # - Version 0.2.0
52 #
53 # Revision 1.23  2002/01/29 01:07:15  alex
54 # - Version auf 0.1.1-pre im CVS angehoben.
55 #
56 # Revision 1.22  2002/01/29 00:24:17  alex
57 # - Version 0.1.0
58 #
59 # Revision 1.21  2002/01/16 23:06:16  alex
60 # - Version auf 0.0.4-pre im CVS angehoben.
61 #
62 # Revision 1.20  2002/01/16 22:55:45  alex
63 # - Version 0.0.3
64 #
65 # Revision 1.19  2002/01/06 16:21:09  alex
66 # - CVS-Version auf "0.0.3-pre" angehoben.
67 #
68 # Revision 1.18  2002/01/06 16:09:37  alex
69 # - Version 0.0.2
70 #
71 # Revision 1.17  2002/01/05 15:53:20  alex
72 # - Test auf Header "arpa/inet.h" und Funktion inet_aton() hinzugefuegt (BeOS).
73 #
74 # Revision 1.16  2002/01/02 13:41:36  alex
75 # - CFLAGS wird nur noch gesetzt, wenn der GCC verwendet wird.
76 #
77 # Revision 1.15  2002/01/02 02:52:09  alex
78 # - Copyright-Texte angepasst ;-)
79 #
80 # Revision 1.14  2001/12/31 16:11:13  alex
81 # - CVS-Version auf "0.0.2-pre" angehoben.
82 #
83 # Revision 1.13  2001/12/31 16:02:30  alex
84 # - Version 0.0.1
85 #
86 # Revision 1.12  2001/12/31 02:21:00  alex
87 # - "doc"-Unterverzeichnis aufgenommen.
88 #
89 # Revision 1.11  2001/12/29 03:04:06  alex
90 # - neue configure-Option "--enable-strict-rfc".
91 #
92 # Revision 1.10  2001/12/27 16:25:36  alex
93 # - neue configure-Option "--with-portab=DIR".
94 #
95 # Revision 1.9  2001/12/27 02:08:38  alex
96 # - da fehlte an zwei Stellen ein AC_MSG_ERROR ... ups!
97 #
98 # Revision 1.8  2001/12/27 01:44:49  alex
99 # - die Verwendung von syslog kann nun abgeschaltet werden.
100 #
101 # Revision 1.7  2001/12/27 00:37:07  alex
102 # - Erkennung der "portab header" geaendert, CFLAGS werden nun anders gesetzt.
103 #
104 # Revision 1.6  2001/12/25 22:01:47  alex
105 # - neue configure-Option "--enable-sniffer".
106 #
107 # Revision 1.5  2001/12/21 23:54:26  alex
108 # - zusaetzliche Debug-Ausgaben koennen eingeschaltet werden.
109 #
110 # Revision 1.4  2001/12/12 17:21:58  alex
111 # - Projektdatei fuer den Mac OS X Project Builder erstellt.
112 #
113 # Revision 1.3  2001/12/12 01:58:53  alex
114 # - Test auf socklen_t verbessert.
115 #
116 # Revision 1.2  2001/12/11 22:04:21  alex
117 # - Test auf stdint.h (HAVE_STDINT_H) hinzugefuegt.
118 #
119 # Revision 1.1.1.1  2001/12/11 21:53:04  alex
120 # Imported sources to CVS.
121 #
122
123 # -- Initialisierung --
124
125 AC_INIT
126 AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
127 AM_INIT_AUTOMAKE(ngircd,0.3.0-CVS)
128 AM_CONFIG_HEADER(src/config.h)
129
130 # -- Templates fuer config.h --
131
132 AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
133 AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
134 AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
135 AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
136 AH_TEMPLATE([USE_SYSLOG], [Define if syslog should be used for logging])
137
138 # -- C Compiler --
139
140 AC_PROG_CC
141 AC_LANG_C
142
143 # -- Hilfsprogramme --
144
145 AC_PROG_AWK
146 AC_PROG_INSTALL
147 AC_PROG_LN_S
148 AC_PROG_MAKE_SET
149 AC_PROG_RANLIB
150
151 # -- Header --
152
153 AC_HEADER_STDC
154
155 AC_HEADER_TIME
156
157 AC_ARG_WITH(portab,
158         [  --with-portab=DIR       search the "portab headers" in DIR],
159         [       if test "x$withval" != "xno"; then
160                         CFLAGS="$CFLAGS -I${withval}"
161                         if test -f ${withval}/portab.h; then
162                                 AC_MSG_RESULT([searching "portab headers" in ${withval}...])
163                         else
164                                 AC_MSG_ERROR([${withval}/portab.h not found!])
165                         fi
166                 else
167                         AC_MSG_ERROR([Can't disable Alex \"portability headers\"!])
168                 fi
169         ],
170         [       AC_CHECK_HEADER(portab.h,[
171                         AC_CHECK_HEADER(imp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
172                         AC_CHECK_HEADER(exp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
173                 ],[
174                         AC_CHECK_HEADER(/usr/local/include/portab.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
175                         AC_CHECK_HEADER(/usr/local/include/imp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
176                         AC_CHECK_HEADER(/usr/local/include/exp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
177                         CFLAGS="$CFLAGS -I/usr/local/include"
178                 ])
179         ]
180 )
181
182 AC_CHECK_HEADERS(arpa/inet.h)
183
184 AC_CHECK_HEADERS([ \
185         errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
186         sys/socket.h sys/time.h sys/wait.h unistd.h \
187         ],,AC_MSG_ERROR([required C header missing!]))
188
189 # -- Datentypen --
190
191 AC_MSG_CHECKING(whether socklen_t exists)
192 AC_TRY_COMPILE([
193         #include <sys/socket.h>
194         #include <sys/types.h>
195         ],[
196         socklen_t a, b;
197         a = 2; b = 4; a += b;
198         ],[
199         AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
200         ],[
201         AC_MSG_RESULT(no)
202 ])
203
204 # -- Libraries --
205
206 AC_CHECK_LIB(UTIL,memmove)
207
208 # -- Funktionen --
209
210 AC_FUNC_MALLOC
211
212 AC_CHECK_FUNCS([ \
213         bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
214         memset select setsockopt socket strcasecmp strchr strerror strftime \
215         strstr vsnprintf waitpid \
216         ],,AC_MSG_ERROR([required function missing!]))
217
218 AC_CHECK_FUNCS(inet_aton)
219
220 AC_CHECK_FUNCS(sigaction)
221
222 # -- Konfigurationsoptionen --
223
224 AC_ARG_ENABLE(syslog,
225         [  --disable-syslog        disable syslog (autodetected by default)],
226         [       if test "$enableval" = "yes"; then
227                         AC_CHECK_HEADER(syslog.h,
228                                 [       AC_DEFINE(USE_SYSLOG, 1)
229                                         AC_CHECK_LIB(be,syslog)
230                                 ],
231                                 AC_MSG_ERROR([Can't enable syslog: syslog.h not found!])
232                         )
233                 else
234                         AC_MSG_RESULT([disabling syslog])
235                 fi
236         ],
237         [       AC_CHECK_HEADER(syslog.h,
238                         [       AC_DEFINE(USE_SYSLOG, 1)
239                                 AC_CHECK_LIB(be,syslog)
240                         ]
241                 )
242         ]
243 )
244
245 AC_ARG_ENABLE(strict-rfc,
246         [  --enable-strict-rfc     strict RFC conformance, may break clients],
247         if test "$enableval" = "yes"; then
248                 AC_DEFINE(STRICT_RFC, 1)
249                 AC_MSG_RESULT([enabling strict RFC conformance])
250         fi
251 )
252
253 AC_ARG_ENABLE(sniffer,
254         [  --enable-sniffer        enable network traffic monitor (enables debug mode!)],
255         if test "$enableval" = "yes"; then
256                 AC_DEFINE(SNIFFER, 1)
257                 AC_MSG_RESULT([enabling network traffic monitor])
258                 x_debug_on=yes
259         fi
260 )
261
262 AC_ARG_ENABLE(debug,
263         [  --enable-debug          show additional debug output],
264         if test "$enableval" = "yes"; then x_debug_on=yes; fi
265 )
266 if test "$x_debug_on" = "yes"; then
267         AC_DEFINE(DEBUG, 1)
268         AC_MSG_RESULT([enabling additional debug output])
269 fi
270
271 # -- Variablen II --
272
273 if test "$GCC" = "yes"; then
274         CFLAGS="-Wall $CFLAGS"
275 fi
276
277 CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
278 CFLAGS="$CFLAGS -DLOCALSTATEDIR='\"\$(localstatedir)\"'"
279
280 # -- Ausgabe --
281
282 AC_OUTPUT([ \
283         Makefile \
284         doc/Makefile \
285         MacOSX/Makefile \
286         MacOSX/ngircd.pbproj/Makefile \
287         src/Makefile \
288         src/ngircd/Makefile \
289 ])
290
291 # -eof-