public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Don't hardcode the makefile name in config-ml.in
@ 2007-11-19 10:24 Thiemo Seufer
  2007-11-19 10:49 ` Paolo Bonzini
  2007-11-26  6:44 ` Hans-Peter Nilsson
  0 siblings, 2 replies; 8+ messages in thread
From: Thiemo Seufer @ 2007-11-19 10:24 UTC (permalink / raw)
  To: gcc-patches

Hello All,

the appended patch un-hardcodes the makefile name in config-ml.in.
(Overriding the name on invocation is supposed to be possible,
currently this changes only some of the uses in config-ml.in.)


Thiemo


2007-11-19  Thiemo Seufer  <ths@mips.com>

	* config-ml.in: Don't hardcode the Makefile name.

Index: config-ml.in
===================================================================
--- config-ml.in.orig	2007-11-18 01:30:21.000000000 +0000
+++ config-ml.in	2007-11-18 01:31:57.000000000 +0000
@@ -586,8 +586,8 @@
 	  true; \
 	else \
 	  lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
-	  for dir in Makefile $(MULTIDIRS); do \
-	    if [ -f ../$${dir}/$${lib}/Makefile ]; then \
+	  for dir in ${Makefile} $(MULTIDIRS); do \
+	    if [ -f ../$${dir}/$${lib}/${Makefile} ]; then \
 	      if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \
 	      then true; \
 	      else exit 1; \
@@ -605,7 +605,7 @@
 fi # ${ml_toplevel_p} = yes
 
 if [ "${ml_verbose}" = --verbose ]; then
-  echo "Adding multilib support to Makefile in ${ml_realsrcdir}"
+  echo "Adding multilib support to ${Makefile} in ${ml_realsrcdir}"
   if [ "${ml_toplevel_p}" = yes ]; then
     echo "multidirs=${multidirs}"
   fi
@@ -740,7 +740,7 @@
       fi
       (cd ${ml_dir}/${ml_libdir};
        ../${dotdot}${ml_unsubdir}symlink-tree ../${dotdot}${ml_unsubdir}${ml_libdir} "")
-      if [ -f ${ml_dir}/${ml_libdir}/Makefile ]; then
+      if [ -f ${ml_dir}/${ml_libdir}/${Makefile} ]; then
 	if [ x"${MAKE}" = x ]; then
 	  (cd ${ml_dir}/${ml_libdir}; make distclean)
 	else

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

* Re: [PATCH] Don't hardcode the makefile name in config-ml.in
  2007-11-19 10:24 [PATCH] Don't hardcode the makefile name in config-ml.in Thiemo Seufer
@ 2007-11-19 10:49 ` Paolo Bonzini
  2007-11-26  6:44 ` Hans-Peter Nilsson
  1 sibling, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2007-11-19 10:49 UTC (permalink / raw)
  To: gcc-patches

Thiemo Seufer wrote:
> Hello All,
> 
> the appended patch un-hardcodes the makefile name in config-ml.in.
> (Overriding the name on invocation is supposed to be possible,
> currently this changes only some of the uses in config-ml.in.)

Ok.

Paolo

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

* Re: [PATCH] Don't hardcode the makefile name in config-ml.in
  2007-11-19 10:24 [PATCH] Don't hardcode the makefile name in config-ml.in Thiemo Seufer
  2007-11-19 10:49 ` Paolo Bonzini
@ 2007-11-26  6:44 ` Hans-Peter Nilsson
  2007-11-26 10:48   ` Ralf Wildenhues
  1 sibling, 1 reply; 8+ messages in thread
From: Hans-Peter Nilsson @ 2007-11-26  6:44 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: gcc-patches

On Mon, 19 Nov 2007, Thiemo Seufer wrote:
> 2007-11-19  Thiemo Seufer  <ths@mips.com>
> 
> 	* config-ml.in: Don't hardcode the Makefile name.

This match broke stuff like "make target-clean".  Just
the base libraries are cleaned, not the multlibs.  Apparently 
the Makefile=Makefile setting is lost somehow somewhere.
Happens to all libs, for example newlib, libstdc++-v3, libgcc.

brgds, H-P

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

* Re: [PATCH] Don't hardcode the makefile name in config-ml.in
  2007-11-26  6:44 ` Hans-Peter Nilsson
@ 2007-11-26 10:48   ` Ralf Wildenhues
  2007-11-26 14:17     ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: Ralf Wildenhues @ 2007-11-26 10:48 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: Thiemo Seufer, gcc-patches

Hello,

* Hans-Peter Nilsson wrote on Mon, Nov 26, 2007 at 01:47:36AM CET:
> On Mon, 19 Nov 2007, Thiemo Seufer wrote:
> > 2007-11-19  Thiemo Seufer  <ths@mips.com>
> > 
> > 	* config-ml.in: Don't hardcode the Makefile name.
> 
> This match broke stuff like "make target-clean".  Just
> the base libraries are cleaned, not the multlibs.  Apparently 
> the Makefile=Makefile setting is lost somehow somewhere.
> Happens to all libs, for example newlib, libstdc++-v3, libgcc.

Please try the first patch in
<http://gcc.gnu.org/ml/gcc-patches/2007-11/msg01183.html>.

Cheers,
Ralf

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

* Re: [PATCH] Don't hardcode the makefile name in config-ml.in
  2007-11-26 10:48   ` Ralf Wildenhues
