From 91c3283cfa7d7306beefa5489f51c865de1559da Mon Sep 17 00:00:00 2001 From: binki Date: Fri, 24 Dec 2010 02:29:53 +0000 Subject: [PATCH] - Fix bundled TRE compilation error on OpenBSD with pkg-config-0.21 where pkg-config can't find 'tre.pc'. Reported by CuleX. (#3982) Also properly escape the sed expression used in the pkg-config call. --- Changes | 3 +++ configure | 11 +++++++---- configure.ac | 20 +++++++++++--------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Changes b/Changes index dd6cd7979..390cc1370 100644 --- a/Changes +++ b/Changes @@ -2252,3 +2252,6 @@ - Fix invalid use of 'wc -l' when detecting the AsynchDNS feature of libcurl which breaks compilation on FreeBSD; instead use 'grep -q'. Reported by Jobe (#3981), solution proposed by satmd. +- Fix bundled TRE compilation error on OpenBSD with pkg-config-0.21 + where pkg-config can't find 'tre.pc'. Reported by CuleX. (#3982) + Also properly escape the sed expression used in the pkg-config call. diff --git a/configure b/configure index 290a7f0b2..4c2b7f1a2 100755 --- a/configure +++ b/configure @@ -6696,10 +6696,13 @@ $as_echo "installing TRE regex library" >&6; } $ac_cv_prog_MAKER install || exit 1 TRE_CFLAGS="-I$cur_dir/extras/regexp/include" -if test "x$ac_cv_path_PKGCONFIG" = "x" ; then - TRE_LIBS="../extras/regexp/lib/libtre.a" -else - TRE_LIBS=`$ac_cv_path_PKGCONFIG --static --libs tre.pc | sed -e 's,-L\(^ \+lib\) -ltre,\1/libtre.a,'` + +TRE_LIBS= +if test -n "$ac_cv_path_PKGCONFIG"; then : + TRE_LIBS="`$ac_cv_path_PKGCONFIG --static --libs tre.pc | sed 's,-L\([^ ]\+lib\) -ltre,\1/libtre.a,'`" +fi +if test -z "$TRE_LIBS"; then : + TRE_LIBS="../extras/regexp/lib/libtre.a" fi cd $cur_dir diff --git a/configure.ac b/configure.ac index a92e433a6..3944e39c1 100644 --- a/configure.ac +++ b/configure.ac @@ -567,15 +567,17 @@ AC_MSG_RESULT(installing TRE regex library) $ac_cv_prog_MAKER install || exit 1 TRE_CFLAGS="-I$cur_dir/extras/regexp/include" AC_SUBST(TRE_CFLAGS) -if test "x$ac_cv_path_PKGCONFIG" = "x" ; then - dnl for when pkg-config isn't available - TRE_LIBS="../extras/regexp/lib/libtre.a" -else - dnl See c-ares's compilation section for more info on this hack. - dnl ensure that we're linking against the bundled version of tre - dnl (we only reach this code if linking against the bundled version is desired). - TRE_LIBS=`$ac_cv_path_PKGCONFIG --static --libs tre.pc | sed -e 's,-L\([^ ]\+lib\) -ltre,\1/libtre.a,'` -fi + +TRE_LIBS= +dnl See c-ares's compilation section for more info on this hack. +dnl ensure that we're linking against the bundled version of tre +dnl (we only reach this code if linking against the bundled version is desired). +AS_IF([test -n "$ac_cv_path_PKGCONFIG"], + [TRE_LIBS="`$ac_cv_path_PKGCONFIG --static --libs tre.pc | sed ['s,-L\([^ ]\+lib\) -ltre,\1/libtre.a,']`"]) +dnl For when pkg-config isn't available -- or for when pkg-config +dnl doesn't see the tre.pc file somehow... (#3982) +AS_IF([test -z "$TRE_LIBS"], + [TRE_LIBS="../extras/regexp/lib/libtre.a"]) AC_SUBST(TRE_LIBS) cd $cur_dir ],[