From 9af0319219b0c7b6860b0d8b634ae9377808cf83 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 24 Jan 2016 15:42:52 +0100 Subject: [PATCH] =?UTF-8?q?Autodetect=20ruby-minitest.=20Travis-CI=20doesn?= =?UTF-8?q?=E2=80=99t=20have=20it=20yet.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configure.ac | 16 ++++++++++++---- ruby/Makefile.am | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 0a83ad6..8f15b96 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/ruby/Makefile.am b/ruby/Makefile.am index 0c5f8a0..7cf6193 100644 --- a/ruby/Makefile.am +++ b/ruby/Makefile.am @@ -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