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