Eric Sunshine patch - build fixes for NextStep. Fixes for Ruby 1.8.x.

Slightly modified Ruby patch so it works on Cygwin.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5672 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-01-22 22:39:08 +00:00
commit 1869f2d821

View file

@ -67,7 +67,11 @@ else
fi fi
dnl Checks for library functions. dnl Checks for types.
AC_LANG_PUSH([C++])
AC_CHECK_TYPES([bool])
AC_LANG_POP([C++])
# Set info about shared libraries. # Set info about shared libraries.
AC_SUBST(SO) AC_SUBST(SO)
@ -658,7 +662,7 @@ fi
AC_MSG_CHECKING(for Perl5 header files) AC_MSG_CHECKING(for Perl5 header files)
if test -n "$PERL"; then if test -n "$PERL"; then
PERL5DIR=`($PERL -e 'use Config; print $Config{archlib};') 2>/dev/null` PERL5DIR=`($PERL -e 'use Config; print $Config{archlib}, "\n";') 2>/dev/null`
if test "$PERL5DIR" != ""; then if test "$PERL5DIR" != ""; then
dirs="$PERL5DIR $PERL5DIR/CORE" dirs="$PERL5DIR $PERL5DIR/CORE"
PERL5EXT=none PERL5EXT=none
@ -675,14 +679,14 @@ if test -n "$PERL"; then
fi fi
AC_MSG_CHECKING(for Perl5 library) AC_MSG_CHECKING(for Perl5 library)
PERL5LIB=`($PERL -e 'use Config; $_=$Config{libperl}; s/^lib//; s/$Config{_a}$//; print $_') 2>/dev/null` PERL5LIB=`($PERL -e 'use Config; $_=$Config{libperl}; s/^lib//; s/$Config{_a}$//; print $_, "\n"') 2>/dev/null`
if test "$PERL5LIB" = "" ; then if test "$PERL5LIB" = "" ; then
AC_MSG_RESULT(not found) AC_MSG_RESULT(not found)
else else
AC_MSG_RESULT($PERL5LIB) AC_MSG_RESULT($PERL5LIB)
fi fi
AC_MSG_CHECKING(for Perl5 compiler options) AC_MSG_CHECKING(for Perl5 compiler options)
PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}' | sed "s/-I/$ISYSTEM/") 2>/dev/null` PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}, "\n"' | sed "s/-I/$ISYSTEM/") 2>/dev/null`
if test "$PERL5CCFLAGS" = "" ; then if test "$PERL5CCFLAGS" = "" ; then
AC_MSG_RESULT(not found) AC_MSG_RESULT(not found)
else else
@ -972,22 +976,27 @@ if test -n "$RUBY"; then
AC_MSG_RESULT(could not locate ruby.h...using $RUBYINCLUDE) AC_MSG_RESULT(could not locate ruby.h...using $RUBYINCLUDE)
fi fi
# Find library and path for linking. Use libruby.a except on Cygwin use the DLL. # Find library and path for linking.
AC_MSG_CHECKING(for Ruby library) AC_MSG_CHECKING(for Ruby library)
RUBYLIB="" RUBYLIB=""
case $host in rb_libdir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["libdir"]]') 2>/dev/null`
*-*-cygwin* | *-*-mingw*) rb_bindir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["bindir"]]') 2>/dev/null`
rb_libdir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["libdir"]]') 2>/dev/null` dirs="$dirs $rb_libdir $rb_bindir"
rb_bindir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["bindir"]]') 2>/dev/null`
dirs="$dirs $rb_libdir $rb_bindir" rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_A"]]') 2>/dev/null`
rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_SO"]]') 2>/dev/null` RUBYLINK=`($RUBY -rrbconfig -e '
RUBYLINK=`($RUBY -rrbconfig -e 'print Config::CONFIG[["RUBY_SO_NAME"]]') 2>/dev/null` c = Config::CONFIG
;; if c.has_key? "LIBRUBYARG_STATIC" # 1.8.x
*) if c[["LIBRUBY"]] == c[["LIBRUBY_A"]]
rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_A"]]') 2>/dev/null` link = c[["LIBRUBYARG_STATIC"]]
RUBYLINK=`($RUBY -rrbconfig -e 'print Config::CONFIG[["RUBY_INSTALL_NAME"]]') 2>/dev/null` else
;; link = c[["LIBRUBYARG_SHARED"]]
esac end
else # 1.6.x
link = "-l" + c[["RUBY_INSTALL_NAME"]]
end
puts link') 2>/dev/null`
if test "$rb_libruby" != ""; then if test "$rb_libruby" != ""; then
for i in $dirs; do for i in $dirs; do
if (test -r $i/$rb_libruby;) then if (test -r $i/$rb_libruby;) then
@ -1007,7 +1016,7 @@ if test -n "$RUBY"; then
RUBYINCLUDE="-I$RUBYDIR" RUBYINCLUDE="-I$RUBYDIR"
RUBYLIB="$RUBYDIR" RUBYLIB="$RUBYDIR"
fi fi
RUBYLINK="-l$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBS"]]') 2>/dev/null`" RUBYLINK="$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBS"]]') 2>/dev/null`"
RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print Config::CONFIG[["CCDLFLAGS"]]') 2>/dev/null` RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print Config::CONFIG[["CCDLFLAGS"]]') 2>/dev/null`
else else
AC_MSG_RESULT(could not figure out how to run ruby) AC_MSG_RESULT(could not figure out how to run ruby)