added 4 changesets to branch 'refs/remotes/HaikuPM-github/package-management' old head: 555b02d34587e4d5b3295771b00cf48859e1c776 new head: f56958c140a47e37386b366dbbc2650d527a15bc overview: https://github.com/haiku/HaikuPM/compare/555b02d...f56958c ---------------------------------------------------------------------------- b57470a: Remove setgcc 483b28e: Add option --target-arch On Haiku it allows to specify the target architecture to build for using one of the installed native compilers. 4e822fe: HaikuPorts/x86_gcc2: Update gcc and binutils Also add secondary architecture packages. f56958c: Add development packages for the secondary architecture [ Ingo Weinhold <ingo_weinhold@xxxxxx> ] ---------------------------------------------------------------------------- 5 files changed, 107 insertions(+), 112 deletions(-) build/jam/OptionalPackages | 18 +++-- build/jam/packages/HaikuDevel | 5 -- build/jam/repositories/HaikuPorts/x86_gcc2 | 8 ++- configure | 89 ++++++++++++++++++++++- data/bin/setgcc | 99 -------------------------- ############################################################################ Commit: b57470a2179ca208ea910422db1ab2881575b69d Author: Ingo Weinhold <ingo_weinhold@xxxxxx> Date: Mon Aug 12 13:53:50 2013 UTC Remove setgcc ---------------------------------------------------------------------------- diff --git a/build/jam/packages/HaikuDevel b/build/jam/packages/HaikuDevel index f2639fa..deb21e7 100644 --- a/build/jam/packages/HaikuDevel +++ b/build/jam/packages/HaikuDevel @@ -42,11 +42,6 @@ AddFilesToPackage develop lib : libposix_error_mapper.a ; # ABI independent stuff -# scripts: setgcc -local scripts = setgcc ; -SEARCH on $(scripts) = [ FDirName $(HAIKU_TOP) data bin ] ; -AddFilesToPackage bin : $(scripts) ; - # headers AddHeaderDirectoryToPackage config ; AddHeaderDirectoryToPackage glibc ; diff --git a/data/bin/setgcc b/data/bin/setgcc deleted file mode 100755 index 0ff216a..0000000 --- a/data/bin/setgcc +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/sh -# -# setgcc [ <arch> ] [ <gcc> ] - -abiDir=/boot/develop/abi -abiLink=$abiDir/current -libDir=/boot/develop/lib - -usage() -{ - cat << EOF -Usage: $0 [ <arch> ] [ <gcc> ] - -Sets the current gcc version, respectively prints it, if no arguments are -given. - - <arch> - The architecture to set. Supported values: "x86", "ppc". - <gcc> - The major gcc version to set. Supported values: "gcc2", "gcc4". - -EOF -} - -if [ $# -gt 2 ]; then - usage - exit 1 -fi - -if [ $# -eq 0 ]; then - if [ -h $abiLink ]; then - abi=$(readlink $abiLink 2> /dev/null) || { - echo "Failed to read GCC symlink." >&2 - exit 1 - } - echo "Current GCC: $abi" - exit - else - echo "GCC symlink not installed." >&2 - exit 1 - fi -fi - -arch= -gcc= - -# parse the args -while [ $# -gt 0 ]; do - case $1 in - -h,--help) usage; exit;; - x86) arch=$1;; - ppc) arch=$1;; - gcc2|gcc4) gcc=$1;; - *) usage; exit 1;; - esac - - shift -done - -# use the native arch, if not given -if [ -z "$arch" ]; then - case $(uname -m) in - BePC) arch=x86;; - *) echo "Can't guess native architecture. Please specify!" >&2 - exit 1;; - esac -fi - -# guess the native gcc version, if not given -if [ -z "$gcc" ]; then - if [ -e /system/lib/gcc2 ]; then - gcc=gcc4 - elif [ -e /system/lib/gcc4 ]; then - gcc=gcc2 - elif [ -e /system/lib/libstdc++.r4.so ]; then - gcc=gcc2 - else - echo "Can't guess native GCC version. Please specify!" >&2 - exit 1 - fi -fi - -# check whether the gcc exists -count=`ls -l $abiDir/$arch/$gcc/tools/current/bin/*gcc 2>/dev/null | wc -l` -if [ $count -eq 0 ]; then - echo "Can't set GCC $arch/$gcc -- not installed." >&2 - exit 1 -fi - -# create the symlink -( rm $abiLink && ln -sf $arch/$gcc $abiLink ) || { - echo "Failed to set GCC $arch/$gcc." >&2 - exit 1 -} - -# create the lib symlink -libLink=$libDir/$arch -( rm -f $libLink && ln -sf $abiDir/$arch/$gcc/lib $libLink ) || { - echo "Failed to set lib $arch/$gcc." >&2 - exit 1 -} ############################################################################ Commit: 483b28e478b142d429975d49e805afcc03a32b0d Author: Ingo Weinhold <ingo_weinhold@xxxxxx> Date: Mon Aug 12 15:18:02 2013 UTC Add option --target-arch On Haiku it allows to specify the target architecture to build for using one of the installed native compilers. ---------------------------------------------------------------------------- diff --git a/configure b/configure index 6cfdbae..023e444 100755 --- a/configure +++ b/configure @@ -75,6 +75,14 @@ options: --target=TARGET Select build target platform. [default=${TARGET_PLATFORM}] valid targets=r5,bone,dano,haiku + --target-arch <arch> Haiku only: Specify the target architecture to + build for. Must be one of the architectures of the + host system. The installed build tools for that + architecture will be used. + This option can be specified multiple times. The + first occurrence specifies the primary + architecture of the Haiku to build, subsequent + ones the secondary architectures. --update re-runs last configure invocation [must be given as first option!] --use-gcc-pipe Build with GCC option -pipe. Speeds up the build @@ -409,6 +417,17 @@ get_build_tool_path() eval "$var=$path" } +is_in_list() +{ + local element + for element in $2; do + if [ "$1" = "$element" ]; then + return 0 + fi + done + return 1 +} + # get cwd and the source directory currentDir=`pwd` cd `dirname "$0"` @@ -428,6 +447,7 @@ buildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools" buildCrossToolsJobs= useGccGraphiteDefault=0 unknownArchIndex=1 +haikuTargetArchs= # exported (BuildSetup) default parameter values # @@ -467,9 +487,18 @@ else exit 1 fi -haikuRequiredLegacyGCCVersion="2.95.3-haiku-2013_07_15" +haikuRequiredLegacyGCCVersion="2.95.3-haiku-2013_08_12" export haikuRequiredLegacyGCCVersion # version of legacy gcc required to build haiku +supportedTargetArchs=" + arm + m68k + mipsel + ppc + x86 + x86_64 + x86_gcc2 + " # determine output directory if [ "$currentDir" = "$sourceDir" ]; then @@ -570,6 +599,20 @@ while [ $# -gt 0 ] ; do --include-3rdparty) HAIKU_INCLUDE_3RDPARTY=1; shift 1;; -j*) buildCrossToolsJobs="$1"; shift 1;; --target=*) TARGET_PLATFORM=`echo $1 | cut -d'=' -f2-`; shift 1;; + --target-arch) + assertparam "$1" $# + targetArch=$2 + shift 2 + if [ ! "$platform" = Haiku ]; then + echo "--target-arch can only be specified on Haiku." >&2 + exit 1 + fi + is_in_list "$targetArch" "$supportedTargetArchs" || ( + echo "Unsupported target architecture: \"$targetArch\"" >&2 + exit 1 + ) + haikuTargetArchs="$haikuTargetArchs $targetArch" + ;; --use-gcc-pipe) HAIKU_USE_GCC_PIPE=1; shift 1;; --use-gcc-graphite) useGccGraphiteDefault=1; shift 1;; --use-32bit) HAIKU_HOST_USE_32BIT=1; shift 1;; @@ -637,9 +680,24 @@ else fi HAIKU_PACKAGING_ARCHS= + # On Haiku determine target architectures and tools automatically. if [ -z "$targetArchs" ]; then - targetArch=x86_gcc2 + if [ $HOST_PLATFORM != haiku_host ]; then + echo "Please specify the build tools to use or build (via" \ + "--cross-tools-prefix or --build-cross-tools) or specify a" + "host-only build (--host-only)." >&2 + exit 1 + fi + + # determine primary architecture + targetArch=`package list -i /system/packages/haiku.hpkg \ + | sed '/^\s*architecture:/!d; s,^\s*architecture:\s*,,'` + is_in_list "$targetArch" "$supportedTargetArchs" || ( + echo "Unsupported target architecture: \"$targetArch\"" >&2 + exit 1 + ) targetArchs=$targetArch + set_default_value HAIKU_AR_$targetArch ar set_default_value HAIKU_CC_$targetArch gcc set_default_value HAIKU_LD_$targetArch ld @@ -647,6 +705,33 @@ else set_default_value HAIKU_RANLIB_$targetArch ranlib set_default_value HAIKU_ELFEDIT_$targetArch elfedit set_default_value HAIKU_STRIP_$targetArch strip + + # determine secondary architectures + for targetArch in $supportedTargetArchs; do + if [ -e /system/packages/haiku_$targetArch.hpkg ]; then + targetArchs="$targetArchs $targetArch" + set_default_value HAIKU_AR_$targetArch ar-$targetArch + set_default_value HAIKU_CC_$targetArch gcc-$targetArch + set_default_value HAIKU_LD_$targetArch ld-$targetArch + set_default_value HAIKU_OBJCOPY_$targetArch objcopy-$targetArch + set_default_value HAIKU_RANLIB_$targetArch ranlib-$targetArch + set_default_value HAIKU_ELFEDIT_$targetArch elfedit-$targetArch + set_default_value HAIKU_STRIP_$targetArch strip-$targetArch + fi + done + + # The target architectures might have been specified explicitly. + if [ -n "$haikuTargetArchs" ]; then + for targetArch in $haikuTargetArchs; do + is_in_list "$targetArch" "$targetArchs" || ( + echo "Unsupported target architecture: \"$targetArch\"." \ + "Only native architectures of the host platform can" \ + "be specified." >&2 + exit 1 + ) + done + targetArchs="$haikuTargetArchs" + fi fi isPrimaryArch=1 ############################################################################ Commit: 4e822fec6f974a956051e19e8c00eedc97eb0471 Author: Ingo Weinhold <ingo_weinhold@xxxxxx> Date: Mon Aug 12 15:20:36 2013 UTC HaikuPorts/x86_gcc2: Update gcc and binutils Also add secondary architecture packages. ---------------------------------------------------------------------------- diff --git a/build/jam/repositories/HaikuPorts/x86_gcc2 b/build/jam/repositories/HaikuPorts/x86_gcc2 index 3e92d23..5992953 100644 --- a/build/jam/repositories/HaikuPorts/x86_gcc2 +++ b/build/jam/repositories/HaikuPorts/x86_gcc2 @@ -17,7 +17,7 @@ RemotePackageRepository HaikuPorts automake-1.13.1-4 bepdf-1.1.1~beta5_2013_04_28-1 # bezillabrowser-2.0.0.22pre_2010_05_02-1 - binutils-2.17_2013_04_21-1 + binutils-2.17_2013_04_21-2 bison-2.4.3-5 bzip2-1.0.6-3 cdrtools-3.01~a07-3 @@ -34,7 +34,7 @@ RemotePackageRepository HaikuPorts flex-2.5.35-6 freetype-2.4.9-3 freetype_devel-2.4.9-3 - gcc-2.95.3_2013_05_04-1 + gcc-2.95.3_2013_08_12-1 gettext-0.18.1.1-5 gettext_libintl-0.18.1.1-5 git-1.7.10.2-2 @@ -114,6 +114,7 @@ RemotePackageRepository HaikuPorts zlib_devel-1.2.8-3 # secondary architecture (x86) + binutils_x86-2.23.2_2013_04_09-1 curl_x86-7.26.0-5 curl_x86_devel-7.26.0-5 expat_x86-2.0.1-7 @@ -122,6 +123,7 @@ RemotePackageRepository HaikuPorts ffmpeg_x86_devel-0.10.2-3 freetype_x86-2.4.9-3 freetype_x86_devel-2.4.9-3 + gcc_x86-4.7.3_2013_08_12-1 gettext_x86-0.18.1.1-5 gettext_x86_libintl-0.18.1.1-5 glu_x86-9.0.0-2 @@ -168,6 +170,7 @@ RemotePackageRepository HaikuPorts automake bepdf binutils + binutils_x86 bison bzip2 cdrtools @@ -181,6 +184,7 @@ RemotePackageRepository HaikuPorts flex freetype gcc + gcc_x86 gettext git glu ############################################################################ Commit: f56958c140a47e37386b366dbbc2650d527a15bc Author: Ingo Weinhold <ingo_weinhold@xxxxxx> Date: Mon Aug 12 15:23:20 2013 UTC Add development packages for the secondary architecture ---------------------------------------------------------------------------- diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages index 1c93fef..a8f2432 100644 --- a/build/jam/OptionalPackages +++ b/build/jam/OptionalPackages @@ -96,15 +96,25 @@ if [ IsOptionalHaikuImagePackageAdded Development ] { AddHaikuImagePackages autoconf automake libtool perl texinfo ; # devel packages for mandatory packages - AddHaikuImagePackages ffmpeg_devel freetype_devel glu_devel jpeg_devel - libpng_devel zlib_devel : system ; + local architectureObject ; + for architectureObject in [ MultiArchSubDirSetup ] { + on $(architectureObject) { + AddHaikuImagePackages ffmpeg_devel freetype_devel glu_devel + jpeg_devel libpng_devel zlib_devel : system ; + } + } } # DevelopmentBase if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ] { - # gcc and binutils - AddHaikuImagePackages binutils gcc ; + # gcc and binutils (for all target architectures) + local architectureObject ; + for architectureObject in [ MultiArchSubDirSetup ] { + on $(architectureObject) { + AddHaikuImagePackages binutils gcc ; + } + } # other commonly used tools AddHaikuImagePackages bison cdrtools flex jam m4 make mkdepend yasm ;