Created
November 19, 2009 12:45
-
-
Save taf2/238745 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ext/extconf.rb b/ext/extconf.rb | |
index 9b1db02..1a82c42 100644 | |
--- a/ext/extconf.rb | |
+++ b/ext/extconf.rb | |
@@ -17,6 +17,17 @@ elsif !have_library('curl') or !have_header('curl/curl.h') | |
EOM | |
end | |
+# Check arch flags | |
+archs = $CFLAGS.scan(/-arch\s(.*?)\s/).first # get the first arch flag | |
+if archs and archs.size >= 1 | |
+ # need to reduce the number of archs... | |
+ # guess the first one is correct... at least the first one is probably the ruby installed arch... | |
+ # this could lead to compiled binaries that crash at runtime... | |
+ $CFLAGS.gsub!(/-arch\s(.*?)\s/,' ') | |
+ $CFLAGS << " -arch #{archs.first}" | |
+ puts "Selected arch: #{archs.first}" | |
+end | |
+ | |
def define(s) | |
$defs.push( format("-D HAVE_%s", s.to_s.upcase) ) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment