Skip to content

Commit

Permalink
Merge pull request #390 from radford/libperl-ldopts
Browse files Browse the repository at this point in the history
libperl's ldopts include libaries and therefore should go in LIBS not LDFLAGS
  • Loading branch information
Marc Fournier committed Feb 6, 2015
2 parents e655312 + f0e6ade commit 4c88746
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
28 changes: 14 additions & 14 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3219,12 +3219,12 @@ if test "x$with_libperl" = "xyes" \
&& test -n "$perl_interpreter"
then
SAVE_CFLAGS="$CFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
SAVE_LIBS="$LIBS"
dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
PERL_LDFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
CFLAGS="$CFLAGS $PERL_CFLAGS"
LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
LIBS="$LIBS $PERL_LIBS"

AC_CACHE_CHECK([for libperl],
[c_cv_have_libperl],
Expand All @@ -3251,13 +3251,13 @@ dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string
then
AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
AC_SUBST(PERL_CFLAGS)
AC_SUBST(PERL_LDFLAGS)
AC_SUBST(PERL_LIBS)
else
with_libperl="no"
fi

CFLAGS="$SAVE_CFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
LIBS="$SAVE_LIBS"
else if test -z "$perl_interpreter"; then
with_libperl="no (no perl interpreter found)"
c_cv_have_libperl="no"
Expand All @@ -3267,9 +3267,9 @@ AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
if test "x$with_libperl" = "xyes"
then
SAVE_CFLAGS="$CFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
SAVE_LIBS="$LIBS"
CFLAGS="$CFLAGS $PERL_CFLAGS"
LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
LIBS="$LIBS $PERL_LIBS"

AC_CACHE_CHECK([if perl supports ithreads],
[c_cv_have_perl_ithreads],
Expand All @@ -3296,17 +3296,17 @@ then
fi

CFLAGS="$SAVE_CFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
LIBS="$SAVE_LIBS"
fi

if test "x$with_libperl" = "xyes"
then
SAVE_CFLAGS="$CFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
SAVE_LIBS="$LIBS"
# trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
# (see issues #41 and #42)
CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
LIBS="$LIBS $PERL_LIBS"

AC_CACHE_CHECK([for broken Perl_load_module()],
[c_cv_have_broken_perl_load_module],
Expand All @@ -3330,17 +3330,17 @@ then
)

CFLAGS="$SAVE_CFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
LIBS="$SAVE_LIBS"
fi
AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
test "x$c_cv_have_broken_perl_load_module" = "xyes")

if test "x$with_libperl" = "xyes"
then
SAVE_CFLAGS="$CFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
SAVE_LIBS="$LIBS"
CFLAGS="$CFLAGS $PERL_CFLAGS"
LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
LIBS="$LIBS $PERL_LIBS"

AC_CHECK_MEMBER(
[struct mgvtbl.svt_local],
Expand All @@ -3359,7 +3359,7 @@ then
fi

CFLAGS="$SAVE_CFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
LIBS="$SAVE_LIBS"
fi
# }}}

Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ perl_la_CFLAGS += -Wno-nonnull
endif
perl_la_LDFLAGS = $(PLUGIN_LDFLAGS) \
$(PERL_LDFLAGS)
perl_la_LIBADD = $(PERL_LIBS)
endif

if BUILD_PLUGIN_PF
Expand Down

0 comments on commit 4c88746

Please sign in to comment.