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