]> arthur.barton.de Git - ngircd-alex.git/blob - configure.in
- externe portab-Header werden nicht mehr benoetigt/benutzt, dadurch
[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.36 2002/03/12 14:37:51 alex Exp $
13 #
14
15 # -- Initialisierung --
16
17 AC_INIT
18 AC_CANONICAL_TARGET
19 AC_CONFIG_SRCDIR(src/config.h.in)
20 AM_INIT_AUTOMAKE(ngircd,0.3.0-CVS)
21 AM_CONFIG_HEADER(src/config.h)
22
23 # -- Templates fuer config.h --
24
25 AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
26 AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
27 AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
28 AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
29 AH_TEMPLATE([USE_SYSLOG], [Define if syslog should be used for logging])
30
31 # -- C Compiler --
32
33 AC_PROG_CC
34 AC_LANG_C
35
36 # -- Hilfsprogramme --
37
38 AC_PROG_AWK
39 AC_PROG_INSTALL
40 AC_PROG_LN_S
41 AC_PROG_MAKE_SET
42 AC_PROG_RANLIB
43
44 # -- Header --
45
46 AC_HEADER_STDC
47
48 AC_HEADER_TIME
49
50 AC_CHECK_HEADERS(arpa/inet.h)
51
52 AC_CHECK_HEADERS([ \
53         errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
54         sys/socket.h sys/time.h sys/wait.h unistd.h \
55         ],,AC_MSG_ERROR([required C header missing!]))
56
57 # -- Datentypen --
58
59 AC_MSG_CHECKING(whether socklen_t exists)
60 AC_TRY_COMPILE([
61         #include <sys/socket.h>
62         #include <sys/types.h>
63         ],[
64         socklen_t a, b;
65         a = 2; b = 4; a += b;
66         ],[
67         AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
68         ],[
69         AC_MSG_RESULT(no)
70 ])
71
72 # -- Libraries --
73
74 AC_CHECK_LIB(UTIL,memmove)
75
76 # -- Funktionen --
77
78 AC_FUNC_MALLOC
79
80 AC_CHECK_FUNCS([ \
81         bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
82         memset select setsockopt socket strcasecmp strchr strerror strftime \
83         strstr vsnprintf waitpid \
84         ],,AC_MSG_ERROR([required function missing!]))
85
86 AC_CHECK_FUNCS(inet_aton)
87
88 AC_CHECK_FUNCS(sigaction)
89
90 # -- Konfigurationsoptionen --
91
92 AC_ARG_ENABLE(syslog,
93         [  --disable-syslog        disable syslog (autodetected by default)],
94         [       if test "$enableval" = "yes"; then
95                         AC_CHECK_HEADER(syslog.h,
96                                 [       AC_DEFINE(USE_SYSLOG, 1)
97                                         AC_CHECK_LIB(be,syslog)
98                                 ],
99                                 AC_MSG_ERROR([Can't enable syslog: syslog.h not found!])
100                         )
101                 else
102                         AC_MSG_RESULT([disabling syslog])
103                 fi
104         ],
105         [       AC_CHECK_HEADER(syslog.h,
106                         [       AC_DEFINE(USE_SYSLOG, 1)
107                                 AC_CHECK_LIB(be,syslog)
108                         ]
109                 )
110         ]
111 )
112
113 AC_ARG_ENABLE(strict-rfc,
114         [  --enable-strict-rfc     strict RFC conformance, may break clients],
115         if test "$enableval" = "yes"; then
116                 AC_DEFINE(STRICT_RFC, 1)
117                 AC_MSG_RESULT([enabling strict RFC conformance])
118         fi
119 )
120
121 AC_ARG_ENABLE(sniffer,
122         [  --enable-sniffer        enable network traffic monitor (enables debug mode!)],
123         if test "$enableval" = "yes"; then
124                 AC_DEFINE(SNIFFER, 1)
125                 AC_MSG_RESULT([enabling network traffic monitor])
126                 x_debug_on=yes
127         fi
128 )
129
130 AC_ARG_ENABLE(debug,
131         [  --enable-debug          show additional debug output],
132         if test "$enableval" = "yes"; then x_debug_on=yes; fi
133 )
134 if test "$x_debug_on" = "yes"; then
135         AC_DEFINE(DEBUG, 1)
136         AC_MSG_RESULT([enabling additional debug output])
137 fi
138
139 # -- Variablen II --
140
141 if test "$GCC" = "yes"; then
142         CFLAGS="-Wall $CFLAGS"
143 fi
144
145 CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
146 CFLAGS="$CFLAGS -DLOCALSTATEDIR='\"\$(localstatedir)\"'"
147
148 # -- Ausgabe --
149
150 AC_OUTPUT([ \
151         Makefile \
152         doc/Makefile \
153         MacOSX/Makefile \
154         MacOSX/ngircd.pbproj/Makefile \
155         src/Makefile \
156         src/portab/Makefile \
157         src/ngircd/Makefile \
158 ])
159
160 # -eof-