Ben Reser wrote on Thu, Aug 15, 2013 at 21:27:40 -0700:
> Probably should fix 1.7.x to not try to use the none command when ruby 
> isn't detected and to emit a proper error message.

FWIW, this is reproducible in trunk,

% RUBY=none ./configure
% make
% make swig-rb

I've looked into a patch.  Attached is what I came up with.  I'm not
sure there isn't a simpler way, so posting here.  The idea of the patch
is to prefix a '.swig_checked-rb' to both instances of the 'swig-rb'
targets and to check $(RUBY) in there, so 'make swig-rb' might generate
swig wrappers (if $(SWIG) != 'none') but will then fail when it gets to
the part that require a 'ruby' binary.

With the patch applied, I get:

% ./autogen.sh >/dev/null && rm -f config.cache && RUBY=none ../*ce -q && make 
-sj4
% make swig-rb
Ruby not found by configure
make: *** [.swig_checked-rb] Error 1
zsh: exit 2     make swig-rb
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 1515085)
+++ Makefile.in	(working copy)
@@ -768,6 +768,7 @@ extraclean-bindings: clean-swig extraclean-swig-he
 
 clean-swig: clean-swig-headers clean-swig-py clean-swig-rb clean-swig-pl
 	@rm -f .swig_checked
+	@rm -f .swig_checked-pl .swig_checked-rb .swig_checked-py
 
 EXTRACLEAN_SWIG_HEADERS=rm -f $(SWIG_SRC_DIR)/proxy/*.swg
 
@@ -793,7 +794,7 @@ READLINK_PL=$(PERL) -e 'use Cwd; print Cwd::realpa
 
 swig-pl_DEPS = autogen-swig-pl libsvn_swig_perl \
   $(SWIG_PL_DIR)/native/Makefile
-swig-pl: $(swig-pl_DEPS)
+swig-pl: .swig_checked-pl $(swig-pl_DEPS)
 	if test "`$(READLINK_PL) $(SWIG_PL_DIR)`" != "`$(READLINK_PL) $(SWIG_PL_SRC_DIR)`"; then \
 	  ln -sf $(SWIG_PL_SRC_DIR)/native/*.c $(SWIG_PL_DIR)/native; \
 	fi
@@ -836,7 +837,7 @@ copy-swig-py: autogen-swig-py $(SWIG_PY_DIR)/libsv
 	done
 	@touch $(SWIG_PY_DIR)/libsvn/__init__.py
 
-swig-py: autogen-swig-py copy-swig-py
+swig-py: .swig_checked-py autogen-swig-py copy-swig-py
 
 check-swig-py: swig-py
 	$(TEST_SHLIB_VAR_SWIG_PY) \
@@ -859,7 +860,7 @@ clean-swig-py:
 extraclean-swig-py: clean-swig-py
 	$(EXTRACLEAN_SWIG_PY)
 
-swig-rb: autogen-swig-rb
+swig-rb: .swig_checked-rb autogen-swig-rb
 
 check-swig-rb: swig-rb svnserve
 	$(TEST_SHLIB_VAR_SWIG_RB) \
Index: autogen.sh
===================================================================
--- autogen.sh	(revision 1515085)
+++ autogen.sh	(working copy)
@@ -143,6 +143,7 @@ if test -n "$RELEASE_MODE"; then
 
   # Remove the .swig_checked file
   rm -f .swig_checked
+  rm -f .swig_checked-pl .swig_checked-rb .swig_checked-py
 fi
 
 if test -n "$SKIP_DEPS"; then
Index: build/generator/gen_make.py
===================================================================
--- build/generator/gen_make.py	(revision 1515085)
+++ build/generator/gen_make.py	(working copy)
@@ -355,6 +355,9 @@ class Generator(gen_base.GeneratorBase):
 
       outputs = [ ]
 
+      if itype in ['swig-rb', 'swig-py', 'swig-pl']:
+        outputs.append('.swig_checked-' + itype[5:])
+
       for t in i_targets:
         if hasattr(t, 'filename'):
           outputs.append(t.filename)
Index: build/generator/templates/build-outputs.mk.ezt
===================================================================
--- build/generator/templates/build-outputs.mk.ezt	(revision 1515085)
+++ build/generator/templates/build-outputs.mk.ezt	(working copy)
@@ -90,6 +90,21 @@ autogen-swig: autogen-swig-[swig_langs.short]
 	fi
 	@touch .swig_checked
 
+.swig_checked-rb:
+	@if test "$(RUBY)" = "none"; then \
+	  echo "Ruby not found by configure" >&2; exit 1; \
+	fi
+	@touch .swig_checked-rb
+.swig_checked-pl:
+	@if test "$(PERL)" = "none"; then \
+	  echo "Perl not found by configure" >&2; exit 1; \
+	fi
+	@touch .swig_checked-pl
+.swig_checked-py:
+	@if test "$(PYTHON)" = "none"; then \
+	  echo "Python not found by configure" >&2; exit 1; \
+	fi
+	@touch .swig_checked-py
 
 ########################################
 # Section 5: Individual target build rules
Index: configure.ac
===================================================================
--- configure.ac	(revision 1515085)
+++ configure.ac	(working copy)
@@ -1544,6 +1544,7 @@ AC_SUBST(SVN_CONFIG_SCRIPT_FILES)
 
 # Ensure that SWIG is checked after reconfiguration.
 rm -f .swig_checked
+rm -f .swig_checked-pl .swig_checked-rb .swig_checked-py
 
 dnl Provide ${host} for use in compiled code (for svn --version)
 AC_DEFINE_UNQUOTED([SVN_BUILD_HOST], "${host}",
Index: .
===================================================================
--- .	(revision 1515085)
+++ .	(working copy)

Property changes on: .
___________________________________________________________________
Modified: svn:ignore
## -8,6 +8,9 ##
 libtool
 .gdb_history
 .swig_checked
+.swig_checked-py
+.swig_checked-pl
+.swig_checked-rb
 *.orig
 *.rej
 TAGS

Reply via email to