From 16d242970376e6944191a038b3b259c0ecfb29d1 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 12 Nov 2013 12:00:17 -0600 Subject: [PATCH] Extract archflags method from cflags method --- Library/ENV/4.3/cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 1c1f3adcec..cd77caf0bf 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -185,7 +185,7 @@ class Cmd args << '-march=native' if tool =~ /clang/ end - ENV['HOMEBREW_ARCHS'].split(',').each { |a| args << "-arch" << a } if cccfg? 'u' + args.concat(archflags) args << "-std=#{@arg0}" if @arg0 =~ /c[89]9/ args end @@ -196,6 +196,11 @@ class Cmd args << '-stdlib=libstdc++' if cccfg? 'h' args end + def archflags + args = [] + ENV['HOMEBREW_ARCHS'].split(',').each { |a| args << "-arch" << a } if cccfg? 'u' + args + end def syslibpath # We reject brew's lib as we explicitly add this as a -L flag, thus it # is given higher priority by cc, so it surpasses the system libpath.