public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* config-ml.in questions.
@ 2007-11-23  1:13 Ralf Wildenhues
  2007-11-26 22:27 ` Ralf Wildenhues
  2007-11-26 23:03 ` Ralf Wildenhues
  0 siblings, 2 replies; 3+ messages in thread
From: Ralf Wildenhues @ 2007-11-23  1:13 UTC (permalink / raw)
  To: gcc-patches, automake-patches

Hello,

I have several questions regarding config-ml.in.

First, the recent change to support a ${Makefile} with a different name
seems to have a bug.  Well, I can't see how the value of ${Makefile} is
transported to the makefile fragment.  I think the small patch below
should fix that.

It also removes one instance of ${Makefile} which had been present (as
`Makefile') in the `for dir in ...' line, since the initial SVN revision
of config-ml.in in the GCC tree but seems to not make sense at all.

I'd need somebody to approve this patch and apply it to both GCC and
src; also for the other patch below.

2007-11-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* config-ml.in (multi-clean): Substitute ${Makefile}.
	Remove superfluous ${Makefile} in list.

--- config-ml.in	2007-11-22 21:56:24.000000000 +0100
+++ config-ml.in	2007-11-22 22:13:43.000000000 +0100
@@ -586,8 +586,12 @@
 	  true; \
 	else \
 	  lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
-	  for dir in ${Makefile} $(MULTIDIRS); do \
-	    if [ -f ../$${dir}/$${lib}/${Makefile} ]; then \
+	  for dir in $(MULTIDIRS); do \
+EOF
+cat >>Multi.tem <<EOF
+	    if [ -f ../\$\${dir}/\$\${lib}/${Makefile} ]; then \\
+EOF
+cat >>Multi.tem <<\EOF
 	      if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \
 	      then true; \
 	      else exit 1; \



Second, the passing of ${ml_config_env} introduced in 2007-04-14
<http://gcc.gnu.org/viewcvs/trunk/config-ml.in?r1=114622&r2=123825>
seems to break the multlib.test in the Automake testsuite:
<http://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob;f=tests/multlib.test;hb=HEAD>
because a configure argument of
  CC=.../build/../mycc

is changed to
  CC=.../build/debug/../mycc

later.  I must confess I don't exactly see where that happens.  In case
the mangling is on purpose, I suppose the test is wrong.  Would this be
an appropriate fix for the test?

--- tests/multlib.test
+++ tests/multlib.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2007  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -49,6 +49,7 @@ gcc ${1+"$@"}
 END
 
 chmod +x mycc
+PATH=`pwd`:$PATH
 
 cat >Makefile.am <<'EOF'
 SUBDIRS = @subdirs@
@@ -130,7 +131,7 @@ cd ..
 # Check VPATH builds
 mkdir build
 cd build
-../configure --enable-multilib CC=`pwd`/../mycc
+../configure --enable-multilib CC=mycc
 $MAKE
 $MAKE install
 $MAKE distcleancheck
@@ -138,5 +139,5 @@ $MAKE distcleancheck
 # Check standard builds.
 cd ..
 # Why to I have to specify --with-target-subdir?
-./configure --enable-multilib --with-target-subdir=. CC=`pwd`/mycc
+./configure --enable-multilib --with-target-subdir=. CC=mycc
 $MAKE



Third, I would like to remove some limitations in Automake wrt. white
space in absolute file names (`pwd`).  Would you consider the following
patch against config-ml.in?

Should I post these three issues independently?

Thanks,
Ralf

2007-11-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* config-ml.in: Robustify against white space in absolute file
	names.

--- config-ml.in	2007-11-22 21:56:24.000000000 +0100
+++ config-ml.in	2007-11-22 22:35:37.000000000 +0100
@@ -540,7 +540,7 @@
 	else \
 	  rootpre=`${PWD_COMMAND}`/; export rootpre; \
 	  srcrootpre=`cd $(srcdir); ${PWD_COMMAND}`/; export srcrootpre; \
-	  lib=`echo $${rootpre} | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \
+	  lib=`echo "$${rootpre}" | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \
 	  compiler="$(CC)"; \
 	  for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \
 	    dir=`echo $$i | sed -e 's/;.*$$//'`; \
@@ -696,7 +696,7 @@
   fi
 
   ml_origdir=`${PWDCMD-pwd}`
-  ml_libdir=`echo $ml_origdir | sed -e 's,^.*/,,'`
+  ml_libdir=`echo "$ml_origdir" | sed -e 's,^.*/,,'`
   # cd to top-level-build-dir/${with_target_subdir}
   cd ..
 
@@ -732,7 +732,7 @@
 
     case ${srcdir} in
     ".")
-      echo Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir}
+      echo "Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir}"
       if [ "${with_target_subdir}" != "." ]; then
 	ml_unsubdir="../"
       else
@@ -797,7 +797,7 @@
     else
 	# Create a regular expression that matches any string as long
 	# as ML_POPDIR.
-	popdir_rx=`echo ${ML_POPDIR} | sed 's,.,.,g'`
+	popdir_rx=`echo "${ML_POPDIR}" | sed 's,.,.,g'`
 	CC_=
 	for arg in ${CC}; do
 	  case $arg in
