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