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