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