12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- # Build script for binutils.
- #
- # Copyright (c) 2014-2018 Matias Fonzo, <selk@dragora.org>.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- version=2.30
- cd -- "$TMPDIR"
- rm -rf binutils-${version}
- unpack "${worktree}/sources/binutils-${version}.tar.lz"
- # Build instructions
- cd binutils-${version}
- # Build in a separate directory
- rm -rf ../binutils-build
- mkdir ../binutils-build
- cd ../binutils-build
- # Import and export toolchain variables
- . "${worktree}/stages/env.d/cross-staticenv"
- ../binutils-${version}/configure \
- AR="$AR" AS="$AS" LD="$LD" RANLIB="$RANLIB" READELF="$READELF" STRIP="$STRIP" \
- CC="$BTCC" CXX="$BTCXX" \
- CFLAGS="$BTCFLAGS" CXXFLAGS="$BTCXXFLAGS" LDFLAGS="$BTLDFLAGS" \
- --prefix=/tools \
- --libdir=/tools/lib${libSuffix} \
- --build=$host \
- --host=$target \
- --target=$target \
- --enable-deterministic-archives \
- --enable-64-bit-bfd \
- --disable-compressed-debug-sections \
- --disable-nls \
- --disable-werror \
- --disable-ppl-version-check \
- --disable-cloog-version-check \
- --with-lib-path=/tools/lib \
- $multilib_options
- make -j${jobs} MAKEINFO="true"
- make -j${jobs} MAKEINFO="true" install
- # Make a new ld(1) containing another search path,
- # this is handled by 16-toolchain (called from musl's recipe)
- make -C ld clean
- make -C ld LIB_PATH=/usr/lib${libSuffix}:/lib
- cp -f ld/ld-new /tools/bin
- # Unset some imported variables from file
- unset AR AS LD RANLIB READELF STRIP
- cleanup()
- {
- cd -- "$TMPDIR" && rm -rf binutils-${version}
- }
|