On 2020/11/17 11:01, Yasuhito FUTATSUKI wrote:
> On 2020/11/17 2:16, Daniel Shahaf wrote:
>> Yasuhito FUTATSUKI wrote on Sat, 14 Nov 2020 14:52 +0900:
>>> +++ subversion/bindings/swig/INSTALL (working copy)
>>> @@ -141,7 +141,15 @@
>>> - Make sure that Subversion's ./configure script sees your installed SWIG!
>>> + If you are using the distribution tarball and you want to use the
>>> language
>>> + bindings C source files shipped with it, you might need to pass the
>>> + --without-swig option to configure script to avoid detecting and checking
>>> + SWIG on your system. A Makefile generated by configure will prevent
>>> + building the language bindings if the configure script detect unsuitable
>>> + version of SWIG.
>>
>> I don't dispute the accuracy of this paragraph, but I think this API
>> isn't autotools-idiomatic.
>>
>> Generally, I'd expect --without-foo to short-circuit the probe for foo
>> and assume foo isn't found; i.e., if my system has an unsuitable
>> version of foo, I'd the default behaviour (given neither --with-foo nor
>> --without-foo) and the behaviour given --without-foo to be identical:
>> namely, behave as though foo isn't available (even if /usr/bin/foo
>> exists and is perfectly suitable).
>>
>> In particular, if my system has an unsuitable version of swig,
>> I wouldn't expect passing --without-swig to change configure's behaviour.
>
> Probably what is wrong here is that the configure script accepts
> --with-swig | --without-swig options and checks it in release mode.
>
> We never clean SWIG generated language bindings C source files on
> clean-foo targets in release mode Makefile. extraclean-foo targets do it,
> but they are only parts of the extraclean target which also removes all
> release mode stuff. So users never use SWIG in release mode actually.
>
> That is, r1876662 is not correct.
To fix it, I tweaked the configure script again.
The patch attached introduce "release mode" for configure generation.
With this patch, configure script generated by "autogen.sh --release"
does not have --with-swig|--without-swig option and never check SWIG
executable.
Could anyone please review this?
For backward compatibility to back port to 1.14.x, default for
--with-swig-perl, --with-swig-python, --with-swig-ruby are "auto",
i.e. search the target language, but I'd like to change them to "no" in
trunk, because I think those are optional feature.
Thanks,
--
Yasuhito FUTATSUKI <[email protected]>
Distinguish configure scripts on release mode and non release mode.
Although makefiles in the Subversion's release tarball do not support to
genarate SWIG language bindings C source files using swig, the configure
scripts shipped with release tarball had a option to specify how to find
SWIG executable, and checked it. To avoid this, we introduce "release mode"
to the configure script and hiding an option and code to check a SWIG
executable on it.
* . (svn:ignore):
Ignore aclocal.m4.
* aclocal.m4 ():
Renamed to aclocal.m4.in
* aclocal.m4.in ():
Renamed from aclocal.m4.in
* autogen.sh ():
Define SVN_RELEASE_MODE macro if --release is specfied from command line.
* build/ac-macros/swig.m4
(): Also mension about Perl and Ruby.
(SVN_CHECK_SWIG):
- Hide --with-swig option in release mode.
- Check SWIG executable only if non release mode and at least one of
SWIG bindings is specfied to be built.
(SVN_FIND_SWIG):
Move checks for each bindings into new macro SVN_DETERMINE_SWIG_OPTS.
(SVN_DETERMINE_SWIG_OPTS): New macro. Devided from SVN_FIND_SWIG.
- On non releasemode, warn if Perl/Python/Ruby interpreter is set but
SWIG is not found. Also it prevent build them on make swig-pl/make
swig-py/make swig-rb in such case.
- Check swig version only on non release mode and it is needed
* configure.ac ():
- Tweak help string for --with-swig-perl, --with-swig-python,
--with-swig-ruby.
- Warn if --with-swig-perl is not specified but variable 'PERL' is set.
- Warn if --with-swig-ruby is not specified but variable 'Ruby' is set,
even the value is not 'no' nor 'none'.
* subversion/bindings/swig/INSTALL (Step 2):
Mension that configure and makefiles in release tarball don't
support generation of SWIG bindings C source files.
Index: aclocal.m4 (deleted)
===================================================================
Index: aclocal.m4.in (added)
===================================================================
Index: autogen.sh
===================================================================
--- autogen.sh (revision 1883722)
+++ autogen.sh (working copy)
@@ -213,6 +213,14 @@
# Produce ./configure
echo "Creating configure..."
+cp -f aclocal.m4.in aclocal.m4
+if test -n "$RELEASE_MODE"; then
+ cat <<EOF >>aclocal.m4
+
+# Generated by 'autogen.sh --release'
+AC_DEFUN([SVN_RELEASE_MODE],[1])
+EOF
+fi
${AUTOCONF:-autoconf}
# If we have a config.cache file, toss it if the configure script has
Index: build/ac-macros/swig.m4
===================================================================
--- build/ac-macros/swig.m4 (revision 1883722)
+++ build/ac-macros/swig.m4 (working copy)
@@ -22,17 +22,19 @@
dnl if it is, then check to see if we have the correct version of python.
dnl
dnl if we do, then set up the appropriate SWIG_ variables to build the
-dnl python bindings.
+dnl Python, Perl, and Ruby bindings.
AC_DEFUN(SVN_CHECK_SWIG,
[
- AC_ARG_WITH(swig,
- AS_HELP_STRING([--with-swig=PATH],
- [Try to use 'PATH/bin/swig' to build the
- swig bindings. If PATH is not specified,
- look for a 'swig' binary in your PATH.]),
+ m4_ifndef([SVN_RELEASE_MODE],
[
- case "$withval" in
+ AC_ARG_WITH(swig,
+ AS_HELP_STRING([--with-swig=PATH],
+ [Try to use 'PATH/bin/swig' to build the
+ swig bindings. If PATH is not specified,
+ look for a 'swig' binary in your PATH.]),
+ [
+ case "$withval" in
yes)
svn_find_swig_arg=required
;;
@@ -39,12 +41,20 @@
*)
svn_find_swig_arg=$withval
;;
- esac
- ],
- [
- svn_find_swig_arg=check
+ esac
+ ],
+ [
+ if test "$SWIG_PY_PYTHON" != "none" \
+ || test "$SWIG_PL_PERL" != "none" \
+ || test "$SWIG_RB_RUBY" != "none" ; then
+ svn_find_swig_arg=check
+ else
+ svn_find_swig_arg=no
+ fi
+ ])
+ SVN_FIND_SWIG($svn_find_swig_arg)
])
- SVN_FIND_SWIG($svn_find_swig_arg)
+ SVN_DETERMINE_SWIG_OPTS
])
AC_DEFUN(SVN_FIND_SWIG,
@@ -93,12 +103,26 @@
AC_MSG_WARN([Subversion requires SWIG >= 1.3.24])
fi
fi
+])
+
+AC_DEFUN(SVN_DETERMINE_SWIG_OPTS,
+[
SWIG_PY_COMPILE="none"
SWIG_PY_LINK="none"
SWIG_PY_OPTS="none"
SWIG_PY_ERRMSG="check config.log for details"
- if test "$SWIG_PY_PYTHON" != "none"; then
+ if test "$SWIG_PY_PYTHON" = "none"; then
+ SWIG_PY_ERRMSG="You specfied not to build Python bindings or \
+suitable Python interpreter is not found."
+ else
+ m4_ifndef([SVN_RELEASE_MODE],
+ [
+ if test "$SWIG" = "none"; then
+ AC_MSG_WARN([You specified to build SWIG Python bindings, but SWIG is
not found.])
+ SWIG_PY_ERRMSG="SWIG is need to build SWIG Python bindings, but it is
not found."
+ else
+ ])
AC_MSG_NOTICE([Configuring python swig binding])
AC_CACHE_CHECK([for Python includes], [ac_cv_python_includes],[
@@ -145,9 +169,11 @@
])
SWIG_PY_LIBS="`SVN_REMOVE_STANDARD_LIB_DIRS($ac_cv_python_libs)`"
- if test "$SWIG" = "none"; then
+ m4_ifdef([SVN_RELEASE_MODE],
+ [
SWIG_PY_ERRMSG=""
- else
+ ],
+ [
# Look more closely at the SWIG and Python versions to
# determine SWIG_PY_OPTS. We can skip this if we already
# have the SWIG-generated files.
@@ -181,15 +207,28 @@
AC_MSG_WARN([Subversion Python bindings for Python 2 require
1.3.24 <= SWIG < 4.0.0])
fi
fi
- fi
+ ])
fi
fi
fi
-
+ m4_ifndef([SVN_RELEASE_MODE],
+ [
+ fi
+ ])
fi
SWIG_PL_ERRMSG="check config.log for details"
- if test "$SWIG_PL_PERL" != "none"; then
+ if test "$SWIG_PL_PERL" = "none"; then
+ SWIG_PL_ERRMSG="You specfied not to build Perl bindings or \
+suitable Perl interpreter is not found."
+ else
+ m4_ifndef([SVN_RELEASE_MODE],
+ [
+ if test "$SWIG" = "none"; then
+ AC_MSG_WARN([You specified to build SWIG Perl bindings, but SWIG is
not found.])
+ SWIG_PL_ERRMSG="SWIG is need to build SWIG Perl bindings, but it is
not found."
+ else
+ ])
AC_MSG_CHECKING([perl version])
dnl Note that the q() bit is there to avoid unbalanced brackets
dnl which m4 really doesn't like.
@@ -205,17 +244,31 @@
else
AC_MSG_WARN([perl bindings require perl 5.8.0 or newer.])
fi
+ m4_ifndef([SVN_RELEASE_MODE],
+ [
+ fi
+ ])
fi
SWIG_RB_COMPILE="none"
SWIG_RB_LINK="none"
SWIG_RB_ERRMSG="check config.log for details"
- if test "$SWIG_RB_RUBY" != "none"; then
- if test x"$SWIG_VERSION" = x"3""00""008"; then
- # Use a local variable to escape the '#' sign.
-
ruby_swig_issue_602='https://subversion.apache.org/docs/release-notes/1.11#ruby-swig-issue-602'
- AC_MSG_WARN([Ruby bindings are known not to support swig 3.0.8; see
$ruby_swig_issue_602])
- fi
+ if test "$SWIG_RB_RUBY" = "none"; then
+ SWIG_RB_ERRMSG="You specfied not to build Ruby bindings or \
+suitable Ruby interpreter is not found."
+ else
+ m4_ifndef([SVN_RELEASE_MODE],
+ [
+ if test "$SWIG" = "none"; then
+ AC_MSG_WARN([You specified to build SWIG Ruby bindings, but SWIG is
not found.])
+ SWIG_RB_ERRMSG="SWIG is need to build SWIG Ruby bindings, but it is
not found."
+ else
+ if test x"$SWIG_VERSION" = x"3""00""008"; then
+ # Use a local variable to escape the '#' sign.
+
ruby_swig_issue_602='https://subversion.apache.org/docs/release-notes/1.11#ruby-swig-issue-602'
+ AC_MSG_WARN([Ruby bindings are known not to support swig 3.0.8; see
$ruby_swig_issue_602])
+ fi
+ ])
rbconfig="$SWIG_RB_RUBY -rrbconfig -e "
for var_name in arch archdir CC LDSHARED DLEXT LIBS LIBRUBYARG \
@@ -330,6 +383,10 @@
dnl SWIG Ruby bindings successfully configured, clear the error message
SWIG_RB_ERRMSG=""
+ m4_ifndef([SVN_RELEASE_MODE],
+ [
+ fi
+ ])
fi
AC_SUBST(SWIG)
AC_SUBST(SWIG_PY_INCLUDES)
Index: configure.ac
===================================================================
--- configure.ac (revision 1883722)
+++ configure.ac (working copy)
@@ -1319,15 +1319,29 @@
AC_ARG_WITH(swig_perl,
[AS_HELP_STRING([[--with-swig-perl[=PATH|auto|no]|--without-swig-perl]],
- [specify path to SWIG bindings target Perl interpreter
[default=auto]])],
+ [Specify path to SWIG bindings target Perl interpreter
+ [default=auto]. If the option value is 'auto' or it is not
+ specfied with this option, it searches a 'perl' program.]
+ m4_ifndef([SVN_RELEASE_MODE],
+ [[Implies --with-swig=yes if PATH is specfied or Perl
+ is found on 'auto' detection.]]))
+],
[],
[
-if test "$PERL" = "no" -o "$PERL" = "none"; then
- with_swig_perl=no
- AC_MSG_WARN([Disabling the SWIG Perl bindings' build by setting the PERL])
- AC_MSG_WARN([environment variable to "none" is deprecated.])
- AC_MSG_WARN([])
- AC_MSG_WARN([Please use --without-swig-perl instead.])
+if test -n "$PERL"; then
+ if test "$PERL" = "no" -o "$PERL" = "none"; then
+ with_swig_perl=no
+ AC_MSG_WARN([Disabling the SWIG Perl bindings' build by setting the PERL])
+ AC_MSG_WARN([environment variable to "none" is deprecated.])
+ AC_MSG_WARN([])
+ AC_MSG_WARN([Please use --without-swig-perl instead.])
+ else
+ with_swig_perl=auto
+ AC_MSG_WARN([Specfying the Perl path for SWIG Perl bindings' build])
+ AC_MSG_WARN([by setting the PERL environment variable is deprecated.])
+ AC_MSG_WARN([])
+ AC_MSG_WARN([Please use --with-swig-perl=PATH instead.])
+ fi
else
with_swig_perl=auto
fi
@@ -1334,6 +1348,7 @@
])
case $with_swig_perl in
yes|auto|"")
+ # honor PERL variable only if it is set and is full path.
AC_PATH_PROG(PERL, perl, none)
SWIG_PL_PERL="$PERL"
;;
@@ -1349,14 +1364,17 @@
# Python: as a target of SWIG Python bindings
AC_ARG_WITH(swig_python,
[AS_HELP_STRING([[--with-swig-python[=PATH|auto|no]|--without-swig-python]],
- [specify path to SWIG bindings target Python interpreter
[default=auto]])],
+ [Specify path to SWIG bindings target Python interpreter
+ [default=auto]. If the option value is 'auto' or it is not
+ specfied with this option, it uses the Python executable
+ searched for running the testsuites.]
+ m4_ifndef([SVN_RELEASE_MODE],
+ [[Implies --with-swig=yes if PATH is specfied or Python
+ is found on 'auto' detection.]]))
+],
[],
[
-if test "$PYTHON" = "no" -o "$PYTHON" = "none"; then
- with_swig_python=no
-else
with_swig_python=auto
-fi
])
case $with_swig_python in
yes|auto|"")
@@ -1373,15 +1391,30 @@
AC_ARG_WITH(swig_ruby,
[AS_HELP_STRING([[--with-swig-ruby[=PATH|auto|no]|--without-swig-ruby]],
- [specify path to SWIG bindings target Ruby interpreter
[default=auto]])],
+ [specify path to SWIG bindings target Ruby interpreter
+ [default=auto]. If the option value is 'auto' or it is not
+ specfied with this option, it searches a Ruby language
+ executable.]
+ m4_ifndef([SVN_RELEASE_MODE],
+ [[Implies --with-swig=yes if PATH is specfied or Ruby
+ is found on 'auto' detection.]]))
+],
[],
[
-if test "$RUBY" = "no" -o "$RUBY" = "none"; then
- with_swig_ruby=no
- AC_MSG_WARN([Disabling the SWIG Ruby bindings' build by setting the RUBY])
- AC_MSG_WARN([environment variable to "none" is deprecated.])
- AC_MSG_WARN([])
- AC_MSG_WARN([Please use --without-swig-ruby instead.])
+if test -n "$RUBY"; then
+ if test "$RUBY" = "no" -o "$RUBY" = "none"; then
+ with_swig_ruby=no
+ AC_MSG_WARN([Disabling the SWIG Ruby bindings' build by setting the RUBY])
+ AC_MSG_WARN([environment variable to "none" is deprecated.])
+ AC_MSG_WARN([])
+ AC_MSG_WARN([Please use --without-swig-ruby instead.])
+ else
+ with_swig_ruby="$RUBY"
+ AC_MSG_WARN([Specfying the Ruby path for SWIG Ruby bindings' build])
+ AC_MSG_WARN([by setting the RUBY environment variable is deprecated.])
+ AC_MSG_WARN([])
+ AC_MSG_WARN([Please use --with-swig-ruby=PATH instead.])
+ fi
else
with_swig_ruby=auto
fi
@@ -1388,6 +1421,7 @@
])
case $with_swig_ruby in
yes|auto|"")
+ # honor RUBY variable only if it is set and is full path.
AC_PATH_PROGS(RUBY, ruby ruby1 ruby1.8 ruby18 ruby1.9 ruby19 ruby1.9.3
ruby193 ruby2 ruby2.0 ruby20 ruby2.1 ruby21 ruby2.2 ruby22 ruby2.3 ruby23
ruby2.4 ruby24, none)
SWIG_RB_RUBY="$RUBY"
;;
Index: subversion/bindings/swig/INSTALL
===================================================================
--- subversion/bindings/swig/INSTALL (revision 1883722)
+++ subversion/bindings/swig/INSTALL (working copy)
@@ -141,7 +141,13 @@
See Subversion's own INSTALL file for details.
- Make sure that Subversion's ./configure script sees your installed SWIG!
+ If you are using a Subversion distribution tarball and want to rebuild
+ the SWIG language bindings C source files with your installed SWIG,
+ you need to execute autogen.sh, because the bundled configure script
+ and makefiles don't support it.
+
+ If you don't use SWIG bindings C source files already generated,
+ make sure that Subversion's ./configure script sees your installed SWIG!
It tries to detect SWIG near the very end of its output.
You can find it by running 'grep "^SWIG=" config.log'.
Index: .
===================================================================
--- . (revision 1883722)
+++ . (working copy)
Property changes on: .
___________________________________________________________________
Modified: svn:ignore
## -14,6 +14,7 ##
tags
neon
build-outputs.mk
+aclocal.m4
autogen-standalone.mk
autom4te.cache
gen-make.opts