From ff95b17588bcbb9e0e6ee660e65951009e49c46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Fri, 14 Dec 2012 13:33:37 +0000 Subject: [PATCH] Adapt configure.in to detect ruby.h in Ruby1.9+ canonical include pathes Fixes issue 3595945 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13964 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- configure.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.in b/configure.in index 1c31b74a0..07a78fb11 100644 --- a/configure.in +++ b/configure.in @@ -1340,7 +1340,13 @@ fi AC_MSG_CHECKING(for Ruby header files) if test -n "$RUBY"; then + # Try Ruby1.9 first + RUBYDIR=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["rubyhdrdir"]] || $rubyhdrdir') 2>/dev/null` + if test x"$RUBYDIR" == x""; then RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null` + else + RUBYARCH=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["arch"]] || $arch') 2>/dev/null` + fi if test x"$RUBYDIR" != x""; then dirs="$RUBYDIR" RUBYINCLUDE=none @@ -1351,6 +1357,9 @@ if test -n "$RUBY"; then break; fi done + if test x"$RUBYARCH" != x""; then + RUBYINCLUDE="-I$RUBYDIR -I$RUBYDIR/$RUBYARCH" + fi if test "$RUBYINCLUDE" = none; then RUBYINCLUDE="-I$RUBYDIR" AC_MSG_RESULT(could not locate ruby.h...using $RUBYINCLUDE)