diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-06-14 17:14:11 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-06-14 17:14:11 -0400 |
commit | 07bc6fe6687fbf2ac0fea5b09fe5a4932a725368 (patch) | |
tree | b6856c32bac190c1bc555daf9f13d8cababab74a | |
parent | 1f5e6cd90590742f4344e423826dae09306d755b (diff) | |
download | postgresql-07bc6fe6687fbf2ac0fea5b09fe5a4932a725368.tar.gz postgresql-07bc6fe6687fbf2ac0fea5b09fe5a4932a725368.zip |
Suppress -arch switches in the output of ExtUtils::Embed.
We previously found out that OS X's standard perl installation tries to put
-arch switches into Perl link commands, evidently in hopes of building
universal binaries. But it doesn't work to add such switches in plperl's
link step if they weren't being used earlier, so this is basically
unworkable. When using gcc the result is only some warnings; but LLVM
fails entirely, so this issue isn't as cosmetic as we originally thought.
Hence, back-patch commit d69a419e682c2d39c2355105a7e5e2b90357c8f0 into
pre-9.0 branches.
-rw-r--r-- | config/perl.m4 | 6 | ||||
-rwxr-xr-x | configure | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/config/perl.m4 b/config/perl.m4 index 1352a991d84..ccd18792952 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 e8a65c49d8c..e89d2bdc1e3 100755 --- a/configure +++ b/configure @@ -4955,7 +4955,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 |