diff options
author | Alexandre Oliva <oliva@adacore.com> | 2021-01-06 08:05:35 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2021-01-06 08:05:35 -0300 |
commit | cecf8c662de09c5db14d1e5a4006ab6147980546 (patch) | |
tree | 4c484c209d5a7041e0086034aa366821b500225a /gcc/config/t-vxworks | |
parent | c9ee9c1e3553247c776f33eb0fe0aadee094a192 (diff) | |
download | gcc-cecf8c662de09c5db14d1e5a4006ab6147980546.zip gcc-cecf8c662de09c5db14d1e5a4006ab6147980546.tar.gz gcc-cecf8c662de09c5db14d1e5a4006ab6147980546.tar.bz2 |
robustify vxworks glimits.h overriding
The glimits.h overriding used in gcc/config/t-vxworks was fragile: the
intermediate file would already be there in a rebuild, and so the
adjustments would not be made, so the generated limits.h would miss
them, causing limits-width-[12] tests to fail on that target.
While changing it, I also replaced the modern $(cmd) shell syntax with
the more portable `cmd` construct.
for gcc/ChangeLog
* Makefile.in (T_GLIMITS_H): New.
(stmp-int-hdrs): Depend on it, use it.
* config/t-vxworks (T_GLIMITS_H): Override it.
(vxw-glimits.h): New.
Diffstat (limited to 'gcc/config/t-vxworks')
-rw-r--r-- | gcc/config/t-vxworks | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/gcc/config/t-vxworks b/gcc/config/t-vxworks index 8f3d990..5a06ebe 100644 --- a/gcc/config/t-vxworks +++ b/gcc/config/t-vxworks @@ -43,29 +43,16 @@ $(INSTALL_HEADERS_DIR): install-stdint.h LIMITS_H_TEST = true STMP_FIXINC = stmp-fixinc -# VxWorks system environments have been GCC based for a long time and we need -# to make sure that our files and the system ones use distinct macro names to -# protect against recursive inclusions. We achieve this by temporarily -# substituting the headers used by stmp-int-headers with alternative versions -# where we add some version indication in the inclusion-protection macro +# VxWorks system environments have been GCC based for a long time and +# we need to make sure that our files and the system ones use distinct +# macro names to protect against recursive inclusions. We achieve +# this by modifying the GLIMITS_H fragment that goes into limits.h +# with some version indication in the inclusion-protection macro # names. -# Before the standard stmp-int-headers operations take place, arrange to -# copy the current version of the relevant header files locally, generate -# the alternate version and replace the original version with ours: +T_GLIMITS_H = vxw-glimits.h -stmp-int-hdrs: subst-glimits.h - -subst-%.h: - cp -p $(srcdir)/$*.h orig-$*.h - ID=$$(echo $(BASEVER_c) | sed -e 's/\./_/g'); \ - sed -e "s/_LIMITS_H__/_LIMITS_H__$${ID}_/" < $(srcdir)/$*.h > $@ - cp $@ $(srcdir)/$*.h - -# Then arrange to restore the original versions after the standard -# operations have taken place: - -INSTALL_HEADERS += restore-glimits.h - -restore-glimits.h: stmp-int-hdrs - cp -p orig-glimits.h $(srcdir)/glimits.h +vxw-glimits.h: $(srcdir)/glimits.h + ID=`echo $(BASEVER_c) | sed -e 's/\./_/g'` && \ + sed -e "s/_LIMITS_H__/_LIMITS_H__$${ID}_/" < $(srcdir)/glimits.h > $@T + mv $@T $@ |