ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/configure.ac
Revision: 2480
Committed: Wed Oct 23 16:05:41 2013 UTC (10 years, 5 months ago) by michael
Content type: application/pkix-attr-cert
Original Path: ircd-hybrid/trunk/configure.ac
File size: 6620 byte(s)
Log Message:
- Initial build system related modernizations
- Add -fstack-protector to CFLAGS if available

File Contents

# Content
1 # Inspired by work Copyright (C) 2006 Luca Filipozzi
2 # vim: set fdm=marker ts=2 sw=2 et:
3
4 AC_REVISION([$Id$])
5
6 AC_PREREQ(2.69)
7 AC_INIT([ircd-hybrid], [TRUNK], [bugs@ircd-hybrid.org])
8 AM_INIT_AUTOMAKE(1.13.1 subdir-objects)
9 AM_MAINTAINER_MODE
10 AC_CONFIG_MACRO_DIR([m4])
11 AC_CONFIG_HEADER(config.h)
12 AC_CONFIG_SRCDIR(src/ircd.c)
13
14 # Checks for programs.
15 AC_PROG_CC_C99
16 AS_IF([test "$ac_cv_prog_cc_c99" = "no"],
17 [AC_MSG_ERROR([no suitable C99 compiler found. Aborting.])])
18 AC_PROG_YACC
19 AM_PROG_LEX
20 AC_PROG_INSTALL
21
22 # Initializing libtool.
23 LT_CONFIG_LTDL_DIR([libltdl])
24 LT_INIT([dlopen disable-static])
25 LTDL_INIT([recursive convenience])
26 LIBTOOL="$LIBTOOL --silent"
27
28 # Checks for libraries.
29 GCC_STACK_PROTECT_CC
30
31 AX_CHECK_LIB_IPV4
32 AX_CHECK_LIB_IPV6
33
34 # Checks for typedefs, structures, and compiler characteristics.
35 AC_C_BIGENDIAN
36
37 # Checks for library functions.
38 AC_CHECK_FUNCS_ONCE(strtok_r \
39 usleep \
40 strlcat \
41 strlcpy)
42
43 # Checks for header files.
44 AC_CHECK_HEADERS_ONCE(crypt.h \
45 sys/resource.h \
46 sys/param.h \
47 types.h \
48 socket.h \
49 sys/wait.h \
50 wait.h)
51
52 AC_SEARCH_LIBS(crypt, crypt)
53
54 AC_ARG_ENABLE(libgeoip,
55 [AS_HELP_STRING([--disable-libgeoip],[Disable GeoIP support])], [],
56 [AC_CHECK_HEADER(GeoIP.h,
57 [AC_SEARCH_LIBS(GeoIP_id_by_ipnum_v6_gl, GeoIP,
58 [AC_DEFINE(HAVE_LIBGEOIP, 1, [Define to 1 if libGeoIP (-lGeoIP) is available.])])])], [])
59
60 dnl Openssl checks
61 AC_ARG_ENABLE(openssl,
62 [ --enable-openssl[=DIR] Enable OpenSSL support (DIR optional).
63 --disable-openssl Disable OpenSSL support. ],
64 [ cf_enable_openssl=$enableval ],
65 [ cf_enable_openssl="auto" ])
66 AC_MSG_CHECKING([for OpenSSL])
67 if test "$cf_enable_openssl" != "no"; then
68 cf_openssl_basedir=""
69 if test "$cf_enable_openssl" != "auto" &&
70 test "$cf_enable_openssl" != "yes"; then
71 dnl Support for --enable-openssl=/some/place
72 cf_openssl_basedir="${cf_enable_openssl}"
73 else
74 dnl Do the auto-probe here. Check some common directory paths.
75 for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/lib /usr/lib/ssl\
76 /opt /opt/openssl /usr/local/openssl; do
77 if test -f "${dirs}/include/openssl/opensslv.h"; then
78 cf_openssl_basedir="${dirs}"
79 break
80 fi
81 done
82 unset dirs
83 fi
84
85 dnl Now check cf_openssl_found to see if we found anything.
86 if test ! -z "$cf_openssl_basedir"; then
87 if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h"; then
88 CPPFLAGS="-I${cf_openssl_basedir}/include $CPPFLAGS"
89 LDFLAGS="-L${cf_openssl_basedir}/lib $LDFLAGS"
90 else
91 dnl OpenSSL wasn't found in the directory specified. Naughty
92 dnl administrator...
93 cf_openssl_basedir=""
94 fi
95 else
96 dnl Check for stock FreeBSD 4.x and 5.x systems, since their files
97 dnl are in /usr/include and /usr/lib. In this case, we don't want to
98 dnl change INCLUDES or LIBS, but still want to enable OpenSSL.
99 dnl We can't do this check above, because some people want two versions
100 dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl)
101 dnl and they want /usr/local/ssl to have preference.
102 if test -f "/usr/include/openssl/opensslv.h"; then
103 cf_openssl_basedir="/usr"
104 fi
105 fi
106
107 dnl If we have a basedir defined, then everything is okay. Otherwise,
108 dnl we have a problem.
109 if test ! -z "$cf_openssl_basedir"; then
110 AC_MSG_RESULT([$cf_openssl_basedir])
111 cf_enable_openssl="yes"
112 else
113 AC_MSG_RESULT([not found. Please check your path.])
114 cf_enable_openssl="no"
115 fi
116 unset cf_openssl_basedir
117 else
118 dnl If --disable-openssl was specified
119 AC_MSG_RESULT([disabled])
120 fi
121
122 AS_IF([test "$cf_enable_openssl" != "no"],
123 [AC_MSG_CHECKING(for OpenSSL 0.9.8 or above)
124 AC_RUN_IFELSE([
125 AC_LANG_PROGRAM([
126 #include <openssl/opensslv.h>
127 #include <stdlib.h>],
128 [[ exit(!(OPENSSL_VERSION_NUMBER >= 0x00908000)); ]])],
129 [cf_openssl_version_ok=yes],
130 [cf_openssl_version_ok=no],
131 [cf_openssl_version_ok=no])
132
133 AS_IF([test "$cf_openssl_version_ok" = "yes"],
134 [AC_MSG_RESULT(found)
135
136 AC_CHECK_LIB(crypto, RSA_free)
137 AS_IF([test "$ac_cv_lib_crypto_RSA_free" = "yes"],
138 [AC_CHECK_LIB(ssl, SSL_connect)])
139 ],[AC_MSG_RESULT(no - OpenSSL support disabled)
140 cf_enable_openssl="no"])])
141
142 AM_CONDITIONAL(ENABLE_SSL, [test "$ac_cv_lib_ssl_SSL_connect" = yes])
143
144
145 AC_ARG_ENABLE(assert, AS_HELP_STRING([--enable-assert],
146 [Enable assert() statements]),
147 [assert=$enableval], [assert=no])
148
149 AS_IF([test "$assert" = "no"],
150 [AC_DEFINE(NDEBUG, 1, [Define to disable assert() statements.])])
151
152 AC_DEFINE([NICKNAMEHISTORYLENGTH], 32768, [Size of the WHOWAS array.])
153 AC_DEFINE([MP_CHUNK_SIZE_CHANNEL], 1024*1024, [Size of the channel mempool chunk.])
154 AC_DEFINE([MP_CHUNK_SIZE_MEMBER], 2048*1024, [Size of the channel-member mempool chunk.])
155 AC_DEFINE([MP_CHUNK_SIZE_BAN], 1024*1024, [Size of the ban mempool chunk.])
156 AC_DEFINE([MP_CHUNK_SIZE_CLIENT], 1024*1024, [Size of the client mempool chunk.])
157 AC_DEFINE([MP_CHUNK_SIZE_LCLIENT], 512*1024, [Size of the local client mempool chunk.])
158 AC_DEFINE([MP_CHUNK_SIZE_DNODE], 32*1024, [Size of the dlink_node mempool chunk.])
159 AC_DEFINE([MP_CHUNK_SIZE_DBUF], 512*1024, [Size of the dbuf mempool chunk.])
160 AC_DEFINE([MP_CHUNK_SIZE_AUTH], 128*1024, [Size of the auth mempool chunk.])
161 AC_DEFINE([MP_CHUNK_SIZE_DNS], 64*1024, [Size of the dns mempool chunk.])
162 AC_DEFINE([MP_CHUNK_SIZE_WATCH], 8*1024, [Size of the watch mempool chunk.])
163 AC_DEFINE([MP_CHUNK_SIZE_NAMEHOST], 64*1024, [Size of the namehost mempool chunk.])
164 AC_DEFINE([MP_CHUNK_SIZE_USERHOST], 128*1024, [Size of the userhost mempool chunk.])
165 AC_DEFINE([MP_CHUNK_SIZE_IP_ENTRY], 128*1024, [Size of the ip_entry mempool chunk.])
166
167 # Argument processing.
168 AX_ARG_ENABLE_IOLOOP_MECHANISM
169 AX_ARG_ENABLE_HALFOPS
170 AX_ARG_ENABLE_DEBUGGING
171 AX_ARG_ENABLE_WARNINGS
172
173 AC_DEFINE_DIR([PREFIX],[prefix],[Set to prefix.])
174 AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Set to sysconfdir.])
175 AC_DEFINE_DIR([LIBDIR],[libdir],[Set to libdir.])
176 AC_DEFINE_DIR([DATADIR],[datadir],[Set to datadir.])
177 AC_DEFINE_DIR([LOCALSTATEDIR],[localstatedir],[Set to localstatedir.])
178
179 AC_CONFIG_FILES( \
180 Makefile \
181 src/Makefile \
182 libltdl/Makefile \
183 modules/Makefile \
184 modules/core/Makefile \
185 doc/Makefile \
186 help/Makefile \
187 tools/Makefile)
188
189 AC_OUTPUT

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision