Precompiled headers: supply "-x c-header" or "-x c++-header" if available.

Some older versions of gcc give "all.hpp: linker input file unused
because linking not done" otherwise, because they don't realize files
named *.hpp are headers.

Reported-by: Wayne Scott <wsc9tt@gmail.com>
This commit is contained in:
Avery Pennarun 2019-02-25 13:09:11 +00:00
commit 1574b11598
5 changed files with 27 additions and 9 deletions

View file

@ -116,14 +116,14 @@ case $1 in
;;
*.h.fpic.gch|*.hpp.fpic.gch)
src="$S/${1%.fpic.gch}"
xCFLAGS="-fPIC" PCH="" dep="" compile "$@"
xCFLAGS="-fPIC" PCH="3" dep="" compile "$@"
# precompiled header is "unchanged" if its component
# headers are unchanged.
cat ${deps#*:} | tee $1.stamp | redo-stamp
;;
*.h.gch|*.hpp.gch)
src="$S/${1%.gch}"
xCFLAGS="" PCH="" dep="" compile "$@"
xCFLAGS="" PCH="3" dep="" compile "$@"
# precompiled header is "unchanged" if its component
# headers are unchanged.
cat ${deps#*:} | tee $1.stamp | redo-stamp