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