Browse Source

Autodetect ruby-minitest. Travis-CI doesn’t have it yet.

tags/v0.99.beta20
Sam Hocevar 9 years ago
parent
commit
9af0319219
2 changed files with 14 additions and 4 deletions
  1. +12
    -4
      configure.ac
  2. +2
    -0
      ruby/Makefile.am

+ 12
- 4
configure.ac View File

@@ -471,13 +471,14 @@ AM_CONDITIONAL(USE_PYTHON, test "${ac_cv_my_have_python}" = "yes")

# Build the Ruby bindings?
ac_cv_my_have_ruby="no"
ac_cv_my_have_ruby_minitest="no"
if test "${enable_ruby}" != "no"; then
AC_PATH_PROG(RUBY, ruby, no)
if test "${RUBY}" != "no"; then
RUBY_CFLAGS="$(ruby -r mkmf -e 'conf = RbConfig::CONFIG.merge("hdrdir" => $hdrdir, "arch_hdrdir" => $arch_hdrdir); print RbConfig::expand("#$INCFLAGS", conf)')"
RUBY_LIBS="-L$(ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"RUBY_SO_NAME"@:>@')"
RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"sitearchdir"@:>@'`
RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print RbConfig::CONFIG@<:@"sitelibdir"@:>@'`
RUBY_CFLAGS="$("${RUBY}" -r mkmf -e 'conf = RbConfig::CONFIG.merge("hdrdir" => $hdrdir, "arch_hdrdir" => $arch_hdrdir); print RbConfig::expand("#$INCFLAGS", conf)')"
RUBY_LIBS="-L$("${RUBY}" -r rbconfig -e 'print RbConfig::CONFIG@<:@"libdir"@:>@') -l$("${RUBY}" -r rbconfig -e 'print RbConfig::CONFIG@<:@"RUBY_SO_NAME"@:>@')"
RUBY_SITEARCHDIR=`"${RUBY}" -r rbconfig -e 'print RbConfig::CONFIG@<:@"sitearchdir"@:>@'`
RUBY_SITELIBDIR=`"${RUBY}" -r rbconfig -e 'print RbConfig::CONFIG@<:@"sitelibdir"@:>@'`
AC_SUBST(RUBY_CFLAGS)
AC_SUBST(RUBY_LIBS)
AC_SUBST(RUBY_SITEARCHDIR)
@@ -486,9 +487,16 @@ if test "${enable_ruby}" != "no"; then
AC_CHECK_HEADERS([ruby.h],
[ac_cv_my_have_ruby="yes"
CACA_BINDINGS="${CACA_BINDINGS} Ruby"])
# For unit tests
AC_MSG_CHECKING(for ruby-minitest)
if "${RUBY}" -e "require 'minitest'" 2>/dev/null; then
ac_cv_my_have_ruby_minitest="yes"
fi
AC_MSG_RESULT(${ac_cv_my_have_ruby_minitest})
fi
fi
AM_CONDITIONAL(USE_RUBY, test "${ac_cv_my_have_ruby}" = "yes")
AM_CONDITIONAL(USE_RUBY_MINITEST, test "${ac_cv_my_have_ruby_minitest}" = "yes")

AC_MSG_CHECKING(available language bindings)
if test -z "${CACA_BINDINGS}"; then


+ 2
- 0
ruby/Makefile.am View File

@@ -7,8 +7,10 @@ rubysitedir = $(RUBY_SITELIBDIR)
if USE_RUBY
rubylib_LTLIBRARIES = caca.la
rubysite_DATA = lib/caca.rb
if USE_RUBY_MINITEST
TESTS = test
endif
endif

CFLAGS += -Wno-strict-prototypes -Wno-missing-prototypes



Loading…
Cancel
Save