[haiku-commits] BRANCH HaikuPM-github.package-management [b0944c7] build/jam src/system/libroot/posix src/system/libroot/posix/glibc build/jam/images src

  • From: HaikuPM-github.package-management <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 1 Aug 2013 09:00:36 +0200 (CEST)

added 4 changesets to branch 'refs/remotes/HaikuPM-github/package-management'
old head: 0c59a38ecd83b6775b950326054f3a091aebb612
new head: b0944c78b074a8110bd98e060415d0e8f38a7f65
overview: https://github.com/haiku/HaikuPM/compare/0c59a38...b0944c7

----------------------------------------------------------------------------

13dc541: libroot: os/arch: remove unsupported architectures

30f0d45: Remove unused Haiku64Image

159663c: Remove no longer needed HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES

b0944c7: More work towards hybrid support
  
  * All packaging architecture dependent variables do now have a
    respective suffix and are set up for each configured packaging
    architecture, save for the kernel and boot loader variables, which
    are still only set up for the primary architecture.
    For convenience TARGET_PACKAGING_ARCH, TARGET_ARCH, TARGET_LIBSUPC++,
    and TARGET_LIBSTDC++ are set to the respective values for the primary
    packaging architecture by default.
  * Introduce a set of MultiArch* rules to help with building targets for
    multiple packaging architectures. Generally the respective targets are
    (additionally) gristed with the packaging architecture. For libraries
    the additional grist is usually omitted for the primary architecture
    (e.g. libroot.so and <x86>libroot.so for x86_gcc2/x86 hybrid), so that
    Jamfiles for targets built only for the primary architecture don't
    need to be changed.
  * Add multi-arch build support for all targets needed for the stage 1
    cross devel package as well as for libbe (untested).

                                    [ Ingo Weinhold <ingo_weinhold@xxxxxx> ]

----------------------------------------------------------------------------

349 files changed, 4252 insertions(+), 3980 deletions(-)
Jamfile                                          |   7 +-
Jamrules                                         |  37 +-
build/jam/ArchitectureRules                      | 777 +++++++++++++++++
build/jam/BeOSRules                              |   8 +-
build/jam/BootRules                              |   9 +-
build/jam/BuildFeatures                          |  17 +-
build/jam/BuildSetup                             | 833 ++++---------------
build/jam/DefaultBuildProfiles                   |   2 -
build/jam/FileRules                              |   3 +-
build/jam/HaikuPackages                          |  18 +-
build/jam/HeadersRules                           |  19 +-
build/jam/HelperRules                            |  20 +-
build/jam/ImageRules                             |  22 +-
build/jam/KernelRules                            |  11 +-
build/jam/LocaleRules                            |  18 +-
build/jam/MainBuildRules                         |  57 +-
build/jam/MiscRules                              |  46 +-
build/jam/OptionalPackages                       |  16 +-
build/jam/OverriddenJamRules                     |  68 +-
build/jam/PackageRules                           |  17 +-
build/jam/RepositoryRules                        |  26 +-
build/jam/UserBuildConfig.ReadMe                 |   6 +-
build/jam/board/beagle/BoardSetup                |   8 +-
build/jam/board/neo_freerunner/BoardSetup        |   6 +-
build/jam/board/overo/BoardSetup                 |   8 +-
build/jam/board/raspberry_pi/BoardSetup          |   6 +-
build/jam/board/sam460ex/BoardSetup              |   5 +-
build/jam/board/verdex/BoardSetup                |   7 +-
build/jam/images/Haiku64Image                    | 448 ----------
build/jam/images/HaikuCD                         |   1 -
build/jam/images/HaikuImage                      |   3 +-
build/jam/images/HaikuImageBootstrap             |   3 +-
build/jam/images/HaikuImageCommon                |   1 -
build/jam/packages/Haiku                         |   5 +-
build/jam/packages/HaikuBootstrap                |   5 +-
build/jam/packages/HaikuCrossDevel               |  44 +-
build/jam/packages/HaikuDevel                    |  19 +-
build/scripts/build_haiku_image                  |  36 +-
build/scripts/build_haiku_package                |   4 +-
src/add-ons/disk_systems/bfs/Jamfile             |   2 +-
src/add-ons/disk_systems/intel/Jamfile           |   2 +-
src/add-ons/disk_systems/ntfs/Jamfile            |   2 +-
.../input_server/devices/keyboard/Jamfile        |   2 +-
.../input_server/methods/canna/lib/Jamfile       |   5 +-
.../input_server/methods/canna/rk/Jamfile        |   5 +-
src/add-ons/kernel/bus_managers/pci/Jamfile      |   3 +-
.../kernel/drivers/network/3com/dev/mii/Jamfile  |   4 +-
.../kernel/drivers/network/3com/dev/xl/Jamfile   |   4 +-
.../drivers/network/attansic_l1/dev/mii/Jamfile  |   4 +-
.../drivers/network/broadcom440x/dev/mii/Jamfile |   3 +-
.../drivers/network/broadcom570x/dev/bge/Jamfile |   3 +-
.../drivers/network/broadcom570x/dev/mii/Jamfile |   3 +-
.../drivers/network/dec21xxx/dev/dc/Jamfile      |   3 +-
.../drivers/network/dec21xxx/dev/de/Jamfile      |   3 +-
.../drivers/network/dec21xxx/dev/mii/Jamfile     |   3 +-
.../drivers/network/ipro100/dev/fxp/Jamfile      |   3 +-
.../drivers/network/jmicron2x0/dev/mii/Jamfile   |   3 +-
.../network/marvell_yukon/dev/mii/Jamfile        |   3 +-
.../drivers/network/nforce/dev/mii/Jamfile       |   3 +-
.../kernel/drivers/network/pegasus/Jamfile       |   3 +-
.../kernel/drivers/network/rdc/dev/mii/Jamfile   |   3 +-
.../drivers/network/rtl8139/dev/mii/Jamfile      |   5 +-
.../drivers/network/rtl81xx/dev/mii/Jamfile      |   5 +-
.../drivers/network/syskonnect/dev/mii/Jamfile   |   3 +-
.../drivers/network/via_rhine/dev/mii/Jamfile    |   3 +-
.../drivers/network/vt612x/dev/mii/Jamfile       |   3 +-
src/add-ons/kernel/file_systems/bindfs/Jamfile   |   2 +-
.../kernel/file_systems/packagefs/Jamfile        |   2 +-
src/add-ons/kernel/file_systems/ramfs/Jamfile    |   2 +-
src/add-ons/kernel/file_systems/reiserfs/Jamfile |   2 +-
.../userlandfs/kernel_add_on/Jamfile             |   2 +-
.../inbound_filters/match_header/Jamfile         |   2 +-
.../mail_daemon/inbound_filters/notifier/Jamfile |   2 +-
.../inbound_filters/spam_filter/Jamfile          |   2 +-
.../mail_daemon/inbound_protocols/imap/Jamfile   |   2 +-
.../mail_daemon/inbound_protocols/pop3/Jamfile   |   2 +-
.../mail_daemon/outbound_filters/fortune/Jamfile |   2 +-
.../mail_daemon/outbound_protocols/smtp/Jamfile  |   2 +-
src/add-ons/media/media-add-ons/mixer/Jamfile    |   2 +-
.../media/media-add-ons/multi_audio/Jamfile      |   2 +-
src/add-ons/screen_savers/butterfly/Jamfile      |   2 +-
src/add-ons/screen_savers/debugnow/Jamfile       |   2 +-
src/add-ons/screen_savers/flurry/Jamfile         |   2 +-
src/add-ons/screen_savers/glife/Jamfile          |   2 +-
src/add-ons/screen_savers/gravity/Jamfile        |   4 +-
src/add-ons/screen_savers/haiku/Jamfile          |   2 +-
src/add-ons/screen_savers/icons/Jamfile          |   2 +-
src/add-ons/screen_savers/ifs/Jamfile            |   2 +-
src/add-ons/screen_savers/leaves/Jamfile         |   2 +-
src/add-ons/screen_savers/message/Jamfile        |   2 +-
src/add-ons/screen_savers/simpleclock/Jamfile    |   2 +-
src/add-ons/screen_savers/spider/Jamfile         |   2 +-
src/add-ons/tracker/zipomatic/Jamfile            |   2 +-
src/add-ons/translators/bmp/Jamfile              |   2 +-
src/add-ons/translators/exr/Jamfile              |   2 +-
src/add-ons/translators/exr/openexr/half/Jamfile |  10 +-
.../translators/exr/openexr/ilmimf/Jamfile       | 124 +--
.../translators/exr/openexr/imath/Jamfile        |  20 +-
src/add-ons/translators/gif/Jamfile              |   2 +-
[ *** stats truncated: 250 lines dropped *** ]

############################################################################

Commit:      13dc541c25e90d8f38f2c78a8e1a89a3c2e52c66
Author:      Ingo Weinhold <ingo_weinhold@xxxxxx>
Date:        Sun Jul 28 16:15:31 2013 UTC

libroot: os/arch: remove unsupported architectures

----------------------------------------------------------------------------

diff --git a/src/system/libroot/os/arch/mips/syscalls.inc 
b/src/system/libroot/os/arch/mips/syscalls.inc
deleted file mode 100644
index 971281a..0000000
--- a/src/system/libroot/os/arch/mips/syscalls.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-/* 
-** Copyright 2001, Travis Geiselbrecht. All rights reserved.
-** Distributed under the terms of the NewOS License.
-*/
-#define SYSCALL0(name, number) .align 2 ; .globl name ; .type name,@function ; 
name:
-#define SYSCALL1(name, number) .align 2 ; .globl name ; .type name,@function ; 
name:
-#define SYSCALL2(name, number) .align 2 ; .globl name ; .type name,@function ; 
name:
-#define SYSCALL3(name, number) .align 2 ; .globl name ; .type name,@function ; 
name:
-#define SYSCALL4(name, number) .align 2 ; .globl name ; .type name,@function ; 
name:
-#define SYSCALL5(name, number) .align 2 ; .globl name ; .type name,@function ; 
name:
-#define SYSCALL6(name, number) .align 2 ; .globl name ; .type name,@function ; 
name:
-#define SYSCALL7(name, number) .align 2 ; .globl name ; .type name,@function ; 
name:
-#define SYSCALL8(name, number) .align 2 ; .globl name ; .type name,@function ; 
name:
-#define SYSCALL9(name, number) .align 2 ; .globl name ; .type name,@function ; 
name:
-#define SYSCALL10(name, number) .align 2 ; .globl name ; .type name,@function 
; name:
-#define SYSCALL11(name, number) .align 2 ; .globl name ; .type name,@function 
; name:
-#define SYSCALL12(name, number) .align 2 ; .globl name ; .type name,@function 
; name:
-#define SYSCALL13(name, number) .align 2 ; .globl name ; .type name,@function 
; name:
-#define SYSCALL14(name, number) .align 2 ; .globl name ; .type name,@function 
; name:
-#define SYSCALL15(name, number) .align 2 ; .globl name ; .type name,@function 
; name:
-#define SYSCALL16(name, number) .align 2 ; .globl name ; .type name,@function 
; name:
-
-
diff --git a/src/system/libroot/os/arch/sh4/syscalls.inc 
b/src/system/libroot/os/arch/sh4/syscalls.inc
deleted file mode 100644
index 6495d69..0000000
--- a/src/system/libroot/os/arch/sh4/syscalls.inc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-** Copyright 2001, Travis Geiselbrecht. All rights reserved.
-** Distributed under the terms of the NewOS License.
-*/
-
-/*
-** arg layout:
-** r4-r7:  arg 1 - 4
-** r0-r3:  arg 5 - 8
-** r8-r13: arg 8 - 13
-*/
-#define FUNC(name) .align 2 ; .globl _##name ; .type _##name,@function ; 
_##name:
-
-#define SYSCALL0(name, n) \
-FUNC(name) \
-       trapa   #(n); \
-       nop; \
-       rts; \
-       nop;
-
-#define SYSCALL1(name, n) \
-FUNC(name) \
-       trapa   #(n); \
-       rts; \
-       nop;
-
-#define SYSCALL2(name, n) \
-FUNC(name) \
-       trapa   #(n); \
-       nop; \
-       rts; \
-       nop;
-
-#define SYSCALL3(name, n) \
-FUNC(name) \
-       trapa   #(n); \
-       nop; \
-       rts; \
-       nop;
-
-#define SYSCALL4(name, n) \
-FUNC(name) \
-       trapa   #(n); \
-       nop; \
-       rts; \
-       nop; \
-
-#define SYSCALL5(name, n) \
-FUNC(name) \
-       mov.l   @r15,r0; \
-       trapa   #(n); \
-       nop; \
-       rts; \
-       nop;
-
-#define SYSCALL6(name, n) \
-FUNC(name) \
-       mov.l   @(0,r15),r0; \
-       mov.l   @(4,r15),r1; \
-       trapa   #(n); \
-       nop; \
-       rts; \
-       nop;
-#define SYSCALL7(name, n) \
-FUNC(name) \
-       mov.l   @(0,r15),r0; \
-       mov.l   @(4,r15),r1; \
-       mov.l   @(8,r15),r2; \
-       trapa   #(n); \
-       nop; \
-       rts; \
-       nop;
-
-#define SYSCALL8(name, n) \
-FUNC(name) \
-       mov.l   @(0,r15),r0; \
-       mov.l   @(4,r15),r1; \
-       mov.l   @(8,r15),r2; \
-       mov.l   @(12,r15),r3; \
-       trapa   #(n); \
-       nop; \
-       rts; \
-       nop;
-
-#define SYSCALL9(name, n) \
-FUNC(name) \
-       mov.l   @(0,r15),r0; \
-       mov.l   @(4,r15),r1; \
-       mov.l   @(8,r15),r2; \
-       mov.l   @(12,r15),r3; \
-       mov.l   r8,@-r15; \
-       mov.l   @(20,r15),r8; \
-       trapa   #(n); \
-       nop; \
-       rts; \
-       mov.l   @r15+,r8
-
diff --git a/src/system/libroot/os/arch/sparc64/syscalls.inc 
b/src/system/libroot/os/arch/sparc64/syscalls.inc
deleted file mode 100644
index 5738d60..0000000
--- a/src/system/libroot/os/arch/sparc64/syscalls.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-/* 
-** Copyright 2001, Travis Geiselbrecht. All rights reserved.
-** Distributed under the terms of the NewOS License.
-*/
-
diff --git a/src/system/libroot/posix/string/arch/sh4/arch_string.S 
b/src/system/libroot/posix/string/arch/sh4/arch_string.S
deleted file mode 100644
index e69de29..0000000

############################################################################

Commit:      30f0d45ff7d899803c23ec06e337d77f2b122a09
Author:      Ingo Weinhold <ingo_weinhold@xxxxxx>
Date:        Tue Jul 30 16:47:01 2013 UTC

Remove unused Haiku64Image

----------------------------------------------------------------------------

