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