1 | dnl Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team |
1 | dnl Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team |
2 | dnl Copyright © 2005 Atheme Development Group |
2 | dnl Copyright © 2005 Atheme Development Group |
3 | dnl Rights to this code are documented in doc/pod/license.pod. |
3 | dnl Rights to this code are documented in doc/pod/license.pod. |
4 | dnl |
4 | dnl |
5 | dnl $Id: configure.ac,v 1.3 2007/07/21 02:00:31 pippijn Exp $ |
5 | dnl $Id: configure.ac,v 1.11 2007/09/16 18:54:41 pippijn Exp $ |
6 | |
6 | |
7 | dnl Process this file with autoconf to produce a configure script. |
7 | dnl Process this file with autoconf to produce a configure script. |
8 | |
8 | |
9 | AC_PREREQ(2.59) |
9 | AC_PREREQ(2.59) |
10 | AC_INIT([ermyth], [2.3], [ermyth@one09.net]) |
10 | AC_INIT([ermyth], [2.3], [ermyth@one09.net]) |
11 | AC_CONFIG_HEADER(include/sysconf.h) |
11 | AC_CONFIG_HEADER(include/sysconf.h) |
12 | AC_CONFIG_AUX_DIR(autoconf) |
12 | AC_CONFIG_AUX_DIR(autoconf) |
13 | |
13 | |
14 | AC_COPYRIGHT([$Id: configure.ac,v 1.3 2007/07/21 02:00:31 pippijn Exp $]) |
14 | AC_COPYRIGHT([$Id: configure.ac,v 1.11 2007/09/16 18:54:41 pippijn Exp $]) |
15 | |
15 | |
16 | AC_PREFIX_DEFAULT(~/PACKAGE) |
16 | AC_PREFIX_DEFAULT(~/PACKAGE) |
17 | |
17 | |
18 | dnl Automake compatibility. |
18 | dnl Automake compatibility. |
19 | AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME]) |
19 | AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME]) |
… | |
… | |
34 | AC_PATH_PROG(AR, ar) |
34 | AC_PATH_PROG(AR, ar) |
35 | AC_PATH_PROG(RANLIB, ranlib) |
35 | AC_PATH_PROG(RANLIB, ranlib) |
36 | |
36 | |
37 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
37 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
38 | |
38 | |
39 | #-------------------------------------------------- |
|
|
40 | # AC_MSG_CHECKING(glib >= 2.10) |
39 | AC_MSG_CHECKING(glib >= 2.10) |
41 | # if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then |
40 | if $PKG_CONFIG glib-2.0 --atleast-version 2.10; then |
42 | # CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`" |
41 | CXXFLAGS="$CXXFLAGS `$PKG_CONFIG glib-2.0 --cflags`" |
43 | # LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`" |
42 | LIBS="$LIBS `$PKG_CONFIG glib-2.0 --libs`" |
44 | # AC_MSG_RESULT(ok) |
43 | AC_MSG_RESULT(ok) |
45 | # else |
44 | else |
46 | # AC_MSG_ERROR(no) |
45 | AC_MSG_ERROR(no) |
47 | # fi |
46 | fi |
48 | #-------------------------------------------------- |
|
|
49 | |
47 | |
50 | AC_PATH_PROG(PERL, perl5.8) |
48 | AC_PATH_PROG(PERL, perl5.8) |
51 | if test -z "$PERL"; then |
49 | if test -z "$PERL"; then |
52 | AC_PATH_PROG(PERL, perl5) |
50 | AC_PATH_PROG(PERL, perl5) |
53 | if test -z "$PERL"; then |
51 | if test -z "$PERL"; then |
… | |
… | |
60 | |
58 | |
61 | dnl |
59 | dnl |
62 | dnl Source generation |
60 | dnl Source generation |
63 | dnl |
61 | dnl |
64 | |
62 | |
65 | CALLBACKS=`$PERL $srcdir/include/gencallbacks.pl 7` |
63 | dnl CALLBACKS=`$PERL $srcdir/include/common/gencallbacks.pl 7` |
66 | AC_SUBST(CALLBACKS) |
64 | dnl AC_SUBST(CALLBACKS) |
67 | |
65 | |
68 | dnl |
66 | dnl |
69 | dnl GNU gettext |
67 | dnl GNU gettext |
70 | dnl |
68 | dnl |
71 | |
69 | |
… | |
… | |
107 | |
105 | |
108 | dnl |
106 | dnl |
109 | dnl Checks for header files. |
107 | dnl Checks for header files. |
110 | dnl |
108 | dnl |
111 | |
109 | |
112 | AC_CHECK_HEADERS(getopt.h link.h valgrind/memcheck.h) |
110 | AC_CHECK_HEADERS(valgrind/memcheck.h) |
113 | AC_CHECK_HEADER(tr1/unordered_map, [], [AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])]) |
111 | AC_CHECK_HEADER(tr1/unordered_map, [], [AC_MSG_ERROR([Your compiler must support the Library Technical Report 1 extensions.])]) |
114 | |
112 | |
115 | AC_DEFINE(_REENTRANT, [1], [Define this]) |
113 | AC_DEFINE(_REENTRANT, [1], [Define this]) |
116 | |
114 | |
117 | #-------------------------------------------------- |
115 | #-------------------------------------------------- |
… | |
… | |
203 | AC_CHECK_LIB(crypt, crypt, [ |
201 | AC_CHECK_LIB(crypt, crypt, [ |
204 | POSIX_CRYPTC="posix.C" |
202 | POSIX_CRYPTC="posix.C" |
205 | LIBS="$LIBS -lcrypt" |
203 | LIBS="$LIBS -lcrypt" |
206 | ]) |
204 | ]) |
207 | |
205 | |
|
|
206 | AC_MSG_CHECKING(for libresolv) |
|
|
207 | AC_TRY_LINK([ |
|
|
208 | #include <netinet/in.h> |
|
|
209 | #include <arpa/nameser.h> |
|
|
210 | #include <resolv.h> |
|
|
211 | ],[ |
|
|
212 | res_init (); |
|
|
213 | ],[resolv_link=yes],[resolv_link=no]) |
|
|
214 | if test x$resolv_link = xyes; then |
|
|
215 | AC_MSG_RESULT(ok) |
|
|
216 | AC_DEFINE(HAVE_LIBRESOLV, 1, Define if you have libresolv) |
|
|
217 | LIBS="$LIBS -lresolv" |
|
|
218 | else |
|
|
219 | AC_MSG_RESULT([no, unable to link]) |
|
|
220 | fi |
|
|
221 | |
208 | AC_MSG_CHECKING(for $PERL suitability) |
222 | AC_MSG_CHECKING(for $PERL suitability) |
209 | if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then |
223 | if $PERL -MExtUtils::Embed -e "use v5.8" >/dev/null 2>&1; then |
210 | save_CXXFLAGS="$CXXFLAGS" |
224 | save_CXXFLAGS="$CXXFLAGS" |
211 | save_LIBS="$LIBS" |
225 | save_LIBS="$LIBS" |
212 | xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`" |
226 | xPERLFLAGS="`$PERL -MExtUtils::Embed -e ccopts`" |
… | |
… | |
297 | srcdir="`cd \"$srcdir\";pwd`" |
311 | srcdir="`cd \"$srcdir\";pwd`" |
298 | ;; |
312 | ;; |
299 | esac |
313 | esac |
300 | fi |
314 | fi |
301 | SRCDIR="$srcdir" |
315 | SRCDIR="$srcdir" |
|
|
316 | BUILDROOT=`pwd` |
302 | |
317 | |
303 | AC_SUBST(ABSPATHS) |
318 | AC_SUBST(ABSPATHS) |
304 | AC_SUBST(SRCDIR) |
319 | AC_SUBST(SRCDIR) |
|
|
320 | AC_SUBST(BUILDROOT) |
305 | |
321 | |
306 | dnl |
322 | dnl |
307 | dnl Filesystem Hierarchy Standard |
323 | dnl Filesystem Hierarchy Standard |
308 | dnl |
324 | dnl |
309 | |
325 | |
… | |
… | |
448 | AC_CHECK_HEADER([openssl/ssl.h],, |
464 | AC_CHECK_HEADER([openssl/ssl.h],, |
449 | [ |
465 | [ |
450 | OPENSSL_FOUND=no |
466 | OPENSSL_FOUND=no |
451 | ],[]) |
467 | ],[]) |
452 | |
468 | |
453 | if test x$OPENSSL_FOUND != xno; then |
|
|
454 | LIBS="$LIBS -lssl -lcrypto" |
|
|
455 | fi |
|
|
456 | |
|
|
457 | AM_CONDITIONAL(HAVE_OPENSSL,test x$OPENSSL_FOUND != xno) |
469 | AM_CONDITIONAL(HAVE_OPENSSL,test x$OPENSSL_FOUND != xno) |
458 | |
470 | |
459 | echo |
471 | echo |
460 | echo "Module support" |
472 | echo "Module support" |
461 | echo |
473 | echo |
462 | |
474 | |
463 | dynamic_loading="yes" |
475 | dynamic_loading="yes" |
464 | |
|
|
465 | if test "$dynamic_loading" = yes; then |
|
|
466 | AC_CHECK_HEADERS(dlfcn.h) |
|
|
467 | AC_SEARCH_LIBS(dlopen, [dl c_r], |
|
|
468 | [ |
|
|
469 | AC_DEFINE(HAVE_DLOPEN, 1, [Define if the dlopen function is available.]) |
|
|
470 | AC_CHECK_FUNC(dlsym, , |
|
|
471 | [ |
|
|
472 | AC_ERROR([dynamic loading unavailable, $PACKAGE will not work on your system]) |
|
|
473 | ]) |
|
|
474 | AC_CHECK_FUNCS(dlfunc) |
|
|
475 | AC_CHECK_FUNCS(dlinfo) |
|
|
476 | ], |
|
|
477 | [ |
|
|
478 | AC_ERROR([dynamic loading unavailable, $PACKAGE will not work on your system]) |
|
|
479 | ]) |
|
|
480 | fi |
|
|
481 | |
476 | |
482 | if test "$dynamic_loading" = yes; then |
477 | if test "$dynamic_loading" = yes; then |
483 | # The GNU linker requires the -export-dynamic option to make |
478 | # The GNU linker requires the -export-dynamic option to make |
484 | # all symbols visible in the dynamic symbol table. |
479 | # all symbols visible in the dynamic symbol table. |
485 | hold_ldflags=$LDFLAGS |
480 | hold_ldflags=$LDFLAGS |
… | |
… | |
563 | AC_SUBST(PICFLAGS) |
558 | AC_SUBST(PICFLAGS) |
564 | |
559 | |
565 | AC_ARG_ENABLE(warnings, |
560 | AC_ARG_ENABLE(warnings, |
566 | AC_HELP_STRING([--enable-warnings],[ Enable compiler warnings]), |
561 | AC_HELP_STRING([--enable-warnings],[ Enable compiler warnings]), |
567 | [ |
562 | [ |
568 | echo |
563 | |
|
|
564 | echo " " |
569 | echo "Compiler warnings" |
565 | echo "Compiler warnings" |
570 | echo |
566 | echo " " |
571 | |
567 | |
572 | dnl See what warnings we can get away with |
568 | dnl See what warnings we can get away with |
573 | ERMYTH_C_GCC_TRY_FLAGS([-Wall], ermyth_cv_c_gcc_w_all) |
569 | ERMYTH_C_GCC_TRY_FLAGS([-Wall], ermyth_cv_c_gcc_w_all) |
574 | ERMYTH_C_GCC_TRY_FLAGS([-Wpointer-arith], ermyth_cv_c_gcc_w_pointer_arith) |
570 | ERMYTH_C_GCC_TRY_FLAGS([-Wpointer-arith], ermyth_cv_c_gcc_w_pointer_arith) |
575 | ERMYTH_C_GCC_TRY_FLAGS([-Wimplicit -Wnested-externs], ermyth_cv_c_gcc_w_implicit) |
571 | ERMYTH_C_GCC_TRY_FLAGS([-Wimplicit], ermyth_cv_c_gcc_w_implicit) |
576 | ERMYTH_C_GCC_TRY_FLAGS([-Wcast-align], ermyth_cv_c_gcc_w_cast_align) |
572 | ERMYTH_C_GCC_TRY_FLAGS([-Wcast-align], ermyth_cv_c_gcc_w_cast_align) |
577 | ERMYTH_C_GCC_TRY_FLAGS([-Wcast-qual], ermyth_cv_c_gcc_w_cast_qual) |
573 | ERMYTH_C_GCC_TRY_FLAGS([-Wcast-qual], ermyth_cv_c_gcc_w_cast_qual) |
578 | ERMYTH_C_GCC_TRY_FLAGS([-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations], ermyth_cv_c_gcc_prototypes) |
|
|
579 | ERMYTH_C_GCC_TRY_FLAGS([-Wparenthesis], ermyth_cv_c_gcc_parenthesis) |
|
|
580 | ERMYTH_C_GCC_TRY_FLAGS([-Wextra], ermyth_cv_c_gcc_w_extra) |
574 | ERMYTH_C_GCC_TRY_FLAGS([-Wextra], ermyth_cv_c_gcc_w_extra) |
581 | ERMYTH_C_GCC_TRY_FLAGS([-W -Wno-unused-parameter], ermyth_cv_c_gcc_w) |
575 | ERMYTH_C_GCC_TRY_FLAGS([-W -Wno-unused-parameter], ermyth_cv_c_gcc_w) |
582 | ERMYTH_C_GCC_TRY_FLAGS([-Wshadow], ermyth_cv_c_gcc_w_shadow) |
576 | ERMYTH_C_GCC_TRY_FLAGS([-Wshadow], ermyth_cv_c_gcc_w_shadow) |
583 | ERMYTH_C_GCC_TRY_FLAGS([-Wmissing-noreturn], ermyth_cv_c_gcc_w_missing_noreturn) |
577 | dnl ERMYTH_C_GCC_TRY_FLAGS([-Wmissing-noreturn], ermyth_cv_c_gcc_w_missing_noreturn) |
584 | ERMYTH_C_GCC_TRY_FLAGS([-Wundef], ermyth_cv_c_gcc_w_undef) |
578 | ERMYTH_C_GCC_TRY_FLAGS([-Wundef], ermyth_cv_c_gcc_w_undef) |
585 | ERMYTH_C_GCC_TRY_FLAGS([-Wpacked], ermyth_cv_c_gcc_w_packed) |
579 | ERMYTH_C_GCC_TRY_FLAGS([-Wpacked], ermyth_cv_c_gcc_w_packed) |
586 | ERMYTH_C_GCC_TRY_FLAGS([-Wnested-externs], ermyth_cv_c_gcc_w_nested_externs) |
|
|
587 | ERMYTH_C_GCC_TRY_FLAGS([-Wbad-function-cast], ermyth_cv_c_gcc_w_bad_function_cast) |
|
|
588 | ERMYTH_C_GCC_TRY_FLAGS([-Wunused-function -Wunused-label -Wunused-value -Wunused-variable], ermyth_cv_c_gcc_w_unused) |
580 | ERMYTH_C_GCC_TRY_FLAGS([-Wunused-function -Wunused-label -Wunused-value -Wunused-variable], ermyth_cv_c_gcc_w_unused) |
589 | ERMYTH_C_GCC_TRY_FLAGS([-Wredundant-decls], ermyth_cv_c_gcc_w_redundant_decls) |
581 | ERMYTH_C_GCC_TRY_FLAGS([-Wredundant-decls], ermyth_cv_c_gcc_w_redundant_decls) |
590 | ERMYTH_C_GCC_TRY_FLAGS([-Wfloat-equal], ermyth_cv_c_gcc_w_float_equal) |
582 | ERMYTH_C_GCC_TRY_FLAGS([-Wfloat-equal], ermyth_cv_c_gcc_w_float_equal) |
591 | ERMYTH_C_GCC_TRY_FLAGS([-Wformat=2], ermyth_cv_c_gcc_w_format) |
583 | ERMYTH_C_GCC_TRY_FLAGS([-Wformat=2], ermyth_cv_c_gcc_w_format) |
592 | ERMYTH_C_GCC_TRY_FLAGS([-Wdisabled-optimization], ermyth_cv_c_gcc_w_format) |
584 | ERMYTH_C_GCC_TRY_FLAGS([-Wdisabled-optimization], ermyth_cv_c_gcc_w_format) |
593 | ERMYTH_C_GCC_TRY_FLAGS([-pedantic], ermyth_cv_c_gcc_pedantic) |
585 | ERMYTH_C_GCC_TRY_FLAGS([-pedantic], ermyth_cv_c_gcc_pedantic) |
594 | ERMYTH_C_GCC_TRY_FLAGS([-std=c89], ermyth_cv_c_gcc_c89) |
586 | ERMYTH_C_GCC_TRY_FLAGS([-std=c++98], ermyth_cv_c_gcc_cpp98) |
595 | |
587 | |
596 | dnl Too unreliable to be useful at this time. |
588 | dnl Too unreliable to be useful at this time. |
597 | dnl ERMYTH_C_GCC_TRY_FLAGS([-Wunreachable-code], ermyth_cv_c_gcc_w_unreachable_code) |
589 | dnl ERMYTH_C_GCC_TRY_FLAGS([-Wunreachable-code], ermyth_cv_c_gcc_w_unreachable_code) |
598 | |
590 | |
599 | dnl Maintainer flags. |
591 | dnl Maintainer flags. |
600 | dnl ERMYTH_C_GCC_TRY_FLAGS([-Wconversion], ermyth_cv_c_gcc_w_conversion) |
592 | ERMYTH_C_GCC_TRY_FLAGS([-Wconversion], ermyth_cv_c_gcc_w_conversion) |
601 | ERMYTH_C_GCC_TRY_FLAGS([-Wwrite-strings], ermyth_cv_c_gcc_w_strings) |
593 | ERMYTH_C_GCC_TRY_FLAGS([-Wwrite-strings], ermyth_cv_c_gcc_w_strings) |
602 | dnl ERMYTH_C_GCC_TRY_FLAGS([-Werror], ermyth_cv_c_gcc_w_error) |
594 | dnl ERMYTH_C_GCC_TRY_FLAGS([-Werror], ermyth_cv_c_gcc_w_error) |
603 | ]) |
595 | ]) |
604 | |
596 | |
605 | AC_ARG_ENABLE(propolice, |
597 | AC_ARG_ENABLE(propolice, |
… | |
… | |
675 | |
667 | |
676 | echo |
668 | echo |
677 | echo "Makefile generation" |
669 | echo "Makefile generation" |
678 | echo |
670 | echo |
679 | |
671 | |
|
|
672 | dnl include/common/callback.h |
680 | AC_OUTPUT([ |
673 | AC_OUTPUT([ |
681 | Makefile |
674 | Makefile |
682 | doc/Makefile |
675 | doc/Makefile |
683 | include/common/callback.h |
|
|
684 | modules/Makefile |
676 | modules/Makefile |
685 | modules/Makefile.common |
677 | modules/Makefile.common |
686 | modules/Makefile.defs |
678 | modules/Makefile.defs |
687 | modules/backend/Makefile |
679 | modules/backend/Makefile |
688 | modules/chanserv/Makefile |
680 | modules/chanserv/Makefile |