# # # patch "m4/idna.m4" # from [2df4573453a2d99819151ab1592336d21e8d6336] # to [5cf3b79652678da089668a065b31e5250607cf08] # # patch "m4/lua.m4" # from [5c18b1bf77c9618f16bf35901fa2e15c4b9d44a2] # to [29724cbb56455f56e0c3ba25ee352714ad1f3660] # # patch "m4/pcre.m4" # from [4bfb66558dc1a84099062093d51f6d9479b14aac] # to [845793af19e8fbd0ba46c4a7d570674d0f3e5a44] # # patch "m4/sqlite.m4" # from [119a2ef4452ba3d689bad4086db1fbed6bf5648e] # to [7c86e923f30ef5f02d2a9a426e8a3643b893addd] # ============================================================ --- m4/idna.m4 2df4573453a2d99819151ab1592336d21e8d6336 +++ m4/idna.m4 5cf3b79652678da089668a065b31e5250607cf08 @@ -5,22 +5,25 @@ AC_DEFUN([MTN_FIND_IDNA], # even if pkg-config isn't installed. The use of + instead of :+ is # deliberate; the user should be able to tell us that the empty string # is the correct set of flags. (PKG_CHECK_MODULES gets this wrong!) - if test -n "${LIBIDN_CFLAGS+set}" || test -n "${LIBIDN_LIBS+set}"; then + if test -n "${LIBIDN_CPPFLAGS+set}" || test -n "${LIBIDN_LIBS+set}"; then found_libidn=yes else PKG_CHECK_MODULES([LIBIDN], [libidn], [found_libidn=yes], [found_libidn=no]) + + if test $found_libidn = yes; then + # PKG_CHECK_MODULES adds LIBIDN_CFLAGS, but we want LIBIDN_CPPFLAGS + LIBIDN_CPPFLAGS="$LIBIDN_CFLAGS" + fi fi if test $found_libidn = no; then AC_MSG_RESULT([no; guessing]) AC_CHECK_LIB([libidn], [idna_strerror], [LIBIDN_LIBS=-lidn]) - LIBIDN_CFLAGS= + LIBIDN_CPPFLAGS= fi - LIBIDN_CPPFLAGS="$LIBIDN_CFLAGS" - # AC_MSG_NOTICE([using libidn compile flags: "$LIBIDN_CPPFLAGS"]) # AC_MSG_NOTICE([using libidn link flags: "$LIBIDN_LIBS"]) ============================================================ --- m4/lua.m4 5c18b1bf77c9618f16bf35901fa2e15c4b9d44a2 +++ m4/lua.m4 29724cbb56455f56e0c3ba25ee352714ad1f3660 @@ -7,7 +7,7 @@ AC_DEFUN([MTN_FIND_LUA], # even if pkg-config isn't installed. The use of + instead of :+ is # deliberate; the user should be able to tell us that the empty string # is the correct set of flags. (PKG_CHECK_MODULES gets this wrong!) - if test -n "${LUA_CFLAGS+set}" || test -n "${LUA_LIBS+set}"; then + if test -n "${LUA_CPPFLAGS+set}" || test -n "${LUA_LIBS+set}"; then found_liblua=yes else PKG_CHECK_MODULES([LUA], [lua5.1], @@ -19,13 +19,18 @@ AC_DEFUN([MTN_FIND_LUA], PKG_CHECK_MODULES([LUA], [lua-5.1], [found_liblua=yes], [found_liblua=no]) fi + + if test $found_liblua = yes; then + # PKG_CHECK_MODULES adds LUA_CFLAGS, but we want LUA_CPPFLAGS + LUA_CPPFLAGS="$LUA_CFLAGS" + fi fi if test $found_liblua = no; then AC_MSG_CHECKING([for lua 5.1]) # try lua-config5x, in case we're on a system with no pkg-config if test -n "`type -p lua-config51`"; then - LUA_CFLAGS="`lua-config51 --include`" + LUA_CPPFLAGS="`lua-config51 --include`" LUA_LIBS="`lua-config51 --libs`" found_liblua=yes AC_MSG_RESULT([yes]) @@ -37,23 +42,21 @@ AC_DEFUN([MTN_FIND_LUA], AC_CHECK_LIB([lua5.1], [lua_load], [LUA_LIBS=-llua5.1], [LUA_LIBS=-llua]) - LUA_CFLAGS= + LUA_CPPFLAGS= fi # Wherever we got the settings from, make sure they work. - LUA_CFLAGS="`echo :$LUA_CFLAGS | sed -e 's/^:@<:@ @:>@*//; s/@<:@ @:>@*$//'`" + LUA_CPPFLAGS="`echo :$LUA_CPPFLAGS | sed -e 's/^:@<:@ @:>@*//; s/@<:@ @:>@*$//'`" LUA_LIBS="`echo :$LUA_LIBS | sed -e 's/^:@<:@ @:>@*//; s/@<:@ @:>@*$//'`" - #AC_MSG_NOTICE([using lua compile flags: "$LUA_CFLAGS"]) - #AC_MSG_NOTICE([using lua link flags: "$LUA_LIBS"]) + # AC_MSG_NOTICE([using lua compile flags: "$LUA_CPPFLAGS"]) + # AC_MSG_NOTICE([using lua link flags: "$LUA_LIBS"]) AC_CACHE_CHECK([whether the lua library is usable], ac_cv_lib_lua_works, [save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" save_CPPFLAGS="$CPPFLAGS" LIBS="$LIBS $LUA_LIBS" - CFLAGS="$CFLAGS $LUA_CFLAGS" - CPPFLAGS="$CFLAGS $LUA_CFLAGS" + CPPFLAGS="$CPPFLAGS $LUA_CPPFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM( [ extern "C" @@ -74,7 +77,6 @@ st = luaL_newstate(); ])], [ac_cv_lib_lua_works=yes], [ac_cv_lib_lua_works=no]) LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" CPPFLAGS="$save_CPPFLAGS"]) if test $ac_cv_lib_lua_works = no; then AC_MSG_ERROR([Your lua library is not usable.]) ============================================================ --- m4/pcre.m4 4bfb66558dc1a84099062093d51f6d9479b14aac +++ m4/pcre.m4 845793af19e8fbd0ba46c4a7d570674d0f3e5a44 @@ -7,44 +7,47 @@ AC_DEFUN([MTN_FIND_PCRE], # even if pkg-config isn't installed. The use of + instead of :+ is # deliberate; the user should be able to tell us that the empty string # is the correct set of flags. (PKG_CHECK_MODULES gets this wrong!) - if test -n "${PCRE_CFLAGS+set}" || test -n "${PCRE_LIBS+set}"; then + if test -n "${PCRE_CPPFLAGS+set}" || test -n "${PCRE_LIBS+set}"; then found_libpcre=yes else PKG_CHECK_MODULES([PCRE], [libpcre], [found_libpcre=yes], [found_libpcre=no]) + + if test $found_libpcre = yes; then + # PKG_CHECK_MODULES adds PCRE_CFLAGS, but we want PCRE_CPPFLAGS + PCRE_CPPFLAGS="$PCRE_CFLAGS"; + fi fi + if test $found_libpcre = no; then # try pcre-config, in case we're on a system with no pkg-config AC_MSG_CHECKING([for PCRE using pcre-config]) if test -n "`type -p pcre-config`"; then - PCRE_CFLAGS="`pcre-config --cflags`" + PCRE_CPPFLAGS="`pcre-config --cflags`" PCRE_LIBS="`pcre-config --libs`" found_libpcre=yes AC_MSG_RESULT([yes]) fi fi + if test $found_libpcre = no; then AC_MSG_RESULT([no; guessing]) - PCRE_CFLAGS= + PCRE_CPPFLAGS= PCRE_LIBS=-lpcre fi # Wherever we got the settings from, make sure they work. - PCRE_CFLAGS="`echo :$PCRE_CFLAGS | sed -e 's/^:@<:@ @:>@*//; s/@<:@ @:>@*$//'`" + PCRE_CPPFLAGS="`echo :$PCRE_CPPFLAGS | sed -e 's/^:@<:@ @:>@*//; s/@<:@ @:>@*$//'`" PCRE_LIBS="`echo :$PCRE_LIBS | sed -e 's/^:@<:@ @:>@*//; s/@<:@ @:>@*$//'`" - if test x"$PCRE_CFLAGS" != x""; then - AC_MSG_NOTICE([using PCRE compile flags: "$PCRE_CFLAGS"]) - fi - if test x"$PCRE_LIBS" != x"-lpcre"; then - AC_MSG_NOTICE([using PCRE link flags: "$PCRE_LIBS"]) - fi + + # AC_MSG_NOTICE([using PCRE compile flags: "$PCRE_CPPFLAGS"]) + # AC_MSG_NOTICE([using PCRE link flags: "$PCRE_LIBS"]) + AC_CACHE_CHECK([whether the PCRE library is usable], ac_cv_lib_pcre_works, [save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" save_CPPFLAGS="$CPPFLAGS" LIBS="$LIBS $PCRE_LIBS" - CFLAGS="$CFLAGS $PCRE_CFLAGS" - CPPFLAGS="$CFLAGS $LUA_CFLAGS" + CPPFLAGS="$CPPFLAGS $PCRE_CPPFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM( [#include ], [const char *e; @@ -56,7 +59,6 @@ AC_DEFUN([MTN_FIND_PCRE], pcre *re = pcre_compile("foo", 0, &e, &o, 0);])], [ac_cv_lib_pcre_works=yes], [ac_cv_lib_pcre_works=no]) LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" CPPFLAGS="$save_CPPFLAGS"]) if test $ac_cv_lib_pcre_works = no; then AC_MSG_ERROR([Your PCRE library is not usable.]) @@ -67,10 +69,8 @@ AC_DEFUN([MTN_FIND_PCRE], sed -n -e 's/#define REQUIRED_PCRE_MAJOR[ ]*/#define REQUIRED_PCRE_MAJOR /p' \ -e 's/#define REQUIRED_PCRE_MINOR[ ]*/#define REQUIRED_PCRE_MINOR /p' \ $srcdir/pcrewrap.hh > conftest.h - save_CFLAGS="$CFLAGS" save_CPPFLAGS="$CPPFLAGS" - CFLAGS="$CFLAGS $PCRE_CFLAGS" - CPPFLAGS="$CFLAGS $LUA_CFLAGS" + CPPFLAGS="$CPPFLAGS $PCRE_CPPFLAGS" AC_PREPROC_IFELSE([ #include "conftest.h" #include @@ -81,9 +81,10 @@ AC_DEFUN([MTN_FIND_PCRE], [pcre_version_match=yes], [pcre_version_match=no]) AC_MSG_RESULT($pcre_version_match) - CFLAGS="$save_CFLAGS" - CPPFLAGS="$save_CPPFLAGS"]) - if test $pcre_version_match = no; then - AC_MSG_ERROR([Your PCRE library is too old, please upgrade it.]) - fi + CPPFLAGS="$save_CPPFLAGS" +]) +if test $pcre_version_match = no; then + AC_MSG_ERROR([Your PCRE library is too old, please upgrade it.]) +fi + ============================================================ --- m4/sqlite.m4 119a2ef4452ba3d689bad4086db1fbed6bf5648e +++ m4/sqlite.m4 7c86e923f30ef5f02d2a9a426e8a3643b893addd @@ -5,25 +5,28 @@ AC_DEFUN([MTN_FIND_SQLITE], # even if pkg-config isn't installed. The use of + instead of :+ is # deliberate; the user should be able to tell us that the empty string # is the correct set of flags. (PKG_CHECK_MODULES gets this wrong!) - if test -n "${SQLITE3_CFLAGS+set}" || test -n "${SQLITE3_LIBS+set}"; then + if test -n "${SQLITE3_CPPFLAGS+set}" || test -n "${SQLITE3_LIBS+set}"; then found_sqlite3=yes else PKG_CHECK_MODULES([SQLITE3], [sqlite3], [found_sqlite3=yes], [found_sqlite3=no]) + + if test $found_sqlite3 = yes; then + # PKG_CHECK_MODULES adds SQLITE_CFLAGS, but we want SQLITE_CPPFLAGS + SQLITE3_CPPFLAGS="$SQLITE3_CFLAGS" + fi fi if test $found_sqlite3 = no; then AC_MSG_RESULT([no; guessing]) AC_CHECK_LIB([sqlite3], [sqlite_open], [SQLITE3_LIBS=-lsqlite3]) - SQLITE3_CFLAGS= + SQLITE3_CPPFLAGS= fi - SQLITE3_CPPFLAGS="$SQLITE3_CFLAGS" + # AC_MSG_NOTICE([using sqlite3 compile flags: "$SQLITE3_CPPFLAGS"]) + # AC_MSG_NOTICE([using sqlite3 link flags: "$SQLITE3_LIBS"]) - # AC_MSG_NOTICE([using sqlite3 compile flags: "$SQLITE3_CPPFLAGS"]) - # AC_MSG_NOTICE([using sqlite3 link flags: "$SQLITE3_LIBS"]) - AC_SUBST(SQLITE3_CPPFLAGS) AC_SUBST(SQLITE3_LIBS)