SUMMARY="The GNU assembler, linker and binary utilities" HOMEPAGE="http://www.gnu.org/software/binutils" SRC_URI="git+git://github.com/haiku/BuildtoolsPM.git#278de7bc9243876c2e08f8d6a243d510c5000462" REVISION="2" ARCHITECTURES="x86_gcc2 ?x86" LICENSE=" GNU GPL v2 GNU LGPL v2 " COPYRIGHT="1988-2006 Free Software Foundation, Inc." PROVIDES=" binutils = $portVersion compat >= 2.17 cmd:addr2line = $portVersion compat >= 2.17 cmd:ar = $portVersion compat >= 2.17 cmd:as = $portVersion compat >= 2.17 cmd:c++filt = $portVersion compat >= 2.17 cmd:gprof = $portVersion compat >= 2.17 cmd:ld = $portVersion compat >= 2.17 cmd:nm = $portVersion compat >= 2.17 cmd:objcopy = $portVersion compat >= 2.17 cmd:objdump = $portVersion compat >= 2.17 cmd:ranlib = $portVersion compat >= 2.17 cmd:readelf = $portVersion compat >= 2.17 cmd:size = $portVersion compat >= 2.17 cmd:strings = $portVersion compat >= 2.17 cmd:strip = $portVersion compat >= 2.17 devel:libbfd = $portVersion compat >= 2.17 devel:libopcodes = $portVersion compat >= 2.17 " REQUIRES=" haiku >= $haikuVersion " BUILD_REQUIRES=" " BUILD_PREREQUIRES=" haiku_devel >= $haikuVersion cmd:autoconf binutils gcc cmd:flex cmd:make cmd:sed cmd:tar texinfo " SOURCE_DIR="$portVersionedName" SOURCE_EXPORT_SUBDIR="legacy/binutils" BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL binutilsDir=$(pwd) relativeArchInstallDir="develop/tools/${portVersionedName}" archInstallDir="$prefix/$relativeArchInstallDir" binutilsObjectsDir=$binutilsDir/../binutils-obj relativeBinutilsDocDir=$relativeDocDir-2.17 binutilsDocDir=$prefix/$relativeBinutilsDocDir BUILD() { rm -rf $binutilsObjectsDir # Touch all *.info files, as newer texinfos don't like their format cd $binutilsDir find . -name \*.info | xargs touch # build binutils mkdir -p $binutilsObjectsDir cd $binutilsObjectsDir CFLAGS="-O2" CXXFLAGS="-O2" "$binutilsDir/configure" \ --prefix=$prefix --exec-prefix=$archInstallDir \ --bindir=$binDir --libdir=$libDir \ --includedir=$includeDir/binutils \ --mandir=$manDir \ --with-htmldir=$relativeBinutilsDocDir \ --disable-nls --enable-shared=yes make } INSTALL() { cd $binutilsObjectsDir archName=$(grep '^target_alias' Makefile | cut -d= -f2) make install make install-html prepareInstalledDevelLibs libbfd libopcodes rm $libDir/libiberty.a # libiberty is only needed for building binutils rmdir $libDir ### HTML documentation #################################### echo "Organizing HTML documentation..." cd $binutilsDocDir mv as.html as ln -sf as/index.html as.html mv bfd.html bfd ln -sf bfd/index.html bfd.html mv binutils.html binutils ln -sf binutils/index.html binutils.html mv gprof.html gprof ln -sf gprof/index.html gprof.html mv ld.html ld ln -sf ld/index.html ld.html rm standards.html ### Strip ################################################# echo "Strip debug info" cd $prefix find bin -type f | xargs -r strip --strip-debug strip --strip-debug lib/*.a strip --strip-debug $archInstallDir/$archName/bin/* ### Symlinks ############################################## echo "Creating required symlinks" # remove duplicate architecture-dependent binaries from $binDir cd $binDir rm ar as ld nm objdump ranlib strip # make all tools available via default paths if these are # the system binutils if [ $targetArchitecture = 'x86_gcc2' ]; then echo "Symlinking binaries into default path" mkdir -p $binDir ln -sfn ../$relativeArchInstallDir/$archName/bin/* . fi ### Cleanup ################################################# echo "Cleanup" cd $prefix rm -rf info } DESCRIPTION=" The GNU Binutils are a collection of binary tools. The main ones are: ld - the GNU linker. as - the GNU assembler. But they also include: addr2line - Converts addresses into filenames and line numbers. ar - A utility for creating, modifying and extracting from archives. c++filt - Filter to demangle encoded C++ symbols. dlltool - Creates files for building and using DLLs. gold - A new, faster, ELF only linker, still in beta test. gprof - Displays profiling information. nlmconv - Converts object code into an NLM. nm - Lists symbols from object files. objcopy - Copys and translates object files. objdump - Displays information from object files. ranlib - Generates an index to the contents of an archive. readelf - Displays information from any ELF format object file. size - Lists the section sizes of an object or archive file. strings - Lists printable strings from files. strip - Discards symbols. windmc - A Windows compatible message compiler. windres - A compiler for Windows resource files. Most of these programs use BFD, the Binary File Descriptor library, to do low-level manipulation. Many of them also use the opcodes library to assemble and disassemble machine instructions. The binutils have been ported to most major Unix variants as well as Wintel systems, and their main reason for existence is to give the GNU system (and GNU/Linux) the facility to compile and link programs. "