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