]> arthur.barton.de Git - ngircd-alex.git/blob - configure.in
78536e944654ea27112c06a20f5a3d5872ca2a82
[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.7 2001/12/27 00:37:07 alex Exp $
13 #
14 # $Log: configure.in,v $
15 # Revision 1.7  2001/12/27 00:37:07  alex
16 # - Erkennung der "portab header" geaendert, CFLAGS werden nun anders gesetzt.
17 #
18 # Revision 1.6  2001/12/25 22:01:47  alex
19 # - neue configure-Option "--enable-sniffer".
20 #
21 # Revision 1.5  2001/12/21 23:54:26  alex
22 # - zusaetzliche Debug-Ausgaben koennen eingeschaltet werden.
23 #
24 # Revision 1.4  2001/12/12 17:21:58  alex
25 # - Projektdatei fuer den Mac OS X Project Builder erstellt.
26 #
27 # Revision 1.3  2001/12/12 01:58:53  alex
28 # - Test auf socklen_t verbessert.
29 #
30 # Revision 1.2  2001/12/11 22:04:21  alex
31 # - Test auf stdint.h (HAVE_STDINT_H) hinzugefuegt.
32 #
33 # Revision 1.1.1.1  2001/12/11 21:53:04  alex
34 # Imported sources to CVS.
35 #
36
37 # -- Initialisierung --
38
39 AC_INIT
40 AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
41 AM_INIT_AUTOMAKE(ngircd,0.0.1-pre)
42 AM_CONFIG_HEADER(src/config.h)
43
44 # -- Variablen --
45
46 CFLAGS="-Wall -g $CFLAGS"
47
48 # -- C Compiler --
49
50 AC_PROG_CC
51 AC_LANG_C
52
53 # -- Hilfsprogramme --
54
55 AC_PROG_MAKE_SET
56 AC_PROG_RANLIB
57
58 # -- Header --
59
60 AC_HEADER_STDC
61
62 AC_CHECK_HEADER(portab.h,[
63         AC_CHECK_HEADER(imp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
64         AC_CHECK_HEADER(exp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
65 ],[
66         AC_CHECK_HEADER(/usr/local/include/portab.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
67         AC_CHECK_HEADER(/usr/local/include/imp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
68         AC_CHECK_HEADER(/usr/local/include/exp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
69         CFLAGS="$CFLAGS -I/usr/local/include"
70 ])
71
72 AC_CHECK_HEADERS([netinet/in.h sys/socket.h],,[required C headers missing!])
73
74 AC_CHECK_HEADERS([stdint.h])
75
76 # -- Datentypen --
77
78 AC_MSG_CHECKING(whether socklen_t exists)
79 AC_TRY_COMPILE([
80         #include <sys/socket.h>
81         #include <sys/types.h>
82         ],[
83         socklen_t a, b;
84         a = 2; b = 4; a += b;
85         ],[
86         AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes)
87         ],[
88         AC_MSG_RESULT(no)
89 ])
90
91 # -- Funktionen --
92
93 AC_CHECK_FUNCS([socket],,[required functions missing!])
94
95 # -- Libraries --
96
97 # -- Konfigurationsoptionen --
98
99 AC_ARG_ENABLE(debug,
100         [  --enable-debug          show additional debug output],
101         if test "$enableval" = "yes"; then
102                 AC_DEFINE(DEBUG, 1)
103                 AC_MSG_RESULT([enabling additional debug output])
104         fi
105 )
106
107 AC_ARG_ENABLE(sniffer,
108         [  --enable-sniffer        enable network traffic monitor (enables debug mode!)],
109         if test "$enableval" = "yes"; then
110                 AC_DEFINE(DEBUG, 1)
111                 AC_MSG_RESULT([enabling additional debug output])
112                 AC_DEFINE(SNIFFER, 1)
113                 AC_MSG_RESULT([enabling network traffic monitor])
114         fi
115 )
116
117 # -- Ausgabe --
118
119 AC_OUTPUT([Makefile MacOSX/Makefile src/Makefile src/ngircd/Makefile])
120
121 # -eof-