]> arthur.barton.de Git - ngircd-alex.git/blob - configure.in
- da fehlte an zwei Stellen ein AC_MSG_ERROR ... ups!
[ngircd-alex.git] / configure.in
1 #
2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001 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 comBase beteiligten Autoren finden Sie in der Datei AUTHORS.
11 #
12 # $Id: configure.in,v 1.9 2001/12/27 02:08:38 alex Exp $
13 #
14 # $Log: configure.in,v $
15 # Revision 1.9  2001/12/27 02:08:38  alex
16 # - da fehlte an zwei Stellen ein AC_MSG_ERROR ... ups!
17 #
18 # Revision 1.8  2001/12/27 01:44:49  alex
19 # - die Verwendung von syslog kann nun abgeschaltet werden.
20 #
21 # Revision 1.7  2001/12/27 00:37:07  alex
22 # - Erkennung der "portab header" geaendert, CFLAGS werden nun anders gesetzt.
23 #
24 # Revision 1.6  2001/12/25 22:01:47  alex
25 # - neue configure-Option "--enable-sniffer".
26 #
27 # Revision 1.5  2001/12/21 23:54:26  alex
28 # - zusaetzliche Debug-Ausgaben koennen eingeschaltet werden.
29 #
30 # Revision 1.4  2001/12/12 17:21:58  alex
31 # - Projektdatei fuer den Mac OS X Project Builder erstellt.
32 #
33 # Revision 1.3  2001/12/12 01:58:53  alex
34 # - Test auf socklen_t verbessert.
35 #
36 # Revision 1.2  2001/12/11 22:04:21  alex
37 # - Test auf stdint.h (HAVE_STDINT_H) hinzugefuegt.
38 #
39 # Revision 1.1.1.1  2001/12/11 21:53:04  alex
40 # Imported sources to CVS.
41 #
42
43 # -- Initialisierung --
44
45 AC_INIT
46 AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
47 AM_INIT_AUTOMAKE(ngircd,0.0.1-pre)
48 AM_CONFIG_HEADER(src/config.h)
49
50 # -- Variablen --
51
52 CFLAGS="-Wall -g $CFLAGS"
53
54 # -- C Compiler --
55
56 AC_PROG_CC
57 AC_LANG_C
58
59 # -- Hilfsprogramme --
60
61 AC_PROG_AWK
62 AC_PROG_INSTALL
63 AC_PROG_LN_S
64 AC_PROG_MAKE_SET
65 AC_PROG_RANLIB
66
67 # -- Header --
68
69 AC_HEADER_STDC
70
71 AC_HEADER_TIME
72
73 AC_CHECK_HEADER(portab.h,[
74         AC_CHECK_HEADER(imp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
75         AC_CHECK_HEADER(exp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
76 ],[
77         AC_CHECK_HEADER(/usr/local/include/portab.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
78         AC_CHECK_HEADER(/usr/local/include/imp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
79         AC_CHECK_HEADER(/usr/local/include/exp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
80         CFLAGS="$CFLAGS -I/usr/local/include"
81 ])
82
83 AC_CHECK_HEADERS([ \
84         arpa/inet.h errno.h fcntl.h netinet/in.h string.h \
85         sys/socket.h sys/time.h unistd.h \
86         ],,AC_MSG_ERROR([required C header missing!]))
87
88 # -- Datentypen --
89
90 AC_MSG_CHECKING(whether socklen_t exists)
91 AC_TRY_COMPILE([
92         #include <sys/socket.h>
93         #include <sys/types.h>
94         ],[
95         socklen_t a, b;
96         a = 2; b = 4; a += b;
97         ],[
98         AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
99         ],[
100         AC_MSG_RESULT(no)
101 ])
102
103 # -- Funktionen --
104
105 AC_FUNC_MALLOC
106
107 AC_CHECK_FUNCS([ \
108         gethostname inet_ntoa memmove memset select \
109         socket strcasecmp strchr strerror strstr \
110         ],,AC_MSG_ERROR([required function missing!]))
111
112 # -- Libraries --
113
114 # -- Konfigurationsoptionen --
115
116 AC_ARG_ENABLE(syslog,
117         [  --disable-syslog        disable syslog (autodetected by default)],
118         [       if test "$enableval" = "yes"; then
119                         AC_CHECK_HEADER(syslog.h,AC_DEFINE(USE_SYSLOG, 1),AC_MSG_ERROR([Can't enable syslog: syslog.h not found!]))
120                 else
121                         AC_MSG_RESULT([disabling syslog])
122                 fi
123         ],
124         [       AC_CHECK_HEADER(syslog.h,AC_DEFINE(USE_SYSLOG, 1))
125         ]
126 )
127
128 AC_ARG_ENABLE(debug,
129         [  --enable-debug          show additional debug output],
130         if test "$enableval" = "yes"; then
131                 AC_DEFINE(DEBUG, 1)
132                 AC_MSG_RESULT([enabling additional debug output])
133         fi
134 )
135
136 AC_ARG_ENABLE(sniffer,
137         [  --enable-sniffer        enable network traffic monitor (enables debug mode!)],
138         if test "$enableval" = "yes"; then
139                 AC_DEFINE(DEBUG, 1)
140                 AC_MSG_RESULT([enabling additional debug output])
141                 AC_DEFINE(SNIFFER, 1)
142                 AC_MSG_RESULT([enabling network traffic monitor])
143         fi
144 )
145
146 # -- Ausgabe --
147
148 AC_OUTPUT([Makefile MacOSX/Makefile src/Makefile src/ngircd/Makefile])
149
150 # -eof-