This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: (toplevel) Don't look for unprefixed tools unless they're appropriate
On Dec 28, 2002, Doug Evans <dje@transmeta.com> wrote:
> Alexandre Oliva writes:
>> On Dec 28, 2002, Nathanael Nerode <neroden@twcny.rr.com> wrote:
>>
>> > Tested on i686-pc-linux-gnu with a Canadian cross. Now if the
>> > prefixed tools can't be found (and the unprefixed tools are incorrect),
>> > the tool values default to blank, which will cause entirely different
>> > errors. (Heh.)
>>
>> Hmm... I don't quite like a blank default. I'd much rather default
>> to <host/target>-<tool>, since this at least gives the user the
>> opportunity to adjust PATH after configure, and gives more of an idea
>> of what's going on.
> Agreed!
Ok, this is what I'm checking in, after verifying that it does the
right thing on native, cross, host-x-host and host-x-build set ups,
namely, if host/target == build, default to the program name without
prefix, otherwise prefix it with the host/target tool prefix.
I predict we're going to have a *lot* of trouble when we switch to
autoconf 2.5x in the top level. The way build/host/target_alias is
defined has changed, and we're going to have to duplicate the logic
autoconf uses for defaulting system names to pass the right arguments
down. Eeek :-( I knew that right when the changes were introduced in
autoconf, but I couldn't stop them, and then I had forgotten.
Index: ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* configure.in (host_configargs): Replace reference to
no-longer-defined buildopts with --build=${build_alias}.
* configure: Rebuilt.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.201
diff -u -p -r1.201 configure.in
--- configure.in 28 Dec 2002 09:12:19 -0000 1.201
+++ configure.in 28 Dec 2002 17:28:42 -0000
@@ -1752,7 +1752,7 @@ case "${cache_file}" in
cache_file_option="--cache-file=../${cache_file}" ;;
esac
-host_configargs="${cache_file_option} ${buildopt} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}"
+host_configargs="${cache_file_option} --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}"
target_configargs=${baseargs}
Index: config/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* acx.m4: Name cache variables properly.
(NCN_STRICT_CHECK_TOOL): If program is not found and
value-if-not-found is empty, use ${ncn_tool_prefix}$2 or $2,
depending on whether build != host or not.
(NCN_STRICT_CHECK_TARGET_TOOL): Ditto, with the target prefix.
Index: config/acx.m4
===================================================================
RCS file: /cvs/gcc/gcc/config/acx.m4,v
retrieving revision 1.1
diff -u -p -r1.1 acx.m4
--- config/acx.m4 28 Dec 2002 06:57:49 -0000 1.1
+++ config/acx.m4 28 Dec 2002 17:28:42 -0000
@@ -24,9 +24,9 @@ if test -n "$ncn_target_tool_prefix"; th
[${ncn_target_tool_prefix}$2], , [$4])
fi
if test -z "$ac_cv_prog_$1" ; then
- ncn_ct_$1=$$1
- AC_CHECK_PROG([ncn_ct_$1], [$2], [$2], [$3], [$4])
- $1=$ncn_ct_$1
+ ncn_cv_$1=$$1
+ AC_CHECK_PROG([ncn_cv_$1], [$2], [$2], [$3], [$4])
+ $1=$ncn_cv_$1
else
$1="$ac_cv_prog_$1"
fi
@@ -45,11 +45,11 @@ if test -n "$ncn_tool_prefix"; then
fi
if test -z "$ac_cv_prog_$1" ; then
if test $build = $host ; then
- ncn_ct_$1=$$1
- AC_CHECK_PROG([ncn_ct_$1], [$2], [$2], [$3], [$4])
- $1=$ncn_ct_$1
+ ncn_cv_$1=$$1
+ AC_CHECK_PROG([ncn_cv_$1], [$2], [$2], [ifelse([$3],[],[$2],[$3])], [$4])
+ $1=$ncn_cv_$1
else
- $1="$3"
+ $1="ifelse([$3],[],[${ncn_tool_prefix}$2],[$3])"
fi
else
$1="$ac_cv_prog_$1"
@@ -69,15 +69,13 @@ if test -n "$ncn_target_tool_prefix"; th
fi
if test -z "$ac_cv_prog_$1" ; then
if test $build = $target ; then
- ncn_ct_$1=$$1
- AC_CHECK_PROG([ncn_ct_$1], [$2], [$2], [$3], [$4])
- $1=$ncn_ct_$1
+ ncn_cv_$1=$$1
+ AC_CHECK_PROG([ncn_cv_$1], [$2], [$2], [ifelse([$3],[],[$2],[$3])], [$4])
+ $1=$ncn_cv_$1
else
- $1="$3"
+ $1="ifelse([$3],[],[${ncn_target_tool_prefix}$2],[$3])"
fi
else
$1="$ac_cv_prog_$1"
fi
]) []dnl # NCN_STRICT_CHECK_TARGET_TOOL
-
-
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer