]> arthur.barton.de Git - ngircd-alex.git/blob - configure.in
- IRC+-Protokoll ist nun abschaltbar; Versionsstring 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.55 2002/09/04 22:11:34 alex Exp $
13 #
14
15 # -- Initialisierung --
16
17 AC_INIT
18 AC_PREREQ(2.50)
19 AC_CANONICAL_TARGET
20 AC_CONFIG_SRCDIR(src/config.h.in)
21 AM_INIT_AUTOMAKE(ngircd,CurrentCVS)
22 AM_CONFIG_HEADER(src/config.h)
23
24 # -- Templates fuer config.h --
25
26 AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
27 AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
28 AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
29 AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
30 AH_TEMPLATE([USE_SYSLOG], [Define if syslog should be used for logging])
31
32 AH_TEMPLATE([TARGET_OS], [Target operating system name])
33 AH_TEMPLATE([TARGET_VENDOR], [Target system vendor])
34 AH_TEMPLATE([TARGET_CPU], [Target CPU name])
35
36 # -- C Compiler --
37
38 AC_PROG_CC
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 # -- Compiler Features --
49
50 AC_LANG_C
51
52 AM_C_PROTOTYPES
53 AC_C_CONST
54
55 # -- Header --
56
57 AC_HEADER_STDC
58
59 AC_HEADER_TIME
60
61 AC_HEADER_SYS_WAIT
62
63 AC_CHECK_HEADERS([ \
64         ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
65         strings.h sys/socket.h sys/time.h unistd.h \
66         ],,AC_MSG_ERROR([required C header missing!]))
67
68 AC_CHECK_HEADERS(arpa/inet.h malloc.h stdint.h varargs.h)
69
70 # -- Datentypen --
71
72 AC_MSG_CHECKING(whether socklen_t exists)
73 AC_TRY_COMPILE([
74         #include <sys/socket.h>
75         #include <sys/types.h>
76         ],[
77         socklen_t a, b;
78         a = 2; b = 4; a += b;
79         ],[
80         AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
81         ],[
82         AC_MSG_RESULT(no)
83 ])
84
85 AC_TYPE_SIGNAL
86
87 AC_TYPE_SIZE_T
88
89 # -- Libraries --
90
91 AC_CHECK_LIB(UTIL,memmove)
92 AC_CHECK_LIB(socket,bind)
93 AC_CHECK_LIB(nsl,gethostent)
94
95 # -- Funktionen --
96
97 AC_FUNC_MALLOC
98
99 AC_FUNC_FORK
100
101 AC_FUNC_STRFTIME
102
103 AC_CHECK_FUNCS([ \
104         bind gethostbyaddr gethostbyname gethostname inet_ntoa memmove \
105         memset select setsockopt socket strcasecmp strchr strerror \
106         strstr waitpid \
107         ],,AC_MSG_ERROR([required function missing!]))
108
109 AC_CHECK_FUNCS(inet_aton sigaction snprintf vsnprintf)
110
111 # -- Konfigurationsoptionen --
112
113 AC_ARG_ENABLE(syslog,
114         [  --disable-syslog        disable syslog (autodetected by default)],
115         [       if test "$enableval" = "yes"; then
116                         AC_CHECK_HEADER(syslog.h,
117                                 [       AC_DEFINE(USE_SYSLOG, 1)
118                                         AC_CHECK_LIB(be,syslog)
119                                 ],
120                                 AC_MSG_ERROR([Can't enable syslog: syslog.h not found!])
121                         )
122                 else
123                         AC_MSG_RESULT([disabling syslog])
124                 fi
125         ],
126         [       AC_CHECK_HEADER(syslog.h,
127                         [       AC_DEFINE(USE_SYSLOG, 1)
128                                 AC_CHECK_LIB(be,syslog)
129                         ]
130                 )
131         ]
132 )
133
134 AC_ARG_ENABLE(strict-rfc,
135         [  --enable-strict-rfc     strict RFC conformance, may break clients],
136         if test "$enableval" = "yes"; then
137                 AC_DEFINE(STRICT_RFC, 1)
138                 AC_MSG_RESULT([enabling strict RFC conformance])
139         fi
140 )
141
142 AC_ARG_ENABLE(sniffer,
143         [  --enable-sniffer        enable network traffic monitor (enables debug mode!)],
144         if test "$enableval" = "yes"; then
145                 AC_DEFINE(SNIFFER, 1)
146                 AC_MSG_RESULT([enabling network traffic monitor])
147                 x_debug_on=yes
148         fi
149 )
150
151 AC_ARG_ENABLE(debug,
152         [  --enable-debug          show additional debug output],
153         if test "$enableval" = "yes"; then x_debug_on=yes; fi
154 )
155 if test "$x_debug_on" = "yes"; then
156         AC_DEFINE(DEBUG, 1)
157         AC_MSG_RESULT([enabling additional debug output])
158 fi
159
160 # -- Definitionen --
161
162 AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
163 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
164 AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
165
166 if test `uname` = "A/UX"; then
167         # unter A/UX sollte _POSIX_SOURCE definiert sein.
168         AC_MSG_RESULT([detected A/UX, defining _POSIX_SOURCE])
169         CFLAGS="$CFLAGS -D_POSIX_SOURCE"
170 fi
171
172 # -- Variablen --
173
174 if test "$GCC" = "yes"; then
175         CFLAGS="-Wall $CFLAGS"
176 fi
177
178 CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'"
179
180 # -- Ausgabe --
181
182 AC_OUTPUT([ \
183         Makefile \
184         doc/Makefile \
185         doc/en/Makefile \
186         MacOSX/Makefile \
187         MacOSX/ngircd.pbproj/Makefile \
188         src/Makefile \
189         src/portab/Makefile \
190         src/ngircd/Makefile \
191         man/Makefile \
192 ])
193
194 # -eof-