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