From 5dff57d7140b95b46b16926a0f4bc5c39d359df4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Sat, 24 Jul 2010 16:19:44 +0200
Subject: [PATCH] Remove -arch flag from build flags for Perl. (Bjorn Wickler)

---
 runtime/doc/todo.txt | 22 ++++++++++------------
 src/auto/configure   |  4 +++-
 src/configure.in     |  7 ++++++-
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 9604e32a01..547941bbfe 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -30,6 +30,16 @@ be worked on, but only if you sponsor Vim development.  See |sponsor|.
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
+Before release 7.3:
+- Rename vim73 branch to default (hints: Xavier de Gaye, 2010 May 23)
+
+Add documentation for Python 3 support.
+
+6   In the quickfix window statusline add the command used to get the list of
+    errors, e.g. ":make foo", ":grep something *.c".
+    New patch 2010 Jul 24
+    Docs patch by Dominique Pelle, Mar 25 included?
+
 Check position in wrapped line with 'concealcursor' set.
 
 Trick with syntax ID works, but it's not nice.  Can we give a sequence nr to
@@ -1111,12 +1121,6 @@ Patch to support horizontal scroll wheel in GTK. Untested. (Bjorn Winckler,
 2010 Jun 30)
 
 
-Before (beta) release 7.3:
-- Documentation for Python 3 support.
-
-Before release 7.3:
-- Rename vim73 branch to default (hints: Xavier de Gaye, 2010 May 23)
-
 More patches:
 -   Another patch for Javascript indenting. (Hari Kumar, 2010 Jul 11)
     Needs a few tests.
@@ -1154,12 +1158,6 @@ More patches:
     more friendly for the Vim distribution.
     New version received 2008 Jan 6.
     No maintenance in two years...
-6   In the quickfix window statusline add the command used to get the list of
-    errors, e.g. ":make foo", ":grep something *.c".
-    Patch by Lech Lorens, 2009 Apri 17.
-    Comments from Andreas Bernauer 24th, Dominique Pelle 24th
-    Docs patch by Dominique Pelle, Mar 25
-    Can we put the strings in a window-local variable?
 -   Patch to access screen under Python. (Marko Mahni, 2010 Jul 18)
 
 
diff --git a/src/auto/configure b/src/auto/configure
index 651c79221d..cd829d18d8 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -5083,6 +5083,8 @@ $as_echo ">>> too old; need Perl version 5.003_01 or later <<<" >&6; }
       PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
       PERL_LIBS="-L$darwindir/CORE -lperl"
     fi
+                PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
+    PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
   fi
   if test "$enable_perlinterp" = "dynamic"; then
     if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then
@@ -6116,7 +6118,7 @@ $as_echo "$rubyhdrdir" >&6; }
 	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//'`
+	  	  	  	  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
diff --git a/src/configure.in b/src/configure.in
index 836d242847..f472210405 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -727,6 +727,11 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
       PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
       PERL_LIBS="-L$darwindir/CORE -lperl"
     fi
+    dnl Perl on Mac OS X 10.5 adds "-arch" flags but these should only
+    dnl be included if requested by passing --with-mac-arch to
+    dnl configure, so strip these flags first (if present)
+    PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
+    PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
   fi
   if test "$enable_perlinterp" = "dynamic"; then
     if test "$perl_ok" = "yes" -a "X$libperl" != "X"; then
@@ -1286,7 +1291,7 @@ if test "$enable_rubyinterp" = "yes"; then
 	  dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only
 	  dnl be included if requested by passing --with-mac-arch to
 	  dnl configure, so strip these flags first (if present)
-	  rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//'`
+	  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
-- 
GitLab