]> git.notmuchmail.org Git - notmuch/commitdiff
build: Allow user to specify ruby executable
authorThomas Schneider <qsx@chaotikum.eu>
Wed, 9 May 2018 12:38:48 +0000 (14:38 +0200)
committerDavid Bremner <david@tethera.net>
Fri, 11 May 2018 00:01:06 +0000 (21:01 -0300)
This way, one can build for a different Ruby than $PATH/ruby
(e. g. different versions, or Ruby in other paths).

Signed-off-by: Thomas Schneider <qsx@chaotikum.eu>
bindings/Makefile.local
configure
test/test-lib.sh

index 17b561caac52dfc17a1f4fc9e56758b32dbb25fd..2ba2775c8e59af673837688576520689f5335f60 100644 (file)
@@ -9,7 +9,7 @@ ifeq ($(HAVE_RUBY_DEV),1)
                EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \
                LIBNOTMUCH="../../lib/$(LINKER_NAME)" \
                NOTMUCH_SRCDIR='$(NOTMUCH_SRCDIR)' \
                EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \
                LIBNOTMUCH="../../lib/$(LINKER_NAME)" \
                NOTMUCH_SRCDIR='$(NOTMUCH_SRCDIR)' \
-               ruby extconf.rb --vendor
+               $(RUBY) extconf.rb --vendor
        $(MAKE) -C $(dir)/ruby
 endif
 
        $(MAKE) -C $(dir)/ruby
 endif
 
index 1a6bf295a8b3241867120ea493b8323e195da3fc..cbb3b7cc4245f1d81979ebb1b1b1fd3fff716a9e 100755 (executable)
--- a/configure
+++ b/configure
@@ -62,6 +62,7 @@ CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
 LDFLAGS=${LDFLAGS:-}
 XAPIAN_CONFIG=${XAPIAN_CONFIG:-}
 PYTHON=${PYTHON:-}
 LDFLAGS=${LDFLAGS:-}
 XAPIAN_CONFIG=${XAPIAN_CONFIG:-}
 PYTHON=${PYTHON:-}
+RUBY=${RUBY:-ruby}
 
 # We don't allow the EMACS or GZIP Makefile variables inherit values
 # from the environment as we do with CC and CXX above. The reason is
 
 # We don't allow the EMACS or GZIP Makefile variables inherit values
 # from the environment as we do with CC and CXX above. The reason is
@@ -118,6 +119,8 @@ Other environment variables can be used to control configure itself,
                        library. [$XAPIAN_CONFIG]
        PYTHON          Name of python command to use in
                        configure and the test suite.
                        library. [$XAPIAN_CONFIG]
        PYTHON          Name of python command to use in
                        configure and the test suite.
+       RUBY            Name of ruby command to use in
+                       configure and the test suite.
 
 Additionally, various options can be specified on the configure
 command line.
 
 Additionally, various options can be specified on the configure
 command line.
@@ -621,7 +624,7 @@ fi
 have_ruby_dev=0
 if [ $WITH_RUBY = "1" ] ; then
     printf "Checking for ruby development files... "
 have_ruby_dev=0
 if [ $WITH_RUBY = "1" ] ; then
     printf "Checking for ruby development files... "
-    if ruby -e "require 'mkmf'"> /dev/null 2>&1; then
+    if ${RUBY} -e "require 'mkmf'"> /dev/null 2>&1; then
        printf "Yes.\n"
        have_ruby_dev=1
     else
        printf "Yes.\n"
        have_ruby_dev=1
     else
@@ -1027,6 +1030,9 @@ WARN_CFLAGS=${WARN_CFLAGS}
 # Name of python interpreter
 PYTHON = ${python}
 
 # Name of python interpreter
 PYTHON = ${python}
 
+# Name of ruby interpreter
+RUBY = ${RUBY}
+
 # The prefix to which notmuch should be installed
 # Note: If you change this value here, be sure to ensure that the
 # LIBDIR_IN_LDCONFIG value below is still set correctly.
 # The prefix to which notmuch should be installed
 # Note: If you change this value here, be sure to ensure that the
 # LIBDIR_IN_LDCONFIG value below is still set correctly.
@@ -1234,6 +1240,9 @@ NOTMUCH_HAVE_MAN=$((have_sphinx))
 # Name of python interpreter
 NOTMUCH_PYTHON=${python}
 
 # Name of python interpreter
 NOTMUCH_PYTHON=${python}
 
+# Name of ruby interpreter
+NOTMUCH_RUBY=${RUBY}
+
 # Are the ruby development files (and ruby) available? If not skip
 # building/testing ruby bindings.
 NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev}
 # Are the ruby development files (and ruby) available? If not skip
 # building/testing ruby bindings.
 NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev}
index 5b2125142929b182723c75b3519776fc03298ad7..7e064021023ce15deabe72883fb3451d81430056 100644 (file)
@@ -1003,7 +1003,7 @@ test_python() {
 }
 
 test_ruby() {
 }
 
 test_ruby() {
-    MAIL_DIR=$MAIL_DIR ruby -I $NOTMUCH_SRCDIR/bindings/ruby> OUTPUT
+    MAIL_DIR=$MAIL_DIR $NOTMUCH_RUBY -I $NOTMUCH_SRCDIR/bindings/ruby> OUTPUT
 }
 
 test_C () {
 }
 
 test_C () {