logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

pass2.sh (2671B)


  1. # SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
  2. # SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
  3. # SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
  4. # SPDX-License-Identifier: GPL-3.0-or-later
  5. EXTRA_DISTFILES="automake-1.16.3.tar.xz"
  6. src_prepare() {
  7. default
  8. # Needed for musl
  9. sed -i 's/struct siginfo/siginfo_t/' gcc/config/i386/linux-unwind.h
  10. # Regenerating top level Makefile requires GNU Autogen and hence Guile,
  11. # but it is not essential for building gcc.
  12. rm configure Makefile.in fixincludes/fixincl.x
  13. for dir in intl libcpp; do
  14. cd $dir
  15. rm aclocal.m4
  16. AUTOM4TE=autom4te-2.61 aclocal-1.9 --acdir=../config
  17. cd ..
  18. done
  19. for dir in fixincludes gcc intl libcpp libiberty; do
  20. cd $dir
  21. rm configure
  22. autoconf-2.61
  23. cd ..
  24. done
  25. cd libmudflap
  26. AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 AUTOM4TE=autom4te-2.61 autoreconf-2.61 -f
  27. cd ..
  28. for dir in fixincludes intl libmudflap; do
  29. cd $dir
  30. rm -f config.in
  31. autoheader-2.61
  32. cd ..
  33. done
  34. # Rebuild libtool files
  35. rm config.guess config.sub ltmain.sh
  36. libtoolize
  37. cp ../automake-1.16.3/lib/config.sub .
  38. # Rebuild bison files
  39. # Workaround for bison being too new
  40. sed -i 's/YYLEX/yylex()/' gcc/c-parse.y
  41. rm gcc/c-parse.c
  42. rm gcc/gengtype-yacc.c gcc/gengtype-yacc.h
  43. rm intl/plural.c
  44. # Rebuild flex generated files
  45. rm gcc/gengtype-lex.c
  46. # Remove translation catalogs
  47. find . -name '*.gmo' -delete
  48. # Pre-built texinfo files
  49. find . -name '*.info' -delete
  50. # Pre-built man files
  51. rm gcc/doc/*.1 gcc/doc/*.7
  52. }
  53. src_configure() {
  54. mkdir build
  55. cd build
  56. for dir in libiberty libcpp gcc; do
  57. mkdir $dir
  58. cd $dir
  59. ../../$dir/configure \
  60. --prefix="${PREFIX}" \
  61. --libdir="${LIBDIR}" \
  62. --build=i386-unknown-linux-musl \
  63. --target=i386-unknown-linux-musl \
  64. --host=i386-unknown-linux-musl \
  65. --disable-shared \
  66. --program-transform-name=
  67. cd ..
  68. done
  69. cd ..
  70. }
  71. src_compile() {
  72. ln -s . build/build-i386-unknown-linux-musl
  73. for dir in libiberty libcpp gcc; do
  74. make "${MAKEJOBS}" -C build/$dir LIBGCC2_INCLUDES=-I"${PREFIX}/include" STMP_FIXINC=
  75. done
  76. }
  77. src_install() {
  78. mkdir -p "${DESTDIR}${LIBDIR}/gcc/i386-unknown-linux-musl/4.0.4/install-tools/include"
  79. make -C build/gcc install STMP_FIXINC= DESTDIR="${DESTDIR}"
  80. cp gcc/gsyslimits.h "${DESTDIR}${LIBDIR}/gcc/i386-unknown-linux-musl/4.0.4/include/syslimits.h"
  81. }