Mail Archives: djgpp-workers/2003/08/23/18:30:22
Hello.
Eli Zaretskii wrote:
>
> > From: <ams AT ludd DOT luth DOT se>
> > Date: Tue, 19 Aug 2003 00:13:30 +0200 (CEST)
> >
> > Are everyone happy with the additional header file? Otherwise we could
> > add "#if __GNUC__/#endif" to strategic places in <math.h> (and other
> > header files if necessary) to remove everything but the defines for .S
> > files.
>
> Why do we need the header file? Is it just for the definitions of the
> FP_* macros? If so, we could create a header with only those
> definitions by running Sed on math.h. The header file is only needed
> during the compilation of fpclassifyld.S, so there's no need to keep
> it any longer, let alone in the public include/sys directory.
I don't like the idea of the "#if __GNUC__/#endif" thing. I prefer the idea of
using sed.
> > Personally I'd rather add the "#if __GNU__"s instead of the new header
> > file (now that I think it's possible).
>
> I agree that this is better than adding a new header.
Rather than just complain, here's an example of how to get sed to list what
you want. ;)
bash-2.04$ echo -e "/FP_CLASSIFY/p\n/FP_NAN/p" > fp.sed
bash-2.04$ echo -e "foo\nbar\nFP_CLASSIFY\nblah\nFP_NAN" | sed -n -f fp.sed
FP_CLASSIFY
FP_NAN
bash-2.04$ sed --version
GNU sed version 3.02.80
Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.
I guess you'd need something in the makefile for fpclassify like this:
fpclassify.S: fp-asm.h fp-asm.sed
sed -n -f fp-asm.sed $(TOP)/../../include/math.h > fp-asm.h
clean:
rm -f fp-asm.h
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -