Skip to content

Instantly share code, notes, and snippets.

@felixbuenemann
Created August 1, 2013 01:46
Show Gist options
  • Save felixbuenemann/6127800 to your computer and use it in GitHub Desktop.
Save felixbuenemann/6127800 to your computer and use it in GitHub Desktop.
diff --git a/src/auto/configure b/src/auto/configure
index 4fd7b82..08af7f3 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -7184,7 +7186,7 @@ echo $ECHO_N "checking Ruby rbconfig... $ECHO_C" >&6; }
echo "${ECHO_T}$ruby_rbconfig" >&6; }
{ echo "$as_me:$LINENO: checking Ruby header files" >&5
echo $ECHO_N "checking Ruby header files... $ECHO_C" >&6; }
- rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG['rubyhdrdir'] || $ruby_rbconfig::CONFIG['archdir'] || \\$hdrdir" 2>/dev/null`
+ rubyhdrdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['rubyhdrdir'] || $ruby_rbconfig::CONFIG['archdir']" 2>/dev/null`
if test "X$rubyhdrdir" != "X"; then
{ echo "$as_me:$LINENO: result: $rubyhdrdir" >&5
echo "${ECHO_T}$rubyhdrdir" >&6; }
@@ -7206,8 +7208,9 @@ echo "${ECHO_T}$rubyhdrdir" >&6; }
librubyarg="$librubyarg"
RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
elif test -d "/System/Library/Frameworks/Ruby.framework"; then
- RUBY_LIBS="-framework Ruby"
- RUBY_CFLAGS=
+ ruby_fw_ver=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['ruby_version'][0,3]"`
+ RUBY_LIBS="/System/Library/Frameworks/Ruby.framework/Versions/$ruby_fw_ver/Ruby"
+ RUBY_CFLAGS="-I/System/Library/Frameworks/Ruby.framework/Versions/$ruby_fw_ver/Headers -DRUBY_VERSION=$rubyversion"
librubyarg=
fi
diff --git a/src/configure.in b/src/configure.in
index edf46a8..62a5d1f 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1684,7 +1687,7 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
fi
AC_MSG_RESULT($ruby_rbconfig)
AC_MSG_CHECKING(Ruby header files)
- rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG[['rubyhdrdir']] || $ruby_rbconfig::CONFIG[['archdir']] || \\$hdrdir" 2>/dev/null`
+ rubyhdrdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['rubyhdrdir']] || $ruby_rbconfig::CONFIG[['archdir']]" 2>/dev/null`
if test "X$rubyhdrdir" != "X"; then
AC_MSG_RESULT($rubyhdrdir)
RUBY_CFLAGS="-I$rubyhdrdir"
@@ -1705,10 +1708,9 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
librubyarg="$librubyarg"
RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
elif test -d "/System/Library/Frameworks/Ruby.framework"; then
- dnl On Mac OS X it is safer to just use the -framework flag
- RUBY_LIBS="-framework Ruby"
- dnl Don't include the -I flag when -framework is set
- RUBY_CFLAGS=
+ ruby_fw_ver=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['ruby_version']][[0,3]]"`
+ RUBY_LIBS="/System/Library/Frameworks/Ruby.framework/Versions/$ruby_fw_ver/Ruby"
+ RUBY_CFLAGS="-I/System/Library/Frameworks/Ruby.framework/Versions/$ruby_fw_ver/Headers -DRUBY_VERSION=$rubyversion"
librubyarg=
fi
diff --git a/src/if_ruby.c b/src/if_ruby.c
index 4436e06..44fd5ee 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -96,11 +96,7 @@
# define rb_num2int rb_num2int_stub
#endif
-#ifdef FEAT_GUI_MACVIM
-# include <Ruby/ruby.h>
-#else
-# include <ruby.h>
-#endif
+#include <ruby.h>
#ifdef RUBY19_OR_LATER
# include <ruby/encoding.h>
#endif
diff --git a/src/os_mac.h b/src/os_mac.h
index 78b79c2..54009ab 100644
--- a/src/os_mac.h
+++ b/src/os_mac.h
@@ -16,6 +16,9 @@
# define OPAQUE_TOOLBOX_STRUCTS 0
#endif
+/* Include MAC_OS_X_VERSION_* macros */
+#include <AvailabilityMacros.h>
+
/*
* Macintosh machine-dependent things.
*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment