diff options
author | Peter Simons <simons@cryp.to> | 2013-03-25 13:33:33 +0100 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2013-03-25 13:33:33 +0100 |
commit | 7259a45f01744196d19185a21249deb2175b844f (patch) | |
tree | 9339ba6479d817943efb7242d73c4c003001f858 /m4/ax_lib_expat.m4 | |
parent | c866673240279cea0f5378dc0b8ad225c99918ba (diff) | |
download | autoconf-archive-7259a45f01744196d19185a21249deb2175b844f.tar.gz |
AX_LIB_EXPAT don't overwrite $LIBS
Furthermore, linker flags are now returned in $EXPAT_LDFLAGS instead of
$EXPAT_LIBS. See <http://savannah.gnu.org/patch/?7968> for more details.
Diffstat (limited to 'm4/ax_lib_expat.m4')
-rw-r--r-- | m4/ax_lib_expat.m4 | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/m4/ax_lib_expat.m4 b/m4/ax_lib_expat.m4 index 16e66de..20b95a9 100644 --- a/m4/ax_lib_expat.m4 +++ b/m4/ax_lib_expat.m4 @@ -29,6 +29,7 @@ # # AC_SUBST(EXPAT_CFLAGS) # AC_SUBST(EXPAT_LIBS) +# AC_SUBST(EXPAT_LDFLAGS) # AC_SUBST(EXPAT_VERSION) -- only if version requirement is used # # And sets: @@ -44,7 +45,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 9 +#serial 10 AC_DEFUN([AX_LIB_EXPAT], [ @@ -108,7 +109,8 @@ AC_DEFUN([AX_LIB_EXPAT], if test -n "$expat_prefix"; then expat_include_dir="$expat_prefix/include" - expat_lib_flags="-L$expat_prefix/lib -lexpat" + expat_ld_flags="-L$expat_prefix/lib" + expat_lib_flags="-lexpat" run_expat_test="yes" elif test "$expat_requested" = "yes"; then if test -n "$expat_include_dir" -a -n "$expat_lib_flags"; then @@ -126,8 +128,11 @@ AC_DEFUN([AX_LIB_EXPAT], saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$expat_include_dir" + saved_LIBS="$LIBS" + LIBS="$LIBS $expat_lib_flags" + saved_LDFLAGS="$LDFLAGS" - LIBS="$LDFLAGS $expat_lib_flags" + LDFLAGS="$LDFLAGS $expat_ld_flags" dnl dnl Check Expat headers @@ -175,6 +180,7 @@ p = NULL; )], [ EXPAT_LIBS="$expat_lib_flags" + EXPAT_LDFLAGS="$expat_ld_flags" expat_lib_found="yes" AC_MSG_RESULT([found]) ], @@ -188,6 +194,7 @@ p = NULL; CPPFLAGS="$saved_CPPFLAGS" LDFLAGS="$saved_LDFLAGS" + LIBS="$saved_LIBS" fi AC_MSG_CHECKING([for Expat XML Parser]) @@ -196,6 +203,7 @@ p = NULL; if test "$expat_header_found" = "yes" -a "$expat_lib_found" = "yes"; then AC_SUBST([EXPAT_CFLAGS]) + AC_SUBST([EXPAT_LDFLAGS]) AC_SUBST([EXPAT_LIBS]) HAVE_EXPAT="yes" |