diff --git a/build/jam/images/Haiku64Image b/build/jam/images/Haiku64Image
deleted file mode 100644
index 18cb19b..0000000
--- a/build/jam/images/Haiku64Image
+++ /dev/null
@@ -1,448 +0,0 @@
-# This file defines what ends up on the Haiku image (respectively in the Haiku
-# installation directory) and it executes the rules building the image
-# (respectively installing the files in the installation directory).
-
-# This is only temporary while x86_64 is still a work in progress, so I can
-# easily add things to the image as I port them.
-
-
-SYSTEM_BIN = "["
-       addattr alert arp
-       base64 basename bash bc beep
-       cal cat catattr checkfs chgrp chmod chown chroot cksum clear clockconfig
-       cmp collectcatkeys comm compress copyattr CortexAddOnHost cp csplit cut
-       date dd diff diff3 dircolors dirname df du dumpcatalog
-       echo eject env error expand expr
-       factor false find finddir FirstBootPrompt fmt fold fortune ftp
-       gawk gdb gzip gzexe getlimits groups
-       head hostname
-       id ifconfig <bin>install isvolume
-       join
-       kernel_debugger kill
-       less lessecho lesskey link linkcatkeys listdev ln locale locate logger
-       logname ls
-       makebootable md5sum mimeset mkdir mkfifo mkfs mktemp mount mountvolume 
mv
-       nl nohup notify nproc
-       od open
-       paste patch pathchk ping pr printenv printf ps ptx pwd
-       query
-       rc readlink rm rmattr rmdir
-       safemode sdiff seq sha1sum shred shuf shutdown sleep sort split stat
-       strace stty su sum sync sysinfo
-       tac tail tee test timeout touch tr true truncate tsort tty
-       unexpand uname uniq unlink unmount unzip <bin>updatedb
-       waitfor wc wget whoami
-       xargs xres
-       yes
-       zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew
-;
-
-SYSTEM_APPS = AboutSystem ActivityMonitor CDPlayer CharacterMap Debugger 
DeskCalc
-       Devices DiskUsage DriveSetup Expander Installer LaunchBox MediaConverter
-       NetworkStatus PoorMan Pulse ProcessController Screenshot ShowImage
-       SoundRecorder StyledEdit Terminal TV Workspaces
-;
-
-SYSTEM_PREFERENCES = Appearance Backgrounds DataTranslations 
<preference>Deskbar
-       FileTypes Keyboard Keymap Locale Media Mouse Network Notifications
-       Printers Screen ScreenSaver Time Touchpad <preference>Tracker
-       VirtualMemory
-;
-
-SYSTEM_DEMOS = BSnow Cortex FontDemo OverlayImage Pairs Sudoku ;
-
-SYSTEM_LIBS = libbe.so libbsd.so libbnetapi.so libgame.so libdebug.so 
libmedia.so
-       libmidi2.so libnetwork.so <revisioned>libroot.so libroot-addon-icu.so
-       libtextencoding.so libtiff.so libtracker.so libtranslation.so
-       $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
-;
-
-PRIVATE_SYSTEM_LIBS =
-       $(HAIKU_JPEG_CURRENT_LIB)
-       $(HAIKU_LIBPNG_CURRENT_LIB)
-       $(HAIKU_ZLIB_CURRENT_LIB)
-       $(HAIKU_FREETYPE_CURRENT_LIB)
-       libilmimf.so
-;
-
-SYSTEM_SERVERS = app_server cddb_daemon debug_server input_server midi_server
-       mount_server net_server notification_server power_daemon print_server
-       print_addon_server registrar syslog_daemon dns_resolver_server
-       nfs4_idmapper_server
-;
-
-SYSTEM_NETWORK_DEVICES = ethernet loopback ;
-SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame
-       ipv6_datagram ;
-SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix icmp6 ipv6 ;
-
-SYSTEM_ADD_ONS_ACCELERANTS = vesa.accelerant ;
-SYSTEM_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator
-       HVIFTranslator ICOTranslator JPEGTranslator JPEG2000Translator
-       PCXTranslator PNGTranslator PPMTranslator
-       RAWTranslator RTFTranslator SGITranslator STXTTranslator TGATranslator
-       TIFFTranslator WebPTranslator WonderBrushTranslator
-;
-
-SYSTEM_ADD_ONS_PRINT =
-       Canon\ LIPS3\ Compatible
-       Canon\ LIPS4\ Compatible
-       Gutenprint
-       PCL5\ Compatible
-       PCL6\ Compatible
-       PDF\ Writer
-       PS\ Compatible
-
-;
-
-SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = vesa ;
-SYSTEM_ADD_ONS_DRIVERS_NET = 3com atheros813x ar81xx attansic_l1 attansic_l2
-       broadcom440x broadcom570x dec21xxx etherpci ipro100 ipro1000 jmicron2x0
-       marvell_yukon nforce pcnet pegasus rtl8139 rtl81xx sis19x sis900 
syskonnect
-       via_rhine wb840
-;
-
-SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
-       ata@ata pci ps2 isa scsi config_manager usb
-] ;
-SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 nfs4 attribute_overlay write_overlay 
;
-
-# modules
-AddFilesToHaikuImage system add-ons kernel bus_managers
-       : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ;
-
-if $(HAIKU_ATA_STACK) = 1 {
-       AddFilesToHaikuImage system add-ons kernel busses ata
-               : generic_ide_pci legacy_sata ;
-}
-
-AddFilesToHaikuImage system add-ons kernel busses scsi
-       : ahci ;
-AddFilesToHaikuImage system add-ons kernel busses usb
-       : <usb>uhci <usb>ohci <usb>ehci ;
-AddFilesToHaikuImage system add-ons kernel debugger
-       : <kdebug>demangle <kdebug>invalidate_on_exit <kdebug>usb_keyboard ;
-AddFilesToHaikuImage system add-ons kernel file_systems
-       : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
-AddFilesToHaikuImage system add-ons kernel generic
-       : ata_adapter@ata bios dpc locked_pool scsi_periph <module>tty ;
-AddFilesToHaikuImage system add-ons kernel partitioning_systems
-       : intel session ;
-
-AddFilesToHaikuImage system add-ons kernel cpu : generic_x86 ;
-
-# drivers
-AddNewDriversToHaikuImage disk scsi    : scsi_cd scsi_disk ;
-
-# legacy drivers
-AddDriversToHaikuImage                         : console dprintf null
-                                                                         
random <driver>tty zero ;
-AddDriversToHaikuImage graphics                : 
$(SYSTEM_ADD_ONS_DRIVERS_GRAPHICS) ;
-AddDriversToHaikuImage disk usb                : usb_disk ;
-AddDriversToHaikuImage input           : ps2_hid usb_hid ;
-AddDriversToHaikuImage net                     : $(SYSTEM_ADD_ONS_DRIVERS_NET) 
;
-
-# kernel
-AddFilesToHaikuImage system : <revisioned>kernel_$(TARGET_ARCH) ;
-
-# libs
-AddLibrariesToHaikuHybridImage system lib
-       : $(SYSTEM_LIBS) $(PRIVATE_SYSTEM_LIBS) ;
-
-OPTIONAL_LIBS_ALIASES =
-        libfreetype.so
-        libjpeg.so
-        libpng.so
-        libz.so
-;
-
-# libfreetype.so links to the current freetype lib
-AddSymlinkToHaikuHybridImage system lib : $(HAIKU_FREETYPE_CURRENT_LIB:BS)
-       : $(HAIKU_FREETYPE_CURRENT_LINK) : : true ;
-AddSymlinkToHaikuHybridImage system lib : $(HAIKU_FREETYPE_CURRENT_LINK)
-       : libfreetype.so : : true ;
-
-# libpng.so links to the current libpng
-AddSymlinkToHaikuHybridImage system lib : $(HAIKU_LIBPNG_CURRENT_LIB:BS)
-       : $(HAIKU_LIBPNG_CURRENT_LINK) : : true ;
-AddSymlinkToHaikuHybridImage system lib : $(HAIKU_LIBPNG_CURRENT_LINK)
-       : libpng.so : : true ;
-
-# libjpeg.so links to the current libjpeg
-AddSymlinkToHaikuHybridImage system lib : $(HAIKU_JPEG_CURRENT_LIB:BS)
-       : $(HAIKU_JPEG_CURRENT_LINK) : : true ;
-AddSymlinkToHaikuHybridImage system lib : $(HAIKU_JPEG_CURRENT_LINK)
-       : libjpeg.so : : true ;
-
-# zlib.so links to the current zlib
-AddSymlinkToHaikuHybridImage system lib : $(HAIKU_ZLIB_CURRENT_LIB:BS)
-       : $(HAIKU_ZLIB_CURRENT_LINK) : : true ;
-AddSymlinkToHaikuHybridImage system lib : $(HAIKU_ZLIB_CURRENT_LINK)
-       : libz.so : : true ;
-
-# servers
-AddFilesToHaikuImage system servers : $(SYSTEM_SERVERS) ;
-
-# apps
-AddFilesToHaikuImage system                            : runtime_loader 
Deskbar Tracker ;
-AddFilesToHaikuImage system bin                        : $(SYSTEM_BIN) 
consoled ;
-AddFilesToHaikuImage system apps               : $(SYSTEM_APPS) ;
-AddFilesToHaikuImage system preferences        : $(SYSTEM_PREFERENCES) ;
-AddFilesToHaikuImage system demos              : $(SYSTEM_DEMOS) ;
-
-SEARCH on which = [ FDirName $(HAIKU_TOP) data bin ] ;
-AddFilesToHaikuImage system bin                        : which ;
-SEARCH on installoptionalpackage = [ FDirName $(HAIKU_TOP) data bin ] ;
-AddFilesToHaikuImage system bin                        : 
installoptionalpackage ;
-SEARCH on install-wifi-firmwares.sh = [ FDirName $(HAIKU_TOP) data bin ] ;
-AddFilesToHaikuImage system bin                        : 
install-wifi-firmwares.sh ;
-
-# Add the files to be used by installoptionalpackage.
-AddDirectoryToHaikuImage common data optional-packages ;
-local optional-pkg-files = BuildFeatures OptionalPackages ;
-for name in $(optional-pkg-files) {
-       local file = [ FDirName $(HAIKU_TOP) build jam $(name) ] ;
-       AddFilesToHaikuImage common data optional-packages : $(file) ;
-}
-AddInstalledPackagesFileToHaikuImage ;
-
-AddSymlinkToHaikuImage system bin : bash : sh ;
-AddSymlinkToHaikuImage system bin : trash : untrash ;
-
-AddSymlinkToHaikuImage home Desktop : /boot/home : Home ;
-
-# Mailbox folders and symlink
-AddDirectoryToHaikuImage home mail draft ;
-AddDirectoryToHaikuImage home mail in ;
-AddDirectoryToHaikuImage home mail out ;
-
-AddSymlinkToHaikuImage home config : settings/deskbar : be ;
-# Deskbar Application links
-AddDirectoryToHaikuImage home config settings deskbar Applications ;
-DESKBAR_APPLICATIONS = ActivityMonitor DriveSetup Installer StyledEdit
-       Terminal ;
-local linkTarget ;
-for linkTarget in $(DESKBAR_APPLICATIONS) {
-       AddSymlinkToHaikuImage home config settings deskbar Applications
-               : /boot/system/apps/$(linkTarget) : $(linkTarget) ;
-}
-
-# Deskbar Desktop applets links
-AddDirectoryToHaikuImage home config settings deskbar Desktop\ applets ;
-DESKBAR_DESKTOP_APPLETS = NetworkStatus ProcessController ;
-for linkTarget in $(DESKBAR_DESKTOP_APPLETS) {
-       AddSymlinkToHaikuImage home config settings deskbar Desktop\ applets
-               : /boot/system/apps/$(linkTarget) : $(linkTarget) ;
-}
-
-# Deskbar Preferences links
-AddDirectoryToHaikuImage home config settings deskbar Preferences ;
-DESKBAR_PREFERENCES = $(SYSTEM_PREFERENCES:B) ;
-for linkTarget in $(DESKBAR_PREFERENCES) {
-       AddSymlinkToHaikuImage home config settings deskbar Preferences
-               : /boot/system/preferences/$(linkTarget)
-               : $(linkTarget) ;
-}
-
-# Deskbar Demo links
-AddDirectoryToHaikuImage home config settings deskbar Demos ;
-for linkTarget in $(SYSTEM_DEMOS) {
-       AddSymlinkToHaikuImage home config settings deskbar Demos
-               : /boot/system/demos/$(linkTarget) : $(linkTarget) ;
-}
-
-AddSymlinkToHaikuImage system bin : less : more ;
-AddSymlinkToHaikuImage system bin : gzip : gunzip ;
-AddSymlinkToHaikuImage system bin : gzip : zcat ;
-AddSymlinkToHaikuImage system bin : zdiff : zcmp ;
-AddSymlinkToHaikuImage system bin : unzip : zipinfo ;
-AddSymlinkToHaikuImage system bin : gawk : awk ;
-
-
-# scripts and data files
-local bootScripts = Bootscript Bootscript.cd SetupEnvironment Netscript
-       InstallerInitScript InstallerFinishScript ;
-SEARCH on $(bootScripts) = [ FDirName $(HAIKU_TOP) data system boot ] ;
-AddFilesToHaikuImage system boot : $(bootScripts) ;
-
-local userBootScripts = UserBootscript UserSetupEnvironment.sample ;
-SEARCH on $(userBootScripts) = [ FDirName $(HAIKU_TOP) data config boot ] ;
-AddFilesToHaikuImage home config boot : $(userBootScripts) ;
-
-# Add boot launch directory
-AddDirectoryToHaikuImage home config boot launch ;
-
-local logoArtwork =
-       $(HAIKU_INCLUDE_TRADEMARKS)"HAIKU logo - white on blue - big.png"
-       $(HAIKU_INCLUDE_TRADEMARKS)"HAIKU logo - white on blue - normal.png" ;
-SEARCH on $(logoArtwork) = [ FDirName $(HAIKU_TOP) data artwork ] ;
-AddFilesToHaikuImage system data artwork : $(logoArtwork) ;
-
-local etcDir = [ FDirName $(HAIKU_TOP) data etc ] ;
-local etcFiles = inputrc profile ;
-etcFiles = $(etcFiles:G=etc) ;
-SEARCH on $(etcFiles) = [ FDirName $(etcDir) ] ;
-etcFiles += <etc>termcap <etc>sysless <etc>sysless.in ;
-AddFilesToHaikuImage common etc : $(etcFiles) ;
-
-local profileFiles = [ Glob $(etcDir)/profile.d : *.sh ] ;
-profileFiles = $(profileFiles:G=profile-d) ;
-AddDirectoryToHaikuImage common etc profile.d ;
-AddFilesToHaikuImage common etc profile.d : $(profileFiles) ;
-
-local fortuneFiles = [ Glob $(HAIKU_TOP)/data/system/data/fortunes
-       : [a-zA-Z0-9]* ] ;
-fortuneFiles = $(fortuneFiles:G=data!fortunes) ;
-AddFilesToHaikuImage system data fortunes : $(fortuneFiles) ;
-
-local fontDir = [ FDirName $(HAIKU_TOP) data system data fonts ] ;
-local psFonts = [ Glob $(fontDir)/psfonts : *.afm *.pfb ] ;
-local ttFonts = [ Glob $(fontDir)/ttfonts : *.ttf ] ;
-AddFilesToHaikuImage system data fonts psfonts : $(psFonts) ;
-AddFilesToHaikuImage system data fonts ttfonts : $(ttFonts) ;
-
-local keymapFiles = [ Glob [ FDirName $(HAIKU_TOP) src data keymaps ]
-       : *.keymap ] ;
-keymapFiles = $(keymapFiles:BG=keymap) ;
-AddFilesToHaikuImage system data Keymaps : $(keymapFiles) ;
-AddSymlinkToHaikuImage system data Keymaps : Swedish : Finnish ;
-AddSymlinkToHaikuImage system data Keymaps : Slovene : Croatian ;
-AddSymlinkToHaikuImage system data Keymaps : US-International : Brazilian ;
-
-# Copy keyboard layout files to the image one-by-one.
-local keyboardLayoutsDir
-       = [ FDirName $(HAIKU_TOP) data system data KeyboardLayouts ] ;
-local keyboardLayoutFiles =
-       "Generic 104-key"
-       "Generic 105-key International"
-       "Kinesis Advantage"
-       "Kinesis Ergo Elan International"
-       "TypeMatrix 2030" ;
-keyboardLayoutFiles = $(keyboardLayoutFiles:G=keyboard-layout) ;
-SEARCH on $(keyboardLayoutFiles) = $(keyboardLayoutsDir) ;
-AddFilesToHaikuImage system data KeyboardLayouts
-       : $(keyboardLayoutFiles) ;
-
-# Add Apple Aluminum keyboard layout files to the image in an Apple Aluminum
-# subdirectory. The subdirectory is turned into a submenu in the Layout menu
-# of the Keymap preference app.
-local appleAluminumDir
-       = [ FDirName $(HAIKU_TOP) data system data KeyboardLayouts
-               Apple\ Aluminum ] ;
-local appleAluminumFiles =
-       "Apple Aluminium Extended International"
-       "Apple Aluminium International"
-       "Apple Aluminum (US)"
-       "Apple Aluminum Extended (US)" ;
-appleAluminumFiles = $(appleAluminumFiles:G=keyboard-layout) ;
-SEARCH on $(appleAluminumFiles) = $(appleAluminumDir) ;
-AddFilesToHaikuImage system data KeyboardLayouts Apple\ Aluminum
-       : $(appleAluminumFiles) ;
-
-# Add ThinkPad keyboard layout files to the image in a ThinkPad
-# subdirectory. The subdirectory is turned into a submenu in the Layout menu
-# of the Keymap preference app.
-local thinkpadDir
-       = [ FDirName $(HAIKU_TOP) data system data KeyboardLayouts ThinkPad ] ;
-local thinkPadFiles =
-       "ThinkPad (US)"
-       "ThinkPad International"
-       "ThinkPad T400s (US)"
-       "ThinkPad T400s International"
-       "ThinkPad X1 (US)"
-       "ThinkPad X1 International"
-       "ThinkPad X100e (US)"
-       "ThinkPad X100e International" ;
-thinkPadFiles = $(thinkPadFiles:G=keyboard-layout) ;
-SEARCH on $(thinkPadFiles) = $(thinkpadDir) ;
-AddFilesToHaikuImage system data KeyboardLayouts ThinkPad
-       : $(thinkPadFiles) ;
-
-local driverSettingsFiles = <driver-settings>kernel ;
-SEARCH on $(driverSettingsFiles)
-       = [ FDirName $(HAIKU_TOP) data settings kernel drivers ] ;
-AddFilesToHaikuImage home config settings kernel drivers
-       : $(driverSettingsFiles) ;
-
-# post install scripts and fresh install indicator file
-local postInstallFiles = add_catalog_entry_attributes.sh
-       default_deskbar_items.sh mime_update.sh ;
-postInstallFiles = $(postInstallFiles:G=post-install) ;
-SEARCH on $(postInstallFiles)
-       = [ FDirName $(HAIKU_TOP) data common boot post_install ] ;
-SEARCH on <post-install>fresh_install
-       = [ FDirName $(HAIKU_TOP) data common settings ] ;
-AddFilesToHaikuImage common boot post-install : $(postInstallFiles) ;
-AddFilesToHaikuImage common settings : <post-install>fresh_install ;
-
-# boot loader
-AddFilesToHaikuImage system : haiku_loader ;
-
-# boot module links
-AddBootModuleSymlinksToHaikuImage
-       ata@ata pci config_manager dpc scsi usb ata_adapter@ata
-       locked_pool scsi_periph ahci generic_ide_pci legacy_sata
-       <usb>uhci <usb>ohci <usb>ehci
-       scsi_cd scsi_disk usb_disk
-       intel
-       bfs
-;
-
-# add-ons
-AddFilesToHaikuImage system add-ons accelerants
-       : $(SYSTEM_ADD_ONS_ACCELERANTS) ;
-
-AddFilesToHaikuHybridImage system add-ons Translators
-       : $(SYSTEM_ADD_ONS_TRANSLATORS) : : true ;
-AddFilesToHaikuImage system add-ons input_server devices
-       : <input>keyboard <input>mouse <input>tablet <input>wacom ;
-AddFilesToHaikuImage system add-ons kernel network
-       : <net>notifications stack ;
-AddFilesToHaikuImage system add-ons kernel network : dns_resolver ;
-AddFilesToHaikuImage system add-ons kernel network devices
-       : $(SYSTEM_NETWORK_DEVICES) ;
-AddFilesToHaikuImage system add-ons kernel network datalink_protocols
-       : $(SYSTEM_NETWORK_DATALINK_PROTOCOLS) ;
-AddFilesToHaikuImage system add-ons kernel network protocols
-       : $(SYSTEM_NETWORK_PROTOCOLS) ;
-
-AddFilesToHaikuImage system add-ons disk_systems
-       : <disk_system>intel <disk_system>bfs ;
-
-# create directories that will remain empty
-AddDirectoryToHaikuImage common bin ;
-AddDirectoryToHaikuImage common include ;
-AddDirectoryToHaikuImage common lib ;
-AddDirectoryToHaikuImage home Desktop ;
-AddDirectoryToHaikuImage home config bin ;
-AddDirectoryToHaikuImage home config lib ;
-AddDirectoryToHaikuImage home mail ;
-AddDirectoryToHaikuImage common var empty ;
-AddDirectoryToHaikuImage common var log ;
-AddDirectoryToHaikuImage common cache tmp ;
-
-AddDirectoryToHaikuImage home config add-ons kernel drivers bin ;
-AddDirectoryToHaikuImage home config add-ons kernel drivers dev ;
-AddDirectoryToHaikuImage home config add-ons input_server devices ;
-AddDirectoryToHaikuImage home config add-ons input_server filters ;
-AddDirectoryToHaikuImage home config add-ons input_server methods ;
-AddDirectoryToHaikuImage home config add-ons media plugins ;
-AddDirectoryToHaikuImage home config add-ons Tracker ;
-AddDirectoryToHaikuImage home config add-ons Print ;
-AddDirectoryToHaikuImage home config add-ons Screen\ Savers ;
-AddDirectoryToHaikuImage home config add-ons Translators ;
-AddDirectoryToHaikuImage system data synth ;
-AddDirectoryToHaikuImage system add-ons input_server methods ;
-
-# licenses
-CopyDirectoryToHaikuImage system data
-       : [ FDirName $(HAIKU_TOP) data system data licenses ]
-       : licenses : -x .svn ;
-
-# Copy documentation as per DiskUsage's license requirement.
-CopyDirectoryToHaikuImage system documentation
-       : [ FDirName $(HAIKU_TOP) docs apps diskusage ]
-       : diskusage : -x .svn ;
-
-
-include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuImageCommon ] ;

