This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] aclocal.m4: Work around a bug in AC_PATH_PROGS.
- From: Kazu Hirata <kazu at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: paul at codesourcery dot com
- Cc: dj at redhat dot com
- Cc: neroden at gcc dot gnu dot org
- Cc: aoliva at redhat dot com
- Date: Tue, 5 Jul 2005 21:35:51 -0700
- Subject: [patch] aclocal.m4: Work around a bug in AC_PATH_PROGS.
Hi,
Attached is a patch to work around a bug in AC_PATH_PROGS.
Suppose the last argument to AC_PATH_PROGS is empty, which could
happen during a canadian cross build. According to Paul Brook, part
of AC_PATH_PROGS($1,$2,, $gcc_cv_tool_dirs) expands to:
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $gcc_cv_tool_dirs
do
IFS=$as_save_IFS
If $gcc_cv_tool_dirs == "" the body of the for will never execute, so
IFS will never be restored.
Tested on x86_64-pc-linux-gnu and cross to arm-none-eabi. OK to
apply?
Kazu Hirata
2005-07-06 Paul Brook <paul@codesourcery.com>
* aclocal.m4: Work around a bug in AC_PATH_PROGS when its last
argument is empty.
Index: aclocal.m4
===================================================================
RCS file: /cvs/gcc/gcc/gcc/aclocal.m4,v
retrieving revision 1.108
diff -u -d -p -r1.108 aclocal.m4
--- aclocal.m4 25 Jun 2005 01:59:09 -0000 1.108
+++ aclocal.m4 5 Jul 2005 16:29:09 -0000
@@ -711,7 +711,13 @@ dnl shut up useless "checking for..." me
dnl we can still read them in config.log
exec AS_MESSAGE_FD([])>/dev/null
if test "x[$]$1" = x; then
- AC_PATH_PROGS($1, $2, , $gcc_cv_tool_dirs)
+ # The AC_PATH_PROGS macro doesn't work properly when its 4th argument
+ # is empty.
+ if test "x$gcc_cv_tool_dirs" = x; then
+ $1=
+ else
+ AC_PATH_PROGS($1, $2, , $gcc_cv_tool_dirs)
+ fi
fi
if test "x[$]$1" = x; then
# If the loop above did not find a tool, then use whatever