This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA/C] Break out C options into a separate file
- From: Zack Weinberg <zack at codesourcery dot com>
- To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Cc: Andreas Tobler <toa at pop dot agri dot ch>, Neil Booth <neil at daikokuya dot co dot uk>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 01 Jun 2003 10:29:44 -0700
- Subject: Re: [RFA/C] Break out C options into a separate file
- References: <20030520221643.GB32072@daikokuya.co.uk><Pine.LNX.4.53.0305210939320.16803@kern.srcf.societies.cam.ac.uk><20030522195154.GA6157@daikokuya.co.uk> <3ED9AAC3.9000102@pop.agri.ch><Pine.LNX.4.53.0306011359120.27296@kern.srcf.societies.cam.ac.uk>
"Joseph S. Myers" <jsm28@cam.ac.uk> writes:
> On Sun, 1 Jun 2003, Andreas Tobler wrote:
>
>> Just for the record, my ppc linux box has sort under /bin. So a
>> bootstrap fails here unless I symlink around.
>>
>>
>> Would it be possible to check for awk/sort and take the corresponding one?
>
> In general, this sort of thing should be taken from the PATH rather than
> hardcoding directories. In the case of awk, there's a standard autoconf
> test to determine the preferred awk.
The right thing to do is what po/exgettext does:
# Set AWK if environment has not already set it.
AWK=${AWK-awk}
That will pick up the $(AWK) variable from the Makefile, which in turn
is set by the configure script to whichever of mawk, gawk, or nawk you
have.
For sort, don't use a variable at all.
I note that opts.sh has a localized override of LANG on the sort
invocation. It would be a good idea to copy this bit from
po/exgettext instead:
# Always operate in the C locale.
LANG=C
LANGUAGE=C
LC_ALL=C
export LANG LANGUAGE LC_ALL
zw