############################################################################

Commit:      159663cebabbc8dcd94c2f64f110ca2536cf24fc
Author:      Ingo Weinhold <ingo_weinhold@xxxxxx>
Date:        Thu Aug  1 06:53:06 2013 UTC

Remove no longer needed HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES

----------------------------------------------------------------------------

diff --git a/build/jam/DefaultBuildProfiles b/build/jam/DefaultBuildProfiles
index a503c08..066528c 100644
--- a/build/jam/DefaultBuildProfiles
+++ b/build/jam/DefaultBuildProfiles
@@ -33,7 +33,6 @@ rule DefineDefaultBuildProfiles
                        HAIKU_ROOT_USER_REAL_NAME = "Yourself" ;
                        AddGroupToHaikuImage party : 101 : user sshd ;
                        HAIKU_IMAGE_HOST_NAME = shredder ;
-                       HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES = 1 ;
                        HAIKU_IMAGE_SIZE = 800 ;
 
                        AddHaikuImagePackages
@@ -75,7 +74,6 @@ rule DefineDefaultBuildProfiles
                        HAIKU_ROOT_USER_NAME = user ;
                        HAIKU_ROOT_USER_REAL_NAME = "Yourself" ;
                        AddGroupToHaikuImage party : 101 : user sshd ;
-                       HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES = 1 ;
                        HAIKU_IMAGE_HOST_NAME = shredder ;
                        HAIKU_IMAGE_SIZE = 600 ;
 
diff --git a/build/jam/ImageRules b/build/jam/ImageRules
index f9846c0..7440efc 100644
--- a/build/jam/ImageRules
+++ b/build/jam/ImageRules
@@ -412,7 +412,7 @@ rule ExtractArchiveToContainer container : directoryTokens 
: archiveFile
        # ExtractArchiveToContainer <container> : <directory> : <archiveFile>
        #       : [ <flags> ] : <extractedSubDir> ;
        #
-       # Supported flags: alwaysUpdate, stripDebugSymbols
+       # Supported flags: alwaysUpdate
 
        # If the container shall only be updated, we extract only, if 
explicitely
        # requested.
@@ -423,14 +423,9 @@ rule ExtractArchiveToContainer container : directoryTokens 
: archiveFile
 
        local directory = [ AddDirectoryToContainer $(container)
                : $(directoryTokens) ] ;
-       local stripDebugSymbols ;
-       if stripDebugSymbols in $(flags) {
-               stripDebugSymbols = 1 ;
-       }
 
        ARCHIVE_FILES_TO_INSTALL on $(directory) += $(archiveFile) ;
        ARCHIVE_SUBDIR_TO_INSTALL_FROM on $(archiveFile) = $(extractedSubDir) ;
-       ARCHIVE_FILES_TO_STRIP on $(archiveFile) = $(stripDebugSymbols) ;
 }
 
 rule AddDriversToContainer container : relativeDirectoryTokens : targets
@@ -799,11 +794,6 @@ rule CreateContainerExtractFilesScript container : script
                        ARCHIVE_SUBDIR_TO_INSTALL_FROM on $(dummyTarget) =
                                $(extractedSubDir:E=.) ;
 
-                       local stripDebugSymbols = [ on $(archiveFile)
-                               return $(ARCHIVE_FILES_TO_STRIP) ] ;
-                       STRIP_DEBUG_SYMBOLS_FROM_ARCHIVE on $(dummyTarget) =
-                               $(stripDebugSymbols) ;
-
                        Depends $(dummyTarget) : $(initScript) $(archiveFile)
                                $(serializationDependency) ;
                        Depends $(script) : $(dummyTarget) ;
@@ -819,8 +809,7 @@ rule CreateContainerExtractFilesScript container : script
 actions AddExtractFileToContainerExtractFilesScript
 {
        echo extractFile "\"$(2[2])\"" "\"$(TARGET_DIR)\"" \
-               "\"$(ARCHIVE_SUBDIR_TO_INSTALL_FROM)\"" \
-               "\"$(STRIP_DEBUG_SYMBOLS_FROM_ARCHIVE)\"" >> $(2[1])
+               "\"$(ARCHIVE_SUBDIR_TO_INSTALL_FROM)\"" >> $(2[1])
 }
 
 
@@ -1068,7 +1057,7 @@ rule InstallOptionalHaikuImagePackage url : dirTokens : 
flags
        #   directory relative to the image's root directory where the content 
of
        #   the archive will be extracted to.
        #
-       # Supported flags: cdPackage, stripDebugSymbols/!stripDebugSymbols
+       # Supported flags: cdPackage
 
        local package = $(url:BS) ;
 
@@ -1087,11 +1076,6 @@ rule InstallOptionalHaikuImagePackage url : dirTokens : 
flags
                # copy onto image
                AddFilesToHaikuImage _packages_ : $(archiveFile) ;
        } else {
-               if $(HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES) = 1
-                       && ! stripDebugSymbols in $(flags)
-                       && ! !stripDebugSymbols in $(flags) {
-                       flags += stripDebugSymbols ;
-               }
                # extract onto image
                ExtractArchiveToHaikuImage $(dirTokens) : $(archiveFile) : 
$(flags) ;
        }
diff --git a/build/jam/UserBuildConfig.ReadMe b/build/jam/UserBuildConfig.ReadMe
index 2252fd9..e51cb79 100644
--- a/build/jam/UserBuildConfig.ReadMe
+++ b/build/jam/UserBuildConfig.ReadMe
@@ -62,10 +62,6 @@ HAIKU_IMAGE_NAME     = walter.image ;
 HAIKU_IMAGE_DIR                = /tmp ;
 HAIKU_IMAGE_SIZE       = 100 ;
 
-# Enable stripping the debug symbols from optional packages.
-# Note, some optional packages may override this to prevent stripping.
-HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES = 1 ;
-
 # Set image volume label to "Walter". Default label is "Haiku".
 HAIKU_IMAGE_LABEL      = Walter ;
 
diff --git a/build/jam/images/HaikuCD b/build/jam/images/HaikuCD
index 6d1a2a9..30b9afb 100644
--- a/build/jam/images/HaikuCD
+++ b/build/jam/images/HaikuCD
@@ -27,7 +27,6 @@ AddTargetVariableToScript $(script) : <build>rc ;
 AddTargetVariableToScript $(script) : <build>resattr ;
 AddTargetVariableToScript $(script) : <build>unzip ;
 AddTargetVariableToScript $(script) : <build>generate_attribute_stores ;
-AddVariableToScript $(script) : stripCommand : $(HAIKU_STRIP) ;
 if $(HOST_RM_ATTRS_TARGET) {
        AddTargetVariableToScript $(script) : $(HOST_RM_ATTRS_TARGET) : rmAttrs 
;
 } else {
diff --git a/build/jam/images/HaikuImageCommon 
b/build/jam/images/HaikuImageCommon
index 6662789..dceb795 100644
--- a/build/jam/images/HaikuImageCommon
+++ b/build/jam/images/HaikuImageCommon
@@ -83,7 +83,6 @@ AddTargetVariableToScript $(script) : 
<build>get_package_dependencies
        : getPackageDependencies ;
 AddTargetVariableToScript $(script) : <build>unzip ;
 AddTargetVariableToScript $(script) : <build>vmdkimage ;
-AddVariableToScript $(script) : stripCommand : $(HAIKU_STRIP) ;
 if $(HOST_RM_ATTRS_TARGET) {
        AddTargetVariableToScript $(script) : $(HOST_RM_ATTRS_TARGET) : rmAttrs 
;
 } else {
diff --git a/build/scripts/build_haiku_image b/build/scripts/build_haiku_image
index 39fb725..a345e53 100755
--- a/build/scripts/build_haiku_image
+++ b/build/scripts/build_haiku_image
@@ -37,7 +37,6 @@ set -o errexit
 # The following is only for cd types:
 # generate_attribute_stores
 # isCD
-# stripCommand
 #
 if [ $# -gt 0 ]; then
        . $1
@@ -148,27 +147,12 @@ else
 fi
 
 
-stripDebugInfo()
-{
-       file="$1"
-
-       # Determine whether the file is an ELF file by checking the ELF 
signature,
-       # or at least the printable characters.
-       elfMarker=`dd "if=$file" bs=1 skip=1 count=3 2> /dev/null`
-       if [ "$elfMarker" = 'ELF' ]; then
-               # make user-writable first -- some files aren't
-               chmod u+w "$file"
-               "$stripCommand" --strip-debug "$file"
-       fi
-}
-
 extractFile()
 {
-       # extractFile <archive> <directory> <extractedSubDir> 
<stripDebugSymbols>
+       # extractFile <archive> <directory> <extractedSubDir>
        archiveFile=$1
        targetExtractedDir=$2
        extractedSubDir=$3
-       stripDebugSymbols=$4
 
        extractDir=$tmpDir/extract
        $rmAttrs -rf "$extractDir"
@@ -205,24 +189,6 @@ extractFile()
                rm $extractDir/.OptionalPackageDescription
        fi
 
-       if [ "$stripDebugSymbols" = "1" ]; then
-               # strip executables in common/bin
-               if [ -d $extractDir/common/bin ]; then
-                       for file in `find $extractDir/common/bin -type f -a 
-perm +100 \
-                                       -a -size +1k`; do
-                               stripDebugInfo "$file"
-                       done
-               fi
-
-               # strip libraries in common/lib
-               if [ -d $extractDir/common/lib ]; then
-                       for file in `find $extractDir/common/lib -type f -a 
-size +1k \
-                                       -a -name lib\*`; do
-                               stripDebugInfo "$file"
-                       done
-               fi
-       fi
-
        $cp -r "${sPrefix}$extractDir/$extractedSubDir/." \
                "${tPrefix}$targetExtractedDir"
 
diff --git a/build/scripts/build_haiku_package 
b/build/scripts/build_haiku_package
index d0d6509..46c1a20 100755
--- a/build/scripts/build_haiku_package
+++ b/build/scripts/build_haiku_package
@@ -61,12 +61,10 @@ mkindex=mkindex
 
 extractFile()
 {
-       # extractFile <archive> <directory> <extractedSubDir> 
<stripDebugSymbols>
+       # extractFile <archive> <directory> <extractedSubDir>
        archiveFile=$1
        targetExtractedDir=$2
        extractedSubDir=$3
-       # Ignore stripDebugSymbols. It's not relevant here, since executables 
and
-       # libraries shouldn't come from zip files or other archives anymore.
 
        extractDir=$tmpDir/extract
        $rmAttrs -rf "$extractDir"

############################################################################

Commit:      b0944c78b074a8110bd98e060415d0e8f38a7f65
Author:      Ingo Weinhold <ingo_weinhold@xxxxxx>
Date:        Thu Aug  1 06:51:16 2013 UTC

More work towards hybrid support

* All packaging architecture dependent variables do now have a
  respective suffix and are set up for each configured packaging
  architecture, save for the kernel and boot loader variables, which
  are still only set up for the primary architecture.
  For convenience TARGET_PACKAGING_ARCH, TARGET_ARCH, TARGET_LIBSUPC++,
  and TARGET_LIBSTDC++ are set to the respective values for the primary
  packaging architecture by default.
* Introduce a set of MultiArch* rules to help with building targets for
  multiple packaging architectures. Generally the respective targets are
  (additionally) gristed with the packaging architecture. For libraries
  the additional grist is usually omitted for the primary architecture
  (e.g. libroot.so and <x86>libroot.so for x86_gcc2/x86 hybrid), so that
  Jamfiles for targets built only for the primary architecture don't
  need to be changed.
* Add multi-arch build support for all targets needed for the stage 1
  cross devel package as well as for libbe (untested).

----------------------------------------------------------------------------

diff --git a/Jamfile b/Jamfile
index 52a143e..395586a 100644
--- a/Jamfile
+++ b/Jamfile
@@ -4,7 +4,12 @@ NotFile doc_files ;
 Depends files : doc_files ;
 
 # Prepare the optional build features before parsing the Jamfile tree.
-include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ;
+local architectureObject ;
+for architectureObject in [ MultiArchSubDirSetup ] {
+       on $(architectureObject) {
+               include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ;
+       }
+}
 
 # Include packages that are required by all images.
 if ! $(HAIKU_BOOTSTRAP_BUILD) {
diff --git a/Jamrules b/Jamrules
index accfe49..4ce01e8 100644
--- a/Jamrules
+++ b/Jamrules
@@ -29,42 +29,8 @@ if ! $(buildConfig) {
 LOCATE on BuildConfig = $(HAIKU_BUILD_OUTPUT_DIR) ;
 include BuildConfig ;
 
-# Set simplified variables for primary architecture.
+# set HAIKU_PACKAGING_ARCH, the primary packaging architecture
 HAIKU_PACKAGING_ARCH = $(HAIKU_PACKAGING_ARCHS[1]) ;
-local variable ;
-for variable in
-       HAIKU_GCC_RAW_VERSION
-       HAIKU_GCC_MACHINE
-       HAIKU_GCC_LIB_DIR
-       HAIKU_GCC_HEADERS_DIR
-       HAIKU_GCC_LIBGCC
-       HAIKU_GCC_LIBGCC_OBJECTS
-       HAIKU_CPU
-       HAIKU_STATIC_LIBSTDC++
-       HAIKU_SHARED_LIBSTDC++
-       HAIKU_STATIC_LIBSUPC++
-       HAIKU_SHARED_LIBSUPC++
-       HAIKU_C++_HEADERS_DIR
-       HAIKU_KERNEL_LIBGCC
-       HAIKU_KERNEL_LIBSUPC++
-       HAIKU_BOOT_LIBGCC
-       HAIKU_BOOT_LIBSUPC++
-       HAIKU_AR
-       HAIKU_CC
-       HAIKU_LD
-       HAIKU_OBJCOPY
-       HAIKU_RANLIB
-       HAIKU_ELFEDIT
-       HAIKU_STRIP
-       HAIKU_CPPFLAGS
-       HAIKU_CCFLAGS
-       HAIKU_C++FLAGS
-       HAIKU_LDFLAGS
-       HAIKU_ARFLAGS
-       HAIKU_UNARFLAGS
-       HAIKU_USE_GCC_GRAPHITE {
-       $(variable) = $($(variable)_$(HAIKU_PACKAGING_ARCH)) ;
-}
 
 # The build setup and rules are neatly organized in several files. Include
 # them now. Start with the side-effect-less rules, since they are the most
@@ -73,6 +39,7 @@ for variable in
 # optional user-defined UserBuildConfig is included thereafter.
 include [ FDirName $(HAIKU_BUILD_RULES_DIR) HelperRules ] ;
 include [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ;
+include [ FDirName $(HAIKU_BUILD_RULES_DIR) ArchitectureRules ] ;
 include [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
 include [ FDirName $(HAIKU_BUILD_RULES_DIR) LocaleRules ] ;
 include [ FDirName $(HAIKU_BUILD_RULES_DIR) CommandLineArguments ] ;
diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules
new file mode 100644
index 0000000..29282c2
--- /dev/null
+++ b/build/jam/ArchitectureRules
@@ -0,0 +1,777 @@
+rule ArchitectureSetup architecture
+{
+       # ArchitectureSetup <architecture> ;
+       #
+       # Initializes all global packaging architecture dependent variables for 
the
+       # given packaging architecture. Also sets HAIKU_ARCH (to the primary
+       # architecture), if this is the first invocation of the rule, and adds
+       # the architecture to HAIKU_ARCHS, if not yet contained.
+
+       # analyze GCC version
+       local gccVersion
+               = [ FAnalyzeGCCVersion HAIKU_GCC_RAW_VERSION_$(architecture) ] ;
+       HAIKU_GCC_VERSION_$(architecture) = $(gccVersion) ;
+
+       # enable GCC -pipe option, if requested
+       local gccBaseFlags ;
+       if $(HAIKU_USE_GCC_PIPE) = 1 {
+               gccBaseFlags = -pipe ;
+       }
+
+       # disable strict aliasing on anything newer than gcc 2 as it may lead to
+       # unexpected results. also disable the tree-vrp (value range 
propagation)
+       # optimization for now as with the current gcc4 version we are using 
this
+       # results in some broken code.
+       # TODO: remove the -fno-strict-aliasing option when all code has been
+       #               analyzed/fixed with regard to aliasing.
+       # TODO: retest/remove the -fno-tree-vrp option as soon as we have 
updated
+       #               our gcc4 compiler. See this discussion on some issues:
+       # 
//www.freelists.org/post/haiku-development/hrev45320-Yet-another-nonobvious-effect-of-ftreevrp-optimization
+       if $(gccVersion[1]) >= 3 {
+               gccBaseFlags += -fno-strict-aliasing -fno-tree-vrp ;
+       }
+
+       # disable array bounds warnings on gcc 4.6 or newer since they trigger
+       # too many false positives. Coverity does a better job of this kind of
+       # analysis anyways.
+       if $(gccVersion[1]) >= 4 {
+               gccBaseFlags += -Wno-array-bounds ;
+       }
+
+       # activating graphite optimizations
+       if $(HAIKU_USE_GCC_GRAPHITE_$(architecture)) = 1 {
+               gccBaseFlags += -floop-interchange -ftree-loop-distribution
+                       -floop-strip-mine -floop-block ;
+       }
+       HAIKU_GCC_BASE_FLAGS_$(architecture) = $(gccBaseFlags) ;
+
+       # override gcc 2.95.3's header directory -- strictly necessary only when
+       # using the BeOS native compiler (since its headers are incompatible), 
but
+       # it doesn't harm for the cross-compiler either.
+       if $(gccVersion[1]) = 2 {
+               HAIKU_GCC_HEADERS_DIR_$(architecture)
+                       = [ FDirName $(HAIKU_TOP) headers build gcc-2.95.3 ] ;
+       }
+
+       # initial state for flags etc.
+       HAIKU_C++_$(architecture) ?= $(HAIKU_CC_$(architecture)) ;
+       HAIKU_LINK_$(architecture) = $(HAIKU_CC_$(architecture)) ;
+       HAIKU_LINKFLAGS_$(architecture) = $(gccBaseFlags) ;
+
+       HAIKU_HDRS_$(architecture) = [ FStandardHeaders $(architecture) ] ;
+       HAIKU_CCFLAGS_$(architecture) += $(gccBaseFlags) -nostdinc ;
+       HAIKU_C++FLAGS_$(architecture) += $(gccBaseFlags) -nostdinc ;
+
+       local cpu = $(HAIKU_CPU_$(architecture)) ;
+       switch $(cpu) {
+               case ppc :
+                       HAIKU_DEFINES_$(architecture) += __POWERPC__ ;
+
+               case arm :
+                       HAIKU_DEFINES_$(architecture) += __ARM__ ;
+
+               case x86 :
+                       HAIKU_DEFINES_$(architecture) += __INTEL__ ;
+
+               case m68k :
+                       HAIKU_DEFINES_$(architecture) += __M68K__ ;
+
+               case mipsel :
+                       HAIKU_DEFINES_$(architecture) += __MIPSEL__ ;
+
+               case * :
+                       Exit "Currently unsupported target CPU:" $(cpu) ;
+       }
+
+       # strip is required
+       if ! $(HAIKU_STRIP_$(architecture)) {
+               Exit "HAIKU_STRIP_$(architecture) not set. Please re-run 
configure." ;
+       }
+
+       HAIKU_ARCH_$(architecture) = $(cpu) ;
+       HAIKU_ARCH ?= $(cpu) ;
+               # Set only, if not set yet. This way HAIKU_ARCH is set to the 
primary
+               # architecture.
+       if ! $(cpu) in $(HAIKU_ARCHS) {
+               HAIKU_ARCHS += $(cpu) ;
+       }
+       HAIKU_DEFINES_$(architecture) += ARCH_$(cpu) ;
+
+       # directories
+       HAIKU_ARCH_OBJECT_DIR_$(architecture)
+               = [ FDirName $(HAIKU_OBJECT_BASE_DIR) $(architecture) ] ;
+       HAIKU_COMMON_DEBUG_OBJECT_DIR_$(architecture)
+               = [ FDirName $(HAIKU_ARCH_OBJECT_DIR_$(architecture)) common ] ;
+       HAIKU_DEBUG_0_OBJECT_DIR_$(architecture)
+               = [ FDirName $(HAIKU_ARCH_OBJECT_DIR_$(architecture)) release ] 
;
+
+       local level ;
+       for level in $(HAIKU_DEBUG_LEVELS[2-]) {
+               HAIKU_DEBUG_$(level)_OBJECT_DIR_$(architecture)
+                       = [ FDirName $(HAIKU_ARCH_OBJECT_DIR_$(architecture))
+                               debug_$(level) ] ;
+       }
+
+       # set variables for gcc header options
+       SetIncludePropertiesVariables HAIKU : _$(architecture) ;
+
+       # assembler flags
+       HAIKU_ASFLAGS_$(architecture) = ;
+
+       # C/C++ flags
+       if $(gccVersion[1]) >= 4 {
+               HAIKU_C++FLAGS_$(architecture) += -Wno-deprecated ;
+       }
+
+       switch $(cpu) {
+               case x86* :
+                       # Enable use of the gcc built-in atomic functions 
instead of
+                       # atomic_*(). The former are inlined and have thus less 
overhead.
+                       # They are not available with gcc 2, but the header 
will take care
+                       # of that.
+                       HAIKU_DEFINES_$(architecture) += 
B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
+       }
+
+       # warning flags
+       HAIKU_WARNING_CCFLAGS_$(architecture)
+               = -Wall -Wno-trigraphs -Wmissing-prototypes
+               -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar ;
+       HAIKU_WARNING_C++FLAGS_$(architecture) = -Wall -Wno-trigraphs
+               -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith 
-Wcast-align
+               -Wsign-compare -Wno-multichar ;
+
+       # debug flags
+       local debugFlags = -ggdb ;
+
+       # debug 0: suppress asserts
+       HAIKU_DEBUG_0_CCFLAGS_$(architecture) = [ FDefines NDEBUG=$(NDEBUG) ] ;
+       HAIKU_DEBUG_0_C++FLAGS_$(architecture) = [ FDefines NDEBUG=$(NDEBUG) ] ;
+
+       local level ;
+       for level in $(HAIKU_DEBUG_LEVELS[2-]) {
+               local flags = $(debugFlags) [ FDefines DEBUG=$(level) ] ;
+               HAIKU_DEBUG_$(level)_CCFLAGS_$(architecture) = $(flags) ;
+               HAIKU_DEBUG_$(level)_C++FLAGS_$(architecture) = $(flags) ;
+       }
+
+       if $(gccVersion[1]) >= 3 {
+               # TODO: Temporary work-around. Should be defined in the 
compiler specs
+               HAIKU_LINKFLAGS_$(architecture) += -Xlinker --no-undefined ;
+       } else {
+               HAIKU_DEFINES_$(architecture) += _BEOS_R5_COMPATIBLE_ ;
+       }
+
+       # private shared kernel/libroot headers
+       HAIKU_PRIVATE_SYSTEM_HEADERS_$(architecture)
+               = [ PrivateHeaders $(DOT) system system/arch/$(cpu) ] ;
+
+       # Add some grist to the libgcc objects
+       HAIKU_GCC_LIBGCC_OBJECTS_$(architecture)
+               = 
$(HAIKU_GCC_LIBGCC_OBJECTS_$(architecture):G=libgcc!$(architecture)) ;
+
+       # the C++ standard library
+       HAIKU_BUILD_SHARED_LIBSTDC++_$(architecture) = ;
+       if $(HAIKU_SHARED_LIBSTDC++_$(architecture)) {
+               HAIKU_LIBSTDC++_$(architecture)
+                       = $(HAIKU_SHARED_LIBSTDC++_$(architecture)) ;
+       } else {
+               # no shared library available with the compiler -- build it
+               if $(gccVersion[1]) = 2 {
+                       HAIKU_LIBSTDC++_$(architecture) = libstdc++.r4.so ;
+               } else {
+                       HAIKU_LIBSTDC++_$(architecture) = 
<$(architecture)>libstdc++.so ;
+               }
+               HAIKU_SHARED_LIBSTDC++_$(architecture)
+                       = $(HAIKU_LIBSTDC++_$(architecture)) ;
+               HAIKU_BUILD_SHARED_LIBSTDC++_$(architecture) = 1 ;
+       }
+
+       # the C++ support (runtime) library
+       HAIKU_BUILD_SHARED_LIBSUPC++_$(architecture) = ;
+       if $(HAIKU_SHARED_LIBSUPC++_$(architecture)) {
+               HAIKU_LIBSUPC++_$(architecture)
+                       = $(HAIKU_SHARED_LIBSUPC++_$(architecture)) ;
+       } else {
+               # no shared library available with the compiler -- build it for 
gcc 4
+               if $(gccVersion[1]) != 2 {
+                       HAIKU_SHARED_LIBSUPC++_$(architecture)
+                               = <$(architecture)>libsupc++.so ;
+                       HAIKU_BUILD_SHARED_LIBSUPC++_$(architecture) = 1 ;
+               }
+
+               HAIKU_LIBSUPC++_$(architecture)
+                       = $(HAIKU_SHARED_LIBSUPC++_$(architecture)) ;
+       }
+
+       # library and executable glue code
+       local commonGlueCode =
+               <src!system!glue!$(architecture)>init_term_dyn.o
+               <src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crti.o
+               <src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crtn.o
+               ;
+       HAIKU_LIBRARY_BEGIN_GLUE_CODE_$(architecture) =
+               <src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crti.o
+               <$(architecture)>crtbegin.o
+               <src!system!glue!$(architecture)>init_term_dyn.o
+               ;
+       HAIKU_LIBRARY_END_GLUE_CODE_$(architecture) =
+               <$(architecture)>crtend.o
+               <src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crtn.o
+               ;
+       HAIKU_EXECUTABLE_BEGIN_GLUE_CODE_$(architecture) =
+               <src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crti.o
+               <$(architecture)>crtbegin.o
+               <src!system!glue!$(architecture)>start_dyn.o
+               <src!system!glue!$(architecture)>init_term_dyn.o
+               ;
+       HAIKU_EXECUTABLE_END_GLUE_CODE_$(architecture)
+               = $(HAIKU_LIBRARY_END_GLUE_CODE_$(architecture)) ;
+
+       SEARCH on <$(architecture)>crtbegin.o <$(architecture)>crtend.o
+               = $(HAIKU_GCC_LIB_DIR_$(architecture)) ;
+
+       # init library name map
+       local i ;
+       for i in be bnetapi debug device game GL locale mail media midi midi2
+                       network opengl package root screensaver textencoding 
tracker
+                       translation z {
+               HAIKU_LIBRARY_NAME_MAP_$(architecture)_$(i) = lib$(i).so ;
+       }
+       HAIKU_LIBRARY_NAME_MAP_$(architecture)_libstdc++
+               = $(HAIKU_LIBSTDC++_$(architecture)) ;
+       HAIKU_LIBRARY_NAME_MAP_$(architecture)_libsupc++
+               = $(HAIKU_LIBSUPC++_$(architecture)) ;
+       HAIKU_LIBRARY_NAME_MAP_$(architecture)_input_server
+               = <nogrist>input_server ;
+       HAIKU_LIBRARY_NAME_MAP_$(architecture)_localestub
+               = <$(architecture)>liblocalestub.a ;
+}
+
+
+rule KernelArchitectureSetup architecture
+{
+       # KernelArchitectureSetup <architecture> ;
+       #
+       # Initializes the global kernel and boot loader related variables. Those
+       # don't have a packaging architecture suffix, since they are only set 
for
+       # the primary packaging architecture. <architecture> is the primary
+       # packaging architecture (supplied for convenience).
+
+       HAIKU_KERNEL_ARCH = $(HAIKU_ARCH) ;
+
+       local gccVersion = $(HAIKU_GCC_VERSION_$(architecture)) ;
+       local cpu = $(HAIKU_CPU_$(architecture)) ;
+
+       switch $(cpu) {
+               case ppc :
+                       HAIKU_BOOT_PLATFORM ?= openfirmware ;
+                       HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
+                       # offset in floppy image (>= sizeof(haiku_loader))
+                       HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - 
unused yet
+
+               case arm :
+                       HAIKU_BOOT_PLATFORM ?= u-boot ;
+                       HAIKU_BOOT_BOARD ?= verdex ;
+                       HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
+                               # in kB (there is not really a floppy on the 
gumstix ;) )
+                       # offset in floppy image (>= sizeof(haiku_loader))
+                       HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - 
unused yet
+
+               case x86 :
+                       HAIKU_BOOT_PLATFORM = bios_ia32 ;
+                       HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
+                       # offset in floppy image (>= sizeof(haiku_loader))
+                       HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
+
+                       # yasm is required for target arch x86
+                       if ! $(HAIKU_YASM) {
+                               Exit "HAIKU_YASM not set. Please re-run 
configure." ;
+                       }
+
+               case x86_64 :
+                       # x86_64 completely shares the x86 bootloader.
+                       HAIKU_BOOT_PLATFORM = bios_ia32 ;
+                       HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
+                       # offset in floppy image (>= sizeof(haiku_loader))
+                       HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
+
+                       # x86_64 kernel source is under arch/x86.
+                       HAIKU_KERNEL_ARCH = x86 ;
+
+                       # yasm is required for target arch x86_64
+                       if ! $(HAIKU_YASM) {
+                               Exit "HAIKU_YASM not set. Please re-run 
configure." ;
+                       }
+
+               case m68k :
+                       HAIKU_BOOT_PLATFORM ?= atari_m68k ;
+                       switch $(HAIKU_BOOT_PLATFORM) {
+                               case atari_m68k :
+                               {
+                                       HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # 
in kB
+                               }
+                               case amiga_m68k :
+                               {
+                                       # for now we have trouble reading from 
double-sided images
+                                       HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 880 ; # 
in kB
+                               }
+                       }
+                       # offset in floppy image (>= sizeof(haiku_loader))
+                       HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 260 ; # in kB
+
+               case mipsel :
+                       # RouterBOARD firmware (ELF image over TFTP)
+                       HAIKU_BOOT_PLATFORM = routerboard_mipsel ;
+                       # offset in floppy image (>= sizeof(haiku_loader))
+                       HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB
+
+               case * :
+                       Exit "Currently unsupported target CPU:" $(cpu) ;
+       }
+
+       # Include embedded board-specific file.
+       if $(HAIKU_BOOT_BOARD) {
+               include [ FDirName $(HAIKU_BUILD_RULES_DIR) board 
$(HAIKU_BOOT_BOARD)
+                       BoardSetup ] ;
+       }
+
+       # private kernel headers to be used when compiling kernel code
+       HAIKU_PRIVATE_KERNEL_HEADERS =
+               [ PrivateHeaders $(DOT) kernel libroot shared
+                       kernel/boot/platform/$(HAIKU_BOOT_PLATFORM) ]
+               [ ArchHeaders $(HAIKU_KERNEL_ARCH) ]
+               [ FDirName $(HAIKU_COMMON_DEBUG_OBJECT_DIR_$(architecture)) 
system
+                       kernel ]
+               $(HAIKU_PRIVATE_SYSTEM_HEADERS_$(architecture))
+               ;
+
+       # C/C++ flags
+       local gccBaseFlags = $(HAIKU_GCC_BASE_FLAGS_$(architecture))
+               -finline -fno-builtin ;
+
+       if $(gccVersion[1]) >= 4 {
+               gccBaseFlags += -ffreestanding ;
+       }
+
+       local g++BaseFlags = $(gccBaseFlags) -fno-exceptions ;
+
+       if $(gccVersion[1]) >= 3 {
+               g++BaseFlags += -fno-use-cxa-atexit ;
+       }
+
+       HAIKU_KERNEL_CCFLAGS = $(HAIKU_CCFLAGS_$(architecture)) $(gccBaseFlags) 
;
+       HAIKU_KERNEL_C++FLAGS = $(HAIKU_C++FLAGS_$(architecture)) 
$(g++BaseFlags) ;
+       HAIKU_BOOT_CCFLAGS = $(HAIKU_CCFLAGS_$(architecture)) $(gccBaseFlags) ;
+       HAIKU_BOOT_C++FLAGS = $(HAIKU_C++FLAGS_$(architecture)) $(g++BaseFlags) 
;
+       HAIKU_BOOT_LINKFLAGS = ;
+
+       HAIKU_KERNEL_PIC_CCFLAGS = -fno-pic ;
+       HAIKU_KERNEL_PIC_LINKFLAGS = ;
+       HAIKU_KERNEL_ADDON_LINKFLAGS = ;
+
+       switch $(cpu) {
+               case ppc :
+                       # Build a position independent PPC kernel. We need to 
be able to
+                       # relocate the kernel, since the virtual address space 
layout at
+                       # boot time is not fixed.
+                       HAIKU_KERNEL_PIC_CCFLAGS = -fPIE ;
+                       HAIKU_KERNEL_PIC_LINKFLAGS = -shared -fPIE ;
+
+               case m68k :
+                       # We don't want to have to handle emulating missing FPU 
opcodes for
+                       # 040 and 060 in the kernel.
+                       HAIKU_KERNEL_CCFLAGS += -m68020-60 ;
+                       HAIKU_KERNEL_C++FLAGS += -m68020-60 ;
+
+               case x86 :
+                       HAIKU_KERNEL_CCFLAGS += -march=pentium ;
+                       HAIKU_KERNEL_C++FLAGS += -march=pentium ;
+
+               case x86_64 :
+                       # Kernel lives in the top 2GB of the address space, use 
kernel code
+                       # model.
+                       HAIKU_KERNEL_PIC_CCFLAGS += -mcmodel=kernel ;
+
+                       # Disable the red zone, which cannot be used in kernel 
code due to
+                       # interrupts, and always enable the frame pointer so 
stack traces
+                       # are correct.
+                       HAIKU_KERNEL_CCFLAGS += -mno-red-zone 
-fno-omit-frame-pointer ;
+                       HAIKU_KERNEL_C++FLAGS += -mno-red-zone 
-fno-omit-frame-pointer ;
+                       HAIKU_KERNEL_PIC_LINKFLAGS += -z max-page-size=0x1000 ;
+                       HAIKU_KERNEL_ADDON_LINKFLAGS += -z max-page-size=0x1000 
;
+
+                       # Bootloader is 32-bit.
+                       HAIKU_BOOT_LINKFLAGS += -m elf_i386_haiku ;
+                       HAIKU_BOOT_CCFLAGS += -m32 -march=pentium ;
+                       HAIKU_BOOT_C++FLAGS += -m32 -march=pentium ;
+       }
+
+       # warning flags
+       HAIKU_KERNEL_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes
+               -Wno-multichar ;
+       HAIKU_KERNEL_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-multichar ;
+
+       # debug flags
+       local level ;
+       for level in $(HAIKU_DEBUG_LEVELS) {
+               local flags = $(HAIKU_DEBUG_FLAGS) [ FDefines DEBUG=$(level) ] ;
+               HAIKU_KERNEL_DEBUG_$(level)_CCFLAGS
+                       = $(HAIKU_DEBUG_$(level)_CCFLAGS_$(architecture)) ;
+               HAIKU_KERNEL_DEBUG_$(level)_C++FLAGS
+                       = $(HAIKU_DEBUG_$(level)_C++FLAGS_$(architecture)) ;
+       }
+
+       # defines
+       HAIKU_KERNEL_DEFINES += _KERNEL_MODE ;
+
+       HAIKU_DEFINES_$(architecture)
+               += BOOT_ARCHIVE_IMAGE_OFFSET=$(HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET) 
;
+               # TODO: That doesn't need to be a general define. It's just 
needed for
+               # compiling (part of) the boot loader.
+
+       # kernel add-on glue code
+       HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = <$(architecture)>crtbegin.o
+               <src!system!glue!$(architecture)>haiku_version_glue.o ;
+       HAIKU_KERNEL_ADDON_END_GLUE_CODE
+               = $(HAIKU_GCC_LIBGCC_$(architecture)) <$(architecture)>crtend.o 
;
+}
+
+
+rule ArchitectureSetupWarnings architecture
+{
+       # ArchitectureSetupWarnings <architecture> ;
+       #
+       # Sets up compiler warnings and error flags for various subdirectories 
for
+       # the given packaging architecture.
+
+       local cpu = $(HAIKU_CPU_$(architecture)) ;
+       switch $(cpu) {
+               case arm :
+                       return ;
+                               # we use #warning as placeholders for things to 
write...
+               case m68k :
+                       return ;
+                               # we use #warning as placeholders for things to 
write...
+               case mipsel :
+                       return ;
+                               # we use #warning as placeholders for things to 
write...
+       }
+
+
+       # enable -Werror for certain parts of the source tree
+       HAIKU_WERRORFLAGS = ;
+       local gccVersion = $(HAIKU_GCC_VERSION_$(architecture)) ;
+       if $(gccVersion[1]) >= 4 {
+               # -Wuninitialized gives too many false positives.
+               HAIKU_WERRORFLAGS = -Wno-error=uninitialized ;
+
+               # TODO: remove the -Wno-unused-but-set-variable option
+               HAIKU_WERRORFLAGS += -Wno-unused-but-set-variable ;
+       }
+
+       HAIKU_WERROR_ARCH = $(architecture) ;
+
+       rule EnableWerror dirTokens : scope {
+               AppendToConfigVar TARGET_WARNING_CCFLAGS_$(HAIKU_WERROR_ARCH)
+                       : HAIKU_TOP $(dirTokens)
+                       : -Werror $(HAIKU_WERRORFLAGS) : $(scope) ;
+               AppendToConfigVar TARGET_WARNING_C++FLAGS_$(HAIKU_WERROR_ARCH)
+                       : HAIKU_TOP $(dirTokens)
+                       : -Werror $(HAIKU_WERRORFLAGS) : $(scope) ;
+       }
+
+       # Work-around for GCC 2 problem -- despite -Wno-multichar it reports
+       # multichar warnings in headers/private/kernel/debugger_keymaps.h 
included
+       # by src/system/kernel/arch/x86/arch_debug_console.cpp.
+       if $(gccVersion[1]) = 2 {
+               local file = <src!system!kernel!arch!x86>arch_debug_console.o ;
+               TARGET_WARNING_C++FLAGS_$(architecture) on $(file)
+                       = [ on $(file) return 
$(TARGET_WARNING_C++FLAGS_$(architecture)) ] ;
+       }
+
+       EnableWerror src add-ons accelerants 3dfx ;
+       EnableWerror src add-ons accelerants ati ;
+       EnableWerror src add-ons accelerants common ;
+       EnableWerror src add-ons accelerants et6x00 ;
+#      EnableWerror src add-ons accelerants intel_extreme ;
+#      EnableWerror src add-ons accelerants matrox ;
+       EnableWerror src add-ons accelerants neomagic ;
+#      EnableWerror src add-ons accelerants nvidia ;
+       EnableWerror src add-ons accelerants nvidia_gpgpu ;
+#      EnableWerror src add-ons accelerants radeon ;
+#      EnableWerror src add-ons accelerants radeon_hd ;
+       EnableWerror src add-ons accelerants s3 ;
+       EnableWerror src add-ons accelerants skeleton ;
+       EnableWerror src add-ons accelerants vesa ;
+       EnableWerror src add-ons accelerants via ;
+       EnableWerror src add-ons accelerants vmware ;
+       EnableWerror src add-ons bluetooth ;
+       EnableWerror src add-ons decorators ;
+       EnableWerror src add-ons disk_systems ;
+       EnableWerror src add-ons input_server devices ;
+#      EnableWerror src add-ons input_server filters ;
+#      EnableWerror src add-ons input_server methods ;
+       EnableWerror src add-ons kernel bluetooth ;
+#      EnableWerror src add-ons kernel bus_managers acpi ;
+       EnableWerror src add-ons kernel bus_managers agp_gart ;
+       EnableWerror src add-ons kernel bus_managers ata ;
+       EnableWerror src add-ons kernel bus_managers config_manager ;
+#      EnableWerror src add-ons kernel bus_managers firewire ;
+       EnableWerror src add-ons kernel bus_managers isa ;
+       EnableWerror src add-ons kernel bus_managers pci ;
+#      EnableWerror src add-ons kernel bus_managers ps2 ; # gcc2
+       EnableWerror src add-ons kernel bus_managers scsi ;
+       EnableWerror src add-ons kernel bus_managers usb ;
+       EnableWerror src add-ons kernel busses agp_gart ;
+       EnableWerror src add-ons kernel busses ata ;
+       EnableWerror src add-ons kernel busses scsi ;
+       EnableWerror src add-ons kernel busses usb ;
+       EnableWerror src add-ons kernel console ;
+       EnableWerror src add-ons kernel cpu ;
+#      EnableWerror src add-ons kernel debugger ; # gcc2
+#      EnableWerror src add-ons kernel drivers audio ;
+       EnableWerror src add-ons kernel drivers bluetooth ;
+       EnableWerror src add-ons kernel drivers bus ;
+       EnableWerror src add-ons kernel drivers common ;
+       EnableWerror src add-ons kernel drivers disk ;
+       EnableWerror src add-ons kernel drivers dvb ;
+#      EnableWerror src add-ons kernel drivers graphics ;
+#      EnableWerror src add-ons kernel drivers input ;
+       EnableWerror src add-ons kernel drivers joystick ;
+       EnableWerror src add-ons kernel drivers midi ;
+       EnableWerror src add-ons kernel drivers misc ;
+#      EnableWerror src add-ons kernel drivers network ;
+       EnableWerror src add-ons kernel drivers ports ;
+#      EnableWerror src add-ons kernel drivers power ;
+       EnableWerror src add-ons kernel drivers printer ;
+       EnableWerror src add-ons kernel drivers random ;
+       EnableWerror src add-ons kernel drivers tty ;
+       EnableWerror src add-ons kernel drivers video ;
+       EnableWerror src add-ons kernel file_systems bfs ;
+       EnableWerror src add-ons kernel file_systems cdda ;
+#      EnableWerror src add-ons kernel file_systems ext2 ;
+#      EnableWerror src add-ons kernel file_systems fat ;
+#      EnableWerror src add-ons kernel file_systems googlefs ;
+       EnableWerror src add-ons kernel file_systems iso9660 ;
+       EnableWerror src add-ons kernel file_systems layers ;
+       EnableWerror src add-ons kernel file_systems netfs ;
+       EnableWerror src add-ons kernel file_systems nfs ;
+       EnableWerror src add-ons kernel file_systems nfs4 ;
+#      EnableWerror src add-ons kernel file_systems ntfs ;
+       EnableWerror src add-ons kernel file_systems packagefs ;
+       EnableWerror src add-ons kernel file_systems ramfs ;
+#      EnableWerror src add-ons kernel file_systems reiserfs ;
+       EnableWerror src add-ons kernel file_systems udf ;
+       EnableWerror src add-ons kernel file_systems userlandfs ;
+       EnableWerror src add-ons kernel generic ;
+#      EnableWerror src add-ons kernel network datalink_protocols ;
+       EnableWerror src add-ons kernel network devices ;
+       EnableWerror src add-ons kernel network dns_resolver ;
+       EnableWerror src add-ons kernel network notifications ;
+       EnableWerror src add-ons kernel network ppp ;
+       EnableWerror src add-ons kernel network protocols ;
+#      EnableWerror src add-ons kernel network stack ;
+       EnableWerror src add-ons kernel partitioning_systems ;
+       EnableWerror src add-ons locale ;
+       EnableWerror src add-ons mail_daemon ;
+       EnableWerror src add-ons media media-add-ons demultiplexer ;
+       EnableWerror src add-ons media media-add-ons dvb ;
+       EnableWerror src add-ons media media-add-ons esound_sink ;
+       EnableWerror src add-ons media media-add-ons finepix_webcam ;
+       EnableWerror src add-ons media media-add-ons firewire_dv ;
+       EnableWerror src add-ons media media-add-ons legacy ;
+       EnableWerror src add-ons media media-add-ons mixer ;
+       EnableWerror src add-ons media media-add-ons multi_audio ;
+       EnableWerror src add-ons media media-add-ons opensound ;
+       EnableWerror src add-ons media media-add-ons radeon ;
+       EnableWerror src add-ons media media-add-ons reader ;
+       EnableWerror src add-ons media media-add-ons tone_producer_demo ;
+       EnableWerror src add-ons media media-add-ons usb_vision ;
+#      EnableWerror src add-ons media media-add-ons usb_webcam ;
+       EnableWerror src add-ons media media-add-ons video_mixer ;
+#      EnableWerror src add-ons media media-add-ons video_producer_demo ;
+       EnableWerror src add-ons media media-add-ons videowindow ;
+       EnableWerror src add-ons media media-add-ons writer ;
+       EnableWerror src add-ons media plugins ac3_decoder ;
+       EnableWerror src add-ons media plugins aiff_reader ;
+       EnableWerror src add-ons media plugins ape_reader ;
+#      EnableWerror src add-ons media plugins asf_reader ;
+       EnableWerror src add-ons media plugins au_reader ;
+#      EnableWerror src add-ons media plugins avi_reader ;
+#      EnableWerror src add-ons media plugins ffmpeg ;
+#      EnableWerror src add-ons media plugins matroska ;
+#      EnableWerror src add-ons media plugins mov_reader ;
+       EnableWerror src add-ons media plugins mp3_decoder ;
+#      EnableWerror src add-ons media plugins mp3_reader ;
+       EnableWerror src add-ons media plugins mp4_reader ;
+       EnableWerror src add-ons media plugins musepack ;
+#      EnableWerror src add-ons media plugins ogg ;
+#      EnableWerror src add-ons media plugins raw_decoder ;
+#      EnableWerror src add-ons media plugins speex ;
+       EnableWerror src add-ons media plugins theora ;
+       EnableWerror src add-ons media plugins vorbis ;
+#      EnableWerror src add-ons media plugins wav_reader ;
+       EnableWerror src add-ons media plugins xvid_decoder ;
+       EnableWerror src add-ons opengl ;
+       EnableWerror src add-ons print ;
+       EnableWerror src add-ons screen_savers ;
+       EnableWerror src add-ons tracker ;
+       EnableWerror src add-ons translators bmp ;
+#      EnableWerror src add-ons translators exr ;
+       EnableWerror src add-ons translators gif ;
+#      EnableWerror src add-ons translators hpgs ;
+       EnableWerror src add-ons translators hvif ;
+       EnableWerror src add-ons translators ico ;
+#      EnableWerror src add-ons translators jpeg ; # gcc2
+       EnableWerror src add-ons translators jpeg2000 ;
+       EnableWerror src add-ons translators pcx ;
+#      EnableWerror src add-ons translators png ; # gcc2
+       EnableWerror src add-ons translators ppm ;
+       EnableWerror src add-ons translators raw ;
+       EnableWerror src add-ons translators rtf ;
+       EnableWerror src add-ons translators sgi ;
+       EnableWerror src add-ons translators shared ;
+#      EnableWerror src add-ons translators stxt ;
+       EnableWerror src add-ons translators tga ;
+       EnableWerror src add-ons translators tiff ;
+#      EnableWerror src add-ons translators wonderbrush ;
+       EnableWerror src add-ons print ;
+       EnableWerror src bin package ;
+       EnableWerror src apps ;
+       EnableWerror src kits ;
+       EnableWerror src preferences ;
+       EnableWerror src servers ;
+       EnableWerror src system kernel ;
+       EnableWerror src system libroot add-ons ;
+       EnableWerror src system libroot posix locale ;
+       EnableWerror src system libroot posix wchar ;
+       EnableWerror src system runtime_loader ;
+}
+
+
+rule MultiArchIfPrimary ifValue : elseValue
+{
+       # MultiArchIfPrimary <ifValue> : <elseValue> ;
+       #
+       # Returns one of the two given values depending on whether
+       # TARGET_PACKAGING_ARCH is currently set to the primary packaging
+       # architecture.
+
+       if $(TARGET_PACKAGING_ARCH) = $(TARGET_PACKAGING_ARCHS[1]) {
+               return $(ifValue) ;
+       }
+       return $(elseValue) ;
+}
+
+
+rule MultiArchConditionalGristFiles files : primaryGrist : secondaryGrist
+{
+       # MultiArchConditionalGristFiles <files> : <primaryGrist>
+       #       : <secondaryGrist> ;
+       #
+       # Returns <files> with their grist set to either <primaryGrist> or
+       # <secondaryGrist> depending on whether TARGET_PACKAGING_ARCH is 
currently
+       # set to the primary packaging architecture.
+
+       local grist = [ MultiArchIfPrimary $(primaryGrist) : $(secondaryGrist) 
] ;
+       return $(files:G=$(grist:E=)) ;
+}
+
+
+rule MultiArchDefaultGristFiles files : gristPrefix
+{
+       # MultiArchDefaultGristFiles <files> : <gristPrefix> ;
+       #
+       # Convenient shorthand for MultiArchConditionalGristFiles for the common
+       # case that for a secondary packaging architecture the packaging
+       # architecture name shall be appended to the grist while it shall be 
omitted
+       # for the primary packaging architecture. IOW, if TARGET_PACKAGING_ARCH 
is
+       # currently set to the primary packaging architecture <files> are 
returned
+       # with their grist set to <gristPrefix>, otherwise <files> are returned 
with
+       # their grist set to <gristPrefix>!<arch> (<arch> being the name of the
+       # packaging architecture) respectively <arch> (if <gristPrefix> is 
empty).
+
+       local secondaryGrist = $(gristPrefix)!$(TARGET_PACKAGING_ARCH) ;
+       secondaryGrist ?= $(TARGET_PACKAGING_ARCH) ;
+
+       return [ MultiArchConditionalGristFiles $(files) : $(gristPrefix) :
+               $(secondaryGrist) ] ;
+}
+
+
+rule MultiArchSubDirSetup architectures
+{
+       # MultiArchSubDirSetup <architectures> ;
+       #
+       # For each of the given packaging architectures <architectures> that are
+       # in the packaging architectures configured for the build (or all 
configured
+       # packaging architectures, if <architectures> is empty) an object is
+       # prepared that can be used for an "on ... { ... }" block to set up 
subdir
+       # variables for the respective packaging architecture. Most notably
+       # TARGET_PACKAGING_ARCH, TARGET_ARCH, TARGET_LIBSUPC++, and 
TARGET_LIBSTDC++
+       # are set to the values for the respective packaging architecture. The
+       # per-subdir variables SOURCE_GRIST, LOCATE_TARGET, LOCATE_SOURCE,
+       # SEARCH_SOURCE, *_LOCATE_TARGET, are reset. All SUBDIR* and config
+       # variables are set to the values they had when this rule was invoked.
+
+       local result ;
+       architectures ?= $(TARGET_PACKAGING_ARCHS) ;
+       local architecture ;
+       for architecture in $(architectures) {
+               if ! $(architecture) in $(TARGET_PACKAGING_ARCHS) {
+                       continue ;
+               }
+
+               local architectureObject = $(architecture:G=<arch-object>) ;
+               result += $(architectureObject) ;
+
+               # Set the variables that default to the values of the respective
+               # variables for the primary architecture.
+               TARGET_PACKAGING_ARCH on $(architectureObject) = 
$(architecture) ;
+
+               local var ;
+               for var in TARGET_ARCH TARGET_LIBSUPC++ TARGET_LIBSTDC++ {
+                       $(var) on $(architectureObject) = 
$($(var)_$(architecture)) ;
+               }
+
+               # Clone the current config variable values and the variables 
SubDir
+               # resets.
+               for var in $(AUTO_SET_UP_CONFIG_VARIABLES) SUBDIR$(SUBDIRRESET) 
{
+                       $(var) on $(architectureObject) = $($(var)) ;
+               }
+
+               # adjust SOURCE_GRIST
+               SOURCE_GRIST on $(architectureObject)
+                       = $(SOURCE_GRIST:E=)!$(architecture) ;
+
+               # Adjust the subdir's object dirs that are architecture 
dependent. To
+               # avoid duplicating the code from SetupObjectsDir, we call it. 
Since it
+               # sets global variables, we set these variables on our object, 
call
+               # SetupObjectsDir in an "on" block, and grab the new variable 
values.
+               local hostTarget = HOST TARGET ;
+               local objectDirVars =
+                       COMMON_ARCH COMMON_DEBUG DEBUG_$(HAIKU_DEBUG_LEVELS)
+                       ;
+               objectDirVars =
+                       COMMON_PLATFORM_LOCATE_TARGET
+                       $(hostTarget)_$(objectDirVars)_LOCATE_TARGET
+                       LOCATE_TARGET
+                       LOCATE_SOURCE
+                       SEARCH_SOURCE
+                       ;
+
+               for var in $(objectDirVars) {
+                       $(var) on $(architectureObject) = ;
+               }
+
+               on $(architectureObject) {
+                       SetupObjectsDir ;
+
+                       for var in $(objectDirVars) {
+                               $(var) on $(architectureObject) = $($(var)) ;
+                       }
+               }
+       }
+
+       return $(result) ;
+}
diff --git a/build/jam/BeOSRules b/build/jam/BeOSRules
index c210679..17d3715 100644
--- a/build/jam/BeOSRules
+++ b/build/jam/BeOSRules
@@ -232,9 +232,11 @@ rule ResComp
                        cc = $(HOST_CC) ;
                        localIncludesOption = $(HOST_LOCAL_INCLUDES_OPTION) ;
                } else {
-                       defines += $(TARGET_DEFINES) ;
-                       cc = $(TARGET_CC) ;
-                       localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
+                       defines += $(TARGET_DEFINES_$(TARGET_PACKAGING_ARCH))
+                               $(TARGET_DEFINES) ;
+                       cc = $(TARGET_CC_$(TARGET_PACKAGING_ARCH)) ;
+                       localIncludesOption
+                               = 
$(TARGET_LOCAL_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
                }
        }
 
diff --git a/build/jam/BootRules b/build/jam/BootRules
index fde7d54..de5f677 100644
--- a/build/jam/BootRules
+++ b/build/jam/BootRules
@@ -24,8 +24,9 @@ rule SetupBoot
         ASFLAGS on $(object) = $(TARGET_BOOT_CCFLAGS) ;
 
                # override warning flags
-               TARGET_WARNING_CCFLAGS on $(object) = 
$(TARGET_KERNEL_WARNING_CCFLAGS) ;
-               TARGET_WARNING_C++FLAGS on $(object)
+               TARGET_WARNING_CCFLAGS_$(TARGET_PACKAGING_ARCH) on $(object)
+                       = $(TARGET_KERNEL_WARNING_CCFLAGS) ;
+               TARGET_WARNING_C++FLAGS_$(TARGET_PACKAGING_ARCH) on $(object)
                        = $(TARGET_KERNEL_WARNING_C++FLAGS) ;
        }
 }
@@ -40,7 +41,7 @@ rule BootLd
 {
        # BootLd <name> : <objs> : <linkerscript> : <args> ;
 
-       LINK on $(1) = $(TARGET_LD) ;
+       LINK on $(1) = $(TARGET_LD_$(TARGET_PACKAGING_ARCH)) ;
 
        LINKFLAGS on $(1) = $(4) ;
        if $(3) { LINKFLAGS on $(1) += --script=$(3) ; }
@@ -125,5 +126,5 @@ actions BootStaticLibraryObjects
        # Force recreation of the archive to avoid build errors caused by
        # stale dependencies after renaming or deleting object files.
        $(RM) "$(1)"
-       $(HAIKU_AR) -r "$(1)" "$(2)" ;
+       $(HAIKU_AR_$(TARGET_PACKAGING_ARCH)) -r "$(1)" "$(2)" ;
 }
diff --git a/build/jam/BuildFeatures b/build/jam/BuildFeatures
index 4bc1a8f..9dcd93e 100644
--- a/build/jam/BuildFeatures
+++ b/build/jam/BuildFeatures
@@ -4,10 +4,13 @@
 # for an optional package.
 
 
+local architecture = $(TARGET_PACKAGING_ARCH) ;
+
+
 # Add the target architecture as a build feature.
-EnableBuildFeatures $(HAIKU_ARCH) ;
+EnableBuildFeatures $(TARGET_ARCH_$(architecture)) ;
 
-if $(HAIKU_GCC_VERSION[1]) = 2 {
+if $(TARGET_GCC_VERSION_$(architecture)[1]) = 2 {
        EnableBuildFeatures gcc2 ;
 }
 
@@ -122,7 +125,7 @@ if ! 1 {
 
 # LLVM
 if $(TARGET_ARCH) = x86 {
-       if $(HAIKU_GCC_VERSION[1]) >= 4 {
+       if $(TARGET_GCC_VERSION_$(architecture)[1]) >= 4 {
                HAIKU_LLVM_FILE = llvm-3.2-x86-gcc4-2012-12-21.zip ;
                local zipFile = [ DownloadFile $(HAIKU_LLVM_FILE)
                        : $(baseURL)/$(HAIKU_LLVM_FILE) ] ;
@@ -395,11 +398,13 @@ if $(TARGET_ARCH) = x86 {
 if $(HAIKU_BUILD_FEATURE_WEBKIT) {
        if $(TARGET_ARCH) != x86 && $(TARGET_ARCH) != x86_64 {
                Echo "WebKit support not available on $(TARGET_ARCH)" ;
-       } else if $(HAIKU_GCC_VERSION[1]) < 4 {
+       } else if $(TARGET_GCC_VERSION_$(architecture)[1]) < 4 {
                if ! $(isHybridBuild) {
-                       Echo "WebKit support not available on gcc 
$(HAIKU_GCC_VERSION[1])" ;
+                       Echo "WebKit support not available on gcc"
+                               "$(TARGET_GCC_VERSION_$(architecture)[1])" ;
                } else {
-                       Echo "WebKit to be utilized by gcc4 inside 
$(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR)" ;
+                       Echo "WebKit to be utilized by gcc4 inside"
+                               "$(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR)" ;
                }
        } else {
                local zipFile = [ DownloadFile $(HAIKU_WEBKIT_FILE)
diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup
index 3ba10a1..aee1b19 100644
--- a/build/jam/BuildSetup
+++ b/build/jam/BuildSetup
@@ -97,401 +97,61 @@ HAIKU_CONFIG_HEADERS = [ FDirName $(HAIKU_TOP) build 
user_config_headers ]
        [ FDirName $(HAIKU_TOP) build config_headers ] ;
 
 
-#pragma mark -
-
-# haiku target platform settings
-
-# analyze GCC version
-if $(HAIKU_HOST_BUILD_ONLY) = 1 {
-       HAIKU_GCC_VERSION = 0 0 0 ;
-} else {
-       HAIKU_GCC_VERSION = [ FAnalyzeGCCVersion HAIKU_GCC_RAW_VERSION ] ;
-}
+# object directories common to all architectures
+HAIKU_OBJECT_BASE_DIR = [ FDirName $(HAIKU_OBJECT_DIR) haiku ] ;
+HAIKU_COMMON_ARCH_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_BASE_DIR) common ] ;
 
-# enable GCC -pipe option, if requested
-if $(HAIKU_USE_GCC_PIPE) = 1 {
-       HAIKU_GCC_BASE_FLAGS = -pipe ;
-}
 
-# disable strict aliasing on anything newer than gcc 2 as it may lead to
-# unexpected results. also disable the tree-vrp (value range propagation)
-# optimization for now as with the current gcc4 version we are using this
-# results in some broken code.
-# TODO: remove the -fno-strict-aliasing option when all code has been
-#              analyzed/fixed with regard to aliasing.
-# TODO: retest/remove the -fno-tree-vrp option as soon as we have updated our
-#              gcc4 compiler. See this discussion on some issues:
-# 
//www.freelists.org/post/haiku-development/hrev45320-Yet-another-nonobvious-effect-of-ftreevrp-optimization
-if $(HAIKU_GCC_VERSION[1]) >= 3 {
-       HAIKU_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
-}
+#pragma mark - haiku target platform settings
 
-# disable array bounds warnings on gcc 4.6 or newer since they trigger
-# too many false positives. Coverity does a better job of this kind of analysis
-# anyways.
-if $(HAIKU_GCC_VERSION[1]) >= 4 {
-       HAIKU_GCC_BASE_FLAGS += -Wno-array-bounds ;
-}
 
-# activating graphite optimizations
-if $(HAIKU_USE_GCC_GRAPHITE) = 1 {
-       HAIKU_GCC_BASE_FLAGS += -floop-interchange -ftree-loop-distribution
-               -floop-strip-mine -floop-block ;
+local architecture ;
+for architecture in $(HAIKU_PACKAGING_ARCHS) {
+       ArchitectureSetup $(architecture) ;
 }
 
-if $(HOST_GCC_VERSION[1]) >= 3 {
-       HOST_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
+# TODO: Might not be needed anymore.
+if $(HAIKU_HOST_BUILD_ONLY) = 1 {
+       HAIKU_GCC_VERSION = 0 0 0 ;
 }
 
-# override gcc 2.95.3's header directory -- strictly necessary only when using
-# the BeOS native compiler (since its headers are incompatible), but it doesn't
-# harm for the cross-compiler either.
-if $(HAIKU_GCC_VERSION[1]) = 2 {
-       HAIKU_GCC_HEADERS_DIR = [ FDirName $(HAIKU_TOP) headers build 
gcc-2.95.3 ] ;
+if $(HAIKU_PACKAGING_ARCH) {
+       KernelArchitectureSetup $(HAIKU_PACKAGING_ARCH) ;
 }
 
-# initial state for flags etc.
-HAIKU_C++ ?= $(HAIKU_CC) ;
-HAIKU_LINK = $(HAIKU_CC) ;
-HAIKU_LINKFLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
-HAIKU_BOOT_LINKFLAGS = ;
-
-HAIKU_HDRS = [ FStandardHeaders ] ;
-HAIKU_KERNEL_CCFLAGS = $(HAIKU_CCFLAGS) $(HAIKU_GCC_BASE_FLAGS) ;
-HAIKU_KERNEL_C++FLAGS = $(HAIKU_C++FLAGS) $(HAIKU_GCC_BASE_FLAGS) ;
-HAIKU_BOOT_CCFLAGS = $(HAIKU_CCFLAGS) $(HAIKU_GCC_BASE_FLAGS) ;
-HAIKU_BOOT_C++FLAGS = $(HAIKU_C++FLAGS) $(HAIKU_GCC_BASE_FLAGS) ;
-HAIKU_CCFLAGS += $(HAIKU_GCC_BASE_FLAGS) -nostdinc ;
-HAIKU_C++FLAGS += $(HAIKU_GCC_BASE_FLAGS) -nostdinc ;
 HAIKU_DEFINES = __HAIKU__ ;
-HAIKU_NO_WERROR ?= 0 ;
+HAIKU_LIBSUPC++ = $(HAIKU_LIBSUPC++_$(HAIKU_PACKAGING_ARCH)) ;
+HAIKU_LIBSTDC++ = $(HAIKU_LIBSTDC++_$(HAIKU_PACKAGING_ARCH)) ;
+
 
 # distro compatibility level defines
 HAIKU_DISTRO_COMPATIBILITY ?= "default" ;
 switch $(HAIKU_DISTRO_COMPATIBILITY) {
-       case official   : {
+       case official :
                HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_OFFICIAL ;
                HAIKU_INCLUDE_TRADEMARKS = "" ;
-       }
-       case compatible : {
+       case compatible :
                HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_COMPATIBLE ;
                HAIKU_INCLUDE_TRADEMARKS = "" ;
-       }
-       case "default"  : {
+       case "default" :
                HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_DEFAULT ;
                HAIKU_INCLUDE_TRADEMARKS = ;
-       }
-       case *                  : Exit "Invalid value for 
HAIKU_DISTRO_COMPATIBILITY:"
-                                               $(HAIKU_DISTRO_COMPATIBILITY) ;
-}
-
-# determine the endianness of the host
-switch $(HOST_GCC_MACHINE) {
-       case amd64-*    : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
-       case i?86-*             : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
-       case powerpc-*  : HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
-       case x86_64-*   : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
-
-       # the following are rather unlikely as hosts ...
-       case arm-*              : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
-       case m68k-*             : HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
-       case mipsel-*   : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
-       case *                  : Exit "Unsupported gcc host machine:" 
$(HOST_GCC_MACHINE) ;
-}
-
-switch $(HAIKU_CPU) {
-       case ppc :
-       {
-               HAIKU_DEFINES += __POWERPC__ ;
-               HAIKU_BOOT_PLATFORM ?= openfirmware ;
-               HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
-               # offset in floppy image (>= sizeof(haiku_loader))
-               HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
-       }
-       case arm :
-       {
-               HAIKU_DEFINES += __ARM__ ;
-               HAIKU_BOOT_PLATFORM ?= u-boot ;
-               HAIKU_BOOT_BOARD ?= verdex ;
-               HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
-                       # in kB (there is not really a floppy on the gumstix ;) 
)
-               # offset in floppy image (>= sizeof(haiku_loader))
-               HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
-               HAIKU_NO_WERROR = 1 ;
-                       # we use #warning as placeholders for things to write...
-       }
-       case x86 :
-       {
-               HAIKU_DEFINES += __INTEL__ ;
-               HAIKU_BOOT_PLATFORM = bios_ia32 ;
-               HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
-               # offset in floppy image (>= sizeof(haiku_loader))
-               HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
-
-               # yasm is required for target arch x86
-               if ! $(HAIKU_YASM) {
-                       Exit "HAIKU_YASM not set. Please re-run configure." ;
-               }
-       }
-       case x86_64 :
-       {
-               # x86_64 completely shares the x86 bootloader.
-               HAIKU_BOOT_PLATFORM = bios_ia32 ;
-               HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
-               # offset in floppy image (>= sizeof(haiku_loader))
-               HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
-
-               # x86_64 kernel source is under arch/x86.
-               HAIKU_KERNEL_ARCH = x86 ;
-
-               # yasm is required for target arch x86_64
-               if ! $(HAIKU_YASM) {
-                       Exit "HAIKU_YASM not set. Please re-run configure." ;
-               }
-       }
-       case m68k :
-       {
-               HAIKU_DEFINES += __M68K__ ;
-               HAIKU_BOOT_PLATFORM ?= atari_m68k ;
-               switch $(HAIKU_BOOT_PLATFORM) {
-                       case atari_m68k :
-                       {
-                               HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
-                       }
-                       case amiga_m68k :
-                       {
-                               # for now we have trouble reading from 
double-sided images
-                               HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 880 ; # in kB
-                       }
-               }
-               # offset in floppy image (>= sizeof(haiku_loader))
-               HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 260 ; # in kB
-               HAIKU_NO_WERROR = 1 ;
-                       # we use #warning as placeholders for things to write...
-       }
-       case mipsel :
-       {
-               HAIKU_DEFINES += __MIPSEL__ ;
-               # RouterBOARD firmware (ELF image over TFTP)
-               HAIKU_BOOT_PLATFORM = routerboard_mipsel ;
-               # offset in floppy image (>= sizeof(haiku_loader))
-               HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB
-               HAIKU_NO_WERROR = 1 ;
-                       # we use #warning as placeholders for things to write...
-       }
        case * :
-               Exit "Currently unsupported target CPU:" $(HAIKU_CPU) ;
-}
-
-# strip is required
-if ! $(HAIKU_STRIP) {
-       Exit "HAIKU_STRIP not set. Please re-run configure." ;
-}
-
-# Include embedded board-specific file.
-if $(HAIKU_BOOT_BOARD) {
-       include [ FDirName $(HAIKU_BUILD_RULES_DIR) board $(HAIKU_BOOT_BOARD)
-               BoardSetup ] ;
-}
-
-HAIKU_ARCH ?= $(HAIKU_CPU) ;
-HAIKU_ARCH_MACRO_DEFINE = ARCH_$(HAIKU_ARCH) ;
-HAIKU_DEFINES += $(HAIKU_ARCH_MACRO_DEFINE) ;
-HAIKU_DEFINES += BOOT_ARCHIVE_IMAGE_OFFSET=$(HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET) ;
-HAIKU_KERNEL_ARCH ?= $(HAIKU_ARCH) ;
-HAIKU_ATA_STACK ?= 1 ;
-
-# directories
-HAIKU_OBJECT_BASE_DIR = [ FDirName $(HAIKU_OBJECT_DIR) haiku ] ;
-HAIKU_COMMON_ARCH_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_BASE_DIR) common ] ;
-HAIKU_ARCH_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_BASE_DIR) $(HAIKU_ARCH) ] ;
-HAIKU_COMMON_DEBUG_OBJECT_DIR = [ FDirName $(HAIKU_ARCH_OBJECT_DIR) common ] ;
-HAIKU_DEBUG_0_OBJECT_DIR = [ FDirName $(HAIKU_ARCH_OBJECT_DIR) release ] ;
-
-local level ;
-for level in $(HAIKU_DEBUG_LEVELS[2-]) {
-       HAIKU_DEBUG_$(level)_OBJECT_DIR
-               = [ FDirName $(HAIKU_ARCH_OBJECT_DIR) debug_$(level) ] ;
-}
-
-# set variables for gcc header options
-SetIncludePropertiesVariables HAIKU ;
-
-# assembler flags
-HAIKU_ASFLAGS = ;
-
-# C/C++ flags
-HAIKU_KERNEL_CCFLAGS += -finline -fno-builtin ;
-HAIKU_KERNEL_C++FLAGS += -finline -fno-builtin -fno-exceptions ;
-HAIKU_KERNEL_DEFINES += _KERNEL_MODE ;
-HAIKU_BOOT_CCFLAGS += -finline -fno-builtin ;
-HAIKU_BOOT_C++FLAGS += -finline -fno-builtin -fno-exceptions ;
-
-if $(HAIKU_GCC_VERSION[1]) >= 3 {
-       HAIKU_BOOT_C++FLAGS += -fno-use-cxa-atexit ;
-       HAIKU_KERNEL_C++FLAGS += -fno-use-cxa-atexit ;
-}
-
-if $(HAIKU_GCC_VERSION[1]) >= 4 {
-       HAIKU_C++FLAGS += -Wno-deprecated ;
-
-       HAIKU_KERNEL_CCFLAGS += -ffreestanding ;
-       HAIKU_KERNEL_C++FLAGS += -ffreestanding ;
-       HAIKU_BOOT_CCFLAGS += -ffreestanding ;
-       HAIKU_BOOT_C++FLAGS += -ffreestanding ;
+               Exit "Invalid value for HAIKU_DISTRO_COMPATIBILITY:"
+                       $(HAIKU_DISTRO_COMPATIBILITY) ;
 }
 
-HAIKU_KERNEL_PIC_CCFLAGS = -fno-pic ;
-HAIKU_KERNEL_PIC_LINKFLAGS = ;
-HAIKU_KERNEL_ADDON_LINKFLAGS = ;
-
-switch $(HAIKU_ARCH) {
-       case ppc :
-       {
-               # Build a position independent PPC kernel. We need to be able to
-               # relocate the kernel, since the virtual address space layout 
at boot
-               # time is not fixed.
-               HAIKU_KERNEL_PIC_CCFLAGS = -fPIE ;
-               HAIKU_KERNEL_PIC_LINKFLAGS = -shared -fPIE ;
-       }
-
-       case m68k :
-       {
-               # We don't want to have to handle emulating missing FPU opcodes 
for 040
-               # and 060 in the kernel.
-               HAIKU_KERNEL_CCFLAGS += -m68020-60 ;
-               HAIKU_KERNEL_C++FLAGS += -m68020-60 ;
-       }
-       case x86 :
-       {
-               HAIKU_CCFLAGS += -march=pentium ;
-               HAIKU_C++FLAGS += -march=pentium ;
-               HAIKU_KERNEL_CCFLAGS += -march=pentium ;
-               HAIKU_KERNEL_C++FLAGS += -march=pentium ;
-
-               # Enable use of the gcc built-in atomic functions instead of 
atomic_*().
-               # The former are inlined and have thus less overhead. They are 
not
-               # available with gcc 2, but the header will take care of that.
-               HAIKU_DEFINES += B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
-       }
-       case x86_64 :
-       {
-               # Kernel lives in the top 2GB of the address space, use kernel 
code
-               # model.
-               HAIKU_KERNEL_PIC_CCFLAGS += -mcmodel=kernel ;
-
-               # Disable the red zone, which cannot be used in kernel code due 
to
-               # interrupts, and always enable the frame pointer so stack 
traces are
-               # correct.
-               HAIKU_KERNEL_CCFLAGS += -mno-red-zone -fno-omit-frame-pointer ;
-               HAIKU_KERNEL_C++FLAGS += -mno-red-zone -fno-omit-frame-pointer ;
-               HAIKU_KERNEL_PIC_LINKFLAGS += -z max-page-size=0x1000 ;
-               HAIKU_KERNEL_ADDON_LINKFLAGS += -z max-page-size=0x1000 ;
-
-               # Bootloader is 32-bit.
-               HAIKU_BOOT_LINKFLAGS += -m elf_i386_haiku ;
-               HAIKU_BOOT_CCFLAGS += -m32 -march=pentium ;
-               HAIKU_BOOT_C++FLAGS += -m32 -march=pentium ;
-
-               # Enable use of the gcc built-in atomic functions instead of 
atomic_*().
-               # The former are inlined and have thus less overhead.
-               HAIKU_DEFINES += B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
-       }
-}
-
-# If the environment variable HAIKU_INCLUDE_PATENTED_CODE is defined, we
-# define an equally named macro to the variable value. Some components use the
-# macro to allow compilation of code known to implemented patented ideas and/or
-# techniques, for example the Freetype bytecode hinter or sub-pixel rendering
-# as well as some problematic media codecs.
+# If the environment variable HAIKU_INCLUDE_PATENTED_CODE is defined, we define
+# an equally named macro to the variable value. Some components use the macro
+# to allow compilation of code known to implemented patented ideas and/or
+# techniques, for example the Freetype bytecode hinter or sub-pixel rendering 
as
+# well as some problematic media codecs.
 if $(HAIKU_INCLUDE_PATENTED_CODE) {
        HAIKU_DEFINES
                += HAIKU_INCLUDE_PATENTED_CODE=$(HAIKU_INCLUDE_PATENTED_CODE) ;
 }
 
-# warning flags
-HAIKU_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes
-       -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar ;
-HAIKU_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy
-       -Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare
-       -Wno-multichar ;
-
-HAIKU_KERNEL_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes
-       -Wno-multichar ;
-HAIKU_KERNEL_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-multichar ;
-
-# debug flags
-HAIKU_DEBUG_FLAGS ?= -ggdb ;
-
-# debug 0: suppress asserts
-HAIKU_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
-HAIKU_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
-
-HAIKU_KERNEL_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
-HAIKU_KERNEL_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
-
-local level ;
-for level in $(HAIKU_DEBUG_LEVELS[2-]) {
-       local flags = $(HAIKU_DEBUG_FLAGS) [ FDefines DEBUG=$(level) ] ;
-       HAIKU_DEBUG_$(level)_CCFLAGS                    = $(flags) ;
-       HAIKU_DEBUG_$(level)_C++FLAGS                   = $(flags) ;
-       HAIKU_KERNEL_DEBUG_$(level)_CCFLAGS             = $(flags) ;
-       HAIKU_KERNEL_DEBUG_$(level)_C++FLAGS    = $(flags) ;
-}
-
-if $(HAIKU_GCC_VERSION[1]) >= 3 {
-       # TODO: Temporary work-around. Should be defined in the compiler specs
-       HAIKU_LINKFLAGS += -Xlinker --no-undefined ;
-} else {
-       HAIKU_DEFINES += _BEOS_R5_COMPATIBLE_ ;
-}
-
-# private shared kernel/libroot headers
-HAIKU_PRIVATE_SYSTEM_HEADERS =
-       [ PrivateHeaders $(DOT) system system/arch/$(HAIKU_ARCH) ]
-;
-
-# private kernel headers to be used when compiling kernel code
-HAIKU_PRIVATE_KERNEL_HEADERS =
-       [ PrivateHeaders $(DOT) kernel libroot shared
-               kernel/boot/platform/$(HAIKU_BOOT_PLATFORM) ]
-       [ ArchHeaders $(HAIKU_KERNEL_ARCH) ]
-       [ FDirName $(HAIKU_COMMON_DEBUG_OBJECT_DIR) system kernel ]
-       $(HAIKU_PRIVATE_SYSTEM_HEADERS)
-;
-
-# Add some grist to the libgcc objects
-HAIKU_GCC_LIBGCC_OBJECTS = $(HAIKU_GCC_LIBGCC_OBJECTS:G=libgcc) ;
-
-# the C++ standard library
-HAIKU_BUILD_SHARED_LIBSTDC++ = ;
-if $(HAIKU_SHARED_LIBSTDC++) {
-       HAIKU_LIBSTDC++ = $(HAIKU_SHARED_LIBSTDC++) ;
-} else {
-       # no shared library available with the compiler -- build it
-       if $(HAIKU_GCC_VERSION[1]) = 2 {
-               HAIKU_LIBSTDC++ = libstdc++.r4.so ;
-       } else {
-               HAIKU_LIBSTDC++ = libstdc++.so ;
-       }
-       HAIKU_SHARED_LIBSTDC++ = $(HAIKU_LIBSTDC++) ;
-       HAIKU_BUILD_SHARED_LIBSTDC++ = 1 ;
-}
-
-# the C++ support (runtime) library
-HAIKU_BUILD_SHARED_LIBSUPC++ = ;
-if $(HAIKU_SHARED_LIBSUPC++) {
-       HAIKU_LIBSUPC++ = $(HAIKU_SHARED_LIBSUPC++) ;
-} else {
-       # no shared library available with the compiler -- build it for gcc 4
-       if $(HAIKU_GCC_VERSION[1]) != 2 {
-               HAIKU_SHARED_LIBSUPC++ = libsupc++.so ;
-               HAIKU_BUILD_SHARED_LIBSUPC++ = 1 ;
-       }
-
-       HAIKU_LIBSUPC++ = $(HAIKU_SHARED_LIBSUPC++) ;
-}
-
+HAIKU_ATA_STACK ?= 1 ;
 
 # network libraries
 HAIKU_NETWORK_LIBS = network ;
@@ -499,38 +159,6 @@ HAIKU_NETAPI_LIB = bnetapi ;
 HAIKU_SELECT_UNAME_ETC_LIB = ; # libroot, against which we link anyway
 
 
-# locale libraries
-HAIKU_LOCALE_LIBS = liblocalestub.a ;
-
-
-# library and executable glue code
-local commonGlueCode =
-       <src!system!glue>init_term_dyn.o
-       <src!system!glue!arch!$(HAIKU_ARCH)>crti.o
-       <src!system!glue!arch!$(HAIKU_ARCH)>crtn.o
-;
-HAIKU_LIBRARY_BEGIN_GLUE_CODE =
-       <src!system!glue!arch!$(HAIKU_ARCH)>crti.o
-       crtbegin.o
-       <src!system!glue>init_term_dyn.o
-;
-HAIKU_LIBRARY_END_GLUE_CODE =
-       crtend.o
-       <src!system!glue!arch!$(HAIKU_ARCH)>crtn.o
-;
-HAIKU_EXECUTABLE_BEGIN_GLUE_CODE =
-       <src!system!glue!arch!$(HAIKU_ARCH)>crti.o
-       crtbegin.o
-       <src!system!glue>start_dyn.o
-       <src!system!glue>init_term_dyn.o
-;
-HAIKU_EXECUTABLE_END_GLUE_CODE = $(HAIKU_LIBRARY_END_GLUE_CODE) ;
-HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = crtbegin.o
-       <src!system!glue>haiku_version_glue.o ;
-HAIKU_KERNEL_ADDON_END_GLUE_CODE = $(HAIKU_GCC_LIBGCC) crtend.o ;
-
-SEARCH on crtbegin.o crtend.o = $(HAIKU_GCC_LIB_DIR) ;
-
 HAIKU_EXECUTABLE_MIME_TYPE = "application/x-vnd.Be-elfexecutable" ;
 
 # TODO: The version stuff should probably go into a separate file and be made
@@ -545,23 +173,23 @@ if ! $(HAIKU_BUILD_VERSION) {
 # an unknown build.
 HAIKU_BUILD_DESCRIPTION ?= "Unknown Build" ;
 
-# init library name map
-{
-       local i ;
-       for i in be bnetapi debug device game GL locale mail media midi midi2
-                       network opengl package root screensaver textencoding 
tracker
-                       translation z {
-               HAIKU_LIBRARY_NAME_MAP_$(i) = lib$(i).so ;
-       }
-       HAIKU_LIBRARY_NAME_MAP_libstdc++ = $(HAIKU_LIBSTDC++) ;
-       HAIKU_LIBRARY_NAME_MAP_libsupc++ = $(HAIKU_LIBSUPC++) ;
-       HAIKU_LIBRARY_NAME_MAP_input_server = <nogrist>input_server ;
-}
 
+#pragma mark - host platform settings
 
-#pragma mark -
 
-# host platform settings
+# determine the endianness of the host
+switch $(HOST_GCC_MACHINE) {
+       case amd64-*    : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
+       case i?86-*             : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
+       case powerpc-*  : HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
+       case x86_64-*   : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
+
+       # the following are rather unlikely as hosts ...
+       case arm-*              : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
+       case m68k-*             : HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
+       case mipsel-*   : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
+       case *                  : Exit "Unsupported gcc host machine:" 
$(HOST_GCC_MACHINE) ;
+}
 
 # analyze the host gcc machine spec to find out about 64-bitness
 HOST_PLATFORM_IS_64_BIT = ;
@@ -645,13 +273,23 @@ if $(HOST_CPU) = x86 && $(HOST_PLATFORM_IS_64_BIT) {
 }
 
 HOST_ARCH                              ?= $(HOST_CPU) ;
-HOST_ARCH_MACRO_DEFINE = ARCH_$(HOST_CPU) ;
+HOST_ARCHS = $(HOST_ARCH) ;
 
+# analyze GCC version
+HOST_GCC_VERSION = [ FAnalyzeGCCVersion HOST_GCC_RAW_VERSION ] ;
+
+# set packaging architecture
+HOST_PACKAGING_ARCH            ?= $(HOST_CPU) ;
+if $(HOST_PACKAGING_ARCH) = x86 && $(HOST_GCC_VERSION[1]) = 2 {
+       HOST_PACKAGING_ARCH = x86_gcc2 ;
+}
+HOST_PACKAGING_ARCHS = $(HOST_PACKAGING_ARCH) ;
 
 # directories
 HOST_OBJECT_BASE_DIR = [ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) ] ;
 HOST_COMMON_ARCH_OBJECT_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) common ] ;
-HOST_ARCH_OBJECT_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) $(HOST_ARCH) ] ;
+HOST_ARCH_OBJECT_DIR
+       = [ FDirName $(HOST_OBJECT_BASE_DIR) $(HOST_PACKAGING_ARCH) ] ;
 HOST_COMMON_DEBUG_OBJECT_DIR = [ FDirName $(HOST_ARCH_OBJECT_DIR) common ] ;
 HOST_DEBUG_0_OBJECT_DIR = [ FDirName $(HOST_ARCH_OBJECT_DIR) release ] ;
 
@@ -661,9 +299,6 @@ for level in $(HAIKU_DEBUG_LEVELS[2-]) {
                = [ FDirName $(HOST_ARCH_OBJECT_DIR) debug_$(level) ] ;
 }
 
-# analyze GCC version
-HOST_GCC_VERSION = [ FAnalyzeGCCVersion HOST_GCC_RAW_VERSION ] ;
-
 # set variables for gcc header options
 SetIncludePropertiesVariables HOST ;
 
@@ -679,6 +314,10 @@ if $(HOST_PLATFORM) != cygwin {
        HOST_PIC_C++FLAGS += -fPIC ;
 }
 
+if $(HOST_GCC_VERSION[1]) >= 3 {
+       HOST_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
+}
+
 HOST_KERNEL_CCFLAGS += $(HOST_GCC_BASE_FLAGS) -finline -fno-builtin
        -D_KERNEL_MODE ;
 HOST_KERNEL_C++FLAGS += $(HOST_GCC_BASE_FLAGS) -finline -fno-builtin
@@ -718,13 +357,14 @@ HOST_KERNEL_WARNING_CCFLAGS = -Wall -Wno-trigraphs 
-Wmissing-prototypes ;
 HOST_KERNEL_WARNING_C++FLAGS = -Wall -Wno-trigraphs ;
 
 # debug flags
+local hostDebugFlags ;
 switch $(HOST_PLATFORM) {
-       case haiku      : HOST_DEBUG_FLAGS ?= -ggdb ;
-       case haiku_host : HOST_DEBUG_FLAGS ?= -ggdb ;
-       case linux      : HOST_DEBUG_FLAGS ?= -ggdb ;
-       case freebsd    : HOST_DEBUG_FLAGS ?= -ggdb ;
-       case darwin     : HOST_DEBUG_FLAGS ?= -ggdb ;
-       case *          : HOST_DEBUG_FLAGS ?= -g ;
+       case haiku              : hostDebugFlags ?= -ggdb ;
+       case haiku_host : hostDebugFlags ?= -ggdb ;
+       case linux              : hostDebugFlags ?= -ggdb ;
+       case freebsd    : hostDebugFlags ?= -ggdb ;
+       case darwin             : hostDebugFlags ?= -ggdb ;
+       case *                  : hostDebugFlags ?= -g ;
 }
 
 # debug 0: suppress asserts
@@ -736,7 +376,7 @@ HOST_KERNEL_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) 
] ;
 
 local level ;
 for level in $(HAIKU_DEBUG_LEVELS[2-]) {
-       local flags = $(HOST_DEBUG_FLAGS) [ FDefines DEBUG=$(level) ] ;
+       local flags = $(hostDebugFlags) [ FDefines DEBUG=$(level) ] ;
        HOST_DEBUG_$(level)_CCFLAGS                     = $(flags) ;
        HOST_DEBUG_$(level)_C++FLAGS            = $(flags) ;
        HOST_KERNEL_DEBUG_$(level)_CCFLAGS      = $(flags) ;
@@ -760,7 +400,7 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE)
        CP = copyattr --data ;
 }
 
-HOST_DEFINES += $(HOST_ARCH_MACRO_DEFINE) ;
+HOST_DEFINES += ARCH_$(HOST_CPU) ;
 HOST_DEFINES += _NO_INLINE_ASM ;
 
 # for builds of tools in the current environment
@@ -948,9 +588,8 @@ if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) {
 }
 
 
-#pragma mark -
+#pragma mark - target platform settings
 
-# target platform settings
 
 # check the target platform compatibility
 SetPlatformCompatibilityFlagVariables TARGET_PLATFORM : TARGET : target ;
@@ -964,46 +603,59 @@ if $(TARGET_PLATFORM) != haiku {
 }
 
 # Set TARGET_* variables either from HAIKU_* or HOST_* depending on the
-# specified TARGET_PLATFORM.
+# specified TARGET_PLATFORM. Some variables are package architecture dependent
+# and their name gets a respective suffix. A few variables exist both with and
+# without suffix. The latter is either equivalent to the variable with the
+# primary architecture suffix (e.g. TARGET_ARCH) or is (additionally) 
applicable
+# for all architectures (e.g. TARGET_DEFINES).
 
 local buildVars =
-       ARCH CPU GCC_VERSION KERNEL_ARCH
-
-       AR CC C++ LD OBJCOPY RANLIB ELFEDIT
+       ARCH ARCHS KERNEL_ARCH PACKAGING_ARCH PACKAGING_ARCHS
 
-       INCLUDES_SEPARATOR LOCAL_INCLUDES_OPTION SYSTEM_INCLUDES_OPTION
-
-       HDRS CPPFLAGS CCFLAGS C++FLAGS LDFLAGS LINK LINKFLAGS DEFINES
-       ARFLAGS UNARFLAGS
+       DEFINES
        KERNEL_DEFINES
 
        KERNEL_CCFLAGS KERNEL_C++FLAGS
        KERNEL_PIC_CCFLAGS KERNEL_PIC_LINKFLAGS KERNEL_ADDON_LINKFLAGS
        BOOT_CCFLAGS BOOT_C++FLAGS BOOT_LINKFLAGS
-       WARNING_CCFLAGS WARNING_C++FLAGS
 
        KERNEL_WARNING_CCFLAGS KERNEL_WARNING_C++FLAGS
 
-       DEBUG_FLAGS
-
-       DEBUG_$(HAIKU_DEBUG_LEVELS)_CCFLAGS DEBUG_$(HAIKU_DEBUG_LEVELS)_C++FLAGS
-
        KERNEL_DEBUG_$(HAIKU_DEBUG_LEVELS)_CCFLAGS
        KERNEL_DEBUG_$(HAIKU_DEBUG_LEVELS)_C++FLAGS
 
        PRIVATE_KERNEL_HEADERS
-       PRIVATE_SYSTEM_HEADERS
 
        LIBSTDC++ LIBSUPC++
-       STATIC_LIBSTDC++ STATIC_LIBSUPC++
 
        NETWORK_LIBS NETAPI_LIB SELECT_UNAME_ETC_LIB
 
-       ARCH_MACRO_DEFINE EXECUTABLE_MIME_TYPE
+       EXECUTABLE_MIME_TYPE
+
+       OBJECT_BASE_DIR COMMON_ARCH_OBJECT_DIR
+       ;
+
+local archDependentBuildVars =
+       ARCH CPU GCC_VERSION
+
+       AR CC C++ ELFEDIT LD OBJCOPY RANLIB STRIP
+
+       ARFLAGS ASFLAGS UNARFLAGS CPPFLAGS CCFLAGS C++FLAGS HDRS LDFLAGS
+       LINK LINKFLAGS
+
+       WARNING_CCFLAGS WARNING_C++FLAGS
+
+       DEBUG_$(HAIKU_DEBUG_LEVELS)_CCFLAGS DEBUG_$(HAIKU_DEBUG_LEVELS)_C++FLAGS
+
+       INCLUDES_SEPARATOR LOCAL_INCLUDES_OPTION SYSTEM_INCLUDES_OPTION
+
+       PRIVATE_SYSTEM_HEADERS
+
+       LIBSTDC++ LIBSUPC++
 
-       OBJECT_BASE_DIR COMMON_ARCH_OBJECT_DIR COMMON_DEBUG_OBJECT_DIR
+       ARCH_OBJECT_DIR COMMON_DEBUG_OBJECT_DIR
        DEBUG_$(HAIKU_DEBUG_LEVELS)_OBJECT_DIR
-;
+       ;
 
 if $(TARGET_PLATFORM) = haiku {
        local var ;
@@ -1011,31 +663,37 @@ if $(TARGET_PLATFORM) = haiku {
                TARGET_$(var) = $(HAIKU_$(var)) ;
        }
 
-       TARGET_GCC_LIB_DIR                      = $(HAIKU_GCC_LIB_DIR) ;
-       TARGET_GCC_HEADERS_DIR          = $(HAIKU_GCC_HEADERS_DIR) ;
-       TARGET_GCC_LIBGCC                       = $(HAIKU_GCC_LIBGCC) ;
-       TARGET_GCC_LIBGCC_OBJECTS       = $(HAIKU_GCC_LIBGCC_OBJECTS) ;
+       for var in $(archDependentBuildVars)_$(TARGET_PACKAGING_ARCHS) {
+               TARGET_$(var) = $(HAIKU_$(var)) ;
+       }
 
-       TARGET_KERNEL_LIBGCC            = $(HAIKU_KERNEL_LIBGCC) ;
-       TARGET_KERNEL_LIBSUPC++         = $(HAIKU_KERNEL_LIBSUPC++) ;
-       TARGET_BOOT_LIBGCC                      = $(HAIKU_BOOT_LIBGCC) ;
-       TARGET_BOOT_LIBSUPC++           = $(HAIKU_BOOT_LIBSUPC++) ;
+       TARGET_KERNEL_LIBGCC
+               = $(HAIKU_KERNEL_LIBGCC_$(TARGET_PACKAGING_ARCH)) ;
+       TARGET_KERNEL_LIBSUPC++
+               = $(HAIKU_KERNEL_LIBSUPC++_$(TARGET_PACKAGING_ARCH)) ;
+       TARGET_BOOT_LIBGCC
+               = $(HAIKU_BOOT_LIBGCC_$(TARGET_PACKAGING_ARCH)) ;
+       TARGET_BOOT_LIBSUPC++
+               = $(HAIKU_BOOT_LIBSUPC++_$(TARGET_PACKAGING_ARCH)) ;
 
        TARGET_BOOT_PLATFORM            ?= $(HAIKU_BOOT_PLATFORM) ;
        TARGET_BOOT_BOARD                       ?= $(HAIKU_BOOT_BOARD) ;
 
-       TARGET_LIBRARY_NAME_MAP         = HAIKU_LIBRARY_NAME_MAP ;
-
+       local architecture ;
+       for architecture in $(TARGET_PACKAGING_ARCHS) {
+               TARGET_DEFINES_$(architecture) = 
$(HAIKU_DEFINES_$(architecture)) ;
+               TARGET_LIBRARY_NAME_MAP_$(architecture)
+                       = HAIKU_LIBRARY_NAME_MAP_$(architecture) ;
+       }
 } else {
        local var ;
        for var in $(buildVars) {
                TARGET_$(var) = $(HOST_$(var)) ;
        }
 
-       TARGET_GCC_LIB_DIR                      = ;
-       TARGET_GCC_HEADERS_DIR          = ;
-       TARGET_GCC_LIBGCC                       = ;
-       TARGET_GCC_LIBGCC_OBJECTS       = ;
+       for var in $(archDependentBuildVars) {
+               TARGET_$(var)_$(TARGET_PACKAGING_ARCH) = $(HOST_$(var)) ;

[ *** diff truncated: 10649 lines dropped *** ]



Other related posts:

  • » [haiku-commits] BRANCH HaikuPM-github.package-management [b0944c7] build/jam src/system/libroot/posix src/system/libroot/posix/glibc build/jam/images src - HaikuPM-github . package-management