From: Daniel Jacobowitz <drow@mvista.com>
To: Alexandre Oliva <aoliva@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Pass FLAGS_FOR_TARGET to subdirectories (was: Re: GCC_FOR_TARGET x linker scripts)
Date: Mon, 28 Oct 2002 12:37:00 -0000 [thread overview]
Message-ID: <20021028203738.GA13849@nevyn.them.org> (raw)
In-Reply-To: <or8z0n1719.fsf@free.redhat.lsd.ic.unicamp.br>
On Fri, Oct 25, 2002 at 01:22:58AM -0300, Alexandre Oliva wrote:
> On Oct 25, 2002, Daniel Jacobowitz <drow@mvista.com> wrote:
>
> > I assume that the -L$$r/ld comes in via @FLAGS_FOR_TARGET@... yes, it
> > does. Why should the definition in gcc/Makefile.in be any different?
> > Is there any reason that the same FLAGS_FOR_TARGET and GCC_FOR_TARGET
> > won't work?
>
> Well, gcc/configure.in would have to duplicate the logic of
> FLAGS_FOR_TARGET, no?
Well, I was planning to pass the value down from the top level at
configure time. Easiest would be in the environment, but FLAGS_TO_PASS
can get a little large, so that might be unwise. I also could have
just picked it out of ../Makefile, but that's a little bit too magical
for my taste, so I wrote it to a new file.
Note that GCC_FOR_TARGET in gcc/Makefile.in includes "-isystem
$(build_tooldir)/sys-include". In the top level it doesn't. It's only
there because the compiler (if it's configured to look for
$(gcc_tooldir)/sys-include at all) won't necessarily find it at build
time when $(gcc_tooldir) doesn't exist... I left it alone for now, but
it should probably move to the top-level FLAGS_FOR_TARGET.
Here's what I came up with; what do you think? The file can be
extended to pass up any other logic we want to be in the top level.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2002-10-28 Daniel Jacobowitz <drow@mvista.com>
* configure.in: Write FLAGS_FOR_TARGET to config.vars.
* Makefile.in (local-distclean): Clean config.vars.
2002-10-28 Daniel Jacobowitz <drow@mvista.com>
* configure.in: Load ../config.vars. Substitute FLAGS_FOR_TARGET.
* configure: Regenerated.
* Makefile.in (FLAGS_FOR_TARGET): Define.
(GCC_FOR_TARGET): Use $(FLAGS_FOR_TARGET).
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.177.4.2
diff -u -p -r1.177.4.2 configure.in
--- configure.in 15 Oct 2002 01:32:20 -0000 1.177.4.2
+++ configure.in 28 Oct 2002 20:17:54 -0000
@@ -1536,6 +1536,12 @@ qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET"
# macros.
qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
+# Save FLAGS_FOR_TARGET for subdirectory configures.
+qFLAGS_FOR_TARGET=`echo "$FLAGS_FOR_TARGET" | sed -e "s/'/'\\\\''/g"`
+cat >config.vars <<EOF
+FLAGS_FOR_TARGET='${qFLAGS_FOR_TARGET}'
+EOF
+
sedtemp=sed.$$
cat >$sedtemp <<EOF
s:@target_configdirs@:${target_configdirs}:
Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.939.2.11
diff -u -p -r1.939.2.11 Makefile.in
--- gcc/Makefile.in 25 Oct 2002 03:18:37 -0000 1.939.2.11
+++ gcc/Makefile.in 28 Oct 2002 20:17:58 -0000
@@ -179,10 +179,12 @@ USER_H = $(srcdir)/ginclude/float.h \
$(srcdir)/ginclude/varargs.h \
$(EXTRA_HEADERS)
+FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
+
# The GCC to use for compiling libgcc.a and crt*.o.
# Usually the one we just built.
# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
-GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
+GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ $(FLAGS_FOR_TARGET) -isystem $(build_tooldir)/sys-include
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It omits XCFLAGS, and specifies -B./.
Index: gcc/configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.617.4.4
diff -u -p -r1.617.4.4 configure.in
--- gcc/configure.in 20 Oct 2002 01:03:49 -0000 1.617.4.4
+++ gcc/configure.in 28 Oct 2002 20:18:07 -0000
@@ -1177,6 +1177,15 @@ for f in $build_xm_file; do
esac
done
+# Pick up some definitions from the top level.
+if test -r ../config.vars; then
+ . ../config.vars
+else
+ echo '"config.vars" is missing; re-run configure at the top level to create it.' 1>&2
+ exit 1
+fi
+AC_SUBST(FLAGS_FOR_TARGET)
+
# Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
# Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
CROSS= AC_SUBST(CROSS)
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.in,v
retrieving revision 1.111.4.2
diff -u -p -r1.111.4.2 Makefile.in
--- Makefile.in 15 Oct 2002 01:32:20 -0000 1.111.4.2
+++ Makefile.in 28 Oct 2002 20:36:12 -0000
@@ -1000,6 +1000,7 @@ local-clean:
local-distclean:
-rm -f Makefile config.status config.cache mh-frag mt-frag
+ -rm -f config.vars
-if [ "$(TARGET_SUBDIR)" != "." ]; then \
rm -rf $(TARGET_SUBDIR); \
else true; fi
next prev parent reply other threads:[~2002-10-28 20:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-24 20:18 GCC_FOR_TARGET x linker scripts Alexandre Oliva
2002-10-24 21:16 ` Daniel Jacobowitz
2002-10-24 21:23 ` Alexandre Oliva
2002-10-28 12:37 ` Daniel Jacobowitz [this message]
2002-10-28 20:01 ` Pass FLAGS_FOR_TARGET to subdirectories (was: Re: GCC_FOR_TARGET x linker scripts) Daniel Jacobowitz
2002-11-06 10:16 ` Alexandre Oliva
2002-11-06 11:25 ` Daniel Jacobowitz
2002-11-06 12:51 ` Alexandre Oliva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021028203738.GA13849@nevyn.them.org \
--to=drow@mvista.com \
--cc=aoliva@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).