2022-04-13 00:08:29 +01:00
|
|
|
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
|
2021-03-20 21:23:07 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
|
2022-03-07 07:58:20 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
|
2021-03-20 21:23:07 +00:00
|
|
|
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-04-24 04:59:17 +01:00
|
|
|
EXTRA_DISTFILES="automake-1.16.3.tar.gz"
|
2022-04-13 00:08:29 +01:00
|
|
|
|
2021-03-20 21:23:07 +00:00
|
|
|
src_prepare() {
|
2021-05-03 23:48:06 +01:00
|
|
|
default
|
2021-03-21 00:24:24 +00:00
|
|
|
|
|
|
|
# Needed for musl
|
2021-03-20 21:23:07 +00:00
|
|
|
sed -i 's/struct siginfo/siginfo_t/' gcc/config/i386/linux-unwind.h
|
|
|
|
|
2021-03-30 20:59:42 +01:00
|
|
|
# Regenerating top level Makefile requires GNU Autogen and hence Guile,
|
|
|
|
# but it is not essential for building gcc.
|
|
|
|
rm configure Makefile.in fixincludes/fixincl.x
|
|
|
|
|
2021-03-20 21:23:07 +00:00
|
|
|
for dir in intl libcpp; do
|
|
|
|
cd $dir
|
|
|
|
rm aclocal.m4
|
2022-07-02 20:39:19 +01:00
|
|
|
AUTOM4TE=autom4te-2.61 aclocal-1.9 --acdir=../config
|
2021-03-20 21:23:07 +00:00
|
|
|
cd ..
|
|
|
|
done
|
|
|
|
for dir in fixincludes gcc intl libcpp libiberty; do
|
|
|
|
cd $dir
|
|
|
|
rm configure
|
|
|
|
autoconf-2.61
|
|
|
|
cd ..
|
|
|
|
done
|
|
|
|
cd libmudflap
|
2021-03-28 23:18:33 +01:00
|
|
|
AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 AUTOM4TE=autom4te-2.61 autoreconf-2.61 -f
|
2021-03-20 21:23:07 +00:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
for dir in fixincludes intl libmudflap; do
|
|
|
|
cd $dir
|
|
|
|
rm -f config.in
|
|
|
|
autoheader-2.61
|
|
|
|
cd ..
|
|
|
|
done
|
|
|
|
|
|
|
|
# Rebuild libtool files
|
|
|
|
rm config.guess config.sub ltmain.sh
|
|
|
|
libtoolize
|
2021-07-06 00:13:58 +01:00
|
|
|
cp ../automake-1.16.3/lib/config.sub .
|
2021-03-20 21:23:07 +00:00
|
|
|
|
|
|
|
# Rebuild bison files
|
|
|
|
# Workaround for bison being too new
|
|
|
|
sed -i 's/YYLEX/yylex()/' gcc/c-parse.y
|
|
|
|
rm gcc/c-parse.c
|
2021-03-21 00:24:24 +00:00
|
|
|
rm gcc/gengtype-yacc.c gcc/gengtype-yacc.h
|
2021-03-20 21:23:07 +00:00
|
|
|
rm intl/plural.c
|
|
|
|
|
|
|
|
# Rebuild flex generated files
|
|
|
|
rm gcc/gengtype-lex.c
|
|
|
|
|
|
|
|
# Remove translation catalogs
|
2021-04-11 22:57:43 +01:00
|
|
|
find . -name '*.gmo' -delete
|
|
|
|
|
2021-07-15 17:59:11 +01:00
|
|
|
# Pre-built texinfo files
|
2021-04-11 22:57:43 +01:00
|
|
|
find . -name '*.info' -delete
|
2022-02-10 10:55:06 +00:00
|
|
|
|
|
|
|
# Pre-built man files
|
|
|
|
rm gcc/doc/*.1 gcc/doc/*.7
|
2021-03-20 21:23:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2021-03-30 20:59:42 +01:00
|
|
|
|
|
|
|
for dir in libiberty libcpp gcc; do
|
|
|
|
mkdir $dir
|
|
|
|
cd $dir
|
|
|
|
../../$dir/configure \
|
|
|
|
--prefix="${PREFIX}" \
|
2022-09-14 13:07:13 +01:00
|
|
|
--libdir="${LIBDIR}" \
|
2021-07-06 00:13:58 +01:00
|
|
|
--build=i386-unknown-linux-musl \
|
|
|
|
--target=i386-unknown-linux-musl \
|
|
|
|
--host=i386-unknown-linux-musl \
|
2021-03-30 20:59:42 +01:00
|
|
|
--disable-shared \
|
|
|
|
--program-transform-name=
|
|
|
|
cd ..
|
|
|
|
done
|
2021-03-20 21:23:07 +00:00
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
2021-07-06 00:13:58 +01:00
|
|
|
ln -s . build/build-i386-unknown-linux-musl
|
2021-03-30 20:59:42 +01:00
|
|
|
for dir in libiberty libcpp gcc; do
|
2023-04-10 06:30:16 +01:00
|
|
|
make "${MAKEJOBS}" -C build/$dir LIBGCC2_INCLUDES=-I"${PREFIX}/include" STMP_FIXINC=
|
2021-03-30 20:59:42 +01:00
|
|
|
done
|
2021-03-20 21:23:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2022-09-14 13:07:13 +01:00
|
|
|
mkdir -p "${DESTDIR}${LIBDIR}/gcc/i386-unknown-linux-musl/4.0.4/install-tools/include"
|
2021-04-02 12:24:40 +01:00
|
|
|
make -C build/gcc install STMP_FIXINC= DESTDIR="${DESTDIR}"
|
2022-09-14 13:07:13 +01:00
|
|
|
cp gcc/gsyslimits.h "${DESTDIR}${LIBDIR}/gcc/i386-unknown-linux-musl/4.0.4/include/syslimits.h"
|
2021-03-20 21:23:07 +00:00
|
|
|
}
|