⛏️ index : buildtools.git

author Oliver Tappe <zooey@hirschkaefer.de> 2011-03-01 16:04:07.0 +00:00:00
committer Ingo Weinhold <ingo_weinhold@gmx.de> 2011-07-17 17:02:43.0 +02:00:00
commit
fa620f65f0b47c25e12ed3b0ae69746a2e5c0356 [patch]
tree
a83af1348868a5a44feaf5a5b402df197897db5e
parent
e68b71f49e44629bc0a5cb7097ab360aecd72047
download
fa620f65f0b47c25e12ed3b0ae69746a2e5c0356.tar.gz

* adjusted for package management

git-svn-id: file:///srv/svn/repos/haiku/buildtools/branches/package-management@40760 a95241bf-73f2-0310-859d-f6bbb57e9c96

Diff

 build-gcc2-optional-package-Haiku.sh | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------
 legacy/compile-binutils              | 12 ++++++++++++
 legacy/compile-gcc                   | 12 ++++++++++++
 3 files changed, 80 insertions(+), 42 deletions(-)

diff --git a/build-gcc2-optional-package-Haiku.sh b/build-gcc2-optional-package-Haiku.sh
index 87b33fc..5f49027 100755
--- a/build-gcc2-optional-package-Haiku.sh
+++ b/build-gcc2-optional-package-Haiku.sh
@@ -1,8 +1,10 @@
#!/bin/sh
# Builds a GCC package from the installation specified by $GCCDATE (or via the
# arguments).
# Usage: build-gcc2-optional-package-Haiku.sh [gcc-base-dir] [version]

packages_build=/boot/common/packages/build

if [ -d "$1" ]; then
	gcc_base=$1
	shift
@@ -26,13 +28,12 @@
fi

current_dir=$(pwd)
base=/boot/develop/abi/x86/gcc2/tools/gcc-2.95.3-haiku-$GCCDATE
base=/boot/common/packages/contents/develop/tools/gcc-2.95.3-$GCCDATE
if [ ! -d "$base" ]; then
	echo GCC directory \"$base\" does not exist!
	exit
fi


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

html_base=$base/html-docs
@@ -74,53 +75,70 @@
	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
	echo "Removing legacy files (man/info/share)..."
	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

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

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

echo "Install C++ includes"
echo "Install C++ includes & library"

rm -rf $base/include/g++
ln -snf /boot/develop/headers/cpp $base/include/g++


### zip archive ###########################################

echo "Building ZIP archive..."

current_gcc=$(setgcc | cut -d/ -f 2)
version_year=20$(echo $GCCDATE | cut -c1-2)
version_month=$(echo $GCCDATE | cut -c3-4)
version_day=$(echo $GCCDATE | cut -c5-6)
zip_name="$current_dir/gcc-2.95.3-x86-$current_gcc-$version_year-$version_month-$version_day.zip"

cd /boot
zip_base=$(echo $base | cut -d/ -f3-)
rm -f $zip_name
zip -yr $zip_name $zip_base

current_name=develop/abi/x86/gcc2/tools/current
ln -snf gcc-2.95.3-haiku-$GCCDATE $current_name
zip -yr $zip_name $current_name


### optional package description ##########################

echo "Package:		GCC
Version:		2.95.3-haiku-$GCCDATE
Copyright:		1988-2000 Free Software Foundation, Inc.
License:		GNU GPL v2
License:		GNU LGPL v2
URL:			http://www.gnu.org/software/gcc/" > /tmp/.OptionalPackageDescription

cd /tmp
zip -yr $zip_name .OptionalPackageDescription
rm .OptionalPackageDescription
ln -snf /boot/system/packages/contents/develop/headers/c++/2.95.3 $base/include/g++

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

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

echo "Building package ..."

cd ${packages_build}
ver=2.95.3_${GCCDATE}
rev=1
while [ -e gcc-2.95.3_${GCCDATE}-$rev ]; do 
	rev=$(expr $rev + 1); 
done
version=$ver-$rev
echo "Version: $version"

mkdir -p gcc-$version/develop/tools
cp -r $base gcc-$version/develop/tools/
cd gcc-$version
cat >.PackageInfo <<ENDOFHERE
	name = gcc
	version = $version
	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 = $ver,
		binutils = 2.17_$GCCDATE
	]
	requires = [
		haiku >= r40675,
		package_management_branch,
		cpp-headers == 2.95.3
	]
ENDOFHERE

mimeset -F .
package create ../gcc-$version.hpkg
cd $current_dir
diff --git a/legacy/compile-binutils b/legacy/compile-binutils
index 9655650..dc9976e 100755
--- a/legacy/compile-binutils
+++ b/legacy/compile-binutils
@@ -1,6 +1,16 @@
#!/bin/bash

if [ -z $GCCDATE ]; then
	echo "need to set GCCDATE environment variable!"
	exit 1
fi 

export BELIBRARIES=/boot/common/packages/contents/lib:/boot/system/packages/contents/develop/lib

mkdir -p binutils-obj
cd binutils-obj
CFLAGS="-O2" CXXFLAGS="-O2" ../binutils/configure --prefix=/boot/develop/tools/gnupro --disable-nls --enable-shared=yes
CFLAGS="-O2" CXXFLAGS="-O2" ../binutils/configure \
	--prefix=/boot/common/packages/contents/develop/tools/gcc-2.95.3-${GCCDATE} \
	--disable-nls --enable-shared=yes
make
cd ..
diff --git a/legacy/compile-gcc b/legacy/compile-gcc
index 8e297e2..e79f474 100755
--- a/legacy/compile-gcc
+++ b/legacy/compile-gcc
@@ -1,6 +1,16 @@
#!/bin/bash

if [ -z $GCCDATE ]; then
	echo "need to set GCCDATE environment variable!"
	exit 1
fi 

export BELIBRARIES=/boot/common/packages/contents/lib:/boot/system/packages/contents/develop/lib

mkdir -p gcc-obj
cd gcc-obj
CFLAGS="-O2" CXXFLAGS="-O2" ../gcc/configure --prefix=/boot/develop/tools/gnupro --disable-nls --enable-shared=yes --enable-languages=c,c++
CFLAGS="-O2" CXXFLAGS="-O2" ../gcc/configure \
	--prefix=/boot/common/packages/contents/develop/tools/gcc-2.95.3-${GCCDATE} \
	--disable-nls --enable-shared=yes --enable-languages=c,c++
make bootstrap
cd ..