From 79b87c34c990c46cbcd36cf3d28f476636d54ea9 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 14 Oct 2014 21:58:47 +0200 Subject: [PATCH] Update recipe for gcc2 * Provides devel:libgcc in gcc_syslibs, that was previously missing * Includes the fixed LDBL_MIN/MAX/EPSILON constants --- sys-devel/gcc/gcc-2.95.3_2014_10_14.recipe | 194 +++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sys-devel/gcc/gcc-2.95.3_2014_10_14.recipe diff --git a/sys-devel/gcc/gcc-2.95.3_2014_10_14.recipe b/sys-devel/gcc/gcc-2.95.3_2014_10_14.recipe new file mode 100644 index 000000000..48c237f39 --- /dev/null +++ b/sys-devel/gcc/gcc-2.95.3_2014_10_14.recipe @@ -0,0 +1,194 @@ +SUMMARY="C/C++ compiler" +DESCRIPTION=" +Standard compiler for x86_gcc2 platform, ABI-compatible with BeOS R5. +" +HOMEPAGE="http://gcc.gnu.org" +LICENSE=" + GNU GPL v2 + GNU LGPL v2 + " +COPYRIGHT="1988-2000 Free Software Foundation, Inc." +srcGitRev="4319c0ca135067023f5c209280715355b2391842" +SRC_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz" +CHECKSUM_SHA256="dd2ab0d1dce85012d61946810541b43c82f247cc1eb04a76d1578b31f98a334d" +REVISION="1" +ARCHITECTURES="x86_gcc2" +if [ $effectiveTargetArchitecture = x86_gcc2 -a $targetArchitecture = x86 ] +then + ARCHITECTURES="$ARCHITECTURES x86" +fi +SECONDARY_ARCHITECTURES="x86_gcc2" + +PROVIDES=" + gcc$secondaryArchSuffix = $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$secondaryArchSuffix >= $haikuVersion + binutils$secondaryArchSuffix + " +BUILD_REQUIRES=" + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + cmd:autoconf + gcc$secondaryArchSuffix + cmd:find + cmd:flex + cmd:make + cmd:sed + cmd:tar + cmd:makeinfo + " + +SOURCE_DIR="buildtools-$srcGitRev/legacy/gcc" +BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL + +gccDir=$(pwd) +relativeGccInstallDir="develop/tools$secondaryArchSubDir" +gccInstallDir="$prefix/$relativeGccInstallDir" +gccObjectsDir=$gccDir/../gcc-obj + +BUILD() +{ + rm -rf $gccObjectsDir + + # 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 gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \ + cp/parse.h c-gperf.h) + + mkdir -p $gccObjectsDir + cd $gccObjectsDir + + local additionalConfigureFlags + if [ -n "$secondaryArchSuffix" ]; then + additionalConfigureFlags="\ + --with-hybrid-secondary=${effectiveTargetArchitecture}" + fi + + CFLAGS="-O2" CXXFLAGS="-O2" "$gccDir/configure" \ + --prefix=$gccInstallDir \ + --disable-nls --enable-shared --enable-languages=c,c++ \ + $additionalConfigureFlags + make bootstrap +} + +INSTALL() +{ + cd $gccObjectsDir + make install + + rm $gccInstallDir/lib/libiberty.a + # only needed for building gcc + + ### HTML documentation #################################### + + local html_base=$docDir + if [ ! -d "$html_base" ]; then + echo "Building HTML documentation..." + mkdir -p $html_base + cd $html_base + + makeinfo --html "$gccDir/gcc/cpp.texi" + makeinfo --html "$gccDir/gcc/gcc.texi" + makeinfo --force --html "$gccDir/libio/iostream.texi" \ + && true + # some errors + + ln -sf cpp/index.html $html_base/cpp.html + ln -sf gcc/index.html $html_base/gcc.html + ln -sf iostream/index.html $html_base/iostream.html + fi + + ### Symlinks ############################################## + + echo "Creating required symlinks" + + # convert to absolute links to relative ones + cd $gccInstallDir/bin + ln -sfn g++ c++ + ln -sfn gcc cc + ln -sfn gcc $effectiveTargetMachineTriple-gcc + + # make all tools available via default paths + echo "Symlinking binaries into default path" + mkdir -p $binDir + symlinkRelative -s $gccInstallDir/bin/* $binDir + + ### Libraries ############################################# + + echo "Moving libraries around" + + # Move/copy libraries such that copies of static libraries (libgcc.a) + # exist in $developLibDir. These are put into a separate package + # (gcc_syslibs_devel), which is used by Haiku's build system. + mkdir -p $libDir + mkdir -p $developLibDir + cd $gccInstallDir + gccLibDir=lib/gcc-lib/$effectiveTargetMachineTriple/2.95.3-* + + # libgcc + cp $gccLibDir/libgcc.a $developLibDir/ + + ### Strip ################################################# + + echo "Strip debug info" + + cd $gccInstallDir + strip --strip-debug bin/* + strip --strip-debug $gccLibDir/* &>/dev/null || true + + ### Cleanup ############################################### + + echo "Cleanup" + + cd $gccInstallDir + rm -rf info + rm -rf share + rm man/man1/cccp.1 + + ### C++ includes ########################################## + + echo "Install C++ includes & library" + + rm -rf $gccInstallDir/include/g++ + ln -snf /boot/system/develop/headers/c++/2.95.3 $gccInstallDir/include/g++ + + ln -snf /boot/system/lib$secondaryArchSubDir/libstdc++.r4.so $gccInstallDir/lib/ + + ### Sub Packages ########################################## + + packageEntries "syslibs_devel" \ + $relativeDevelopLibDir/libgcc.a + + rm -rf $libDir + rm -rf $developLibDir +} + +# ----- syslibs_devel package ----------------------------------------------- + +SUMMARY_syslibs_devel="\ +GCC c/c++-runtime static libraries, needed to build Haiku" +DESCRIPTION_syslibs_devel="\ +This package is not of general interest - it contains the set of gcc's c/c++-\ +runtime libraries that is required by Haiku's build system when building \ +Haiku." + +PROVIDES_syslibs_devel=" + gcc_syslibs_devel$secondaryArchSuffix = $portVersion compat >= 2.95.3 + devel:libgcc + " + +REQUIRES_syslibs_devel=""