| 1 | dnl jabberd2 configure script |
|---|
| 2 | dnl $Id: configure.in,v 1.95 2005/08/21 10:06:06 zion Exp $ |
|---|
| 3 | |
|---|
| 4 | dnl |
|---|
| 5 | dnl autoconf setup |
|---|
| 6 | dnl |
|---|
| 7 | |
|---|
| 8 | AC_PREREQ(2.57) |
|---|
| 9 | |
|---|
| 10 | dnl startup |
|---|
| 11 | AC_INIT(jabberd, 2.1) |
|---|
| 12 | AM_INIT_AUTOMAKE |
|---|
| 13 | |
|---|
| 14 | dnl copyright |
|---|
| 15 | AC_COPYRIGHT([Copyright (c) 2002-2004 Robert Norris |
|---|
| 16 | This configure script may be copied, distributed and modified under the |
|---|
| 17 | terms of the jabberd license; see COPYING for more details.]) |
|---|
| 18 | |
|---|
| 19 | dnl identify the source tree |
|---|
| 20 | AC_CONFIG_SRCDIR(sx/sx.h) |
|---|
| 21 | |
|---|
| 22 | dnl output config header |
|---|
| 23 | AM_CONFIG_HEADER(config.h) |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | dnl |
|---|
| 27 | dnl build environment setup |
|---|
| 28 | dnl |
|---|
| 29 | |
|---|
| 30 | dnl developer flags |
|---|
| 31 | AC_ARG_ENABLE(developer, AC_HELP_STRING([--enable-developer], [Compile with warnings and debugging symbols]), |
|---|
| 32 | CFLAGS="-Wall -g $CFLAGS") |
|---|
| 33 | |
|---|
| 34 | dnl basic tools |
|---|
| 35 | AC_PROG_CC |
|---|
| 36 | AC_PROG_MAKE_SET |
|---|
| 37 | |
|---|
| 38 | dnl need libtool for internal linking |
|---|
| 39 | AC_DISABLE_STATIC |
|---|
| 40 | AC_LIBTOOL_DLOPEN |
|---|
| 41 | AC_PROG_LIBTOOL |
|---|
| 42 | |
|---|
| 43 | dnl use libtool to compile checks |
|---|
| 44 | ac_link="${SHELL} ${srcdir}/libtool --mode=link $ac_link" |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | dnl |
|---|
| 48 | dnl extra paths |
|---|
| 49 | dnl |
|---|
| 50 | |
|---|
| 51 | AC_ARG_WITH(extra_include_path, AC_HELP_STRING([--with-extra-include-path], |
|---|
| 52 | [use additional include paths]), |
|---|
| 53 | extra_include_path=$withval) |
|---|
| 54 | split_includes="`echo $extra_include_path | sed -e 's/:/ /g'`" |
|---|
| 55 | for incpath in $split_includes ; do |
|---|
| 56 | CPPFLAGS="-I$incpath $CPPFLAGS" |
|---|
| 57 | done |
|---|
| 58 | |
|---|
| 59 | AC_ARG_WITH(extra_library_path, AC_HELP_STRING([--with-extra-library-path], |
|---|
| 60 | [use additional library paths]), |
|---|
| 61 | extra_library_path=$withval) |
|---|
| 62 | split_libs="`echo $extra_library_path | sed -e 's/:/ /g'`" |
|---|
| 63 | for libpath in $split_libs ; do |
|---|
| 64 | LDFLAGS="-L$libpath $LDFLAGS" |
|---|
| 65 | done |
|---|
| 66 | |
|---|
| 67 | dnl |
|---|
| 68 | dnl header checks |
|---|
| 69 | dnl |
|---|
| 70 | AC_HEADER_DIRENT |
|---|
| 71 | AC_HEADER_STDC |
|---|
| 72 | AC_HEADER_SYS_WAIT |
|---|
| 73 | AC_HEADER_TIME |
|---|
| 74 | |
|---|
| 75 | # Two-step header checking. First check for headers which don't |
|---|
| 76 | # require any other headers. |
|---|
| 77 | AC_CHECK_HEADERS( \ |
|---|
| 78 | arpa/inet.h \ |
|---|
| 79 | arpa/nameser.h \ |
|---|
| 80 | fcntl.h \ |
|---|
| 81 | netinet/in.h \ |
|---|
| 82 | signal.h \ |
|---|
| 83 | sys/filio.h \ |
|---|
| 84 | sys/ioctl.h \ |
|---|
| 85 | sys/types.h \ |
|---|
| 86 | sys/socket.h \ |
|---|
| 87 | sys/stat.h \ |
|---|
| 88 | sys/time.h \ |
|---|
| 89 | sys/timeb.h \ |
|---|
| 90 | sys/utsname.h \ |
|---|
| 91 | syslog.h \ |
|---|
| 92 | unistd.h \ |
|---|
| 93 | windows.h \ |
|---|
| 94 | winsock2.h) |
|---|
| 95 | |
|---|
| 96 | # Now check for those headers that do, including all the required |
|---|
| 97 | # headers. |
|---|
| 98 | AC_CHECK_HEADERS(resolv.h windns.h,,, |
|---|
| 99 | [#ifdef HAVE_SYS_TYPES_H |
|---|
| 100 | # include <sys/types.h> |
|---|
| 101 | #endif |
|---|
| 102 | #ifdef HAVE_WINSOCK2_H |
|---|
| 103 | # include <winsock2.h> |
|---|
| 104 | #endif |
|---|
| 105 | #ifdef HAVE_NETINET_IN_H |
|---|
| 106 | # include <netinet/in.h> |
|---|
| 107 | #endif]) |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | dnl |
|---|
| 111 | dnl quirky functions |
|---|
| 112 | dnl |
|---|
| 113 | |
|---|
| 114 | AC_CHECK_FUNC(connect, ,[AC_CHECK_LIB(socket, connect)]) |
|---|
| 115 | AC_CHECK_LIB(ws2_32, _head_libws2_32_a) |
|---|
| 116 | AC_CHECK_FUNC(gethostbyname, ,[AC_CHECK_LIB(resolv, gethostbyname)]) |
|---|
| 117 | AC_CHECK_FUNC(gethostbyname, ,[AC_CHECK_LIB(nsl, gethostbyname)]) |
|---|
| 118 | |
|---|
| 119 | if test "x$ac_cv_lib_nsl_gethostbyname" != "xyes" && test "x$ac_cv_func_gethostbyname" != "xyes" ; then |
|---|
| 120 | AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(socket, gethostbyname)]) |
|---|
| 121 | fi |
|---|
| 122 | |
|---|
| 123 | if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname" ; then |
|---|
| 124 | AC_MSG_CHECKING([if we can include libnsl + libsocket]) |
|---|
| 125 | LIBS="-lnsl -lsocket $LIBS" |
|---|
| 126 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void) gethostbyname]])],[my_ac_link_result=yes],[my_ac_link_result=no ]) |
|---|
| 127 | if test "$my_ac_link_result" = "no" ; then |
|---|
| 128 | AC_MSG_RESULT([failure]) |
|---|
| 129 | AC_MSG_ERROR([unable to use gethostbyname()]) |
|---|
| 130 | else |
|---|
| 131 | AC_MSG_RESULT([success]) |
|---|
| 132 | fi |
|---|
| 133 | fi |
|---|
| 134 | |
|---|
| 135 | dnl res_query has been seen in libc, libbind and libresolv |
|---|
| 136 | if test "x-$ac_cv_header_resolv_h" = "x-yes" ; then |
|---|
| 137 | AC_CHECK_FUNCS(res_query) |
|---|
| 138 | if test "x-$ac_cv_func_res_query" = "x-yes" ; then |
|---|
| 139 | have_res_query=yes |
|---|
| 140 | else |
|---|
| 141 | AC_CHECK_LIB(resolv, res_query) |
|---|
| 142 | if test "x-$ac_cv_lib_resolv_res_query" = "x-yes" ; then |
|---|
| 143 | have_res_query=yes |
|---|
| 144 | else |
|---|
| 145 | AC_CHECK_LIB(bind, res_query) |
|---|
| 146 | if test "x-$ac_cv_lib_bind_res_query" = "x-yes" ; then |
|---|
| 147 | have_res_query=yes |
|---|
| 148 | else |
|---|
| 149 | dnl some glibcs have res_query as a macro, so work around it |
|---|
| 150 | AC_MSG_CHECKING([for res_query in -lresolv (alternate version)]) |
|---|
| 151 | save_libs="$LIBS" |
|---|
| 152 | LIBS="-lresolv $LIBS" |
|---|
| 153 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <resolv.h>]], |
|---|
| 154 | [[res_query(0,0,0,0,0)]])], |
|---|
| 155 | [AC_MSG_RESULT(yes) |
|---|
| 156 | have_res_query=yes], |
|---|
| 157 | [AC_MSG_RESULT(no) |
|---|
| 158 | LIBS="$save_libs"]) |
|---|
| 159 | fi |
|---|
| 160 | fi |
|---|
| 161 | fi |
|---|
| 162 | fi |
|---|
| 163 | |
|---|
| 164 | dnl windows calls it DnsQuery |
|---|
| 165 | if test "x-$ac_cv_header_windns_h" = "x-yes" ; then |
|---|
| 166 | AC_MSG_CHECKING([for DnsQuery in -ldnsapi]) |
|---|
| 167 | save_libs="$LIBS" |
|---|
| 168 | LIBS="-ldnsapi $LIBS" |
|---|
| 169 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <windows.h> |
|---|
| 170 | #include <windns.h>]], |
|---|
| 171 | [[DnsQuery(0,0,0,0,0,0)]])], |
|---|
| 172 | [AC_MSG_RESULT(yes) |
|---|
| 173 | have_dnsquery=yes], |
|---|
| 174 | [AC_MSG_RESULT(no) |
|---|
| 175 | LIBS="$save_libs"]) |
|---|
| 176 | fi |
|---|
| 177 | |
|---|
| 178 | if test "x-$have_res_query" = "x-yes" ; then |
|---|
| 179 | AC_DEFINE(HAVE_RES_QUERY,1,[Define to 1 if you have the 'res_query' function.]) |
|---|
| 180 | elif test "x-$have_dnsquery" = "x-yes" ; then |
|---|
| 181 | AC_DEFINE(HAVE_DNSQUERY,1,[Define to 1 if you have the 'DnsQuery' function.]) |
|---|
| 182 | else |
|---|
| 183 | AC_MSG_ERROR([no DNS resolver interface (res_query or DnsQuery) found]) |
|---|
| 184 | fi |
|---|
| 185 | |
|---|
| 186 | dnl inet_ntop/inet_pton have been seen in -lnsl, and sometimes not at all |
|---|
| 187 | AC_CHECK_FUNC(inet_ntop, ,[AC_CHECK_LIB(nsl, inet_ntop)]) |
|---|
| 188 | unset ac_cv_func_inet_ntop |
|---|
| 189 | AC_CHECK_FUNCS(inet_ntop inet_pton) |
|---|
| 190 | |
|---|
| 191 | dnl some glibcs have broken sockaddr_storage members |
|---|
| 192 | if test "x-$ac_cv_type_struct_sockaddr_storage" = "x-yes" ; then |
|---|
| 193 | AC_MSG_CHECKING(for broken __ss_family member in struct sockaddr_storage) |
|---|
| 194 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM(_IP6_INCLUDES, |
|---|
| 195 | [[do { |
|---|
| 196 | struct sockaddr_storage s; |
|---|
| 197 | s.__ss_family = 0; |
|---|
| 198 | } while(0)]])], |
|---|
| 199 | [AC_MSG_RESULT(yes) |
|---|
| 200 | AC_DEFINE(ss_family, __ss_family, |
|---|
| 201 | [Define to '__ss_family' if 'struct sockaddr_storage' defines '__ss_family' instead of 'ss_family'.])], |
|---|
| 202 | AC_MSG_RESULT(no)) |
|---|
| 203 | |
|---|
| 204 | AC_MSG_CHECKING(for broken __ss_len member in struct sockaddr_storage) |
|---|
| 205 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM(_IP6_INCLUDES, |
|---|
| 206 | [[do { |
|---|
| 207 | struct sockaddr_storage s; |
|---|
| 208 | s.__ss_len = 0; |
|---|
| 209 | } while(0)]])], |
|---|
| 210 | [AC_MSG_RESULT(yes) |
|---|
| 211 | AC_DEFINE(ss_len, __ss_len, |
|---|
| 212 | [Define to '__ss_len' if 'struct sockaddr_storage' defines '__ss_len' instead of 'ss_len'.])], |
|---|
| 213 | AC_MSG_RESULT(no)) |
|---|
| 214 | fi |
|---|
| 215 | |
|---|
| 216 | |
|---|
| 217 | dnl syslog |
|---|
| 218 | if test "x-$ac_cv_header_syslog_h" = "x-yes" ; then |
|---|
| 219 | AC_CHECK_FUNCS(syslog vsyslog) |
|---|
| 220 | fi |
|---|
| 221 | |
|---|
| 222 | if test "x-$ac_cv_header_windows_h" = "x-yes" ; then |
|---|
| 223 | AC_MSG_CHECKING(for ReportEvent) |
|---|
| 224 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <windows.h>]], |
|---|
| 225 | [[ReportEvent(0,0,0,0,0,0,0,0,0)]])], |
|---|
| 226 | [AC_MSG_RESULT(yes) |
|---|
| 227 | AC_DEFINE(HAVE_REPORTEVENT,1,[Define to 1 if you have the 'ReportEvent' function.])], |
|---|
| 228 | AC_MSG_RESULT(no)) |
|---|
| 229 | fi |
|---|
| 230 | |
|---|
| 231 | |
|---|
| 232 | dnl snprintf/vsnprintf don't exist everywhere. additionally, we require |
|---|
| 233 | dnl them to gracefully accept NULLs, which is non-standard |
|---|
| 234 | AC_CHECK_FUNCS(snprintf vsnprintf) |
|---|
| 235 | if test "x-$ac_cv_func_snprintf" = "x-yes" ; then |
|---|
| 236 | AC_MSG_CHECKING([if snprintf can handle NULL arguments]) |
|---|
| 237 | AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|---|
| 238 | #include <signal.h> |
|---|
| 239 | segv() { exit(1); } |
|---|
| 240 | main() { char b[10]; signal(SIGSEGV,segv); snprintf(b,10,"%s",NULL); exit(0); }]])], |
|---|
| 241 | AC_MSG_RESULT(yes), |
|---|
| 242 | [AC_MSG_RESULT(no) |
|---|
| 243 | AC_DEFINE(HAVE_BROKEN_SNPRINTF,1,[Define to 1 if 'snprintf' cannot handle NULL arguments.])]) |
|---|
| 244 | fi |
|---|
| 245 | if test "x-$ac_cv_func_vsnprintf" = "x-yes" ; then |
|---|
| 246 | AC_MSG_CHECKING([if vsnprintf can handle NULL arguments]) |
|---|
| 247 | AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> |
|---|
| 248 | #include <signal.h> |
|---|
| 249 | #include <stdarg.h> |
|---|
| 250 | segv() { exit(1); } |
|---|
| 251 | expand(char *f,...) { va_list ap; char b[10]; va_start(ap,f); vsnprintf(b,10,f,ap); va_end(ap); } |
|---|
| 252 | main() { char b[10]; signal(SIGSEGV,segv); expand("%s", NULL); exit(0); }]])], |
|---|
| 253 | AC_MSG_RESULT(yes), |
|---|
| 254 | [AC_MSG_RESULT(no) |
|---|
| 255 | AC_DEFINE(HAVE_BROKEN_VSNPRINTF,1,[Define to 1 if 'vsnprintf' cannot handle NULL arguments.])]) |
|---|
| 256 | fi |
|---|
| 257 | |
|---|
| 258 | |
|---|
| 259 | dnl |
|---|
| 260 | dnl external packages |
|---|
| 261 | dnl |
|---|
| 262 | |
|---|
| 263 | dnl find libidn >= 0.3.0 |
|---|
| 264 | AC_ARG_ENABLE(idn, AC_HELP_STRING([--enable-idn], [enable IDN support (yes)]), want_idn=$enableval, want_idn=yes) |
|---|
| 265 | if test "x-$want_idn" = "x-yes" ; then |
|---|
| 266 | AC_CHECK_HEADERS(stringprep.h) |
|---|
| 267 | if test "x-$ac_cv_header_stringprep_h" = "x-yes" ; then |
|---|
| 268 | AC_CHECK_LIB(idn, stringprep_check_version) |
|---|
| 269 | fi |
|---|
| 270 | if test "x-$ac_cv_lib_idn_stringprep_check_version" = "x-yes" ; then |
|---|
| 271 | AC_MSG_CHECKING(for Libidn version >= 0.3.0) |
|---|
| 272 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stringprep.h>]], |
|---|
| 273 | [[return !(stringprep_check_version("0.3.0"))]])], |
|---|
| 274 | [AC_MSG_RESULT(yes) |
|---|
| 275 | have_idn=yes], |
|---|
| 276 | AC_MSG_RESULT(no)) |
|---|
| 277 | fi |
|---|
| 278 | if test "x-$have_idn" = "x-" ; then |
|---|
| 279 | AC_MSG_ERROR([Libidn >= 0.3.0 not found]) |
|---|
| 280 | fi |
|---|
| 281 | |
|---|
| 282 | AC_DEFINE(HAVE_IDN,1,[Define to 1 if Libidn is available.]) |
|---|
| 283 | fi |
|---|
| 284 | |
|---|
| 285 | dnl |
|---|
| 286 | dnl Cyrus-SASL |
|---|
| 287 | dnl |
|---|
| 288 | AC_CHECK_LIB(sasl2, sasl_client_init, [], |
|---|
| 289 | [AC_MSG_ERROR([Cyrus-SASL library not found])]) |
|---|
| 290 | AC_CHECK_HEADERS("sasl/sasl.h", , |
|---|
| 291 | [AC_MSG_ERROR([Cyrus-SASL development headers not found])]) |
|---|
| 292 | |
|---|
| 293 | |
|---|
| 294 | dnl find openssl >= 0.9.6b |
|---|
| 295 | AC_ARG_ENABLE(ssl, AC_HELP_STRING([--enable-ssl], [enable SSL/TLS support (yes)]), want_ssl=$enableval, want_ssl=yes) |
|---|
| 296 | if test "x-$want_ssl" = "x-yes" ; then |
|---|
| 297 | AC_CHECK_HEADERS(openssl/crypto.h) |
|---|
| 298 | if test "x-$ac_cv_header_openssl_crypto_h" = "x-yes" ; then |
|---|
| 299 | AC_CHECK_LIB(crypto, CRYPTO_lock) |
|---|
| 300 | fi |
|---|
| 301 | if test "x-$ac_cv_lib_crypto_CRYPTO_lock" = "x-yes" ; then |
|---|
| 302 | AC_CHECK_HEADERS(openssl/ssl.h) |
|---|
| 303 | fi |
|---|
| 304 | if test "x-$ac_cv_header_openssl_ssl_h" = "x-yes" ; then |
|---|
| 305 | AC_CHECK_LIB(ssl, SSL_connect) |
|---|
| 306 | fi |
|---|
| 307 | if test "x-$ac_cv_lib_ssl_SSL_connect" = "x-yes" ; then |
|---|
| 308 | AC_MSG_CHECKING(for OpenSSL version >= 0.9.6b) |
|---|
| 309 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <openssl/opensslv.h>]], |
|---|
| 310 | [[return !(SSLeay() >= 0x000906020L)]])], |
|---|
| 311 | [AC_MSG_RESULT(yes) |
|---|
| 312 | have_openssl=yes], |
|---|
| 313 | AC_MSG_RESULT(no)) |
|---|
| 314 | fi |
|---|
| 315 | if test "x-$have_openssl" = "x-" ; then |
|---|
| 316 | AC_MSG_ERROR([OpenSSL >= 0.9.6b not found]) |
|---|
| 317 | fi |
|---|
| 318 | |
|---|
| 319 | AC_DEFINE(HAVE_SSL,1,[Define to 1 if OpenSSL is available.]) |
|---|
| 320 | fi |
|---|
| 321 | |
|---|
| 322 | dnl find expat |
|---|
| 323 | AC_ARG_ENABLE(expat, AC_HELP_STRING([--enable-expat], [enable expat (yes)]), want_expat=$enableval, want_expat=yes) |
|---|
| 324 | if test "x-$want_expat" = "x-yes" ; then |
|---|
| 325 | AC_CHECK_HEADERS(expat.h) |
|---|
| 326 | LIBS="-lexpat $LIBS" |
|---|
| 327 | fi |
|---|
| 328 | |
|---|
| 329 | |
|---|
| 330 | dnl |
|---|
| 331 | dnl optional libs |
|---|
| 332 | dnl |
|---|
| 333 | |
|---|
| 334 | dnl mysql |
|---|
| 335 | AC_ARG_ENABLE(mysql, AC_HELP_STRING([--enable-mysql], [enable MySQL auth/reg/storage support (yes)]), |
|---|
| 336 | want_mysql=$enableval, want_mysql=yes) |
|---|
| 337 | if test "x-$want_mysql" = "x-yes" ; then |
|---|
| 338 | AC_CHECK_HEADERS(mysql.h) |
|---|
| 339 | if test "x-$ac_cv_header_mysql_h" != "x-yes" ; then |
|---|
| 340 | for incpath in /usr/include/mysql /usr/local/include/mysql; do |
|---|
| 341 | if test "x-$ac_cv_header_mysql_h" != "x-yes" ; then |
|---|
| 342 | AC_MSG_CHECKING([for mysql.h in $incpath]) |
|---|
| 343 | save_cppflags="$CPPFLAGS" |
|---|
| 344 | CPPFLAGS="-I$incpath $CPPFLAGS" |
|---|
| 345 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mysql.h>]])], |
|---|
| 346 | [AC_MSG_RESULT(yes) |
|---|
| 347 | AC_DEFINE(HAVE_MYSQL_H,,[Define if you have mysql.h]) |
|---|
| 348 | ac_cv_header_mysql_h=yes], |
|---|
| 349 | AC_MSG_RESULT(no)) |
|---|
| 350 | if test "x-$ac_cv_header_mysql_h" != "x-yes" ; then |
|---|
| 351 | CPPFLAGS="$save_cppflags" |
|---|
| 352 | fi |
|---|
| 353 | fi |
|---|
| 354 | done |
|---|
| 355 | fi |
|---|
| 356 | if test "x-$ac_cv_header_mysql_h" = "x-yes" ; then |
|---|
| 357 | AC_CHECK_LIB(mysqlclient, mysql_init) |
|---|
| 358 | fi |
|---|
| 359 | if test "x-$ac_cv_lib_mysqlclient_mysql_init" != "x-yes" ; then |
|---|
| 360 | AC_MSG_ERROR([MySQL client libraries not found]) |
|---|
| 361 | else |
|---|
| 362 | AC_DEFINE(STORAGE_MYSQL,1,[Define to 1 if you want to use MySQL for auth/reg/storage.]) |
|---|
| 363 | fi |
|---|
| 364 | fi |
|---|
| 365 | |
|---|
| 366 | |
|---|
| 367 | dnl postgresql |
|---|
| 368 | AC_ARG_ENABLE(pgsql, AC_HELP_STRING([--enable-pgsql], [enable PostgreSQL auth/reg/storage support (no)]), |
|---|
| 369 | want_pgsql=$enableval, want_pgsql=no) |
|---|
| 370 | if test "x-$want_pgsql" = "x-yes" ; then |
|---|
| 371 | AC_CHECK_HEADERS(libpq-fe.h) |
|---|
| 372 | if test "x-$ac_cv_header_libpq_fe_h" != "x-yes" ; then |
|---|
| 373 | for incpath in /usr/include/postgresql /usr/local/include/postgresql; do |
|---|
| 374 | if test "x-$ac_cv_header_libpq_fe_h" != "x-yes" ; then |
|---|
| 375 | AC_MSG_CHECKING([for libpq-fe.h in $incpath]) |
|---|
| 376 | save_cppflags="$CPPFLAGS" |
|---|
| 377 | CPPFLAGS="-I$incpath $CPPFLAGS" |
|---|
| 378 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libpq-fe.h>]])], |
|---|
| 379 | [AC_MSG_RESULT(yes) |
|---|
| 380 | AC_DEFINE(HAVE_LIBPQ_FE_H,,[Define if you have libpq_fe.h]) |
|---|
| 381 | ac_cv_header_libpq_fe_h=yes], |
|---|
| 382 | AC_MSG_RESULT(no)) |
|---|
| 383 | if test "x-$ac_cv_header_libpq_fe_h" != "x-yes" ; then |
|---|
| 384 | CPPFLAGS="$save_cppflags" |
|---|
| 385 | fi |
|---|
| 386 | fi |
|---|
| 387 | done |
|---|
| 388 | fi |
|---|
| 389 | if test "x-$ac_cv_header_libpq_fe_h" = "x-yes" ; then |
|---|
| 390 | AC_CHECK_LIB(pq, PQsetdbLogin) |
|---|
| 391 | fi |
|---|
| 392 | if test "x-$ac_cv_lib_pq_PQsetdbLogin" != "x-yes" ; then |
|---|
| 393 | AC_MSG_ERROR([PostgreSQL client libraries not found]) |
|---|
| 394 | else |
|---|
| 395 | AC_DEFINE(STORAGE_PGSQL,1,[Define to 1 if you want to use PostgreSQL for auth/reg/storage.]) |
|---|
| 396 | fi |
|---|
| 397 | fi |
|---|
| 398 | |
|---|
| 399 | |
|---|
| 400 | dnl SQLite 3 |
|---|
| 401 | AC_ARG_ENABLE(sqlite, AC_HELP_STRING([--enable-sqlite], [enable SQLite 3 storage support (no)]), |
|---|
| 402 | want_sqlite=$enableval, want_sqlite=no) |
|---|
| 403 | if test "x-$want_sqlite" = "x-yes" ; then |
|---|
| 404 | AC_CHECK_HEADERS(sqlite3.h) |
|---|
| 405 | if test "x-$ac_cv_header_sqlite3_h" = "x-yes" ; then |
|---|
| 406 | AC_CHECK_LIB(sqlite3, sqlite3_open) |
|---|
| 407 | fi |
|---|
| 408 | if test "x-$ac_cv_lib_sqlite3_sqlite3_open" != "x-yes" ; then |
|---|
| 409 | AC_MSG_ERROR([SQLite 3 library not found]) |
|---|
| 410 | else |
|---|
| 411 | AC_DEFINE(STORAGE_SQLITE,1,[Define to 1 if you want to use SQLite 3 for storage.]) |
|---|
| 412 | fi |
|---|
| 413 | fi |
|---|
| 414 | |
|---|
| 415 | |
|---|
| 416 | dnl berkeley db |
|---|
| 417 | AC_ARG_ENABLE(db, AC_HELP_STRING([--enable-db], [enable Berkeley DB auth/reg/storage support (no)]), |
|---|
| 418 | want_db=$enableval, want_db=no) |
|---|
| 419 | if test "x-$want_db" = "x-yes" ; then |
|---|
| 420 | AC_CHECK_HEADERS(db.h) |
|---|
| 421 | if test "x-$ac_cv_header_db_h" = "x-yes" ; then |
|---|
| 422 | for lib in db-4.3 db-4.2 db-4.1 db-4 db4 db41 db ; do |
|---|
| 423 | if test "x-$have_db_version" != "x-yes" ; then |
|---|
| 424 | AC_MSG_CHECKING([for db_create in -l$lib]) |
|---|
| 425 | save_libs="$LIBS" |
|---|
| 426 | LIBS="-l$lib $LIBS" |
|---|
| 427 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <db.h>]], |
|---|
| 428 | [[db_create(0,0,0)]])], |
|---|
| 429 | [AC_MSG_RESULT(yes) |
|---|
| 430 | AC_MSG_CHECKING(for Berkeley DB version >= 4.1.25) |
|---|
| 431 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <db.h>]], |
|---|
| 432 | [[do { |
|---|
| 433 | int major, minor, patch; |
|---|
| 434 | db_version(&major, &minor, &patch); |
|---|
| 435 | if(major < 4 || |
|---|
| 436 | (major == 4 && minor < 1) || |
|---|
| 437 | (major == 4 && minor == 1 && patch < 24)) |
|---|
| 438 | return 1; |
|---|
| 439 | } while(0)]])], |
|---|
| 440 | [AC_MSG_RESULT(yes) |
|---|
| 441 | have_db_version=yes], |
|---|
| 442 | AC_MSG_RESULT(no))], |
|---|
| 443 | AC_MSG_RESULT(no)) |
|---|
| 444 | if test "x-$have_db_version" = "x-" ; then |
|---|
| 445 | LIBS="$save_libs" |
|---|
| 446 | fi |
|---|
| 447 | fi |
|---|
| 448 | done |
|---|
| 449 | fi |
|---|
| 450 | if test "x-$have_db_version" != "x-yes" ; then |
|---|
| 451 | AC_MSG_ERROR([Berkeley DB >= 4.1.24 not found]) |
|---|
| 452 | else |
|---|
| 453 | AC_DEFINE(STORAGE_DB,1,[Define to 1 if you want to use Berkeley DB for auth/reg/storage.]) |
|---|
| 454 | fi |
|---|
| 455 | fi |
|---|
| 456 | |
|---|
| 457 | |
|---|
| 458 | dnl openldap |
|---|
| 459 | AC_ARG_ENABLE(ldap, AC_HELP_STRING([--enable-ldap], [enable OpenLDAP auth/reg support (no)]), |
|---|
| 460 | want_ldap=$enableval, want_ldap=no) |
|---|
| 461 | if test "x-$want_ldap" = "x-yes" ; then |
|---|
| 462 | AC_CHECK_HEADERS(lber.h ldap.h) |
|---|
| 463 | if test "x-$ac_cv_header_ldap_h" = "x-yes" -a "x-$ac_cv_header_lber_h" = "x-yes" ; then |
|---|
| 464 | AC_CHECK_LIB(lber, ber_alloc) |
|---|
| 465 | AC_CHECK_LIB(ldap, ldap_init) |
|---|
| 466 | fi |
|---|
| 467 | if test "x-$ac_cv_lib_lber_ber_alloc" = "x-yes" -a "x-$ac_cv_lib_ldap_ldap_init" = "x-yes" ; then |
|---|
| 468 | AC_MSG_CHECKING(for OpenLDAP version >= 2.1.0) |
|---|
| 469 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <lber.h> |
|---|
| 470 | #include <ldap.h>]], |
|---|
| 471 | [[do { |
|---|
| 472 | LDAPAPIInfo info; |
|---|
| 473 | info.ldapai_info_version = LDAP_API_INFO_VERSION; |
|---|
| 474 | ldap_get_option(0, LDAP_OPT_API_INFO, &info); |
|---|
| 475 | if(info.ldapai_vendor_version != LDAP_VENDOR_VERSION || LDAP_VENDOR_VERSION < 2004) |
|---|
| 476 | return 1; |
|---|
| 477 | } while(0)]])], |
|---|
| 478 | [AC_MSG_RESULT(yes) |
|---|
| 479 | have_ldap_version=yes], |
|---|
| 480 | AC_MSG_RESULT(no)) |
|---|
| 481 | fi |
|---|
| 482 | if test "x-$want_ldap" = "x-yes" -a "x-$have_ldap_version" = "x-" ; then |
|---|
| 483 | AC_MSG_ERROR([OpenLDAP client libraries >= 2.1.0 not found]) |
|---|
| 484 | else |
|---|
| 485 | AC_DEFINE(STORAGE_LDAP,1,[Define to 1 if you want to use OpenLDAP for auth/reg.]) |
|---|
| 486 | fi |
|---|
| 487 | fi |
|---|
| 488 | |
|---|
| 489 | |
|---|
| 490 | dnl pam |
|---|
| 491 | AC_ARG_ENABLE(pam, AC_HELP_STRING([--enable-pam], [enable PAM auth/reg support (no)]), |
|---|
| 492 | want_pam=$enableval, want_pam=no) |
|---|
| 493 | if test "x-$want_pam" = "x-yes" ; then |
|---|
| 494 | AC_CHECK_HEADERS(security/pam_appl.h) |
|---|
| 495 | if test "x-$ac_cv_header_security_pam_appl_h" = "x-yes" ; then |
|---|
| 496 | AC_CHECK_LIB(pam, pam_start) |
|---|
| 497 | fi |
|---|
| 498 | if test "x-$ac_cv_lib_pam_pam_start" != "x-yes" ; then |
|---|
| 499 | AC_MSG_ERROR([PAM application libraries not found]) |
|---|
| 500 | else |
|---|
| 501 | AC_DEFINE(STORAGE_PAM,1,[Define to 1 if you want to use PAM for auth/reg.]) |
|---|
| 502 | fi |
|---|
| 503 | fi |
|---|
| 504 | |
|---|
| 505 | |
|---|
| 506 | dnl pipe (not really an external package, but does need some checks) |
|---|
| 507 | AC_ARG_ENABLE(pipe, AC_HELP_STRING([--enable-pipe], [enable pipe auth/reg support (no)]), |
|---|
| 508 | want_pipe=$enableval, want_pipe=no) |
|---|
| 509 | if test "x-$want_pipe" = "x-yes" ; then |
|---|
| 510 | AC_CHECK_HEADERS(sys/wait.h) |
|---|
| 511 | AC_FUNC_FORK |
|---|
| 512 | AC_CHECK_FUNCS(pipe wait) |
|---|
| 513 | if test "x-$ac_cv_header_sys_wait_h" != "x-yes" -o \ |
|---|
| 514 | "x-$ac_cv_func_fork" != "x-yes" -o \ |
|---|
| 515 | "x-$ac_cv_func_pipe" != "x-yes" -o \ |
|---|
| 516 | "x-$ac_cv_func_wait" != "x-yes" ; then |
|---|
| 517 | AC_MSG_ERROR([Pipe auth/reg requirements (sys/wait.h, fork(), pipe(), wait()) not found]) |
|---|
| 518 | else |
|---|
| 519 | AC_DEFINE(STORAGE_PIPE,1,[Define to 1 if you want to use pipes for auth/reg.]) |
|---|
| 520 | fi |
|---|
| 521 | fi |
|---|
| 522 | |
|---|
| 523 | |
|---|
| 524 | dnl anon |
|---|
| 525 | AC_ARG_ENABLE(anon, AC_HELP_STRING([--enable-anon], [enable anonymous auth/reg support (no)]), |
|---|
| 526 | want_anon=$enableval, want_anon=no) |
|---|
| 527 | if test "x-$want_anon" = "x-yes" ; then |
|---|
| 528 | AC_DEFINE(STORAGE_ANON,1,[Define to 1 if you want anonymous auth.]) |
|---|
| 529 | fi |
|---|
| 530 | |
|---|
| 531 | |
|---|
| 532 | dnl filesystem storage |
|---|
| 533 | AC_ARG_ENABLE(fs, AC_HELP_STRING([--enable-fs], [enable filesystem storage support (no)]), |
|---|
| 534 | want_fs=$enableval, want_fs=no) |
|---|
| 535 | if test "x-$want_fs" = "x-yes" ; then |
|---|
| 536 | AC_DEFINE(STORAGE_FS,1,[Define to 1 if you want to use the filesystem for storage.]) |
|---|
| 537 | fi |
|---|
| 538 | |
|---|
| 539 | dnl Oracle |
|---|
| 540 | AC_ARG_WITH(oracle-home, |
|---|
| 541 | [ --with-oracle-home=DIR the Oracle home directory, for includes and libs. ], |
|---|
| 542 | [ ac_oracle_home="$withval" ]) |
|---|
| 543 | |
|---|
| 544 | AC_ARG_ENABLE(oracle, AC_HELP_STRING([--enable-oracle], [enable Oracle auth/reg/storage support (no)]), |
|---|
| 545 | want_oracle=$enableval, want_oracle=no) |
|---|
| 546 | if test "x-$want_oracle" = "x-yes" ; then |
|---|
| 547 | AC_CHECK_HEADERS(oci.h) |
|---|
| 548 | if test "x-$ac_cv_header_oci_h" != "x-yes" ; then |
|---|
| 549 | if test -n $ac_oracle_home ; then |
|---|
| 550 | AC_MSG_CHECKING([for oci.h in $ac_oracle_home]) |
|---|
| 551 | save_cppflags="$CPPFLAGS" |
|---|
| 552 | CPPFLAGS="-I$ac_oracle_home/rdbms/demo -I$ac_oracle_home/rdbms/public $CPPFLAGS" |
|---|
| 553 | save_libs="$LIBS" |
|---|
| 554 | LIBS="-L$ac_oracle_home/lib $LIBS" |
|---|
| 555 | save_ldflags="$LDFLAGS" |
|---|
| 556 | LDFLAGS="-Wl,-rpath,$ac_oracle_home/lib $LDFLAGS" |
|---|
| 557 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <oci.h>]])], |
|---|
| 558 | [AC_MSG_RESULT(yes) |
|---|
| 559 | AC_DEFINE(HAVE_OCI_H,,[Define if you have oci.h]) |
|---|
| 560 | ac_cv_header_oci_h=yes], |
|---|
| 561 | AC_MSG_RESULT(no)) |
|---|
| 562 | if test "x-$ac_cv_header_oci_h" != "x-yes" ; then |
|---|
| 563 | CPPFLAGS="$save_cppflags" |
|---|
| 564 | LIBS="$save_libs" |
|---|
| 565 | LDFLAGS="$save_ldflags" |
|---|
| 566 | fi |
|---|
| 567 | fi |
|---|
| 568 | fi |
|---|
| 569 | if test "x-$ac_cv_header_oci_h" = "x-yes" ; then |
|---|
| 570 | AC_CHECK_LIB(clntsh, OCIInitialize) |
|---|
| 571 | fi |
|---|
| 572 | if test "x-$ac_cv_lib_clntsh_OCIInitialize" != "x-yes" ; then |
|---|
| 573 | AC_MSG_ERROR([Oracle client libraries not found]) |
|---|
| 574 | else |
|---|
| 575 | AC_DEFINE(STORAGE_ORACLE,1,[Define to 1 if you want to use Oracle for auth/reg/storage.]) |
|---|
| 576 | fi |
|---|
| 577 | fi |
|---|
| 578 | |
|---|
| 579 | |
|---|
| 580 | |
|---|
| 581 | dnl |
|---|
| 582 | dnl generic system types |
|---|
| 583 | dnl |
|---|
| 584 | AC_CREATE_STDINT_H(ac-stdint.h) |
|---|
| 585 | |
|---|
| 586 | |
|---|
| 587 | |
|---|
| 588 | |
|---|
| 589 | dnl |
|---|
| 590 | dnl typedefs, structs, compiler quirks |
|---|
| 591 | dnl |
|---|
| 592 | AC_TYPE_MODE_T |
|---|
| 593 | AC_TYPE_OFF_T |
|---|
| 594 | AC_TYPE_PID_T |
|---|
| 595 | AC_TYPE_SIZE_T |
|---|
| 596 | AC_STRUCT_TM |
|---|
| 597 | AC_STRUCT_TIMEZONE |
|---|
| 598 | |
|---|
| 599 | |
|---|
| 600 | dnl |
|---|
| 601 | dnl ipv6 stuff |
|---|
| 602 | dnl |
|---|
| 603 | AC_DEFUN([_IP6_INCLUDES],[[ |
|---|
| 604 | #include "ac-stdint.h" |
|---|
| 605 | #ifdef HAVE_SYS_TYPES_H |
|---|
| 606 | # include <sys/types.h> |
|---|
| 607 | #endif |
|---|
| 608 | #ifdef HAVE_SYS_SOCKET_H |
|---|
| 609 | # include <sys/socket.h> |
|---|
| 610 | #endif |
|---|
| 611 | #ifdef HAVE_NETINET_IN_H |
|---|
| 612 | # include <netinet/in.h> |
|---|
| 613 | #endif |
|---|
| 614 | #ifdef HAVE_ARPA_INET_H |
|---|
| 615 | # include <arpa/inet.h> |
|---|
| 616 | #endif |
|---|
| 617 | ]]) |
|---|
| 618 | |
|---|
| 619 | dnl these types are missing in places |
|---|
| 620 | AC_CHECK_TYPES([in_port_t, sa_family_t, struct sockaddr_storage, struct sockaddr_in6, struct in6_addr],,, _IP6_INCLUDES) |
|---|
| 621 | |
|---|
| 622 | |
|---|
| 623 | dnl |
|---|
| 624 | dnl mio backend checks |
|---|
| 625 | dnl |
|---|
| 626 | AC_ARG_ENABLE(mio, AC_HELP_STRING([--enable-mio=BACKEND], [use BACKEND to drive MIO]), |
|---|
| 627 | mio_check=$enableval, mio_check='epoll poll select') |
|---|
| 628 | |
|---|
| 629 | mio_backend='' |
|---|
| 630 | for backend in $mio_check ; do |
|---|
| 631 | case x-$backend in |
|---|
| 632 | |
|---|
| 633 | x-epoll) |
|---|
| 634 | AC_CHECK_HEADERS(sys/epoll.h) |
|---|
| 635 | if test "x-$ac_cv_header_sys_epoll_h" = "x-yes" ; then |
|---|
| 636 | AC_CHECK_FUNCS(epoll_create,[ |
|---|
| 637 | mio_backend='epoll' |
|---|
| 638 | AC_DEFINE(MIO_EPOLL,1,[Define to 1 if you want to use 'epoll' for non-blocking I/O.])]) |
|---|
| 639 | fi |
|---|
| 640 | ;; |
|---|
| 641 | |
|---|
| 642 | x-poll) |
|---|
| 643 | AC_CHECK_HEADERS(poll.h) |
|---|
| 644 | if test "x-$ac_cv_header_poll_h" = "x-yes" ; then |
|---|
| 645 | AC_CHECK_FUNCS(poll,[ |
|---|
| 646 | mio_backend='poll' |
|---|
| 647 | AC_DEFINE(MIO_POLL,1,[Define to 1 if you want to use 'poll' for non-blocking I/O.])]) |
|---|
| 648 | fi |
|---|
| 649 | ;; |
|---|
| 650 | |
|---|
| 651 | x-select) |
|---|
| 652 | AC_CHECK_HEADERS(sys/select.h) |
|---|
| 653 | if test "x-$ac_cv_header_sys_select_h" = "x-yes" ; then |
|---|
| 654 | AC_CHECK_FUNCS(select, have_select=yes) |
|---|
| 655 | fi |
|---|
| 656 | |
|---|
| 657 | if test "x-$have_select" != "x-yes" -a "x-$ac_cv_header_winsock2_h" = "x-yes" ; then |
|---|
| 658 | AC_MSG_CHECKING([for select in ws2_32]) |
|---|
| 659 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]], |
|---|
| 660 | [[select(0,0,0,0,0)]])], |
|---|
| 661 | [AC_MSG_RESULT(yes) |
|---|
| 662 | have_select=yes], |
|---|
| 663 | AC_MSG_RESULT(no)) |
|---|
| 664 | fi |
|---|
| 665 | |
|---|
| 666 | if test "x-$have_select" = "x-yes" ; then |
|---|
| 667 | mio_backend='select' |
|---|
| 668 | AC_DEFINE(MIO_SELECT,1,[Define to 1 if you want to use 'select' for non-blocking I/O.]) |
|---|
| 669 | fi |
|---|
| 670 | ;; |
|---|
| 671 | esac |
|---|
| 672 | done |
|---|
| 673 | |
|---|
| 674 | if test "x-$mio_backend" = "x-" ; then |
|---|
| 675 | AC_MSG_ERROR([no MIO backend available out of: $backend]) |
|---|
| 676 | fi |
|---|
| 677 | |
|---|
| 678 | |
|---|
| 679 | dnl functions we need |
|---|
| 680 | AC_FUNC_MALLOC |
|---|
| 681 | AC_FUNC_MEMCMP |
|---|
| 682 | AC_FUNC_MKTIME |
|---|
| 683 | AC_FUNC_REALLOC |
|---|
| 684 | AC_FUNC_STAT |
|---|
| 685 | AC_FUNC_VPRINTF |
|---|
| 686 | AC_CHECK_FUNCS( \ |
|---|
| 687 | close \ |
|---|
| 688 | dup2 \ |
|---|
| 689 | fcntl \ |
|---|
| 690 | inet_aton \ |
|---|
| 691 | ioctl \ |
|---|
| 692 | isascii \ |
|---|
| 693 | _findfirst \ |
|---|
| 694 | getopt \ |
|---|
| 695 | gettimeofday \ |
|---|
| 696 | getpid \ |
|---|
| 697 | _getpid \ |
|---|
| 698 | memchr \ |
|---|
| 699 | memmove \ |
|---|
| 700 | memset \ |
|---|
| 701 | mkdir \ |
|---|
| 702 | _mkdir \ |
|---|
| 703 | modf \ |
|---|
| 704 | sleep \ |
|---|
| 705 | Sleep \ |
|---|
| 706 | strcasecmp \ |
|---|
| 707 | stricmp \ |
|---|
| 708 | strchr \ |
|---|
| 709 | strdup \ |
|---|
| 710 | strerror \ |
|---|
| 711 | strncasecmp \ |
|---|
| 712 | strnicmp \ |
|---|
| 713 | strstr \ |
|---|
| 714 | tzset \ |
|---|
| 715 | uname \ |
|---|
| 716 | getpagesize ) |
|---|
| 717 | |
|---|
| 718 | dnl windows has different names for a few basic things |
|---|
| 719 | if test "x-$ac_cv_func_getpid" != "x-yes" -a "x-$ac_cv_func__getpid" = "x-yes" ; then |
|---|
| 720 | AC_DEFINE(getpid,_getpid,[Define to a function than can provide getpid(2) functionality.]) |
|---|
| 721 | fi |
|---|
| 722 | |
|---|
| 723 | if test "x-$ac_cv_func_sleep" != "x-yes" -a "x-$ac_cv_func_Sleep" = "x-yes" ; then |
|---|
| 724 | AC_DEFINE(sleep,Sleep,[Define to a function than can provide sleep(2) functionality.]) |
|---|
| 725 | fi |
|---|
| 726 | |
|---|
| 727 | if test "x-$ac_cv_func_strcasecmp" != "x-yes" -a "x-$ac_cv_func_stricmp" = "x-yes" ; then |
|---|
| 728 | AC_DEFINE(strcasecmp,stricmp,[Define to a function than can provide strcasecmp(3) functionality.]) |
|---|
| 729 | fi |
|---|
| 730 | |
|---|
| 731 | if test "x-$ac_cv_func_strncasecmp" != "x-yes" -a "x-$ac_cv_func_strnicmp" = "x-yes" ; then |
|---|
| 732 | AC_DEFINE(strncasecmp,strnicmp,[Define to a function than can provide strncasecmp(3) functionality.]) |
|---|
| 733 | fi |
|---|
| 734 | |
|---|
| 735 | dnl winsock substitutions |
|---|
| 736 | if test "x-$ac_cv_func_close" != "x-yes" ; then |
|---|
| 737 | AC_MSG_CHECKING(for closesocket) |
|---|
| 738 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]], |
|---|
| 739 | [[closesocket(0)]])], |
|---|
| 740 | [AC_MSG_RESULT(yes) |
|---|
| 741 | AC_DEFINE(close,closesocket,[Define to a function than can provide close(2) functionality.])], |
|---|
| 742 | AC_DEFINE(HAVE_CLOSE,1,[Define to 1 if you have the 'close' function.]) |
|---|
| 743 | AC_MSG_RESULT(no)) |
|---|
| 744 | fi |
|---|
| 745 | |
|---|
| 746 | if test "x-$ac_cv_func_ioctl" != "x-yes" ; then |
|---|
| 747 | AC_MSG_CHECKING(for ioctlsocket) |
|---|
| 748 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]], |
|---|
| 749 | [[ioctlsocket(0,0,0)]])], |
|---|
| 750 | [AC_MSG_RESULT(yes) |
|---|
| 751 | AC_DEFINE(ioctl,ioctlsocket,[Define to a function than can provide ioctl(2) functionality.])], |
|---|
| 752 | AC_DEFINE(HAVE_IOCTL,1,[Define to 1 if you have the 'ioctl' function.]) |
|---|
| 753 | AC_MSG_RESULT(no)) |
|---|
| 754 | fi |
|---|
| 755 | |
|---|
| 756 | |
|---|
| 757 | dnl |
|---|
| 758 | dnl debugging |
|---|
| 759 | dnl |
|---|
| 760 | AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debug messages]), |
|---|
| 761 | want_debug=$enableval, want_debug=no) |
|---|
| 762 | if test "x-$want_debug" = "x-yes" ; then |
|---|
| 763 | AC_DEFINE(DEBUG,1,[Define to 1 if you want to get debug output with -D.]) |
|---|
| 764 | AC_DEFINE(SX_DEBUG,1,[Define to 1 if you want to get SX debug output with -D.]) |
|---|
| 765 | fi |
|---|
| 766 | |
|---|
| 767 | AC_ARG_ENABLE(nad_debug, AC_HELP_STRING([--enable-nad-debug], [enable NAD pointer tracking]), |
|---|
| 768 | want_nad_debug=$enableval, want_nad_debug=no) |
|---|
| 769 | if test "x-$want_nad_debug" = "x-yes" ; then |
|---|
| 770 | AC_DEFINE(NAD_DEBUG,1,[Define to 1 if you want to enable NAD pointer tracking.]) |
|---|
| 771 | fi |
|---|
| 772 | |
|---|
| 773 | AC_ARG_ENABLE(pool_debug, AC_HELP_STRING([--enable-pool-debug], [enable memory pool statistics]), |
|---|
| 774 | want_pool_debug=$enableval, want_pool_debug=no) |
|---|
| 775 | if test "x-$want_pool_debug" = "x-yes" ; then |
|---|
| 776 | AC_DEFINE(POOL_DEBUG,1,[Define to 1 if you want to enable memory pool statistics.]) |
|---|
| 777 | fi |
|---|
| 778 | |
|---|
| 779 | AC_ARG_ENABLE(mio_debug, AC_HELP_STRING([--enable-mio-debug], [enable managed IO debug output]), |
|---|
| 780 | want_mio_debug=$enableval, want_mio_debug=no) |
|---|
| 781 | if test "x-$want_mio_debug" = "x-yes" ; then |
|---|
| 782 | AC_DEFINE(MIO_DEBUG,1,[Define to 1 if you want to enable managed IO debug output.]) |
|---|
| 783 | fi |
|---|
| 784 | |
|---|
| 785 | |
|---|
| 786 | dnl |
|---|
| 787 | dnl finishing up |
|---|
| 788 | dnl |
|---|
| 789 | |
|---|
| 790 | dnl put our config in its own subdir |
|---|
| 791 | sysconfdir="$sysconfdir/jabberd" |
|---|
| 792 | |
|---|
| 793 | dnl done! |
|---|
| 794 | AC_OUTPUT(Makefile \ |
|---|
| 795 | etc/Makefile \ |
|---|
| 796 | etc/templates/Makefile \ |
|---|
| 797 | tools/Makefile \ |
|---|
| 798 | man/Makefile \ |
|---|
| 799 | mio/Makefile \ |
|---|
| 800 | subst/Makefile \ |
|---|
| 801 | sx/Makefile \ |
|---|
| 802 | util/Makefile \ |
|---|
| 803 | c2s/Makefile \ |
|---|
| 804 | resolver/Makefile \ |
|---|
| 805 | router/Makefile \ |
|---|
| 806 | s2s/Makefile \ |
|---|
| 807 | sm/Makefile \ |
|---|
| 808 | Doxyfile) |
|---|