Strip all -arch flags from Perl and Ruby

The system provided Perl and Ruby libraries adds -arch flags since they
were built as universal binaries.  This causes Vim to build with these
flags which is undesirable (the default should be to only build for the
native architecture).  The solution is to strip any -arch flags from
Perl and Ruby.

A universal binary can be built by using the --with-archs configure
flag.
This commit is contained in:
Bjorn Winckler
2009-09-30 10:19:06 +02:00
parent 770796042e
commit 1ab1bec908
2 changed files with 24 additions and 11 deletions
+10 -5
View File
@@ -4864,6 +4864,11 @@ echo "${ECHO_T}OK" >&6; }
perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \
-e 'ccdlflags' | sed -e 's/-bE:perl.exp//'`
if test "x$MACOSX" = "xyes"; then
perllibs=`echo "$perllibs" | sed -e 's/-arch[^-]*//g'`
perlcppflags=`echo "$perlcppflags" | sed -e 's/-arch[^-]*//g'`
fi
{ echo "$as_me:$LINENO: checking if compile and link flags for Perl are sane" >&5
echo $ECHO_N "checking if compile and link flags for Perl are sane... $ECHO_C" >&6; }
cflags_save=$CFLAGS
@@ -5740,12 +5745,12 @@ echo "${ECHO_T}$rubyhdrdir" >&6; }
RUBY_LIBS="$librubyarg $RUBY_LIBS"
fi
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["LDFLAGS"]'`
if test "X$rubyldflags" != "X"; then
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
fi
if test "x$MACOSX" = "xyes"; then
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch[^-]*//g'`
fi
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
fi
RUBY_SRC="if_ruby.c"
RUBY_OBJ="objects/if_ruby.o"
RUBY_PRO="if_ruby.pro"
+14 -6
View File
@@ -573,6 +573,14 @@ if test "$enable_perlinterp" = "yes"; then
perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \
-e 'ccdlflags' | sed -e 's/-bE:perl.exp//'`
if test "x$MACOSX" = "xyes"; then
dnl Perl on Mac OS X 10.5 and later adds "-arch" flags but these
dnl should only be included if requested by passing --with-archs
dnl to configure, so strip these flags first (if present)
perllibs=`echo "$perllibs" | sed -e 's/-arch[[^-]]*//g'`
perlcppflags=`echo "$perlcppflags" | sed -e 's/-arch[[^-]]*//g'`
fi
dnl check that compiling a simple program still works with the flags
dnl added for Perl.
AC_MSG_CHECKING([if compile and link flags for Perl are sane])
@@ -987,15 +995,15 @@ if test "$enable_rubyinterp" = "yes"; then
RUBY_LIBS="$librubyarg $RUBY_LIBS"
fi
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'`
if test "X$rubyldflags" != "X"; then
if test "x$MACOSX" = "xyes"; then
dnl Ruby on Mac OS X 10.5 and later adds "-arch" flags but these
dnl should only be included if requested by passing --with-mac-arch
dnl should only be included if requested by passing --with-archs
dnl to configure, so strip these flags first (if present)
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
fi
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch[[^-]]*//g'`
fi
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
fi
RUBY_SRC="if_ruby.c"
RUBY_OBJ="objects/if_ruby.o"
RUBY_PRO="if_ruby.pro"