diff --git a/config/perl.m4 b/config/perl.m4 index 808c86b52b8..f2fbc09d848 100644 --- a/config/perl.m4 +++ b/config/perl.m4 @@ -25,12 +25,16 @@ AC_DEFUN([PGAC_CHECK_PERL_CONFIGS], # PGAC_CHECK_PERL_EMBED_LDFLAGS # ----------------------------- +# We are after Embed's ldopts, but without the subset mentioned in +# Config's ccdlflags; and also without any -arch flags, which recent +# Apple releases put in unhelpfully. (If you want a multiarch build +# you'd better be specifying it in more places than plperl's final link.) AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS], [AC_REQUIRE([PGAC_PATH_PERL]) AC_MSG_CHECKING(for flags to link embedded Perl) pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts` pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'` -perl_embed_ldflags=`echo X"$pgac_tmp1" | sed "s/^X//;s%$pgac_tmp2%%"` +perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]` AC_SUBST(perl_embed_ldflags)dnl if test -z "$perl_embed_ldflags" ; then AC_MSG_RESULT(no) diff --git a/configure b/configure index 6d4bf5a3202..ea89b5afd71 100755 --- a/configure +++ b/configure @@ -5336,7 +5336,7 @@ echo "$as_me:$LINENO: checking for flags to link embedded Perl" >&5 echo $ECHO_N "checking for flags to link embedded Perl... $ECHO_C" >&6 pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts` pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'` -perl_embed_ldflags=`echo X"$pgac_tmp1" | sed "s/^X//;s%$pgac_tmp2%%"` +perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"` if test -z "$perl_embed_ldflags" ; then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6