This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: improve ATTRIBUTE_GCC_DIAG


Ben Elliston <bje@au1.ibm.com> writes:

> Short of having autoconf (or make) generate a header file with the
> encoded version number in it, does anyone have any other ideas?

I know I've made several suggestions already, but how about something
like

bversion.h: s-bversion; @true
s-bversion: BASE-VER
	echo '#define BUILDING_GCC_MAJOR `echo $(BASEVER_c) | sed -e 's/^\([0-9]*\).*$/\1/'` > bversion.h
	echo '#define BUILDING_GCC_MINOR `echo $(BASEVER_c) | sed -e 's/^[0-9]*\.\([0-9]*\).*$/\1/'` >> bversion.h
	echo '#define BUILDING_GCC_PATCHLEVEL `echo $(BASEVER_c) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$/\1/'` >> bversion.h
	$(STAMP) s-bversion

Then add bversion.h to TOPLEV_H, and #include "bversion.h" in toplev.h.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]