Skip to content

Instantly share code, notes, and snippets.

@bdwong
Created April 6, 2011 19:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdwong/906314 to your computer and use it in GitHub Desktop.
Save bdwong/906314 to your computer and use it in GitHub Desktop.
Patch to SWIG 2.0.2 to make it build with rvm under Mac OS 10.6
--- configure 2011-02-20 12:24:48.000000000 -0800
+++ configure.mine 2011-03-29 15:46:00.000000000 -0700
@@ -8654,15 +8654,20 @@
RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG["archdir"] || $archdir') 2>/dev/null`
if test x"$RUBYDIR" != x""; then
- dirs="$RUBYDIR"
- RUBYINCLUDE=none
+ # dirs for rvm
+ dirs="`cd $MY_RUBY_HOME/include/*/*/ruby/..;pwd` `cd $MY_RUBY_HOME/include/*;pwd`"
+ RUBYINCLUDE=""
+ # Some archs need more than one include directory.
+ ALLINCLUDE=""
for i in $dirs; do
if test -r $i/ruby.h; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5
-$as_echo "$i" >&6; }
- RUBYINCLUDE="-I$i"
- break;
+ RUBYINCLUDE="$RUBYINCLUDE -I$i"
fi
+ ALLINCLUDE="$ALLINCLUDE -I$i"
done
- if test "$RUBYINCLUDE" = none; then
+ if test -n "$RUBYINCLUDE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5
+$as_echo "$i" >&6; }
+ RUBYINCLUDE="$ALLINCLUDE"
+ else
RUBYINCLUDE="-I$RUBYDIR"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: could not locate ruby.h...using $RUBYINCLUDE" >&5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment