1 |
< |
# Inspired by work Copyright (C) 2006 Luca Filipozzi |
2 |
< |
# vim: set fdm=marker ts=2 sw=2 et: |
1 |
> |
dnl Process this file with autoconf to produce a configure script. |
2 |
|
|
3 |
|
AC_REVISION([$Id$]) |
4 |
|
|
5 |
|
AC_PREREQ(2.69) |
6 |
|
AC_INIT([ircd-hybrid], [TRUNK], [bugs@ircd-hybrid.org]) |
7 |
< |
AM_INIT_AUTOMAKE(1.13.1) |
7 |
> |
AM_INIT_AUTOMAKE(1.15 subdir-objects) |
8 |
|
AM_MAINTAINER_MODE |
9 |
+ |
AC_CONFIG_MACRO_DIR([m4]) |
10 |
|
AC_CONFIG_HEADER(config.h) |
11 |
|
AC_CONFIG_SRCDIR(src/ircd.c) |
12 |
|
|
24 |
|
LTDL_INIT([recursive convenience]) |
25 |
|
LIBTOOL="$LIBTOOL --silent" |
26 |
|
|
27 |
– |
AC_CHECK_SIZEOF(short) |
28 |
– |
AC_CHECK_SIZEOF(int) |
29 |
– |
AC_CHECK_SIZEOF(long) |
30 |
– |
AC_CHECK_SIZEOF(void *) |
31 |
– |
AC_CHECK_SIZEOF(int64_t) |
32 |
– |
AC_CHECK_SIZEOF(long long) |
33 |
– |
|
34 |
– |
if test "$ac_cv_sizeof_int" = 2 ; then |
35 |
– |
AC_CHECK_TYPE(int16_t, int) |
36 |
– |
AC_CHECK_TYPE(uint16_t, unsigned int) |
37 |
– |
elif test "$ac_cv_sizeof_short" = 2 ; then |
38 |
– |
AC_CHECK_TYPE(int16_t, short) |
39 |
– |
AC_CHECK_TYPE(uint16_t, unsigned short) |
40 |
– |
else |
41 |
– |
AC_MSG_ERROR([Cannot find a type with size of 16 bits]) |
42 |
– |
fi |
43 |
– |
if test "$ac_cv_sizeof_int" = 4 ; then |
44 |
– |
AC_CHECK_TYPE(int32_t, int) |
45 |
– |
AC_CHECK_TYPE(uint32_t, unsigned int) |
46 |
– |
elif test "$ac_cv_sizeof_short" = 4 ; then |
47 |
– |
AC_CHECK_TYPE(int32_t, short) |
48 |
– |
AC_CHECK_TYPE(uint32_t, unsigned short) |
49 |
– |
elif test "$ac_cv_sizeof_long" = 4 ; then |
50 |
– |
AC_CHECK_TYPE(int32_t, long) |
51 |
– |
AC_CHECK_TYPE(uint32_t, unsigned long) |
52 |
– |
else |
53 |
– |
AC_MSG_ERROR([Cannot find a type with size of 32 bits]) |
54 |
– |
fi |
55 |
– |
if test "$ac_cv_sizeof_int64_t" = 8 ; then |
56 |
– |
AC_CHECK_TYPE(int64_t) |
57 |
– |
AC_CHECK_TYPE(uint64_t) |
58 |
– |
elif test "$ac_cv_sizeof_long_long" = 8 ; then |
59 |
– |
AC_CHECK_TYPE(int64_t, long long) |
60 |
– |
AC_CHECK_TYPE(uint64_t, unsigned long long) |
61 |
– |
else |
62 |
– |
AC_MSG_ERROR([Cannot find a type with size of 64 bits]) |
63 |
– |
fi |
64 |
– |
|
65 |
– |
|
27 |
|
# Checks for libraries. |
28 |
< |
AX_CHECK_LIB_IPV4 |
29 |
< |
AX_CHECK_LIB_IPV6 |
28 |
> |
GCC_STACK_PROTECT_CC |
29 |
> |
GCC_STACK_PROTECT_LIB |
30 |
> |
|
31 |
> |
AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing]) |
32 |
> |
AX_LIBRARY_NET |
33 |
|
|
34 |
|
# Checks for typedefs, structures, and compiler characteristics. |
35 |
|
AC_C_BIGENDIAN |
51 |
|
|
52 |
|
AC_SEARCH_LIBS(crypt, crypt) |
53 |
|
|
90 |
– |
AC_ARG_ENABLE(libgeoip, |
91 |
– |
[AS_HELP_STRING([--disable-libgeoip],[Disable GeoIP support])], [], |
92 |
– |
[AC_CHECK_HEADER(GeoIP.h, |
93 |
– |
[AC_SEARCH_LIBS(GeoIP_id_by_ipnum_v6_gl, GeoIP, |
94 |
– |
[AC_DEFINE(HAVE_LIBGEOIP, 1, [Define to 1 if libGeoIP (-lGeoIP) is available.])])])], []) |
95 |
– |
|
96 |
– |
dnl Openssl checks |
97 |
– |
AC_ARG_ENABLE(openssl, |
98 |
– |
[ --enable-openssl[=DIR] Enable OpenSSL support (DIR optional). |
99 |
– |
--disable-openssl Disable OpenSSL support. ], |
100 |
– |
[ cf_enable_openssl=$enableval ], |
101 |
– |
[ cf_enable_openssl="auto" ]) |
102 |
– |
AC_MSG_CHECKING([for OpenSSL]) |
103 |
– |
if test "$cf_enable_openssl" != "no"; then |
104 |
– |
cf_openssl_basedir="" |
105 |
– |
if test "$cf_enable_openssl" != "auto" && |
106 |
– |
test "$cf_enable_openssl" != "yes"; then |
107 |
– |
dnl Support for --enable-openssl=/some/place |
108 |
– |
cf_openssl_basedir="${cf_enable_openssl}" |
109 |
– |
else |
110 |
– |
dnl Do the auto-probe here. Check some common directory paths. |
111 |
– |
for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/lib /usr/lib/ssl\ |
112 |
– |
/opt /opt/openssl /usr/local/openssl; do |
113 |
– |
if test -f "${dirs}/include/openssl/opensslv.h"; then |
114 |
– |
cf_openssl_basedir="${dirs}" |
115 |
– |
break |
116 |
– |
fi |
117 |
– |
done |
118 |
– |
unset dirs |
119 |
– |
fi |
120 |
– |
|
121 |
– |
dnl Now check cf_openssl_found to see if we found anything. |
122 |
– |
if test ! -z "$cf_openssl_basedir"; then |
123 |
– |
if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h"; then |
124 |
– |
CPPFLAGS="-I${cf_openssl_basedir}/include $CPPFLAGS" |
125 |
– |
LDFLAGS="-L${cf_openssl_basedir}/lib $LDFLAGS" |
126 |
– |
else |
127 |
– |
dnl OpenSSL wasn't found in the directory specified. Naughty |
128 |
– |
dnl administrator... |
129 |
– |
cf_openssl_basedir="" |
130 |
– |
fi |
131 |
– |
else |
132 |
– |
dnl Check for stock FreeBSD 4.x and 5.x systems, since their files |
133 |
– |
dnl are in /usr/include and /usr/lib. In this case, we don't want to |
134 |
– |
dnl change INCLUDES or LIBS, but still want to enable OpenSSL. |
135 |
– |
dnl We can't do this check above, because some people want two versions |
136 |
– |
dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl) |
137 |
– |
dnl and they want /usr/local/ssl to have preference. |
138 |
– |
if test -f "/usr/include/openssl/opensslv.h"; then |
139 |
– |
cf_openssl_basedir="/usr" |
140 |
– |
fi |
141 |
– |
fi |
142 |
– |
|
143 |
– |
dnl If we have a basedir defined, then everything is okay. Otherwise, |
144 |
– |
dnl we have a problem. |
145 |
– |
if test ! -z "$cf_openssl_basedir"; then |
146 |
– |
AC_MSG_RESULT([$cf_openssl_basedir]) |
147 |
– |
cf_enable_openssl="yes" |
148 |
– |
else |
149 |
– |
AC_MSG_RESULT([not found. Please check your path.]) |
150 |
– |
cf_enable_openssl="no" |
151 |
– |
fi |
152 |
– |
unset cf_openssl_basedir |
153 |
– |
else |
154 |
– |
dnl If --disable-openssl was specified |
155 |
– |
AC_MSG_RESULT([disabled]) |
156 |
– |
fi |
157 |
– |
|
158 |
– |
AS_IF([test "$cf_enable_openssl" != "no"], |
159 |
– |
[AC_MSG_CHECKING(for OpenSSL 0.9.8 or above) |
160 |
– |
AC_RUN_IFELSE([ |
161 |
– |
AC_LANG_PROGRAM([ |
162 |
– |
#include <openssl/opensslv.h> |
163 |
– |
#include <stdlib.h>], |
164 |
– |
[[ exit(!(OPENSSL_VERSION_NUMBER >= 0x00908000)); ]])], |
165 |
– |
[cf_openssl_version_ok=yes], |
166 |
– |
[cf_openssl_version_ok=no], |
167 |
– |
[cf_openssl_version_ok=no]) |
168 |
– |
|
169 |
– |
AS_IF([test "$cf_openssl_version_ok" = "yes"], |
170 |
– |
[AC_MSG_RESULT(found) |
171 |
– |
|
172 |
– |
AC_CHECK_LIB(crypto, RSA_free) |
173 |
– |
AS_IF([test "$ac_cv_lib_crypto_RSA_free" = "yes"], |
174 |
– |
[AC_CHECK_LIB(ssl, SSL_connect)]) |
175 |
– |
],[AC_MSG_RESULT(no - OpenSSL support disabled) |
176 |
– |
cf_enable_openssl="no"])]) |
177 |
– |
|
178 |
– |
AM_CONDITIONAL(ENABLE_SSL, [test "$ac_cv_lib_ssl_SSL_connect" = yes]) |
179 |
– |
|
180 |
– |
|
181 |
– |
AC_ARG_ENABLE(assert, AS_HELP_STRING([--enable-assert], |
182 |
– |
[Enable assert() statements]), |
183 |
– |
[assert=$enableval], [assert=no]) |
184 |
– |
|
185 |
– |
AS_IF([test "$assert" = "no"], |
186 |
– |
[AC_DEFINE(NDEBUG, 1, [Define to disable assert() statements.])]) |
187 |
– |
|
54 |
|
AC_DEFINE([NICKNAMEHISTORYLENGTH], 32768, [Size of the WHOWAS array.]) |
55 |
|
AC_DEFINE([MP_CHUNK_SIZE_CHANNEL], 1024*1024, [Size of the channel mempool chunk.]) |
56 |
|
AC_DEFINE([MP_CHUNK_SIZE_MEMBER], 2048*1024, [Size of the channel-member mempool chunk.]) |
57 |
|
AC_DEFINE([MP_CHUNK_SIZE_BAN], 1024*1024, [Size of the ban mempool chunk.]) |
58 |
|
AC_DEFINE([MP_CHUNK_SIZE_CLIENT], 1024*1024, [Size of the client mempool chunk.]) |
59 |
< |
AC_DEFINE([MP_CHUNK_SIZE_LCLIENT], 512*1024, [Size of the local client mempool chunk.]) |
59 |
> |
AC_DEFINE([MP_CHUNK_SIZE_CONNECTION], 512*1024, [Size of the connection mempool chunk.]) |
60 |
|
AC_DEFINE([MP_CHUNK_SIZE_DNODE], 32*1024, [Size of the dlink_node mempool chunk.]) |
61 |
|
AC_DEFINE([MP_CHUNK_SIZE_DBUF], 512*1024, [Size of the dbuf mempool chunk.]) |
62 |
|
AC_DEFINE([MP_CHUNK_SIZE_AUTH], 128*1024, [Size of the auth mempool chunk.]) |
67 |
|
AC_DEFINE([MP_CHUNK_SIZE_IP_ENTRY], 128*1024, [Size of the ip_entry mempool chunk.]) |
68 |
|
|
69 |
|
# Argument processing. |
70 |
< |
AX_ARG_ENABLE_IOLOOP_MECHANISM |
71 |
< |
AX_ARG_ENABLE_HALFOPS |
70 |
> |
AX_ARG_IOLOOP_MECHANISM |
71 |
> |
AX_ARG_ENABLE_ASSERT |
72 |
|
AX_ARG_ENABLE_DEBUGGING |
73 |
|
AX_ARG_ENABLE_WARNINGS |
74 |
+ |
AX_ARG_OPENSSL |
75 |
+ |
AX_ARG_LIBGEOIP |
76 |
|
|
77 |
|
AC_DEFINE_DIR([PREFIX],[prefix],[Set to prefix.]) |
78 |
|
AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Set to sysconfdir.]) |
86 |
|
libltdl/Makefile \ |
87 |
|
modules/Makefile \ |
88 |
|
modules/core/Makefile \ |
89 |
+ |
modules/extra/Makefile \ |
90 |
|
doc/Makefile \ |
91 |
|
help/Makefile \ |
92 |
|
tools/Makefile) |
93 |
|
|
94 |
|
AC_OUTPUT |
95 |
+ |
|
96 |
+ |
echo "###############################################################################" |
97 |
+ |
echo "Configuration complete. Type make (or gmake on some *BSD machines) to compile." |
98 |
+ |
echo |
99 |
+ |
echo "ircd-hybrid will be installed in ${prefix}. To change this, run:" |
100 |
+ |
echo " ./configure --prefix=DIRECTORY" |
101 |
+ |
echo "###############################################################################" |