The PCRE test in acinclude.m4 and epan/acinclude.m4 don't work if PCRE
exists in a non-system directory. The problem is that LDFLAGS and LIBS
are set incorrectly. LIBS shouldn't contain -L arguments. The patch
below fixes this.
--
albert chin (china@xxxxxxxxxxxxxxxxxx)
-- snip snip
--- epan/acinclude.m4.orig 2003-12-16 16:35:58.244720000 -0600
+++ epan/acinclude.m4 2003-12-16 16:36:22.989305000 -0600
@@ -207,7 +207,9 @@
ethereal_save_CPPLAGS="$CPPLAGS"
CPPFLAGS="$CPPFLAGS -I$pcre_dir/include"
ethereal_save_LIBS="$LIBS"
- PCRE_LIBS="-L$pcre_dir/lib -lpcre"
+ LIBS="$LIBS -lpcre"
+ ethereal_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$pcre_dir/lib"
fi
#
@@ -258,8 +260,8 @@
then
#
# Put the "-I" and "-L" flags for pcre at
- # the beginning of CFLAGS, CPPFLAGS, and
- # LIBS.
+ # the beginning of CFLAGS, CPPFLAGS,
+ # LDFLAGS, and LIBS.
#
PCRE_LIBS="-L$pcre_dir/lib -lpcre $ethereal_save_LIBS"
else
@@ -271,12 +273,14 @@
then
#
# Restore the versions of CFLAGS, CPPFLAGS,
- # and LIBS before we added the "-with-pcre="
- # directory, as we didn't actually find
- # pcre there.
+ # LDFLAGS, and LIBS before we added the
+ # "--with-pcre=" directory, as we didn't
+ # actually find pcre there.
#
CFLAGS="$ethereal_save_CFLAGS"
CPPFLAGS="$ethereal_save_CPPLAGS"
+ LDFLAGS="$ethereal_save_LDFLAGS"
+ LIBS="$ethereal_save_LIBS"
PCRE_LIBS=""
fi
want_pcre=no
--- acinclude.m4.orig 2003-12-16 15:54:13.321183000 -0600
+++ acinclude.m4 2003-12-16 16:31:19.035816000 -0600
@@ -536,7 +411,9 @@
ethereal_save_CPPLAGS="$CPPLAGS"
CPPFLAGS="$CPPFLAGS -I$pcre_dir/include"
ethereal_save_LIBS="$LIBS"
- PCRE_LIBS="-L$pcre_dir/lib -lpcre"
+ LIBS="$LIBS -lpcre"
+ ethereal_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$pcre_dir/lib"
fi
#
@@ -587,8 +464,8 @@
then
#
# Put the "-I" and "-L" flags for pcre at
- # the beginning of CFLAGS, CPPFLAGS, and
- # LIBS.
+ # the beginning of CFLAGS, CPPFLAGS,
+ # LDFLAGS, and LIBS.
#
PCRE_LIBS="-L$pcre_dir/lib -lpcre $ethereal_save_LIBS"
else
@@ -600,12 +477,14 @@
then
#
# Restore the versions of CFLAGS, CPPFLAGS,
- # and LIBS before we added the "-with-pcre="
- # directory, as we didn't actually find
- # pcre there.
+ # LDFLAGS, and LIBS before we added the
+ # "--with-pcre=" directory, as we didn't
+ # actually find pcre there.
#
CFLAGS="$ethereal_save_CFLAGS"
CPPFLAGS="$ethereal_save_CPPLAGS"
+ LDFLAGS="$ethereal_save_LDFLAGS"
+ LIBS="$ethereal_save_LIBS"
PCRE_LIBS=""
fi
want_pcre=no