]> arthur.barton.de Git - ngircd-alex.git/blob - configure.in
948663ddf2edc322ac945e0656c9b6d6e7bfad44
[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.42 2002/03/31 20:55:07 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,CurrentCVS)
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 AH_TEMPLATE([TARGET_OS], [Target operating system name])
32 AH_TEMPLATE([TARGET_VENDOR], [Target system vendor])
33 AH_TEMPLATE([TARGET_CPU], [Target CPU name])
34
35 # -- C Compiler --
36
37 AC_PROG_CC
38 AC_LANG_C
39
40 # -- Hilfsprogramme --
41
42 AC_PROG_AWK
43 AC_PROG_INSTALL
44 AC_PROG_LN_S
45 AC_PROG_MAKE_SET
46 AC_PROG_RANLIB
47
48 AC_CHECK_PROGS([NROFF], [groff nroff])
49
50 # -- Header --
51
52 AC_HEADER_STDC
53
54 AC_HEADER_TIME
55
56 AC_CHECK_HEADERS(arpa/inet.h)
57
58 AC_CHECK_HEADERS([ \
59         errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
60         sys/socket.h sys/time.h sys/wait.h unistd.h \
61         ],,AC_MSG_ERROR([required C header missing!]))
62
63 # -- Datentypen --
64
65 AC_MSG_CHECKING(whether socklen_t exists)
66 AC_TRY_COMPILE([
67         #include <sys/socket.h>
68         #include <sys/types.h>
69         ],[
70         socklen_t a, b;
71         a = 2; b = 4; a += b;
72         ],[
73         AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
74         ],[
75         AC_MSG_RESULT(no)
76 ])
77
78 # -- Libraries --
79
80 AC_CHECK_LIB(UTIL,memmove)
81
82 # -- Funktionen --
83
84 AC_FUNC_MALLOC
85
86 AC_CHECK_FUNCS([ \
87         bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
88         memset select setsockopt socket strcasecmp strchr strerror strftime \
89         strstr vsnprintf waitpid \
90         ],,AC_MSG_ERROR([required function missing!]))
91
92 AC_CHECK_FUNCS(inet_aton)
93
94 AC_CHECK_FUNCS(sigaction)
95
96 # -- Konfigurationsoptionen --
97
98 AC_ARG_ENABLE(syslog,
99         [  --disable-syslog        disable syslog (autodetected by default)],
100         [       if test "$enableval" = "yes"; then
101                         AC_CHECK_HEADER(syslog.h,
102                                 [       AC_DEFINE(USE_SYSLOG, 1)
103                                         AC_CHECK_LIB(be,syslog)
104                                 ],
105                                 AC_MSG_ERROR([Can't enable syslog: syslog.h not found!])
106                         )
107                 else
108                         AC_MSG_RESULT([disabling syslog])
109                 fi
110         ],
111         [       AC_CHECK_HEADER(syslog.h,
112                         [       AC_DEFINE(USE_SYSLOG, 1)
113                                 AC_CHECK_LIB(be,syslog)
114                         ]
115                 )
116         ]
117 )
118
119 AC_ARG_ENABLE(strict-rfc,
120         [  --enable-strict-rfc     strict RFC conformance, may break clients],
121         if test "$enableval" = "yes"; then
122                 AC_DEFINE(STRICT_RFC, 1)
123                 AC_MSG_RESULT([enabling strict RFC conformance])
124         fi
125 )
126
127 AC_ARG_ENABLE(sniffer,
128         [  --enable-sniffer        enable network traffic monitor (enables debug mode!)],
129         if test "$enableval" = "yes"; then
130                 AC_DEFINE(SNIFFER, 1)
131                 AC_MSG_RESULT([enabling network traffic monitor])
132                 x_debug_on=yes
133         fi
134 )
135
136 AC_ARG_ENABLE(debug,
137         [  --enable-debug          show additional debug output],
138         if test "$enableval" = "yes"; then x_debug_on=yes; fi
139 )
140 if test "$x_debug_on" = "yes"; then
141         AC_DEFINE(DEBUG, 1)
142         AC_MSG_RESULT([enabling additional debug output])
143 fi
144
145 # -- Definitionen --
146
147 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
148 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
149 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
150
151 # -- Variablen --
152
153 if test "$GCC" = "yes"; then
154         CFLAGS="-Wall $CFLAGS"
155 fi
156
157 CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
158
159 if test `uname` = "A/UX"; then
160         # unter A/UX sollte _POSIX_SOURCE definiert sein.
161         AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
162         CFLAGS="$CFLAGS -D_POSIX_SOURCE"
163 fi
164
165 # -- Ausgabe --
166
167 AC_OUTPUT([ \
168         Makefile \
169         doc/Makefile \
170         MacOSX/Makefile \
171         MacOSX/ngircd.pbproj/Makefile \
172         src/Makefile \
173         src/portab/Makefile \
174         src/ngircd/Makefile \
175         man/Makefile \
176 ])
177
178 # -eof-