* (toplevel patch) Deal with multilib.out. Really.
@ 2002-12-19 18:33 Nathanael Nerode
2002-12-20 1:35 ` Raja R Harinath
0 siblings, 1 reply; 2+ messages in thread
From: Nathanael Nerode @ 2002-12-19 18:33 UTC (permalink / raw)
To: gcc-patches, dj, binutils, gdb-patches
Final version. This is currently being tested to see if it generates any of
the known problems generated by previous tries. If it's OK, can I commit it?
I should also add multilib.out to a clean target, but I can't stand to
even think about it tonight.
* Makefile.tpl: There is only one multilib.out. Rebuild it with
move-if-change.
* Makefile.in: Regenerate.
* configure.in: Remove unneeded stuff.
Index: Makefile.tpl
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.tpl,v
retrieving revision 1.21
diff -u -r1.21 Makefile.tpl
--- Makefile.tpl 19 Dec 2002 20:23:50 -0000 1.21
+++ Makefile.tpl 20 Dec 2002 02:20:12 -0000
@@ -784,7 +784,6 @@
# built are.
TAGS: do-TAGS
-
# --------------------------------------
# Modules which run on the build machine
# --------------------------------------
@@ -968,13 +967,10 @@
maybe-configure-target-[+module+]:
configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/Makefile
-# Don't manually override CC_FOR_TARGET at make time; get it set right
-# at configure time. Otherwise multilibs may be wrong.
-$(TARGET_SUBDIR)/[+module+]/multilib.out: maybe-all-gcc
+# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
+$(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out
@[ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\
- r=`${PWD}`; export r; \
- echo "Configuring multilibs for [+module+]"; \
- $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/[+module+]/multilib.out 2> /dev/null
+ cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out
$(TARGET_SUBDIR)/[+module+]/Makefile: config.status $(TARGET_SUBDIR)/[+module+]/multilib.out
@[ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\
@@ -1394,6 +1390,21 @@
# --------------------------------
# Regenerating top level configury
# --------------------------------
+
+# Multilib.out tells target dirs what multilibs they should build.
+# There is really only one copy. We use the 'timestamp' method to
+# work around various timestamp bugs on some systems.
+# We use move-if-change so that it's only considered updated when it
+# actually changes, because it has to depend on a phony target.
+multilib.out: multilib.ts
+ @true
+
+multilib.ts: maybe-all-gcc
+ r=`${PWD}`; export r; \
+ echo "Checking multilib configuration..."; \
+ $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \
+ $(SHELL) $(srcdir)/move-if-change multilib.tmp $(TARGET_SUBDIR)/[+module+]/multilib.out ; \
+ echo timestamp > multilib.ts
# Rebuilding Makefile.in, using autogen.
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.196
diff -u -r1.196 configure.in
--- configure.in 19 Dec 2002 20:23:50 -0000 1.196
+++ configure.in 20 Dec 2002 02:20:21 -0000
@@ -1698,12 +1698,6 @@
qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
qqRAW_CXX_FOR_TARGET=`echo "$qRAW_CXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
-# BASE_CC_FOR_TARGET is the actual program file of CC_FOR_TARGET,
-# for use in dependencies. Replace $$r with a relative
-# path if it's present.
-set dummy $CC_FOR_TARGET; cc_for_target_first_word=$2
-BASE_CC_FOR_TARGET=`echo "$cc_for_target_first_word" | sed -e 's,[$][$]r,.,'`
-
sedtemp=sed.$$
cat >$sedtemp <<EOF
s%@GDB_TK@%${GDB_TK}%
@@ -1722,7 +1716,6 @@
s%@target_configargs@%${targargs}%
s%@FLAGS_FOR_TARGET@%${FLAGS_FOR_TARGET}%
s%@CC_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}%
-s%@BASE_CC_FOR_TARGET@%${BASE_CC_FOR_TARGET}%
s%@GCJ_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}%
s%@CXX_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}%
s%@RAW_CXX_FOR_TARGET@%\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}%
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: (toplevel patch) Deal with multilib.out. Really.
2002-12-19 18:33 (toplevel patch) Deal with multilib.out. Really Nathanael Nerode
@ 2002-12-20 1:35 ` Raja R Harinath
0 siblings, 0 replies; 2+ messages in thread
From: Raja R Harinath @ 2002-12-20 1:35 UTC (permalink / raw)
To: Nathanael Nerode; +Cc: gcc-patches, dj, binutils, gdb-patches
Hi,
Nathanael Nerode <neroden@twcny.rr.com> writes:
> +# Multilib.out tells target dirs what multilibs they should build.
> +# There is really only one copy. We use the 'timestamp' method to
> +# work around various timestamp bugs on some systems.
> +# We use move-if-change so that it's only considered updated when it
> +# actually changes, because it has to depend on a phony target.
> +multilib.out: multilib.ts
> + @true
To round out this idiom, this should be
multilib.out: multilib.ts
@if test -f multilib.out; then :; \
else rm -f multilib.ts; $(MAKE) multilib.ts; fi
So that
rm multilib.out
make
works.
Also, IIRC discussions on the automake list about the use of 'then :;
else' form rather than 'test ! -f' -- some shells use the exit code of
the 'if' test when they fall through a missing 'else' clause.
- Hari
--
Raja R Harinath ------------------------------ harinath@cs.umn.edu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-20 5:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-19 18:33 (toplevel patch) Deal with multilib.out. Really Nathanael Nerode
2002-12-20 1:35 ` Raja R Harinath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox