From 497e30a0bb157dce6dffd3d5ad414dc299f42442 Mon Sep 17 00:00:00 2001 From: Lee Starnes Date: Tue, 27 May 2014 10:39:55 -0400 Subject: [PATCH 1/8] configure: add --enable-shared-sqlite option When --enable-shared-sqlite is used, charybdis will be compiled with a shared sqlite library if it is available. --- bandb/Makefile.in | 17 ++++++++---- configure | 70 +++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 15 ++++++++++ 3 files changed, 97 insertions(+), 5 deletions(-) diff --git a/bandb/Makefile.in b/bandb/Makefile.in index 6ad7e2af6..3d45e2822 100644 --- a/bandb/Makefile.in +++ b/bandb/Makefile.in @@ -29,9 +29,10 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PROGRAM_PREFIX = @PROGRAM_PREFIX@ +SQLITE_LIB = @SQLITE_LD@ ZIP_LIB = @ZLIB_LD@ -IRCDLIBS = @MODULES_LIBS@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS) $(ZIP_LIB) +IRCDLIBS = @MODULES_LIBS@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS) $(ZIP_LIB) $(SQLITE_LIB) INCLUDES = -I. -I../include -I../libratbox/include $(SSL_INCLUDES) CPPFLAGS = ${INCLUDES} @CPPFLAGS@ @@ -45,16 +46,22 @@ PROGS = $(pkglibexec_PROGS) $(bin_PROGS) BANDB_SOURCES = \ bandb.c \ rsdb_snprintf.c \ - rsdb_sqlite3.c \ - sqlite3.c + rsdb_sqlite3.c + +ifndef SQLITE_LIB + BANDB_SOURCES+=sqlite3.c +endif BANDB_OBJECTS = ${BANDB_SOURCES:.c=.o} BANTOOL_SOURCES = \ bantool.c \ rsdb_snprintf.c \ - rsdb_sqlite3.c \ - sqlite3.c + rsdb_sqlite3.c + +ifndef SQLITE_LIB + BANTOOL_SOURCES+=sqlite3.c +endif BANTOOL_OBJECTS = ${BANTOOL_SOURCES:.c=.o} diff --git a/configure b/configure index 7ec29cddf..e0d32d891 100755 --- a/configure +++ b/configure @@ -642,6 +642,7 @@ HELP_DIR logdir LOG_DIR ETC_DIR +SQLITE_LD ZLIB_LD ENCSPEED ALLOCA @@ -732,6 +733,7 @@ enable_ipv6 enable_openssl with_zlib_path enable_zlib +enable_shared_sqlite enable_ports enable_poll enable_select @@ -1379,6 +1381,7 @@ Optional Features: --enable-openssl=DIR Enable OpenSSL support (DIR optional). --disable-openssl Disable OpenSSL support. --disable-zlib Disable ziplinks support + --enable-shared-sqlite Use shared sqlite --enable-ports Force solaris I/O ports subsystem usage. --enable-poll Force poll() usage. --enable-select Force select() usage. @@ -7242,6 +7245,73 @@ fi +fi + +# Check whether --enable-shared-sqlite was given. +if test "${enable_shared_sqlite+set}" = set; then : + enableval=$enable_shared_sqlite; shared_sqlite=$enableval +else + shared_sqlite=no +fi + + +if test "$shared_sqlite" = yes; then + +ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" +if test "x$ac_cv_header_sqlite3_h" = xyes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 +$as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } +if ${ac_cv_lib_sqlite3_sqlite3_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsqlite3 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqlite3_open (); +int +main () +{ +return sqlite3_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sqlite3_sqlite3_open=yes +else + ac_cv_lib_sqlite3_sqlite3_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 +$as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } +if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then : + + SQLITE_LD=-lsqlite3 + + +else + shared_sqlite=no +fi + + +else + shared_sqlite=no +fi + + + fi diff --git a/configure.ac b/configure.ac index b58de4ba5..2fa76a453 100644 --- a/configure.ac +++ b/configure.ac @@ -564,6 +564,21 @@ AC_CHECK_HEADER(zlib.h, [ fi +AC_ARG_ENABLE(shared-sqlite, +AC_HELP_STRING([--enable-shared-sqlite],[Use shared sqlite]), +[shared_sqlite=$enableval],[shared_sqlite=no]) + +if test "$shared_sqlite" = yes; then + +AC_CHECK_HEADER(sqlite3.h, [ + AC_CHECK_LIB(sqlite3, sqlite3_open, + [ + AC_SUBST(SQLITE_LD, -lsqlite3) + ], shared_sqlite=no) +], shared_sqlite=no) + +fi + dnl IO Loop Selection dnl ================= From 74ab6be0948b2d25c04512cd9d01b4d41b6cc897 Mon Sep 17 00:00:00 2001 From: Lee Starnes Date: Thu, 29 May 2014 17:53:43 -0400 Subject: [PATCH 2/8] bandb: make Makefile work with BSD make again --- bandb/Makefile.in | 14 ++++---------- configure | 6 ++++++ configure.ac | 4 ++++ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/bandb/Makefile.in b/bandb/Makefile.in index 3d45e2822..1bb034285 100644 --- a/bandb/Makefile.in +++ b/bandb/Makefile.in @@ -46,22 +46,16 @@ PROGS = $(pkglibexec_PROGS) $(bin_PROGS) BANDB_SOURCES = \ bandb.c \ rsdb_snprintf.c \ - rsdb_sqlite3.c - -ifndef SQLITE_LIB - BANDB_SOURCES+=sqlite3.c -endif + rsdb_sqlite3.c \ + @SQLITE_SRC@ BANDB_OBJECTS = ${BANDB_SOURCES:.c=.o} BANTOOL_SOURCES = \ bantool.c \ rsdb_snprintf.c \ - rsdb_sqlite3.c - -ifndef SQLITE_LIB - BANTOOL_SOURCES+=sqlite3.c -endif + rsdb_sqlite3.c \ + @SQLITE_SRC@ BANTOOL_OBJECTS = ${BANTOOL_SOURCES:.c=.o} diff --git a/configure b/configure index e0d32d891..5c3fdcf90 100755 --- a/configure +++ b/configure @@ -642,6 +642,7 @@ HELP_DIR logdir LOG_DIR ETC_DIR +SQLITE_SRC SQLITE_LD ZLIB_LD ENCSPEED @@ -7312,6 +7313,11 @@ fi +fi + +if test "$shared_sqlite" = no; then + SQLITE_SRC=sqlite3.c + fi diff --git a/configure.ac b/configure.ac index 2fa76a453..60706e600 100644 --- a/configure.ac +++ b/configure.ac @@ -579,6 +579,10 @@ AC_CHECK_HEADER(sqlite3.h, [ fi +if test "$shared_sqlite" = no; then + AC_SUBST(SQLITE_SRC, sqlite3.c) +fi + dnl IO Loop Selection dnl ================= From a6ef3156ec996987cd5f2ced64515c57e0f18a40 Mon Sep 17 00:00:00 2001 From: Lee Starnes Date: Sat, 31 May 2014 21:14:09 -0400 Subject: [PATCH 3/8] configure: use --with-shared-sqlite instead of --enable-shared-sqlite --- configure | 11 ++++++----- configure.ac | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/configure b/configure index 5c3fdcf90..4e1df5044 100755 --- a/configure +++ b/configure @@ -734,7 +734,7 @@ enable_ipv6 enable_openssl with_zlib_path enable_zlib -enable_shared_sqlite +with_shared_sqlite enable_ports enable_poll enable_select @@ -1382,7 +1382,6 @@ Optional Features: --enable-openssl=DIR Enable OpenSSL support (DIR optional). --disable-openssl Disable OpenSSL support. --disable-zlib Disable ziplinks support - --enable-shared-sqlite Use shared sqlite --enable-ports Force solaris I/O ports subsystem usage. --enable-poll Force poll() usage. --enable-select Force select() usage. @@ -1400,6 +1399,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-zlib-path=DIR Path to libz.so for ziplinks support. + --with-shared-sqlite Use shared sqlite --with-confdir=DIR Directory to install config files [deprecated, use --sysconfdir instead]. --with-logdir=DIR Directory where to write logfiles. @@ -7248,9 +7248,10 @@ fi fi -# Check whether --enable-shared-sqlite was given. -if test "${enable_shared_sqlite+set}" = set; then : - enableval=$enable_shared_sqlite; shared_sqlite=$enableval + +# Check whether --with-shared-sqlite was given. +if test "${with_shared_sqlite+set}" = set; then : + withval=$with_shared_sqlite; shared_sqlite=$withval else shared_sqlite=no fi diff --git a/configure.ac b/configure.ac index 60706e600..c6152a7b6 100644 --- a/configure.ac +++ b/configure.ac @@ -564,9 +564,9 @@ AC_CHECK_HEADER(zlib.h, [ fi -AC_ARG_ENABLE(shared-sqlite, -AC_HELP_STRING([--enable-shared-sqlite],[Use shared sqlite]), -[shared_sqlite=$enableval],[shared_sqlite=no]) +AC_ARG_WITH(shared-sqlite, +AC_HELP_STRING([--with-shared-sqlite],[Use shared sqlite]), +[shared_sqlite=$withval],[shared_sqlite=no]) if test "$shared_sqlite" = yes; then From cf1001a73934bc7ab9c5f41a9a139a2319b5f87c Mon Sep 17 00:00:00 2001 From: Lee Starnes Date: Sat, 31 May 2014 22:56:12 -0400 Subject: [PATCH 4/8] configure: fix linking with shared sqlite on *BSD --- configure | 25 ++++++++++++++++++++----- configure.ac | 29 ++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 4e1df5044..86b205641 100755 --- a/configure +++ b/configure @@ -7259,10 +7259,21 @@ fi if test "$shared_sqlite" = yes; then +saveCPPFLAGS="$CPPFLAGS" +saveLIBS="$LIBS" + +OSNAME=`uname -s` +case $OSNAME in + *BSD) + CPPFLAGS="$CPPFLAGS -I/usr/local/include" + LIBS="$LIBS -L/usr/local/lib" + ;; +esac + ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" if test "x$ac_cv_header_sqlite3_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 $as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } if ${ac_cv_lib_sqlite3_sqlite3_open+:} false; then : $as_echo_n "(cached) " >&6 @@ -7300,8 +7311,7 @@ fi $as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then : - SQLITE_LD=-lsqlite3 - + SQLITE_LD="$CPPFLAGS $LIBS -lsqlite3" else shared_sqlite=no @@ -7317,11 +7327,16 @@ fi fi if test "$shared_sqlite" = no; then - SQLITE_SRC=sqlite3.c - + SQLITE_SRC="sqlite3.c" fi + + +CPPFLAGS="$saveCPPFLAGS" +LIBS="$saveLIBS" + + # Check whether --enable-ports was given. if test "${enable_ports+set}" = set; then : enableval=$enable_ports; if test $enableval = yes; then diff --git a/configure.ac b/configure.ac index c6152a7b6..57e439934 100644 --- a/configure.ac +++ b/configure.ac @@ -564,25 +564,44 @@ AC_CHECK_HEADER(zlib.h, [ fi +dnl Check for shared sqlite +dnl ====================== AC_ARG_WITH(shared-sqlite, AC_HELP_STRING([--with-shared-sqlite],[Use shared sqlite]), [shared_sqlite=$withval],[shared_sqlite=no]) if test "$shared_sqlite" = yes; then +saveCPPFLAGS="$CPPFLAGS" +saveLIBS="$LIBS" + +dnl XXX: *BSD uses /usr/local for shared sqlite libs and includes +OSNAME=`uname -s` +case $OSNAME in + *BSD) + CPPFLAGS="$CPPFLAGS -I/usr/local/include" + LIBS="$LIBS -L/usr/local/lib" + ;; +esac + AC_CHECK_HEADER(sqlite3.h, [ - AC_CHECK_LIB(sqlite3, sqlite3_open, - [ - AC_SUBST(SQLITE_LD, -lsqlite3) - ], shared_sqlite=no) + AC_CHECK_LIB(sqlite3, sqlite3_open, [ + SQLITE_LD="$CPPFLAGS $LIBS -lsqlite3" + ], shared_sqlite=no) ], shared_sqlite=no) fi if test "$shared_sqlite" = no; then - AC_SUBST(SQLITE_SRC, sqlite3.c) + SQLITE_SRC="sqlite3.c" fi +AC_SUBST(SQLITE_LD) +AC_SUBST(SQLITE_SRC) + +CPPFLAGS="$saveCPPFLAGS" +LIBS="$saveLIBS" + dnl IO Loop Selection dnl ================= From bd4ebd6b18bea331ca707292933db9e9e910176d Mon Sep 17 00:00:00 2001 From: Lee Starnes Date: Sun, 1 Jun 2014 15:40:19 -0400 Subject: [PATCH 5/8] configure: move local autoconf macros to m4/charybdis.m4 --- aclocal.m4 => m4/charybdis.m4 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename aclocal.m4 => m4/charybdis.m4 (100%) diff --git a/aclocal.m4 b/m4/charybdis.m4 similarity index 100% rename from aclocal.m4 rename to m4/charybdis.m4 From 83c9439aa3fcf3fcb311ef711eaf51e4b1e6a7fa Mon Sep 17 00:00:00 2001 From: Lee Starnes Date: Sun, 1 Jun 2014 15:43:55 -0400 Subject: [PATCH 6/8] m4/pkg.m4: add pkg-config-0.24 macros --- m4/pkg.m4 | 287 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 287 insertions(+) create mode 100644 m4/pkg.m4 diff --git a/m4/pkg.m4 b/m4/pkg.m4 new file mode 100644 index 000000000..75a89ecfe --- /dev/null +++ b/m4/pkg.m4 @@ -0,0 +1,287 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_INSTALLDIR + + +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_NOARCH_INSTALLDIR + + +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +# Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])# PKG_CHECK_VAR + +# PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +# [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +# [DESCRIPTION], [DEFAULT]) +# +# Prepare a "--with-" configure option using the lowercase [VARIABLE-PREFIX] +# name, merging the behaviour of AC_ARG_WITH and PKG_CHECK_MODULES in a single +# macro +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +]) dnl PKG_WITH_MODULES + +# PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +# [DESCRIPTION], [DEFAULT]) +# +# Convenience macro to trigger AM_CONDITIONAL after +# PKG_WITH_MODULES check. +# +# HAVE_[VARIABLE-PREFIX] is exported as make variable. +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +]) + +# PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +# [DESCRIPTION], [DEFAULT]) +# +# Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +# PKG_WITH_MODULES check. +# +# HAVE_[VARIABLE-PREFIX] is exported as make and preprocessor variable. +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +]) From f286b102d8f91585a15f7f6d6d920cff72d04ca5 Mon Sep 17 00:00:00 2001 From: Lee Starnes Date: Sun, 1 Jun 2014 15:44:36 -0400 Subject: [PATCH 7/8] aclocal.m4: rerun aclocal --- aclocal.m4 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 aclocal.m4 diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 000000000..1b8e45c78 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,16 @@ +# generated automatically by aclocal 1.14 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_include([m4/charybdis.m4]) +m4_include([m4/pkg.m4]) From a5471f2483eb46b454abc7d638c3d290e847d9e4 Mon Sep 17 00:00:00 2001 From: Lee Starnes Date: Sun, 1 Jun 2014 15:50:01 -0400 Subject: [PATCH 8/8] configure: use pkg-config for sqlite --- bandb/Makefile.in | 7 +- configure | 464 +++++++++++++++++++++++----------------------- configure.ac | 29 +-- 3 files changed, 240 insertions(+), 260 deletions(-) diff --git a/bandb/Makefile.in b/bandb/Makefile.in index 1bb034285..a08525a9b 100644 --- a/bandb/Makefile.in +++ b/bandb/Makefile.in @@ -29,12 +29,13 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PROGRAM_PREFIX = @PROGRAM_PREFIX@ -SQLITE_LIB = @SQLITE_LD@ +SQLITE_LIBS = @SQLITE_LD@ +SQLITE_INCLUDES = @SQLITE_INCLUDES@ ZIP_LIB = @ZLIB_LD@ -IRCDLIBS = @MODULES_LIBS@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS) $(ZIP_LIB) $(SQLITE_LIB) +IRCDLIBS = @MODULES_LIBS@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS) $(ZIP_LIB) $(SQLITE_LIBS) -INCLUDES = -I. -I../include -I../libratbox/include $(SSL_INCLUDES) +INCLUDES = -I. -I../include -I../libratbox/include $(SSL_INCLUDES) $(SQLITE_INCLUDES) CPPFLAGS = ${INCLUDES} @CPPFLAGS@ CFLAGS += -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION=1 diff --git a/configure b/configure index 86b205641..81a25d1d4 100755 --- a/configure +++ b/configure @@ -621,7 +621,6 @@ ac_includes_default="\ # include #endif" -enable_option_checking=no ac_subst_vars='LTLIBOBJS LIBOBJS SEDOBJ @@ -643,7 +642,13 @@ logdir LOG_DIR ETC_DIR SQLITE_SRC +SQLITE_INCLUDES SQLITE_LD +SQLITE_LIBS +SQLITE_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG ZLIB_LD ENCSPEED ALLOCA @@ -677,7 +682,6 @@ SET_MAKE STDOUT MAKEDEPEND MKDEP -subdirs EGREP GREP CPP @@ -767,8 +771,13 @@ LIBS CPPFLAGS CPP YACC -YFLAGS' -ac_subdirs_all='libratbox' +YFLAGS +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +SQLITE_CFLAGS +SQLITE_LIBS' + # Initialize some variables set by options. ac_init_help= @@ -1432,6 +1441,14 @@ Some influential environment variables: YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + SQLITE_CFLAGS + C compiler flags for SQLITE, overriding pkg-config + SQLITE_LIBS linker flags for SQLITE, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -2452,6 +2469,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_config_headers="$ac_config_headers include/setup.h" @@ -4256,39 +4274,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$OLD_CFLAGS" -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - - - -subdirs="$subdirs libratbox" - if test "$ac_cv_c_compiler_gnu" != yes; then @@ -4731,6 +4716,35 @@ $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -7259,83 +7273,210 @@ fi if test "$shared_sqlite" = yes; then -saveCPPFLAGS="$CPPFLAGS" -saveLIBS="$LIBS" -OSNAME=`uname -s` -case $OSNAME in - *BSD) - CPPFLAGS="$CPPFLAGS -I/usr/local/include" - LIBS="$LIBS -L/usr/local/lib" - ;; -esac -ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" -if test "x$ac_cv_header_sqlite3_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5 -$as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; } -if ${ac_cv_lib_sqlite3_sqlite3_open+:} false; then : + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsqlite3 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char sqlite3_open (); -int -main () -{ -return sqlite3_open (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_sqlite3_sqlite3_open=yes + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - ac_cv_lib_sqlite3_sqlite3_open=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5 -$as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; } -if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then : - - SQLITE_LD="$CPPFLAGS $LIBS -lsqlite3" - +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 else - shared_sqlite=no + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac fi - - +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } else - shared_sqlite=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLITE" >&5 +$as_echo_n "checking for SQLITE... " >&6; } + +if test -n "$SQLITE_CFLAGS"; then + pkg_cv_SQLITE_CFLAGS="$SQLITE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sqlite3") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SQLITE_CFLAGS=`$PKG_CONFIG --cflags "sqlite3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SQLITE_LIBS"; then + pkg_cv_SQLITE_LIBS="$SQLITE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sqlite3") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SQLITE_LIBS=`$PKG_CONFIG --libs "sqlite3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried fi +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + SQLITE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sqlite3" 2>&1` + else + SQLITE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sqlite3" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SQLITE_PKG_ERRORS" >&5 + + shared_sqlite=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + shared_sqlite=no +else + SQLITE_CFLAGS=$pkg_cv_SQLITE_CFLAGS + SQLITE_LIBS=$pkg_cv_SQLITE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + shared_sqlite=yes + +fi fi if test "$shared_sqlite" = no; then SQLITE_SRC="sqlite3.c" fi +SQLITE_LD="$SQLITE_LIBS" + +SQLITE_INCLUDES="$SQLITE_CFLAGS" -CPPFLAGS="$saveCPPFLAGS" -LIBS="$saveLIBS" - # Check whether --enable-ports was given. if test "${enable_ports+set}" = set; then : @@ -11042,151 +11183,6 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi - -# -# CONFIG_SUBDIRS section. -# -if test "$no_recursion" != yes; then - - # Remove --cache-file, --srcdir, and --disable-option-checking arguments - # so they do not pile up. - ac_sub_configure_args= - ac_prev= - eval "set x $ac_configure_args" - shift - for ac_arg - do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case $ac_arg in - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ - | --c=*) - ;; - --config-cache | -C) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - ;; - --disable-option-checking) - ;; - *) - case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append ac_sub_configure_args " '$ac_arg'" ;; - esac - done - - # Always prepend --prefix to ensure using the same prefix - # in subdir configurations. - ac_arg="--prefix=$prefix" - case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" - - # Pass --silent - if test "$silent" = yes; then - ac_sub_configure_args="--silent $ac_sub_configure_args" - fi - - # Always prepend --disable-option-checking to silence warnings, since - # different subdirs can have different --enable and --with options. - ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" - - ac_popdir=`pwd` - for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - test -d "$srcdir/$ac_dir" || continue - - ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" - $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 - $as_echo "$ac_msg" >&6 - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - cd "$ac_dir" - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f "$ac_srcdir/configure.gnu"; then - ac_sub_configure=$ac_srcdir/configure.gnu - elif test -f "$ac_srcdir/configure"; then - ac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.in"; then - # This should be Cygnus configure. - ac_sub_configure=$ac_aux_dir/configure - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 -$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - # Make the cache file name correct relative to the subdirectory. - case $cache_file in - [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; - *) # Relative name. - ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 -$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} - # The eval makes quoting arguments work. - eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ - --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || - as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 - fi - - cd "$ac_popdir" - done -fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} diff --git a/configure.ac b/configure.ac index 57e439934..582170cbf 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,7 @@ AC_COPYRIGHT([$Id: configure.ac 3516 2007-06-10 16:14:03Z jilles $]) AC_INIT([charybdis], [3.5.0-dev]) +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADER(include/setup.h) AC_PREFIX_DEFAULT($HOME/ircd) @@ -26,7 +27,6 @@ AC_LANG(C) dnl Make sure autoconf doesn't interfere with cflags -jmallett CFLAGS="$OLD_CFLAGS" -AC_CONFIG_SUBDIRS(libratbox) dnl Check for various compilers. -jmallett dnl But if $CC turns out to be gcc, sure as hell it's, well, gcc. -joshk @@ -571,37 +571,20 @@ AC_HELP_STRING([--with-shared-sqlite],[Use shared sqlite]), [shared_sqlite=$withval],[shared_sqlite=no]) if test "$shared_sqlite" = yes; then - -saveCPPFLAGS="$CPPFLAGS" -saveLIBS="$LIBS" - -dnl XXX: *BSD uses /usr/local for shared sqlite libs and includes -OSNAME=`uname -s` -case $OSNAME in - *BSD) - CPPFLAGS="$CPPFLAGS -I/usr/local/include" - LIBS="$LIBS -L/usr/local/lib" - ;; -esac - -AC_CHECK_HEADER(sqlite3.h, [ - AC_CHECK_LIB(sqlite3, sqlite3_open, [ - SQLITE_LD="$CPPFLAGS $LIBS -lsqlite3" + PKG_CHECK_MODULES(SQLITE, [sqlite3], + [ + shared_sqlite=yes ], shared_sqlite=no) -], shared_sqlite=no) - fi if test "$shared_sqlite" = no; then SQLITE_SRC="sqlite3.c" fi -AC_SUBST(SQLITE_LD) +AC_SUBST(SQLITE_LD, "$SQLITE_LIBS") +AC_SUBST(SQLITE_INCLUDES, "$SQLITE_CFLAGS") AC_SUBST(SQLITE_SRC) -CPPFLAGS="$saveCPPFLAGS" -LIBS="$saveLIBS" - dnl IO Loop Selection dnl =================