]> jfr.im git - irc/evilnet/x3.git/blob - configure.in
715f8007d622e6a5690e0d0d20dd64e19fa8a62b
[irc/evilnet/x3.git] / configure.in
1 dnl Process this file with autoconf to create a configure script.
2
3 dnl General initialization.
4 AC_REVISION([$Id$])
5 AC_PREREQ(2.61)
6 AC_INIT([X3],[1.6],[evilnet-devel@lists.sourceforge.net])
7 CODENAME=X3
8 AC_CONFIG_HEADERS(src/config.h)
9 AC_CONFIG_SRCDIR(src/opserv.c)
10 dnl AM_CANONICAL_TARGET must be before AM_INIT_AUTOMAKE() or autoconf whines
11 AC_CANONICAL_TARGET
12 AM_INIT_AUTOMAKE([gnu 1.6])
13 AM_MAINTAINER_MODE
14
15 dnl Compiler/runtime feature checks.
16 AC_TYPE_SIGNAL
17 AC_C_CONST
18 AC_C_INLINE
19
20 dnl Checks for programs.
21 AC_PROG_AWK
22 AC_PROG_CC
23 AC_PROG_INSTALL
24
25 AC_PROG_RANLIB
26 dnl AC_PROG_LIBTOOL
27
28 AC_PROG_LN_S
29 AC_PROG_MAKE_SET
30 AC_PROG_GCC_TRADITIONAL
31 AC_CHECK_PROG(MAKER, gmake, gmake, make)
32
33 dnl nice that unixes can all follow a standard.
34 case $target in
35 *-freebsd2* | *-freebsdelf2* | *-freebsd*out3*)
36 ANSI_SRC=""
37 ;;
38 *-freebsd3* | *-freebsdelf3* | *-freebsd*out3*)
39 ANSI_SRC=""
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 ;;
56 esac
57 CFLAGS="$CFLAGS $EXTRA_DEFINE"
58
59 dnl Checks for libraries.
60 AC_CHECK_LIB(socket, socket)
61 AC_CHECK_LIB(nsl, gethostbyname)
62 AC_CHECK_LIB(m, main)
63 AC_CHECK_LIB(GeoIP, GeoIP_open)
64
65 dnl Checks for header files.
66 AC_HEADER_STDC
67
68 dnl will be used for portability stuff
69 AC_HEADER_TIME
70 AC_STRUCT_TM
71
72 dnl Would rather not bail on headers, BSD has alot of the functions elsewhere. -Jedi
73 AC_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 ,,)
74
75 dnl portability stuff, hurray! -Jedi
76 AC_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>])
80 AC_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>])
85
86 AC_CHECK_FUNCS(gettimeofday)
87 if test $ac_cv_func_gettimeofday = no; then
88 AC_CHECK_FUNCS(ftime,,AC_MSG_ERROR([ftime or gettimeofday required. X3 build will fail.]))
89 fi
90
91 dnl We have fallbacks in case these are missing, so just check for them.
92 AC_CHECK_FUNCS(freeaddrinfo getaddrinfo getnameinfo getpagesize memcpy memset strdup strerror strsignal localtime_r setrlimit getopt getopt_long sysconf,,)
93
94 dnl Check for absolutely required library functions.
95 AC_CHECK_FUNCS(select socket strcspn strspn strtod strtoul,,AC_MSG_ERROR([a required function was not found. X3 build will fail.]))
96
97 dnl Check for functions (and how to get them).
98 AC_FUNC_ALLOCA
99 AC_FUNC_MMAP
100
101 AC_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;])],
104 ac_cv_sin_len="yes", ac_cv_sin_len="no")])
105 if test $ac_cv_sin_len = yes ; then
106 AC_DEFINE(HAVE_SIN_LEN, 1, [Define if struct sockaddr_in contains a sin_len field])
107 fi
108
109 dnl Check for socklen_t. In traditional BSD this is an int, but some
110 dnl OSes use a different type. Test until we find something that will
111 dnl work properly. Test borrowed from a patch submitted for Python.
112 AC_CHECK_TYPE([socklen_t], ,[
113 AC_MSG_CHECKING([for socklen_t equivalent])
114 AC_CACHE_VAL([curl_cv_socklen_t_equiv],
115 [
116 dnl Systems have either "struct sockaddr*" or "void*" as second
117 dnl 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>
123 int 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
135 dnl Can only check with -Werror, but the rest of configure doesn't like -Werror
136 OLD_CFLAGS=$CFLAGS
137 CFLAGS="$CFLAGS -W -Wall -Werror"
138
139 dnl Now figure out how to printf() a time_t
140 AC_MSG_CHECKING(for time_t format)
141 AC_CACHE_VAL(ac_cv_fmt_time_t, [
142 ac_cv_fmt_time_t=no
143 AC_COMPILE_IFELSE([#include <sys/types.h>
144 #include <stdio.h>
145 void myfunc(void) {
146 time_t test=0;
147 printf("%li", test);
148 }], ac_cv_fmt_time_t="\"%li\"")
149 if test $ac_cv_fmt_time_t = no; then
150 AC_COMPILE_IFELSE([#include <sys/types.h>
151 #include <stdio.h>
152 void myfunc(void) {
153 time_t test=0;
154 printf("%i", test);
155 }], ac_cv_fmt_time_t="\"%i\"")
156 fi
157 if test $ac_cv_fmt_time_t = no; then
158 AC_MSG_ERROR([Cannot detect format string for time_t
159 Please check sys/types.h for the typedef of time_t and submit to a developer])
160 fi
161 ])
162 AC_DEFINE_UNQUOTED(FMT_TIME_T, $ac_cv_fmt_time_t, [Define to printf format for a time_t variable])
163 AC_MSG_RESULT($ac_cv_fmt_time_t)
164
165 dnl How to copy one va_list to another?
166 AC_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 )])
171 if test "$ac_cv_c_va_copy" = "yes" ; then
172 AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
173 fi
174
175 AC_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 )])
180 if test "$ac_cv_c___va_copy" = "yes" ; then
181 AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
182 fi
183
184 dnl Now fix things back up
185 CFLAGS=$OLD_CFLAGS
186
187 dnl Optional features.
188 AC_MSG_CHECKING(which malloc to use)
189 AC_ARG_WITH(malloc,
190 [ --with-malloc=type Enables use of a special malloc library; one of:
191 system (the default), boehm-gc, dmalloc, mpatrol, x3, slab],
192 [],
193 [withval="system"])
194 if test "x$withval" = "xsystem" ; then
195 AC_MSG_RESULT(system)
196 AC_DEFINE(WITH_MALLOC_SYSTEM, 1, [Define if using the system's malloc])
197 x3_malloc="System"
198 elif 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])
203 x3_malloc="DMalloc"
204 elif 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])
211 x3_malloc="MPatrol"
212 elif 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])
218 x3_malloc="Boehm"
219 elif test "x$withval" = "xx3" ; then
220 AC_MSG_RESULT(x3)
221 AC_DEFINE(WITH_MALLOC_X3, 1, [Define if using the X3 internal debug allocator])
222 MODULE_OBJS="$MODULE_OBJS alloc-x3.\$(OBJEXT)"
223 x3_malloc="X3"
224 elif 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)"
228 x3_malloc="Slab"
229 else
230 AC_MSG_ERROR([Unknown malloc type $withval])
231 fi
232
233 AC_MSG_CHECKING(which protocol to use)
234 AC_ARG_WITH(protocol,
235 [ --with-protocol=name Choose IRC dialect to support; one of:
236 p10 (the default)],
237 [],
238 [withval="p10"])
239 if test "x$withval" = "xp10" ; then
240 AC_MSG_RESULT(P10)
241 AC_DEFINE(WITH_PROTOCOL_P10, 1, [Define if using the P10 dialect of IRC])
242 MODULE_OBJS="$MODULE_OBJS proto-p10.\$(OBJEXT)"
243 PROTO_FILES=proto-p10.c
244 x3_ircd="P10"
245 else
246 AC_MSG_ERROR([Unknown IRC dialect $withval])
247 fi
248
249 AC_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])
253 fi])
254
255 AC_MSG_CHECKING(whether to enable tokenization)
256 AC_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])
260 if test "z$enableval" = zno ; then
261 AC_MSG_RESULT(no)
262 else
263 AC_DEFINE(ENABLE_TOKENS, 1, [Define if tokenized P10 desired])
264 AC_MSG_RESULT(yes)
265 fi
266
267 AC_MSG_CHECKING(whether to enable debug behaviors)
268 AC_ARG_ENABLE(debug,
269 [ --enable-debug Enables debugging behaviors],
270 [
271 CPPFLAGS="$CPPFLAGS"
272 AC_MSG_RESULT(yes)
273 x3_debug="Enabled"
274 ],
275 [
276 CPPFLAGS="$CPPFLAGS -DNDEBUG"
277 AC_MSG_RESULT(no)
278 x3_debug="Disabled"
279 ])
280
281 if 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
285 else
286 mkdir src
287 fi
288 AC_MSG_CHECKING(for extra module files)
289 MODULE_DEFINES="src/modules-list.h"
290 echo > $MODULE_DEFINES
291 touch $MODULE_DEFINES
292 AC_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\$//`
302 EXTRA_MODULE_OBJS="$EXTRA_MODULE_OBJS mod-$module.\$(OBJEXT)"
303 module_list="$module_list $module"
304 echo "WITH_MODULE($module)" >> $MODULE_DEFINES
305 if test "x$module" = "xtrack" ; then
306 TRACK="-D HAVE_TRACK"
307 AC_DEFINE(HAVE_TRACK, 1, [Define this if you are using mod-track])
308 fi
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
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
322 AC_ARG_ENABLE(python,
323 [ --disable-python don't build the python plugin],
324 python=$enableval, python=yes)
325
326
327 MY_SUBDIRS=""
328 RX_INCLUDES=""
329 RX_LIBS=""
330 if test "${BROKEN_REGEX}" = yes -o "${ac_cv_func_regcomp}" = no; then
331 MY_SUBDIRS="rx $MY_SUBDIRS"
332 RX_INCLUDES="-I../rx"
333 RX_LIBS="../rx/librx.a"
334 fi
335 MY_SUBDIRS="$MY_SUBDIRS src"
336 CFLAGS="$CFLAGS $ANSI_SRC -W -Wall"
337 if test "z$USE_MAINTAINER_MODE" = zyes ; then
338 CFLAGS="$CFLAGS -Werror"
339 fi
340
341 dnl I am not comfortable running make install from ./configure. This has to be done correctly or not at all. -Rubin
342 dnl REMEMBER TO CHANGE WITH A NEW TRE RELEASE!
343 dnl AC_MSG_RESULT(extracting TRE regex library)
344 dnl cur_dir=`pwd`
345 dnl cd tools
346 dnl remove old tre directory to force a recompile...
347 dnl rm -rf tre-$tre_version
348 dnl if test "x$ac_cv_path_GUNZIP" = "x" ; then
349 dnl tar xfz tre.tar.gz
350 dnl else
351 dnl cp tre.tar.gz tre.tar.gz.bak
352 dnl gunzip -f tre.tar.gz
353 dnl cp tre.tar.gz.bak tre.tar.gz
354 dnl tar xf tre.tar
355 dnl fi
356 dnl AC_MSG_RESULT(configuring TRE regex library)
357 dnl cd tre-$tre_version
358 dnl tre_prefix=$prefix
359 dnl if test $tre_prefix = "NONE"; then
360 dnl tre_prefix="$HOME"
361 dnl fi
362 dnl ./configure --disable-agrep --disable-shared --disable-system-abi --disable-wchar --disable-multibyte --prefix=$tre_prefix || exit 1
363 dnl
364 dnl AC_MSG_RESULT(compiling TRE regex library)
365 dnl $ac_cv_prog_MAKER || exit 1
366 dnl AC_MSG_RESULT(installing TRE regex library)
367 dnl $ac_cv_prog_MAKER install || exit 1
368 dnl TREINCDIR="$tre_prefix/include"
369 dnl AC_SUBST(TREINCDIR)
370 dnl if test "x$ac_cv_path_PKGCONFIG" = "x" ; then
371 dnl TRELIBS="-L$tre_prefix/lib -ltre"
372 dnl else
373 dnl TRELIBS=`$ac_cv_path_PKGCONFIG --libs tre.pc`
374 dnl fi
375 dnl AC_SUBST(TRELIBS)
376 dnl
377 dnl cd $cur_dir
378
379 dnl libTRE (regex library) checking
380 tre_version="0.7.5"
381 withval=''
382 AC_ARG_WITH(tre,
383 [ --with-tre=PATH Base path to where libtre is installed, such that
384 PATH/lib/libtre.so and PATH/include/tre/regex.h exist.], )
385 if test "x$withval" != "x"; then
386 AC_MSG_RESULT(Using include dir $withval to find libtre)
387 CPPFLAGS="$CPPFLAGS -I$withval/include -L$withval/lib"
388 LIBS="$LIBS -L$withval/lib"
389 else
390 AC_MSG_RESULT([Looking for tre in system and home dirs (${HOME})...])
391 CPPFLAGS="$CPPFLAGS -I${HOME}/include -L${HOME}/lib"
392 LIBS="$LIBS -L${HOME}/lib"
393 fi
394 AC_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.])],)
395 AC_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.])])
396
397 dnl core dumper checking
398 core_version="1.1"
399 withval=''
400 AC_ARG_WITH(coredumper,
401 [ --with-coredumper=PATH Base path to where core dumper is installed, such
402 that PATH/lib/libcoredumper.so and
403 PATH/include/google/coredumper.h exist.], )
404 if test "x$withval" != "x"; then
405 AC_MSG_RESULT(Using include dir $withval to find coredumper)
406 CPPFLAGS="$CPPFLAGS -I$withval/include -L$withval/lib"
407 LIBS="$LIBS -L$withval/lib"
408 else
409 AC_MSG_RESULT([Looking for coredumper in system and home dirs (${HOME})...])
410 CPPFLAGS="$CPPFLAGS -I${HOME}/include -L${HOME}/lib"
411 LIBS="$LIBS -Wl,--rpath -Wl,${HOME}/lib"
412 fi
413 AC_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.])],)
414 AC_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.])])
415
416 dnl openssl checking
417 withval=''
418 AC_ARG_WITH(ssl,
419 [ --with-ssl=PATH Base path to where openssl is installed],)
420 if test "x$withval" != "x"; then
421 AC_MSG_RESULT(Using include dir $withval to find openssl)
422 CPPFLAGS="$CPPFLAGS -I$withval/include -L$withval/lib"
423 LIBS="$LIBS -L$withval/lib"
424 else
425 AC_MSG_RESULT([Looking for openssl in system ])
426 fi
427
428 AC_CHECK_LIB(ssl, BIO_new,
429 [
430 LIBS="-lssl $LIBS"
431 AC_CHECK_HEADERS(openssl/bio.h,
432 [
433 AC_DEFINE(WITH_SSL, 1, [Define if SSL libs are linked])
434 ssl_message="LDAP library: enabled"
435 ],
436 [
437 if test "x$withval" != "x"; then
438 AC_MSG_ERROR([ssl headers not found])
439 fi
440 ])
441 ],
442 [
443 if test "x$withval" != "x"; then
444 AC_MSG_ERROR([libldap not found or not valid])
445 fi
446 ]
447 )
448 AC_MSG_RESULT($LIBS)
449
450
451 dnl ldap checking
452 withval=''
453 AC_ARG_WITH(ldap,
454 [ --with-ldap=PATH Base path to where the ldap library and headers are installed,
455 such that PATH/include/ldap.h and PATH/lib/libldap.so exist.],)
456 if test "x$withval" != "x"; then
457 AC_MSG_RESULT(Using include dir $withval to find libldap)
458 CPPFLAGS="$CPPFLAGS -I$withval/include -L$withval/lib"
459 LIBS="$LIBS -L$withval/lib"
460 else
461 AC_MSG_RESULT([Looking for ldap in system ])
462 fi
463
464 AC_CHECK_LIB(ldap, ldap_simple_bind_s,
465 [
466 LIBS="-lldap $LIBS"
467 AC_CHECK_HEADERS(ldap.h,
468 [
469 AC_DEFINE(WITH_LDAP, 1, [Define if LDAP libs are linked])
470 ldap_message="LDAP library: enabled"
471 ],
472 [
473 if test "x$withval" != "x"; then
474 AC_MSG_ERROR([ldap.h not found])
475 fi
476 ])
477 ],
478 [
479 if test "x$withval" != "x"; then
480 AC_MSG_ERROR([libldap not found or not valid])
481 fi
482 ]
483 )
484
485 dnl *********************************************************************
486 dnl ** PYTHON ***********************************************************
487 dnl *********************************************************************
488
489 if test "$python" = yes; then
490 AC_PATH_PROG(pythonpath, python2)
491 if test "_$pythonpath" = _ ; then
492 AC_PATH_PROG(pythonpath, python)
493 fi
494 if test "_$pythonpath" = _ ; then
495 python=no
496 else
497 AC_MSG_CHECKING(Python version)
498 changequote(<<, >>)dnl
499 PY_VER=`$pythonpath -c 'import distutils.sysconfig; print distutils.sysconfig.get_config_vars("VERSION")[0];'`
500 PY_LIB=`$pythonpath -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(standard_lib=1);'`
501 PY_INC=`$pythonpath -c 'import distutils.sysconfig; print distutils.sysconfig.get_config_vars("INCLUDEPY")[0];'`
502 $pythonpath -c "import sys; map(int,sys.version[:3].split('.')) >= [2,2] or sys.exit(1)"
503 changequote([, ])dnl
504 AC_MSG_RESULT($PY_VER)
505 if test "$?" != "1"; then
506 AC_MSG_CHECKING(Python compile flags)
507 PY_PREFIX=`$pythonpath -c 'import sys; print sys.prefix'`
508 PY_EXEC_PREFIX=`$pythonpath -c 'import sys; print sys.exec_prefix'`
509 if test -f $PY_INC/Python.h; then
510 AC_DEFINE(WITH_PYTHON, 1, [Define if using python])
511 PY_LIBS="-L$PY_LIB/config -lpython$PY_VER -lpthread -lutil"
512 PY_CFLAGS="-I$PY_INC"
513 AC_MSG_RESULT(ok)
514 else
515 python=no
516 AC_MSG_RESULT([Can't find Python.h])
517 fi
518 else
519 echo "Python too old. Only 2.2 or above is supported."
520 python=no
521 fi
522 fi
523 fi
524
525 AM_CONDITIONAL(DO_PYTHON, test "x$python" = "xyes")
526
527 AC_MSG_RESULT($LIBS)
528
529 AC_DEFINE_UNQUOTED(CODENAME, "${CODENAME}", [Code name for this release])
530 AC_SUBST(MODULE_OBJS)
531 AC_SUBST(MY_SUBDIRS)
532 AC_SUBST(RX_INCLUDES)
533 AC_SUBST(RX_LIBS)
534 AC_SUBST(TRACK)
535 AC_SUBST(PY_CFLAGS)
536 AC_SUBST(PY_LIBS)
537
538 AC_CONFIG_FILES(Makefile rx/Makefile src/Makefile)
539 AC_OUTPUT
540
541
542 dnl Print configuration summary
543
544 cat <<EOF
545
546 Configuration summary
547 =====================
548
549 X3 is now configured as follows:
550
551 * Compilation environment
552
553 CC = $CC
554 CFLAGS = $CFLAGS
555 CPP = $CPP
556 CPPFLAGS = $CPPFLAGS
557 LD = $LD
558 LDFLAGS = $LDFLAGS
559 LIBS = $LIBS
560
561 * X3 options
562
563 Debug: $x3_debug
564 Extra Modules: $module_list
565 Malloc: $x3_malloc
566 Protocol: $x3_ircd
567 Regexp Library TRE $tre_version
568 Coredumper Library Coredumper $core_version
569 $ldap_message
570 python: $python
571
572 Install to: $prefix
573
574 Now you can proceed with compiling X3
575
576 EOF
577