⛏️ index : buildtools.git

author Augustin Cavalier <waddlesplash@gmail.com> 2020-05-03 15:47:00.0 -04:00:00
committer Augustin Cavalier <waddlesplash@gmail.com> 2020-05-03 15:47:00.0 -04:00:00
commit
5720e0c88e004f3789631ac03c568e2c9d99d1dd [patch]
tree
153fe9ded9058209a1ae7281122d59367e0c235f
parent
32f9366f9eac1c2ea7d41f067432e636bb735806
download
5720e0c88e004f3789631ac03c568e2c9d99d1dd.tar.gz

Remove obsolete installation guides.



Diff

 INSTALL-as-haiku-cross-compiler-on-LINUX |  20 --------------------
 INSTALL-gcc2-from-source-Haiku           |  52 ----------------------------------------------------
 INSTALL-gcc4-from-source-Haiku           |  44 --------------------------------------------
 build-gcc2-package-Haiku.sh              | 180 --------------------------------------------------------------------------------
 build-gcc4-optional-package-Haiku.sh     | 208 --------------------------------------------------------------------------------
 5 files changed, 504 deletions(-)

diff --git a/INSTALL-as-haiku-cross-compiler-on-LINUX b/INSTALL-as-haiku-cross-compiler-on-LINUX
deleted file mode 100644
index 8d46d26..0000000 100644
--- a/INSTALL-as-haiku-cross-compiler-on-LINUX
+++ /dev/null
@@ -1,20 +1,0 @@
How to create a cross-compiler on LINUX (or any other supported build platform)
for haiku (information is copied from haiku's README):

Please chdir into haiku's base directory (the one where Jamrules and README live).

If you want to build the default (legacy, 2.95.3) gcc, do this:

  $ ./configure --build-cross-tools ../buildtools

One of the last output lines should tell you that the tools have been built
successfully.

If you're not interested in binary compatibility (or want to build for the PowerPC architecture), you can build gcc5 instead by doing this:

  $ ./configure --build-cross-tools <arch> ../buildtools

Replace "<arch>" with either "x86" or "ppc", depending on which of the two
architectures you want to build for.


diff --git a/INSTALL-gcc2-from-source-Haiku b/INSTALL-gcc2-from-source-Haiku
deleted file mode 100644
index 89269ff..0000000 100644
--- a/INSTALL-gcc2-from-source-Haiku
+++ /dev/null
@@ -1,52 +1,0 @@
How to build gcc-2.95.3 for Haiku:

cd into the buildtools/legacy folder

declare the current gcc-version-date like this:
	export GCCDATE=100818
(just use the current date instead of '100818', ie. 'yymmdd')
If your GCC version includes new features, make sure you also alter the
version in gcc/gcc/version.c.

compile binutils:

	mkdir binutils-obj
	cd binutils-obj
	LC_ALL=POSIX CFLAGS="-O2" CXXFLAGS="-O2" ../binutils/configure \
		--prefix=/boot/common/develop/tools/gcc-2.95.3-${GCCDATE} \
		--disable-nls --enable-shared=yes
	LC_ALL=POSIX make
	cd ..


compile gcc:

	mkdir gcc-obj
	cd gcc-obj
	LC_ALL=POSIX CFLAGS="-O2" CXXFLAGS="-O2" ../gcc/configure \
		--prefix=/boot/common/develop/tools/gcc-2.95.3-${GCCDATE} \
		--disable-nls --enable-shared=yes --enable-languages=c,c++
	LC_ALL=POSIX make bootstrap
	# 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
	cd ..

Ok, now everything is compiled and ready, waiting to be packaged:

	mkdir /boot/develop/abi/x86/gcc2/tools/gcc-2.95.3-haiku-${GCCDATE}
	cd binutils-obj
	make install
	cd ..
	cd gcc-obj
	make install
	cd ..
	ln -sfn gcc-2.95.3-haiku-${GCCDATE} /boot/develop/abi/x86/gcc2/tools/current

To build the binutils HTML documentation (needed by the GCC2 package build
script):

	cd binutils-obj
	make install-html
	cd ..

Please send questions & bug-reports to: Oliver Tappe <gcc@hirschkaefer.de>
diff --git a/INSTALL-gcc4-from-source-Haiku b/INSTALL-gcc4-from-source-Haiku
deleted file mode 100644
index 423b3b2..0000000 100644
--- a/INSTALL-gcc4-from-source-Haiku
+++ /dev/null
@@ -1,44 +1,0 @@
How to build gcc-4.5 natively on Haiku:

checkout the buildtools from the haiku repository
cd into the buildtools folder (where this file lives)

declare the current gcc-version-date like this:
	export GCCDATE=110631
	export GCCVERSION=gcc-4.5.3-haiku-${GCCDATE}
(just use the current date instead of '110631' and the current gcc version
instead of '4.5.3')

compile binutils:

	mkdir binutils-obj
	cd binutils-obj
	LC_ALL=POSIX CFLAGS="-O2" CXXFLAGS="-O2" ../binutils/configure \
		--prefix=/boot/develop/abi/x86/gcc4/tools/${GCCVERSION} \
		--disable-nls --enable-shared=yes \
		--with-htmldir=html-docs
	LC_ALL=POSIX make -j2
	cd ..

compile gcc:	

	mkdir gcc-obj
	cd gcc-obj
	LC_ALL=POSIX CFLAGS="-O2" CXXFLAGS="-O2" ../gcc/configure \
		--prefix=/boot/develop/abi/x86/gcc4/tools/${GCCVERSION} \
		--enable-shared --enable-languages=c,c++ \
		--disable-nls --without-libiconv-prefix --disable-libstdcxx-pch \
		--with-htmldir=html-docs
	LC_ALL=POSIX make -j2 bootstrap
	cd ..

Ok, now everything is compiled and ready, waiting to be installed:

	mkdir /boot/develop/abi/x86/gcc4/tools/${GCCVERSION}
	cd binutils-obj
	make install install-html
	cd ../gcc-obj
	make install install-html
	ln -sfn ${GCCVERSION} /boot/develop/abi/x86/gcc4/tools/current
	
Please send questions & bug-reports to: Oliver Tappe <gcc@hirschkaefer.de>
diff --git a/build-gcc2-package-Haiku.sh b/build-gcc2-package-Haiku.sh
deleted file mode 100755
index 75de3c1..0000000 100755
--- a/build-gcc2-package-Haiku.sh
+++ /dev/null
@@ -1,180 +1,0 @@
#!/bin/sh

# Builds a GCC package from the sources.
#
# Usage: build-gcc2-package-Haiku.sh <version date> <release>
#   <version date> must be version date string formatted YYMMDD.
#   <release> must be a number between 1 and 99.

# get version date and release parameters
if [ $# -ne 2 ]; then
	echo "Usage: $0 <version date YYMMDD> <release>" >&2
	exit 1
fi

export GCCDATE=$1
release=$2

# get current dir and buildtools dir
currentDir="$(pwd)/build-gcc-package"
rm -rf "$currentDir"
mkdir "$currentDir"
cd "$(dirname $0)"
buildtoolsDir="$(pwd)/legacy"
cd "$currentDir"

# prepare an install dir with a .PackageInfo
installDir="$currentDir/install"
rm -rf "$installDir"
mkdir "$installDir"

version=2.95.3_${GCCDATE}

packageInfoFile="package-info"

cat > "$packageInfoFile" << ENDOFHERE
	name			gcc
	version			$version-$release
	architecture	x86_gcc2
	summary			"c/c++ compiler"
	description		"standard compiler for x86_gcc2 platform, ABI-compatible with BeOS R5"
	packager		"Oliver Tappe <zooey@hirschkaefer.de>"
	vendor			"Haiku Project"
	copyrights		"1988-2000 Free Software Foundation, Inc."
	licenses {
		"GNU GPL v2"
		"GNU LGPL v2"
	}
	provides {
		gcc = $version compat >= 2.95.3
		binutils = 2.17_$GCCDATE compat >= 2.17
	}
	requires {
		haiku >= r1-alpha3
		haiku-devel >= r1-alpha3
	}
ENDOFHERE

# create a build package
versionedPackageName=gcc-$version-$release
packageFileName="$versionedPackageName-x86_gcc2.hpkg"
packageFile="$currentDir/$packageFileName"

echo "Creating build package..."
package create -b -I "$installDir" -i "$packageInfoFile" $packageFile ||
	exit 1

# activate the package
rm -f /boot/common/packages/$packageFileName
ln -s "$packageFile" /boot/common/packages

finalInstallDir="/packages/$versionedPackageName/.self"

sleep 1

if [ ! -e "$finalInstallDir" ]; then
	echo "Activating the build package failed!"
	exit 1
fi

gccInstallDir="$finalInstallDir/develop/tools/gcc-2.95.3-${GCCDATE}"
mkdir -p "$gccInstallDir"

# build binutils
mkdir binutils-obj
cd binutils-obj
CFLAGS="-O2" CXXFLAGS="-O2" "$buildtoolsDir/binutils/configure" \
	--prefix=$gccInstallDir \
	--disable-nls --enable-shared=yes || exit 1
make || exit 1
make install || exit 1
cd ..

# build gcc
mkdir gcc-obj
cd gcc-obj
CFLAGS="-O2" CXXFLAGS="-O2" "$buildtoolsDir/gcc/configure" \
	--prefix=$gccInstallDir \
	--disable-nls --enable-shared=yes --enable-languages=c,c++ || exit 1
make bootstrap
	# 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 install || exit 1
cd ..


base=$gccInstallDir

### HTML documentation ####################################

html_base=$base/html-docs
if [ ! -d "$html_base" ]; then
	echo "Building HTML documentation..."
	mkdir $html_base
	cd $html_base

	makeinfo --html "$buildtoolsDir/gcc/gcc/cpp.texi"
	makeinfo --html "$buildtoolsDir/gcc/gcc/gcc.texi"
	makeinfo --html "$buildtoolsDir/binutils/libiberty/libiberty.texi"
	makeinfo --force --html "$buildtoolsDir/gcc/libio/iostream.texi"

	ln -sf cpp/index.html $html_base/cpp.html
	ln -sf gcc/index.html $html_base/gcc.html
	ln -sf libiberty/index.html $html_base/libiberty.html
	ln -sf iostream/index.html $html_base/iostream.html
fi
if [ -d "$base/share/doc" ]; then
	echo "Adding binutils HTML documentation..."

	mv $base/share/doc/as.html $html_base/as
	mv $base/share/doc/binutils.html $html_base/binutils
	mv $base/share/doc/gprof.html $html_base/gprof
	mv $base/share/doc/ld.html $html_base/ld
	#mv $base/share/doc/configure.html $html_base/

	ln -sf as/index.html $html_base/as.html
	ln -sf binutils/index.html $html_base/binutils.html
	ln -sf gprof/index.html $html_base/gprof.html
	ln -sf ld/index.html $html_base/ld.html
fi
if [ ! -e "$html_base/as.html" ]; then
	echo "binutils HTML documentation missing, see" \
		"INSTALL-gcc2-from-source-Haiku."
fi

### Cleanup ###############################################

echo "Cleanup"

cd $base/bin
for binary in ../i586-pc-haiku/bin/*; do
	ln -sfn $binary .
done

if [ -d $base/man -o -d $base/info -o -d $base/share ]; then
	rm -rf $base/man
	rm -rf $base/info
	rm -rf $base/share
fi

rm -f $base/lib/gcc-lib/i586-pc-haiku/2.95.3-haiku-$GCCDATE/include/math.h

### C++ includes ######################################

echo "Install C++ includes & library"

rm -rf $base/include/g++
ln -snf /boot/system/develop/headers/c++/2.95.3 $base/include/g++

ln -snf /boot/system/lib/libstdc++.r4.so $base/lib/
ln -snf /boot/system/lib/libstdc++.so $base/lib/

### package ###########################################

echo "Building package ..."

cd "$currentDir"
mimeset -F "$installDir"
package create -C "$installDir" -i "$packageInfoFile" $packageFile || exit 1

echo "Built package $packageInfoFile successfully."
diff --git a/build-gcc4-optional-package-Haiku.sh b/build-gcc4-optional-package-Haiku.sh
deleted file mode 100755
index 5c3c934..0000000 100755
--- a/build-gcc4-optional-package-Haiku.sh
+++ /dev/null
@@ -1,208 +1,0 @@
#!/bin/sh
#
# Builds an GCC (optional) package from the sources.

usage()
{
	echo "Usage: $0 [ <options> ] <gcc date>"
}


# get the relevant directories
currentDir=`pwd`
cd `dirname "$0"`
buildtoolsDir=`pwd`
cd "$currentDir"

binutilsSources="$buildtoolsDir/binutils"
gccSources="$buildtoolsDir/gcc"

buildDir="$currentDir/gcc-objects"
binutilsBuildDir="$buildDir/binutils"
gccBuildDir="$buildDir/gcc"
targetArch=x86
gccMakeTarget=bootstrap
gccConfigureArgs="--enable-shared"
binutilsConfigureArgs="--enable-shared"

# parse the arguments
jobArgs=
while [ $# -gt 0 ]; do
	case "$1" in

		-h|--help)	usage; exit 0;;
		-j*)		jobArgs="$1"; shift 1;;
		--arch)
			case "$2" in

				x86)	HAIKU_GCC_MACHINE=i586-pc-haiku;;
				x86_64)	HAIKU_GCC_MACHINE=x86_64-unknown-haiku; targetArch=x86_64;;
				ppc)	HAIKU_GCC_MACHINE=powerpc-apple-haiku; targetArch=ppc;
						gccMakeTarget= gccConfigureArgs="--disable-shared --disable-multilib"
						binutilsConfigureArgs="--disable-shared --disable-multilib" ;;
				m68k)	HAIKU_GCC_MACHINE=m68k-unknown-haiku; targetArch=m68k;
						gccMakeTarget= gccConfigureArgs="--disable-shared --disable-multilib"
						binutilsConfigureArgs="--disable-shared --disable-multilib" ;;
				arm)	HAIKU_GCC_MACHINE=arm-unknown-haiku; targetArch=arm;
						gccMakeTarget= gccConfigureArgs="--disable-shared --disable-multilib"
						binutilsConfigureArgs="--disable-shared --disable-multilib" ;;
				mipsel)	HAIKU_GCC_MACHINE=mipsel-unknown-haiku; targetArch=mips;
						gccMakeTarget= gccConfigureArgs="--disable-shared --disable-multilib"
						binutilsConfigureArgs="--disable-shared --disable-multilib" ;;
				*)		echo "Unsupported target architecture: $2"
						exit 1;;
			esac
			shift 2
			targetCrossToolsMachine="--target=${HAIKU_GCC_MACHINE}";;
		--source-dir)	haikuSourceDir="$2"; shift 2;;
		*)			break;;
	esac
done

# get the GCC date
if [ $# -ne 1 ]; then
	usage >&2
	exit 1
fi

gccDate=$1

case "$gccDate" in

	[0-9][0-9][0-9][0-9][0-9][0-9])	true;;
	*)	echo "Invalid GCC date string '$gccDate'." >&2; exit 1;;
esac

# get the GCC version
gccVersion=`cat $gccSources/gcc/BASE-VER`
if [ -z "$gccVersion" ]; then
	echo "Failed to get GCC version." >&2
	exit 1
fi

gccVersionedName=gcc-${gccVersion}-haiku-${gccDate}


# check whether the installation dir does already exit
installDir=/boot/develop/abi/$targetArch/gcc4/tools/$gccVersionedName
if [ -e "$installDir" ]; then
	echo "The installation directory '$installDir' does already exist." >&2
	echo "Remove it first." >&2
	exit 1
fi


# print some info before we start the action
echo "Building binutils and gcc optional packages from the source."
echo "sources:     $buildtoolsDir"
echo "build dir:   $buildDir"
echo "target arch: $targetArch"
echo "GCC date:    $gccDate"
echo "GCC version: $gccVersion"
echo "install dir: $installDir"
echo
echo "This is going to take a while ..."
sleep 3

# From now on fail, if anything goes wrong.
set -o errexit


# forcefeed the POSIX locale, as the build (makeinfo) might choke otherwise
export LC_ALL=POSIX

# remove and recreate the build directories
rm -rf "$buildDir"
mkdir -p "$binutilsBuildDir" "$gccBuildDir"


# build and install the binutils
cd "$binutilsBuildDir"
CFLAGS="-O2" CXXFLAGS="-O2" "$binutilsSources/configure" \
	--prefix="$installDir" $targetCrossToolsMachine --disable-nls \
	$binutilsConfigureArgs --with-htmldir=html-docs
make $jobArgs
make install install-html

# prepare the include files
copy_headers()
{
	sourceDir=$1
	targetDir=$2

	headers="$(find $sourceDir -name \*\.h | grep -v /.svn)"
	headers="$(echo $headers | sed -e s@$sourceDir/@@g)"
	for f in $headers; do
		headerTargetDir=$targetDir/$(dirname $f)
		mkdir -p $headerTargetDir
		cp $sourceDir/$f $headerTargetDir
	done
}

if [ -n "$haikuSourceDir" ]; then
	tmpIncludeDir=$currentDir/sysincludes
	tmpLibDir=$currentDir/syslibs
	mkdir -p $tmpIncludeDir $tmpLibDir
	copy_headers $haikuSourceDir/headers/config $tmpIncludeDir/config
	copy_headers $haikuSourceDir/headers/os $tmpIncludeDir/os
	copy_headers $haikuSourceDir/headers/posix $tmpIncludeDir/posix
	headersLibsArgs="--with-headers=$tmpIncludeDir --with-libs=$tmpLibDir"
fi

# build and install gcc
cd "$gccBuildDir"
CFLAGS="-O2" CXXFLAGS="-O2" "$gccSources/configure" \
	--prefix="$installDir" $gccConfigureArgs --enable-languages=c,c++ \
	$targetCrossToolsMachine --disable-nls --without-libiconv-prefix \
	--disable-libstdcxx-pch --with-htmldir=html-docs --enable-lto \
	--enable-frame-pointer $headersLibsArgs
make $jobArgs $gccMakeTarget
make install-strip install-html


# remove installed stuff we don't want
rm -rf "$installDir/info" "$installDir/man" "$installDir/share" \
	"$installDir/lib/libstdc++.so"


# strip the executables of debug info (somewhat crude heuristics to identify
# actual executables: files >= 20 kiB with execute permission and not in a "lib"
# directory)
strip --strip-debug \
	`find "$installDir" -type f -a -perm -u=x -a -size +20k | grep -v /lib/`


# add C++ header symlink
ln -s c++/$gccVersion $installDir/include/g++


# zip everything up
gccVersionYear=20$(echo $gccDate | cut -c1-2)
gccVersionMonth=$(echo $gccDate | cut -c3-4)
gccVersionDay=$(echo $gccDate | cut -c5-6)
packageFile="$currentDir/gcc-${gccVersion}-${targetArch}-gcc4-${gccVersionYear}-${gccVersionMonth}-${gccVersionDay}.zip"

cd /boot
zip -ry "$packageFile" `echo $installDir | cut -d/ -f3-`


# add the "current" version symlink
cd "$buildDir"
mkdir -p develop/abi/$targetArch/gcc4/tools/
ln -s $gccVersionedName develop/abi/$targetArch/gcc4/tools/current
zip -y "$packageFile" develop/abi/$targetArch/gcc4/tools/current


# add the optional package description
cd "$buildDir"
echo "Package:		GCC
Version:		${gccVersion}-${targetArch}-haiku-${gccDate}
Copyright:		1988-2012 Free Software Foundation, Inc.
License:		GNU GPL v3
License:		GNU LGPL v3
URL:			http://www.gnu.org/software/gcc/
" > .OptionalPackageDescription

zip "$packageFile" .OptionalPackageDescription


# clean up
cd "$currentDir"
rm -rf "$buildDir"