Re: [toplevel] Gas install name problem from autoconf 2.5x

Daniel Jacobowitz
2003-09-07T17:33:05Z

On Sat, Sep 06, 2003 at 09:08:45PM -0700, Ian Lance Taylor wrote:
> Daniel Jacobowitz <drow@mvista.com> writes:
>
> > I would like to explicitly pass --program-transform-name from the
> > toplevel to subdirectories, when configure implicitly generates it.
> > How does that sound?
>
> While that would fix one problem, I suspect there will be other
> problems.
>
> The new autoconf simply behaves differently with respect to command
> line options. I suspect that trying to finesse this behaviour will
> lead to trouble. Better to adjust the command line options depending
> on the version of autoconf used in the subdirectory, or convert all
> the configure scripts at once.

Converting all the configure scripts at once isn't going to happen.

And adjusting the command lines isn't going to solve the problem,
either. Consider that a lot of people are used to explicitly
specifying --host/--build/--target. They'll now get gas installed as
<target>-gas and gcc installed as gcc. Plus, you can't even use the
new-style arguments to configure, because the top level hasn't been
converted; you must still give it the old-style arguments or it'll draw
the wrong conclusions.

Oh, and I just noticed: ./configure i686-linux will now produce
i686-linux-gas and gcc too. Nothing we can do about that unless we
want to manufacture appropriate arguments from whole cloth for each
configure type.

The only other difference besides this one and the cross-compilation
mode one that I've been able to find is:
2.13:
if test $host != $build; then
ac_tool_prefix=${host_alias}-
else
ac_tool_prefix=
fi

2.57:
test -n "$host_alias" && ac_tool_prefix=$host_alias-

But in both cases it will fall back to unprefixed versions if those
aren't found, so I don't expect this to be a big problem. And I do
expect all configure scripts to be converted, at some point, before any
new major releases from these repositories.

Anyway, actions, words, all that. Here is a patch to compute
program-transform-name in the top level and pass it down. This patch
preserves the 2.13 behavior, because at the moment that's easier; then,
in a few more months when the bulk of the affected directories have
been converted, we can either remove it or update it to the 2.5x
behavior. Just rebuilding the toplevel configure script with 2.5x will
change the behavior for all subdirectories consistently, converted or
not. Thoughts?

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer

2003-09-07 Daniel Jacobowitz <drow@mvista.com>

* configure.in: Pass a computed --program-transform-name
to subconfigures.

Index: configure.in
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/configure.in,v
retrieving revision 1.184
diff -u -p -r1.184 configure.in
--- configure.in 4 Sep 2003 12:33:44 -0000 1.184
+++ configure.in 7 Sep 2003 17:28:14 -0000
@@ -1766,7 +1766,9 @@ AC_SUBST_FILE(serialization_dependencies

# Base args. Strip norecursion, cache-file, srcdir, host, build,
# target and nonopt. These are the ones we might not want to pass
-# down to subconfigures.
+# down to subconfigures. Also strip program-prefix, program-suffix,
+# and program-transform-name, so that we can pass down a consistent
+# program-transform-name.
cat <<\EOF_SED > conftestsed
s/ --no[[^ ]]* / /
s/ --c[[a-z-]]*[[= ]][[^ ]]* / /
@@ -1774,16 +1776,34 @@ s/ --sr[[a-z-]]*[[= ]][[^ ]]* / /
s/ --ho[[a-z-]]*[[= ]][[^ ]]* / /
s/ --bu[[a-z-]]*[[= ]][[^ ]]* / /
s/ --t[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* / /
s/ -cache-file[[= ]][[^ ]]* / /
s/ -srcdir[[= ]][[^ ]]* / /
s/ -host[[= ]][[^ ]]* / /
s/ -build[[= ]][[^ ]]* / /
s/ -target[[= ]][[^ ]]* / /
+s/ -program-prefix[[= ]][[^ ]]* / /
+s/ -program-suffix[[= ]][[^ ]]* / /
+s/ -program-transform-name[[= ]][[^ ]]* / /
s/ [[^' -][^ ]*] / /
s/^ *//;s/ *$//
s,\\,\\\\,g; s,\$,$$,g
EOF_SED
baseargs=`echo " ${ac_configure_args} " | sed -f conftestsed`
+rm -f conftestsed
+
+# Add in --program-transform-name, after --program-prefix and
+# --program-suffix have been applied to it.
+cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+gcc_transform_name="${program_transform_name}"
+# Autoconf expects s,x,x, as the default. If we want subdirectory configure
+# scripts to obey this transformation, we need to modify it slightly.
+if test "${gcc_transform_name}" = s,x,x,; then
+ gcc_transform_name=s,y,y,
+fi
+baseargs="$baseargs --program-transform-name=`echo ${gcc_transform_name} | sed -f conftestsed`"
rm -f conftestsed

# For the build-side libraries, we just need to pretend we're native,