123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- # Build recipe for binutils.
- #
- # Copyright (c) 2015-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.
- program=binutils
- version=2.31.1
- release=4
- # Set 'outdir' for a nice and well-organized output directory
- outdir="${outdir}/${arch}/devel"
- tarname=${program}-${version}.tar.lz
- # Remote source(s)
- fetch=http://ftp.gnu.org/gnu/binutils/$tarname
- description="
- The GNU binary utilities.
- Binutils is a collection of programming tools for the manipulation
- of object code in various object file formats. These tools consist
- of the GNU linker (ld), the GNU assembler (as) and the profiler
- (gprof). There is also a collection of other binary tools like
- the disassembler (objdump).
- "
- homepage=http://www.gnu.org/software/binutils
- license="GPLv2+, GPLv3+, LGPLv2, LGPLv3"
- # Source documentation
- docs="COPYING* README"
- docsdir="${docdir}/${program}-${version}"
- # System-dependent
- MACHTYPE="$(cc -dumpmachine)"
- build()
- {
- set -e
- unpack "${tardir}/$tarname"
- cd "$srcdir"
- # Set sane permissions
- chmod -R u+w,go-w,a+rX-s .
- patch -Np1 -i "${worktree}/patches/binutils/branch-updates.diff"
- patch -Np1 -i "${worktree}/patches/binutils/136_bfd_pic.patch"
- # Create a separate build directory
- rm -rf ../binutils-build
- mkdir ../binutils-build
- cd ../binutils-build
- # Set sane permissions
- chmod -R u+w,go-w,a+rX-s .
- ../${program}-${version}/configure \
- CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
- $configure_args \
- $multilib_options \
- --libdir=/usr/lib${libSuffix} \
- --mandir=$mandir \
- --infodir=$infodir \
- --with-docdir=$docsdir \
- --enable-deterministic-archives \
- --enable-shared \
- --enable-gold=yes \
- --enable-ld=default \
- --enable-relro \
- --enable-lto \
- --enable-nls \
- --enable-plugins \
- --enable-threads \
- --enable-64-bit-bfd \
- --enable-targets=i386-efi-pe,x86_64-pep \
- --enable-install-libiberty \
- --disable-werror \
- --disable-compressed-debug-sections \
- --with-system-zlib \
- --build=$MACHTYPE
- make -j${jobs} tooldir=/usr/${MACHTYPE}
- #make -k check
- make -j${jobs} tooldir=/usr/${MACHTYPE} DESTDIR="$destdir" install-strip
- # Back to srcdir
- cd .. && cd "$srcdir"
- # Replace hard-links with relative soft-links for the package size
- (
- cd "${destdir}/usr/bin" && \
- rm -f ld ; ln -sf ld.bfd ld
- )
- (
- cd "${destdir}/usr/${MACHTYPE}/bin" && \
- for file in *
- do
- if test -x "../../bin/$file"
- then
- rm -f "$file" && ln -s "../../bin/$file" .
- fi
- done
- )
- # Compress info documents deleting index file for the package
- if test -d "${destdir}/$infodir"
- then
- rm -f "${destdir}/${infodir}/dir"
- lzip -9 "${destdir}/${infodir}"/*
- fi
- # Compress man pages
- if test -d "${destdir}/$mandir"
- then
- lzip -9 "${destdir}/${mandir}"/man?/*
- fi
- # Copy documentation
- mkdir -p "${destdir}${docsdir}"
- cp -p $docs "${destdir}${docsdir}/"
- # Delete temporary build directory
- cd -- "$TMPDIR"
- if test -d ./binutils-build
- then
- rm -rf ./binutils-build
- fi
- }
|