From 65fef7efba36dd75d41344d423283047ce07e818 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Wed, 12 Aug 2009 09:03:32 -0600 Subject: fix pcre build issues Reviewed by: nkinder (Thanks!) --- m4/pcre.m4 | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'm4') diff --git a/m4/pcre.m4 b/m4/pcre.m4 index f60123e2..6096108d 100644 --- a/m4/pcre.m4 +++ b/m4/pcre.m4 @@ -53,24 +53,8 @@ AC_ARG_WITH(pcre, [ --with-pcre=PATH Perl Compatible Regular Expression direc ], AC_MSG_RESULT(no)) -dnl - check in system locations -if test -z "$pcre_inc"; then - AC_MSG_CHECKING(for pcre.h) - if test -f "/usr/include/pcre.h"; then - AC_MSG_RESULT([using /usr/include/pcre.h]) - pcre_incdir="/usr/include" - pcre_inc="-I/usr/include" - pcre_lib='-L$(libdir)' - pcre_libdir='$(libdir)' - else - AC_MSG_RESULT(no) - AC_MSG_ERROR([pcre not found, specify with --with-pcre.]) - fi -fi # # if PCRE is not found yet, try pkg-config - -# last resort if test -z "$pcre_inc" -o -z "$pcre_lib" -o -z "$pcre_libdir"; then AC_PATH_PROG(PKG_CONFIG, pkg-config) AC_MSG_CHECKING(for pcre with pkg-config) @@ -80,8 +64,29 @@ if test -z "$pcre_inc" -o -z "$pcre_lib" -o -z "$pcre_libdir"; then pcre_lib=`$PKG_CONFIG --libs-only-L pcre` pcre_libdir=`$PKG_CONFIG --libs-only-L pcre | sed -e s/-L// | sed -e s/\ .*$//` AC_MSG_RESULT([using system PCRE]) + elif $PKG_CONFIG --exists libpcre; then + pcre_inc=`$PKG_CONFIG --cflags-only-I libpcre` + pcre_lib=`$PKG_CONFIG --libs-only-L libpcre` + pcre_libdir=`$PKG_CONFIG --libs-only-L libpcre | sed -e s/-L// | sed -e s/\ .*$//` + AC_MSG_RESULT([using system PCRE]) else AC_MSG_ERROR([PCRE not found, specify with --with-pcre.]) fi fi fi + +dnl last resort +dnl - check in system locations +if test -z "$pcre_inc"; then + AC_MSG_CHECKING(for pcre.h) + if test -f "/usr/include/pcre.h"; then + AC_MSG_RESULT([using /usr/include/pcre.h]) + pcre_incdir="/usr/include" + pcre_inc="-I/usr/include" + pcre_lib='-L$(libdir)' + pcre_libdir='$(libdir)' + else + AC_MSG_RESULT(no) + AC_MSG_ERROR([pcre not found, specify with --with-pcre.]) + fi +fi -- cgit