ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.1.x/configure.ac
Revision: 1856
Committed: Wed Apr 24 19:43:22 2013 UTC (10 years, 11 months ago) by michael
Content type: application/pkix-attr-cert
Original Path: ircd-hybrid/trunk/configure.ac
File size: 6609 byte(s)
Log Message:
- Added configure test for libGeoIP for later usage

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

Properties

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