This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rfc: new libgcc build mechanism
- To: Donn Terry <donnte at microsoft dot com>
- Subject: Re: rfc: new libgcc build mechanism
- From: pausmith at nortelnetworks dot com (Paul D. Smith)
- Date: 10 May 2000 13:15:30 -0400
- Cc: "'Felix Lee'" <flee at teleport dot com>, "'Robert Lipe'" <robertlipe at usa dot net>, "'Russ Allbery '" <rra at stanford dot edu>, "'autoconf at gnu dot org '" <autoconf at gnu dot org>, "'gcc at gcc dot gnu dot org '" <gcc at gcc dot gnu dot org>
- References: <309F4FC4705DC844987051A517E9E39B16EEC0@red-pt-02.redmond.corp.microsoft.com>
- Reply-To: pausmith at nortelnetworks dot com
%% Donn Terry <donnte@microsoft.com> writes:
dt> Please take a look at the Makefile in that area; the
dt> current code is using nested `` to create further command
dt> lines (not data files). I'll admit I haven't tried, but
dt> I'm not at all sure it can be done because the *creation*
dt> of the string occurs in a different directory than the
dt> *use* of it, and the purpose of the substitution is to
dt> deal with that problem! Here's what I currently use
dt> locally (with $()). If you can figure out a decent
dt> (and generally acceptable) solution to the problem that
dt> works with ``, I'll be more than happy to see it.
dt> PREPEND_DOTDOT_TO_RELATIVE_PATHS = sed \
dt> -e 's|^ *[^ /][^ /]*/|%&|' \
dt> -e 's| -B| -B%|g' \
dt> -e 's|% *[^- /]|%&|g' \
dt> -e 's|%% *|../|g' \
dt> -e 's|%||g'
I'm a little concerned that the & token isn't supported by all versions
of sed, either, but I couldn't find any examples... anyone have thoughts
on the portability of that?
dt> "CC=$$(echo $$(case '$(CC)' in (stage*) echo '$(CC)' | sed -e \
dt> 's|stage|../stage|g';; (*) echo '$(CC)';; esac) | \
dt> $(PREPEND_DOTDOT_TO_RELATIVE_PATHS) )"
Hmm. Why can't you do this with just one ``? There's no need for the
outer one and the outer echo at all as far as I can see, just pipe the
results of the case statement directly into the sed script, like this:
"CC=`case '$(CC)' in stage*) echo '$(CC)' | sed -e 's|stage|../stage|g';; \
*) echo '$(CC)';; \
esac | $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`"
?
--
-------------------------------------------------------------------------------
Paul D. Smith <psmith@baynetworks.com> Network Management Development
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions---Nortel Networks takes no responsibility for them.