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