@ 2007-11-26 14:17     ` Paolo Bonzini
  2007-11-26 14:47       ` Andreas Schwab
  2007-11-26 15:04       ` Ralf Wildenhues
  0 siblings, 2 replies; 8+ messages in thread
From: Paolo Bonzini @ 2007-11-26 14:17 UTC (permalink / raw)
  To: Ralf Wildenhues, Hans-Peter Nilsson, Thiemo Seufer, GCC Patches


> Please try the first patch in
> <http://gcc.gnu.org/ml/gcc-patches/2007-11/msg01183.html>.

The third patch there is okay.

Now on to the first.  First of all, my apologies for approving the wrong 
patch.  I hadn't realized that the modified code was inside a "cat << \EOF".

If I understand correctly, the ${Makefile} in

	  for dir in ${Makefile} $(MULTIDIRS); do \

is just a way to avoid an error if MULTIDIRS is empty but [ -z 
"$(MULTIDIRS)" ] does not get it?  If this is the case, I would prefer 
to have something like

         set fnord $(MULTIDIRS); shift; \
         lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
         for dir; 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; \
             fi; \
           else true; \
           fi; \
         done; \

Ralf, portability-wise, what do you think?

Paolo

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

* Re: [PATCH] Don't hardcode the makefile name in config-ml.in
  2007-11-26 14:17     ` Paolo Bonzini
@ 2007-11-26 14:47       ` Andreas Schwab
  2007-11-26 15:04       ` Ralf Wildenhues
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2007-11-26 14:47 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Ralf Wildenhues, Hans-Peter Nilsson, Thiemo Seufer, GCC Patches

Paolo Bonzini <bonzini@gnu.org> writes:

> If I understand correctly, the ${Makefile} in
>
> 	  for dir in ${Makefile} $(MULTIDIRS); do \
>
> is just a way to avoid an error if MULTIDIRS is empty but [ -z 
> "$(MULTIDIRS)" ] does not get it?

It would be a syntax error in some shells, and the test is part of the
same command, so the loop command would be parsed nevertheless.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH] Don't hardcode the makefile name in config-ml.in
  2007-11-26 14:17     ` Paolo Bonzini
  2007-11-26 14:47       ` Andreas Schwab
@ 2007-11-26 15:04       ` Ralf Wildenhues
  2007-11-26 15:20         ` Paolo Bonzini
  1 sibling, 1 reply; 8+ messages in thread
From: Ralf Wildenhues @ 2007-11-26 15:04 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Hans-Peter Nilsson, Thiemo Seufer, GCC Patches

* Paolo Bonzini wrote on Mon, Nov 26, 2007 at 11:48:22AM CET:
>
>> Please try the first patch in
>> <http://gcc.gnu.org/ml/gcc-patches/2007-11/msg01183.html>.
>
> The third patch there is okay.

Thanks.  I need someone to apply it for me (to GCC and src).

> Now on to the first.  First of all, my apologies for approving the wrong 
> patch.  I hadn't realized that the modified code was inside a "cat << 
> \EOF".
>
> If I understand correctly, the ${Makefile} in
>
> 	  for dir in ${Makefile} $(MULTIDIRS); do \
>
> is just a way to avoid an error if MULTIDIRS is empty but [ -z 
> "$(MULTIDIRS)" ] does not get it?

OK, but then I would do this:
  for dir in : $(MULTIDIRS); do \
    test $$dir != : || continue; \

If you like, I can submit a patch for this tonight.

> If this is the case, I would prefer to 
> have something like
>
>         set fnord $(MULTIDIRS); shift; \
>         lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
>         for dir; do \
[...]
>
> Ralf, portability-wise, what do you think?

Some ancient shell out there does not grok `for dir; do'
but only `for dir
          do'

(i.e., a newline works, but semi-colon doesn't).

Cheers,
Ralf

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

* Re: [PATCH] Don't hardcode the makefile name in config-ml.in
  2007-11-26 15:04       ` Ralf Wildenhues
@ 2007-11-26 15:20         ` Paolo Bonzini
  0 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2007-11-26 15:20 UTC (permalink / raw)
  To: Ralf Wildenhues, GCC Patches


> OK, but then I would do this:
>   for dir in : $(MULTIDIRS); do \
>     test $$dir != : || continue; \
> 
> If you like, I can submit a patch for this tonight.

That's ok.  Please submit a single patch, I can mentally separate them 
and it will be easier to apply.

Paolo

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-19 10:24 [PATCH] Don't hardcode the makefile name in config-ml.in Thiemo Seufer
2007-11-19 10:49 ` Paolo Bonzini
2007-11-26  6:44 ` Hans-Peter Nilsson
2007-11-26 10:48   ` Ralf Wildenhues
2007-11-26 14:17     ` Paolo Bonzini
2007-11-26 14:47       ` Andreas Schwab
2007-11-26 15:04       ` Ralf Wildenhues
2007-11-26 15:20         ` Paolo Bonzini

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).