[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Help] Re: Bug#998479: aevol: FTBFS: configure.ac:301: error: AM_INIT_AUTOMAKE expanded multiple times



Control: tags -1 + patch pending

Hi Andreas,

Andreas Tille, on 2021-11-05:
> I tried to fix the issue via a patch[1] that should ensure
> AM_INIT_AUTOMAKE is called only once.  Unfortunately that patch
> resulted in:
> 
>    dh_autoreconf
> configure.ac:303: error: AM_INIT_AUTOMAKE expanded multiple times
> /usr/share/aclocal-1.16/init.m4:29: AM_INIT_AUTOMAKE is expanded from...
> configure.ac:301: the top level
> /usr/share/aclocal-1.16/init.m4:29: AM_INIT_AUTOMAKE is expanded from...
> configure.ac:303: the top level
> autom4te: error: /usr/bin/m4 failed with exit status: 1
> aclocal: error: /usr/bin/autom4te failed with exit status: 1
> autoreconf: error: aclocal failed with exit status: 1
> dh_autoreconf: error: autoreconf -f -i returned exit code 1
> 
> 
> Any idea why autoreconf is working inside if and else branch and how to
> fix this issue properly?

After some digging, it turns out that the expansion of the
AM_INIT_AUTOMAKE macro is done before the if… else…
conditionals.  This is because the if… else… is part of the yet
to be produced ./configure shell script.  Since there are still
two occurrences of the macro in the file, the recent version of
autoreconf catches both, thus still returns in error.

The existing script tried to apply conditionally the
subdir-objects option to automake.  From what I could witness in
my try, applying this option, which allows building object files
within subdirectories, does not hurt.  I took the liberty to
wrap up a patch in that direction, so you don't have to worry
about it:

------------------------------8<--------------------------------
--- aevol.orig/configure.ac
+++ aevol/configure.ac
@@ -20,7 +20,7 @@
 AC_CONFIG_MACRO_DIR([m4])
 
 # We want to use automake
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([subdir-objects])
 
 # Select compiler
 AC_PROG_CXX([clang-omp++ clang++ g++ icc])
@@ -298,7 +298,6 @@
 AM_CONDITIONAL(WITH_RAEVOL, test x"$raevol" != xno)
 if test "x$raevol" = "xyes" ; then
    AC_DEFINE(__REGUL)
-   AM_INIT_AUTOMAKE([subdir-objects])
 fi
 
 #  ************************* --with-blas option *******************************
------------------------------8<--------------------------------

I will push this to salsa soon.

In hope this helps,
Have a nice day,  :)
-- 
Étienne Mollier <emollier@emlwks999.eu>
Fingerprint:  8f91 b227 c7d6 f2b1 948c  8236 793c f67e 8f0d 11da
Sent from /dev/pts/2, please excuse my verbosity.

Attachment: signature.asc
Description: PGP signature


Reply to: