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