From c963815f7bd701cedb2ff44a29371bc2ea6048bd Mon Sep 17 00:00:00 2001 From: psychon Date: Fri, 24 Apr 2009 18:57:25 +0000 Subject: [PATCH] Fix configure's check for libperl perl's LDFLAGS where included in $LIBS when checking for libperl. This meant that e.g. the -L flag necessary for finding libperl was after the "-lperl" argument. This made the test fail. This moves these flags into $LDFLAGS (and later restores the old $LDFLAGS since only modperl needs those flags, modules/Makefile.in handles that). Thanks to sartek for reporting this is broken on solaris and testing the patch. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1496 726aef4b-f618-498e-8847-2d620e286838 --- configure | 5 ++++- configure.in | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/configure b/configure index aba23cf7..f922ee54 100755 --- a/configure +++ b/configure @@ -3266,13 +3266,15 @@ fi if test -n "$PERL"; then + my_saved_LDFLAGS="$LDFLAGS" + appendLD `$PERL -MExtUtils::Embed -e ccopts -e ldopts` { $as_echo "$as_me:$LINENO: checking for perl_alloc in -lperl" >&5 $as_echo_n "checking for perl_alloc in -lperl... " >&6; } if test "${ac_cv_lib_perl_perl_alloc+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lperl `$PERL -MExtUtils::Embed -e ccopts -e ldopts` $LIBS" +LIBS="-lperl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3339,6 +3341,7 @@ $as_echo "$as_me: error: could not find libperl. Try --disable-perl" >&2;} { (exit 1); exit 1; }; } fi + LDFLAGS="$my_saved_LDFLAGS" else { { $as_echo "$as_me:$LINENO: error: could not find perl binary. Try --disable-perl" >&5 $as_echo "$as_me: error: could not find perl binary. Try --disable-perl" >&2;} diff --git a/configure.in b/configure.in index fd9a3d73..8b052aa1 100644 --- a/configure.in +++ b/configure.in @@ -201,9 +201,11 @@ if test "$MODULES" = "yes"; then if test -z "$NOPERL"; then AC_PATH_PROG([PERL], [perl], []) if test -n "$PERL"; then + my_saved_LDFLAGS="$LDFLAGS" + appendLD `$PERL -MExtUtils::Embed -e ccopts -e ldopts` AC_CHECK_LIB(perl, perl_alloc,unset NOPERL, - AC_MSG_ERROR([could not find libperl. Try --disable-perl]), - [`$PERL -MExtUtils::Embed -e ccopts -e ldopts`]) + AC_MSG_ERROR([could not find libperl. Try --disable-perl])) + LDFLAGS="$my_saved_LDFLAGS" else AC_MSG_ERROR([could not find perl binary. Try --disable-perl]) fi