@@ -901,11 +901,11 @@
       exit 1
     fi
 
-    cd ${ML_POPDIR}
+    cd "${ML_POPDIR}"
 
   done
 
-  cd ${ml_origdir}
+  cd "${ml_origdir}"
 fi
 
 fi # ${ml_toplevel_p} = yes

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: config-ml.in questions.
  2007-11-23  1:13 config-ml.in questions Ralf Wildenhues
@ 2007-11-26 22:27 ` Ralf Wildenhues
  2007-11-26 23:03 ` Ralf Wildenhues
  1 sibling, 0 replies; 3+ messages in thread
From: Ralf Wildenhues @ 2007-11-26 22:27 UTC (permalink / raw)
  To: gcc-patches, Paolo Bonzini

:ADDPATCH configure:

Hello,

please consider this patch, and if good, apply to GCC and src.
FWIW, I have only tested it as part of Automake's multlib.test
(where it fixes the failure, if the other patch I posted for
the test is applied to Automake as well).

And yes, there were changes in all the copyright years added.

Thanks,
Ralf

2007-11-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* config-ml.in (multi-clean): Substitute ${Makefile}.
	Remove superfluous ${Makefile} in list.

Index: config-ml.in
===================================================================
--- config-ml.in	(revision 130431)
+++ config-ml.in	(working copy)
@@ -1,8 +1,8 @@
 # Configure fragment invoked in the post-target section for subdirs
 # wanting multilib support.
 #
-# Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-#   Free Software Foundation, Inc.
+# Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007  Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -586,8 +586,13 @@
 	  true; \
 	else \
 	  lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
-	  for dir in ${Makefile} $(MULTIDIRS); do \
-	    if [ -f ../$${dir}/$${lib}/${Makefile} ]; then \
+	  for dir in : $(MULTIDIRS); do \
+	    test $$dir != : || continue; \
+EOF
+cat >>Multi.tem <<EOF
+	    if [ -f ../\$\${dir}/\$\${lib}/${Makefile} ]; then \\
+EOF
+cat >>Multi.tem <<\EOF
 	      if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \
 	      then true; \
 	      else exit 1; \

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: config-ml.in questions.
  2007-11-23  1:13 config-ml.in questions Ralf Wildenhues
  2007-11-26 22:27 ` Ralf Wildenhues
@ 2007-11-26 23:03 ` Ralf Wildenhues
  1 sibling, 0 replies; 3+ messages in thread
From: Ralf Wildenhues @ 2007-11-26 23:03 UTC (permalink / raw)
  To: gcc-patches, Paolo Bonzini; +Cc: automake-patches

:ADDPATCH configure:

Hello,

Please approve and apply this patch to GCC and src.  Again, I tested it
in Automake, not with GCC, sorry.

Thanks,
Ralf

2007-11-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* config-ml.in: Robustify against white space in absolute file
	names.

Index: config-ml.in
===================================================================
--- config-ml.in	(revision 130431)
+++ config-ml.in	(working copy)
@@ -540,7 +540,7 @@
 	else \
 	  rootpre=`${PWD_COMMAND}`/; export rootpre; \
 	  srcrootpre=`cd $(srcdir); ${PWD_COMMAND}`/; export srcrootpre; \
-	  lib=`echo $${rootpre} | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \
+	  lib=`echo "$${rootpre}" | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \
 	  compiler="$(CC)"; \
 	  for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \
 	    dir=`echo $$i | sed -e 's/;.*$$//'`; \
@@ -696,7 +701,7 @@
   fi
 
   ml_origdir=`${PWDCMD-pwd}`
-  ml_libdir=`echo $ml_origdir | sed -e 's,^.*/,,'`
+  ml_libdir=`echo "$ml_origdir" | sed -e 's,^.*/,,'`
   # cd to top-level-build-dir/${with_target_subdir}
   cd ..
 
@@ -732,7 +737,7 @@
 
     case ${srcdir} in
     ".")
-      echo Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir}
+      echo "Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir}"
       if [ "${with_target_subdir}" != "." ]; then
 	ml_unsubdir="../"
       else
@@ -797,7 +802,7 @@
     else
 	# Create a regular expression that matches any string as long
 	# as ML_POPDIR.
-	popdir_rx=`echo ${ML_POPDIR} | sed 's,.,.,g'`
+	popdir_rx=`echo "${ML_POPDIR}" | sed 's,.,.,g'`
 	CC_=
 	for arg in ${CC}; do
 	  case $arg in
@@ -901,11 +906,11 @@
       exit 1
     fi
 
-    cd ${ML_POPDIR}
+    cd "${ML_POPDIR}"
 
   done
 
-  cd ${ml_origdir}
+  cd "${ml_origdir}"
 fi
 
 fi # ${ml_toplevel_p} = yes

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-26 19:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-23  1:13 config-ml.in questions Ralf Wildenhues
2007-11-26 22:27 ` Ralf Wildenhues
2007-11-26 23:03 ` Ralf Wildenhues

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).