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 (12 years, 9 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

# User Rev Content
1 stu 908 # Inspired by work Copyright (C) 2006 Luca Filipozzi
2     # vim: set fdm=marker ts=2 sw=2 et:
3 adx 30
4 michael 953 AC_REVISION([$Id$])
5    
6 michael 1373 AC_PREREQ(2.69)
7 michael 1680 AC_INIT([ircd-hybrid], [TRUNK], [bugs@ircd-hybrid.org])
8 michael 2347 AM_INIT_AUTOMAKE(1.13.1 subdir-objects)
9 stu 908 AM_MAINTAINER_MODE
10 michael 2480 AC_CONFIG_MACRO_DIR([m4])
11 michael 912 AC_CONFIG_HEADER(config.h)
12     AC_CONFIG_SRCDIR(src/ircd.c)
13 adx 30
14 stu 908 # Checks for programs.
15 michael 1010 AC_PROG_CC_C99
16     AS_IF([test "$ac_cv_prog_cc_c99" = "no"],
17 michael 1348 [AC_MSG_ERROR([no suitable C99 compiler found. Aborting.])])
18 michael 912 AC_PROG_YACC
19     AM_PROG_LEX
20 stu 908 AC_PROG_INSTALL
21 michael 945
22 michael 1015 # Initializing libtool.
23 michael 1084 LT_CONFIG_LTDL_DIR([libltdl])
24 michael 977 LT_INIT([dlopen disable-static])
25 michael 1092 LTDL_INIT([recursive convenience])
26 michael 1053 LIBTOOL="$LIBTOOL --silent"
27 adx 30
28 stu 908 # Checks for libraries.
29 michael 2480 GCC_STACK_PROTECT_CC
30    
31 stu 908 AX_CHECK_LIB_IPV4
32     AX_CHECK_LIB_IPV6
33 adx 30
34 stu 908 # Checks for typedefs, structures, and compiler characteristics.
35 adx 30 AC_C_BIGENDIAN
36    
37 stu 908 # Checks for library functions.
38 michael 1664 AC_CHECK_FUNCS_ONCE(strtok_r \
39 michael 1010 usleep \
40     strlcat \
41 michael 1329 strlcpy)
42 adx 30
43 michael 923 # Checks for header files.
44 michael 912 AC_CHECK_HEADERS_ONCE(crypt.h \
45     sys/resource.h \
46     sys/param.h \
47 db 941 types.h \
48     socket.h \
49 michael 912 sys/wait.h \
50 michael 1348 wait.h)
51 michael 912
52 michael 977 AC_SEARCH_LIBS(crypt, crypt)
53 michael 923
54 michael 2334 AC_ARG_ENABLE(libgeoip,
55 michael 1856 [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 michael 912 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 michael 1010 AC_MSG_CHECKING([for OpenSSL])
67 michael 912 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 michael 1010 AC_MSG_RESULT([$cf_openssl_basedir])
111 michael 912 cf_enable_openssl="yes"
112     else
113 michael 1010 AC_MSG_RESULT([not found. Please check your path.])
114 michael 912 cf_enable_openssl="no"
115     fi
116     unset cf_openssl_basedir
117     else
118     dnl If --disable-openssl was specified
119 michael 1010 AC_MSG_RESULT([disabled])
120 michael 912 fi
121 michael 1015
122     AS_IF([test "$cf_enable_openssl" != "no"],
123 michael 2228 [AC_MSG_CHECKING(for OpenSSL 0.9.8 or above)
124 michael 1106 AC_RUN_IFELSE([
125 michael 1015 AC_LANG_PROGRAM([
126     #include <openssl/opensslv.h>
127     #include <stdlib.h>],
128 michael 2228 [[ exit(!(OPENSSL_VERSION_NUMBER >= 0x00908000)); ]])],
129 michael 1015 [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 michael 1106
136 michael 1456 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 michael 1015 ],[AC_MSG_RESULT(no - OpenSSL support disabled)
140     cf_enable_openssl="no"])])
141    
142 michael 1456 AM_CONDITIONAL(ENABLE_SSL, [test "$ac_cv_lib_ssl_SSL_connect" = yes])
143 michael 912
144    
145 michael 955 AC_ARG_ENABLE(assert, AS_HELP_STRING([--enable-assert],
146     [Enable assert() statements]),
147 michael 924 [assert=$enableval], [assert=no])
148    
149 michael 1010 AS_IF([test "$assert" = "no"],
150     [AC_DEFINE(NDEBUG, 1, [Define to disable assert() statements.])])
151 michael 924
152 michael 1908 AC_DEFINE([NICKNAMEHISTORYLENGTH], 32768, [Size of the WHOWAS array.])
153 michael 1964 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 michael 1654 AC_DEFINE([MP_CHUNK_SIZE_DBUF], 512*1024, [Size of the dbuf mempool chunk.])
160 michael 1964 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 michael 925
167 stu 908 # Argument processing.
168     AX_ARG_ENABLE_IOLOOP_MECHANISM
169     AX_ARG_ENABLE_HALFOPS
170     AX_ARG_ENABLE_DEBUGGING
171     AX_ARG_ENABLE_WARNINGS
172 adx 30
173 stu 908 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 adx 30
179 michael 922 AC_CONFIG_FILES( \
180     Makefile \
181     src/Makefile \
182 michael 1092 libltdl/Makefile \
183 michael 922 modules/Makefile \
184 michael 1053 modules/core/Makefile \
185 michael 922 doc/Makefile \
186     help/Makefile \
187 michael 1015 tools/Makefile)
188 adx 30
189     AC_OUTPUT

Properties

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