]> jfr.im git - irc/evilnet/x3.git/blame - configure.in
make oper_ldap_group membership level configurable
[irc/evilnet/x3.git] / configure.in
CommitLineData
d76ed9a9 1dnl Process this file with autoconf to create a configure script.
2
3dnl General initialization.
4AC_REVISION([$Id$])
d82cf2f0 5AC_PREREQ(2.60)
90746c83 6AC_INIT([X3],[1.6],[evilnet-devel@lists.sourceforge.net])
ceafd592 7CODENAME=X3
d76ed9a9 8AC_CONFIG_HEADERS(src/config.h)
9AC_CONFIG_SRCDIR(src/opserv.c)
10dnl AM_CANONICAL_TARGET must be before AM_INIT_AUTOMAKE() or autoconf whines
11AC_CANONICAL_TARGET
12AM_INIT_AUTOMAKE([gnu 1.6])
13AM_MAINTAINER_MODE
14
15dnl Compiler/runtime feature checks.
16AC_TYPE_SIGNAL
17AC_C_CONST
0f6fe38c 18AC_C_INLINE
d76ed9a9 19
20dnl Checks for programs.
21AC_PROG_AWK
22AC_PROG_CC
d76ed9a9 23AC_PROG_INSTALL
0f6fe38c 24
35305a49 25AC_PROG_RANLIB
0f6fe38c 26dnl AC_PROG_LIBTOOL
35305a49 27
d76ed9a9 28AC_PROG_LN_S
29AC_PROG_MAKE_SET
30AC_PROG_GCC_TRADITIONAL
5b1166fd 31AC_CHECK_PROG(MAKER, gmake, gmake, make)
d76ed9a9 32
33dnl nice that unixes can all follow a standard.
34case $target in
35 *-freebsd2* | *-freebsdelf2* | *-freebsd*out3*)
36 ANSI_SRC=""
37 ;;
38 *-freebsd3* | *-freebsdelf3* | *-freebsd*out3*)
39 ANSI_SRC=""
d76ed9a9 40 ;;
41 *-solaris*)
42 EXTRA_DEFINE="-D__SOLARIS__"
43 ANSI_SRC="-fno-builtin"
44 ;;
45 *-cygwin)
46 ANSI_SRC="-fno-builtin"
47 ;;
48 *-linux*)
49 dnl -D_GNU_SOURCE needed for strsignal()
50 EXTRA_DEFINE="-D_GNU_SOURCE"
51 ANSI_SRC=""
52 ;;
53 *)
54 ANSI_SRC=""
55 ;;
56esac
57CFLAGS="$CFLAGS $EXTRA_DEFINE"
58
59dnl Checks for libraries.
60AC_CHECK_LIB(socket, socket)
61AC_CHECK_LIB(nsl, gethostbyname)
d8cf9c21 62AC_CHECK_LIB(m, main)
21f6caee 63AC_CHECK_LIB(GeoIP, GeoIP_open)
d76ed9a9 64
65dnl Checks for header files.
66AC_HEADER_STDC
67
68dnl will be used for portability stuff
69AC_HEADER_TIME
70AC_STRUCT_TM
71
72dnl Would rather not bail on headers, BSD has alot of the functions elsewhere. -Jedi
0f6fe38c 73AC_CHECK_HEADERS(GeoIP.h GeoIPCity.h fcntl.h tgmath.h malloc.h netdb.h netinet/in.h sys/resource.h sys/timeb.h sys/times.h sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h unistd.h getopt.h memory.h arpa/inet.h sys/mman.h sys/stat.h dirent.h ,,)
d76ed9a9 74
d76ed9a9 75dnl portability stuff, hurray! -Jedi
2f61d1d7 76AC_CHECK_MEMBER([struct sockaddr.sa_len],
77 [AC_DEFINE([HAVE_SOCKADDR_SA_LEN],,[Define if struct sockaddr has sa_len field])],
78 [],[#include <sys/types.h>
79#include <sys/socket.h>])
80AC_CHECK_MEMBER([struct addrinfo.ai_flags],
81 [AC_DEFINE([HAVE_STRUCT_ADDRINFO],,[Define if struct addrinfo declared])],
82 [],[#include <sys/types.h>
83#include <sys/socket.h>
84#include <netdb.h>])
21f6caee 85
0f6fe38c 86AC_CHECK_FUNCS(gettimeofday)
d76ed9a9 87if test $ac_cv_func_gettimeofday = no; then
2f61d1d7 88 AC_CHECK_FUNCS(ftime,,AC_MSG_ERROR([ftime or gettimeofday required. X3 build will fail.]))
d76ed9a9 89fi
90
0f6fe38c 91dnl We have fallbacks in case these are missing, so just check for them.
92AC_CHECK_FUNCS(freeaddrinfo getaddrinfo getnameinfo getpagesize memcpy memset strdup strerror strsignal localtime_r setrlimit getopt getopt_long sysconf,,)
93
d76ed9a9 94dnl Check for absolutely required library functions.
0f6fe38c 95AC_CHECK_FUNCS(select socket strcspn strspn strtod strtoul,,AC_MSG_ERROR([a required function was not found. X3 build will fail.]))
d76ed9a9 96
97dnl Check for functions (and how to get them).
98AC_FUNC_ALLOCA
99AC_FUNC_MMAP
100
101AC_CACHE_CHECK([for sin_len], ac_cv_sin_len,
102[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
103#include <netinet/in.h>],[struct sockaddr_in *sin; sin->sin_len = 0;])],
104ac_cv_sin_len="yes", ac_cv_sin_len="no")])
105if test $ac_cv_sin_len = yes ; then
106 AC_DEFINE(HAVE_SIN_LEN, 1, [Define if struct sockaddr_in contains a sin_len field])
107fi
108
697f4c9a 109dnl Check for socklen_t. In traditional BSD this is an int, but some
110dnl OSes use a different type. Test until we find something that will
111dnl work properly. Test borrowed from a patch submitted for Python.
112AC_CHECK_TYPE([socklen_t], ,[
113 AC_MSG_CHECKING([for socklen_t equivalent])
114 AC_CACHE_VAL([curl_cv_socklen_t_equiv],
115 [
116dnl Systems have either "struct sockaddr*" or "void*" as second
117dnl arg to getpeername.
118 curl_cv_socklen_t_equiv=
119 for arg2 in "struct sockaddr" void ; do
120 for t in int size_t unsigned long "unsigned long" ; do
121 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
122#include <sys/socket.h>
123int getpeername (int $arg2 *, $t *);]], [[$t len;
124 getpeername(0, 0, &len);]])],[curl_cv_socklen_t_equiv="$t"
125 break],[])
126 done
127 done
128 ])
129 AC_MSG_RESULT($curl_cv_socklen_t_equiv)
130 AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
131 [type to use in place of socklen_t if not defined])],
132 [#include <sys/types.h>
133#include<sys/socket.h>])
134
d76ed9a9 135dnl Can only check with -Werror, but the rest of configure doesn't like -Werror
136OLD_CFLAGS=$CFLAGS
137CFLAGS="$CFLAGS -W -Wall -Werror"
138
139dnl Now figure out how to printf() a time_t
140AC_MSG_CHECKING(for time_t format)
141AC_CACHE_VAL(ac_cv_fmt_time_t, [
142ac_cv_fmt_time_t=no
143AC_COMPILE_IFELSE([#include <sys/types.h>
144#include <stdio.h>
145void myfunc(void) {
146 time_t test=0;
147 printf("%li", test);
148}], ac_cv_fmt_time_t="\"%li\"")
149if test $ac_cv_fmt_time_t = no; then
150AC_COMPILE_IFELSE([#include <sys/types.h>
151#include <stdio.h>
152void myfunc(void) {
153 time_t test=0;
154 printf("%i", test);
155}], ac_cv_fmt_time_t="\"%i\"")
156fi
157if test $ac_cv_fmt_time_t = no; then
158AC_MSG_ERROR([Cannot detect format string for time_t
159Please check sys/types.h for the typedef of time_t and submit to a developer])
160fi
161])
162AC_DEFINE_UNQUOTED(FMT_TIME_T, $ac_cv_fmt_time_t, [Define to printf format for a time_t variable])
163AC_MSG_RESULT($ac_cv_fmt_time_t)
164
165dnl How to copy one va_list to another?
166AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy, [AC_LINK_IFELSE(
167 [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);])],
168 [ac_cv_c_va_copy="yes"],
169 [ac_cv_c_va_copy="no"]
170)])
171if test "$ac_cv_c_va_copy" = "yes" ; then
172 AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
173fi
174
175AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy, [AC_LINK_IFELSE(
176 [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);])],
177 [ac_cv_c___va_copy="yes"],
178 [ac_cv_c___va_copy="no"]
179)])
180if test "$ac_cv_c___va_copy" = "yes" ; then
181 AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
182fi
183
184dnl Now fix things back up
185CFLAGS=$OLD_CFLAGS
186
187dnl Optional features.
188AC_MSG_CHECKING(which malloc to use)
189AC_ARG_WITH(malloc,
190[ --with-malloc=type Enables use of a special malloc library; one of:
b8cb2a14 191 system (the default), boehm-gc, dmalloc, mpatrol, x3, slab],
d76ed9a9 192[],
193[withval="system"])
194if test "x$withval" = "xsystem" ; then
195 AC_MSG_RESULT(system)
196 AC_DEFINE(WITH_MALLOC_SYSTEM, 1, [Define if using the system's malloc])
5b1166fd 197 x3_malloc="System"
d76ed9a9 198elif test "x$withval" = "xdmalloc" ; then
199 AC_MSG_RESULT(dmalloc)
200 AC_CHECK_HEADERS(dmalloc.h,,AC_MSG_ERROR([dmalloc header file missing. dmalloc build will fail.]))
201 AC_CHECK_LIB(dmalloc,malloc,,AC_MSG_ERROR([dmalloc library is missing. dmalloc build will fail.]))
202 AC_DEFINE(WITH_MALLOC_DMALLOC, 1, [Define if using the dmalloc debugging malloc package])
5b1166fd 203 x3_malloc="DMalloc"
d76ed9a9 204elif test "x$withval" = "xmpatrol" ; then
205 AC_MSG_RESULT(mpatrol)
206 AC_CHECK_HEADERS(mpatrol.h,,AC_MSG_ERROR([mpatrol header file missing. mpatrol build will fail.]))
207 dnl Using mpatrol requires linking against libelf, at least on Linux.
208 AC_CHECK_LIB(elf, elf_begin)
209 AC_CHECK_LIB(mpatrol,__mp_atexit,,AC_MSG_ERROR([mpatrol library is missing completely. mpatrol build will fail.]))
210 AC_DEFINE(WITH_MALLOC_MPATROL, 1, [Define if using the mpatrol malloc debugging package])
5b1166fd 211 x3_malloc="MPatrol"
d76ed9a9 212elif test "x$withval" = "xboehm-gc" ; then
213 AC_MSG_RESULT(boehm-gc)
214 AC_CHECK_HEADERS(gc/gc.h,,AC_MSG_ERROR([Boehm GC header file missing. boehm-gc build will fail.]))
215 AC_CHECK_LIB(dl, dlopen, , AC_MSG_ERROR([libdl library is missing. boehm-gc build will fail.]))
216 AC_CHECK_LIB(gc, GC_gcollect, , AC_MSG_ERROR([Boehm GC library is missing. boehm-gc build will fail.]))
217 AC_DEFINE(WITH_MALLOC_BOEHM_GC, 1, [Define if using the Boehm GC to garbage collect and check memory leaks])
5b1166fd 218 x3_malloc="Boehm"
b8cb2a14 219elif test "x$withval" = "xx3" ; then
220 AC_MSG_RESULT(x3)
2f61d1d7 221 AC_DEFINE(WITH_MALLOC_X3, 1, [Define if using the X3 internal debug allocator])
b8cb2a14 222 MODULE_OBJS="$MODULE_OBJS alloc-x3.\$(OBJEXT)"
5b1166fd 223 x3_malloc="X3"
0d16e639 224elif test "x$withval" = "xslab" ; then
225 AC_MSG_RESULT(slab)
226 AC_DEFINE(WITH_MALLOC_SLAB, 1, [Define if using the slab internal debug allocator])
227 MODULE_OBJS="$MODULE_OBJS alloc-slab.\$(OBJEXT)"
5b1166fd 228 x3_malloc="Slab"
d76ed9a9 229else
230 AC_MSG_ERROR([Unknown malloc type $withval])
231fi
232
233AC_MSG_CHECKING(which protocol to use)
234AC_ARG_WITH(protocol,
235[ --with-protocol=name Choose IRC dialect to support; one of:
7827220c 236 p10 (the default)],
d76ed9a9 237[],
238[withval="p10"])
239if test "x$withval" = "xp10" ; then
0f6fe38c 240 AC_MSG_RESULT(P10)
d76ed9a9 241 AC_DEFINE(WITH_PROTOCOL_P10, 1, [Define if using the P10 dialect of IRC])
2f61d1d7 242 MODULE_OBJS="$MODULE_OBJS proto-p10.\$(OBJEXT)"
0f6fe38c 243 PROTO_FILES=proto-p10.c
5b1166fd 244 x3_ircd="P10"
d76ed9a9 245else
246 AC_MSG_ERROR([Unknown IRC dialect $withval])
247fi
248
249AC_ARG_WITH(getopt,
250[ --without-getopt Disables building of the GNU getopt library],
251[if test "$withval" = no; then
252 AC_DEFINE(IGNORE_GETOPT, 1, [Define to disable built-in getopt library])
253fi])
254
255AC_MSG_CHECKING(whether to enable tokenization)
256AC_ARG_ENABLE(tokens,
257[ --disable-tokens Disables tokenization of P10 protocol output
258 (tokens required if linking to ircu 2.10.11)],
259[],[enableval=yes])
260if test "z$enableval" = zno ; then
261 AC_MSG_RESULT(no)
262else
263 AC_DEFINE(ENABLE_TOKENS, 1, [Define if tokenized P10 desired])
264 AC_MSG_RESULT(yes)
265fi
266
267AC_MSG_CHECKING(whether to enable debug behaviors)
268AC_ARG_ENABLE(debug,
269[ --enable-debug Enables debugging behaviors],
270[
271 CPPFLAGS="$CPPFLAGS"
272 AC_MSG_RESULT(yes)
5b1166fd 273 x3_debug="Enabled"
d76ed9a9 274],
275[
276 CPPFLAGS="$CPPFLAGS -DNDEBUG"
277 AC_MSG_RESULT(no)
5b1166fd 278 x3_debug="Disabled"
d76ed9a9 279])
280
281if test -e src ; then
282 if test ! -d src ; then
283 AC_MSG_ERROR([src exists but is not a directory; please move it out of the way.])
284 fi
285else
286 mkdir src
287fi
288AC_MSG_CHECKING(for extra module files)
289MODULE_DEFINES="src/modules-list.h"
290echo > $MODULE_DEFINES
291touch $MODULE_DEFINES
292AC_ARG_ENABLE(modules,
293[ --enable-modules=list,of,modules Enable extra modules],
294[
295 OIFS="$IFS"
296 IFS=','
297 EXTRA_MODULE_OBJS=""
298 module_list=""
299 dnl Must use a separate file because autoconf can't stand newlines in an AC_SUBSTed variable.
300 for module in $enableval ; do
301 module=`echo $module | sed -e s/^mod-// -e s/\.c\$//`
2f61d1d7 302 EXTRA_MODULE_OBJS="$EXTRA_MODULE_OBJS mod-$module.\$(OBJEXT)"
d76ed9a9 303 module_list="$module_list $module"
304 echo "WITH_MODULE($module)" >> $MODULE_DEFINES
ec311f39 305 if test "x$module" = "xtrack" ; then
306 TRACK="-D HAVE_TRACK"
8de34abd 307 AC_DEFINE(HAVE_TRACK, 1, [Define this if you are using mod-track])
ec311f39 308 fi
3da28d8e 309 if test "x$module" = "xhelpserv" ; then
310 TRACK="-D HAVE_HELPSERV"
311 AC_DEFINE(HAVE_HELPSERV, 1, [Define this if you are using mod-helpserv])
312 fi
d76ed9a9 313 done
314 IFS="$OIFS"
315 MODULE_OBJS="$MODULE_OBJS $EXTRA_MODULE_OBJS"
316 AC_MSG_RESULT($module_list)
317],
318[
319 AC_MSG_RESULT(none)
320])
321
322MY_SUBDIRS=""
323RX_INCLUDES=""
324RX_LIBS=""
325if test "${BROKEN_REGEX}" = yes -o "${ac_cv_func_regcomp}" = no; then
326 MY_SUBDIRS="rx $MY_SUBDIRS"
327 RX_INCLUDES="-I../rx"
328 RX_LIBS="../rx/librx.a"
329fi
330MY_SUBDIRS="$MY_SUBDIRS src"
331CFLAGS="$CFLAGS $ANSI_SRC -W -Wall"
332if test "z$USE_MAINTAINER_MODE" = zyes ; then
0f6fe38c 333 CFLAGS="$CFLAGS -Werror"
d76ed9a9 334fi
335
35305a49 336dnl I am not comfortable running make install from ./configure. This has to be done correctly or not at all. -Rubin
5b1166fd 337dnl REMEMBER TO CHANGE WITH A NEW TRE RELEASE!
35305a49 338dnl AC_MSG_RESULT(extracting TRE regex library)
339dnl cur_dir=`pwd`
340dnl cd tools
5b1166fd 341dnl remove old tre directory to force a recompile...
35305a49 342dnl rm -rf tre-$tre_version
343dnl if test "x$ac_cv_path_GUNZIP" = "x" ; then
344dnl tar xfz tre.tar.gz
345dnl else
346dnl cp tre.tar.gz tre.tar.gz.bak
347dnl gunzip -f tre.tar.gz
348dnl cp tre.tar.gz.bak tre.tar.gz
349dnl tar xf tre.tar
350dnl fi
351dnl AC_MSG_RESULT(configuring TRE regex library)
352dnl cd tre-$tre_version
353dnl tre_prefix=$prefix
354dnl if test $tre_prefix = "NONE"; then
355dnl tre_prefix="$HOME"
356dnl fi
357dnl ./configure --disable-agrep --disable-shared --disable-system-abi --disable-wchar --disable-multibyte --prefix=$tre_prefix || exit 1
358dnl
359dnl AC_MSG_RESULT(compiling TRE regex library)
360dnl $ac_cv_prog_MAKER || exit 1
361dnl AC_MSG_RESULT(installing TRE regex library)
362dnl $ac_cv_prog_MAKER install || exit 1
363dnl TREINCDIR="$tre_prefix/include"
364dnl AC_SUBST(TREINCDIR)
365dnl if test "x$ac_cv_path_PKGCONFIG" = "x" ; then
366dnl TRELIBS="-L$tre_prefix/lib -ltre"
367dnl else
368dnl TRELIBS=`$ac_cv_path_PKGCONFIG --libs tre.pc`
369dnl fi
370dnl AC_SUBST(TRELIBS)
371dnl
372dnl cd $cur_dir
373
374dnl libTRE (regex library) checking
a8b2ad8d 375tre_version="0.7.5"
35305a49 376withval=''
a8b2ad8d 377AC_ARG_WITH(tre,
378[ --with-tre=PATH Base path to where libtre is installed, such that
379 PATH/lib/libtre.so and PATH/include/tre/regex.h exist.], )
35305a49 380if test "x$withval" != "x"; then
381 AC_MSG_RESULT(Using include dir $withval to find libtre)
39edf54a 382 CPPFLAGS="$CPPFLAGS -I$withval/include -L$withval/lib"
0754f993 383 LIBS="$LIBS -L$withval/lib"
5b1166fd 384else
35305a49 385 AC_MSG_RESULT([Looking for tre in system and home dirs (${HOME})...])
39edf54a 386 CPPFLAGS="$CPPFLAGS -I${HOME}/include -L${HOME}/lib"
0754f993 387 LIBS="$LIBS -L${HOME}/lib"
5b1166fd 388fi
0bd0bef6 389AC_CHECK_HEADER(tre/regex.h, , [AC_MSG_ERROR([tre/regex.h, the TRE regex headers, were not found. Install tre or use --with-tre=PATH to tell me how to find it, where PATH/include/tre/regex.h exists. For convenience, just type 'tools/tre_install.sh' now, to install tre in your home directory.])],)
390AC_CHECK_LIB(tre, regexec, , [AC_MSG_ERROR([TRE regex library not found. Install tre, or use --with-tre=PATH to tell me how to find it, where PATH/lib/libtre.so exists. For convenience, just type 'tools/tre_install.sh' now, to install tre in your home directory.])])
5b1166fd 391
a8b2ad8d 392dnl core dumper checking
2784452e 393core_version="1.1"
a8b2ad8d 394withval=''
395AC_ARG_WITH(coredumper,
396[ --with-coredumper=PATH Base path to where core dumper is installed, such
397 that PATH/lib/libcoredumper.so and
398 PATH/include/google/coredumper.h exist.], )
399if test "x$withval" != "x"; then
400 AC_MSG_RESULT(Using include dir $withval to find coredumper)
39edf54a 401 CPPFLAGS="$CPPFLAGS -I$withval/include -L$withval/lib"
a8b2ad8d 402 LIBS="$LIBS -L$withval/lib"
403else
404 AC_MSG_RESULT([Looking for coredumper in system and home dirs (${HOME})...])
39edf54a 405 CPPFLAGS="$CPPFLAGS -I${HOME}/include -L${HOME}/lib"
2784452e 406 LIBS="$LIBS -Wl,--rpath -Wl,${HOME}/lib"
a8b2ad8d 407fi
0bd0bef6 408AC_CHECK_HEADER(google/coredumper.h, , [AC_MSG_RESULT([google/coredumper.h, the coredumper headers, were not found. Install coredumper or use --with-coredumper=PATH to tell me how to find it, where PATH/include/google/coredumper.h exists. For convenience, just type 'tools/core_install.sh' now, to install coredumper in your home directory.])],)
409AC_CHECK_LIB(coredumper, WriteCoreDump, , [AC_MSG_RESULT([Coredumper library not found. Install coredumper, or use --with-coredumper=PATH to tell me how to find it, where PATH/lib/libcoredumper.so exists. For convenience, just type 'tools/core_install.sh' now, to install coredumper in your home directory.])])
a8b2ad8d 410
73d4cc91 411dnl openssl checking
412withval=''
413AC_ARG_WITH(ssl,
414[ --with-ssl=PATH Base path to where openssl is installed],)
415if test "x$withval" != "x"; then
416 AC_MSG_RESULT(Using include dir $withval to find openssl)
417 CPPFLAGS="$CPPFLAGS -I$withval/include -L$withval/lib"
418 LIBS="$LIBS -L$withval/lib"
419else
420 AC_MSG_RESULT([Looking for openssl in system ])
421fi
422
423AC_CHECK_LIB(ssl, BIO_new,
424[
425LIBS="-lssl $LIBS"
426AC_CHECK_HEADERS(openssl/bio.h,
427[
428AC_DEFINE(WITH_SSL, 1, [Define if SSL libs are linked])
429ssl_message="LDAP library: enabled"
430],
431[
432if test "x$withval" != "x"; then
433 AC_MSG_ERROR([ssl headers not found])
434fi
435])
436],
437[
438if test "x$withval" != "x"; then
439 AC_MSG_ERROR([libldap not found or not valid])
440fi
441]
442)
443AC_MSG_RESULT($LIBS)
444
445
8da89711 446dnl ldap checking
447withval=''
448AC_ARG_WITH(ldap,
449[ --with-ldap=PATH Base path to where the ldap library and headers are installed,
450 such that PATH/include/ldap.h and PATH/lib/libldap.so exist.],)
451if test "x$withval" != "x"; then
452 AC_MSG_RESULT(Using include dir $withval to find libldap)
453 CPPFLAGS="$CPPFLAGS -I$withval/include -L$withval/lib"
454 LIBS="$LIBS -L$withval/lib"
455else
456 AC_MSG_RESULT([Looking for ldap in system ])
457fi
458
39edf54a 459AC_CHECK_LIB(ldap, ldap_simple_bind_s,
8da89711 460[
39edf54a 461LIBS="-lldap $LIBS"
8da89711 462AC_CHECK_HEADERS(ldap.h,
463[
464AC_DEFINE(WITH_LDAP, 1, [Define if LDAP libs are linked])
465ldap_message="LDAP library: enabled"
466],
467[
db9a9a8a 468if test "x$withval" != "x"; then
8da89711 469 AC_MSG_ERROR([ldap.h not found])
470fi
471])
472],
473[
db9a9a8a 474if test "x$withval" != "x"; then
8da89711 475 AC_MSG_ERROR([libldap not found or not valid])
476fi
477]
478)
39edf54a 479AC_MSG_RESULT($LIBS)
8da89711 480
d76ed9a9 481AC_DEFINE_UNQUOTED(CODENAME, "${CODENAME}", [Code name for this release])
482AC_SUBST(MODULE_OBJS)
483AC_SUBST(MY_SUBDIRS)
484AC_SUBST(RX_INCLUDES)
485AC_SUBST(RX_LIBS)
ec311f39 486AC_SUBST(TRACK)
d76ed9a9 487AC_CONFIG_FILES(Makefile rx/Makefile src/Makefile)
488AC_OUTPUT
5b1166fd 489
490
491dnl Print configuration summary
492
493cat <<EOF
494
495Configuration summary
496=====================
497
498X3 is now configured as follows:
499
500* Compilation environment
501
502 CC = $CC
503 CFLAGS = $CFLAGS
504 CPP = $CPP
505 CPPFLAGS = $CPPFLAGS
506 LD = $LD
507 LDFLAGS = $LDFLAGS
508 LIBS = $LIBS
509
510* X3 options
511
a8b2ad8d 512 Debug: $x3_debug
513 Extra Modules: $module_list
514 Malloc: $x3_malloc
515 Protocol: $x3_ircd
516 Regexp Library TRE $tre_version
517 Coredumper Library Coredumper $core_version
8da89711 518 $ldap_message
5b1166fd 519
a8b2ad8d 520 Install to: $prefix
35305a49 521
5b1166fd 522Now you can proceed with compiling X3
523
524EOF
525