From e554a19c517b09b1773a4e5f83b39fbab34c7129 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 11 Aug 2013 18:48:51 +0200 Subject: [PATCH] binutils/gcc 2: change directory layout * The files are no longer installed in a separate develop/tools subdirectory for binutils and one for gcc. Instead we install directly in develop/tools[/]. This allows gcc to find gas and ld via its built-in search instead of via PATH only. In a hybrid setup this makes a difference, when the gcc that is not the first in PATH is invoked directly (e.g. via absolute path). * Add support for building for the secondary architecture. Not tested yet. --- .../binutils/binutils-2.17_2013_04_21.recipe | 105 +++++++++--------- sys-devel/gcc/gcc-2.95.3_2013_05_04.recipe | 51 ++++----- 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/sys-devel/binutils/binutils-2.17_2013_04_21.recipe b/sys-devel/binutils/binutils-2.17_2013_04_21.recipe index 6b24bb4ed..b2db590e1 100644 --- a/sys-devel/binutils/binutils-2.17_2013_04_21.recipe +++ b/sys-devel/binutils/binutils-2.17_2013_04_21.recipe @@ -1,45 +1,49 @@ SUMMARY="The GNU assembler, linker and binary utilities" HOMEPAGE="http://www.gnu.org/software/binutils" SRC_URI="git+git://github.com/haiku/BuildtoolsPM.git#ab0f66e" -REVISION="1" -ARCHITECTURES="x86_gcc2 ?x86" +REVISION="2" LICENSE=" GNU GPL v2 GNU LGPL v2 " COPYRIGHT="1988-2006 Free Software Foundation, Inc." +ARCHITECTURES="x86_gcc2" +if [ $effectiveTargetArchitecture = x86_gcc2 -a $targetArchitecture = x86 ] +then + ARCHITECTURES="$ARCHITECTURES x86" +fi +SECONDARY_ARCHITECTURES="x86_gcc2" + 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 + binutils$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:addr2line$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:ar$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:as$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:c++filt$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:gprof$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:ld$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:nm$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:objcopy$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:objdump$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:ranlib$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:readelf$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:size$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:strings$secondaryArchSuffix = $portVersion compat >= 2.17 + cmd:strip$secondaryArchSuffix = $portVersion compat >= 2.17 " REQUIRES=" - haiku >= $haikuVersion + haiku$secondaryArchSuffix >= $haikuVersion " BUILD_REQUIRES=" " BUILD_PREREQUIRES=" - haiku_devel >= $haikuVersion + haiku${secondaryArchSuffix}_devel >= $haikuVersion cmd:autoconf cmd:flex - cmd:gcc - cmd:ld + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix cmd:make cmd:makeinfo cmd:sed @@ -50,11 +54,9 @@ SOURCE_DIR="$portVersionedName/legacy/binutils" BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL binutilsDir=$(pwd) -relativeArchInstallDir="develop/tools/${portVersionedName}" -archInstallDir="$prefix/$relativeArchInstallDir" +relativeInstallDir="develop/tools$secondaryArchSubDir" +installDir="$prefix/$relativeInstallDir" binutilsObjectsDir=$binutilsDir/../binutils-obj -relativeBinutilsDocDir=$relativeDocDir-2.17 -binutilsDocDir=$prefix/$relativeBinutilsDocDir BUILD() { @@ -67,12 +69,11 @@ BUILD() # build binutils mkdir -p $binutilsObjectsDir cd $binutilsObjectsDir - CFLAGS="-O2" CXXFLAGS="-O2" "$binutilsDir/configure" \ - --prefix=$prefix --exec-prefix=$archInstallDir \ - --bindir=$binDir --libdir=$libDir \ + CFLAGS="-O2" CXXFLAGS="-O2" runConfigure --omit-dirs "docDir dataRootDir" \ + "$binutilsDir/configure" \ + --exec-prefix=$installDir \ --includedir=$includeDir/binutils \ - --mandir=$manDir \ - --with-htmldir=$relativeBinutilsDocDir \ + --with-htmldir=$relativeDocDir \ --disable-nls --enable-shared=yes make } @@ -85,15 +86,14 @@ INSTALL() make install make install-html - prepareInstalledDevelLibs libbfd libopcodes - rm $libDir/libiberty.a - # libiberty is only needed for building binutils - rmdir $libDir + # Remove the development libraries and headers. Nobody uses those anyway. + rm -r $libDir + rm -r $developDir/headers ### HTML documentation #################################### echo "Organizing HTML documentation..." - cd $binutilsDocDir + cd $docDir mv as.html as ln -sf as/index.html as.html @@ -105,7 +105,10 @@ INSTALL() ln -sf gprof/index.html gprof.html mv ld.html ld ln -sf ld/index.html ld.html - rm standards.html + rm libiberty.html standards.html + + # no info documentation + rm -r $infoDir ### Strip ################################################# @@ -113,31 +116,27 @@ INSTALL() cd $prefix find bin -type f | xargs -r strip --strip-debug - strip --strip-debug lib/*.a - strip --strip-debug $archInstallDir/$archName/bin/* + strip --strip-debug $installDir/$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 + # There are copies of a subset of the commands below installDir. We + # overwrite those with symlinks to the ones in binDir. + for file in $installDir/i586-pc-haiku/bin/*; do + symlinkRelative -sfn $binDir/$(basename $file) $file + done ### Cleanup ################################################# echo "Cleanup" - cd $prefix - rm -rf info + # delete man pages for commands that we aren't including + cd $manDir + for cmd in dlltool nlmconv windmc windres; do + rm -f man1/$cmd.1 + done } DESCRIPTION=" diff --git a/sys-devel/gcc/gcc-2.95.3_2013_05_04.recipe b/sys-devel/gcc/gcc-2.95.3_2013_05_04.recipe index 1401edccf..d95b4638f 100644 --- a/sys-devel/gcc/gcc-2.95.3_2013_05_04.recipe +++ b/sys-devel/gcc/gcc-2.95.3_2013_05_04.recipe @@ -10,33 +10,38 @@ SRC_URI=" git+file://$portBaseDir/../binutils/download/BuildtoolsPM.git#b1ef802 git+git://github.com/haiku/BuildtoolsPM.git#b1ef802 " -REVISION="1" -ARCHITECTURES="x86_gcc2 ?x86" +REVISION="2" +ARCHITECTURES="x86_gcc2" +if [ $effectiveTargetArchitecture = x86_gcc2 -a $targetArchitecture = x86 ] +then + ARCHITECTURES="$ARCHITECTURES x86" +fi +SECONDARY_ARCHITECTURES="x86_gcc2" PROVIDES=" gcc = $portVersion compat >= 2.95.3 - cmd:cc - cmd:c++ = $portVersion compat >= 2.95.3 - cmd:c++filt = $portVersion compat >= 2.95.3 - cmd:cpp = $portVersion compat >= 2.95.3 - cmd:g++ = $portVersion compat >= 2.95.3 - cmd:gcc = $portVersion compat >= 2.95.3 - cmd:gcov = 1.5 compat >= 1.5 - cmd:i586_pc_haiku_gcc = $portVersion compat >= 2.95.3 - cmd:protoize = $portVersion compat >= 2.95.3 - cmd:unprotoize = $portVersion compat >= 2.95.3 + cmd:cc$secondaryArchSuffix + cmd:c++$secondaryArchSuffix = $portVersion compat >= 2.95.3 + cmd:c++filt$secondaryArchSuffix = $portVersion compat >= 2.95.3 + cmd:cpp$secondaryArchSuffix = $portVersion compat >= 2.95.3 + cmd:g++$secondaryArchSuffix = $portVersion compat >= 2.95.3 + cmd:gcc$secondaryArchSuffix = $portVersion compat >= 2.95.3 + cmd:gcov$secondaryArchSuffix = 1.5 compat >= 1.5 + cmd:i586_pc_haiku_gcc$secondaryArchSuffix = $portVersion compat >= 2.95.3 + cmd:protoize$secondaryArchSuffix = $portVersion compat >= 2.95.3 + cmd:unprotoize$secondaryArchSuffix = $portVersion compat >= 2.95.3 " REQUIRES=" - haiku >= $haikuVersion - binutils + haiku$secondaryArchSuffix >= $haikuVersion + binutils$secondaryArchSuffix " BUILD_REQUIRES=" " BUILD_PREREQUIRES=" - haiku_devel >= $haikuVersion + haiku${secondaryArchSuffix}_devel >= $haikuVersion cmd:autoconf - gcc + gcc$secondaryArchSuffix cmd:flex cmd:make cmd:sed @@ -49,10 +54,9 @@ BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL gccDir=$(pwd) gccDate=$(echo $portVersion | sed 's,.*_,,') -relativeGccInstallDir="develop/tools/gcc-2.95.3_${gccDate}" +relativeGccInstallDir="develop/tools$secondaryArchSubDir" gccInstallDir="$prefix/$relativeGccInstallDir" gccObjectsDir=$gccDir/../gcc-obj -gccDocDir=$docDir-2.95.3 BUILD() { @@ -61,7 +65,7 @@ BUILD() # Touch some files generated by bison, so that bison won't run to update # them. Fixes issues with newer bison versions. # And while at it, touch gperf target, too (as gperf may not be installed). - (cd $gccDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ + (cd gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ cp/parse.h c-gperf.h) # build gcc @@ -70,10 +74,7 @@ BUILD() CFLAGS="-O2" CXXFLAGS="-O2" "$gccDir/configure" \ --prefix=$gccInstallDir \ --disable-nls --enable-shared=yes --enable-languages=c,c++ - make bootstrap || true - # The above will fail when compiling builtinbuf.cc, but we can ignore - # that since it's trying to build libstdc++.so, which haiku provides - # anyway. + make bootstrap } INSTALL() @@ -88,7 +89,7 @@ INSTALL() ### HTML documentation #################################### - html_base=$gccDocDir + html_base=$docDir if [ ! -d "$html_base" ]; then echo "Building HTML documentation..." mkdir -p $html_base @@ -120,7 +121,7 @@ INSTALL() if [ $targetArchitecture = 'x86_gcc2' ]; then echo "Symlinking binaries into default path" mkdir -p $prefix/bin - cd $prefix/bin + cd $binDir ln -sfn ../$relativeGccInstallDir/bin/* . fi