* (toplevel patch) Real make targets for configure-target-*
@ 2002-12-03 8:31 Nathanael Nerode
2002-12-03 10:21 ` DJ Delorie
2002-12-13 6:06 ` Alexandre Oliva
0 siblings, 2 replies; 3+ messages in thread
From: Nathanael Nerode @ 2002-12-03 8:31 UTC (permalink / raw)
To: gcc-patches, gdb-patches, binutils, dj
Real targets for configure-target-*. More complicated than the
configure-build-* case because of:
- multilibs; configuration depends on multilib.out, which depends on
(BASE_)CC_FOR_TARGET.
- dependencies: depending lines must change to match
Tested on i686-pc-linux-gnu.
* configure.in: Introduce BASE_CC_FOR_TARGET.
* Makefile.tpl: Realize configure-target-* targets.
* Makefile.in: Regenerate.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.177.4.13
diff -u -r1.177.4.13 configure.in
--- configure.in 3 Dec 2002 03:42:19 -0000 1.177.4.13
+++ configure.in 3 Dec 2002 16:23:08 -0000
@@ -1653,6 +1653,12 @@
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}%
@@ -1669,6 +1675,7 @@
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}%
@@ -1684,8 +1691,4 @@
rm -f Makefile $sedtemp
mv -f Makefile.tem Makefile
-#
-# Local Variables:
-# fill-column: 131
-# End:
#
--- Makefile.tpl.base 2002-12-03 11:16:05.000000000 -0500
+++ Makefile.tpl 2002-12-03 11:27:05.000000000 -0500
@@ -259,6 +259,7 @@
# Should be substed by configure.in
FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
CC_FOR_TARGET = @CC_FOR_TARGET@
+BASE_CC_FOR_TARGET = @BASE_CC_FOR_TARGET@
CXX_FOR_TARGET = @CXX_FOR_TARGET@
RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
@@ -923,30 +924,21 @@
[+ ENDIF no_install +]
[+ ENDFOR host_modules +]
-# --------------------------------------
+# ---------------------------------------
# Modules which run on the target machine
-# --------------------------------------
+# ---------------------------------------
[+ FOR target_modules +]
.PHONY: configure-target-[+module+] maybe-configure-target-[+module+]
maybe-configure-target-[+module+]:
-configure-target-[+module+]:
+configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/Makefile
+
+$(TARGET_SUBDIR)/[+module+]/multilib.out: $(BASE_CC_FOR_TARGET)
@r=`${PWD}`; export r; \
- $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/[+module+]/tmpmulti.out 2> /dev/null; \
- if [ -s $(TARGET_SUBDIR)/[+module+]/tmpmulti.out ]; then \
- if [ -f $(TARGET_SUBDIR)/[+module+]/multilib.out ]; then \
- if cmp $(TARGET_SUBDIR)/[+module+]/multilib.out $(TARGET_SUBDIR)/[+module+]/tmpmulti.out > /dev/null; then \
- rm -f $(TARGET_SUBDIR)/[+module+]/tmpmulti.out; \
- else \
- echo "Multilibs changed for [+module+], reconfiguring"; \
- rm -f $(TARGET_SUBDIR)/[+module+]/multilib.out $(TARGET_SUBDIR)/[+module+]/Makefile; \
- mv $(TARGET_SUBDIR)/[+module+]/tmpmulti.out $(TARGET_SUBDIR)/[+module+]/multilib.out; \
- fi; \
- else \
- mv $(TARGET_SUBDIR)/[+module+]/tmpmulti.out $(TARGET_SUBDIR)/[+module+]/multilib.out; \
- fi; \
- fi; exit 0 # break command into two pieces
- @if [ -d $(srcdir)/[+module+] ]; then \
- [ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\
+ echo "Configuring multilibs for [+module+]"; \
+ $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/[+module+]/multilib.out 2> /dev/null
+
+$(TARGET_SUBDIR)/[+module+]/Makefile: config.status $(TARGET_SUBDIR)/[+module+]/multilib.out
+ @[ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\
r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \
$(SET_LIB_PATH) \
@@ -1007,10 +999,7 @@
CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
$(TARGET_CONFIGARGS) $${srcdiroption} \
--with-target-subdir="$(TARGET_SUBDIR)" \
- || exit 1; \
- else \
- true; \
- fi
+ || exit 1
.PHONY: all-target-[+module+] maybe-all-target-[+module+]
maybe-all-target-[+module+]:
@@ -1266,34 +1255,34 @@
ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3
# Target modules specific to gcc.
-configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads
-configure-target-fastjar: maybe-configure-target-zlib
+$(TARGET_SUBDIR)/boehm-gc/Makefile: $(ALL_GCC_C) maybe-configure-target-qthreads
+$(TARGET_SUBDIR)/fastjar/Makefile: maybe-configure-target-zlib
all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty
-configure-target-libf2c: $(ALL_GCC_C)
+$(TARGET_SUBDIR)/libf2c/Makefile: $(ALL_GCC_C)
all-target-libf2c: maybe-all-target-libiberty
-configure-target-libffi: $(ALL_GCC_C)
-configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi
+$(TARGET_SUBDIR)/libffi/Makefile: $(ALL_GCC_C)
+$(TARGET_SUBDIR)/libjava/Makefile: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi
all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi
-configure-target-libobjc: $(ALL_GCC_C)
+$(TARGET_SUBDIR)/libobjc/Makefile: $(ALL_GCC_C)
all-target-libobjc: maybe-all-target-libiberty
-configure-target-libstdc++-v3: $(ALL_GCC_C)
+$(TARGET_SUBDIR)/libstdc++-v3/Makefile: $(ALL_GCC_C)
all-target-libstdc++-v3: maybe-all-target-libiberty
-configure-target-zlib: $(ALL_GCC_C)
+$(TARGET_SUBDIR)/zlib/Makefile: $(ALL_GCC_C)
# Target modules in the 'src' repository.
-configure-target-examples: $(ALL_GCC_C)
-configure-target-libgloss: $(ALL_GCC)
+$(TARGET_SUBDIR)/examples/Makefile: $(ALL_GCC_C)
+$(TARGET_SUBDIR)/libgloss/Makefile: $(ALL_GCC)
all-target-libgloss: maybe-configure-target-newlib
-configure-target-libiberty: $(ALL_GCC_C)
-configure-target-libtermcap: $(ALL_GCC_C)
-configure-target-newlib: $(ALL_GCC)
-configure-target-winsup: $(ALL_GCC_C)
+$(TARGET_SUBDIR)/libiberty/Makefile: $(ALL_GCC_C)
+$(TARGET_SUBDIR)/libtermcap/Makefile: $(ALL_GCC_C)
+$(TARGET_SUBDIR)/newlib/Makefile: $(ALL_GCC)
+$(TARGET_SUBDIR)/winsup/Makefile: $(ALL_GCC_C)
all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap
# Other target modules. Warning, these are not well tested.
-configure-target-gperf: $(ALL_GCC_CXX)
+$(TARGET_SUBDIR)/gperf/Makefile: $(ALL_GCC_CXX)
all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3
-configure-target-qthreads: $(ALL_GCC_C)
+$(TARGET_SUBDIR)/qthreads/Makefile: $(ALL_GCC_C)
# Dependencies of maybe-foo on foo. These are used because, for example,
# all-gcc only depends on all-gas if gas is present and being configured.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: (toplevel patch) Real make targets for configure-target-*
2002-12-03 8:31 (toplevel patch) Real make targets for configure-target-* Nathanael Nerode
@ 2002-12-03 10:21 ` DJ Delorie
2002-12-13 6:06 ` Alexandre Oliva
1 sibling, 0 replies; 3+ messages in thread
From: DJ Delorie @ 2002-12-03 10:21 UTC (permalink / raw)
To: neroden; +Cc: gcc-patches, gdb-patches, binutils
> * configure.in: Introduce BASE_CC_FOR_TARGET.
> * Makefile.tpl: Realize configure-target-* targets.
> * Makefile.in: Regenerate.
Ok with the addendum, but...
> +$(TARGET_SUBDIR)/[+module+]/Makefile: config.status $(TARGET_SUBDIR)/[+module+]/multilib.out
> + @[ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\
This mkdir isn't needed.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: (toplevel patch) Real make targets for configure-target-*
2002-12-03 8:31 (toplevel patch) Real make targets for configure-target-* Nathanael Nerode
2002-12-03 10:21 ` DJ Delorie
@ 2002-12-13 6:06 ` Alexandre Oliva
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2002-12-13 6:06 UTC (permalink / raw)
To: Nathanael Nerode; +Cc: gcc-patches, gdb-patches, binutils, dj
On Dec 3, 2002, Nathanael Nerode <neroden@twcny.rr.com> wrote:
> +# 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,.,'`
Beware CC_FOR_TARGET starting with env_var=content. You may want to
strip words containing `=' before setting it.
(yeah, I've actually run into this, while playing with distcc for gcc
bootstrapping, having to override DISTCC_HOSTS)
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-12-13 13:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-03 8:31 (toplevel patch) Real make targets for configure-target-* Nathanael Nerode
2002-12-03 10:21 ` DJ Delorie
2002-12-13 6:06 ` Alexandre Oliva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox