04-binutils 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Build script for binutils.
  2. #
  3. # Copyright (c) 2014-2018 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. version=2.30
  17. cd -- "$TMPDIR"
  18. rm -rf binutils-${version}
  19. unpack "${worktree}/sources/binutils-${version}.tar.lz"
  20. # Build instructions
  21. cd binutils-${version}
  22. # Build in a separate directory
  23. rm -rf ../binutils-build
  24. mkdir ../binutils-build
  25. cd ../binutils-build
  26. # Import and export toolchain variables
  27. . "${worktree}/stages/env.d/cross-staticenv"
  28. ../binutils-${version}/configure \
  29. AR="$AR" AS="$AS" LD="$LD" RANLIB="$RANLIB" READELF="$READELF" STRIP="$STRIP" \
  30. CC="$BTCC" CXX="$BTCXX" \
  31. CFLAGS="$BTCFLAGS" CXXFLAGS="$BTCXXFLAGS" LDFLAGS="$BTLDFLAGS" \
  32. --prefix=/tools \
  33. --libdir=/tools/lib${libSuffix} \
  34. --build=$host \
  35. --host=$target \
  36. --target=$target \
  37. --enable-deterministic-archives \
  38. --enable-64-bit-bfd \
  39. --disable-compressed-debug-sections \
  40. --disable-nls \
  41. --disable-werror \
  42. --disable-ppl-version-check \
  43. --disable-cloog-version-check \
  44. --with-lib-path=/tools/lib \
  45. $multilib_options
  46. make -j${jobs} MAKEINFO="true"
  47. make -j${jobs} MAKEINFO="true" install
  48. # Make a new ld(1) containing another search path,
  49. # this is handled by 16-toolchain (called from musl's recipe)
  50. make -C ld clean
  51. make -C ld LIB_PATH=/usr/lib${libSuffix}:/lib
  52. cp -f ld/ld-new /tools/bin
  53. # Unset some imported variables from file
  54. unset AR AS LD RANLIB READELF STRIP
  55. cleanup()
  56. {
  57. cd -- "$TMPDIR" && rm -rf binutils-${version}
  58. }