11.3.1-4.1

Work around --with-gxx-include-dir

Resolves: #2149650
This commit is contained in:
Marek Polacek 2022-12-15 18:19:58 -05:00
parent 4d1c6e4fb4
commit 38f08e5122

View File

@ -1501,6 +1501,18 @@ for crossarch in %{cross_targets}; do
# Temporarily replace DEV-PHASE. # Temporarily replace DEV-PHASE.
cp -p ../../gcc/DEV-PHASE{.cross,} cp -p ../../gcc/DEV-PHASE{.cross,}
# --with-gxx-include-dir= doesn't prefix its argument with $(DESTDIR)
# and you can't install things into /usr unless you're root.
mkdir scratch
scratchdir=`pwd`/scratch
cd $crossarch/libstdc++-v3
for i in `find . -name Makefile`; do
cp -a $i $i.save
sed -i -e 's?^gxx_include_dir = .*$?gxx_include_dir = '$scratchdir'?' $i
touch -r $i.save $i
done
cd ../..
# Use -j1, because build-many-glibcs says: # Use -j1, because build-many-glibcs says:
# Parallel "make install" for GCC has race conditions that can # Parallel "make install" for GCC has race conditions that can
# cause it to fail; see # cause it to fail; see
@ -1518,6 +1530,15 @@ for crossarch in %{cross_targets}; do
# Restore DEV-PHASE. # Restore DEV-PHASE.
cp -p ../../gcc/DEV-PHASE{.native,} cp -p ../../gcc/DEV-PHASE{.native,}
# Restore Makefiles with the old gxx_include_dir.
cd $crossarch/libstdc++-v3
for i in `find . -name Makefile`; do
mv -f $i.save $i
done
cd ../..
# We're not shipping C++ headers; nuke 'em.
rm -rf $scratchdir
# Move libgomp.spec to where it belongs for %files. # Move libgomp.spec to where it belongs for %files.
mv $crossarch/libgomp/libgomp.spec $CROSS_LIBPATH mv $crossarch/libgomp/libgomp.spec $CROSS_LIBPATH