You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Yasuhito FUTATSUKI <fu...@yf.bsdclub.org> on 2020/11/20 00:45:40 UTC

How do we detect release mode in autoconf or in configure script?

Hi,

As I wrote in another thread, Subversion's configure script in release
mode still has an issue that it detects SWIG executable which is never
used in release mode.

To resolve this issue, it is need to detect release mode in autoconf
macro or in generated configure script. However I can't find the ways
already used in autoconf input files.

What is the recommended way to do it?

Or if there is no recommended way, may I add a code fragment like
the following to configure.ac?

[[[
# detect release mode
if $GREP -q '^RELEASE_MODE[[:blank:]]*=[[:blank:]]*1' $abs_src_dir/build-outputs.mk; then
  release_mode = yes
else
  release_mode = no
fi
]]]


Thanks,
-- 
Yasuhito FUTATSUKI <fu...@yf.bsclub.org>

Re: How do we detect release mode in autoconf or in configure script?

Posted by Yasuhito FUTATSUKI <fu...@yf.bsdclub.org>.
On 2020/11/20 18:58, Branko Čibej wrote:
> On 20.11.2020 10:05, Yasuhito FUTATSUKI wrote:
>> On 2020/11/20 10:44, Yasuhito FUTATSUKI wrote:
>>> On 2020/11/20 10:22, Branko Čibej wrote:
>>>> On 20.11.2020 01:45, Yasuhito FUTATSUKI wrote:
>>  
>>> Then if users want to rebuild bindings C source, they can do by using
>>> --with-swig option in configure and doing
>>> "make extraclean-swig-xx && make swig-xx".
>> This is incorrect, because the build-outputs.mk generated by autogen.sh
>> with --release option doesn't have rules to generate bindings C source
>> files. So users need to execute autogen.sh without --release option in
>> such case.
> 
> 
> Right, and anyone who wants to generate the bindings sources with Swig should be doing that in any case, so that's not a regression.
> 
> So it looks like your idea to detect "release mode" in configure is the correct approach after all. But I don't like the idea of parsing build-outputs.mk. How about something like this:

Thank you for the suggestion again. Actually I also don't like the
code fragment I wrote, and wanted to detect it on executing autoconf.

I'll try the way you suggest.

Cheers,
-- 
Yasuhito FUTATSUKI <fu...@yf.bsclub.org>

Re: How do we detect release mode in autoconf or in configure script?

Posted by Branko Čibej <br...@apache.org>.
On 20.11.2020 10:05, Yasuhito FUTATSUKI wrote:
> On 2020/11/20 10:44, Yasuhito FUTATSUKI wrote:
>> On 2020/11/20 10:22, Branko Čibej wrote:
>>> On 20.11.2020 01:45, Yasuhito FUTATSUKI wrote:
>   
>> Then if users want to rebuild bindings C source, they can do by using
>> --with-swig option in configure and doing
>> "make extraclean-swig-xx && make swig-xx".
> This is incorrect, because the build-outputs.mk generated by autogen.sh
> with --release option doesn't have rules to generate bindings C source
> files. So users need to execute autogen.sh without --release option in
> such case.


Right, and anyone who wants to generate the bindings sources with Swig 
should be doing that in any case, so that's not a regression.

So it looks like your idea to detect "release mode" in configure is the 
correct approach after all. But I don't like the idea of parsing 
build-outputs.mk. How about something like this:

$ svn mv aclocal.m4 aclocal.m4.in


then

$ svn diff --no-diff-deleted --no-diff-added
Index: aclocal.m4 (deleted)
===================================================================
Index: aclocal.m4.in (added)
===================================================================
Index: autogen.sh
===================================================================
--- autogen.sh    (revision 1883466)
+++ autogen.sh    (working copy)
@@ -213,6 +213,14 @@ fi
  
  # 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'
+svn_release-mode=1
+EOF
+fi
  ${AUTOCONF:-autoconf}
  
  # If we have a config.cache file, toss it if the configure script has
Index: .
===================================================================
--- .   (revision 1883466)
+++ .   (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



-- Brane

Re: How do we detect release mode in autoconf or in configure script?

Posted by Yasuhito FUTATSUKI <fu...@yf.bsdclub.org>.
On 2020/11/20 10:44, Yasuhito FUTATSUKI wrote:
> On 2020/11/20 10:22, Branko Čibej wrote:
>> On 20.11.2020 01:45, Yasuhito FUTATSUKI wrote:
 
> Then if users want to rebuild bindings C source, they can do by using
> --with-swig option in configure and doing
> "make extraclean-swig-xx && make swig-xx".

This is incorrect, because the build-outputs.mk generated by autogen.sh
with --release option doesn't have rules to generate bindings C source
files. So users need to execute autogen.sh without --release option in
such case.

Cheers,
-- 
Yasuhito FUTATSUKI <fu...@yf.bsclub.org>

Re: How do we detect release mode in autoconf or in configure script?

Posted by Yasuhito FUTATSUKI <fu...@yf.bsdclub.org>.
On 2020/11/20 10:22, Branko Čibej wrote:
> On 20.11.2020 01:45, Yasuhito FUTATSUKI wrote:
>> Hi,
>>
>> As I wrote in another thread, Subversion's configure script in release
>> mode still has an issue that it detects SWIG executable which is never
>> used in release mode.
> 
> Does this cause any problems for the build? As far as I know, it doesn't.

The configure script in release tarballs accept --with-swig | --without-swig
options, but actually SWIG is used only in configure script itself and
it can prevent building language bindings with prebuilt bindings C sources.
 
>> To resolve this issue, it is need to detect release mode in autoconf
>> macro or in generated configure script. However I can't find the ways
>> already used in autoconf input files.
>>
>> What is the recommended way to do it?
> 
> There is no such thing as "release mode". We should probably make --without-swig the default, and make --with-swig (without parameters) do whatever we do by default today. Developers can fix their build scripts if necessary.

Thank you for the suggestion. I'll do.

Then if users want to rebuild bindings C source, they can do by using
--with-swig option in configure and doing
"make extraclean-swig-xx && make swig-xx".

Thanks,
-- 
Yasuhito FUTATSUKI <fu...@yf.bsclub.org>

Re: How do we detect release mode in autoconf or in configure script?

Posted by Branko Čibej <br...@apache.org>.
On 20.11.2020 01:45, Yasuhito FUTATSUKI wrote:
> Hi,
>
> As I wrote in another thread, Subversion's configure script in release
> mode still has an issue that it detects SWIG executable which is never
> used in release mode.

Does this cause any problems for the build? As far as I know, it doesn't.


> To resolve this issue, it is need to detect release mode in autoconf
> macro or in generated configure script. However I can't find the ways
> already used in autoconf input files.
>
> What is the recommended way to do it?

There is no such thing as "release mode". We should probably make 
--without-swig the default, and make --with-swig (without parameters) do 
whatever we do by default today. Developers can fix their build scripts 
if necessary.

-- Brane