Hi Pietro,Yes. This is sadly a (known) limitation of autoreconf. Autoconf supports shell variables in AC_CONFIG_AUX_DIR, but autoreconf reads the argument literally, without evaluating the shell code that sets the variable.
That also explains the "$foo" directory with 2.69. It seems the newer version catches the missing files, exposing a problem that was already there...
So I wouldn't call your usage wrong, although it doesn't work with autoreconf. Running autoconf and the other required tools directly should work around it.
I recommend steadily upgrading to the newest version. I will perhaps soon have some free time to look into this. It doesn't look too hard to provide some reasonable way of doing this.
This horrible hack could work:
AC_CONFIG_AUX_DIR([..])
m4_divert_text([INIT_PREPARE], [
top_source_dir_var=...
])
m4_define([_AC_AUX_DIR_CANDIDATES], [$top_source_dir_var])
... but it will almost certainly break at some point (it's using
internal/unstable variable names). In hindsight, please do not do this.
-- With Valediction, Kamila Szewczyk (https://iczelia.net) On 11/3/26 10:03 PM, Pietro Monteiro wrote:
Hello, GCC, binutils and GDB use an specific version of autoconf, currently 2.69, and include the generated files in their repositories and releases. I'm looking into upgrading the the version of autoconf and ran into a problem with autoreconf and using a variable in AC_CONFIG_AUX_DIR. To support multilibs and sharing libiberty between gcc and binutils-gdb source trees we use a bit of shell to determine the top source directory and then use AC_CONFIG_AUX_DIR($top_source_dir_var). Running autoreconf 2.69 on the libiberty directory creates a directory with the same name of the variable used in AC_CONFIG_AUX_DIR. Ex: AC_CONFIG_AUX_DIR($foo) creates a directory "$foo", dolar sign included, in the libiberty source directory. But it runs to completion re-creating all necessary files and exiting with status 0. Autoreconf 2.73 errors out saying it can't find config.guess, config.sub, and install-sh. Is this a bug on autoreconf? Or in our usage of AC_CONFIG_AUX_DIR? Looking into AC_CONFIG_AUX_DIR code it seems that using variables with it is ok from autoconf's point of view. Autoconf 2.73 runs fine on libiberty. Thanks, Pietro
OpenPGP_0xC868F0B6DE38409D.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature
