Merge branch 'package-management'

Conflicts:
	src/preferences/network/Jamfile
This commit is contained in:
Ingo Weinhold 2013-09-27 02:01:12 +02:00
commit 9f81ca838c
1477 changed files with 63420 additions and 53378 deletions

187
Jamfile
View File

@ -3,152 +3,45 @@ SubDir HAIKU_TOP ;
NotFile doc_files ;
Depends files : doc_files ;
# Pseudo-target to build the mail kit only
NotFile MailKit ;
Depends MailKit :
libmail.so
mail_daemon
E-mail
BeMail
# mail_daemon addons
Inbox
Outbox
Message\ Parser
New\ Mail\ Notification
Match\ Header
R5\ Daemon\ Filter
IMAP
POP3
SMTP
Fortune
Spam\ Filter
spamdbm
;
# Pseudo-target to build the media stuffs only
# TODO: don't know how to make avcodec mp3_decoder mp3_reader ogg speex vorbis
NotFile MediaKit ;
Depends MediaKit :
libmedia.so
libgame.so
# Servers
media_addon_server
media_server
# Preference
Sounds
Media
# Deskbar replicant
desklink
# add-ons
mixer.media_addon
tone_producer_demo.media_addon
video_producer_demo.media_addon
legacy.media_addon
multi_audio.media_addon
# reader.media_addon
# writer.media_addon
# demultiplexer.media_addon
# codecs
ac3_decoder
aiff_reader
au_reader
avcodec
avi_reader
matroska
mp3_decoder
mp3_reader
musepack
ogg
raw_decoder
speex
vorbis
wav_reader
mov_reader
;
# Pseudo-target to build the input kit only
NotFile InputKit ;
Depends InputKit :
# Servers
input_server
# Addons
<input>keyboard
<input>mouse
# Apps
keymap
# Preferences
Keymap
Keyboard
Mouse
;
# Pseudo-target to build the OpenGL kit only
NotFile OpenGLKit ;
Depends OpenGLKit :
libGL.so
GLTeapot
# GLInfo
;
# Pseudo-target to build the screensaver kit only
NotFile ScreenSaverKit ;
Depends ScreenSaverKit :
libscreensaver.so
screen_saver
screen_blanker
ScreenSaver
Haiku
;
# Pseudo-target to build the locale kit only
# TODO: src/add-ons/locale/collators/GermanDIN-2.cpp does not compile
NotFile LocaleKit ;
Depends LocaleKit :
Locale
# binaries for building localized software on haiku
collectcatkeys
dumpcatalog
linkcatkeys
# addons
LocaleKitCollatorAddons
LocaleKitCatalogAddons
# tests
LocaleKitTests
;
# Add optional packages given via HAIKU_ADD_OPTIONAL_PACKAGES.
if $(HAIKU_ADD_OPTIONAL_PACKAGES) {
AddOptionalHaikuImagePackages
[ FSplitString $(HAIKU_ADD_OPTIONAL_PACKAGES) : / ] ;
}
# Prepare the optional build features before parsing the Jamfile tree.
local architectureObject ;
for architectureObject in [ MultiArchSubDirSetup ] {
on $(architectureObject) {
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ;
}
}
# Include packages that are required by all images.
AddOptionalHaikuImagePackages MandatoryPackages ;
if ! $(HAIKU_BOOTSTRAP_BUILD) {
# primary architecture
AddHaikuImagePackages
bzip2 ctags ffmpeg freetype glu grep icu jpeg libpng libsolv mesa sed
tar zlib
:
system
;
# If enabled, make sure that OpenSSL is added to the image.
if $(HAIKU_BUILD_FEATURE_OPENSSL_ENABLED) {
AddOptionalHaikuImagePackages OpenSSL ;
# secondary architectures
local architectureObject ;
for architectureObject
in [ MultiArchSubDirSetup $(HAIKU_PACKAGING_ARCHS[2-]) ] {
on $(architectureObject) {
AddHaikuImagePackages
ffmpeg freetype glu icu jpeg libpng libsolv mesa zlib
:
system
;
}
}
}
AddOptionalHaikuImagePackages ICU ;
# If enabled, make sure that OpenSSL is added to the image.
if [ FIsBuildFeatureEnabled openssl ] {
AddHaikuImagePackages openssl ;
}
# Evaluate optional package dependencies
include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalPackageDependencies ] ;
# add additionally requested packages
AddHaikuImagePackages $(HAIKU_IMAGE_ADDITIONAL_PACKAGES) ;
# Optionally we allow not to include the "src" subdirectory.
if $(HAIKU_DONT_INCLUDE_SRC) {
@ -173,13 +66,17 @@ SubDir HAIKU_TOP ;
UserBuildConfigRulePostBuildTargets ;
# specify the Haiku image and network boot archive contents
include [ FDirName $(HAIKU_BUILD_RULES_DIR) HaikuImage ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) NetBootArchive ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) FloppyBootImage ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDBootImage ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDBootPPCImage ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) HaikuCD ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) AnybootImage ] ;
if $(HAIKU_BOOTSTRAP_BUILD) {
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuImageBootstrap ] ;
} else {
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuImage ] ;
}
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images NetBootArchive ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images FloppyBootImage ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootImage ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootPPCImage ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuCD ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images AnybootImage ] ;
# Check whether all requested optional packages do actually exist.
local package ;

View File

@ -29,6 +29,9 @@ if ! $(buildConfig) {
LOCATE on BuildConfig = $(HAIKU_BUILD_OUTPUT_DIR) ;
include BuildConfig ;
# set HAIKU_PACKAGING_ARCH, the primary packaging architecture
HAIKU_PACKAGING_ARCH = $(HAIKU_PACKAGING_ARCHS[1]) ;
# 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
# likely to be used in the top level context (i.e. not only in rules).
@ -36,7 +39,9 @@ include BuildConfig ;
# 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) BuildFeatureRules ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) LocaleRules ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) CommandLineArguments ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) ConfigRules ] ;
@ -51,8 +56,29 @@ include [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) MiscRules ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) OverriddenJamRules ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) RepositoryRules ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) DefaultBuildProfiles ] ;
# Include the repositories for this architecture.
local repositoriesDirectory
= [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories ] ;
local repositories = HaikuPorts ;
if $(HAIKU_BOOTSTRAP_BUILD) {
repositories = HaikuPortsCross ;
}
local repository ;
for repository in $(repositories) {
local repositoryDirectory
= [ FDirName $(repositoriesDirectory) $(repository) ] ;
local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ;
if $(file) {
HAIKU_REPOSITORY_JAMFILE = $(file) ;
include $(file) ;
}
}
# Declare no-op user-overridable build rules.
rule UserBuildConfigRulePostBuildTargets { }
@ -75,18 +101,6 @@ if ! $(HAIKU_IGNORE_USER_BUILD_CONFIG) {
}
}
include [ FDirName $(HAIKU_BUILD_RULES_DIR) ReleaseBuildProfiles ] ;
# If a build profile was specified on the command line, now is the time to
# check whether it is unknown or one of the default profiles.
if $(HAIKU_BUILD_PROFILE) && ! $(HAIKU_BUILD_PROFILE_DEFINED) {
# define the obvious default profiles
if $(HAIKU_BUILD_PROFILE) in anyboot-image cd-image image install
vmware-image {
DefineBuildProfile $(HAIKU_BUILD_PROFILE) : $(HAIKU_BUILD_PROFILE) ;
} else {
Exit "Build profile" $(HAIKU_BUILD_PROFILE) "not defined." ;
}
}
DefineDefaultBuildProfiles ;
PrepareConfigVariables ;

View File

@ -58,6 +58,8 @@
#define SYSCALL_TRACING_IGNORE_KTRACE_OUTPUT 1
#define TCP_TRACING 0
#define TEAM_TRACING 0
#define TRANSLATION_MAP_TRACING 0
#define TRANSLATION_MAP_TRACING_STACK_TRACE 0 /* stack trace depth */
#define USER_MALLOC_TRACING 0
#define VFS_PAGES_IO_TRACING 0
#define VM_CACHE_TRACING 0

View File

@ -1,63 +0,0 @@
# This file defines what ends up in the alternative GCC archive and it executes
# the rules building the archive. Included by HaikuImage.
#sanity check - make sure the primary gcc is different than the alternative gcc
if $(HAIKU_PRIMARY_GCC) = $(HAIKU_GCC_VERSION[1]) {
Exit "Error: Your alternative gcc is the same as the main gcc!"
"You need to reconfigure your generated directories." ;
}
#pragma mark - Build The Archive
# archive target
HAIKU_ALTERNATIVE_GCC_ARCHIVE = alternative_system_libs.zip ;
MakeLocate $(HAIKU_ALTERNATIVE_GCC_ARCHIVE) : $(HAIKU_OUTPUT_DIR) ;
# the pseudo target all archive contents is attached to
NotFile $(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME) ;
# prepare the script that initializes the shell variables
local initVarsScript = <AlternativeGCCArchive>haiku-alternative-gcc-init-vars ;
local script = $(initVarsScript) ;
MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ;
Always $(script) ;
AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ;
AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
AddTargetVariableToScript $(script) : <build>copyattr ;
AddTargetVariableToScript $(script) : <build>zip ;
if $(HOST_RM_ATTRS_TARGET) {
AddTargetVariableToScript $(script) : $(HOST_RM_ATTRS_TARGET) : rmAttrs ;
} else {
AddVariableToScript $(script) : rmAttrs : rm ;
}
# create the other scripts
local makeDirsScript = <AlternativeGCCArchive>haiku-alternative-gcc-make-dirs ;
local copyFilesScript
= <AlternativeGCCArchive>haiku-alternative-gcc-copy-files ;
MakeLocate $(makeDirsScript) $(copyFilesScript) : $(HAIKU_OUTPUT_DIR) ;
CreateAlternativeGCCArchiveMakeDirectoriesScript $(makeDirsScript) ;
CreateAlternativeGCCArchiveCopyFilesScript $(copyFilesScript) ;
# build the archive
BuildAlternativeGCCArchive $(HAIKU_ALTERNATIVE_GCC_ARCHIVE) :
$(initVarsScript)
$(makeDirsScript)
$(copyFilesScript)
;
# remove the scripts we have generated
RmTemps $(HAIKU_ALTERNATIVE_GCC_ARCHIVE) :
$(initVarsScript)
$(makeDirsScript)
$(copyFilesScript)
;
NotFile haiku-alternative-gcc-archive ;
Depends haiku-alternative-gcc-archive : $(HAIKU_ALTERNATIVE_GCC_ARCHIVE) ;

785
build/jam/ArchitectureRules Normal file
View File

@ -0,0 +1,785 @@
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:
# http://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 ;
}
local cpu = $(HAIKU_CPU_$(architecture)) ;
if $(cpu) = arm {
# For stackcrawls
gccBaseFlags += -mapcs-frame ;
}
# 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 ;
# 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 libraryGrist = "" ;
if $(architecture) != $(HAIKU_PACKAGING_ARCHS[1]) {
libraryGrist = $(architecture) ;
}
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 {
local library = lib$(i).so ;
HAIKU_LIBRARY_NAME_MAP_$(architecture)_$(i)
= $(library:G=$(libraryGrist)) ;
}
HAIKU_LIBRARY_NAME_MAP_$(architecture)_libstdc++
= $(HAIKU_LIBSTDC++_$(architecture)) ;
HAIKU_LIBRARY_NAME_MAP_$(architecture)_libsupc++
= $(HAIKU_LIBSUPC++_$(architecture)) ;
HAIKU_LIBRARY_NAME_MAP_$(architecture)_localestub
= <$(architecture)>liblocalestub.a ;
if $(architecture) = $(HAIKU_PACKAGING_ARCHS[1]) {
HAIKU_LIBRARY_NAME_MAP_$(architecture)_input_server
= <nogrist>input_server ;
} else {
HAIKU_LIBRARY_NAME_MAP_$(architecture)_input_server
= <$(architecture)>input_server ;
}
}
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 multiuser ;
EnableWerror src bin package ;
EnableWerror src bin package_repo ;
EnableWerror src bin pkgman ;
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 : architecture
{
# MultiArchIfPrimary <ifValue> : <elseValue>
# [ : <architecture> = $(TARGET_PACKAGING_ARCH) ] ;
#
# Returns one of the two given values depending on whether
# <architecture> is the primary packaging architecture.
architecture ?= $(TARGET_PACKAGING_ARCH) ;
if $(architecture) = $(TARGET_PACKAGING_ARCHS[1]) {
return $(ifValue) ;
}
return $(elseValue) ;
}
rule MultiArchConditionalGristFiles files : primaryGrist : secondaryGrist
: architecture
{
# MultiArchConditionalGristFiles <files> : <primaryGrist>
# : <secondaryGrist> [ : <architecture> = $(TARGET_PACKAGING_ARCH) ] ;
#
# Returns <files> with their grist set to either <primaryGrist> or
# <secondaryGrist> depending on whether <architecture> is the primary
# packaging architecture.
architecture ?= $(TARGET_PACKAGING_ARCH) ;
local grist = [ MultiArchIfPrimary $(primaryGrist) : $(secondaryGrist)
: $(architecture) ] ;
return $(files:G=$(grist:E=)) ;
}
rule MultiArchDefaultGristFiles files : gristPrefix : architecture
{
# MultiArchDefaultGristFiles <files> : <gristPrefix>
# [ : <architecture> = $(TARGET_PACKAGING_ARCH) ] ;
#
# 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 architecture is the
# primary packaging architecture, <files> are returned with their grist set
# to <gristPrefix>, otherwise <files> are returned with their grist set to
# <gristPrefix>!<architecture> respectively <architecture> (if <gristPrefix>
# is empty).
architecture ?= $(TARGET_PACKAGING_ARCH) ;
local secondaryGrist = $(gristPrefix)!$(architecture) ;
secondaryGrist ?= $(architecture) ;
return [ MultiArchConditionalGristFiles $(files) : $(gristPrefix) :
$(secondaryGrist) : $(architecture) ] ;
}
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) ;
}

View File

@ -149,34 +149,70 @@ actions SetVersion1
$(2[1]) "$(1)" -system $(HAIKU_BUILD_VERSION) -short "$(HAIKU_BUILD_DESCRIPTION)" ;
}
rule SetType
rule SetType target : type
{
# SetType <target>
# SetType <target> [ : <type> ]
# Sets the MIME type on the target. If none is given, the executable MIME
# type is used.
Depends $(1) : <build>settype ;
SetType1 $(1) : <build>settype ;
TARGET_MIME_TYPE on $(target) = $(type:E=$(TARGET_EXECUTABLE_MIME_TYPE)) ;
Depends $(target) : <build>settype ;
SetType1 $(target) : <build>settype ;
}
actions SetType1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) -t $(TARGET_EXECUTABLE_MIME_TYPE) "$(1)" ;
$(2[1]) -t $(TARGET_MIME_TYPE) "$(1)" ;
}
rule MimeSet
rule MimeSet target
{
# MimeSet <target>
# MimeSet <target> ;
Depends $(1) : <build>mimeset ;
MimeSet1 $(1) : <build>mimeset ;
Depends $(target) : <build>mimeset <mimedb>mime_db ;
MimeSet1 $(target) : <build>mimeset <mimedb>mime_db ;
}
actions MimeSet1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) -f "$(1)" ;
$(2[1]) -f --mimedb "$(2[2])" "$(1)"
}
rule CreateAppMimeDBEntries target
{
# MimeSetApp <target> ;
# Create the app meta MIME DB entries for the given target. The
# HAIKU_MIME_DB_ENTRIES variable on <target> is set to the generated
# resulting target directory that contains the MIME DB entries.
local appGrist = $(target:G) ;
local appMimeDB = $(target:BS)_mimedb ;
appMimeDB = $(appMimeDB:G=mimedb-app-$(appGrist:E=)) ;
MakeLocateDebug $(appMimeDB) ;
Depends $(appMimeDB) : <build>mimeset $(target) <mimedb>mime_db ;
CreateAppMimeDBEntries1 $(appMimeDB)
: <build>mimeset $(target) <mimedb>mime_db ;
HAIKU_MIME_DB_ENTRIES on $(target) = $(appMimeDB) ;
}
actions CreateAppMimeDBEntries1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
appMimeDB="$(1)"
$(RM) -rf "$appMimeDB"
$(MKDIR) "$appMimeDB"
$(2[1]) -f --apps --mimedb "$appMimeDB" --mimedb "$(2[3])" "$(2[2])"
}
rule ResComp
{
# ResComp <resource file> : <rdef file> ;
@ -196,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)) ;
}
}

View File

@ -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)" ;
}

455
build/jam/BuildFeatureRules Normal file
View File

@ -0,0 +1,455 @@
rule FQualifiedBuildFeatureName features
{
# FQualifiedBuildFeatureName <features>
#
# Prepends the name of the current target packaging architecture to the
# given feature names.
return $(TARGET_PACKAGING_ARCH):$(features) ;
}
rule FIsBuildFeatureEnabled feature
{
# FIsBuildFeatureEnabled <feature> ;
# Returns whether the given build feature <feature> is enabled (if so: "1",
# if not: empty list).
#
# <feature> - The name of the build feature (all lower case).
feature = [ FQualifiedBuildFeatureName $(feature) ] ;
return $(HAIKU_BUILD_FEATURE_$(feature:U)_ENABLED) ;
}
rule FMatchesBuildFeatures specification
{
# FMatchesBuildFeatures <specification> ;
# Returns whether the given build feature specification <specification>
# holds. <specification> consists of positive and negative build feature
# conditions. Conditions can be individual list elements and multiple
# conditions can be joined, separated by ",", in a single list element. The
# effect is the same; they are considered as single set of conditions.
# A positive condition does not start with a "!". It holds when the build
# feature named by the element is enabled.
# A negative condition starts with a "!". It holds when the build feature
# named by the string resulting from removing the leading "!" is not
# enabled.
# <specification> holds when it is not empty and
# * none of the negative conditions it contains hold and
# * if it contains any positive conditions, at least one one of them holds.
#
# <specification> - The build feature specification. A list of individual
# conditions or conditions joined by ",".
local splitSpecification ;
local element ;
for element in $(specification) {
splitSpecification += [ FSplitString $(element) : "," ] ;
}
return [ FConditionsHold $(splitSpecification) : FIsBuildFeatureEnabled ] ;
}
rule FFilterByBuildFeatures list
{
# FFilterByBuildFeatures <list> ;
# Filters the list annotated by build feature specifications and returns the
# resulting list. The list can be annotated in two different ways:
# * A single list element can be annotated by appending "@<specification>"
# to it, with <specification> being a build feature specification (a
# single comma-separated string). The element appears in the resulting
# list, only if <specification> holds.
# * A sublist can be annotated by enclosing it in "<specification> @{" (two
# separate list elements) and "}@", with <specification> being a build
# feature specification (a single comma-separated string). The enclosed
# sublist appears in the resulting list, only if <specification> holds.
# The sublist annotations can be nested. The annotations themselves don't
# appear in the resulting list.
#
# <list> - A list annotated with build feature specifications.
local filteredList ;
# Since we must look ahead one element to be able to decide whether an
# element is a regular list element or a features specification for a
# subsequent "@{". Hence we always process an element other than "@{" and
# "}@" in the next iteration. We append a dummy element to the list so we
# don't need special handling for the last element.
local evaluationStack = 1 ;
local previousElement ;
local element ;
for element in $(list) dummy {
local stackTop = $(evaluationStack[1]) ;
local processElement = $(previousElement) ;
switch $(element) {
case }@ :
{
# Pop the topmost specification off the stack.
evaluationStack = $(evaluationStack[2-]) ;
if ! $(evaluationStack) {
Exit "FFilterByBuildFeatures: Unbalanced @( in: " $(list) ;
}
processElement = $(previousElement) ;
previousElement = ;
}
case @{ :
{
if ! $(previousElement) {
Exit "FFilterByBuildFeatures: No feature specification"
"after )@ in: " $(list) ;
}
if $(evaluationStack[1]) = 1
&& [ FMatchesBuildFeatures $(previousElement) ] {
evaluationStack = 1 $(evaluationStack) ;
} else {
evaluationStack = 0 $(evaluationStack) ;
}
processElement = ;
previousElement = ;
}
case * :
{
processElement = $(previousElement) ;
previousElement = $(element) ;
}
}
if $(processElement) && $(stackTop) = 1 {
local splitElement = [ Match "(.*)@([^@]*)" : $(processElement) ] ;
if $(splitElement) {
if [ FMatchesBuildFeatures $(splitElement[2]) ] {
filteredList += $(splitElement[1]) ;
}
} else {
filteredList += $(processElement) ;
}
}
}
if $(evaluationStack[2-]) {
Exit "FFilterByBuildFeatures: Unbalanced )@ in: " $(list) ;
}
return $(filteredList) ;
}
rule EnableBuildFeatures features : specification
{
# EnableBuildFeatures <features> : <specification> ;
# Enables the build features <features>, if the build features specification
# <specification> holds. If <specification> is omitted, the features are
# enabled unconditionally.
# The rule enables a build feature by adding its given lower case name to
# the build variable HAIKU_BUILD_FEATURES and defining a build variable
# HAIKU_BUILD_FEATURE_<FEATURE>_ENABLED (<FEATURE> being the upper case name
# of the build feature) to "1".
#
# <features> - A list of build feature names (lower case).
# <specification> - An optional build features specification (cf.
# FMatchesBuildFeatures).
features = [ FQualifiedBuildFeatureName $(features) ] ;
if ! $(HAIKU_BUILD_FEATURE_$(feature:U)_ENABLED)
&& ( ! $(specification)
|| [ FMatchesBuildFeatures $(specification) ] ) {
local feature ;
for feature in $(features) {
HAIKU_BUILD_FEATURES += $(feature) ;
HAIKU_BUILD_FEATURE_$(feature:U)_ENABLED = 1 ;
}
}
}
rule BuildFeatureObject feature
{
# BuildFeatureObject <feature> ;
# Returns a unique object for the given build feature. It is used for
# attaching attribute values to it.
feature = [ FQualifiedBuildFeatureName $(feature) ] ;
local featureObject = $(HAIKU_BUILD_FEATURE_$(feature:U)) ;
if ! $(featureObject) {
featureObject = [ NewUniqueTarget ] ;
HAIKU_BUILD_FEATURE_$(feature:U) = $(featureObject) ;
}
return $(featureObject) ;
}
rule SetBuildFeatureAttribute feature : attribute : values : package
{
# SetBuildFeatureAttribute <feature> : <attribute> : <values>
# [ : <package> ] ;
# Sets attribute <attribute> of a build feature <feature> to value <values>.
# If <package> is specified, it names the package the attribute belongs to.
local featureObject = [ BuildFeatureObject $(feature) ] ;
HAIKU_ATTRIBUTE_$(attribute) on $(featureObject) = $(values) ;
if $(package) {
HAIKU_ATTRIBUTE_$(attribute):package on $(featureObject) = $(package) ;
}
}
rule BuildFeatureAttribute feature : attribute : flags
{
# BuildFeatureAttribute <feature> : <attribute> [ : <flags> ] ;
# Returns the value of attribute <attribute> of a build feature <feature>.
# Flags can be a list of flags which influence the returned value. Currently
# only flag "path" is defined, which will convert the attribute value --
# which is assumed to be a list of (gristed) targets with a path relative to
# the extraction directory of the build feature archive files -- to paths.
# A typical example is the "headers" attribute, whose value can be used as
# dependency, but which must be converted to a path to be a valid headers
# search path.
local featureObject = [ BuildFeatureObject $(feature) ] ;
local values
= [ on $(featureObject) return $(HAIKU_ATTRIBUTE_$(attribute)) ] ;
if path in $(flags) {
# get the attribute's package and the corresponding extraction dir
local package
= [ BuildFeatureAttribute $(feature) : $(attribute):package ] ;
local directory ;
if $(package) {
directory = [ BuildFeatureAttribute $(feature)
: $(package):directory ] ;
}
# translate the values
local paths ;
local value ;
for value in $(values:G=) {
paths += [ FDirName $(directory) $(value) ] ;
}
values = $(paths) ;
}
return $(values) ;
}
rule ExtractBuildFeatureArchivesExpandValue value : fileName
{
if ! $(value) {
return $(value) ;
}
# split the value
local splitValue ;
while $(value) {
local components = [ Match "([^%]*)(%[^%]*%)(.*)" : $(value) ] ;
if ! $(components) {
splitValue += $(value) ;
break ;
}
if $(components[1]) {
splitValue += $(components[1]) ;
}
splitValue += $(components[2]) ;
value = $(components[3]) ;
}
# reassemble the value, performing the substitutions
local %packageName% ;
local %portName% ;
local %packageFullVersion% ;
value = "" ;
while $(splitValue) {
local component = $(splitValue[1]) ;
splitValue = $(splitValue[2-]) ;
switch $(component) {
case %packageRevisionedName% :
splitValue = %packageName% "-" %packageFullVersion%
$(splitValue) ;
case %portRevisionedName% :
splitValue = %portName% "-" %packageFullVersion% $(splitValue) ;
case %*% :
if ! x$(%packageName%) {
# extract package name and version from file name
local splitName
= [ Match "([^-]*)-(.*).hpkg" : $(fileName) ] ;
if $(splitName) {
%packageName% = $(splitName[1]) ;
%packageFullVersion%
= [ Match "([^-]*-[^-]*)-.*" : $(splitName[2]) ] ;
if ! $(packageFullVersion%) {
packageFullVersion% = $(splitName[2]) ;
}
} else {
%packageName% = [ Match "(.*).hpkg" : $(fileName) ] ;
if ! $(%packageName%) {
%packageName% = $(fileName) ;
}
%packageFullVersion% = "" ;
}
# get the port name from the package name
splitName = [ FSplitPackageName $(%packageName%) ] ;
%portName% = $(splitName[1]) ;
}
value = "$(value)$($(component):E=)" ;
case * :
value = "$(value)$(component)" ;
}
}
return $(value) ;
}
rule ExtractBuildFeatureArchives feature : list
{
# ExtractBuildFeatureArchives <feature> : <list> ;
# Downloads and extracts one or more archives for build feature <feature>
# and sets attributes for the build feature to extracted entries. The syntax
# for <list> is:
# "file:" <packageAlias> <packageName>
# <attribute>: <value> ...
# ...
# "file:" <packageAlias2> <packageName2>
# ...
#
# <packageAlias> specifies a short name for the archive (e.g. "base" for the
# base package, "devel" for the development package, etc.), <packageName>
# the unversioned name of the package (e.g. "libsolv_devel").
# <attribute> can be any name and <value> any relative path in the
# extraction directory. The following placeholders in <value> will be
# replaced with the respective value:
# * %packageName% is replaced with the name of the package as extracted from
# the package file name (may differ from the specified package name e.g.
# for bootstrap packages).
# * %portName% is replaced with the name of the port the package belongs to.
# That is %packageName% with any well-known package type suffix ("_devel",
# "_source", etc.) removed.
# * %packageFullVersion% is replaced with the the full version string of the
# package (i.e. including the revision) as extracted frmo the package file
# name.
# * %packageRevisionedName% is replaced with what
# %packageName%-%packageFullVersion% would be replaced.
# * %portRevisionedName% is replaced with what
# %portName%-%packageFullVersion% would be replaced.
#
# The attribute with the name "depends" will be handled specially. Its
# <value> specifies the name of a package the current package depends on
# (e.g. "devel" typically depends on "base"). If such a dependency is
# specified the current package will be extracted to the same directory as
# the package it depends on. The "depends" attribute must precede any other
# attribute for the package.
#
# The rule also sets the build feature attribute "<packageAlias>:directory"
# to the extraction directory for each package.
local qualifiedFeature = [ FQualifiedBuildFeatureName $(feature) ] ;
list = [ FFilterByBuildFeatures $(list) ] ;
while $(list) {
if $(list[1]) != file: {
Exit "ExtractBuildFeatureArchives: Expected \"file: ...\", got:"
$(list) ;
}
local package = $(list[2]) ;
local file = [ FetchPackage $(list[3]) ] ;
local fileName = $(file:BS) ;
list = $(list[4-]) ;
local directory = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(fileName:B) ] ;
directory = $(directory:G=$(package)) ;
while $(list) {
local attribute = [ Match "(.*):" : $(list[1]) ] ;
if ! $(attribute) {
Exit "ExtractBuildFeatureArchives: Expected attribute, got:"
$(list) ;
}
if $(attribute) = file {
break ;
}
list = $(list[2-]) ;
local values ;
while $(list) {
switch $(list[1]) {
case *: :
{
break ;
}
case * :
{
values += [ ExtractBuildFeatureArchivesExpandValue
$(list[1]) : $(fileName) ] ;
list = $(list[2-]) ;
}
}
}
if $(attribute) = depends {
# Inherit the extraction directory (with a different grist) and
# depend on the extraction directory of the base package.
local basePackage = $(values[1]) ;
local baseDirectory = [ BuildFeatureAttribute $(feature)
: $(basePackage):directory ] ;
directory = $(baseDirectory:G=$(package)) ;
Depends $(directory) : $(directory:G=$(basePackage)) ;
} else {
SetBuildFeatureAttribute $(feature) : $(attribute)
: [ ExtractArchive $(directory)
: $(values) : $(file)
: extracted-$(qualifiedFeature)-$(package) ] ;
SetBuildFeatureAttribute $(feature) : $(attribute):package
: $(package) ;
}
}
SetBuildFeatureAttribute $(feature) : $(package):directory
: $(directory:G=) ;
}
}
rule InitArchitectureBuildFeatures architecture
{
# InitArchitectureBuildFeatures <architecture> ;
#
# Enable the build features that can be derived directly from the
# architecture.
# The build feature rule use TARGET_PACKAGING_ARCH, so set that temporarily.
local savedArchitecture = $(TARGET_PACKAGING_ARCH) ;
TARGET_PACKAGING_ARCH = $(architecture) ;
# Add the target architecture as a build feature.
EnableBuildFeatures $(TARGET_ARCH_$(architecture)) ;
# For the primary architecture add the "primary" build feature.
if $(architecture) = $(TARGET_PACKAGING_ARCHS[1]) {
EnableBuildFeatures primary ;
}
# Add all secondary architectures as build features (with prefix).
EnableBuildFeatures secondary_$(TARGET_PACKAGING_ARCHS[2-]) ;
if $(TARGET_GCC_VERSION_$(architecture)[1]) = 2 {
EnableBuildFeatures gcc2 ;
}
TARGET_PACKAGING_ARCH = $(savedArchitecture) ;
}

View File

@ -1,75 +1,37 @@
# This file contains setup for build features that are not available for all
# architectures/setups or that are optional for the build. For features that
# require downloading a zip file from somewhere it is likely the same file used
# for an optional package.
# This file contains setup for build features that require external packages. It
# is included once for each configured packaging architecture (with
# TARGET_PACKAGING_ARCH set accordingly).
# Add the target architecture as a build feature.
EnableBuildFeatures $(HAIKU_ARCH) ;
# Detect a hybrid GCC2/GCC4 image and disable the checks for unavailable GCC4
# packages. (It does not matter if a package was built with either compiler,
# the system should have the respective other system libs.)
local isHybridBuild ;
if $(HAIKU_ADD_ALTERNATIVE_GCC_LIBS) = 1
&& $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR) {
isHybridBuild = 1 ;
}
local baseURL = http://www.haiku-files.org/files/optional-packages ;
local architecture = $(TARGET_PACKAGING_ARCH) ;
local secondaryArchSubDir = [ MultiArchIfPrimary "" : /$(architecture) ] ;
local developLibDir = develop/lib$(secondaryArchSubDir) ;
local developHeadersDir = develop/headers$(secondaryArchSubDir) ;
# SSL
# Automatically enable the SSL feature, when the optional OpenSSL optional
# package is enabled.
if [ IsOptionalHaikuImagePackageAdded OpenSSL ] {
# Automatically enable the SSL feature, when the OpenSSL package is enabled.
if [ IsHaikuImagePackageAdded openssl ] {
HAIKU_BUILD_FEATURE_SSL = 1 ;
}
if $(HAIKU_GCC_VERSION[1]) >= 4 {
if $(TARGET_ARCH) = x86_64 {
HAIKU_OPENSSL_PACKAGE = openssl-1.0.0j-x86_64-2012-12-18.zip ;
} else {
HAIKU_OPENSSL_PACKAGE = openssl-1.0.0j-r1a4-x86-gcc4-2012-08-29.zip ;
}
} else {
HAIKU_OPENSSL_PACKAGE = openssl-1.0.0j-r1a4-x86-gcc2-2012-08-26.zip ;
}
HAIKU_OPENSSL_URL = $(baseURL)/$(HAIKU_OPENSSL_PACKAGE) ;
if $(HAIKU_BUILD_FEATURE_SSL) {
if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
# Download the zip archive.
local zipFile = [ DownloadFile $(HAIKU_OPENSSL_PACKAGE)
: $(HAIKU_OPENSSL_URL) ] ;
# zip file and output directory
HAIKU_OPENSSL_ZIP_FILE = $(zipFile) ;
HAIKU_OPENSSL_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_OPENSSL_PACKAGE:B) ] ;
# extract headers and libraries
HAIKU_OPENSSL_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_OPENSSL_DIR)
: common/include/ : $(zipFile) : extracted-openssl
] ;
HAIKU_OPENSSL_LIBS = [ ExtractArchive $(HAIKU_OPENSSL_DIR)
:
common/lib/libcrypto.so
common/lib/libssl.so
: $(zipFile)
: extracted-openssl
] ;
HAIKU_OPENSSL_HEADERS
= [ FDirName $(HAIKU_OPENSSL_DIR) common include ] ;
if [ IsPackageAvailable openssl_devel ] {
ExtractBuildFeatureArchives openssl :
file: base openssl
runtime: lib
file: devel openssl_devel
depends: base
libraries:
$(developLibDir)/libcrypto.so
$(developLibDir)/libssl.so
headers: $(developHeadersDir)
;
EnableBuildFeatures openssl ;
} else {
Echo "SSL build feature not available for $(TARGET_ARCH)" ;
Echo "SSL build feature not available for $(TARGET_PACKAGING_ARCH)" ;
}
}
@ -77,92 +39,37 @@ if $(HAIKU_BUILD_FEATURE_SSL) {
# ICU
# Note ICU isn't actually optional, but is still an external package
HAIKU_ICU_GCC_2_PACKAGE = icu-4.8.1.1-r1a4-x86-gcc2-2012-08-29.zip ;
HAIKU_ICU_GCC_4_PACKAGE = icu-4.8.1.1-r1a4-x86-gcc4-2012-08-29.zip ;
HAIKU_ICU_PPC_PACKAGE = icu-4.8.1-ppc-2011-08-20.zip ;
HAIKU_ICU_ARM_PACKAGE = icu-4.8.1.1-arm-2012-11-21.zip ;
HAIKU_ICU_X86_64_PACKAGE = icu-4.8.1.1-x86_64-2012-07-30.zip ;
if $(TARGET_ARCH) in arm ppc x86 x86_64 {
local icu_package ;
if $(TARGET_ARCH) = ppc {
icu_package = $(HAIKU_ICU_PPC_PACKAGE) ;
HAIKU_ICU_DEVEL_PACKAGE = icu-devel-4.8.1-ppc-2011-12-19.zip ;
} else if $(TARGET_ARCH) = arm {
icu_package = $(HAIKU_ICU_ARM_PACKAGE) ;
HAIKU_ICU_DEVEL_PACKAGE = icu-devel-4.8.1.1-arm-2012-11-21.zip ;
} else if $(TARGET_ARCH) = x86_64 {
icu_package = $(HAIKU_ICU_X86_64_PACKAGE) ;
HAIKU_ICU_DEVEL_PACKAGE = icu-devel-4.8.1.1-x86_64-2012-07-30.zip ;
} else if $(HAIKU_GCC_VERSION[1]) = 2 {
icu_package = $(HAIKU_ICU_GCC_2_PACKAGE) ;
HAIKU_ICU_DEVEL_PACKAGE = icu-devel-4.8.1.1-x86-gcc2-2011-12-20.zip ;
} else {
icu_package = $(HAIKU_ICU_GCC_4_PACKAGE) ;
HAIKU_ICU_DEVEL_PACKAGE = icu-devel-4.8.1.1-x86-gcc4-2011-12-20.zip ;
}
local zipFile = [ DownloadFile $(icu_package)
: $(baseURL)/$(icu_package) ] ;
# zip file and output directory
HAIKU_ICU_ZIP_FILE = $(zipFile) ;
HAIKU_ICU_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(icu_package:B) ] ;
# extract libraries
if $(TARGET_ARCH) = ppc {
HAIKU_ICU_LIBS = [ ExtractArchive $(HAIKU_ICU_DIR)
:
libicudata.so.48.1
libicui18n.so.48.1
libicuio.so.48.1
libicule.so.48.1
libiculx.so.48.1
libicutu.so.48.1
libicuuc.so.48.1
: $(zipFile)
: extracted-icu
] ;
} else {
HAIKU_ICU_LIBS = [ ExtractArchive $(HAIKU_ICU_DIR)
:
libicudata.so.48.1.1
libicui18n.so.48.1.1
libicuio.so.48.1.1
libicule.so.48.1.1
libiculx.so.48.1.1
libicutu.so.48.1.1
libicuuc.so.48.1.1
: $(zipFile)
: extracted-icu
] ;
}
# zip file and output directory
HAIKU_ICU_DEVEL_ZIP_FILE = [ DownloadFile $(HAIKU_ICU_DEVEL_PACKAGE)
: $(baseURL)/$(HAIKU_ICU_DEVEL_PACKAGE) ] ;
HAIKU_ICU_DEVEL_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_ICU_DEVEL_PACKAGE:B) ] ;
# extract headers
HAIKU_ICU_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_ICU_DEVEL_DIR)
: develop/headers/3rdparty : $(HAIKU_ICU_DEVEL_ZIP_FILE)
: extracted-icu-devel ] ;
HAIKU_ICU_HEADERS
= [ FDirName $(HAIKU_ICU_DEVEL_DIR) develop headers 3rdparty ] ;
if [ IsPackageAvailable icu_devel ] {
ExtractBuildFeatureArchives icu :
file: base icu
runtime: lib
file: devel icu_devel
depends: base
libraries:
$(developLibDir)/libicudata.so
$(developLibDir)/libicui18n.so
$(developLibDir)/libicuio.so
$(developLibDir)/libicule.so
$(developLibDir)/libiculx.so
$(developLibDir)/libicutu.so
$(developLibDir)/libicuuc.so
headers: $(developHeadersDir)
;
EnableBuildFeatures icu ;
} else {
Echo "ICU not available for $(TARGET_ARCH)" ;
Echo "ICU not available for $(TARGET_PACKAGING_ARCH)" ;
}
# CLucene
# Automatically install the CLucene feature, when the optional CLucene optional
# package is enabled.
if [ IsOptionalHaikuImagePackageAdded CLucene ] {
# TODO: Update to packages!
if ! 1 {
# Automatically install the CLucene feature, when the CLucene package is
# enabled.
if [ IsHaikuImagePackageAdded clucene ] {
HAIKU_BUILD_FEATURE_CLUCENE = 1 ;
}
@ -172,7 +79,8 @@ HAIKU_CLUCENE_URL = $(baseURL)/$(HAIKU_CLUCENE_PACKAGE) ;
if $(HAIKU_BUILD_FEATURE_CLUCENE) {
if $(TARGET_ARCH) != x86 {
Echo "CLucene build feature not available for $(TARGET_ARCH)" ;
Echo "CLucene build feature not available for"
"$(TARGET_PACKAGING_ARCH)" ;
} else {
# Download the zip archive.
local zipFile = [ DownloadFile $(HAIKU_CLUCENE_PACKAGE)
@ -202,301 +110,226 @@ if $(HAIKU_BUILD_FEATURE_CLUCENE) {
}
}
} # ! 1
# GLU (GL Utilities)
# TODO: Update to packages!
if ! 1 {
# LLVM
if $(TARGET_ARCH) = x86 {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_GLU_FILE = glu-9.0-x86-gcc4-2012-11-13.zip ;
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) ] ;
HAIKU_LLVM_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_LLVM_FILE:B) ] ;
HAIKU_LLVM_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_LLVM_DIR)
: common/include/ : $(zipFile) : extracted-llvm ] ;
HAIKU_LLVM_HEADERS = [ FDirName $(HAIKU_LLVM_DIR) common include ] ;
# We can't Glob these because they aren't extracted yet.
HAIKU_LLVM_LIBS = [ ExtractArchive $(HAIKU_LLVM_DIR)
:
common/lib/libLLVMAsmParser.a
common/lib/libLLVMInstrumentation.a
common/lib/libLLVMLinker.a
common/lib/libLLVMArchive.a
common/lib/libLLVMBitReader.a
common/lib/libLLVMDebugInfo.a
common/lib/libLLVMJIT.a
common/lib/libLLVMipo.a
common/lib/libLLVMVectorize.a
common/lib/libLLVMBitWriter.a
common/lib/libLLVMTableGen.a
#common/lib/libLLVMHexagonCodeGen.a
#common/lib/libLLVMHexagonAsmPrinter.a
#common/lib/libLLVMHexagonDesc.a
#common/lib/libLLVMHexagonInfo.a
#common/lib/libLLVMNVPTXCodeGen.a
#common/lib/libLLVMNVPTXDesc.a
#common/lib/libLLVMNVPTXInfo.a
#common/lib/libLLVMNVPTXAsmPrinter.a
#common/lib/libLLVMMBlazeCodeGen.a
#common/lib/libLLVMMBlazeAsmParser.a
#common/lib/libLLVMMBlazeDisassembler.a
#common/lib/libLLVMMBlazeDesc.a
#common/lib/libLLVMMBlazeInfo.a
#common/lib/libLLVMMBlazeAsmPrinter.a
common/lib/libLLVMCppBackendCodeGen.a
common/lib/libLLVMCppBackendInfo.a
#common/lib/libLLVMMSP430CodeGen.a
#common/lib/libLLVMMSP430Desc.a
#common/lib/libLLVMMSP430AsmPrinter.a
#common/lib/libLLVMMSP430Info.a
#common/lib/libLLVMXCoreCodeGen.a
#common/lib/libLLVMXCoreDesc.a
#common/lib/libLLVMXCoreInfo.a
#common/lib/libLLVMCellSPUCodeGen.a
#common/lib/libLLVMCellSPUDesc.a
#common/lib/libLLVMCellSPUInfo.a
#common/lib/libLLVMMipsAsmParser.a
#common/lib/libLLVMMipsCodeGen.a
#common/lib/libLLVMMipsDesc.a
#common/lib/libLLVMMipsAsmPrinter.a
#common/lib/libLLVMMipsDisassembler.a
#common/lib/libLLVMMipsInfo.a
#common/lib/libLLVMARMAsmParser.a
#common/lib/libLLVMARMCodeGen.a
#common/lib/libLLVMARMDisassembler.a
#common/lib/libLLVMARMDesc.a
#common/lib/libLLVMARMInfo.a
#common/lib/libLLVMARMAsmPrinter.a
#common/lib/libLLVMPowerPCCodeGen.a
#common/lib/libLLVMPowerPCDesc.a
#common/lib/libLLVMPowerPCInfo.a
#common/lib/libLLVMPowerPCAsmPrinter.a
#common/lib/libLLVMSparcCodeGen.a
#common/lib/libLLVMSparcDesc.a
#common/lib/libLLVMSparcInfo.a
common/lib/libLLVMX86AsmParser.a
common/lib/libLLVMX86CodeGen.a
common/lib/libLLVMSelectionDAG.a
common/lib/libLLVMAsmPrinter.a
common/lib/libLLVMX86Disassembler.a
common/lib/libLLVMX86Desc.a
common/lib/libLLVMX86Info.a
common/lib/libLLVMX86AsmPrinter.a
common/lib/libLLVMX86Utils.a
common/lib/libLLVMMCDisassembler.a
common/lib/libLLVMMCParser.a
common/lib/libLLVMInterpreter.a
common/lib/libLLVMCodeGen.a
common/lib/libLLVMScalarOpts.a
common/lib/libLLVMInstCombine.a
common/lib/libLLVMTransformUtils.a
common/lib/libLLVMipa.a
common/lib/libLLVMAnalysis.a
common/lib/libLLVMMCJIT.a
common/lib/libLLVMRuntimeDyld.a
common/lib/libLLVMExecutionEngine.a
common/lib/libLLVMTarget.a
common/lib/libLLVMMC.a
common/lib/libLLVMObject.a
common/lib/libLLVMCore.a
common/lib/libLLVMSupport.a
: $(zipFile) : extracted-llvm ]
;
EnableBuildFeatures llvm ;
} else {
HAIKU_GLU_FILE = glu-9.0-x86-gcc2-2012-11-13.zip ;
# Nor will it ever be
Echo "LLVM not available on GCC2" ;
}
} else {
Echo "LLVM not yet available on $(TARGET_PACKAGING_ARCH)" ;
}
local zipFile = [ DownloadFile $(HAIKU_GLU_FILE)
: $(baseURL)/lib/$(HAIKU_GLU_FILE) ] ;
} # ! 1
HAIKU_GLU_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_GLU_FILE:B) ] ;
HAIKU_GLU_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_GLU_DIR)
: develop/headers/os/opengl/GL : $(zipFile) : extracted-glu-headers ] ;
HAIKU_GLU_LIBS = [ ExtractArchive $(HAIKU_GLU_DIR)
: system/lib/libGLU.a : $(zipFile) : extracted-glu ] ;
HAIKU_GLU_HEADERS = [ FDirName $(HAIKU_GLU_DIR) develop headers os opengl ] ;
# GLU (GL Utilities)
if [ IsPackageAvailable glu_devel ] {
ExtractBuildFeatureArchives glu :
file: base glu
runtime: lib
file: devel glu_devel
depends: base
library: $(developLibDir)/libGLU.so
headers: $(developHeadersDir)
;
EnableBuildFeatures glu ;
} else {
Echo "GLU not yet available on $(TARGET_ARCH)" ;
Echo "GLU not yet available on $(TARGET_PACKAGING_ARCH)" ;
}
# Mesa
if $(TARGET_ARCH) = x86 {
local zipFile ;
if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_MESA_FILE = mesa-9.2.0-x86-gcc4-2013-08-28.zip ;
} else {
HAIKU_MESA_FILE = mesa-7.8.2-x86-gcc2-2013-04-28.zip ;
}
if [ IsPackageAvailable mesa_devel ] {
ExtractBuildFeatureArchives mesa : [ FFilterByBuildFeatures
file: devel mesa_devel
mesaLibrary: $(developLibDir)/libmesa.a
glapiLibrary: $(developLibDir)/libglapi.a
headers: $(developHeadersDir)
privateHeaders: $(developHeadersDir)/mesa_private
zipFile = [ DownloadFile $(HAIKU_MESA_FILE)
: $(baseURL)/$(HAIKU_MESA_FILE) ] ;
!gcc2 @{
glslLibrary: $(developLibDir)/libglsl.a
galliumLibrary: $(developLibDir)/libgallium.a
llvm @{
galliumLlvmpipeLibrary: $(developLibDir)/libllvmpipe.a
}@
!llvm @{
galliumSoftpipeLibrary: $(developLibDir)/libsoftpipe.a
}@
}@ # !gcc2
] ;
HAIKU_MESA_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_MESA_FILE:B) ] ;
HAIKU_MESA_HEADERS = [ FDirName $(HAIKU_MESA_DIR) include ] ;
HAIKU_MESA_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_MESA_DIR)
: include/ : $(zipFile) : extracted-mesa ] ;
# Base Mesa libraries
HAIKU_MESA_LIB = [ ExtractArchive $(HAIKU_MESA_DIR)
:
lib.haiku/libmesa.a
: $(zipFile)
: extracted-mesa ] ;
HAIKU_GLAPI_LIB = [ ExtractArchive $(HAIKU_MESA_DIR)
:
lib.haiku/libglapi.a
: $(zipFile)
: extracted-mesa ] ;
Depends $(HAIKU_MESA_HEADERS_DEPENDENCY) : $(HAIKU_GLU_HEADERS_DEPENDENCY) ;
Depends $(HAIKU_GLAPI_LIBS) : $(HAIKU_GLU_LIBS) ;
# Extended Mesa libraries for newer versions
if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_GLSL_LIB = [ ExtractArchive $(HAIKU_MESA_DIR)
:
lib.haiku/libglsl.a
: $(zipFile)
: extracted-mesa ] ;
HAIKU_GALLIUM_LIB = [ ExtractArchive $(HAIKU_MESA_DIR)
:
lib.haiku/libgallium.a
: $(zipFile)
: extracted-mesa ] ;
HAIKU_GALLIUM_SWPIPE_LIB = [ ExtractArchive $(HAIKU_MESA_DIR)
:
lib.haiku/swpipe_bundle.a
: $(zipFile)
: extracted-mesa ] ;
}
Depends [ BuildFeatureAttribute mesa : galliumLlvmpipeLibrary ]
: $(HAIKU_LLVM_LIBS) ;
EnableBuildFeatures mesa ;
} else {
Echo "Mesa 3D rendering support not available on $(TARGET_ARCH)" ;
Echo "Mesa 3D rendering support not available on $(TARGET_PACKAGING_ARCH)" ;
}
# FFmpeg
local ffmpegBaseURL = $(baseURL)/lib ;
if $(TARGET_ARCH) = x86 {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_FFMPEG_FILE = ffmpeg-0.10.2-r1a4-x86-gcc4-2012-09-02.zip ;
HAIKU_SPEEX_FILE = speex-1.2rc1-r1a4-x86-gcc4-2012-09-02.zip ;
HAIKU_LIBTHEORA_FILE = libtheora-1.1.1-r1a4-x86-gcc4-2012-09-02.zip ;
HAIKU_LIBVORBIS_FILE = libvorbis-1.3.2-r1a4-x86-gcc4-2012-09-02.zip ;
HAIKU_LIBOGG_FILE = libogg-1.3.0-r1a4-x86-gcc4-2012-09-02.zip ;
HAIKU_LIBVPX_FILE = libvpx-1.0.0-r1a4-x86-gcc4-2012-09-02.zip ;
} else {
HAIKU_FFMPEG_FILE = ffmpeg-0.10.2-r1a4-x86-gcc2-2012-08-30.zip ;
HAIKU_SPEEX_FILE = speex-1.2rc1-r1a4-x86-gcc2-2012-08-29.zip ;
HAIKU_LIBTHEORA_FILE = libtheora-1.1.1-r1a4-x86-gcc2-2012-08-29.zip ;
HAIKU_LIBVORBIS_FILE = libvorbis-1.3.2-r1a4-x86-gcc2-2012-08-29.zip ;
HAIKU_LIBOGG_FILE = libogg-1.3.0-r1a4-x86-gcc2-2012-08-29.zip ;
HAIKU_LIBVPX_FILE = libvpx-1.0.0-r1a4-x86-gcc2-2012-08-29.zip ;
if [ IsPackageAvailable ffmpeg_devel ] {
local ffmpegLibs = libavformat.so libavcodec.so libavdevice.so
libavfilter.so libswscale.so libavutil.so ;
local speexLibs = libspeex.so ;
local libtheoraLibs = libtheora.so libtheoradec.so libtheoraenc.so ;
local libvorbisLibs = libvorbis.so libvorbisenc.so ;
local liboggLibs = libogg.so ;
local libvpxLibs = libvpx.so ;
local feature ;
for feature in ffmpeg speex libtheora libvorbis libogg libvpx {
ExtractBuildFeatureArchives $(feature) :
file: base $(feature)
runtime: lib
file: devel $(feature)_devel
depends: base
libraries: $(developLibDir)/$($(feature)Libs)
headers: $(developHeadersDir)
;
EnableBuildFeatures $(feature) ;
}
local ffmpegZipFile = [ DownloadFile $(HAIKU_FFMPEG_FILE)
: $(ffmpegBaseURL)/$(HAIKU_FFMPEG_FILE) ] ;
local speexZipFile = [ DownloadFile $(HAIKU_SPEEX_FILE)
: $(ffmpegBaseURL)/$(HAIKU_SPEEX_FILE) ] ;
local libtheoraZipFile = [ DownloadFile $(HAIKU_LIBTHEORA_FILE)
: $(ffmpegBaseURL)/$(HAIKU_LIBTHEORA_FILE) ] ;
local libvorbisZipFile = [ DownloadFile $(HAIKU_LIBVORBIS_FILE)
: $(ffmpegBaseURL)/$(HAIKU_LIBVORBIS_FILE) ] ;
local liboggZipFile = [ DownloadFile $(HAIKU_LIBOGG_FILE)
: $(ffmpegBaseURL)/$(HAIKU_LIBOGG_FILE) ] ;
local libvpxZipFile = [ DownloadFile $(HAIKU_LIBVPX_FILE)
: $(ffmpegBaseURL)/$(HAIKU_LIBVPX_FILE) ] ;
HAIKU_FFMPEG_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_FFMPEG_FILE:B) ] ;
HAIKU_SPEEX_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_SPEEX_FILE:B) ] ;
HAIKU_LIBTHEORA_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_LIBTHEORA_FILE:B) ] ;
HAIKU_LIBVORBIS_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_LIBVORBIS_FILE:B) ] ;
HAIKU_LIBOGG_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_LIBOGG_FILE:B) ] ;
HAIKU_LIBVPX_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_LIBVPX_FILE:B) ] ;
HAIKU_FFMPEG_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_FFMPEG_DIR)
: common/include/ : $(ffmpegZipFile) : extracted-ffmpeg ] ;
HAIKU_SPEEX_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_SPEEX_DIR)
: common/include/ : $(speexZipFile) : extracted-speex ] ;
HAIKU_LIBTHEORA_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_LIBTHEORA_DIR)
: common/include/ : $(libtheoraZipFile) : extracted-libtheora ] ;
HAIKU_LIBVORBIS_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_LIBVORBIS_DIR)
: common/include/ : $(libvorbisZipFile) : extracted-libvorbis ] ;
HAIKU_LIBOGG_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_LIBOGG_DIR)
: common/include/ : $(liboggZipFile) : extracted-libogg ] ;
HAIKU_LIBVPX_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_LIBVPX_DIR)
: common/include/ : $(libvpxZipFile) : extracted-libvpx ] ;
HAIKU_FFMPEG_LIBS = [ ExtractArchive $(HAIKU_FFMPEG_DIR)
:
common/lib/libavformat.a
common/lib/libavcodec.a
common/lib/libavdevice.a
common/lib/libavfilter.a
common/lib/libswscale.a
common/lib/libavutil.a
: $(ffmpegZipFile)
: extracted-ffmpeg ] ;
Depends $(HAIKU_FFMPEG_LIBS) : $(HAIKU_FFMPEG_HEADERS_DEPENDENCY) ;
HAIKU_SPEEX_LIBS = [ ExtractArchive $(HAIKU_SPEEX_DIR)
:
common/lib/libspeex.a
: $(speexZipFile)
: extracted-speex ] ;
Depends $(HAIKU_SPEEX_LIBS) : $(HAIKU_SPEEX_HEADERS_DEPENDENCY) ;
HAIKU_LIBTHEORA_LIBS = [ ExtractArchive $(HAIKU_LIBTHEORA_DIR)
:
common/lib/libtheora.a
common/lib/libtheoradec.a
common/lib/libtheoraenc.a
: $(libtheoraZipFile)
: extracted-libtheora ] ;
Depends $(HAIKU_LIBTHEORA_LIBS) : $(HAIKU_LIBTHEORA_HEADERS_DEPENDENCY) ;
HAIKU_LIBVORBIS_LIBS = [ ExtractArchive $(HAIKU_LIBVORBIS_DIR)
:
common/lib/libvorbis.a
common/lib/libvorbisenc.a
: $(libvorbisZipFile)
: extracted-libvorbis ] ;
Depends $(HAIKU_LIBVORBIS_LIBS) : $(HAIKU_LIBVORBIS_HEADERS_DEPENDENCY) ;
HAIKU_LIBOGG_LIBS = [ ExtractArchive $(HAIKU_LIBOGG_DIR)
:
common/lib/libogg.a
: $(liboggZipFile)
: extracted-libogg ] ;
Depends $(HAIKU_LIBOGG_LIBS) : $(HAIKU_LIBOGG_HEADERS_DEPENDENCY) ;
HAIKU_LIBVPX_LIBS = [ ExtractArchive $(HAIKU_LIBVPX_DIR)
:
common/lib/libvpx.a
: $(libvpxZipFile)
: extracted-libvpx ] ;
Depends $(HAIKU_LIBVPX_LIBS) : $(HAIKU_LIBVPX_HEADERS_DEPENDENCY) ;
HAIKU_FFMPEG_HEADERS = [ FDirName $(HAIKU_FFMPEG_DIR) common include ] ;
HAIKU_SPEEX_HEADERS = [ FDirName $(HAIKU_SPEEX_DIR) common include ] ;
HAIKU_LIBTHEORA_HEADERS = [ FDirName $(HAIKU_LIBTHEORA_DIR) common include ] ;
HAIKU_LIBVORBIS_HEADERS = [ FDirName $(HAIKU_LIBVORBIS_DIR) common include ] ;
HAIKU_LIBOGG_HEADERS = [ FDirName $(HAIKU_LIBOGG_DIR) common include ] ;
HAIKU_LIBVPX_HEADERS = [ FDirName $(HAIKU_LIBVPX_DIR) common include ] ;
EnableBuildFeatures ffmpeg ;
} else {
Echo "FFMpeg support not available on $(TARGET_ARCH)" ;
}
# MikMod
local mikmodBaseURL = http://haiku-files.org/files/optional-packages/lib ;
if $(TARGET_ARCH) = x86 {
if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_MIKMOD_FILE = libmikmod-3.1.11-r1a4-x86-gcc4-2012-09-02.zip ;
} else {
HAIKU_MIKMOD_FILE = libmikmod-3.1.11-r1a4-x86-gcc2-2012-08-29.zip ;
}
local mikmodZipFile = [ DownloadFile $(HAIKU_MIKMOD_FILE)
: $(mikmodBaseURL)/$(HAIKU_MIKMOD_FILE) ] ;
HAIKU_MIKMOD_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_MIKMOD_FILE:B) ] ;
HAIKU_MIKMOD_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_MIKMOD_DIR)
: common/include/ : $(mikmodZipFile) : extracted-mikmod ] ;
HAIKU_MIKMOD_LIBS = [ ExtractArchive $(HAIKU_MIKMOD_DIR)
:
common/lib/libmikmod.a
: $(mikmodZipFile)
: extracted-ffmpeg ] ;
Depends $(HAIKU_MIKMOD_LIBS) : $(HAIKU_MIKMOD_HEADERS_DEPENDENCY) ;
HAIKU_MIKMOD_HEADERS = [ FDirName $(HAIKU_MIKMOD_DIR) common include ] ;
EnableBuildFeatures mikmod ;
} else {
Echo "MikMod support not available on $(TARGET_ARCH)" ;
Echo "FFMpeg support not available on $(TARGET_PACKAGING_ARCH)" ;
}
# Freetype
local freetypeBaseURL = $(baseURL)/lib ;
if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(TARGET_ARCH) = arm {
if $(TARGET_ARCH) = arm {
HAIKU_FREETYPE_FILE = freetype-2.4.9-arm-2012-11-21.zip ;
} else if $(TARGET_ARCH) = ppc {
HAIKU_FREETYPE_FILE = freetype-2.4.9-ppc-gcc4-2012-06-26.zip ;
} else if $(TARGET_ARCH) = x86_64 {
HAIKU_FREETYPE_FILE = freetype-2.4.9-x86_64-2012-08-04.zip ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_FREETYPE_FILE = freetype-2.4.9-r1a4-x86-gcc4-2012-09-02.zip ;
} else {
HAIKU_FREETYPE_FILE = freetype-2.4.9-r1a4-x86-gcc2-2012-08-28.zip ;
}
local freetypeZipFile = [ DownloadFile $(HAIKU_FREETYPE_FILE)
: $(freetypeBaseURL)/$(HAIKU_FREETYPE_FILE) ] ;
HAIKU_FREETYPE_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_FREETYPE_FILE:B) ] ;
HAIKU_FREETYPE_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_FREETYPE_DIR)
: develop/headers/3rdparty/freetype2 : $(freetypeZipFile)
: extracted-freetype ] ;
HAIKU_FREETYPE_LIB = [ ExtractArchive $(HAIKU_FREETYPE_DIR)
:
common/lib/libfreetype.so
: $(freetypeZipFile)
: extracted-freetype ] ;
HAIKU_FREETYPE_CURRENT_LIB = [ ExtractArchive $(HAIKU_FREETYPE_DIR)
:
common/lib/libfreetype.so.6.8.1
: $(freetypeZipFile)
: extracted-freetype ] ;
Depends $(HAIKU_FREETYPE_LIB) $(HAIKU_FREETYPE_CURRENT_LIB) : $(HAIKU_FREETYPE_HEADERS_DEPENDENCY) ;
HAIKU_FREETYPE_CURRENT_LINK = libfreetype.so.6 ;
HAIKU_FREETYPE_HEADERS = [ FDirName $(HAIKU_FREETYPE_DIR) develop
headers 3rdparty ] [ FDirName $(HAIKU_FREETYPE_DIR) develop
headers 3rdparty freetype2 ] ;
if [ IsPackageAvailable freetype_devel ] {
ExtractBuildFeatureArchives freetype :
file: base freetype
runtime: lib
file: devel freetype_devel
depends: base
library: $(developLibDir)/libfreetype.so
headers: $(developHeadersDir) $(developHeadersDir)/freetype2
;
EnableBuildFeatures freetype ;
} else {
Echo "Freetype support not available on $(TARGET_ARCH)" ;
Echo "Freetype support not available on $(TARGET_PACKAGING_ARCH)" ;
}
# TagLib
# TODO: Update to packages!
if ! 1 {
# Automatically install the TagLib feature, when the optional TagLib optional
# package is enabled.
if [ IsOptionalHaikuImagePackageAdded TagLib ] {
if [ IsHaikuImagePackageAdded taglib ] {
HAIKU_BUILD_FEATURE_TAGLIB = 1 ;
}
@ -505,7 +338,7 @@ HAIKU_TAGLIB_URL = $(baseURL)/$(HAIKU_TAGLIB_PACKAGE) ;
if $(HAIKU_BUILD_FEATURE_TAGLIB) {
if $(TARGET_ARCH) != x86 {
Echo "TagLib build feature not available for $(TARGET_ARCH)" ;
Echo "TagLib build feature not available for $(TARGET_PACKAGING_ARCH)" ;
} else {
# Download the zip archive.
local zipFile = [ DownloadFile $(HAIKU_TAGLIB_PACKAGE)
@ -536,190 +369,107 @@ if $(HAIKU_BUILD_FEATURE_TAGLIB) {
}
}
} # ! 1
# WebKit
# Automatically install the WebKit feature, when the optional WebPositive
# optional package is enabled.
if [ IsOptionalHaikuImagePackageAdded WebPositive ] {
HAIKU_BUILD_FEATURE_WEBKIT = 1 ;
}
if $(TARGET_ARCH) = x86 {
HAIKU_WEBKIT_FILE = haikuwebkit-1.1.3-x86-gcc4-2012-08-31a.zip ;
} else if $(TARGET_ARCH) = x86_64 {
HAIKU_WEBKIT_FILE = haikuwebkit-1.1.3-x86_64-gcc4-2012-12-22.zip ;
}
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 {
if ! $(isHybridBuild) {
Echo "WebKit support not available on gcc $(HAIKU_GCC_VERSION[1])" ;
} else {
Echo "WebKit to be utilized by gcc4 inside $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR)" ;
}
} else {
local zipFile = [ DownloadFile $(HAIKU_WEBKIT_FILE)
: $(baseURL)/$(HAIKU_WEBKIT_FILE) ] ;
HAIKU_WEBKIT_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_WEBKIT_FILE:B) ] ;
HAIKU_WEBKIT_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_WEBKIT_DIR)
: include/ : $(zipFile) : extracted-webkit ] ;
HAIKU_WEBKIT_LIBS = [ ExtractArchive $(HAIKU_WEBKIT_DIR)
:
lib/libwtf.so
lib/libjavascriptcore.so
lib/libwebcore.so
lib/libwebkit.so
: $(zipFile)
: extracted-webkit
] ;
HAIKU_WEBKIT_HEADERS = [ FDirName $(HAIKU_WEBKIT_DIR) include ] ;
if [ IsPackageAvailable haikuwebkit_devel ] {
ExtractBuildFeatureArchives webkit :
file: base haikuwebkit
runtime: lib
file: devel haikuwebkit_devel
depends: base
libraries:
$(developLibDir)/libwtf.so
$(developLibDir)/libjavascriptcore.so
$(developLibDir)/libwebcore.so
$(developLibDir)/libwebkit.so
headers: $(developHeadersDir)
;
EnableBuildFeatures webkit ;
} else {
Echo "WebKit build feature not available for $(TARGET_PACKAGING_ARCH)" ;
}
}
# libpng
local libpngBaseURL = $(baseURL)/lib ;
if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(TARGET_ARCH) = arm {
if $(TARGET_ARCH) = arm {
HAIKU_LIBPNG_FILE = libpng-1.5.12-arm-2012-11-21.zip ;
} else if $(TARGET_ARCH) = ppc {
HAIKU_LIBPNG_FILE = libpng-1.5.12-ppc-gcc4-2012-08-27.zip ;
} else if $(TARGET_ARCH) = x86_64 {
HAIKU_LIBPNG_FILE = libpng-1.5.12-x86_64-2012-11-18.zip ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_LIBPNG_FILE = libpng-1.5.12-x86-gcc4-2012-08-23.zip ;
} else {
HAIKU_LIBPNG_FILE = libpng-1.5.12-x86-gcc2-2012-08-23.zip ;
}
local libpngZipFile = [ DownloadFile $(HAIKU_LIBPNG_FILE)
: $(libpngBaseURL)/$(HAIKU_LIBPNG_FILE) ] ;
HAIKU_LIBPNG_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_LIBPNG_FILE:B) ] ;
HAIKU_LIBPNG_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_LIBPNG_DIR)
: common/include : $(libpngZipFile)
: extracted-libpng ] ;
HAIKU_LIBPNG_LIB = [ ExtractArchive $(HAIKU_LIBPNG_DIR)
:
common/lib/libpng.so
: $(libpngZipFile)
: extracted-libpng ] ;
HAIKU_LIBPNG_CURRENT_LIB = [ ExtractArchive $(HAIKU_LIBPNG_DIR)
:
common/lib/libpng15.so.15.12.0
: $(libpngZipFile)
: extracted-libpng ] ;
Depends $(HAIKU_LIBPNG_LIB) $(HAIKU_LIBPNG_CURRENT_LIB) : $(HAIKU_LIBPNG_HEADERS_DEPENDENCY) ;
HAIKU_LIBPNG_CURRENT_LINK = libpng15.so.15 ;
HAIKU_LIBPNG_HEADERS = [ FDirName $(HAIKU_LIBPNG_DIR) common include ] ;
if [ IsPackageAvailable libpng_devel ] {
ExtractBuildFeatureArchives libpng :
file: base libpng
runtime: lib
file: devel libpng_devel
depends: base
library: $(developLibDir)/libpng.so
headers: $(developHeadersDir)
;
EnableBuildFeatures libpng ;
} else {
Echo "libpng support not available on $(TARGET_ARCH)" ;
Echo "libpng support not available on $(TARGET_PACKAGING_ARCH)" ;
}
# jpeg
local jpegBaseURL = $(baseURL)/lib ;
if $(TARGET_ARCH) in arm ppc x86 x86_64 {
if $(TARGET_ARCH) = arm {
HAIKU_JPEG_FILE = jpeg-8d-arm-2012-11-21.zip ;
} else if $(TARGET_ARCH) = ppc {
HAIKU_JPEG_FILE = jpeg-8d-ppc-gcc4-2012-08-27.zip ;
} else if $(TARGET_ARCH) = x86_64 {
HAIKU_JPEG_FILE = jpeg-8d-x86_64-2012-11-18.zip ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_JPEG_FILE = jpeg-8d-x86-gcc4-2012-08-23.zip ;
if [ IsPackageAvailable jpeg_devel ] {
ExtractBuildFeatureArchives jpeg :
file: base jpeg
runtime: lib
file: devel jpeg_devel
depends: base
library: $(developLibDir)/libjpeg.so
headers: $(developHeadersDir)
;
EnableBuildFeatures jpeg ;
} else {
HAIKU_JPEG_FILE = jpeg-8d-x86-gcc2-2012-08-23.zip ;
Echo "jpeg support not available on $(TARGET_PACKAGING_ARCH)" ;
}
local jpegZipFile = [ DownloadFile $(HAIKU_JPEG_FILE)
: $(jpegBaseURL)/$(HAIKU_JPEG_FILE) ] ;
HAIKU_JPEG_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_JPEG_FILE:B) ] ;
HAIKU_JPEG_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_JPEG_DIR)
: common/include : $(jpegZipFile)
: extracted-jpeg ] ;
HAIKU_JPEG_LIB = [ ExtractArchive $(HAIKU_JPEG_DIR)
:
common/lib/libjpeg.so
: $(jpegZipFile)
: extracted-jpeg ] ;
HAIKU_JPEG_CURRENT_LIB = [ ExtractArchive $(HAIKU_JPEG_DIR)
:
common/lib/libjpeg.so.8.4.0
: $(jpegZipFile)
: extracted-jpeg ] ;
Depends $(HAIKU_JPEG_LIB) $(HAIKU_JPEG_CURRENT_LIB) : $(HAIKU_JPEG_HEADERS_DEPENDENCY) ;
HAIKU_JPEG_CURRENT_LINK = libjpeg.so.8 ;
HAIKU_JPEG_HEADERS = [ FDirName $(HAIKU_JPEG_DIR) common include ] ;
EnableBuildFeatures libjpeg ;
} else {
Echo "jpeg support not available on $(TARGET_ARCH)" ;
}
# zlib
local zlibBaseURL = $(baseURL)/lib ;
if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 || $(TARGET_ARCH) = arm {
if $(TARGET_ARCH) = arm {
HAIKU_ZLIB_FILE = zlib-1.2.7-arm-2012-11-21.zip ;
} else if $(TARGET_ARCH) = ppc {
HAIKU_ZLIB_FILE = zlib-1.2.7-ppc-gcc4-2012-10-30.zip ;
} else if $(TARGET_ARCH) = x86_64 {
HAIKU_ZLIB_FILE = zlib-1.2.7-x86_64-2012-11-18.zip ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
HAIKU_ZLIB_FILE = zlib-1.2.7-x86-gcc4-2012-10-30.zip ;
} else {
HAIKU_ZLIB_FILE = zlib-1.2.7-x86-gcc2-2012-10-30.zip ;
}
local zlibZipFile = [ DownloadFile $(HAIKU_ZLIB_FILE)
: $(zlibBaseURL)/$(HAIKU_ZLIB_FILE) ] ;
HAIKU_ZLIB_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
$(HAIKU_ZLIB_FILE:B) ] ;
HAIKU_ZLIB_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_ZLIB_DIR)
: common/include : $(zlibZipFile)
: extracted-zlib ] ;
HAIKU_ZLIB_LIB = [ ExtractArchive $(HAIKU_ZLIB_DIR)
:
common/lib/libz.so
: $(zlibZipFile)
: extracted-zlib ] ;
HAIKU_ZLIB_CURRENT_LIB = [ ExtractArchive $(HAIKU_ZLIB_DIR)
:
common/lib/libz.so.1.2.7
: $(zlibZipFile)
: extracted-zlib ] ;
Depends $(HAIKU_ZLIB_LIB) $(HAIKU_ZLIB_CURRENT_LIB) : $(HAIKU_ZLIB_HEADERS_DEPENDENCY) ;
HAIKU_ZLIB_CURRENT_LINK = libz.so.1 ;
HAIKU_ZLIB_HEADERS = [ FDirName $(HAIKU_ZLIB_DIR) common include ] ;
if [ IsPackageAvailable zlib_devel ] {
ExtractBuildFeatureArchives zlib :
file: base zlib
runtime: lib
file: devel zlib_devel
depends: base
library: $(developLibDir)/libz.so
headers: $(developHeadersDir)
# sources are required for the primary architecture only
primary @{
file: source zlib_source
sources: develop/sources/%portRevisionedName%/source
}@
;
EnableBuildFeatures zlib ;
} else {
Echo "zlib support not available on $(TARGET_ARCH)" ;
Echo "zlib support not available on $(TARGET_PACKAGING_ARCH)" ;
}
# libsolv
if [ IsPackageAvailable libsolv_devel ] {
ExtractBuildFeatureArchives libsolv :
file: base libsolv
runtime: lib
file: devel libsolv_devel
depends: base
libraries:
$(developLibDir)/libsolv.so
$(developLibDir)/libsolvext.so
headers: $(developHeadersDir)
# sources are required for the primary architecture only
primary @{
file: source libsolv_source
sources: develop/sources/%portRevisionedName%/source
}@
;
EnableBuildFeatures libsolv ;
} else {
Echo "libsolv package not available for $(TARGET_PACKAGING_ARCH)" ;
}

File diff suppressed because it is too large Load Diff

View File

@ -66,6 +66,16 @@ rule ProcessCommandLineArguments
}
}
# Copy the given set of local package files to the remote repository
# and create a new version of that remote repository.
case build-remote-repository : {
BuildRemoteHaikuPortsRepository $(JAM_TARGETS[1])
: $(JAM_TARGETS[2-]) ;
JAM_TARGETS = $(JAM_TARGETS[1]) ;
NotFile $(JAM_TARGETS) ;
Always $(JAM_TARGETS) ;
}
# A target starting with "@" is a build profile.
case @* : {
HAIKU_BUILD_PROFILE = [ Match "@(.*)" : $(JAM_TARGETS[1]) ] ;
@ -81,7 +91,9 @@ rule ProcessCommandLineArguments
if $(JAM_TARGETS[1]) in update-image update-vmware-image
update-install {
SetUpdateHaikuImageOnly 1 ;
HAIKU_PACKAGES_UPDATE_ONLY = 1 ;
HAIKU_INCLUDE_IN_IMAGE on $(JAM_TARGETS[2-]) = 1 ;
HAIKU_INCLUDE_IN_PACKAGES on $(JAM_TARGETS[2-]) = 1 ;
if $(JAM_TARGETS[1]) = update-image {
JAM_TARGETS = haiku-image ;

View File

@ -0,0 +1,201 @@
# set HAIKU_BOOTSTRAP_BUILD early, if building a bootstrap Haiku image
switch $(HAIKU_BUILD_PROFILE) {
case "bootstrap-*" :
HAIKU_BOOTSTRAP_BUILD = 1 ;
}
rule DefineDefaultBuildProfiles
{
# alpha release profiles
DefineBuildProfile alpha-raw : image : "haiku-alpha.image" ;
DefineBuildProfile alpha-vmware : vmware-image : "haiku-alpha.vmdk" ;
DefineBuildProfile alpha-cd : cd-image : "haiku-alpha.iso" ;
DefineBuildProfile alpha-anyboot : anyboot-image
: "haiku-alpha-anyboot.image" ;
# nightly profiles
DefineBuildProfile nightly-raw : image : "haiku-nightly.image" ;
DefineBuildProfile nightly-vmware : vmware-image : "haiku-nightly.vmdk" ;
DefineBuildProfile nightly-cd : cd-image : "haiku-nightly.iso" ;
DefineBuildProfile nightly-anyboot : anyboot-image
: "haiku-nightly-anyboot.image" ;
# bootstrap profiles
DefineBuildProfile bootstrap-raw : image : "haiku-bootstrap.image" ;
DefineBuildProfile bootstrap-vmware : vmware-image
: "haiku-bootstrap.vmdk" ;
switch $(HAIKU_BUILD_PROFILE) {
case "alpha-*" : {
Echo Building Haiku R1/alpha ;
HAIKU_ROOT_USER_NAME = user ;
HAIKU_ROOT_USER_REAL_NAME = "Yourself" ;
AddGroupToHaikuImage party : 101 : user sshd ;
HAIKU_IMAGE_HOST_NAME = shredder ;
HAIKU_IMAGE_SIZE = 800 ;
AddHaikuImagePackages
wpa_supplicant
:
system
;
AddHaikuImagePackages
bepdf
cvs
keymapswitcher
man
mercurial
nano
openssh
p7zip
pe
python
subversion
timgmsoundfont
vision
wonderbrush
wqy_microhei
xz_utils@!gcc2
;
# xz_utils can't be built with gcc2, so a mere gcc2 system doesn't
# have it. However, xz_utils does exist for the secondary (gcc4)
# architecture of a gcc2 hybrid.
if $(HAIKU_PACKAGING_ARCHS) != x86_gcc2 {
AddHaikuImagePackages
xz_utils_x86@gcc2
;
}
local architectureObject ;
for architectureObject in [ MultiArchSubDirSetup ] {
on $(architectureObject) {
AddHaikuImagePackages openssl : system ;
}
}
AddOptionalHaikuImagePackages BeBook Development Git WebPositive
Welcome ;
}
case "beta-*" : {
Echo You wish. ;
}
case "nightly-*" : {
Echo Building Haiku Nightly ;
HAIKU_ROOT_USER_NAME = user ;
HAIKU_ROOT_USER_REAL_NAME = "Yourself" ;
AddGroupToHaikuImage party : 101 : user sshd ;
HAIKU_IMAGE_HOST_NAME = shredder ;
HAIKU_IMAGE_SIZE = 600 ;
AddHaikuImagePackages
openssl
wpa_supplicant
:
system
;
AddHaikuImagePackages
man
nano
openssh
p7zip
pe
vision
xz_utils
;
AddOptionalHaikuImagePackages Development Git WebPositive ;
}
case "bootstrap-*" : {
Echo Building Haiku Bootstrap ;
HAIKU_IMAGE_HOST_NAME = shredder ;
HAIKU_IMAGE_SIZE = 20000 ;
AddHaikuImagePackages
freetype
freetype_devel
grep
icu
libsolv
ncurses
ncurses_devel
sed
zlib
zlib_devel
:
system
;
AddHaikuImagePackages
autoconf
automake
binutils
bison
flex
gcc
haikuporter
# jam
libtool
libtool_libltdl
m4
make
# makeinfo
# mkdepend
# perl
python
# texinfo
;
# secondary architecture packages
local architectureObject ;
for architectureObject
in [ MultiArchSubDirSetup $(TARGET_PACKAGING_ARCHS[2-]) ] {
on $(architectureObject) {
AddHaikuImagePackages
freetype
freetype_devel
icu
libsolv
ncurses
ncurses_devel
zlib
zlib_devel
:
system
;
AddHaikuImagePackages
binutils
gcc
;
}
}
AddOptionalHaikuImagePackages DevelopmentMin ;
}
}
# Uncomment in official release branch.
#HAIKU_DEFINES += HAIKU_OFFICIAL_RELEASE ;
#TARGET_DEFINES += HAIKU_OFFICIAL_RELEASE ;
# If a build profile was specified on the command line, now is the time to
# check whether it is unknown or one of the default profiles.
if $(HAIKU_BUILD_PROFILE) && ! $(HAIKU_BUILD_PROFILE_DEFINED) {
# define the obvious default profiles
if $(HAIKU_BUILD_PROFILE) in anyboot-image cd-image image install
vmware-image {
DefineBuildProfile $(HAIKU_BUILD_PROFILE) : $(HAIKU_BUILD_PROFILE) ;
} else {
Exit "Build profile" $(HAIKU_BUILD_PROFILE) "not defined." ;
}
}
}

View File

@ -1,3 +1,20 @@
rule Copy
{
if $(2) {
SEARCH on $(2) += $(SEARCH_SOURCE) ;
Depends $(1) : <build>copyattr $(2) ;
Copy1 $(1) : <build>copyattr $(2) ;
}
}
actions Copy1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
"$(2[1])" -d "$(2[2-])" "$(1)"
}
rule SymLink
{
# SymLink <target> : <source> : <makeDefaultDependencies> ;
@ -186,7 +203,8 @@ rule UnarchiveObjects
actions UnarchiveObjects
{
( cd $(1[1]:D) && $(TARGET_AR) $(TARGET_UNARFLAGS) "$(2)" $(1:BS) )
( cd $(1[1]:D) && $(TARGET_AR_$(TARGET_PACKAGING_ARCH)) \
$(TARGET_UNARFLAGS_$(TARGET_PACKAGING_ARCH)) "$(2)" $(1:BS) )
}
@ -220,7 +238,7 @@ rule ExtractArchive directory : entries : archiveFile : grist
targets += $(target) ;
}
LOCATE on $(targets) = $(directory) ;
LOCATE on $(targets) = $(directory:G=) ;
Depends $(targets) : $(directory) $(archiveFile) ;
NoUpdate $(targets) ;
@ -235,40 +253,53 @@ rule ExtractArchive directory : entries : archiveFile : grist
Depends $(directory) : $(archiveFile) ;
switch $(archiveFile:S)
{
case .zip : ExtractZipArchive1 $(targets) : $(directory)
$(archiveFile) ;
case .tgz : ExtractTarArchive1 $(targets) : $(directory)
$(archiveFile) ;
case "" : Exit "ExtractArchive: No archive passed" ;
case * : Exit "ExtractArchive: Unhandled archive extension:
$(archiveFile:S)" ;
case .zip :
ExtractZipArchive1 $(directory) : $(archiveFile) ;
case .tgz :
ExtractTarArchive1 $(directory) : $(archiveFile) ;
case .hpkg :
Depends $(directory) : <build>package ;
ExtractHPKGArchive1 $(directory)
: <build>package $(archiveFile) ;
case "" :
Exit "ExtractArchive: No archive passed" ;
case * :
Exit "ExtractArchive: Unhandled archive extension:"
"$(archiveFile:S)" ;
}
INITIALIZED on $(directory) = 1 ;
}
# Use a dummy rule so that it looks to jam like the targets are actually
# built from the directory target.
ExtractArchiveDummy $(targets) : $(directory) ;
return $(targets) ;
}
actions ExtractZipArchive1
{
mkdir -p $(2[1])
unzip -q -u -o -d $(2[1]) $(2[2])
mkdir -p $(1)
unzip -q -u -o -d $(1) $(2)
}
actions ExtractTarArchive1
{
mkdir -p $(2[1])
tar -C $(2[1]) -xf $(2[2])
mkdir -p $(1)
tar -C $(1) -xf $(2)
}
actions ExtractArchiveDummy
actions ExtractHPKGArchive1
{
mkdir -p "$(1)"
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) extract -C "$(1)" "$(2[2])"
}
rule ObjectReference
{
# ObjectReference <reference object> : <source object>
@ -297,52 +328,63 @@ rule ObjectReferences
}
}
rule CopySetHaikuRevision target : source
{
# CopySetHaikuRevision <target> : <source>
#
# Copy <source> to <target>, writing the SVN revision of the working root
# Copy <source> to <target>, writing the Git revision of the working
# directory into the haiku revision section of <target>.
#
# <target> - Output file target. Gristed and located target.
# <source> - ELF object to be copied. Gristed and located target.
# If existent, make the target depend on the .svn/entries file in the
# If existing, make the target depend on the .git/index file in the
# root directory, so it gets updated when the revision changes due to
# "svn up".
if [ Glob [ FDirName $(HAIKU_TOP) .svn ] : entries ] {
local svnEntries = <haiku-rootdir-svn>entries ;
SEARCH on $(svnEntries) = [ FDirName $(HAIKU_TOP) .svn ] ;
Depends $(target) : $(svnEntries) ;
} else if [ Glob [ FDirName $(HAIKU_TOP) .git ] : index ] {
# commits or merges.
local gitIndex = <haiku-rootdir-git>index ;
local revisionFile = <haiku-rootdir-git>haiku-revision ;
if ! [ on $(gitIndex) return $(HAIKU_GIT_REVISION_DETERMINED) ] {
if [ Glob [ FDirName $(HAIKU_TOP) .git ] : index ] {
HAIKU_GIT_REVISION_DETERMINED on $(gitIndex) = 1 ;
SEARCH on $(gitIndex) = [ FDirName $(HAIKU_TOP) .git ] ;
Depends $(target) : $(gitIndex) ;
} else if [ Glob [ FDirName $(HAIKU_TOP) .hg ] : store ] {
local hgStore = <haiku-rootdir-hg>store ;
SEARCH on $(hgStore) = [ FDirName $(HAIKU_TOP) .hg ] ;
Depends $(target) : $(hgStore) ;
MakeLocate $(revisionFile) : $(HAIKU_BUILD_OUTPUT_DIR) ;
Depends $(revisionFile) : $(gitIndex) ;
DetermineHaikuRevision $(revisionFile) : $(gitIndex) ;
} else {
revisionFile = ;
}
}
HAIKU_INCLUDE_IN_IMAGE on $(target)
= [ on $(source) return $(HAIKU_INCLUDE_IN_IMAGE) ] ;
PropagateContainerUpdateTargetFlags $(target) : $(source) ;
Depends $(target) : <build>copyattr <build>set_haiku_revision $(source) ;
Depends $(target)
: <build>copyattr <build>set_haiku_revision $(source) $(revisionFile) ;
CopySetHaikuRevision1 $(target)
: <build>copyattr <build>set_haiku_revision $(source) ;
: <build>copyattr <build>set_haiku_revision $(source) $(revisionFile) ;
}
actions CopySetHaikuRevision1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
. $(HAIKU_TOP)/build/scripts/determine_haiku_revision
determineHaikuRevision $(HAIKU_TOP) $(HAIKU_BUILD_OUTPUT_DIR)
$(2[1]) --data $(2[3]) $(1) || exit 1
$(2[1]) --data $(2[3]) $(1) &&
$(2[2]) $(1) ${revision}
revision=0
if [ -n "$(2[4]:E=)" ]; then
revision="`cat $(2[4]:E=)`"
fi
$(2[2]) $(1) "$revision"
}
actions DetermineHaikuRevision
{
$(HAIKU_TOP)/build/scripts/determine_haiku_revision $(HAIKU_TOP) $(1)
}
rule DataFileToSourceFile sourceFile : dataFile : dataVariable : sizeVariable
{
sourceFile = [ FGristFiles $(sourceFile) ] ;
@ -364,20 +406,36 @@ actions DataFileToSourceFile1
$(2[1]) $(DATA_VARIABLE) $(SIZE_VARIABLE) $(2[2]) $(1)
}
rule DownloadLocatedFile target : url
rule DownloadLocatedFile target : url : source
{
# DownloadLocatedFile <target> : <url> [ : <source> ] ;
#
# <source> is an optional target that <target> will be made dependent on.
# Its resolved path can be used in <url> via '$source'.
URL on $(target) = $(url) ;
DownloadLocatedFile1 $(target) ;
if $(source) {
Depends $(target) : $(source) ;
}
DownloadLocatedFile1 $(target) : $(source) ;
}
actions DownloadLocatedFile1
{
wget -O "$(1)" $(URL)
source="$(2)"
wget -O "$(1)" $(URL) || exit 1
touch "$(1)"
}
rule DownloadFile file : url
rule DownloadFile file : url : source
{
# DownloadFile <file> : <url> [ : <source> ] ;
#
# <source> is an optional target that the target will be made dependent on.
# Its resolved path can be used in <url> via '$source'.
file = $(file:G=download) ;
# Request the download only once.
@ -388,8 +446,15 @@ rule DownloadFile file : url
HAIKU_FILE_DOWNLOAD on $(file) = 1 ;
MakeLocate $(file) : $(HAIKU_DOWNLOAD_DIR) ;
DownloadLocatedFile $(file) : $(url) ;
DownloadLocatedFile $(file) : $(url) : $(source) ;
return $(file) ;
}
actions ChecksumFileSHA256
{
$(HOST_SHA256) $(2) | sed -r 's,([^[:space:]]*).*,\1,' > $(1)
# The sed part is only necessary for sha256sum, but it doesn't harm for
# sha256 either.
}

60
build/jam/HaikuPackages Normal file
View File

@ -0,0 +1,60 @@
# The packages we build. Each is defined in its own file in the packages/
# subdirectory.
local packages =
HaikuDevel
HaikuLoader
HaikuUserguide
HaikuWelcome
MakefileEngine
;
if $(HAIKU_BOOTSTRAP_BUILD) {
packages += HaikuBootstrap ;
} else {
packages += Haiku ;
}
local archDependentPackages =
HaikuCrossDevel
WebPositive
;
local secondaryArchPackages =
HaikuDevelSecondary
;
if $(HAIKU_BOOTSTRAP_BUILD) {
secondaryArchPackages += HaikuSecondaryBootstrap ;
} else {
secondaryArchPackages += HaikuSecondary ;
}
packages = $(packages:G=package-rules) ;
archDependentPackages = $(archDependentPackages:G=package-rules) ;
secondaryArchPackages = $(secondaryArchPackages:G=package-rules) ;
SEARCH on $(packages) $(archDependentPackages) $(secondaryArchPackages)
= [ FDirName $(HAIKU_BUILD_RULES_DIR) packages ] ;
local package ;
for package in $(packages) {
include $(package) ;
}
for package in $(archDependentPackages) {
local architectureObject ;
for architectureObject in [ MultiArchSubDirSetup ] {
on $(architectureObject) {
include $(package) ;
}
}
}
for package in $(secondaryArchPackages) {
local architectureObject ;
for architectureObject in
[ MultiArchSubDirSetup $(TARGET_PACKAGING_ARCHS[2-]) ] {
on $(architectureObject) {
include $(package) ;
}
}
}

View File

@ -71,11 +71,13 @@ rule ObjectSysHdrs
[ FSysIncludes $(sysHeaders)
: $(HOST_SYSTEM_INCLUDES_OPTION) ] ;
} else {
local architecture = $(TARGET_PACKAGING_ARCH) ;
fileHeaders =
[ FIncludes $(HDRS) : $(TARGET_LOCAL_INCLUDES_OPTION) ]
$(TARGET_INCLUDES_SEPARATOR)
[ FIncludes $(HDRS)
: $(TARGET_LOCAL_INCLUDES_OPTION_$(architecture)) ]
$(TARGET_INCLUDES_SEPARATOR_$(architecture))
[ FSysIncludes $(sysHeaders)
: $(TARGET_SYSTEM_INCLUDES_OPTION) ] ;
: $(TARGET_SYSTEM_INCLUDES_OPTION_$(architecture)) ] ;
}
ASHDRS on $(file) = $(fileHeaders) ;
@ -408,7 +410,22 @@ rule UsePrivateKernelHeaders
rule UsePrivateSystemHeaders
{
UseHeaders $(TARGET_PRIVATE_SYSTEM_HEADERS) : true ;
UseHeaders $(TARGET_PRIVATE_SYSTEM_HEADERS_$(TARGET_PACKAGING_ARCH))
: true ;
}
rule UseBuildFeatureHeaders feature : attribute
{
# UseBuildFeatureHeaders <feature> : [ <attribute> ] ;
# A shorthand for
# UseHeaders [ BuildFeatureAttribute <feature> : <attribute> ] : true ;
# Moreover the default value for <attribute> is "headers", which usually
# allows the rule to be called with the feature name as the only parameter.
local headers = [ BuildFeatureAttribute $(feature) : $(attribute:E=headers)
: path ] ;
UseHeaders $(headers) : true ;
}
@ -426,7 +443,7 @@ rule FStandardOSHeaders
}
rule FStandardHeaders
rule FStandardHeaders architecture
{
local osIncludes = add-ons add-ons/file_system add-ons/graphics
add-ons/input_server add-ons/registrar
@ -439,14 +456,14 @@ rule FStandardHeaders
# The C++ headers. If specified, we use the compiler headers, otherwise
# the ones that come with our libstdc++.
if $(HAIKU_C++_HEADERS_DIR) {
headers += $(HAIKU_C++_HEADERS_DIR) ;
if $(HAIKU_C++_HEADERS_DIR_$(architecture)) {
headers += $(HAIKU_C++_HEADERS_DIR_$(architecture)) ;
} else {
headers += [ FDirName $(HAIKU_TOP) headers cpp ] ;
}
# GCC headers
headers += $(HAIKU_GCC_HEADERS_DIR) ;
headers += $(HAIKU_GCC_HEADERS_DIR_$(architecture)) ;
# Use headers directory, to allow to do things like include <posix/string.h>
headers += [ FDirName $(HAIKU_TOP) headers ] ;

View File

@ -97,26 +97,28 @@ rule FSplitPath
}
rule FSetConditionsHold conditions : set
rule FConditionsHold conditions : predicate
{
# FSetConditionsHold <conditions> : <set> ;
# Checks whether the conditions <conditions> are satisfied by the list of
# elements <set> and returns a respective result (if so: "1", if not: empty
# list). The conditions are satisfied when <conditions> is not empty and
# FConditionsHold <conditions> : <predicate> ;
# Checks whether the conditions <conditions> are satisfied by the predicate
# rule <predicate> and returns a respective result (if so: "1", if not:
# empty list). The conditions are satisfied when <conditions> is not empty
# and
# * none of the negative conditions it contains hold and
# * if <conditions> contains any positive conditions, at least one one of
# those holds.
# * if <conditions> contains any positive conditions, at least one of those
# holds.
# A positive condition is an element not starting with a "!". It holds when
# the element is contained in <set>.
# the predicate rule <predicate> returns true for the element.
# A negative condition is an element that starts with a "!". It holds when
# the string resulting from removing the leading "!" is not contained in
# <set>.
# the predicate rule <predicate> returns true for the string resulting from
# removing the leading "!".
#
# <conditions> - The list of conditions.
# <set> - The elements against which the conditions are tested.
# <predicate> - The predicate rule invoked to test the elements.
#
# Examples:
# For set { a b c } the following conditions hold:
# For a predicate that holds for the elements of the set { a b c } the
# following conditions hold:
# { a }, { a d }, { !d }, { !d !e }, { a !d }, { b !e !f }
# The following conditions don't hold:
# { }, { d }, { d e }, { !a }, { !a b }, { !d e } { a b !c !d }
@ -131,14 +133,14 @@ rule FSetConditionsHold conditions : set
{
hasNegative = 1 ;
condition = [ Match "!(.*)" : $(condition) ] ;
if $(condition) in $(set) {
if [ $(predicate) $(condition) ] {
return ;
}
}
case * :
{
hasPositive = 1 ;
if $(condition) in $(set) {
if [ $(predicate) $(condition) ] {
positiveMatch = 1 ;
}
}
@ -205,6 +207,9 @@ rule SetPlatformCompatibilityFlagVariables
$(varPrefix)_PLATFORM_HAIKU_COMPATIBLE = true ;
}
case host :
# not compatible to anything
case * :
{
if ! ( $(platform) in $(otherPlatforms) ) {
@ -267,19 +272,19 @@ rule FAnalyzeGCCVersion
return $(version) ;
}
rule SetIncludePropertiesVariables
rule SetIncludePropertiesVariables prefix : suffix
{
# SetIncludePropertiesVariables <varPrefix> ;
# SetIncludePropertiesVariables <prefix> : <suffix> ;
#
local prefix = $(1) ;
if $($(prefix)_GCC_VERSION[1]) < 4 {
$(prefix)_INCLUDES_SEPARATOR = -I- ;
$(prefix)_LOCAL_INCLUDES_OPTION = -I ;
$(prefix)_SYSTEM_INCLUDES_OPTION = -I ;
suffix = $(suffix:E=) ;
if $($(prefix)_GCC_VERSION$(suffix)[1]) < 4 {
$(prefix)_INCLUDES_SEPARATOR$(suffix) = -I- ;
$(prefix)_LOCAL_INCLUDES_OPTION$(suffix) = -I ;
$(prefix)_SYSTEM_INCLUDES_OPTION$(suffix) = -I ;
} else {
$(prefix)_INCLUDES_SEPARATOR = ;
$(prefix)_LOCAL_INCLUDES_OPTION = "-iquote " ;
$(prefix)_SYSTEM_INCLUDES_OPTION = "-I " ;
$(prefix)_INCLUDES_SEPARATOR$(suffix) = ;
$(prefix)_LOCAL_INCLUDES_OPTION$(suffix) = "-iquote " ;
$(prefix)_SYSTEM_INCLUDES_OPTION$(suffix) = "-I " ;
}
}

View File

@ -70,36 +70,55 @@ actions together AddVariableToScript1
$(VARIABLE_DEFS)$(1);
}
rule AddTargetVariableToScript
rule AddTargetVariableToScript script : targets : variable
{
# AddTargetVariableToScript <script> : <target> [ : <variable> ] ;
# AddTargetVariableToScript <script> : <targets> [ : <variable> ] ;
#
local script = $(1) ;
local target = $(2) ;
local variable = $(3:E=$(target:BS)) ;
# If <targets> contains multiple targets, their paths must not contain
# whitespaces or other characters that need to be escaped in the shell.
#
variable ?= $(3:E=$(targets[1]:BS)) ;
InitScript $(script) ;
local initScript = [ InitScript $(script) ] ;
# That's not completely save, if one has more than on target with the
# same base name. A unique pseudo target would have to be introduced
# to do it more correctly.
VARIABLE_NAME($(target:BS)) on $(script) = $(variable) ;
serialization = [ on $(script) return $(HAIKU_SERIALIZATION) ] ;
Depends $(script) : $(target) ;
AddTargetVariableToScript1 $(script) : $(target) ;
local variableTarget = [ NewUniqueTarget ] ;
NotFile $(variableTarget) ;
Depends $(variableTarget) : $(initScript) $(targets) $(serialization) ;
Depends $(script) : $(variableTarget) ;
HAIKU_SERIALIZATION on $(script) = $(variableTarget) ;
HAIKU_VARIABLE_NAME on $(variableTarget) = $(variable) ;
AddTargetVariableToScript1 $(variableTarget) : $(initScript) $(targets) ;
}
actions AddTargetVariableToScript1
{
echo "$(VARIABLE_NAME($(2:BS)))=\"$(2)\"" >> $(1)
script="$(2[1])"
echo "$(HAIKU_VARIABLE_NAME)=" >> "$script"
firstSeen=
for value in "$(2[2-])" ; do
if [ -z "$firstSeen" ]; then
echo "$(HAIKU_VARIABLE_NAME)=\"$value\"" >> "$script"
firstSeen=1
else
echo "$(HAIKU_VARIABLE_NAME)=\"\$$(HAIKU_VARIABLE_NAME) $value\"" \
>> "$script"
fi
done
}
#pragma mark -
rule AddDirectoryToContainer container : directoryTokens
rule AddDirectoryToContainer container : directoryTokens : attributeFiles
{
# AddDirectoryToContainer <container> : <directoryTokens>
# AddDirectoryToContainer <container> : <directoryTokens> : <attributeFiles>
local containerGrist = [ on $(container) return $(HAIKU_CONTAINER_GRIST) ] ;
local directory = [ FDirName $(directoryTokens) ] ;
@ -121,6 +140,12 @@ rule AddDirectoryToContainer container : directoryTokens
}
}
if $(attributeFiles) {
SEARCH on $(attributeFiles)
+= [ FDirName $(HAIKU_TOP) data image_directories ] ;
ATTRIBUTE_FILES on $(dir) += $(attributeFiles) ;
}
return $(directory) ;
}
@ -151,14 +176,26 @@ rule IncludeAllTargetsInContainer container
}
rule PropagateContainerUpdateTargetFlags toTarget : fromTarget
{
if [ on $(fromTarget) return $(HAIKU_INCLUDE_IN_IMAGE) ] {
HAIKU_INCLUDE_IN_IMAGE on $(toTarget) = 1 ;
}
if [ on $(fromTarget) return $(HAIKU_INCLUDE_IN_PACKAGES) ] {
HAIKU_INCLUDE_IN_PACKAGES on $(toTarget) = 1 ;
}
}
rule AddFilesToContainer container : directoryTokens : targets : destName
{
# AddFilesToContainer <container> : <directoryTokens> : <targets>
# [ : dest name ]
#
local directory = [ AddDirectoryToContainer $(container)
: $(directoryTokens) ] ;
local containerGrist = [ on $(container) return $(HAIKU_CONTAINER_GRIST) ] ;
local systemDirTokens
= [ on $(container) return $(HAIKU_CONTAINER_SYSTEM_DIR_TOKENS) ] ;
targets = [ FFilterByBuildFeatures $(targets) ] ;
@ -171,8 +208,27 @@ rule AddFilesToContainer container : directoryTokens : targets : destName
if $(filterVar) {
targets = [ FilterContainerUpdateTargets $(targets)
: $(filterVar) ] ;
# If there are any targets, mark the container as to be included in
# an update, too, if it has set the update inheritance variable.
# This makes updating a target that lives in a package on an image
# work.
if $(targets) {
local updateVariable = [ on $(container) return
$(HAIKU_CONTAINER_INHERIT_UPDATE_VARIABLE) ] ;
if $(updateVariable) {
$(updateVariable) on $(container) = 1 ;
}
}
}
}
if ! $(targets) {
return ;
}
local directory = [ AddDirectoryToContainer $(container)
: $(directoryTokens) ] ;
# We create a unique dummy target per target to install.
local installTargetsVar
@ -197,9 +253,25 @@ rule AddFilesToContainer container : directoryTokens : targets : destName
if $(catalogs) {
local signature
= [ on $(target) return $(HAIKU_CATALOG_SIGNATURE) ] ;
AddFilesToHaikuImage system data locale catalogs $(signature)
AddFilesToContainer $(container)
: $(systemDirTokens) data locale catalogs $(signature)
: $(catalogs) ;
}
# If the target is associated with MIME DB entries, add those, too.
local mimeDBEntries = [ on $(target) return $(HAIKU_MIME_DB_ENTRIES) ] ;
if $(mimeDBEntries) {
# Make sure we add the entries only once by tracking the containers
# we have already added it to.
local containers = [ on $(mimeDBEntries)
return $(HAIKU_MIME_DB_ENTRIES_IN_CONTAINERS) ] ;
if ! $(container) in $(containers) {
HAIKU_MIME_DB_ENTRIES_IN_CONTAINERS on $(mimeDBEntries)
= $(containers) $(container) ;
CopyDirectoryToContainer $(container) : data
: $(mimeDBEntries) : mime_db : : alwaysUpdate isTarget ;
}
}
}
}
@ -255,60 +327,135 @@ rule FSymlinksInContainerDirectory container : directoryTokens
}
rule CopyDirectoryToContainer container : directoryTokens : sourceDirectory
: targetDirectoryName : excludePatterns : alwaysUpdate
: targetDirectoryName : excludePatterns : flags
{
# CopyDirectoryToContainer <container> : <directoryTokens>
# : <sourceDirectory> : <targetDirectoryName> : <excludePatterns>
# : <alwaysUpdate> ;
# [ : <flags> ] ;
#
# Supported flags: alwaysUpdate, isTarget
# isTarget: <sourceDirectory> is a target, not a path
# If the image shall only be updated, we don't copy any directories
if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
&& ! [ IncludeAllTargetsInContainer $(container) ]
&& ! $(alwaysUpdate) {
&& ! alwaysUpdate in $(flags) {
return ;
}
if ! $(targetDirectoryName) {
local path = [ FReverse [ FSplitPath $(sourceDirectory) ] ] ;
targetDirectoryName = $(path[1]) ;
targetDirectoryName = $(sourceDirectory[1]:BS) ;
}
# If sourceDirectory is a path, not a target, make it a target, so we can
# treat both the same way.
if ! isTarget in $(flags) {
sourceDirectory = $(sourceDirectory:G=copy-directory-to-container) ;
SEARCH on $(sourceDirectory) = ;
TARGET on $(sourceDirectory) = ;
}
local directory = [ AddDirectoryToContainer $(container)
: $(directoryTokens) $(targetDirectoryName) ] ;
local targetDir = $(directory)/-/$(sourceDirectory) ;
Depends $(targetDir) : $(sourceDirectory) ;
EXCLUDE_PATTERNS on $(targetDir) = $(excludePatterns) ;
SOURCE_DIRECTORY on $(targetDir) = $(sourceDirectory) ;
TARGET_DIRECTORY on $(targetDir) = $(directory) ;
DIRECTORIES_TO_INSTALL on $(directory) += $(targetDir) ;
}
rule AddHeaderDirectoryToContainer container : dirTokens : dirName
: flags
{
# AddHeaderDirectoryToContainer <container> : <dirTokens> : [ <dirName> ]
# [ : <flags> ] ;
#
# Supported flags: alwaysUpdate
local systemDirTokens
= [ on $(container) return $(HAIKU_CONTAINER_SYSTEM_DIR_TOKENS) ] ;
CopyDirectoryToContainer $(container) : $(systemDirTokens) develop headers
: [ FDirName $(HAIKU_TOP) headers $(dirTokens) ]
: $(dirName) : -x .svn : $(flags) ;
}
rule AddWifiFirmwareToContainer container : driver : package : archive : extract
{
# AddWifiFirmwareToContainer <container> : <driver> : <package> : <archive>
# : <extract>
# complete location to wifi firmware archive
local firmwareArchive = [ FDirName
$(HAIKU_TOP) data system data firmware $(driver) $(archive) ] ;
local systemDirTokens
= [ on $(container) return $(HAIKU_CONTAINER_SYSTEM_DIR_TOKENS) ] ;
local dirTokens = $(systemDirTokens) data firmware $(driver) ;
if $(extract) = true || $(extract) = 1 {
ExtractArchiveToContainer $(container) : $(dirTokens)
: $(firmwareArchive) : : $(package) ;
} else {
AddFilesToContainer $(container) : $(dirTokens) : $(firmwareArchive) ;
}
}
rule ExtractArchiveToContainer container : directoryTokens : archiveFile
: extractedSubDir : stripDebugSymbols
: flags : extractedSubDir
{
# ExtractArchiveToContainer <container> : <directory> : <archiveFile>
# : <extractedSubDir> : <stripDebugSymbols> ;
# : [ <flags> ] : <extractedSubDir> ;
#
# Supported flags: alwaysUpdate
# If the container shall only be updated, we extract only, if explicitely
# requested.
if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
&& ! alwaysUpdate in $(flags) {
return ;
}
local directory = [ AddDirectoryToContainer $(container)
: $(directoryTokens) ] ;
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
{
# AddDriversToContainer <container> : <relative directory> : <targets> ;
#
local directoryTokens = system add-ons kernel drivers dev
local systemDirTokens
= [ on $(container) return $(HAIKU_CONTAINER_SYSTEM_DIR_TOKENS) ] ;
local directoryTokens = $(systemDirTokens) add-ons kernel drivers dev
$(relativeDirectoryTokens) ;
targets = [ FFilterByBuildFeatures $(targets) ] ;
AddFilesToContainer $(container) : system add-ons kernel drivers bin
: $(targets) ;
# A driver can be in multiple categories. Avoid adding it to the bin/
# directory more than once.
local binTargets ;
local target ;
for target in $(targets) {
local containers
= [ on $(target) return $(HAIKU_DRIVER_IN_CONTAINERS) ] ;
if ! $(container) in $(containers) {
HAIKU_DRIVER_IN_CONTAINERS on $(target)
= $(containers) $(container) ;
binTargets += $(target) ;
}
}
AddFilesToContainer $(container)
: $(systemDirTokens) add-ons kernel drivers bin
: $(binTargets) ;
# If the image shall only be updated, we don't add any symlinks.
if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
@ -336,7 +483,9 @@ rule AddNewDriversToContainer container : relativeDirectoryTokens
{
# AddNewDriversToContainer <container> : <directory> : <targets> ;
#
local directoryTokens = system add-ons kernel drivers
local systemDirTokens
= [ on $(container) return $(HAIKU_CONTAINER_SYSTEM_DIR_TOKENS) ] ;
local directoryTokens = $(systemDirTokens) add-ons kernel drivers
$(relativeDirectoryTokens) ;
targets = [ FFilterByBuildFeatures $(targets) ] ;
@ -350,12 +499,15 @@ rule AddBootModuleSymlinksToContainer container : targets
# AddBootModuleSymlinksToContainer <container> : <targets> ;
#
# If the image shall only be updated, we don't add any symlinks.
# If the container shall only be updated, we don't add any symlinks.
if [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
&& ! [ IncludeAllTargetsInContainer $(container) ] {
return ;
}
local systemDirTokens
= [ on $(container) return $(HAIKU_CONTAINER_SYSTEM_DIR_TOKENS) ] ;
targets = [ FFilterByBuildFeatures $(targets) ] ;
# add the symlinks
@ -373,15 +525,46 @@ rule AddBootModuleSymlinksToContainer container : targets
Exit "ERROR: Add*ToContainer has not been invoked for it yet." ;
}
local name = $(target:BS) ;
local linkTarget = [ FDirName /boot $(installDir:G=) $(name) ] ;
# chop off the system dir prefix from installDir
installDir = [ on $(installDir) return $(DIRECTORY_TOKENS) ] ;
local dummy ;
for dummy in $(systemDirTokens) {
installDir = $(installDir[2-]) ;
}
AddSymlinkToContainer $(container) : system add-ons kernel boot
local name = $(target:BS) ;
local linkTarget = [ FDirName ../../.. $(installDir) $(name) ] ;
AddSymlinkToContainer $(container)
: $(systemDirTokens) add-ons kernel boot
: $(linkTarget) : $(name) ;
}
}
rule AddLibrariesToContainer container : directory : libs
{
# AddLibrariesToContainer <container> : <directory> : <libs>
#
# Installs libraries with the appropriate links into the container.
#
local lib ;
for lib in $(libs) {
local abiVersion = [ on $(lib) return $(HAIKU_LIB_ABI_VERSION) ] ;
if $(abiVersion) {
local abiVersionedLib = $(lib:G=).$(abiVersion) ;
AddFilesToContainer $(container) : $(directory) : $(lib)
: $(abiVersionedLib) ;
AddSymlinkToContainer $(container) : $(directory)
: $(abiVersionedLib) : $(lib:G=) ;
} else {
AddFilesToContainer $(container) : $(directory) : $(lib) ;
}
}
}
rule CreateContainerMakeDirectoriesScript container : script
{
MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ;
@ -409,7 +592,9 @@ rule CreateContainerMakeDirectoriesScript container : script
# If the image shall only be updated, we don't create directories.
if $(dirsToCreate)
&& ( ! [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ]
|| [ IncludeAllTargetsInContainer $(container) ] ) {
|| [ IncludeAllTargetsInContainer $(container) ]
|| [ on $(container) return
$(HAIKU_CONTAINER_ALWAYS_CREATE_DIRECTORIES) ] ) {
Depends $(scriptBody) : $(dirsToCreate) ;
CreateContainerMakeDirectoriesScript1 $(scriptBody) : $(dirsToCreate) ;
@ -574,7 +759,7 @@ actions AddSymlinkToContainerCopyFilesScript
}
actions AddDirectoryToContainerCopyFilesScript
actions AddDirectoryToContainerCopyFilesScript bind SOURCE_DIRECTORY
{
echo \$cp -r $(EXCLUDE_PATTERNS) "\"\${sPrefix}$(SOURCE_DIRECTORY)/.\"" \
"\"\${tPrefix}$(TARGET_DIRECTORY:G=)\"" >> $(2[1])
@ -616,11 +801,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) ;
@ -636,8 +816,63 @@ 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])
}
rule AddPackagesAndRepositoryVariablesToContainerScript script : container
{
AddVariableToScript $(script) : downloadDir : $(HAIKU_DOWNLOAD_DIR) ;
AddTargetVariableToScript $(script) : <build>package ;
AddTargetVariableToScript $(script) : <build>get_package_dependencies
: getPackageDependencies ;
# Add a variable to indicate whether packages dependencies shall be
# resolved. We always want to do that in non-update mode, but also in update
# mode when all packages are updated.
local updateOnly
= [ on $(container) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] ;
local resolvePackageDependencies ;
if ( ! $(updateOnly) || $(HAIKU_UPDATE_ALL_PACKAGES) )
&& ! $(HAIKU_BOOTSTRAP_BUILD) {
resolvePackageDependencies = 1 ;
}
AddVariableToScript $(script) : resolvePackageDependencies
: $(resolvePackageDependencies) ;
# Add variables "systemPackages" and "commonPackages" with the packages
# copied/updated.
local allPackages = [ on $(container) return $(HAIKU_PACKAGES_IN_IMAGE) ] ;
if $(updateOnly) && ! [ IncludeAllTargetsInContainer $(container) ] {
allPackages = [ FilterContainerUpdateTargets $(allPackages)
: [ on $(container) return $(HAIKU_INCLUDE_IN_CONTAINER_VAR) ] ] ;
}
local systemPackages ;
local commonPackages ;
local package ;
for package in $(allPackages) {
if [ on $(package) return $(HAIKU_PACKAGE_INSTALLATION_LOCATION) ]
= system {
systemPackages += $(package) ;
} else {
commonPackages += $(package) ;
}
}
AddTargetVariableToScript $(script) : $(systemPackages) : systemPackages ;
AddTargetVariableToScript $(script) : $(commonPackages) : commonPackages ;
# Generate the repository package lists and add variables for the
# repositories.
local repository ;
local repositoryFiles ;
for repository in $(HAIKU_REPOSITORIES) {
repositoryFiles
+= [ on $(repository) return $(HAIKU_REPOSITORY_CACHE_FILE) ] ;
}
AddTargetVariableToScript $(script) : $(repositoryFiles) : repositories ;
}
@ -655,18 +890,10 @@ rule IsUpdateHaikuImageOnly
rule AddDirectoryToHaikuImage directoryTokens : attributeFiles
{
# AddDirectoryToHaikuImage <directoryTokens>
# AddDirectoryToHaikuImage <directoryTokens> : <attributeFiles>
local dir = [ AddDirectoryToContainer $(HAIKU_IMAGE_CONTAINER_NAME)
: $(directoryTokens) ] ;
if $(attributeFiles) {
SEARCH on $(attributeFiles)
+= [ FDirName $(HAIKU_TOP) data image_directories ] ;
ATTRIBUTE_FILES on $(dir) += $(attributeFiles) ;
}
return $(dir) ;
return [ AddDirectoryToContainer $(HAIKU_IMAGE_CONTAINER_NAME)
: $(directoryTokens) : $(attributeFiles) ] ;
}
rule AddFilesToHaikuImage directory : targets : destName
@ -700,61 +927,47 @@ rule FSymlinksInHaikuImageDirectory directoryTokens
}
rule CopyDirectoryToHaikuImage directoryTokens : sourceDirectory
: targetDirectoryName : excludePatterns : alwaysUpdate
: targetDirectoryName : excludePatterns : flags
{
CopyDirectoryToContainer $(HAIKU_IMAGE_CONTAINER_NAME) : $(directoryTokens)
: $(sourceDirectory) : $(targetDirectoryName) : $(excludePatterns)
: $(alwaysUpdate) ;
: $(flags) ;
}
rule AddSourceDirectoryToHaikuImage dirTokens : alwaysUpdate
rule AddSourceDirectoryToHaikuImage dirTokens : flags
{
# AddSourceDirectoryToHaikuImage <dirTokens> : <alwaysUpdate> ;
# AddSourceDirectoryToHaikuImage <dirTokens> : <flags> ;
CopyDirectoryToHaikuImage home HaikuSources
: [ FDirName $(HAIKU_TOP) $(dirTokens) ]
: : : $(alwaysUpdate) ;
: : : $(flags) ;
}
rule AddHeaderDirectoryToHaikuImage dirTokens : dirName : alwaysUpdate
rule AddHeaderDirectoryToHaikuImage dirTokens : dirName : flags
{
# AddHeaderDirectoryToHaikuImage <dirTokens> : [ <dirName> ]
# : <alwaysUpdate> ;
# : <flags> ;
CopyDirectoryToHaikuImage develop headers
: [ FDirName $(HAIKU_TOP) headers $(dirTokens) ]
: $(dirName) : : $(alwaysUpdate) ;
AddHeaderDirectoryToContainer $(HAIKU_IMAGE_CONTAINER_NAME) : $(dirTokens)
: $(dirName) : $(flags) ;
}
rule AddWifiFirmwareToHaikuImage driver : package : archive : extract
{
# AddWifiFirmwareToHaikuImage <driver> : <package> : <archive> : <extract>
# complete location to wifi firmware archive
local firmwareArchive = [ FDirName
$(HAIKU_TOP) data system data firmware $(driver) $(archive) ] ;
local dirTokens = system data firmware $(driver) ;
if $(extract) = true || $(extract) = 1 {
ExtractArchiveToHaikuImage $(dirTokens) : $(firmwareArchive) :
: $(package) ;
} else {
AddFilesToHaikuImage $(dirTokens) : $(firmwareArchive) ;
}
AddWifiFirmwareToHaikuImage $(HAIKU_IMAGE_CONTAINER_NAME) : $(driver)
: $(package) : $(archive) : $(extract) ;
}
rule ExtractArchiveToHaikuImage dirTokens : archiveFile : alwaysUpdate
: extractedSubDir : stripDebugSymbols
rule ExtractArchiveToHaikuImage dirTokens : archiveFile : flags
: extractedSubDir
{
# ExtractArchiveToHaikuImage <dirTokens> : <archiveFile> : <alwaysUpdate>
# ExtractArchiveToHaikuImage <dirTokens> : <archiveFile> : <flags>
# : <extractedSubDir> ;
# If the image shall only be updated, we extract only, if explicitely
# requested.
if ! [ IsUpdateHaikuImageOnly ] || $(alwaysUpdate) {
ExtractArchiveToContainer $(HAIKU_IMAGE_CONTAINER_NAME) : $(dirTokens)
: $(archiveFile) : $(extractedSubDir) : $(stripDebugSymbols) ;
}
: $(archiveFile) : $(flags) : $(extractedSubDir) ;
}
rule AddDriversToHaikuImage relativeDirectoryTokens : targets
@ -781,6 +994,16 @@ rule AddBootModuleSymlinksToHaikuImage targets
: $(targets) ;
}
rule AddPackageFilesToHaikuImage location : packages
{
packages = [ FFilterByBuildFeatures $(packages) ] ;
HAIKU_PACKAGES_IN_IMAGE on $(HAIKU_IMAGE_CONTAINER_NAME)
= [ on $(HAIKU_IMAGE_CONTAINER_NAME) return $(HAIKU_PACKAGES_IN_IMAGE) ]
$(packages) ;
HAIKU_PACKAGE_INSTALLATION_LOCATION on $(packages) = $(location) ;
AddFilesToHaikuImage $(location) packages : $(packages) ;
}
rule AddOptionalHaikuImagePackages packages
{
local package ;
@ -828,6 +1051,82 @@ rule OptionalPackageDependencies package : dependencies
}
}
rule AddHaikuImagePackages packages : installationLocation
{
# AddHaikuImagePackages <packages> [ : <installationLocation> ] ;
# Adds the given package <packages>s to the image. <installationLocation>
# is either "system" or "common" (the default) and specifies where the
# packages shall be installed.
installationLocation ?= common ;
packages = [ FFilterByBuildFeatures $(packages) ] ;
local package ;
for package in $(packages) {
local resolvedPackage = [ IsPackageAvailable $(package) ] ;
if ! $(resolvedPackage) {
Echo "AddHaikuImagePackages: package" $(package)
"not available!" ;
continue ;
}
if ! [ on $(resolvedPackage) return $(HAIKU_PACKAGE_ADDED) ] {
HAIKU_PACKAGE_ADDED on $(resolvedPackage) = 1 ;
HAIKU_ADDED_PACKAGES += $(resolvedPackage) ;
# download the package file and add it to the image
local file = [ FetchPackage $(package) ] ;
if $(HAIKU_UPDATE_ALL_PACKAGES) {
HAIKU_INCLUDE_IN_IMAGE on $(file) = 1 ;
}
AddPackageFilesToHaikuImage $(installationLocation) : $(file) ;
}
}
}
rule IsHaikuImagePackageAdded package
{
local resolvedPackage = [ IsPackageAvailable $(package) ] ;
if $(resolvedPackage)
&& [ on $(resolvedPackage) return $(HAIKU_PACKAGE_ADDED) ] {
return 1 ;
}
return ;
}
rule BuildHaikuImagePackageList target
{
if ! $(target) {
return ;
}
# get the file names of all added packages
local packageFiles ;
local package ;
for package in $(HAIKU_ADDED_PACKAGES) {
packageFiles += [ FetchPackage $(package) : nameResolved ] ;
}
# extract the versioned package names (without revision)
packageFiles = [ Match "(.*)-[^-]*-[^-]*" : $(packageFiles:B) ] ;
HAIKU_IMAGE_PACKAGES on $(target) = $(packageFiles) ;
}
actions BuildHaikuImagePackageList
{
echo $(HAIKU_IMAGE_PACKAGES) | xargs -n 1 echo | LC_ALL=C sort -u > $(1)
}
rule InstallSourceArchive file : url
{
if $(HAIKU_INCLUDE_SOURCES) = 1 {
@ -839,29 +1138,41 @@ rule InstallSourceArchive file : url
}
}
rule InstallOptionalHaikuImagePackage package : url : dirTokens : isCDPackage
: stripDebugSymbols
rule InstallOptionalHaikuImagePackage url : dirTokens : flags
{
# TODO: Remove the non-hpkg cases!
# Currently the semantics differs depending on whether the cdPackage flag
# has been specified and the type of the package file:
# * For a hpkg <dirTokens> is "common" (default) or "system" and specifies
# the installation location of the package (will be copied to the
# packages/ subdirectory).
# * For a regular archive and cdPackage, <dirTokens> is ignored and
# the package will be copied to the _package_ directory of the CD image.
# * For a regular archive and without cdPackage, <dirTokens> specifies the
# directory relative to the image's root directory where the content of
# the archive will be extracted to.
#
# Supported flags: cdPackage
local package = $(url:BS) ;
# download archive file
local archiveFile = [ DownloadFile $(package) : $(url) ] ;
if ( $(isCDPackage) = true || $(isCDPackage) = 1 ) && $(HAIKU_CD_NAME) {
if $(package:S) = .hpkg {
local location = $(dirTokens:E=common) ;
if $(HAIKU_UPDATE_ALL_PACKAGES) {
HAIKU_INCLUDE_IN_IMAGE on $(archiveFile) = 1 ;
}
AddPackageFilesToHaikuImage $(location) : $(archiveFile) ;
} else if cdPackage in $(flags) && $(HAIKU_CD_NAME) {
# TODO: If HAIKU_CD_NAME is set, that doesn't mean we're building a CD
# image!
# copy onto image
AddFilesToHaikuImage _packages_ : $(archiveFile) ;
} else {
if $(HAIKU_STRIP_DEBUG_FROM_OPTIONAL_PACKAGES) = 1 {
stripDebugSymbols ?= 1 ;
# The script will only test for = 1. This is in case someone
# manually set the flag 'true'
if $(stripDebugSymbols) = true {
stripDebugSymbols = 1 ;
}
}
# extract onto image
ExtractArchiveToHaikuImage $(dirTokens) : $(archiveFile)
: : : $(stripDebugSymbols) ;
ExtractArchiveToHaikuImage $(dirTokens) : $(archiveFile) : $(flags) ;
}
}
@ -877,7 +1188,7 @@ rule AddEntryToHaikuImageUserGroupFile file : entry
Always $(file) ;
MakeLocate $(file) : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ;
BuildHaikuImageUserGroupFile $(file) ;
AddFilesToHaikuImage common etc : $(file) ;
AddFilesToHaikuImage common settings etc : $(file) ;
}
HAIKU_IMAGE_USER_GROUP_ENTRIES on $(file) = $(allEntries) ;
@ -912,80 +1223,16 @@ rule AddGroupToHaikuImage group : gid : members
AddEntryToHaikuImageUserGroupFile <haiku-image>group : $(entry) ;
}
rule AddEntryToHaikuImageExpanderRuleFile file : entry
rule AddLibrariesToHaikuImage directory : libs
{
local allEntries
= [ on $(file) return $(HAIKU_IMAGE_EXPANDER_RULES_ENTRIES) ] ;
# AddLibraryToHaikuImage <directory> : <libs>
#
# Installs libraries with the appropriate links onto the image.
#
if $(allEntries) {
allEntries = $(allEntries)!$(entry) ;
} else {
allEntries = $(entry) ;
Always $(file) ;
MakeLocate $(file) : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ;
BuildHaikuImageExpanderRules $(file) ;
AddFilesToHaikuImage common data : $(file) ;
}
HAIKU_IMAGE_EXPANDER_RULES_ENTRIES on $(file) = $(allEntries) ;
}
actions BuildHaikuImageExpanderRules
{
echo -e "$(HAIKU_IMAGE_EXPANDER_RULES_ENTRIES)" | tr '!' '\n' > $(1)
}
rule AddExpanderRuleToHaikuImage mimetype : extension : list : extract
{
#AddExpanderRuleToHaikuImage <mimetype> : <extension> : <list> : <extract>
if ! $(mimetype) || ! $(extension) || ! $(list) || ! $(extract) {
Exit "Invalid expander rule specification passed to AddExpanderRule." ;
}
local entry
= "\\\"$(mimetype)\\\"\\\t$(extension)\\\t\\\"$(list)\\\"\\\t\\\"$(extract)\\\"" ;
AddEntryToHaikuImageExpanderRuleFile <haiku-image>expander.rules
: $(entry) ;
}
rule AddInstalledPackagesFileToHaikuImage
{
#AddInstalledPackagesFileToHaikuImage
local file = <haiku-image>InstalledPackages ;
Always $(file) ;
MakeLocate $(file) : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ;
BuildHaikuImageInstalledPackagesFile $(file) ;
AddFilesToHaikuImage common data optional-packages : $(file) ;
}
actions BuildHaikuImageInstalledPackagesFile
{
echo -e "$(HAIKU_ADDED_OPTIONAL_PACKAGES)" | tr '\ ' '\n' > $(1)
}
rule AddOptionalPackageDescriptionToHaikuImage file : searchPath
{
if $(searchPath) {
SEARCH on $(file) = [ FDirName $(searchPath) ] ;
}
HAIKU_IMAGE_OPTIONAL_PACKAGE_DESCRIPTIONS += $(file) ;
}
rule AddLicenseToHaikuImage file : name : searchPath
{
if $(searchPath) {
SEARCH on $(file) = [ FDirName $(searchPath) ] ;
}
if $(name) && $(file:BS) = $(name) {
name = ;
}
AddFilesToHaikuImage system data licenses : $(file) : $(name) ;
AddLibrariesToContainer $(HAIKU_IMAGE_CONTAINER_NAME) : $(directory)
: $(libs) ;
}
@ -1144,160 +1391,6 @@ actions BuildNetBootArchive1
}
#pragma mark - Alternative GCC Archive rules
rule AddDirectoryToAlternativeGCCArchive directoryTokens
{
# AddDirectoryToAlternativeGCCArchive <directoryTokens>
return [ AddDirectoryToContainer
$(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME) : $(directoryTokens) ] ;
}
rule AddFilesToAlternativeGCCArchive directory : targets : destName
{
# AddFilesToAlternativeGCCArchive <directory> : <targets> [ : dest name ]
AddFilesToContainer $(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME)
: $(directory) : $(targets) : $(destName) ;
}
rule AddSymlinkToAlternativeGCCArchive directoryTokens : linkTarget : linkName
{
# AddSymlinkToAlternativeGCCArchive <directory> : <link target>
# [ : <link name> ] ;
AddSymlinkToContainer $(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME)
: $(directoryTokens) : $(linkTarget) : $(linkName) ;
}
rule CopyDirectoryToAlternativeGCCArchive directoryTokens : sourceDirectory
: targetDirectoryName : excludePatterns : alwaysUpdate
{
CopyDirectoryToContainer $(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME)
: $(directoryTokens) : $(sourceDirectory) : $(targetDirectoryName)
: $(excludePatterns) : $(alwaysUpdate) ;
}
rule CreateAlternativeGCCArchiveMakeDirectoriesScript script
{
CreateContainerMakeDirectoriesScript
$(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME) : $(script) ;
}
rule CreateAlternativeGCCArchiveCopyFilesScript script
{
CreateContainerCopyFilesScript
$(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME) : $(script) ;
}
rule BuildAlternativeGCCArchive archive : scripts
{
# BuildAlternativeGCCArchive <archive> : <scripts> ;
local mainScript = build_archive ;
SEARCH on $(mainScript) = [ FDirName $(HAIKU_TOP) build scripts ] ;
Depends $(archive) : $(mainScript) $(scripts) ;
BuildAlternativeGCCArchive1 $(archive) : $(mainScript) $(scripts) ;
}
actions BuildAlternativeGCCArchive1
{
$(2[1]) $(1) $(2[2-])
}
#pragma mark - Haiku Hybrid Image rules
rule AddFilesToHaikuHybridImage directory : targets : destName
: useABISubDir
{
# AddFilesToHaikuHybridImage <directory> : <targets> : <destName>
# : <useABISubDir>
#
# Convenience rule calling both AddFilesToHaikuImage and
# AddFilesToAlternativeGCCArchive.
#
# <useABISubDir>
# if non-empty, specifies that an ABI subdirectory shall be appended to
# <directory> for the alternative GCC archive.
local alternativeSubDir ;
if $(useABISubDir) {
alternativeSubDir = gcc$(HAIKU_GCC_VERSION[1]) ;
}
AddFilesToHaikuImage $(directory) : $(targets) : $(destName) ;
AddFilesToAlternativeGCCArchive $(directory) $(alternativeSubDir)
: $(targets) : $(destName) ;
}
rule AddSymlinkToHaikuHybridImage directoryTokens : linkTarget : linkName
: useSymlinkTargetABISubDir : useABISubDir
{
# AddSymlinkToHaikuHybridImage <directoryTokens> : <linkTarget> : <linkName>
# [ : <useSymlinkTargetABISubDir> [ : <useABISubDir> ] ]
#
# Convenience rule calling both AddSymlinkToHaikuImage and
# AddSymlinkToAlternativeGCCArchive.
#
# <linkTarget>
# Can be a list of components that will be joined to path inserting
# "/"s inbetween.
# <useSymlinkTargetABISubDir>
# If non-empty, specifies that an ABI subdirectory shall be inserted
# into <linkTarget> (between the first and second component) for the
# alternative GCC archive.
# <useABISubDir>
# If non-empty, specifies that an ABI subdirectory part shall be appended
# to the directory tokens for the alternative GCC archive.
local alternativeDirTokens = $(directoryTokens) ;
if $(useABISubDir) {
alternativeDirTokens += gcc$(HAIKU_GCC_VERSION[1]) ;
}
local alternativeLinkTarget = $(linkTarget) ;
if $(useSymlinkTargetABISubDir) {
alternativeLinkTarget = $(linkTarget[1]) gcc$(HAIKU_GCC_VERSION[1])
$(linkTarget[2-]) ;
}
linkTarget = $(linkTarget:J=/) ;
alternativeLinkTarget = $(alternativeLinkTarget:J=/) ;
AddSymlinkToHaikuImage $(directoryTokens) : $(linkTarget) : $(linkName) ;
AddSymlinkToAlternativeGCCArchive $(alternativeDirTokens)
: $(alternativeLinkTarget) : $(linkName) ;
}
rule AddLibrariesToHaikuHybridImage directory : libs
{
# AddLibraryToHaikuHybridImage <directory> : <libs>
#
# Installs libraries with the appropriate links onto the image.
#
libs = [ FFilterByBuildFeatures $(libs) ] ;
local lib ;
for lib in $(libs) {
local abiVersion = [ on $(lib) return $(HAIKU_LIB_ABI_VERSION) ] ;
if $(abiVersion) {
local abiVersionedLib = $(lib).$(abiVersion) ;
AddFilesToHaikuHybridImage $(directory)
: $(lib) : $(abiVersionedLib) : true ;
AddSymlinkToHaikuHybridImage $(directory)
: $(abiVersionedLib) : $(lib) : : true ;
} else {
AddFilesToHaikuHybridImage $(directory) : $(lib) : : true ;
}
}
}
#pragma mark - Floppy Boot Archive rules

View File

@ -23,8 +23,9 @@ rule SetupKernel
ObjectDefines $(object) : $(TARGET_KERNEL_DEFINES) ;
# 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) ;
}
}
@ -39,7 +40,7 @@ rule KernelLd
{
# KernelLd <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) ; }
@ -92,7 +93,7 @@ actions KernelSo1
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) --data $(2[2]) $(1) &&
$(HAIKU_ELFEDIT) --output-type dyn $(1)
$(HAIKU_ELFEDIT_$(TARGET_PACKAGING_ARCH)) --output-type dyn $(1)
}
rule KernelAddon
@ -133,7 +134,7 @@ rule KernelAddon
Depends $(target) : $(beginGlue) $(endGlue) ;
# compile and link
SetupKernel $(sources) : $(TARGET_KERNEL_PIC_FLAGS) : false ;
SetupKernel $(sources) : : false ;
local linkFlags = -nostdlib -Xlinker --no-undefined
-Xlinker -soname=\"$(target:G=)\" $(TARGET_KERNEL_ADDON_LINKFLAGS) ;
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ] $(linkFlags) ;
@ -161,7 +162,7 @@ rule KernelStaticLibrary
{
# Usage KernelStaticLibrary <name> : <sources> : <extra cc flags> ;
# This is designed to take a set of sources and libraries and create
# a file called lib<name>.a
# a static library.
SetupKernel $(2) : $(3) : false ;
Library $(1) : $(2) ;
@ -187,5 +188,5 @@ actions KernelStaticLibraryObjects
# 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)" ;
}

View File

@ -32,13 +32,17 @@ rule ExtractCatalogEntries target : sources : signature : regexp
localIncludesOption = $(HOST_LOCAL_INCLUDES_OPTION) ;
systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ;
} else {
sysHeaders += $(TARGET_HDRS) ;
defines += $(TARGET_DEFINES) ;
cc = $(TARGET_CC) ;
sysHeaders += $(TARGET_HDRS_$(TARGET_PACKAGING_ARCH)) ;
defines += $(TARGET_DEFINES_$(TARGET_PACKAGING_ARCH))
$(TARGET_DEFINES) ;
cc = $(TARGET_CC_$(TARGET_PACKAGING_ARCH)) ;
includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
includesSeparator
= $(TARGET_INCLUDES_SEPARATOR_$(TARGET_PACKAGING_ARCH)) ;
localIncludesOption
= $(TARGET_LOCAL_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
systemIncludesOption
= $(TARGET_SYSTEM_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
}
}

View File

@ -9,15 +9,10 @@ rule AddSharedObjectGlueCode
on $(1) {
platform = $(PLATFORM) ;
if $(platform) = haiku {
local stdLibs = libroot.so ;
local beginGlue ;
local endGlue ;
if $(2) = true {
beginGlue += $(HAIKU_EXECUTABLE_BEGIN_GLUE_CODE) ;
endGlue += $(HAIKU_EXECUTABLE_END_GLUE_CODE) ;
} else {
beginGlue += $(HAIKU_LIBRARY_BEGIN_GLUE_CODE) ;
endGlue += $(HAIKU_LIBRARY_END_GLUE_CODE) ;
local stdLibs = [ MultiArchDefaultGristFiles libroot.so ] ;
local type = EXECUTABLE ;
if $(2) != true {
type = LIBRARY ;
# special case for libroot: don't link it against itself
if $(DONT_LINK_AGAINST_LIBROOT) {
@ -25,6 +20,11 @@ rule AddSharedObjectGlueCode
}
}
local beginGlue
= $(HAIKU_$(type)_BEGIN_GLUE_CODE_$(TARGET_PACKAGING_ARCH)) ;
local endGlue
= $(HAIKU_$(type)_END_GLUE_CODE_$(TARGET_PACKAGING_ARCH)) ;
LINK_BEGIN_GLUE on $(1) = $(beginGlue) ;
LINK_END_GLUE on $(1) = $(endGlue) ;
@ -209,9 +209,9 @@ rule Ld
LINK on $(target) = $(HOST_LD) ;
LINKFLAGS on $(target) = $(HOST_LDFLAGS) $(LINKFLAGS) $(linkerFlags) ;
} else {
LINK on $(target) = $(TARGET_LD) ;
LINKFLAGS on $(target) = $(TARGET_LDFLAGS) $(LINKFLAGS)
$(linkerFlags) ;
LINK on $(target) = $(TARGET_LD_$(TARGET_PACKAGING_ARCH)) ;
LINKFLAGS on $(target) = $(TARGET_LDFLAGS_$(TARGET_PACKAGING_ARCH))
$(LINKFLAGS) $(linkerFlags) ;
}
NEEDLIBS on $(target) = $(NEEDLIBS) ;
@ -275,8 +275,9 @@ rule CreateAsmStructOffsetsHeader header : source
}
} else {
sysHeaders += $(TARGET_HDRS) ;
defines += $(TARGET_DEFINES) ;
sysHeaders += $(TARGET_HDRS_$(TARGET_PACKAGING_ARCH)) ;
defines += $(TARGET_DEFINES_$(TARGET_PACKAGING_ARCH))
$(TARGET_DEFINES) ;
}
# optimization flags
@ -309,18 +310,22 @@ rule CreateAsmStructOffsetsHeader header : source
} else {
# warning flags
if $(WARNINGS) != 0 {
flags += $(TARGET_WARNING_C++FLAGS) ;
flags += $(TARGET_WARNING_C++FLAGS_$(TARGET_PACKAGING_ARCH)) ;
}
# debug and other flags
flags += $(TARGET_C++FLAGS) $(TARGET_DEBUG_$(DEBUG)_C++FLAGS)
flags += $(TARGET_C++FLAGS_$(TARGET_PACKAGING_ARCH))
$(TARGET_DEBUG_$(DEBUG)_C++FLAGS_$(TARGET_PACKAGING_ARCH))
$(SUBDIRC++FLAGS) $(C++FLAGS) ;
C++ on $(header) = $(TARGET_C++) ;
C++ on $(header) = $(TARGET_C++_$(TARGET_PACKAGING_ARCH)) ;
includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
includesSeparator
= $(TARGET_INCLUDES_SEPARATOR_$(TARGET_PACKAGING_ARCH)) ;
localIncludesOption
= $(TARGET_LOCAL_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
systemIncludesOption
= $(TARGET_SYSTEM_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
}
}
@ -328,6 +333,7 @@ rule CreateAsmStructOffsetsHeader header : source
# for non-PODs. Since we're using the same compiler for the whole kernel and
# don't do virtual inheritence, that works well enough.
flags += -Wno-invalid-offsetof ;
# TODO: Rather get rid of the respective offsetof() instances.
# locate object, search for source, and set on target variables
@ -376,8 +382,9 @@ rule MergeObjectFromObjects
LINK on $(1) = $(HOST_LD) ;
LINKFLAGS on $(target) = $(HOST_LDFLAGS) ;
} else {
LINK on $(1) = $(TARGET_LD) ;
LINKFLAGS on $(target) = $(TARGET_LDFLAGS) ;
LINK on $(1) = $(TARGET_LD_$(TARGET_PACKAGING_ARCH)) ;
LINKFLAGS on $(target)
= $(TARGET_LDFLAGS_$(TARGET_PACKAGING_ARCH)) ;
}
}
@ -479,12 +486,12 @@ rule LinkAgainst
on $(target) {
# map libraries, if desired and target platform is Haiku
if $(PLATFORM) != host && $(mapLibs) = true
&& $(TARGET_LIBRARY_NAME_MAP) {
local map = $(TARGET_LIBRARY_NAME_MAP_$(TARGET_PACKAGING_ARCH)) ;
if $(PLATFORM) != host && $(mapLibs) = true && $(map) {
local mappedLibs ;
for i in $(libs) {
local mapped = $($(TARGET_LIBRARY_NAME_MAP)_$(i)) ;
local mapped = $($(map)_$(i)) ;
mapped ?= $(i) ;
mappedLibs += $(mapped) ;
}

View File

@ -10,15 +10,21 @@ rule SetupObjectsDir
if $(relPath) = . {
relPath = ;
}
COMMON_PLATFORM_LOCATE_TARGET =
[ FDirName $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) $(relPath) ] ;
COMMON_PLATFORM_LOCATE_TARGET
= [ FDirName $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) $(relPath) ] ;
HOST_COMMON_ARCH_LOCATE_TARGET
= [ FDirName $(HOST_COMMON_ARCH_OBJECT_DIR) $(relPath) ] ;
TARGET_COMMON_ARCH_LOCATE_TARGET
= [ FDirName $(TARGET_COMMON_ARCH_OBJECT_DIR) $(relPath) ] ;
local var ;
for var in COMMON_ARCH COMMON_DEBUG DEBUG_$(HAIKU_DEBUG_LEVELS) {
for var in COMMON_DEBUG DEBUG_$(HAIKU_DEBUG_LEVELS) {
HOST_$(var)_LOCATE_TARGET
= [ FDirName $(HOST_$(var)_OBJECT_DIR) $(relPath) ] ;
TARGET_$(var)_LOCATE_TARGET
= [ FDirName $(TARGET_$(var)_OBJECT_DIR) $(relPath) ] ;
= [ FDirName $(TARGET_$(var)_OBJECT_DIR_$(TARGET_PACKAGING_ARCH))
$(relPath) ] ;
}
LOCATE_TARGET = $(COMMON_PLATFORM_LOCATE_TARGET) ;
@ -71,58 +77,62 @@ rule SubIncludeGPL
# pragma mark - MakeLocate variants
rule MakeLocateCommonPlatform
rule MakeLocateCommonPlatform files : subdir
{
# The file is shared between all target platforms.
MakeLocate $(1) : $(COMMON_PLATFORM_LOCATE_TARGET) ;
MakeLocate $(files)
: [ FDirName $(COMMON_PLATFORM_LOCATE_TARGET) $(subdir) ] ;
}
rule MakeLocatePlatform
rule MakeLocatePlatform files : subdir
{
# The file is specific for the target platform, but
# architecture independent. Usually the right rule for generated
# sources, though sometimes sources can be architecture specific.
local files = $(1) ;
local file ;
for file in $(files) {
local directory ;
if [ on $(file) return $(PLATFORM) ] = host {
MakeLocate $(file) : $(HOST_COMMON_ARCH_LOCATE_TARGET) ;
directory = $(HOST_COMMON_ARCH_LOCATE_TARGET) ;
} else {
MakeLocate $(file) : $(TARGET_COMMON_ARCH_LOCATE_TARGET) ;
directory = $(TARGET_COMMON_ARCH_LOCATE_TARGET) ;
}
MakeLocate $(file) : [ FDirName $(directory) $(subdir) ] ;
}
}
rule MakeLocateArch
rule MakeLocateArch files : subdir
{
# The file is platform+architecture specific, but is debug
# level independent. This is usually the right rule for generated
# architecture specific data or source files.
local files = $(1) ;
local file ;
for file in $(files) {
local directory ;
if [ on $(file) return $(PLATFORM) ] = host {
MakeLocate $(file) : $(HOST_COMMON_DEBUG_LOCATE_TARGET) ;
directory = $(HOST_COMMON_DEBUG_LOCATE_TARGET) ;
} else {
MakeLocate $(file) : $(TARGET_COMMON_DEBUG_LOCATE_TARGET) ;
directory = $(TARGET_COMMON_DEBUG_LOCATE_TARGET) ;
}
MakeLocate $(file) : [ FDirName $(directory) $(subdir) ] ;
}
}
rule MakeLocateDebug
rule MakeLocateDebug files : subdir
{
# The file is platform+architecture+debug level specific.
# That's what should be used for compiled code.
local files = $(1) ;
local file ;
for file in $(files) {
local directory ;
on $(file) {
if $(PLATFORM) = host {
MakeLocate $(file) : $(HOST_DEBUG_$(DEBUG)_LOCATE_TARGET) ;
directory = $(HOST_DEBUG_$(DEBUG)_LOCATE_TARGET) ;
} else {
MakeLocate $(file) : $(TARGET_DEBUG_$(DEBUG)_LOCATE_TARGET) ;
directory = $(TARGET_DEBUG_$(DEBUG)_LOCATE_TARGET) ;
}
}
MakeLocate $(file) : [ FDirName $(directory) $(subdir) ] ;
}
}
@ -394,13 +404,31 @@ rule DefineBuildProfile name : type : path {
case "update" : {
JAM_TARGETS = $(buildTarget) ;
SetUpdateHaikuImageOnly 1 ;
HAIKU_PACKAGES_UPDATE_ONLY = 1 ;
HAIKU_INCLUDE_IN_IMAGE on $(HAIKU_BUILD_PROFILE_PARAMETERS) = 1 ;
HAIKU_INCLUDE_IN_PACKAGES on $(HAIKU_BUILD_PROFILE_PARAMETERS) = 1 ;
}
case "update-all" : {
JAM_TARGETS = $(buildTarget) ;
SetUpdateHaikuImageOnly 1 ;
HAIKU_PACKAGES_UPDATE_ONLY = 1 ;
HAIKU_INCLUDE_IN_IMAGE = 1 ;
HAIKU_INCLUDE_IN_PACKAGES = 1 ;
}
case "update-packages" : {
JAM_TARGETS = $(buildTarget) ;
SetUpdateHaikuImageOnly 1 ;
HAIKU_UPDATE_ALL_PACKAGES = 1 ;
}
case "build-package-list" : {
HAIKU_IMAGE_LIST_PACKAGES_TARGET
= $(HAIKU_BUILD_PROFILE_PARAMETERS[1]) ;
HAIKU_IMAGE_ADDITIONAL_PACKAGES
= $(HAIKU_BUILD_PROFILE_PARAMETERS[2-]) ;
JAM_TARGETS = $(HAIKU_IMAGE_LIST_PACKAGES_TARGET) ;
}
case "mount" : {
@ -417,166 +445,3 @@ rule DefineBuildProfile name : type : path {
return 1 ;
}
# pragma mark - Build Features
rule FIsBuildFeatureEnabled feature
{
# FIsBuildFeatureEnabled <feature> ;
# Returns whether the given build feature <feature> is enabled (if so: "1",
# if not: empty list).
#
# <feature> - The name of the build feature (all lower case).
if $(feature) in $(HAIKU_BUILD_FEATURES) {
return 1 ;
}
return ;
}
rule FMatchesBuildFeatures specification
{
# FMatchesBuildFeatures <specification> ;
# Returns whether the given build feature specification <specification>
# holds. <specification> consists of positive and negative build feature
# conditions. Conditions can be individual list elements and multiple
# conditions can be joined, separated by ",", in a single list element. The
# effect is the same; they are considered as single set of conditions.
# A positive condition does not start with a "!". It holds when the build
# feature named by the element is enabled.
# A negative condition starts with a "!". It holds when the build feature
# named by the string resulting from removing the leading "!" is not
# enabled.
# <specification> holds when it is not empty and
# * none of the negative conditions it contains hold and
# * if it contains any positive conditions, at least one one of them holds.
#
# <specification> - The build feature specification. A list of individual
# conditions or conditions joined by ",".
local splitSpecification ;
local element ;
for element in $(specification) {
splitSpecification += [ FSplitString $(element) : "," ] ;
}
return [ FSetConditionsHold $(splitSpecification)
: $(HAIKU_BUILD_FEATURES) ] ;
}
rule FFilterByBuildFeatures list
{
# FFilterByBuildFeatures <list> ;
# Filters the list annotated by build feature specifications and returns the
# resulting list. The list can be annotated in two different ways:
# * A single list element can be annotated by appending "@<specification>"
# to it, with <specification> being a build feature specification (a
# single comma-separated string). The element appears in the resulting
# list, only if <specification> holds.
# * A sublist can be annotated by enclosing it in "<specification> @{" (two
# separate list elements) and "}@", with <specification> being a build
# feature specification (a single comma-separated string). The enclosed
# sublist appears in the resulting list, only if <specification> holds.
# The sublist annotations can be nested. The annotations themselves don't
# appear in the resulting list.
#
# <list> - A list annotated with build feature specifications.
local filteredList ;
# Since we must look ahead one element to be able to decide whether an
# element is a regular list element or a features specification for a
# subsequent "@{". Hence we always process an element other than "@{" and
# "}@" in the next iteration. We append a dummy element to the list so we
# don't need special handling for the last element.
local evaluationStack = 1 ;
local previousElement ;
local element ;
for element in $(list) dummy {
local stackTop = $(evaluationStack[1]) ;
local processElement = $(previousElement) ;
switch $(element) {
case }@ :
{
# Pop the topmost specification off the stack.
evaluationStack = $(evaluationStack[2-]) ;
if ! $(evaluationStack) {
Exit "FFilterByBuildFeatures: Unbalanced @( in: " $(list) ;
}
processElement = $(previousElement) ;
previousElement = ;
}
case @{ :
{
if ! $(previousElement) {
Exit "FFilterByBuildFeatures: No feature specification"
"after )@ in: " $(list) ;
}
if $(evaluationStack[1]) = 1
&& [ FMatchesBuildFeatures $(previousElement) ] {
evaluationStack = 1 $(evaluationStack) ;
} else {
evaluationStack = 0 $(evaluationStack) ;
}
processElement = ;
previousElement = ;
}
case * :
{
processElement = $(previousElement) ;
previousElement = $(element) ;
}
}
if $(processElement) && $(stackTop) = 1 {
local splitElement = [ Match "(.*)@([^@]*)" : $(processElement) ] ;
if $(splitElement) {
if [ FMatchesBuildFeatures $(splitElement[2]) ] {
filteredList += $(splitElement[1]) ;
}
} else {
filteredList += $(processElement) ;
}
}
}
if $(evaluationStack[2-]) {
Exit "FFilterByBuildFeatures: Unbalanced )@ in: " $(list) ;
}
return $(filteredList) ;
}
rule EnableBuildFeatures features : specification
{
# EnableBuildFeatures <features> : <specification> ;
# Enables the build features <features>, if the build features specification
# <specification> holds. If <specification> is omitted, the features are
# enabled unconditionally.
# The rule enables a build feature by adding its given lower case name to
# the build variable HAIKU_BUILD_FEATURES and defining a build variable
# HAIKU_BUILD_FEATURE_<FEATURE>_ENABLED (<FEATURE> being the upper case name
# of the build feature) to "1".
#
# <features> - A list of build feature names (lower case).
# <specification> - An optional build features specification (cf.
# FMatchesBuildFeatures).
if ! $(specification)
|| [ FMatchesBuildFeatures $(specification)
: $(HAIKU_BUILD_FEATURES) ] {
local feature ;
for feature in $(features) {
HAIKU_BUILD_FEATURES += $(feature) ;
HAIKU_BUILD_FEATURE_$(feature:U)_ENABLED = 1 ;
}
}
}

View File

@ -1,356 +0,0 @@
# This file defines the optional lib packages that can be added to the Haiku image.
# It is directly included from HaikuImage -- all variables defined there can
# be used
# Detect a hybrid GCC2/GCC4 image and disable the checks for unavailable GCC4
# packages. (It does not matter if a package was built with either compiler,
# the system should have the respective other system libs.)
local isHybridBuild ;
if $(HAIKU_ADD_ALTERNATIVE_GCC_LIBS) = 1
&& $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR) {
isHybridBuild = 1 ;
}
# Available Optional Lib Packages:
# AllegroLibs
# box2d
# fribidi
# lcms
# libart_lgpl
# libmad
# libmikmod
# libmodplug
# libpaper
# physfs
# SDLLibs
# XiphLibs
local baseURL = http://haiku-files.org/files/optional-packages ;
local baseSourceURL = http://haiku-files.org/files/sources ;
# AllegroLibs
if [ IsOptionalHaikuImagePackageAdded AllegroLibs ] {
# libsdl and related libs
if $(TARGET_ARCH) != x86 {
Echo "No optional package AllegroLibs available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
allegro-4.4.1.1-r1a4-x86-gcc4-2012-09-09.zip
: $(baseURL)/lib/allegro-4.4.1.1-r1a4-x86-gcc4-2012-09-09.zip ;
InstallOptionalHaikuImagePackage
dumb-0.9.3-r1a4-x86-gcc4-2012-09-09.zip
: $(baseURL)/lib/dumb-0.9.3-r1a4-x86-gcc4-2012-09-09.zip ;
InstallOptionalHaikuImagePackage
jgmod-0.99-r1a4-x86-gcc4-2012-09-09.zip
: $(baseURL)/lib/jgmod-0.99-r1a4-x86-gcc4-2012-09-09.zip ;
} else {
InstallOptionalHaikuImagePackage
allegro-4.4.1.1-r1a4-x86-gcc2-2012-08-30.zip
: $(baseURL)/lib/allegro-4.4.1.1-r1a4-x86-gcc2-2012-08-30.zip ;
InstallOptionalHaikuImagePackage
dumb-0.9.3-r1a4-x86-gcc2-2012-08-30.zip
: $(baseURL)/lib/dumb-0.9.3-r1a4-x86-gcc2-2012-08-30.zip ;
InstallOptionalHaikuImagePackage
jgmod-0.99-r1a4-x86-gcc2-2012-08-30.zip
: $(baseURL)/lib/jgmod-0.99-r1a4-x86-gcc2-2012-08-30.zip ;
}
}
# box2d
if [ IsOptionalHaikuImagePackageAdded box2d ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package box2d available for $(TARGET_ARCH)" ;
} else {
if $(HAIKU_GCC_VERSION[1]) >= 4 || $(isHybridBuild) {
InstallOptionalHaikuImagePackage
box2d-2.1.2-r1a4-x86-gcc4-2012-09-09.zip
: $(baseURL)/lib/box2d-2.1.2-r1a4-x86-gcc4-2012-09-09.zip
: : true ;
} else {
Echo "No optional package box2d available for $(TARGET_ARCH)-gcc2" ;
}
}
}
# fribidi
if [ IsOptionalHaikuImagePackageAdded fribidi ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package fribidi available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
fribidi-0.19.2-r1a4-x86-gcc4-2012-09-01.zip
: $(baseURL)/lib/fribidi-0.19.2-r1a4-x86-gcc4-2012-09-01.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
fribidi-0.19.2-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/fribidi-0.19.2-r1a4-x86-gcc2-2012-08-29.zip
: : true ;
}
}
# lcms
if [ IsOptionalHaikuImagePackageAdded lcms ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package lcms available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
lcms-2.1-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/lcms-2.1-r1a4-x86-gcc4-2012-09-02.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
lcms-2.1-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/lcms-2.1-r1a4-x86-gcc2-2012-08-29.zip
: : true ;
}
}
# libart_lgpl
if [ IsOptionalHaikuImagePackageAdded libart_lgpl ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package libart_lgpl available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
libart_lgpl-2.3.21-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/libart_lgpl-2.3.21-r1a4-x86-gcc4-2012-09-02.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
libart_lgpl-2.3.21-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/libart_lgpl-2.3.21-r1a4-x86-gcc2-2012-08-29.zip
: : true ;
}
}
# libmad
if [ IsOptionalHaikuImagePackageAdded libmad ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package libmad available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
libmad-0.15.1b-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/libmad-0.15.1b-r1a4-x86-gcc4-2012-09-02.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
libmad-0.15.1b-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/libmad-0.15.1b-r1a4-x86-gcc2-2012-08-29.zip
: : true ;
}
}
# libmikmod
if [ IsOptionalHaikuImagePackageAdded libmikmod ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package libmikmod available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
libmikmod-3.1.11-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/libmikmod-3.1.11-r1a4-x86-gcc4-2012-09-02.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
libmikmod-3.1.11-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/libmikmod-3.1.11-r1a4-x86-gcc2-2012-08-29.zip
: : true ;
}
}
# libmodplug
if [ IsOptionalHaikuImagePackageAdded libmodplug ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package libmodplug available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
libmodplug-0.8.8.4-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/libmodplug-0.8.8.4-r1a4-x86-gcc4-2012-09-02.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
libmodplug-0.8.8.4-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/libmodplug-0.8.8.4-r1a4-x86-gcc2-2012-08-29.zip
: : true ;
}
}
# libpaper
if [ IsOptionalHaikuImagePackageAdded libpaper ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package libpaper available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
libpaper-1.1.24-r1a4-x86-gcc4-2012-09-01.zip
: $(baseURL)/lib/libpaper-1.1.24-r1a4-x86-gcc4-2012-09-01.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
libpaper-1.1.24-r1a4-x86-gcc4-2012-09-01.zip
: $(baseURL)/lib/libpaper-1.1.24-r1a4-x86-gcc4-2012-09-01.zip
: : true ;
}
}
# physfs
if [ IsOptionalHaikuImagePackageAdded physfs ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package physfs available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
physfs-2.0.1-r1a4-x86-gcc4-2012-09-09.zip
: $(baseURL)/lib/physfs-2.0.1-r1a4-x86-gcc4-2012-09-09.zip
: : true ;
} else {
InstallOptionalHaikuImagePackage
physfs-2.0.1-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/physfs-2.0.1-r1a4-x86-gcc2-2012-08-29.zip
: : true ;
}
}
# SDLLibs
if [ IsOptionalHaikuImagePackageAdded SDLLibs ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package SDLLibs available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
libsdl-1.2.15-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/libsdl-1.2.15-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
guilib-1.2.1-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/guilib-1.2.1-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
sdl-gfx-2.0.23-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/sdl-gfx-2.0.23-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
sdl-image-1.2.12-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/sdl-image-1.2.12-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
sdl-mixer-1.2.11-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/sdl-mixer-1.2.11-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
sdl-net-1.2.8-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/sdl-net-1.2.8-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
sdl-sound-1.0.3-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/sdl-sound-1.0.3-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
sdl-rtf-0.1.0-r1a4-x86-gcc4-2012-09-03.zip
: $(baseURL)/lib/sdl-rtf-0.1.0-r1a4-x86-gcc4-2012-09-03.zip ;
InstallOptionalHaikuImagePackage
sdl-ttf-2.0.11-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/sdl-ttf-2.0.11-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
sge-030809-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/sge-030809-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
smjpeg-0.2.1-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/smjpeg-0.2.1-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
smpeg-0.4.5-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/smpeg-0.4.5-r1a4-x86-gcc4-2012-09-02.zip ;
} else {
InstallOptionalHaikuImagePackage
libsdl-1.2.15-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/libsdl-1.2.15-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
guilib-1.2.1-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/guilib-1.2.1-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
sdl-gfx-2.0.23-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/sdl-gfx-2.0.23-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
sdl-image-1.2.12-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/sdl-image-1.2.12-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
sdl-mixer-1.2.11-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/sdl-mixer-1.2.11-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
sdl-net-1.2.8-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/sdl-net-1.2.8-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
sdl-sound-1.0-hg-r1a4-x86-gcc2-2012-08-30.zip
: $(baseURL)/lib/sdl-sound-1.0-hg-r1a4-x86-gcc2-2012-08-30.zip ;
InstallOptionalHaikuImagePackage
sdl-rtf-0.1.0-r1a3-x86-gcc2-2011-05-20.zip
: $(baseURL)/lib/sdl-rtf-0.1.0-r1a3-x86-gcc2-2011-05-20.zip ;
InstallOptionalHaikuImagePackage
sdl-ttf-2.0.11-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/sdl-ttf-2.0.11-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
sge-030809-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/sge-030809-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
smjpeg-0.2.1-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/smjpeg-0.2.1-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
smpeg-0.4.5-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/smpeg-0.4.5-r1a4-x86-gcc2-2012-08-29.zip ;
}
}
# XiphLibs
if [ IsOptionalHaikuImagePackageAdded XiphLibs ] {
if $(TARGET_ARCH) != x86 {
Echo "No optional package XiphLibs available for $(TARGET_ARCH)" ;
} else if $(HAIKU_GCC_VERSION[1]) >= 4 {
InstallOptionalHaikuImagePackage
flac-1.2.1-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/flac-1.2.1-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
libao-1.0.0-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/libao-1.0.0-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
libogg-1.3.0-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/libogg-1.3.0-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
libtheora-1.1.1-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/libtheora-1.1.1-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
libvorbis-1.3.2-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/libvorbis-1.3.2-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
speex-1.2rc1-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/speex-1.2rc1-r1a4-x86-gcc4-2012-09-02.zip ;
InstallOptionalHaikuImagePackage
vorbis-tools-1.4.0-r1a4-x86-gcc4-2012-09-02.zip
: $(baseURL)/lib/vorbis-tools-1.4.0-r1a4-x86-gcc4-2012-09-02.zip ;
} else {
InstallOptionalHaikuImagePackage
flac-1.2.1-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/flac-1.2.1-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
libao-1.0.0-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/libao-1.0.0-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
libogg-1.3.0-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/libogg-1.3.0-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
libtheora-1.1.1-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/libtheora-1.1.1-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
libvorbis-1.3.2-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/libvorbis-1.3.2-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
speex-1.2rc1-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/speex-1.2rc1-r1a4-x86-gcc2-2012-08-29.zip ;
InstallOptionalHaikuImagePackage
vorbis-tools-1.4.0-r1a4-x86-gcc2-2012-08-29.zip
: $(baseURL)/lib/vorbis-tools-1.4.0-r1a4-x86-gcc2-2012-08-29.zip ;
}
}

View File

@ -1,44 +0,0 @@
# package dependencies
#
# For transitive dependencies dependents should be listed before their
# dependencies.
OptionalPackageDependencies APR-util : APR Expat ;
OptionalPackageDependencies AllegroLibs : XiphLibs ;
OptionalPackageDependencies ArmyKnife : TagLib ;
OptionalPackageDependencies Beam : LibIconv LibLayout OpenSSL PCRE ;
OptionalPackageDependencies BeHappy : BeBook NetSurf ;
OptionalPackageDependencies BurnItNow : CDRecord ;
OptionalPackageDependencies Caya : Expat ;
OptionalPackageDependencies CDRecord : GetText LibIconv ;
OptionalPackageDependencies Curl : OpenSSL ;
OptionalPackageDependencies DevelopmentBase : CDRecord DevelopmentMin Yasm ;
OptionalPackageDependencies Development : DevelopmentBase Perl ;
OptionalPackageDependencies DevelopmentPowerPC : DevelopmentMin ;
OptionalPackageDependencies GetText : LibIconv ;
OptionalPackageDependencies Git : Expat Curl OpenSSL LibIconv ;
OptionalPackageDependencies GitDoc : Man Git ;
OptionalPackageDependencies ICU-devel : DevelopmentBase ;
OptionalPackageDependencies LibLayout : DevelopmentBase ;
OptionalPackageDependencies LibXML2 : XZ-Utils ;
OptionalPackageDependencies Man : Groff ;
OptionalPackageDependencies Tar : LibIconv ;
OptionalPackageDependencies Python : Bzip ;
OptionalPackageDependencies Mercurial : Python ;
OptionalPackageDependencies Neon : LibXML2 ;
OptionalPackageDependencies NetFS : UserlandFS ;
OptionalPackageDependencies NetSurf : OpenSSL Curl LibXML2 LibIconv Libmng ;
OptionalPackageDependencies OpenSSH : OpenSSL ;
OptionalPackageDependencies OpenSSL : CARootCertificates ;
OptionalPackageDependencies Paladin : CCache Fastdep PCRE ;
OptionalPackageDependencies Pe : PCRE ;
OptionalPackageDependencies SDLLibs : XiphLibs libmad libmikmod Libmng libmodplug physfs ;
OptionalPackageDependencies Subversion : APR-util Neon LibIconv LibXML2 OpenSSL SQLite ;
OptionalPackageDependencies Transmission : LibEvent Curl OpenSSL LibIconv ;
OptionalPackageDependencies Vim : GetText LibIconv ;
OptionalPackageDependencies WebPositive : Curl LibXML2 SQLite WebKit WebPositiveBookmarks ;
OptionalPackageDependencies wpa_supplicant : OpenSSL ;
OptionalPackageDependencies XZ-Utils : Tar ;
OptionalPackageDependencies MandatoryPackages : Bzip Ctags Grep ICU Sed Tar TermInfo ;

File diff suppressed because it is too large Load Diff

View File

@ -7,34 +7,35 @@
# libMicro
if [ IsOptionalHaikuImagePackageAdded libMicro ] {
# add scripts, tattle executable and README
SEARCH on <libmicro>bench <libmicro>multiview <libmicro>README
= [ FDirName $(HAIKU_TOP) src tests system benchmarks libMicro ] ;
AddFilesToHaikuImage home benchmarks libmicro
: <libmicro>bench <libmicro>multiview <libmicro>README ;
AddFilesToHaikuImage home benchmarks libmicro bin-BePC : tattle ;
# add libmicro benchmarks
AddFilesToHaikuImage home benchmarks libmicro bin-BePC :
atomic <libmicro>bind cachetocache cascade_cond cascade_fcntl
cascade_flock cascade_lockf cascade_mutex chdir close close_tcp
connection dup exec exec_bin exit exp fcntl fcntl_ndelay file_lock fork
getcontext getenv <libmicro>getpeername getpid getrusage getsockname
gettimeofday isatty listen localtime_r <libmicro>log longjmp lrand48
lseek malloc memcpy memmove memrand memset mktime mmap mprotect msync
munmap mutex nop <libmicro>open pipe poll pread pthread_create pwrite
read realpath recurse select semop setcontext setsockopt sigaction
siglongjmp signal sigprocmask <libmicro>socket socketpair <libmicro>stat
strcasecmp strchr strcmp strcpy strftime strlen strtol system time times
write writev ;
AddSymlinkToHaikuImage home benchmarks libmicro : bin-BePC : bin ;
AddOptionalPackageDescriptionToHaikuImage
<libmicro>.OptionalPackageDescription
: $(HAIKU_TOP) src tests system benchmarks libMicro ;
AddLicenseToHaikuImage <libmicro>OPENSOLARIS.LICENSE : OpenSolaris
: $(HAIKU_TOP) src tests system benchmarks libMicro ;
}
# TODO: Make this an actual package!
# if [ IsOptionalHaikuImagePackageAdded libMicro ] {
# # add scripts, tattle executable and README
# SEARCH on <libmicro>bench <libmicro>multiview <libmicro>README
# = [ FDirName $(HAIKU_TOP) src tests system benchmarks libMicro ] ;
#
# AddFilesToHaikuImage home benchmarks libmicro
# : <libmicro>bench <libmicro>multiview <libmicro>README ;
# AddFilesToHaikuImage home benchmarks libmicro bin-BePC : tattle ;
#
# # add libmicro benchmarks
# AddFilesToHaikuImage home benchmarks libmicro bin-BePC :
# atomic <libmicro>bind cachetocache cascade_cond cascade_fcntl
# cascade_flock cascade_lockf cascade_mutex chdir close close_tcp
# connection dup exec exec_bin exit exp fcntl fcntl_ndelay file_lock fork
# getcontext getenv <libmicro>getpeername getpid getrusage getsockname
# gettimeofday isatty listen localtime_r <libmicro>log longjmp lrand48
# lseek malloc memcpy memmove memrand memset mktime mmap mprotect msync
# munmap mutex nop <libmicro>open pipe poll pread pthread_create pwrite
# read realpath recurse select semop setcontext setsockopt sigaction
# siglongjmp signal sigprocmask <libmicro>socket socketpair <libmicro>stat
# strcasecmp strchr strcmp strcpy strftime strlen strtol system time times
# write writev ;
#
# AddSymlinkToHaikuImage home benchmarks libmicro : bin-BePC : bin ;
#
# AddOptionalPackageDescriptionToHaikuImage
# <libmicro>.OptionalPackageDescription
# : $(HAIKU_TOP) src tests system benchmarks libMicro ;
# AddLicenseToHaikuImage <libmicro>OPENSOLARIS.LICENSE : OpenSolaris
# : $(HAIKU_TOP) src tests system benchmarks libMicro ;
# }

View File

@ -22,8 +22,8 @@ rule Link
LINK on $(1) = $(HOST_LINK) ;
LINKFLAGS on $(1) = $(HOST_LINKFLAGS) [ on $(1) return $(LINKFLAGS) ] ;
} else {
LINK on $(1) = $(TARGET_LINK) ;
LINKFLAGS on $(1) = $(TARGET_LINKFLAGS)
LINK on $(1) = $(TARGET_LINK_$(TARGET_PACKAGING_ARCH)) ;
LINKFLAGS on $(1) = $(TARGET_LINKFLAGS_$(TARGET_PACKAGING_ARCH))
[ on $(1) return $(LINKFLAGS) ] ;
}
@ -34,9 +34,15 @@ rule Link
on $(1) XRes $(1) : $(RESFILES) ;
if ! [ on $(1) return $(DONT_USE_BEOS_RULES) ] {
SetType $(1) ;
MimeSet $(1) ;
MimeSet $(1) : sharedObject ;
SetVersion $(1) ;
# For applications for the target also generate the MIME DB entries.
if [ on $(1) return $(PLATFORM) ] != host
&& [ on $(1) return $(RESFILES) ] {
CreateAppMimeDBEntries $(1) ;
}
# If the generic attribute emulation is enabled, make sure the tool to
# remove the attributes is built first.
if $(HOST_RM_ATTRS_TARGET) {
@ -100,8 +106,9 @@ rule Object
}
} else {
sysHeaders += $(TARGET_HDRS) ;
defines += $(TARGET_DEFINES) ;
sysHeaders += $(TARGET_HDRS_$(TARGET_PACKAGING_ARCH)) ;
defines += $(TARGET_DEFINES_$(TARGET_PACKAGING_ARCH))
$(TARGET_DEFINES) ;
}
}
@ -188,13 +195,17 @@ rule As
systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ;
} else {
flags = [ on $(1) return $(TARGET_ASFLAGS) $(ASFLAGS) ] ;
flags = [ on $(1) return $(TARGET_ASFLAGS_$(architecture))
$(ASFLAGS) ] ;
CC on $(1) = $(TARGET_CC) ;
CC on $(1) = $(TARGET_CC_$(TARGET_PACKAGING_ARCH)) ;
includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
includesSeparator
= $(TARGET_INCLUDES_SEPARATOR_$(TARGET_PACKAGING_ARCH)) ;
localIncludesOption
= $(TARGET_LOCAL_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
systemIncludesOption
= $(TARGET_SYSTEM_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
}
Depends $(<) : $(>) ;
@ -288,18 +299,22 @@ rule Cc
} else {
# warning flags
if $(WARNINGS) != 0 {
flags += $(TARGET_WARNING_CCFLAGS) ;
flags += $(TARGET_WARNING_CCFLAGS_$(TARGET_PACKAGING_ARCH)) ;
}
# debug and other flags
flags += $(TARGET_CCFLAGS) $(TARGET_DEBUG_$(DEBUG)_CCFLAGS)
flags += $(TARGET_CCFLAGS_$(TARGET_PACKAGING_ARCH))
$(TARGET_DEBUG_$(DEBUG)_CCFLAGS_$(TARGET_PACKAGING_ARCH))
$(SUBDIRCCFLAGS) $(CCFLAGS) ;
CC on $(1) = $(TARGET_CC) ;
CC on $(1) = $(TARGET_CC_$(TARGET_PACKAGING_ARCH)) ;
includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
includesSeparator
= $(TARGET_INCLUDES_SEPARATOR_$(TARGET_PACKAGING_ARCH)) ;
localIncludesOption
= $(TARGET_LOCAL_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
systemIncludesOption
= $(TARGET_SYSTEM_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
}
CCFLAGS on $(<) = $(flags) ;
@ -355,18 +370,22 @@ rule C++
} else {
# warning flags
if $(WARNINGS) != 0 {
flags += $(TARGET_WARNING_C++FLAGS) ;
flags += $(TARGET_WARNING_C++FLAGS_$(TARGET_PACKAGING_ARCH)) ;
}
# debug and other flags
flags += $(TARGET_C++FLAGS) $(TARGET_DEBUG_$(DEBUG)_C++FLAGS)
flags += $(TARGET_C++FLAGS_$(TARGET_PACKAGING_ARCH))
$(TARGET_DEBUG_$(DEBUG)_C++FLAGS_$(TARGET_PACKAGING_ARCH))
$(SUBDIRC++FLAGS) $(C++FLAGS) ;
C++ on $(1) = $(TARGET_C++) ;
C++ on $(1) = $(TARGET_C++_$(TARGET_PACKAGING_ARCH)) ;
includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
includesSeparator
= $(TARGET_INCLUDES_SEPARATOR_$(TARGET_PACKAGING_ARCH)) ;
localIncludesOption
= $(TARGET_LOCAL_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
systemIncludesOption
= $(TARGET_SYSTEM_INCLUDES_OPTION_$(TARGET_PACKAGING_ARCH)) ;
}
C++FLAGS on $(<) = $(flags) ;
@ -418,8 +437,9 @@ rule LibraryFromObjects
AR on $(_l) = $(HOST_AR) $(HOST_ARFLAGS) ;
RANLIB on $(_l) = $(HOST_RANLIB) ;
} else {
AR on $(_l) = $(TARGET_AR) $(TARGET_ARFLAGS) ;
RANLIB on $(_l) = $(TARGET_RANLIB) ;
AR on $(_l) = $(TARGET_AR_$(TARGET_PACKAGING_ARCH))
$(TARGET_ARFLAGS_$(TARGET_PACKAGING_ARCH)) ;
RANLIB on $(_l) = $(TARGET_RANLIB_$(TARGET_PACKAGING_ARCH)) ;
}
# library depends on its member objects
@ -529,7 +549,8 @@ rule MainFromObjects
}
# Override Jam 2.5rc3 MakeLocate and MkDir to deal more intelligently
# with grist set on the supplied directory name.
# with grist set on the supplied directory name. Also do nothing for already
# located files.
rule MakeLocate
{
local dir = $(2[1]) ;
@ -539,11 +560,18 @@ rule MakeLocate
if ! $(dir:G) {
dir = $(dir:G=dir) ;
}
LOCATE on $(1) += $(dir:G=) ; # don't relocate once located
Depends $(1) : $(dir) ;
local target ;
for target in $(1) {
# don't relocate once located
LOCATE on $(target) += $(dir:G=) ;
if [ on $(target) return $(LOCATE) ] = $(dir:G=) {
Depends $(target) : $(dir) ;
MkDir $(dir) ;
}
}
}
}
rule MkDir
{
@ -646,11 +674,13 @@ rule ObjectHdrs
[ FSysIncludes $(SYSHDRS)
: $(HOST_SYSTEM_INCLUDES_OPTION) ] ;
} else {
local architecture = $(TARGET_PACKAGING_ARCH) ;
fileHeaders =
[ FIncludes $(localHeaders) : $(TARGET_LOCAL_INCLUDES_OPTION) ]
$(TARGET_INCLUDES_SEPARATOR)
[ FIncludes $(localHeaders)
: $(TARGET_LOCAL_INCLUDES_OPTION_$(architecture)) ]
$(TARGET_INCLUDES_SEPARATOR_$(architecture))
[ FSysIncludes $(SYSHDRS)
: $(TARGET_SYSTEM_INCLUDES_OPTION) ] ;
: $(TARGET_SYSTEM_INCLUDES_OPTION_$(architecture)) ] ;
}
ASHDRS on $(file) = $(fileHeaders) ;
@ -692,3 +722,9 @@ rule SubInclude
# restore SUBDIR_TOKENS
SUBDIR_TOKENS = $(oldSubDirTokens) ;
}
actions File
{
$(CP) "$(>)" "$(<)"
}

View File

@ -1,250 +1,242 @@
#-------------------------------------------------------------------------------
# Packages for OBOS alpha/beta testers
#-------------------------------------------------------------------------------
rule Copy
rule FHaikuPackageGrist package
{
if $(2) {
SEARCH on $(2) += $(SEARCH_SOURCE) ;
Depends $(1) : <build>copyattr $(2) ;
Copy1 $(1) : <build>copyattr $(2) ;
}
local grist = [ Match "<(.*)>" : $(package:G) ] ;
return hpkg_$(grist:E="")-$(package:G=) ;
}
actions Copy1
rule HaikuPackage package
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
"$(2[1])" -d "$(2[2-])" "$(1)"
local grist = [ FHaikuPackageGrist $(package) ] ;
HAIKU_CONTAINER_GRIST on $(package) = $(grist) ;
HAIKU_INCLUDE_IN_CONTAINER_VAR on $(package) = HAIKU_INCLUDE_IN_PACKAGES ;
HAIKU_INSTALL_TARGETS_VAR on $(package)
= $(grist)_HAIKU_PACKAGE_INSTALL_TARGETS ;
HAIKU_CONTAINER_SYSTEM_DIR_TOKENS on $(package) = ;
HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE = $(package) ;
if $(HAIKU_PACKAGES_UPDATE_ONLY) {
HAIKU_CONTAINER_UPDATE_ONLY on $(package) = 1 ;
HAIKU_CONTAINER_INHERIT_UPDATE_VARIABLE on $(package)
= HAIKU_INCLUDE_IN_IMAGE ;
} else if $(HAIKU_UPDATE_ALL_PACKAGES) {
HAIKU_INCLUDE_IN_IMAGE on $(package) = 1 ;
}
rule Packages
HAIKU_CONTAINER_ALWAYS_CREATE_DIRECTORIES on $(package) = 1 ;
}
rule PreprocessPackageInfo source : directory : architecture
: secondaryArchitecture
{
local packagenames = $(1) ;
local packagefiles = $(2) ;
local path = $(3) ;
for name in $(packagenames) {
Package $(name) : $(packagefiles) : $(path) ;
}
}
source = $(source:G=package-info-source) ;
SEARCH on $(source) +=
[ FDirName $(HAIKU_PACKAGE_INFOS_DIR) $(architecture) ]
[ FDirName $(HAIKU_PACKAGE_INFOS_DIR) any ]
[ FDirName $(HAIKU_PACKAGE_INFOS_DIR) generic ]
;
rule FPackageConfigSubPath
{
# FPackageConfigSubPath <packagename>
#
local packagename = $(1) ;
local configSubPath ;
on $(packagename) {
if $(PLATFORM) = host {
configSubPath = $(HOST_PLATFORM) $(HOST_ARCH) ;
local target = $(source:BSG=package-info)-package-info ;
local defines = HAIKU_PACKAGING_ARCH=$(architecture) ;
local sedReplacements = %HAIKU_PACKAGING_ARCH%,$(architecture) ;
if $(HAIKU_BOOTSTRAP_BUILD) {
defines += HAIKU_BOOTSTRAP_BUILD ;
target = $(target)-bootstrap ;
}
if $(secondaryArchitecture) {
defines += HAIKU_SECONDARY_PACKAGING_ARCH=$(secondaryArchitecture) ;
sedReplacements
+= %HAIKU_SECONDARY_PACKAGING_ARCH%,$(secondaryArchitecture) ;
sedReplacements +=
%HAIKU_SECONDARY_PACKAGING_ARCH_SUFFIX%,_$(secondaryArchitecture) ;
} else {
configSubPath = $(TARGET_PLATFORM) $(TARGET_ARCH) ;
sedReplacements
+= %HAIKU_SECONDARY_PACKAGING_ARCH_SUFFIX%, ;
}
if $(DEBUG) = 0 {
configSubPath += release ;
MakeLocate $(target) : $(directory) ;
Depends $(target) : $(source) ;
CCDEFS on $(target) = [ FDefines $(defines) ] ;
HAIKU_SED_REPLACEMENTS on $(target) = "-e s,$(sedReplacements),g" ;
PreprocessPackageInfo1 $(target) : $(source) ;
return $(target) ;
}
actions PreprocessPackageInfo1
{
sed $(HAIKU_SED_REPLACEMENTS) < $(2) | $(HOST_CC) -E -w $(CCDEFS) - -o $(1)
}
rule BuildHaikuPackage package : packageInfo
{
local architecture = $(HAIKU_PACKAGING_ARCH) ;
local secondaryArchitecture ;
if $(TARGET_PACKAGING_ARCH) != $(architecture) {
secondaryArchitecture = $(TARGET_PACKAGING_ARCH) ;
}
local grist = [ FHaikuPackageGrist $(package) ] ;
local tempDir
= [ FDirName $(HAIKU_PACKAGES_BUILD_DIR_$(architecture)) $(grist) ] ;
local scriptDir = [ FDirName $(tempDir) scripts ] ;
# build the package info and locate the package
packageInfo = [ PreprocessPackageInfo $(packageInfo) : $(tempDir)
: $(architecture) : $(secondaryArchitecture) ] ;
MakeLocate $(package) : $(HAIKU_PACKAGES_DIR_$(architecture)) ;
Depends $(package) : $(packageInfo) ;
# prepare the script that initializes the shell variables
local initVariablesScript = <$(grist)>haiku.package-init-vars ;
MakeLocate $(initVariablesScript) : $(scriptDir) ;
Always $(initVariablesScript) ;
local script = $(initVariablesScript) ;
AddVariableToScript $(script) : sourceDir : $(HAIKU_TOP) ;
AddVariableToScript $(script) : outputDir : $(HAIKU_OUTPUT_DIR) ;
AddVariableToScript $(script) : tmpDir : $(tempDir) ;
AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
AddVariableToScript $(script) : compressionLevel
: [ on $(package) return $(HAIKU_PACKAGE_COMPRESSION_LEVEL) ] ;
AddVariableToScript $(script) : updateOnly
: [ on $(package) return $(HAIKU_CONTAINER_UPDATE_ONLY) ] ;
AddVariableToScript $(script) : cc : $(TARGET_CC_$(architecture)) ;
AddTargetVariableToScript $(script) : <build>addattr ;
AddTargetVariableToScript $(script) : <build>copyattr ;
AddTargetVariableToScript $(script) : <mimedb>mime_db : mimeDB ;
AddTargetVariableToScript $(script) : <build>mimeset ;
AddTargetVariableToScript $(script) : <build>package ;
AddTargetVariableToScript $(script) : <build>rc ;
AddTargetVariableToScript $(script) : <build>resattr ;
AddTargetVariableToScript $(script) : <build>unzip ;
if $(HOST_RM_ATTRS_TARGET) {
AddTargetVariableToScript $(script) : $(HOST_RM_ATTRS_TARGET)
: rmAttrs ;
} else {
configSubPath += debug_$(DEBUG) ;
}
AddVariableToScript $(script) : rmAttrs : rm ;
}
return $(configSubPath) ;
# create the other scripts
local makeDirsScript = <$(grist)>haiku.package-make-dirs ;
local copyFilesScript = <$(grist)>haiku.package-copy-files ;
local extractFilesScript = <$(grist)>haiku.package-extract-files ;
MakeLocate $(makeDirsScript) $(copyFilesScript) $(extractFilesScript)
: $(scriptDir) ;
CreateContainerMakeDirectoriesScript $(package) : $(makeDirsScript) ;
CreateContainerCopyFilesScript $(package) : $(copyFilesScript) ;
CreateContainerExtractFilesScript $(package) : $(extractFilesScript) ;
local scripts = $(initVariablesScript) $(makeDirsScript)
$(copyFilesScript) $(extractFilesScript) ;
# call the build actions
local mainScript = build_haiku_package ;
SEARCH on $(mainScript) = [ FDirName $(HAIKU_TOP) build scripts ] ;
LocalDepends $(package) : $(mainScript) $(scripts) ;
BuildHaikuPackage1 $(package) : $(mainScript) $(packageInfo) $(scripts) ;
}
rule Package
actions BuildHaikuPackage1
{
local packagename = $(1) ;
local packagefiles = $(2) ;
local path = $(3) ;
local configSubPath = [ FPackageConfigSubPath $(packagename) ] ;
local packagezip = $(packagename:S=.zip:G=_packages) ;
local targetDir = [ FDirName $(HAIKU_PACKAGE_DIR) $(configSubPath) ] ;
local packagedir = [ FDirName $(targetDir) $(packagename) ] ;
local installscript = install.sh ;
local packageinstallscript = $(installscript:G=_packages!$(packagename)) ;
local installzip = install.zip ;
local packageinstallzip = $(installzip:G=_packages!$(packagename)) ;
local packageobjectdir = [ FDirName $(HAIKU_PACKAGE_OBJECT_DIR)
$(configSubPath) $(packagename) ] ;
local packagefiledir = [ FDirName $(packageobjectdir) $(path) ] ;
local packagefileinstallzip
= $(installzip:G=_package_objects!$(packagename)) ;
# add the files to the install.zip
local packagefilegrist = [ FGrist _package_files $(packagename) $(path) ] ;
for file in $(packagefiles) {
if $(path[0]) = "boot" {
local packagefile = $(file:G=$(packagefilegrist)) ;
MakeLocate $(packagefile) : $(packagefiledir) ;
Copy $(packagefile) : $(file) ;
Clean cleanPackages : $(packagefile) ;
PackageInstallZip $(packagefileinstallzip) : $(packagefile) ;
} else {
local packagefile = $(file:G=_packages!$(packagename)) ;
MakeLocate $(packagefile) : $(packagedir) ;
Copy $(packagefile) : [ FGristFiles $(file) ] ;
Clean cleanPackages : $(packagefile) ;
Depends $(packagezip) : $(packagefile) ;
}
$(2[1]) "$(1)" "$(2[2])" $(2[3-])
}
# general setup for this package -- only on first invocation
if ! $(_setup_$(packagename)) {
_setup_$(packagename) = true ;
NotFile $(packagename) ;
LocalDepends packages : $(packagename) ;
MakeLocate $(packagezip) : $(targetDir) ;
MakeLocate $(packageinstallscript) : $(packagedir) ;
MakeLocate $(packageinstallzip) : $(packagedir) ;
MakeLocate $(packagefileinstallzip) : $(packageobjectdir) ;
PackageInstallScript $(packageinstallscript) : $(packagedir) ;
LinkInstallZip $(packageinstallzip) : $(packagefileinstallzip) ;
Depends $(packagename) : $(packagezip) ;
PackageZip $(packagezip) : $(packagedir)
: $(packageinstallscript) $(packageinstallzip) ;
}
}
rule PackageSymLink
rule AddDirectoryToPackage directoryTokens : attributeFiles
{
# PackageSymLink <packageName> : <symlink path components>
# : <symlink target>
#
local packagename = $(1) ;
local symlinkPath = $(2) ;
local symlinkTarget = $(3) ;
local configSubPath = [ FPackageConfigSubPath $(packagename) ] ;
local symlinkDir = [ FReverse $(symlinkPath) ] ;
local symlink = $(symlinkDir[1]) ;
symlinkDir = [ FReverse $(symlinkDir[2-]) ] ;
local symlinkGrist = [ FGrist _package $(packagename) $(symlinkDir) ] ;
symlink = $(symlink:G=$(symlinkGrist)) ;
if $(symlinkDir[1]) = boot {
local installzip = install.zip ;
local packagefileinstallzip
= $(installzip:G=_package_objects!$(packagename)) ;
local packageobjectdir = [ FDirName $(HAIKU_PACKAGE_OBJECT_DIR)
$(configSubPath) $(packagename) ] ;
symlinkDir = [ FDirName $(packageobjectdir) $(symlinkDir) ] ;
PackageInstallZip $(packagefileinstallzip) : $(symlink) ;
} else {
local packagezip = $(packagename:S=.zip:G=_packages) ;
local packagedir = [ FDirName $(HAIKU_PACKAGE_DIR) $(configSubPath)
$(packagename) ] ;
symlinkDir = [ FDirName $(packagedir) $(symlinkDir) ] ;
Depends $(packagezip) : $(symlink) ;
return [ AddDirectoryToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE)
: $(directoryTokens) : $(attributeFiles) ] ;
}
MakeLocate $(symlink) : $(symlinkDir) ;
SymLink $(symlink) : $(symlinkTarget) : false ;
Clean cleanPackages : $(symlink) ;
}
rule PackageDriverSymLink
rule AddFilesToPackage directory : targets : destName
{
# PackageDriverSymLink <packageName> : <devRelativeSymlinkComponents> ;
# <packageName>: Package name.
# <devRelativeSymlinkComponents>: Path components relative to the
# /boot/home/config/add-ons/kernel/drivers/dev directory, e.g.
# "graphics mga.driver" (no quotation, of course).
#
local packageName = $(1) ;
local symlinkComponents = $(2) ;
# construct the symlink contents
local symlinkPath = [ FReverse $(symlinkComponents) ] ;
symlinkPath = bin $(symlinkPath[1]) ;
for i in $(symlinkComponents) {
symlinkPath = $(DOTDOT) $(symlinkPath) ;
AddFilesToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE) : $(directory)
: $(targets) : $(destName) ;
}
PackageSymLink $(packageName)
: boot home config add-ons kernel drivers dev $(symlinkComponents)
: [ FDirName $(symlinkPath) ] ;
}
rule PackageZip
rule AddSymlinkToPackage directoryTokens : linkTarget : linkName
{
local dir = $(2:G=dir) ;
Depends $(1) : $(dir) $(3) ;
Clean cleanPackages : $(1) ;
PackageZip1 $(1) : $(dir) ;
linkTarget = $(linkTarget:J=/) ;
AddSymlinkToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE)
: $(directoryTokens) : $(linkTarget) : $(linkName) ;
}
actions together PackageZip1 {
cd "$(2:P)" ;
zip -rq "$(1:BS)" "$(2:BS)" ;
}
rule PackageInstallScript
rule CopyDirectoryToPackage directoryTokens : sourceDirectory
: targetDirectoryName : excludePatterns : flags
{
MakeLocate $(1) : $(2) ;
Clean cleanPackages : $(1) ;
PackageInstallScript1 $(1) : $(2:G=dir) ;
CopyDirectoryToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE)
: $(directoryTokens) : $(sourceDirectory) : $(targetDirectoryName)
: $(excludePatterns) : $(flags) ;
}
actions together PackageInstallScript1
rule AddHeaderDirectoryToPackage dirTokens : dirName : flags
{
echo '#!/bin/sh
base=`dirname "$0"`
cd "$base"
if [ -n "$TTY" ]
then
unzip -d / install.zip
else
response=`alert "Would you like to automatically overwrite existing files, or receive a prompt?" "Overwrite" "Prompt"`
if [ $response == "Overwrite" ]
then
unzip -od / install.zip
alert "Finished installing" "Thanks"
else
if [ -e /boot/beos/apps/Terminal ]
then
terminal=/boot/beos/apps/Terminal
else
terminal=`query Terminal | head -1`
fi
$terminal -t "installer" /bin/sh "$0"
fi
fi' > "$(1)" ;
chmod 755 "$(1)" ;
AddHeaderDirectoryToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE)
: $(dirTokens) : $(dirName) : $(flags) ;
}
rule PackageInstallZip
rule AddWifiFirmwareToPackage driver : subDirToExtract : archive
: extract
{
Depends $(1) : $(2) ;
Clean cleanPackages : $(1) ;
AddWifiFirmwareToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE)
: $(driver) : $(subDirToExtract) : $(archive) : $(extract) ;
}
actions together PackageInstallZip
rule ExtractArchiveToPackage dirTokens : archiveFile : flags : extractedSubDir
{
cd "$(1:P)" ;
zip -rqy "$(1:BS)" boot ;
ExtractArchiveToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE)
: $(dirTokens) : $(archiveFile) : $(flags) : $(extractedSubDir) ;
}
rule LinkInstallZip
rule AddDriversToPackage relativeDirectoryTokens : targets
{
Depends $(1) : $(2) ;
Clean cleanPackages : $(1) ;
AddDriversToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE)
: $(relativeDirectoryTokens) : $(targets) ;
}
actions together LinkInstallZip
rule AddNewDriversToPackage relativeDirectoryTokens : targets
{
ln -sf "`pwd`/$(2)" "$(1)" ;
AddNewDriversToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE)
: $(relativeDirectoryTokens) : $(targets) ;
}
rule AddBootModuleSymlinksToPackage targets
{
AddBootModuleSymlinksToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE)
: $(targets) ;
}
rule AddLibrariesToPackage directory : libs
{
AddLibrariesToContainer $(HAIKU_CURRENTLY_BUILT_HAIKU_PACKAGE)
: $(directory) : $(libs) ;
}
# default value for the package compression level
HAIKU_PACKAGE_COMPRESSION_LEVEL ?= 9 ;

View File

@ -1,55 +0,0 @@
DefineBuildProfile alpha-raw : image : "haiku-alpha.image" ;
DefineBuildProfile alpha-vmware : vmware-image : "haiku-alpha.vmdk" ;
DefineBuildProfile alpha-cd : cd-image : "haiku-alpha.iso" ;
DefineBuildProfile alpha-anyboot : anyboot-image
: "haiku-alpha-anyboot.image" ;
DefineBuildProfile nightly-raw : image : "haiku-nightly.image" ;
DefineBuildProfile nightly-vmware : vmware-image : "haiku-nightly.vmdk" ;
DefineBuildProfile nightly-cd : cd-image : "haiku-nightly.iso" ;
DefineBuildProfile nightly-anyboot : anyboot-image
: "haiku-nightly-anyboot.image" ;
switch $(HAIKU_BUILD_PROFILE) {
case "alpha-*" : {
Echo Building Haiku R1/alpha ;
HAIKU_ROOT_USER_NAME = user ;
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 ;
AddOptionalHaikuImagePackages TimGMSoundFont TrackerNewTemplates
WQY-MicroHei ;
AddOptionalHaikuImagePackages BePDF Pe Vision
WebPositive WonderBrush ;
AddOptionalHaikuImagePackages CVS Development Git Mercurial
Python Subversion OpenSSH OpenSSL ;
AddOptionalHaikuImagePackages KeymapSwitcher Nano P7zip Welcome
BeBook XZ-Utils ;
AddOptionalHaikuImagePackages wpa_supplicant ;
}
case "beta-*" : {
Echo You wish. ;
}
case "nightly-*" : {
Echo Building Haiku Nightly ;
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 ;
AddOptionalHaikuImagePackages Pe Nano Vision P7zip XZ-Utils ;
AddOptionalHaikuImagePackages Development Git OpenSSH OpenSSL ;
AddOptionalHaikuImagePackages wpa_supplicant WebPositive ;
}
}
# Uncomment in official release branch.
#HAIKU_DEFINES += HAIKU_OFFICIAL_RELEASE ;
#TARGET_DEFINES += HAIKU_OFFICIAL_RELEASE ;

656
build/jam/RepositoryRules Normal file
View File

@ -0,0 +1,656 @@
#pragma mark - Private
rule PackageFamily packageBaseName
{
return $(packageBaseName:G=package-family) ;
}
rule SetRepositoryMethod repository : methodName : method
{
HAIKU_REPOSITORY_METHOD_$(methodName) on $(repository) = $(method) ;
}
rule InvokeRepositoryMethod repository : methodName : arg1 : arg2 : arg3 : arg4
: arg5 : arg6 : arg7
{
local method
= [ on $(repository) return $(HAIKU_REPOSITORY_METHOD_$(methodName)) ] ;
if ! $(method) {
Exit "Method" $(methodName) " not defined for repository"
$(repository) ;
}
return [ $(method) $(repository) : $(arg1) : $(arg2) : $(arg3) : $(arg4)
: $(arg5) : $(arg6) : $(arg7) ] ;
}
rule AddRepositoryPackage repository : architecture : baseName : version
{
local package = $(baseName)-$(version) ;
package = $(package:E=$(baseName):G=package-in-$(repository:G=)) ;
HAIKU_PACKAGE_REPOSITORY on $(package) = $(repository) ;
HAIKU_PACKAGE_ARCHITECTURE on $(package) = $(architecture) ;
HAIKU_PACKAGE_FILE_NAME on $(package) = $(package:G=)-$(architecture).hpkg ;
local packageFamily = [ InvokeRepositoryMethod $(repository) : PackageFamily
: $(baseName) ] ;
baseName = $(packageFamily:G=) ;
if ! $(baseName) in $(HAIKU_AVAILABLE_PACKAGES) {
HAIKU_AVAILABLE_PACKAGES += $(baseName) ;
}
HAIKU_PACKAGE_VERSIONS on $(packageFamily) += $(package) ;
HAIKU_REPOSITORY_PACKAGES on $(repository) += $(package) ;
return $(package) ;
}
rule AddRepositoryPackages repository : architecture : packages : sourcePackages
: debugInfoPackages
{
local packageTargets ;
local package ;
for package in $(packages) {
local splitName = [ Match "([^-]*)-(.*)" : $(package) ] ;
local baseName = $(splitName[1]:E=$(package)) ;
local version = $(splitName[2]) ;
packageTargets += [ AddRepositoryPackage $(repository) : $(architecture)
: $(baseName) : $(version) ] ;
if $(baseName) in $(sourcePackages) {
AddRepositoryPackage $(repository) : source : $(baseName)_source
: $(version) ;
}
if $(baseName) in $(debugInfoPackages) {
packageTargets += [ AddRepositoryPackage $(repository)
: $(architecture) : $(baseName)_debuginfo : $(version) ] ;
}
}
return $(packageTargets) ;
}
rule PackageRepository repository : architecture : anyPackages : packages
: sourcePackages : debugInfoPackages
{
if $(architecture) != $(HAIKU_PACKAGING_ARCHS[1]) {
return ;
}
HAIKU_REPOSITORIES += $(repository) ;
HAIKU_REPOSITORY_DEFINITION_FILE on $(repository)
= $(HAIKU_REPOSITORY_JAMFILE) ;
return [ AddRepositoryPackages $(repository) : any : $(anyPackages)
: $(sourcePackages) : $(debugInfoPackages) ]
[ AddRepositoryPackages $(repository) : $(architecture) : $(packages)
: $(sourcePackages) : $(debugInfoPackages) ] ;
}
#pragma mark - Remote Repository
rule RemoteRepositoryPackageFamily repository : packageBaseName
{
return [ PackageFamily $(packageBaseName) ] ;
}
rule RemoteRepositoryFetchPackage repository : package : fileName
{
local baseUrl = [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
local packagesChecksumFile
= [ on $(repository)
return $(HAIKU_REPOSITORY_PACKAGES_CHECKSUM_FILE) ] ;
local downloadedFile = [ DownloadFile $(fileName)
: "$(baseUrl)/`cat $source`/packages/$(fileName)"
: $(packagesChecksumFile) ] ;
NoUpdate $(downloadedFile) ;
# Don't download the file again when something in the repository
# changes. It is (supposed to be) still the same file.
return $(downloadedFile) ;
}
rule RemotePackageRepository repository : architecture : repositoryUrl
: anyPackages : packages : sourcePackages : debugInfoPackages
{
repository = $(repository:G=repository) ;
SetRepositoryMethod $(repository) : PackageFamily
: RemoteRepositoryPackageFamily ;
SetRepositoryMethod $(repository) : FetchPackage
: RemoteRepositoryFetchPackage ;
HAIKU_REPOSITORY_URL on $(repository) = $(repositoryUrl) ;
PackageRepository $(repository) : $(architecture) : $(anyPackages)
: $(packages) : $(sourcePackages) : $(debugInfoPackages) ;
# build package list file
local packageListFile = $(repository:G=repository-package-list)-packages ;
local repositoriesDir = $(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture)) ;
MakeLocate $(packageListFile) : $(repositoriesDir) ;
GeneratedRepositoryPackageList $(packageListFile) : $(repository) ;
# build package list checksum file
local packagesChecksumFile
= $(repository:G=repository-package-checksum)-checksum ;
MakeLocate $(packagesChecksumFile) : $(repositoriesDir) ;
Depends $(packagesChecksumFile) : $(packageListFile) ;
ChecksumFileSHA256 $(packagesChecksumFile) : $(packageListFile) ;
# download repository info file
local repositoryInfo = $(repository:G=repository-info)-info ;
MakeLocate $(repositoryInfo) : $(repositoriesDir) ;
local repoUrl = [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
DownloadLocatedFile $(repositoryInfo)
: "$(repoUrl)/`cat $source`/repo.info"
: $(packagesChecksumFile) ;
# download repository file
local repositoryFile = $(repository:G=repository-cache) ;
MakeLocate $(repositoryFile) : $(repositoriesDir) ;
local repoUrl = [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
DownloadLocatedFile $(repositoryFile)
: "$(repoUrl)/`cat $source`/repo"
: $(packagesChecksumFile) ;
# build repository config file
local repositoryConfig = $(repository:G=repository-config)-config ;
MakeLocate $(repositoryConfig) : $(repositoriesDir) ;
RepositoryConfig $(repositoryConfig) : $(repositoryInfo)
: $(packagesChecksumFile) : $(repository) ;
HAIKU_REPOSITORY_CACHE_FILE on $(repository) = $(repositoryFile) ;
HAIKU_REPOSITORY_CONFIG_FILE on $(repository) = $(repositoryConfig) ;
HAIKU_REPOSITORY_PACKAGES_CHECKSUM_FILE on $(repository)
= $(packagesChecksumFile) ;
}
rule GeneratedRepositoryPackageList target : repository
{
repository = $(repository:G=repository) ;
# construct a list of file names
local fileNames ;
local package ;
for package in [ on $(repository) return $(HAIKU_REPOSITORY_PACKAGES) ] {
fileNames += [ on $(package) return $(HAIKU_PACKAGE_FILE_NAME) ] ;
}
local definitionFile
= [ on $(repository) return $(HAIKU_REPOSITORY_DEFINITION_FILE) ] ;
Depends $(target) : $(definitionFile) ;
HAIKU_REPOSITORY_PACKAGE_FILE_NAMES on $(target) = $(fileNames) ;
GeneratedRepositoryPackageList1 $(target) ;
}
actions GeneratedRepositoryPackageList1
{
(for file in $(HAIKU_REPOSITORY_PACKAGE_FILE_NAMES) ; do
echo $file
done) | LC_ALL=C sort -u > $(1)
}
rule RepositoryConfig repoConfig : repoInfo : packagesChecksumFile : repository
{
repository = $(repository:G=repository) ;
HAIKU_REPOSITORY_URL on $(repoConfig)
= [ on $(repository) return $(HAIKU_REPOSITORY_URL) ] ;
Depends $(repoConfig)
: <build>create_repository_config $(repoInfo) $(packagesChecksumFile) ;
RepositoryConfig1 $(repoConfig)
: <build>create_repository_config $(repoInfo) $(packagesChecksumFile) ;
}
actions RepositoryConfig1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) $(HAIKU_REPOSITORY_URL)/`cat $(2[3])` $(2[2]) $(1)
}
#pragma mark - Bootstrap Repository
rule BootstrapRepositoryPackageFamily repository : packageBaseName
{
local splitBaseName = [ Match "(.*)_bootstrap(.*)" : $(packageBaseName) ] ;
if $(splitBaseName) {
packageBaseName = $(splitBaseName[1])$(splitBaseName[2]) ;
}
return [ PackageFamily $(packageBaseName) ] ;
}
rule BootstrapRepositoryFetchPackage repository : package : fileName
{
local outputDir
= [ on $(repository) return $(HAIKU_REPOSITORY_BUILD_DIRECTORY) ] ;
local configFile
= [ on $(repository) return $(HAIKU_REPOSITORY_BUILD_CONFIG_FILE) ] ;
local haikuCrossDevelPackages = [ on $(package)
return $(HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES) ] ;
local packageFile = <cross-built>$(fileName) ;
if [ on $(packageFile) return $(HAIKU_REPOSITORY_BUILD_DIRECTORY) ] {
# rule already called for this package
return $(packageFile) ;
}
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(packageFile) = $(outputDir) ;
MakeLocate $(packageFile) : [ FDirName $(outputDir) packages ] ;
NoUpdate $(packageFile) ;
# Don't rebuild the file. Since the haiku cross devel package is
# a dependency and is updated always, this package would otherwise be
# rebuilt always as well.
Depends $(packageFile) : $(haikuCrossDevelPackages) $(configFile) ;
BootstrapRepositoryFetchPackage1 $(packageFile)
: $(haikuCrossDevelPackages) ;
return $(packageFile) ;
}
actions BootstrapRepositoryFetchPackage1
{
# don't rebuild existing package
package="$(1)"
if [ -e "$package" ]; then
exit 0
fi
# make Haiku cross devel package path absolute
haikuCrossDevelPackage="$(2[1])"
if [[ "$haikuCrossDevelPackage" != /* ]]; then
haikuCrossDevelPackage="`pwd`/$haikuCrossDevelPackage"
fi
# make secondary Haiku cross devel packages path absolute
secondaryCrossDevelPackages=
if [ -n "$(2[2-]:J)" ]; then
for secondaryCrossDevelPackage in "$(2[2-])" ; do
if [[ "$secondaryCrossDevelPackage" != /* ]]; then
secondaryCrossDevelPackage="`pwd`/$secondaryCrossDevelPackage"
fi
if [ -n "$secondaryCrossDevelPackages" ]; then
secondaryCrossDevelPackages="secondaryCrossDevelPackages,$secondaryCrossDevelPackage"
else
secondaryCrossDevelPackages="--secondary-cross-devel-package=$secondaryCrossDevelPackage"
fi
done
fi
# determine the portName
portName=`basename "$package" | sed 's@-.*@@'`
case $portName in
*_devel|*_doc|*_source|*_debuginfo)
portName=`echo $portName | sed 's@_[^_]*$@@'`
;;
*_source_rigged)
portName=`echo $portName | sed 's@_source_rigged$@@'`
;;
esac
cd $(HAIKU_REPOSITORY_BUILD_DIRECTORY)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
if [ -n "$secondaryCrossDevelPackages" ]; then
$(HOST_HAIKU_PORTER) -j$(HAIKU_PORTER_CONCURRENT_JOBS) \
--cross-devel-package "$haikuCrossDevelPackage" \
"$secondaryCrossDevelPackages" $portName
else
$(HOST_HAIKU_PORTER) -j$(HAIKU_PORTER_CONCURRENT_JOBS) \
--cross-devel-package "$haikuCrossDevelPackage" $portName
fi
}
actions BuildBootstrapRepositoryConfig
{
cat > $(1) << EOF
PACKAGER="The Haiku build system <build-system@haiku-os.org>"
TREE_PATH="$(HAIKU_REPOSITORY_TREE_PATH)"
TARGET_ARCHITECTURE="$(HAIKU_PACKAGING_ARCH)"
DOWNLOAD_IN_PORT_DIRECTORY="yes"
PACKAGE_COMMAND="$(2[1])"
MIMESET_COMMAND="$(2[2])"
SYSTEM_MIME_DB="$(2[3])"
LICENSES_DIRECTORY="$(HAIKU_TOP)/data/system/data/licenses"
OUTPUT_DIRECTORY="$(HAIKU_REPOSITORY_BUILD_DIRECTORY)"
EOF
# If we have cross tools, add the cross tools directory.
gcc=$(HAIKU_CC_$(HAIKU_PACKAGING_ARCH))
if [[ "$gcc" = /* ]]; then
if [ `basename $gcc` = \
$(HAIKU_GCC_MACHINE_$(HAIKU_PACKAGING_ARCH))-gcc ]; then
dir=`dirname $gcc`
dir=`dirname $dir`
echo CROSS_TOOLS=\"$dir\" >> $(1)
fi
fi
# Add secondary architectures and cross tools.
secondaryArchs="$(HAIKU_PACKAGING_ARCHS[2-]:E=)"
if [ -n "$secondaryArchs" ]; then
echo SECONDARY_TARGET_ARCHITECTURES=\" >> $(1)
for arch in $secondaryArchs; do
echo " $arch" >> $(1)
done
echo \" >> $(1)
echo SECONDARY_CROSS_TOOLS=\" >> $(1)
for gcc in $(HAIKU_CC_$(HAIKU_PACKAGING_ARCHS[2-])) ; do
dir=`dirname $gcc`
dir=`dirname $dir`
echo " $dir" >> $(1)
done
echo \" >> $(1)
fi
}
rule BootstrapPackageRepository repository : architecture
: anyPackages : packagesStage1 : packagesStage2 : sourcePackages
: debugInfoPackages
{
repository = $(repository:G=repository) ;
packagesStage1 = [ FFilterByBuildFeatures $(packagesStage1) ] ;
packagesStage2 = [ FFilterByBuildFeatures $(packagesStage2) ] ;
sourcePackages = [ FFilterByBuildFeatures $(sourcePackages) ] ;
debugInfoPackages = [ FFilterByBuildFeatures $(debugInfoPackages) ] ;
SetRepositoryMethod $(repository) : PackageFamily
: BootstrapRepositoryPackageFamily ;
SetRepositoryMethod $(repository) : FetchPackage
: BootstrapRepositoryFetchPackage ;
# register repository with stage 1 packages
local stage1PackageTargets = [ PackageRepository $(repository)
: $(architecture) : $(anyPackages) : $(packagesStage1)
: $(sourcePackages) : $(debugInfoPackages) ] ;
if ! $(stage1PackageTargets) {
return ;
}
local crossDevelPackageSuffixes = $(architecture)
$(architecture)_$(HAIKU_PACKAGING_ARCHS[2-]) ;
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage1PackageTargets)
= haiku_cross_devel_sysroot_stage1_$(crossDevelPackageSuffixes).hpkg ;
# add stage 2 packages
local stage2PackageTargets = [ AddRepositoryPackages $(repository)
: $(architecture) : $(packagesStage2) : $(sourcePackages)
: $(debugInfoPackages) ] ;
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage2PackageTargets)
= haiku_cross_devel_sysroot_$(crossDevelPackageSuffixes).hpkg ;
# prepare the config file for the HaikuPorts cross build
local outputDir = [ FDirName
$(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture))
$(repository:G=)-build ] ;
local configFile = haikuports.conf ;
configFile = $(configFile:G=repository-config-$(repository:G=)) ;
MakeLocate $(configFile) : $(outputDir) ;
NoUpdate $(configFile) ;
Depends $(configFile) : <build>package <build>mimeset <mimedb>mime_db ;
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(configFile) = $(outputDir) ;
HAIKU_PACKAGING_ARCH on $(configFile) = $(architecture) ;
HAIKU_REPOSITORY_TREE_PATH on $(configFile) = $(HAIKU_PORTS_CROSS) ;
BuildBootstrapRepositoryConfig $(configFile)
: <build>package <build>mimeset <mimedb>mime_db ;
HAIKU_REPOSITORY_BUILD_CONFIG_FILE on $(repository) = $(configFile) ;
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(repository) = $(outputDir) ;
# Serialize all package file targets. We need to do this, since
# haikuporter uses a common directory for building the ports, so building
# two ports concurrently isn't possible.
local previousPackageFile ;
local package ;
for package in $(stage1PackageTargets) $(stage2PackageTargets) {
local fileName = [ on $(package) return $(HAIKU_PACKAGE_FILE_NAME) ] ;
local packageFile = [ BootstrapRepositoryFetchPackage $(repository)
: $(package) : $(fileName) ] ;
Depends $(packageFile) : $(previousPackageFile) ;
previousPackageFile = $(packageFile) ;
}
}
#pragma mark - Public
rule FSplitPackageName packageName
{
local splitName = [ Match "(.*)_([^_]*)" : $(packageName) ] ;
local knownPackageSuffixes = devel doc source debuginfo ;
if $(splitName[2]) && $(splitName[2]) in $(knownPackageSuffixes) {
return $(splitName) ;
}
return $(packageName) ;
}
rule IsPackageAvailable package : flags
{
# for a secondary architecture adjust the package name
if $(TARGET_PACKAGING_ARCH) != $(TARGET_PACKAGING_ARCHS[1])
&& ! nameResolved in $(flags) {
local splitName = [ FSplitPackageName $(package) ] ;
splitName = $(splitName[1]) $(TARGET_PACKAGING_ARCH) $(splitName[2-]) ;
package = $(splitName:J=_) ;
}
if $(package) in $(HAIKU_AVAILABLE_PACKAGES) {
return $(package) ;
}
return ;
}
rule FetchPackage packageName : flags
{
local foundPackageName = [ IsPackageAvailable $(packageName) : $(flags) ] ;
if ! $(foundPackageName) {
Exit "DownloadPackage: package" $(packageName) "not available!" ;
return ;
}
packageName = $(foundPackageName) ;
# TODO: We should support explicitly specified versions (or partial/minimum
# versions like gcc-2 or gcc-4).
local packageFamily = [ PackageFamily $(packageName) ] ;
local package
= [ on $(packageFamily) return $(HAIKU_PACKAGE_VERSIONS[1]) ] ;
local fileName = [ on $(package) return $(HAIKU_PACKAGE_FILE_NAME) ] ;
local repository = [ on $(package) return $(HAIKU_PACKAGE_REPOSITORY) ] ;
return [ InvokeRepositoryMethod $(repository) : FetchPackage : $(package)
: $(fileName) ] ;
}
rule BuildHaikuPortsSourcePackageDirectory
{
local architecture = $(TARGET_PACKAGING_ARCH) ;
local outputDir = [ FDirName
$(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture))
HaikuPorts-sources-build ] ;
local sourcePackageDir = <HaikuPorts-repository-source-packages>packages ;
MakeLocate $(sourcePackageDir) : $(outputDir) ;
# build the package list file
local packageList
= <repository-package-list-HaikuPorts-sources>package_list ;
MakeLocate $(packageList) : $(outputDir) ;
Depends $(packageList) :
[ FDirName $(HAIKU_BUILD_RULES_DIR) repositories HaikuPorts
$(architecture) ] ;
# Note: Those are packages we need for building on the bootstrap Haiku. They
# are build-pre-requires and as such won't be detected by haikuporter as
# required dependencies when building the source packages.
HAIKU_REPOSITORY_BUILD_ADDITIONAL_PACKAGES on $(packageList) =
htmldoc
texi2html
;
BuildHaikuPortsPackageList $(packageList) ;
# prepare the config file for the HaikuPorts build
local configFile = <repository-config-HaikuPorts-sources>haikuports.conf ;
MakeLocate $(configFile) : $(outputDir) ;
NoUpdate $(configFile) ;
Depends $(configFile) : <build>package <build>mimeset <mimedb>mime_db ;
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(configFile) = $(outputDir) ;
HAIKU_PACKAGING_ARCH on $(configFile) = $(architecture) ;
HAIKU_REPOSITORY_TREE_PATH on $(configFile) = $(HAIKU_PORTS) ;
BuildBootstrapRepositoryConfig $(configFile)
: <build>package <build>mimeset <mimedb>mime_db ;
# get Haiku cross-devel packages and build the sources
local crossDevelPackageSuffixes = $(architecture)
$(architecture)_$(HAIKU_PACKAGING_ARCHS[2-]) ;
local haikuCrossDevelPackages
= haiku_cross_devel_sysroot_stage1_$(crossDevelPackageSuffixes).hpkg ;
HAIKU_REPOSITORY_BUILD_DIRECTORY on $(sourcePackageDir) = $(outputDir) ;
Depends $(sourcePackageDir) : $(packageList) $(haikuCrossDevelPackages)
$(configFile) ;
BuildHaikuPortsSourcePackageDirectory1 $(sourcePackageDir)
: $(packageList) $(haikuCrossDevelPackages) ;
return $(sourcePackageDir) ;
}
actions BuildHaikuPortsPackageList
{
HAIKU_BOOTSTRAP_BUILD= $(JAM:E=jam) @alpha-raw build-package-list $(1) \
$(HAIKU_REPOSITORY_BUILD_ADDITIONAL_PACKAGES)
}
actions BuildHaikuPortsSourcePackageDirectory1
{
packageList="$(2[1])"
# make Haiku cross devel package path absolute
haikuCrossDevelPackage="$(2[2])"
if [[ "$haikuCrossDevelPackage" != /* ]]; then
haikuCrossDevelPackage="`pwd`/$haikuCrossDevelPackage"
fi
# make secondary Haiku cross devel packages path absolute
secondaryCrossDevelPackages=
if [ -n "$(2[3-]:J)" ]; then
for secondaryCrossDevelPackage in "$(2[3-])" ; do
if [[ "$secondaryCrossDevelPackage" != /* ]]; then
secondaryCrossDevelPackage="`pwd`/$secondaryCrossDevelPackage"
fi
if [ -n "$secondaryCrossDevelPackages" ]; then
secondaryCrossDevelPackages="secondaryCrossDevelPackages,$secondaryCrossDevelPackage"
else
secondaryCrossDevelPackages="--secondary-cross-devel-package=$secondaryCrossDevelPackage"
fi
done
fi
cd $(HAIKU_REPOSITORY_BUILD_DIRECTORY)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
if [ -n "$secondaryCrossDevelPackages" ]; then
$(HOST_HAIKU_PORTER) --cross-devel-package "$haikuCrossDevelPackage" \
"$secondaryCrossDevelPackages" \
--create-source-packages-for-bootstrap --portsfile $packageList
else
$(HOST_HAIKU_PORTER) --cross-devel-package "$haikuCrossDevelPackage" \
--create-source-packages-for-bootstrap --portsfile $packageList
fi
}
rule BuildHaikuPortsRepositoryConfig treePath
{
local architecture = $(TARGET_PACKAGING_ARCH) ;
local outputDir = [ FDirName
$(HAIKU_PACKAGE_REPOSITORIES_DIR_$(architecture))
HaikuPorts-bootstrap ] ;
local configFile = <repository-config-HaikuPorts-bootstrap>haikuports.conf ;
MakeLocate $(configFile) : $(outputDir) ;
NoUpdate $(configFile) ;
HAIKU_REPOSITORY_TREE_PATH on $(configFile) = $(treePath) ;
BuildHaikuPortsRepositoryConfig1 $(configFile) ;
return $(configFile) ;
}
actions BuildHaikuPortsRepositoryConfig1
{
cat > $(1) << EOF
PACKAGER="The Haiku build system <build-system@haiku-os.org>"
TREE_PATH="$(HAIKU_REPOSITORY_TREE_PATH)"
TARGET_ARCHITECTURE="$(HAIKU_PACKAGING_ARCH)"
EOF
}
rule BuildRemoteHaikuPortsRepository target : packages
{
local packageListFile = <repository-package-list>HaikuPorts-packages ;
Depends $(target) : $(packageListFile) ;
HAIKU_REMOTE_REPOSITORY_PACKAGES on $(target) = $(packages) ;
BuildRemoteHaikuPortsRepository1 $(target) : $(packageListFile) ;
}
actions BuildRemoteHaikuPortsRepository1
{
remote=haiku_files@haiku-files.org
if [ -n "$(HAIKU_REMOTE_REPOSITORY_PACKAGES:E=:J)" ]; then
for package in $(HAIKU_REMOTE_REPOSITORY_PACKAGES) ; do
file=`basename $package`
if ! grep -q $file $(2); then
echo "Error: $file is not being referenced in $(2)"
exit 1
fi
done
scp $(HAIKU_REMOTE_REPOSITORY_PACKAGES) \
$remote:haiku-files.org/files/hpkg/
fi
packageList=package-list.$(TARGET_PACKAGING_ARCH)
scp $(2) $remote:build_repository/$packageList
ssh $remote \
"cd build_repository \
&& ./build_repo.sh $(TARGET_PACKAGING_ARCH) $packageList"
}

View File

@ -20,7 +20,7 @@ Exit You must NOT copy UserBuildConfig.ReadMe directly but use parts of it! ;
# CCFLAGS C++FLAGS DEBUG DEFINES HDRS LINKFLAGS OPTIM OPTIMIZE SYSHDRS
# WARNINGS
# HOST_WARNING_CCFLAGS HOST_WARNING_C++FLAGS
# TARGET_WARNING_CCFLAGS TARGET_WARNING_C++FLAGS
# TARGET_WARNING_CCFLAGS_<packageArch> TARGET_WARNING_C++FLAGS_<packageArch>
# PLATFORM SUPPORTED_PLATFORMS
#
# The following examples would work analogously for any of these variables.
@ -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 ;
@ -79,6 +75,18 @@ HAIKU_INSTALL_DIR = /Haiku ;
# freshly be initialized with BFS. Useful when installing Haiku on a partition.
HAIKU_DONT_CLEAR_IMAGE = 1 ;
# Set the compression level for the creation and update of Haiku packages to 1.
# Values from 0 to 9 are supported. 0 means no compression, 1 fastest, ..., and
# 9 best. The default is 9 which should be used for official builds (release or
# nightly) to achieve the smallest possible package files at the cost of long
# package building times. For developers who frequently rebuild/update packages
# level 1 is a good compromise. Depending on the package data it's about an
# order of magnitude faster while still achieving acceptable compression ratios.
# Using level 0 will make package creation mostly I/O bound. It can be used, if
# package size is not a concern. Depending on the package data, files may be
# several times larger than even with level 1.
HAIKU_PACKAGE_COMPRESSION_LEVEL = 1 ;
# Affects the haiku-image, haiku-vmware-image, and install-haiku targets. Only
# targets on which the HAIKU_INCLUDE_IN_IMAGE variable has been set will be
@ -109,7 +117,7 @@ AddFilesToHaikuImage home config settings : <keymap>US-International : Key_map ;
# Note that the second directory will also be copied, if the image will only
# be updated; the first one won't in that case.
AddSourceDirectoryToHaikuImage src/kits/storage ;
AddSourceDirectoryToHaikuImage src/tests/servers/debug : 1 ;
AddSourceDirectoryToHaikuImage src/tests/servers/debug : alwaysUpdate ;
# Copy the jam sources (assuming they are located ../buildtools/jam relatively
# to your Haiku sources) to the image as /boot/home/Desktop/jam-src, excluding
@ -138,14 +146,6 @@ AddOptionalHaikuImagePackages WonderBrush ;
AddOptionalHaikuImagePackages WebPositive ;
SuppressOptionalHaikuImagePackages SQLite ;
# Don't add the libraries built with the alternative gcc version.
# If the alternative gcc generated directory has been specified via the
# configure option --alternative-gcc-output-dir, the libraries for the
# alternative gcc version are added by default. Unsetting this variable disables
# building and adding the libraries. Ignored, if --alternative-gcc-output-dir
# was not specified.
HAIKU_ADD_ALTERNATIVE_GCC_LIBS = 0 ;
# Specify scripts that shall be run when populating the image/installation
# directory. The "early" script is run before anything has been copied onto
# the image/into the installation directory. The "late" script is run after

View File

@ -28,9 +28,6 @@
# Add the optional package WonderBrush to the image.
#AddOptionalHaikuImagePackages WonderBrush ;
# Don't add the libraries built with the alternative gcc version.
#HAIKU_ADD_ALTERNATIVE_GCC_LIBS = 0 ;
# Add an example optional gfx driver and its accelerant.
# (Drivers just have a special rule because of the need for the symlink in dev/)
#AddDriversToHaikuImage graphics : optional_driver ;

View File

@ -64,7 +64,7 @@ HAIKU_BOARD_SDIMAGE_FILES =
HAIKU_KERNEL_CCFLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
HAIKU_KERNEL_C++FLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
HAIKU_CCFLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
HAIKU_C++FLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
HAIKU_CCFLAGS_$(HAIKU_PACKAGING_ARCH)
+= -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
HAIKU_C++FLAGS_$(HAIKU_PACKAGING_ARCH)
+= -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;

View File

@ -71,15 +71,15 @@ HAIKU_BOARD_SDIMAGE_FILES =
HAIKU_KERNEL_CCFLAGS += -mcpu=arm920t ;
HAIKU_KERNEL_C++FLAGS += -mcpu=arm920t ;
HAIKU_CCFLAGS += -mcpu=arm920t ;
HAIKU_C++FLAGS += -mcpu=arm920t ;
HAIKU_CCFLAGS_$(HAIKU_PACKAGING_ARCH) += -mcpu=arm920t ;
HAIKU_C++FLAGS_$(HAIKU_PACKAGING_ARCH) += -mcpu=arm920t ;
# Workaround for ld using 32k for alignment despite forcing it in the config...
# should definitely not be needed!
HAIKU_KERNEL_LINKFLAGS +=
-Wl,-z -Wl,max-page-size=0x1000
-Wl,-z -Wl,common-page-size=0x1000 ;
HAIKU_LINKFLAGS +=
HAIKU_LINKFLAGS_$(HAIKU_PACKAGING_ARCH) +=
-Wl,-z -Wl,max-page-size=0x1000
-Wl,-z -Wl,common-page-size=0x1000 ;

View File

@ -60,7 +60,7 @@ HAIKU_BOARD_SDIMAGE_FILES =
HAIKU_KERNEL_CCFLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
HAIKU_KERNEL_C++FLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
HAIKU_CCFLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
HAIKU_C++FLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
HAIKU_CCFLAGS_$(HAIKU_PACKAGING_ARCH)
+= -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
HAIKU_C++FLAGS_$(HAIKU_PACKAGING_ARCH)
+= -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;

View File

@ -48,15 +48,15 @@ HAIKU_BOARD_SDIMAGE_SIZE = 256 ;
HAIKU_KERNEL_CCFLAGS += -mtune=arm1176jzf-s ;
HAIKU_KERNEL_C++FLAGS += -mtune=arm1176jzf-s ;
HAIKU_CCFLAGS += -mtune=arm1176jzf-s ;
HAIKU_C++FLAGS += -mtune=arm1176jzf-s ;
HAIKU_CCFLAGS_$(HAIKU_PACKAGING_ARCH) += -mtune=arm1176jzf-s ;
HAIKU_C++FLAGS_$(HAIKU_PACKAGING_ARCH) += -mtune=arm1176jzf-s ;
# Workaround for ld using 32k for alignment despite forcing it in the config...
# should definitely not be needed!
HAIKU_KERNEL_LINKFLAGS +=
-Wl,-z -Wl,max-page-size=0x1000
-Wl,-z -Wl,common-page-size=0x1000 ;
HAIKU_LINKFLAGS +=
HAIKU_LINKFLAGS_$(HAIKU_PACKAGING_ARCH) +=
-Wl,-z -Wl,max-page-size=0x1000
-Wl,-z -Wl,common-page-size=0x1000 ;

View File

@ -79,7 +79,6 @@ TARGET_ASFLAGS += -mcpu=xscale -D__XSCALE__ ;
HAIKU_KERNEL_LINKFLAGS +=
-Wl,-z -Wl,max-page-size=0x1000
-Wl,-z -Wl,common-page-size=0x1000 ;
HAIKU_LINKFLAGS +=
HAIKU_LINKFLAGS_$(HAIKU_PACKAGING_ARCH) +=
-Wl,-z -Wl,max-page-size=0x1000
-Wl,-z -Wl,common-page-size=0x1000 ;

View File

@ -29,7 +29,9 @@ SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
acpi@x86 ata@ata config_manager dpc pci
ide@ide isa@x86 scsi $(USB_ONLY)usb
] ;
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ;
SYSTEM_ADD_ONS_FILE_SYSTEMS =
attribute_overlay bfs iso9660 packagefs write_overlay
;
if $(TARGET_ARCH) = x86_64 {
@ -106,7 +108,8 @@ if $(TARGET_ARCH) = x86_64 {
}
# kernel
AddFilesToFloppyBootArchive system : <revisioned>kernel_$(TARGET_ARCH) ;
AddFilesToFloppyBootArchive system
: <revisioned>kernel_$(TARGET_ARCH) ;
# scripts and data files
@ -120,13 +123,17 @@ if $(NET_BOOT) = 1 {
# add-ons
AddFilesToFloppyBootArchive system add-ons kernel network
: stack socket ;
AddFilesToFloppyBootArchive system add-ons kernel network devices
AddFilesToFloppyBootArchive
system add-ons kernel network devices
: $(SYSTEM_NETWORK_DEVICES) ;
AddFilesToFloppyBootArchive system add-ons kernel network datalink_protocols
AddFilesToFloppyBootArchive
system add-ons kernel network datalink_protocols
: $(SYSTEM_NETWORK_DATALINK_PROTOCOLS) ;
AddFilesToFloppyBootArchive system add-ons kernel network ppp
AddFilesToFloppyBootArchive
system add-ons kernel network ppp
: $(SYSTEM_NETWORK_PPP) ;
AddFilesToFloppyBootArchive system add-ons kernel network protocols
AddFilesToFloppyBootArchive
system add-ons kernel network protocols
: $(SYSTEM_NETWORK_PROTOCOLS) ;
}

View File

@ -8,13 +8,6 @@ HAIKU_CD = $(HAIKU_CD_NAME) ;
HAIKU_CD_LABEL ?= $(HAIKU_DEFAULT_CD_LABEL) ;
MakeLocate $(HAIKU_CD) : $(HAIKU_CD_DIR) ;
# Detect a hybrid GCC2/GCC4 image.
local isHybridBuild ;
if $(HAIKU_ADD_ALTERNATIVE_GCC_LIBS) = 1
&& $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR) {
isHybridBuild = 1 ;
}
# prepare the script that initializes the shell variables
HAIKU_CD_INIT_VARIABLES_SCRIPT = <HaikuCD>haiku.cd-init-vars ;
local script = $(HAIKU_CD_INIT_VARIABLES_SCRIPT) ;
@ -34,16 +27,14 @@ 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 {
AddVariableToScript $(script) : rmAttrs : rm ;
}
if $(optionalPackageDescriptions) {
AddTargetVariableToScript $(script) : $(optionalPackageDescriptions)
: optionalPackageDescriptions ;
}
AddPackagesAndRepositoryVariablesToContainerScript $(script)
: $(HAIKU_IMAGE_CONTAINER_NAME) ;
# Convenience wrapper rule around BuildHaikuCD.
rule _BuildHaikuCD haikuCD : bootFloppy

341
build/jam/images/HaikuImage Normal file
View File

@ -0,0 +1,341 @@
# 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).
SYSTEM_BIN = [ FFilterByBuildFeatures
"["
addattr alert arp
base64 basename bash bc beep bfsinfo
cal cat catattr checkfs checkitout chgrp chmod chop chown chroot cksum clear
clockconfig cmp collectcatkeys comm compress copyattr CortexAddOnHost cp
csplit cut date dc dd desklink df diff diff3 dircolors dirname
diskimage draggers driveinfo dstcheck du dumpcatalog
echo eject env error expand expr
factor false fdinfo ffm filepanel find finddir FirstBootPrompt fmt fold
fortune frcode ftp ftpd funzip fwcontrol
gawk gdb@x86 getlimits groupadd groupdel groupmod groups gzip gzexe
hd head hey hostname
id ident ifconfig <bin>install installsound iroster isvolume
ideinfo@ide idestatus@ide
join kernel_debugger keymap keystore kill
less lessecho lesskey link linkcatkeys listarea listattr listimage listdev
listport listres listsem listusb ln locale locate logger login logname ls
lsindex
mail2mbox makebootable mbox2mail md5sum merge message mimeset mkdos mkdir
mkfifo mkfs mkindex mktemp modifiers mount mount_nfs mountvolume mv
netcat netstat nl nohup notify nproc
od open
package package_repo passwd paste patch pathchk pc ping ping6 pkgman play
playfile playsound playwav pr prio printenv printf profile ps ptx pwd
query quit
rc readlink reindex release renice rlog rm rmattr rmindex rmdir roster
route
safemode screen_blanker screenmode screenshot sdiff setdecor setmime settype
setversion setvolume seq sha1sum sha256sum shar shred shuf shutdown sleep
sort spamdbm split stat strace stty su sum sync sysinfo
tac tail tcpdump tcptester tee telnet telnetd test timeout top touch
tr traceroute translate trash true truncate tsort tty
uname unchop unexpand unmount uniq unlink unshar unzip unzipsfx
<bin>updatedb uptime urlwrapper useradd userdel uudecode uuencode
vdir version vmstat
waitfor watch wc wget whoami writembr@x86 xargs xres
yes
zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew
] ;
SYSTEM_APPS = [ FFilterByBuildFeatures
AboutSystem ActivityMonitor BootManager@x86 CDPlayer CharacterMap
CodyCam Debugger DeskCalc Devices DiskProbe DiskUsage DriveSetup
Expander GLInfo@x86 HaikuDepot Icon-O-Matic Installer LaunchBox Magnify Mail
MediaConverter MediaPlayer MidiPlayer NetworkStatus PackageInstaller People
PoorMan PowerStatus ProcessController Screenshot ShowImage SoundRecorder
StyledEdit Terminal TextSearch TV WebWatch Workspaces
] ;
SYSTEM_PREFERENCES = [ FFilterByBuildFeatures
Appearance Backgrounds CPUFrequency DataTranslations
<preference>Deskbar E-mail FileTypes Keyboard Keymap Locale Media
Mouse Network Notifications Printers Screen ScreenSaver
Shortcuts Sounds Time Touchpad <preference>Tracker VirtualMemory
] ;
SYSTEM_DEMOS = [ FFilterByBuildFeatures
BSnow Chart Clock Cortex FontDemo GLTeapot@x86
$(HAIKU_INCLUDE_TRADEMARKS)Haiku3d@x86 Mandelbrot OverlayImage Pairs
PatchBay Playground Pulse Sudoku
] ;
rule HaikuImageGetSystemLibs
{
return
# libs with special grist
[ MultiArchDefaultGristFiles libroot.so : revisioned ]
$(HAIKU_SHARED_LIBSTDC++_$(TARGET_PACKAGING_ARCH))
$(HAIKU_SHARED_LIBSUPC++_$(TARGET_PACKAGING_ARCH))
# libs with standard grist
[ MultiArchDefaultGristFiles [ FFilterByBuildFeatures
libbe.so libbsd.so libbnetapi.so
libdebug.so libdevice.so
libgame.so libGL.so@x86 libglut.so@x86
libgnu.so libmail.so libmedia.so libmidi.so libmidi2.so
libnetwork.so
libpackage.so
libscreensaver.so
libtextencoding.so libtiff.so libtracker.so libtranslation.so
] ]
;
}
rule HaikuImageGetPrivateSystemLibs
{
return [ MultiArchDefaultGristFiles [ FFilterByBuildFeatures
libalm.so
libfluidsynth.so
libilmimf.so
libpackage-add-on-libsolv.so
libroot-addon-icu.so
] ] ;
}
SYSTEM_SERVERS = [ FFilterByBuildFeatures
app_server cddb_daemon debug_server dns_resolver_server input_server
keystore_server mail_daemon media_addon_server media_server midi_server
mount_server net_server nfs4_idmapper_server notification_server
package_daemon power_daemon print_server print_addon_server registrar
syslog_daemon
] ;
SYSTEM_NETWORK_DEVICES = ethernet loopback ;
SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame
ipv6_datagram ;
#SYSTEM_NETWORK_PPP = ipcp modem pap pppoe ;
SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix icmp6 ipv6 ;
SYSTEM_ADD_ONS_ACCELERANTS = [ FFilterByBuildFeatures
x86,x86_64 @{
vesa.accelerant intel_extreme.accelerant
}@ # x86,x86_64
x86 @{
3dfx.accelerant ati.accelerant matrox.accelerant neomagic.accelerant
nvidia.accelerant intel_810.accelerant
radeon.accelerant radeon_hd.accelerant s3.accelerant
#via.accelerant vmware.accelerant
}@ # x86
] ;
SYSTEM_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator
HVIFTranslator ICOTranslator JPEGTranslator JPEG2000Translator
PCXTranslator PNGTranslator PPMTranslator
RAWTranslator RTFTranslator SGITranslator STXTTranslator TGATranslator
TIFFTranslator WebPTranslator WonderBrushTranslator ICNSTranslator
;
SYSTEM_ADD_ONS_LOCALE_CATALOGS = <catalog-addon>plaintext ;
SYSTEM_ADD_ONS_MEDIA = [ FFilterByBuildFeatures
cortex_audioadapter.media_addon
cortex_flanger.media_addon
dvb.media_addon@x86
hmulti_audio.media_addon
mixer.media_addon
opensound.media_addon
tone_producer_demo.media_addon
usb_webcam.media_addon
video_producer_demo.media_addon
video_window_demo.media_addon
firewire_dv.media_addon@x86
#legacy.media_addon
equalizer.media_addon
vst_host.media_addon
] ;
SYSTEM_ADD_ONS_MEDIA_PLUGINS = [ FFilterByBuildFeatures
ffmpeg@ffmpeg raw_decoder
] ;
SYSTEM_ADD_ONS_PRINT =
Canon\ LIPS3\ Compatible
Canon\ LIPS4\ Compatible
Gutenprint
PCL5\ Compatible
PCL6\ Compatible
PDF\ Writer
PS\ Compatible
Preview
;
SYSTEM_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR
# Parallel\ Port
Print\ To\ File Serial\ Port USB\ Port
;
SYSTEM_ADD_ONS_SCREENSAVERS = [ FFilterByBuildFeatures
Butterfly DebugNow Flurry@x86
GLife@x86 $(HAIKU_INCLUDE_TRADEMARKS)Haiku Icons IFS Leaves
Message Spider Gravity@x86
] ;
SYSTEM_ADD_ONS_DRIVERS_AUDIO = auich auvia echo3g emuxki hda ice1712 sis7018 ;
SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD = ; #cmedia usb_audio ;
SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = [ FFilterByBuildFeatures
x86,x86_64 @{
vesa intel_extreme
}@ # x86,x86_64
x86 @{
ati 3dfx intel_810 matrox neomagic nvidia radeon radeon_hd
s3 #via vmware
}@ # x86
] ;
SYSTEM_ADD_ONS_DRIVERS_MIDI = emuxki ice1712 usb_midi ;
SYSTEM_ADD_ONS_DRIVERS_NET = [ FFilterByBuildFeatures
x86,x86_64 @{
3com atheros813x ar81xx attansic_l1 attansic_l2 broadcom440x
broadcom570x dec21xxx ipro100 ipro1000 jmicron2x0 marvell_yukon nforce
pcnet rtl8139 rtl81xx sis19x syskonnect via_rhine vt612x
}@ # x86_64
etherpci pegasus sis900 usb_davicom usb_asix usb_ecm wb840
# WLAN drivers
x86 @{
aironetwifi atheroswifi broadcom43xx
iprowifi2100 iprowifi2200 iprowifi3945
iprowifi4965 marvell88w8363 marvell88w8335
ralinkwifi wavelanwifi
}@ # x86
# WWAN drivers
#usb_beceemwmx@gpl
] ;
SYSTEM_ADD_ONS_DRIVERS_POWER = [ FFilterByBuildFeatures acpi_button@x86 ] ;
SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
ata@ata pci ps2@x86,x86_64 isa@x86,x86_64
ide@ide scsi config_manager agp_gart@x86,x86_64 usb firewire@x86 acpi@x86
virtio random
] ;
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs bindfs btrfs cdda exfat ext2 fat iso9660 nfs
nfs4 attribute_overlay write_overlay ntfs packagefs reiserfs@x86 udf
googlefs ;
# build the haiku system packages and add them
include [ FDirName $(HAIKU_BUILD_RULES_DIR) HaikuPackages ] ;
AddPackageFilesToHaikuImage system :
haiku.hpkg
haiku_$(TARGET_PACKAGING_ARCHS[2-]).hpkg
;
AddPackageFilesToHaikuImage system : haiku_loader.hpkg ;
AddSymlinkToHaikuImage home Desktop : /boot/home : Home ;
# Mailbox folders and symlink
AddDirectoryToHaikuImage home mail draft ;
AddDirectoryToHaikuImage home mail in ;
AddDirectoryToHaikuImage home mail out ;
# global settings when a package is installed in ~/config
AddDirectoryToHaikuImage home config settings global ;
# scripts and data files
local userBootScripts = UserBootscript UserSetupEnvironment.sample ;
SEARCH on $(userBootScripts) = [ FDirName $(HAIKU_TOP) data config boot ] ;
AddFilesToHaikuImage home config settings boot : $(userBootScripts) ;
# Add boot launch directory
AddDirectoryToHaikuImage home config settings boot launch ;
# Add mail provider infos.
AddFilesToHaikuImage home config settings Mail ProviderInfo :
$(HAIKU_PROVIDER_INFOS) ;
# Add Tracker New Templates
AddFilesToHaikuImage home config settings Tracker "Tracker New Templates"
:
"<tracker-new-templates>C++ header"
"<tracker-new-templates>C++ source"
"<tracker-new-templates>makefile"
"<tracker-new-templates>text file"
;
local etcDir = [ FDirName $(HAIKU_TOP) data etc ] ;
local etcFiles = inputrc profile ;
etcFiles = $(etcFiles:G=etc) ;
SEARCH on $(etcFiles) = $(etcDir) ;
etcFiles += <etc>termcap <etc>sysless <etc>sysless.in ;
AddFilesToHaikuImage common settings etc : $(etcFiles) ;
local profileFiles = [ Glob $(etcDir)/profile.d : *.sh ] ;
profileFiles = $(profileFiles:G=profile-d) ;
AddDirectoryToHaikuImage common settings etc profile.d ;
AddFilesToHaikuImage common settings etc profile.d : $(profileFiles) ;
#local bashCompletionFiles = [ Glob $(etcDir)/bash_completion.d : * ] ;
#local bashCompletionHelperFiles
# = [ Glob $(etcDir)/bash_completion.d/helpers : * ] ;
#bashCompletionFiles = $(bashCompletionFiles:G=bash-completion) ;
#bashCompletionHelperFiles = $(bashCompletionHelperFiles:G=bash-completion-hlp) ;
#AddDirectoryToHaikuImage common etc bash_completion.d ;
#AddDirectoryToHaikuImage common etc bash_completion.d helpers ;
#AddFilesToHaikuImage common etc bash_completion.d : $(bashCompletionFiles) ;
#AddFilesToHaikuImage common etc bash_completion.d helpers
# : $(bashCompletionHelperFiles) ;
local driverSettingsFiles = <driver-settings>kernel ;
SEARCH on $(driverSettingsFiles)
= [ FDirName $(HAIKU_TOP) data settings kernel drivers ] ;
AddFilesToHaikuImage home config settings kernel drivers
: $(driverSettingsFiles) ;
local networkSettingsFiles = <network-settings>services ;
SEARCH on $(networkSettingsFiles)
= [ FDirName $(HAIKU_TOP) data settings network ] ;
AddFilesToHaikuImage common settings network : $(networkSettingsFiles) ;
# fresh install indicator file for the post install scripts
SEARCH on <post-install>fresh_install
= [ FDirName $(HAIKU_TOP) data common settings ] ;
AddFilesToHaikuImage common settings : <post-install>fresh_install ;
# decorators
AddDirectoryToHaikuImage home config non-packaged add-ons decorators ;
#AddFilesToHaikuImage home config add-ons decorators : ;
# create directories that will remain empty
AddDirectoryToHaikuImage common cache tmp ;
AddDirectoryToHaikuImage common non-packaged ;
AddDirectoryToHaikuImage common var empty ;
AddDirectoryToHaikuImage common var log ;
AddDirectoryToHaikuImage home Desktop ;
AddDirectoryToHaikuImage home mail ;
AddDirectoryToHaikuImage home config packages ;
AddDirectoryToHaikuImage home config non-packaged bin ;
AddDirectoryToHaikuImage home config non-packaged lib ;
AddDirectoryToHaikuImage home config non-packaged add-ons kernel drivers bin ;
AddDirectoryToHaikuImage home config non-packaged add-ons kernel drivers dev ;
AddDirectoryToHaikuImage home config non-packaged add-ons input_server devices ;
AddDirectoryToHaikuImage home config non-packaged add-ons input_server filters ;
AddDirectoryToHaikuImage home config non-packaged add-ons input_server methods ;
AddDirectoryToHaikuImage home config non-packaged add-ons media plugins ;
AddDirectoryToHaikuImage home config non-packaged add-ons Tracker ;
AddDirectoryToHaikuImage home config non-packaged add-ons Print ;
AddDirectoryToHaikuImage home config non-packaged add-ons Screen\ Savers ;
AddDirectoryToHaikuImage home config non-packaged add-ons Translators ;
# printers
AddDirectoryToHaikuImage home config settings printers Preview
: home-config-settings-printers-preview.rdef ;
AddDirectoryToHaikuImage home config settings printers "Save as PDF"
: home-config-settings-printers-save-as-pdf.rdef ;
# dvb channel settings
CopyDirectoryToHaikuImage home config settings Media
: [ FDirName $(HAIKU_TOP) data settings media dvb ]
: dvb : -x Jamfile ;
# repository config files
local repository ;
for repository in $(HAIKU_REPOSITORIES) {
AddFilesToHaikuImage common settings package-repositories
: [ on $(repository) return $(HAIKU_REPOSITORY_CONFIG_FILE) ]
: $(repository:G=) ;
}
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuImageCommon ] ;

View File

@ -0,0 +1,263 @@
# This file defines what ends up on the Haiku bootstrap image (respectively in
# the Haiku installation directory) and it executes the rules building the image
# (respectively installing the files in the installation directory).
SYSTEM_BIN = [ FFilterByBuildFeatures
"["
addattr alert arp
base64 basename bash bc beep bfsinfo
cal cat catattr checkfs checkitout chgrp chmod chop chown chroot cksum clear
clockconfig cmp collectcatkeys comm compress copyattr CortexAddOnHost cp
csplit cut date dc dd desklink df diff diff3 dircolors dirname
diskimage draggers driveinfo dstcheck du dumpcatalog
echo eject env error expand expr
factor false fdinfo ffm filepanel find finddir fmt fold
fortune frcode ftp ftpd funzip
gawk gdb@x86 getlimits groupadd groupdel groupmod groups gzip gzexe
hd head hey hostname
id ident ifconfig <bin>install isvolume
ideinfo@ide idestatus@ide
join kernel_debugger keymap keystore kill
less lessecho lesskey link linkcatkeys listarea listattr listimage listdev
listport listres listsem listusb ln locale locate logger login logname ls
lsindex
makebootable md5sum merge message mimeset mkdir
mkfifo mkfs mkindex mktemp modifiers mount mountvolume mv
netcat netstat nl nohup notify nproc
od open
package package_repo passwd paste patch pathchk pc ping ping6 pkgman
pr prio printenv printf profile ps ptx pwd
query quit
rc readlink reindex release renice rlog rm rmattr rmindex rmdir roster
route
safemode screen_blanker screenmode sdiff setmime settype
setversion setvolume seq sha1sum sha256sum shar shred shuf shutdown sleep
sort split stat strace stty su sum sync sysinfo
tac tail tcpdump tcptester tee telnet telnetd test timeout top touch
tr traceroute trash true truncate tsort tty
uname unchop unexpand unmount uniq unlink unshar unzip unzipsfx
<bin>updatedb uptime urlwrapper useradd userdel uudecode uuencode
vdir version vmstat
waitfor watch wc wget whoami writembr@x86 xargs xres
yes
zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew
] ;
SYSTEM_APPS = [ FFilterByBuildFeatures
AboutSystem ActivityMonitor BootManager@x86 CharacterMap
DeskCalc Debugger Devices DiskProbe DiskUsage DriveSetup
Expander Installer LaunchBox
NetworkStatus PackageInstaller
PowerStatus ProcessController ShowImage
StyledEdit Terminal TextSearch Workspaces
] ;
SYSTEM_PREFERENCES = [ FFilterByBuildFeatures
Appearance Backgrounds CPUFrequency
<preference>Deskbar FileTypes Keyboard Keymap Locale
Mouse Network Notifications Screen ScreenSaver
Shortcuts Time Touchpad <preference>Tracker VirtualMemory
] ;
SYSTEM_DEMOS = ;
rule HaikuImageGetSystemLibs
{
return
# libs with special grist
[ MultiArchDefaultGristFiles libroot.so : revisioned ]
$(HAIKU_SHARED_LIBSTDC++_$(TARGET_PACKAGING_ARCH))
$(HAIKU_SHARED_LIBSUPC++_$(TARGET_PACKAGING_ARCH))
# libs with standard grist
[ MultiArchDefaultGristFiles [ FFilterByBuildFeatures
libbe.so libbsd.so libbnetapi.so
libdebug.so libdevice.so
libgame.so
libgnu.so libmail.so libmedia.so libmidi.so libmidi2.so
libnetwork.so
libpackage.so
libscreensaver.so
libtextencoding.so libtracker.so libtranslation.so
] ]
;
}
rule HaikuImageGetPrivateSystemLibs
{
return [ MultiArchDefaultGristFiles [ FFilterByBuildFeatures
libalm.so
libfluidsynth.so
# libilmimf.so
libpackage-add-on-libsolv.so
libroot-addon-icu.so
] ] ;
}
SYSTEM_SERVERS = [ FFilterByBuildFeatures
app_server debug_server dns_resolver_server input_server
keystore_server media_addon_server
mount_server net_server notification_server
package_daemon power_daemon registrar
syslog_daemon
] ;
SYSTEM_NETWORK_DEVICES = ethernet loopback ;
SYSTEM_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame
ipv6_datagram ;
#SYSTEM_NETWORK_PPP = ipcp modem pap pppoe ;
SYSTEM_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix icmp6 ipv6 ;
SYSTEM_ADD_ONS_ACCELERANTS = [ FFilterByBuildFeatures
x86,x86_64 @{
vesa.accelerant
}@ # x86,x86_64
x86 @{
3dfx.accelerant ati.accelerant matrox.accelerant neomagic.accelerant
nvidia.accelerant intel_810.accelerant intel_extreme.accelerant
radeon.accelerant radeon_hd.accelerant s3.accelerant
#via.accelerant vmware.accelerant
}@ # x86
] ;
SYSTEM_ADD_ONS_TRANSLATORS = STXTTranslator ;
SYSTEM_ADD_ONS_LOCALE_CATALOGS = <catalog-addon>plaintext ;
SYSTEM_ADD_ONS_MEDIA = ;
SYSTEM_ADD_ONS_MEDIA_PLUGINS = ;
SYSTEM_ADD_ONS_PRINT = ;
SYSTEM_ADD_ONS_PRINT_TRANSPORT = ;
SYSTEM_ADD_ONS_SCREENSAVERS = ;
SYSTEM_ADD_ONS_DRIVERS_AUDIO = ;
SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD = ;
SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = [ FFilterByBuildFeatures
x86,x86_64 @{
vesa
}@ # x86,x86_64
x86 @{
ati 3dfx intel_810 intel_extreme matrox neomagic nvidia radeon radeon_hd
s3 #via vmware
}@ # x86
] ;
SYSTEM_ADD_ONS_DRIVERS_MIDI = ;
SYSTEM_ADD_ONS_DRIVERS_NET = [ FFilterByBuildFeatures
x86,x86_64 @{
3com atheros813x ar81xx attansic_l1 attansic_l2 broadcom440x
broadcom570x dec21xxx ipro100 ipro1000 jmicron2x0 marvell_yukon nforce
pcnet rtl8139 rtl81xx sis19x syskonnect via_rhine vt612x
}@ # x86_64
etherpci pegasus sis900 usb_davicom usb_asix usb_ecm wb840
# WLAN drivers
x86 @{
aironetwifi atheroswifi broadcom43xx
iprowifi2100 iprowifi2200 iprowifi3945
iprowifi4965 marvell88w8363 marvell88w8335
ralinkwifi wavelanwifi
}@ # x86
# WWAN drivers
#usb_beceemwmx@gpl
] ;
SYSTEM_ADD_ONS_DRIVERS_POWER = [ FFilterByBuildFeatures acpi_button@x86 ] ;
SYSTEM_ADD_ONS_BUS_MANAGERS = [ FFilterByBuildFeatures
ata@ata pci ps2@x86,x86_64 isa@x86,x86_64
ide@ide scsi config_manager agp_gart@x86 usb firewire@x86 acpi@x86
virtio
] ;
SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs bindfs btrfs exfat ext2 fat iso9660
attribute_overlay write_overlay ntfs packagefs reiserfs@x86 udf ;
# build the haiku system packages and add them
include [ FDirName $(HAIKU_BUILD_RULES_DIR) HaikuPackages ] ;
AddPackageFilesToHaikuImage system :
haiku.hpkg
haiku_$(TARGET_PACKAGING_ARCHS[2-]).hpkg
;
AddPackageFilesToHaikuImage system : haiku_loader.hpkg ;
# build and add the source package directory and a haikuports.config file
CopyDirectoryToHaikuImage home haikuports
: [ BuildHaikuPortsSourcePackageDirectory ]
: input-source-packages : : isTarget ;
AddFilesToHaikuImage home haikuports
: [ BuildHaikuPortsRepositoryConfig /boot/home/haikuports ] ;
AddSymlinkToHaikuImage home Desktop : /boot/home : Home ;
# global settings when a package is installed in ~/config
AddDirectoryToHaikuImage home config settings global ;
# scripts and data files
local userBootScripts = UserBootscript UserSetupEnvironment.sample ;
SEARCH on $(userBootScripts) = [ FDirName $(HAIKU_TOP) data config boot ] ;
AddFilesToHaikuImage home config settings boot : $(userBootScripts) ;
# Add boot launch directory
AddDirectoryToHaikuImage home config settings boot launch ;
# Add Tracker New Templates
AddFilesToHaikuImage home config settings Tracker "Tracker New Templates"
:
"<tracker-new-templates>C++ header"
"<tracker-new-templates>C++ source"
"<tracker-new-templates>makefile"
"<tracker-new-templates>text file"
;
local etcDir = [ FDirName $(HAIKU_TOP) data etc ] ;
local etcFiles = inputrc profile ;
etcFiles = $(etcFiles:G=etc) ;
SEARCH on $(etcFiles) = $(etcDir) ;
etcFiles += <etc>termcap <etc>sysless <etc>sysless.in ;
AddFilesToHaikuImage common settings etc : $(etcFiles) ;
local profileFiles = [ Glob $(etcDir)/profile.d : *.sh ] ;
profileFiles = $(profileFiles:G=profile-d) ;
AddDirectoryToHaikuImage common settings etc profile.d ;
AddFilesToHaikuImage common settings etc profile.d : $(profileFiles) ;
local driverSettingsFiles = <driver-settings>kernel ;
SEARCH on $(driverSettingsFiles)
= [ FDirName $(HAIKU_TOP) data settings kernel drivers ] ;
AddFilesToHaikuImage home config settings kernel drivers
: $(driverSettingsFiles) ;
local networkSettingsFiles = <network-settings>services ;
SEARCH on $(networkSettingsFiles)
= [ FDirName $(HAIKU_TOP) data settings network ] ;
AddFilesToHaikuImage common settings network : $(networkSettingsFiles) ;
# fresh install indicator file for the post install scripts
SEARCH on <post-install>fresh_install
= [ FDirName $(HAIKU_TOP) data common settings ] ;
AddFilesToHaikuImage common settings : <post-install>fresh_install ;
# create directories that will remain empty
AddDirectoryToHaikuImage common cache tmp ;
AddDirectoryToHaikuImage common non-packaged ;
AddDirectoryToHaikuImage common var empty ;
AddDirectoryToHaikuImage common var log ;
AddDirectoryToHaikuImage home Desktop ;
AddDirectoryToHaikuImage home mail ;
AddDirectoryToHaikuImage home config packages ;
AddDirectoryToHaikuImage home config non-packaged bin ;
AddDirectoryToHaikuImage home config non-packaged lib ;
AddDirectoryToHaikuImage home config non-packaged add-ons kernel drivers bin ;
AddDirectoryToHaikuImage home config non-packaged add-ons kernel drivers dev ;
AddDirectoryToHaikuImage home config non-packaged add-ons input_server devices ;
AddDirectoryToHaikuImage home config non-packaged add-ons input_server filters ;
AddDirectoryToHaikuImage home config non-packaged add-ons input_server methods ;
AddDirectoryToHaikuImage home config non-packaged add-ons media plugins ;
AddDirectoryToHaikuImage home config non-packaged add-ons Tracker ;
AddDirectoryToHaikuImage home config non-packaged add-ons Print ;
AddDirectoryToHaikuImage home config non-packaged add-ons Screen\ Savers ;
AddDirectoryToHaikuImage home config non-packaged add-ons Translators ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuImageCommon ] ;

View File

@ -0,0 +1,157 @@
#pragma mark - Optional Packages
include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalPackages ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalTestPackages ] ;
#pragma mark - User/Group Setup
# add the root user and the root and users groups
AddUserToHaikuImage $(HAIKU_ROOT_USER_NAME:E=baron) : 0 : 0 : /boot/home
: /bin/bash : $(HAIKU_ROOT_USER_REAL_NAME:E="Root User") ;
AddGroupToHaikuImage root : 0 : ;
AddGroupToHaikuImage users : 100 : ;
#pragma mark - Host Name
if $(HAIKU_IMAGE_HOST_NAME) {
actions BuildHaikuImageHostnameFile
{
echo "$(HAIKU_IMAGE_HOST_NAME)" > $(1)
}
local file = <haiku-image>hostname ;
Always $(file) ;
MakeLocate $(file) : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ;
BuildHaikuImageHostnameFile $(file) ;
AddFilesToHaikuImage common settings network : $(file) ;
}
#pragma mark - Build The Image
# Execute pre-image user config rules.
UserBuildConfigRulePreImage ;
# Set image name and directory defaults and locate the image.
HAIKU_IMAGE_NAME ?= $(HAIKU_DEFAULT_IMAGE_NAME) ;
HAIKU_IMAGE_DIR ?= $(HAIKU_DEFAULT_IMAGE_DIR) ;
HAIKU_IMAGE = $(HAIKU_IMAGE_NAME) ;
HAIKU_IMAGE_SIZE ?= $(HAIKU_DEFAULT_IMAGE_SIZE) ; # 300 MB
HAIKU_IMAGE_LABEL ?= $(HAIKU_DEFAULT_IMAGE_LABEL) ;
MakeLocate $(HAIKU_IMAGE) : $(HAIKU_IMAGE_DIR) ;
# Set the default installation directory.
HAIKU_INSTALL_DIR ?= $(HAIKU_DEFAULT_INSTALL_DIR) ;
# the pseudo target all image contents is attached to
NotFile $(HAIKU_IMAGE_CONTAINER_NAME) ;
# prepare the script that initializes the shell variables
HAIKU_IMAGE_INIT_VARIABLES_SCRIPT = <HaikuImage>haiku.image-init-vars ;
local script = $(HAIKU_IMAGE_INIT_VARIABLES_SCRIPT) ;
MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ;
Always $(script) ;
AddVariableToScript $(script) : sourceDir : $(HAIKU_TOP) ;
AddVariableToScript $(script) : outputDir : $(HAIKU_OUTPUT_DIR) ;
AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ;
AddVariableToScript $(script) : installDir : $(HAIKU_INSTALL_DIR) ;
#AddVariableToScript $(script) : isImage : 1 ;
AddVariableToScript $(script) : imageSize : $(HAIKU_IMAGE_SIZE) ;
AddVariableToScript $(script) : imageLabel : $(HAIKU_IMAGE_LABEL) ;
AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
AddVariableToScript $(script) : dontClearImage : $(HAIKU_DONT_CLEAR_IMAGE) ;
AddVariableToScript $(script) : updateOnly : [ IsUpdateHaikuImageOnly ] ;
AddTargetVariableToScript $(script) : <build>addattr ;
AddTargetVariableToScript $(script) : <build>bfs_shell : bfsShell ;
AddTargetVariableToScript $(script) : <build>fs_shell_command : fsShellCommand ;
AddTargetVariableToScript $(script) : <build>copyattr ;
AddTargetVariableToScript $(script) : <build>create_image : createImage ;
AddTargetVariableToScript $(script) : <build>makebootable ;
AddTargetVariableToScript $(script) : <build>rc ;
AddTargetVariableToScript $(script) : <build>resattr ;
AddTargetVariableToScript $(script) : <build>unzip ;
AddTargetVariableToScript $(script) : <build>vmdkimage ;
if $(HOST_RM_ATTRS_TARGET) {
AddTargetVariableToScript $(script) : $(HOST_RM_ATTRS_TARGET) : rmAttrs ;
} else {
AddVariableToScript $(script) : rmAttrs : rm ;
}
AddPackagesAndRepositoryVariablesToContainerScript $(script)
: $(HAIKU_IMAGE_CONTAINER_NAME) ;
# create the other scripts
HAIKU_IMAGE_MAKE_DIRS_SCRIPT = <HaikuImage>haiku.image-make-dirs ;
HAIKU_IMAGE_COPY_FILES_SCRIPT = <HaikuImage>haiku.image-copy-files ;
HAIKU_IMAGE_EXTRACT_FILES_SCRIPT = <HaikuImage>haiku.image-extract-files ;
MakeLocate $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT)
$(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) : $(HAIKU_OUTPUT_DIR) ;
CreateHaikuImageMakeDirectoriesScript $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) ;
CreateHaikuImageCopyFilesScript $(HAIKU_IMAGE_COPY_FILES_SCRIPT) ;
CreateHaikuImageExtractFilesScript $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) ;
# Convenience wrapper rule around BuildHaikuImage.
rule _BuildHaikuImage image : isImage : isVMwareImage
{
# _BuildHaikuImage <image target> : <isImage> : <isVMwareImage> ;
#
# build the image
# HAIKU_IMAGE_EARLY_USER_SCRIPTS, HAIKU_IMAGE_LATE_USER_SCRIPTS can be
# specified by the user.
BuildHaikuImage $(image) :
$(HAIKU_IMAGE_INIT_VARIABLES_SCRIPT)
$(HAIKU_IMAGE_EARLY_USER_SCRIPTS)
$(HAIKU_IMAGE_MAKE_DIRS_SCRIPT)
$(HAIKU_IMAGE_COPY_FILES_SCRIPT)
$(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT)
$(HAIKU_IMAGE_LATE_USER_SCRIPTS)
: $(isImage)
: $(isVMwareImage)
;
# remove the scripts we have generated
RmTemps $(image) :
$(HAIKU_IMAGE_INIT_VARIABLES_SCRIPT)
$(HAIKU_IMAGE_MAKE_DIRS_SCRIPT)
$(HAIKU_IMAGE_COPY_FILES_SCRIPT)
$(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT)
;
}
# build the image
_BuildHaikuImage $(HAIKU_IMAGE) : true ;
NotFile haiku-image ;
Depends haiku-image : $(HAIKU_IMAGE) ;
# install Haiku into a directory
NotFile install-haiku ;
_BuildHaikuImage install-haiku : 0 ;
# build the VMware image
HAIKU_VMWARE_IMAGE_NAME ?= $(HAIKU_DEFAULT_VMWARE_IMAGE_NAME) ;
HAIKU_VMWARE_IMAGE = $(HAIKU_VMWARE_IMAGE_NAME) ;
MakeLocate $(HAIKU_VMWARE_IMAGE) : $(HAIKU_IMAGE_DIR) ;
_BuildHaikuImage $(HAIKU_VMWARE_IMAGE) : true : true ;
NotFile haiku-vmware-image ;
Depends haiku-vmware-image : $(HAIKU_VMWARE_IMAGE) ;
# create a package list
BuildHaikuImagePackageList $(HAIKU_IMAGE_LIST_PACKAGES_TARGET) ;
# Execute post-image user config rules.
UserBuildConfigRulePostImage ;

View File

@ -35,7 +35,8 @@ AddFilesToNetBootArchive system add-ons kernel busses ide
: generic_ide_pci ide_isa@x86 silicon_image_3112 ;
AddFilesToNetBootArchive system add-ons kernel busses scsi
: ahci ;
AddFilesToNetBootArchive system add-ons kernel console : vga_text ;
AddFilesToNetBootArchive system add-ons kernel console
: vga_text ;
AddFilesToNetBootArchive system add-ons kernel file_systems
: $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToNetBootArchive system add-ons kernel generic
@ -46,7 +47,8 @@ AddFilesToNetBootArchive system add-ons kernel interrupt_controllers
: openpic@ppc ;
if $(TARGET_ARCH) = x86 {
AddFilesToNetBootArchive system add-ons kernel cpu : generic_x86 ;
AddFilesToNetBootArchive system add-ons kernel cpu
: generic_x86 ;
}
# drivers
@ -56,7 +58,8 @@ AddDriversToNetBootArchive disk virtual : remote_disk ;
AddDriversToNetBootArchive net : $(SYSTEM_ADD_ONS_DRIVERS_NET) ;
# kernel
AddFilesToNetBootArchive system : <revisioned>kernel_$(TARGET_ARCH) ;
AddFilesToNetBootArchive system
: <revisioned>kernel_$(TARGET_ARCH) ;
# scripts and data files
@ -71,11 +74,13 @@ AddFilesToNetBootArchive system add-ons kernel network
: <net>notifications stack ;
AddFilesToNetBootArchive system add-ons kernel network devices
: $(SYSTEM_NETWORK_DEVICES) ;
AddFilesToNetBootArchive system add-ons kernel network datalink_protocols
AddFilesToNetBootArchive
system add-ons kernel network datalink_protocols
: $(SYSTEM_NETWORK_DATALINK_PROTOCOLS) ;
AddFilesToNetBootArchive system add-ons kernel network ppp
: $(SYSTEM_NETWORK_PPP) ;
AddFilesToNetBootArchive system add-ons kernel network protocols
AddFilesToNetBootArchive
system add-ons kernel network protocols
: $(SYSTEM_NETWORK_PROTOCOLS) ;
# boot module links

393
build/jam/packages/Haiku Normal file
View File

@ -0,0 +1,393 @@
local architecture = $(HAIKU_PACKAGING_ARCHS[1]) ;
local haikuPackage = haiku.hpkg ;
HaikuPackage $(haikuPackage) ;
# wifi firmware
for driver in $(SYSTEM_ADD_ONS_DRIVERS_NET) {
local package = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_PACKAGE) ] ;
local archive = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_ARCHIVE) ] ;
local extract = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_DO_EXTRACT) ] ;
if $(archive) {
AddWifiFirmwareToPackage $(driver) : $(package) : $(archive)
: $(extract) ;
}
local packages = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_PACKAGES) ] ;
local archives = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_ARCHIVES) ] ;
for archive in $(archives) {
AddWifiFirmwareToPackage $(driver) : $(packages[1]) : $(archive)
: $(extract) ;
packages = $(packages[2-]) ;
}
}
# modules
AddFilesToPackage add-ons kernel bus_managers : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ;
AddFilesToPackage add-ons kernel busses agp_gart : <agp_gart>intel@x86,x86_64 ;
if $(HAIKU_ATA_STACK) = 1 {
AddFilesToPackage add-ons kernel busses ata
: generic_ide_pci it8211 legacy_sata silicon_image_3112 ide_isa@x86 ;
} else {
AddFilesToPackage add-ons kernel busses ide
: generic_ide_pci it8211 legacy_sata silicon_image_3112 ide_isa@x86 ;
}
AddFilesToPackage add-ons kernel busses random : virtio_rng ;
AddFilesToPackage add-ons kernel busses scsi : ahci virtio_scsi ;
AddFilesToPackage add-ons kernel busses usb : <usb>uhci <usb>ohci <usb>ehci ;
AddFilesToPackage add-ons kernel busses virtio : virtio_pci ;
AddFilesToPackage add-ons kernel console : vga_text ;
AddFilesToPackage add-ons kernel debugger
: <kdebug>demangle <kdebug>disasm@x86 <kdebug>hangman
<kdebug>invalidate_on_exit <kdebug>usb_keyboard <kdebug>qrencode
<kdebug>run_on_exit ;
AddFilesToPackage add-ons kernel file_systems : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToPackage add-ons kernel generic
: ata_adapter@ata bios@x86,x86_64 dpc ide_adapter@ide
locked_pool mpu401 scsi_periph <module>tty ;
AddFilesToPackage add-ons kernel partitioning_systems
: amiga_rdb apple efi_gpt intel session ;
AddFilesToPackage add-ons kernel interrupt_controllers : openpic@ppc ;
if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
AddFilesToPackage add-ons kernel cpu : generic_x86 ;
}
# drivers
AddNewDriversToPackage disk scsi : scsi_cd scsi_disk ;
AddNewDriversToPackage disk virtual : virtio_block ;
AddNewDriversToPackage power : enhanced_speedstep@x86 ;
AddNewDriversToPackage power : acpi_battery@x86 ;
#AddNewDriversToPackage display : display_controls@x86 ;
# legacy drivers
AddDriversToPackage : console dprintf null <driver>tty zero ;
AddDriversToPackage audio hmulti : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ;
AddDriversToPackage audio old : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ;
AddDriversToPackage midi : $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ;
AddDriversToPackage bus : usb_raw fw_raw@x86 ;
AddDriversToPackage disk floppy : pc_floppy@x86 ;
AddDriversToPackage disk usb : usb_disk ;
AddDriversToPackage disk usb : usb_floppy ;
AddDriversToPackage printer usb : usb_printer ;
AddDriversToPackage disk virtual : nbd ;
AddDriversToPackage dvb : cx23882 ;
AddDriversToPackage graphics : $(SYSTEM_ADD_ONS_DRIVERS_GRAPHICS) ;
AddDriversToPackage input : ps2_hid usb_hid wacom ;
AddDriversToPackage misc : <driver>poke <driver>mem ;
AddDriversToPackage net : $(SYSTEM_ADD_ONS_DRIVERS_NET) ;
AddDriversToPackage ports : usb_serial ;
AddDriversToPackage power : $(SYSTEM_ADD_ONS_DRIVERS_POWER) ;
# kernel
AddFilesToPackage : <revisioned>kernel_$(TARGET_ARCH) ;
# libs
AddLibrariesToPackage lib
: [ HaikuImageGetSystemLibs ] [ HaikuImageGetPrivateSystemLibs ] ;
# libnetwork.so replaces quite a few libraries
if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 {
local libNetworkAliases = libsocket.so libbind.so libnet.so ;
local lib ;
for lib in $(libNetworkAliases) {
AddSymlinkToPackage lib : libnetwork.so : $(lib) ;
}
AddSymlinkToPackage lib : libbnetapi.so : libnetapi.so ;
}
# TODO: Remove when the packages have been rebuilt!
AddSymlinkToPackage lib : libbe.so : liblocale.so ;
# servers
AddFilesToPackage servers : $(SYSTEM_SERVERS) ;
# apps
AddFilesToPackage : runtime_loader Deskbar Tracker ;
AddFilesToPackage bin : $(SYSTEM_BIN) consoled ;
AddFilesToPackage apps : $(SYSTEM_APPS) ;
AddFilesToPackage preferences : $(SYSTEM_PREFERENCES) ;
AddFilesToPackage demos : $(SYSTEM_DEMOS) ;
SEARCH on which = [ FDirName $(HAIKU_TOP) data bin ] ;
AddFilesToPackage bin : which ;
SEARCH on install-wifi-firmwares.sh = [ FDirName $(HAIKU_TOP) data bin ] ;
AddFilesToPackage bin : install-wifi-firmwares.sh ;
AddSymlinkToPackage bin : bash : sh ;
AddSymlinkToPackage bin : trash : untrash ;
AddSymlinkToPackage bin : less : more ;
AddSymlinkToPackage bin : gzip : gunzip ;
AddSymlinkToPackage bin : gzip : zcat ;
AddSymlinkToPackage bin : zdiff : zcmp ;
AddSymlinkToPackage bin : unzip : zipinfo ;
AddSymlinkToPackage 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 ] ;
AddFilesToPackage boot : $(bootScripts) ;
# post install scripts
local postInstallFiles = add_catalog_entry_attributes.sh
default_deskbar_items.sh ;
postInstallFiles = $(postInstallFiles:G=post-install) ;
SEARCH on $(postInstallFiles)
= [ FDirName $(HAIKU_TOP) data common boot post_install ] ;
AddFilesToPackage boot post-install : $(postInstallFiles) ;
# Gutenprint data files
CopyDirectoryToPackage data
: [ FDirName $(HAIKU_TOP) src libs print libgutenprint src xml ]
: gutenprint : -x *.c -x Makefile.am -x Makefile.in ;
# artwork and sounds
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 ] ;
AddFilesToPackage data artwork : $(logoArtwork) ;
# Mail spell check dictionaries
local spellFiles = words geekspeak ;
spellFiles = $(spellFiles:G=spell) ;
SEARCH on $(spellFiles) = [ FDirName $(HAIKU_TOP) src apps mail ] ;
AddFilesToPackage data spell_check word_dictionary : $(spellFiles) ;
local fortuneFiles = [ Glob $(HAIKU_TOP)/data/system/data/fortunes
: [a-zA-Z0-9]* ] ;
fortuneFiles = $(fortuneFiles:G=data!fortunes) ;
AddFilesToPackage 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 ] ;
AddFilesToPackage data fonts psfonts : $(psFonts) ;
AddFilesToPackage data fonts ttfonts : $(ttFonts) ;
local cannaDir = [ FDirName $(HAIKU_TOP) data system data Canna ] ;
local cannaDefault = [ Glob $(cannaDir)/default : *.canna *.gz ] ;
local cannaDic = [ Glob $(cannaDir)/dic : *.cbp ] ;
local cannaDicCanna = [ Glob $(cannaDir)/dic/canna
: *.cld *.ctd *.cbd *.dir ] ;
AddFilesToPackage data Canna default : $(cannaDefault) ;
AddFilesToPackage data Canna dic : $(cannaDic) ;
AddFilesToPackage data Canna dic canna : $(cannaDicCanna) ;
#AddDirectoryToPackage data Canna dic group ;
#AddDirectoryToPackage data Canna dic user ;
# TODO: If those serve any purpose, they should probably live in a writable
# subtree.
local keymapFiles = [ Glob [ FDirName $(HAIKU_TOP) src data keymaps ]
: *.keymap ] ;
keymapFiles = $(keymapFiles:BG=keymap) ;
AddFilesToPackage data Keymaps : $(keymapFiles) ;
AddSymlinkToPackage data Keymaps : Swedish : Finnish ;
AddSymlinkToPackage data Keymaps : Slovene : Croatian ;
AddSymlinkToPackage 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) ;
AddFilesToPackage 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) ;
AddFilesToPackage 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) ;
AddFilesToPackage data KeyboardLayouts ThinkPad
: $(thinkPadFiles) ;
# boot module links
AddBootModuleSymlinksToPackage
acpi@x86 ata@ata pci isa@x86 config_manager dpc
ide@ide scsi usb
openpic@ppc
ata_adapter@ata ide_adapter@ide locked_pool scsi_periph
ahci generic_ide_pci it8211 legacy_sata silicon_image_3112
ide_isa@x86
<usb>uhci <usb>ohci <usb>ehci
scsi_cd scsi_disk usb_disk
virtio virtio_pci virtio_block virtio_scsi
efi_gpt
intel
bfs packagefs
;
# add-ons
AddFilesToPackage add-ons accelerants : $(SYSTEM_ADD_ONS_ACCELERANTS) ;
AddFilesToPackage add-ons Translators : $(SYSTEM_ADD_ONS_TRANSLATORS) ;
AddFilesToPackage add-ons locale catalogs : $(SYSTEM_ADD_ONS_LOCALE_CATALOGS) ;
AddFilesToPackage add-ons opengl :
x86 @{
Legacy\ Software\ Rasterizer@gcc2
Software\ Rasterizer@!gcc2
}@ # x86
;
AddFilesToPackage add-ons mail_daemon inbound_protocols : POP3 IMAP ;
AddFilesToPackage add-ons mail_daemon outbound_protocols : SMTP ;
AddFilesToPackage add-ons mail_daemon inbound_filters
: MatchHeader SpamFilter NewMailNotification ;
AddFilesToPackage add-ons mail_daemon outbound_filters : Fortune ;
AddFilesToPackage add-ons media : $(SYSTEM_ADD_ONS_MEDIA) ;
AddFilesToPackage add-ons media plugins : $(SYSTEM_ADD_ONS_MEDIA_PLUGINS) ;
AddFilesToPackage add-ons Tracker
: FileType Mark\ as… Mark\ as\ Read Open\ Target\ Folder
Open\ Terminal ZipOMatic ;
AddSymlinkToPackage add-ons Tracker
: /boot/system/preferences/Backgrounds : Background ;
AddSymlinkToPackage add-ons Tracker
: /boot/system/apps/TextSearch : TextSearch ;
AddSymlinkToPackage add-ons Tracker
: /boot/system/apps/DiskUsage : DiskUsage ;
AddFilesToPackage add-ons input_server devices
: <input>keyboard <input>mouse <input>tablet <input>wacom ;
AddFilesToPackage add-ons input_server filters
: screen_saver shortcut_catcher ;
AddFilesToPackage add-ons kernel network : <net>notifications stack ;
AddFilesToPackage add-ons kernel network : dns_resolver ;
AddFilesToPackage add-ons kernel network devices : $(SYSTEM_NETWORK_DEVICES) ;
AddFilesToPackage add-ons kernel network datalink_protocols
: $(SYSTEM_NETWORK_DATALINK_PROTOCOLS) ;
AddFilesToPackage add-ons kernel network ppp: $(SYSTEM_NETWORK_PPP) ;
AddFilesToPackage add-ons kernel network protocols
: $(SYSTEM_NETWORK_PROTOCOLS) ;
AddFilesToPackage add-ons Print : $(SYSTEM_ADD_ONS_PRINT) ;
AddFilesToPackage add-ons Print transport
: $(SYSTEM_ADD_ONS_PRINT_TRANSPORT) ;
AddFilesToPackage add-ons Screen\ Savers : $(SYSTEM_ADD_ONS_SCREENSAVERS) ;
AddFilesToPackage add-ons disk_systems
: <disk_system>intel <disk_system>gpt <disk_system>bfs <disk_system>ntfs ;
# the MIME DB
CopyDirectoryToPackage data : <mimedb>mime_db : : : isTarget ;
# Deskbar menu symlinks
# "Applications" links
DESKBAR_APPLICATIONS = ActivityMonitor CharacterMap CodyCam CDPlayer DeskCalc
Devices DiskProbe DriveSetup DiskUsage Expander HaikuDepot Icon-O-Matic
Installer Magnify Mail MediaConverter MediaPlayer MidiPlayer People PoorMan
Screenshot SoundRecorder StyledEdit Terminal TV
;
local linkTarget ;
for linkTarget in $(DESKBAR_APPLICATIONS) {
AddSymlinkToPackage data deskbar menu Applications
: ../../../../apps/$(linkTarget) : $(linkTarget) ;
}
# "Desktop applets" links
DESKBAR_DESKTOP_APPLETS = LaunchBox NetworkStatus PowerStatus ProcessController
Workspaces
;
for linkTarget in $(DESKBAR_DESKTOP_APPLETS) {
AddSymlinkToPackage data deskbar menu Desktop\ applets
: ../../../../apps/$(linkTarget) : $(linkTarget) ;
}
# "Preferences" links
AddDirectoryToPackage data deskbar menu Preferences ;
DESKBAR_PREFERENCES = $(SYSTEM_PREFERENCES:B) ;
for linkTarget in $(DESKBAR_PREFERENCES) {
AddSymlinkToPackage data deskbar menu Preferences
: ../../../../preferences/$(linkTarget)
: $(linkTarget) ;
}
# "Demo" links
AddDirectoryToPackage data deskbar menu Demos ;
for linkTarget in $(SYSTEM_DEMOS) {
AddSymlinkToPackage data deskbar menu Demos
: ../../../../demos/$(linkTarget) : $(linkTarget) ;
}
# Deskbar menu entries file
AddFilesToPackage data deskbar : <deskbar>menu_entries ;
# optional
# TODO: We should probably build another package (including the data files
# above) that can be installed, if desired.
AddFilesToPackage optional add-ons input_server methods : canna ;
# PDF Writer enconding files
CopyDirectoryToPackage data
: [ FDirName $(HAIKU_TOP) src add-ons print drivers pdf encoding ]
: "PDF Writer" : -x Jamfile ;
# licenses
CopyDirectoryToPackage data
: [ FDirName $(HAIKU_TOP) data system data licenses ]
: licenses ;
# Copy documentation as per DiskUsage's license requirement.
CopyDirectoryToPackage documentation
: [ FDirName $(HAIKU_TOP) docs apps diskusage ]
: diskusage ;
# Copy documentation and sample programs as per PDFlib Lite's license
# requirement.
CopyDirectoryToPackage documentation
: [ FDirName $(HAIKU_TOP) src libs pdflib doc ]
: pdflib ;
CopyDirectoryToPackage develop sample-code
: [ FDirName $(HAIKU_TOP) src libs pdflib bind pdflib ]
: pdflib ;
BuildHaikuPackage $(haikuPackage) : haiku ;

View File

@ -0,0 +1,308 @@
local architecture = $(HAIKU_PACKAGING_ARCHS[1]) ;
local haikuPackage = haiku.hpkg ;
HaikuPackage $(haikuPackage) ;
# wifi firmware
for driver in $(SYSTEM_ADD_ONS_DRIVERS_NET) {
local package = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_PACKAGE) ] ;
local archive = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_ARCHIVE) ] ;
local extract = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_DO_EXTRACT) ] ;
if $(archive) {
AddWifiFirmwareToPackage $(driver) : $(package) : $(archive)
: $(extract) ;
}
local packages = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_PACKAGES) ] ;
local archives = [ on $(driver) return $(HAIKU_WIFI_FIRMWARE_ARCHIVES) ] ;
for archive in $(archives) {
AddWifiFirmwareToPackage $(driver) : $(packages[1]) : $(archive)
: $(extract) ;
packages = $(packages[2-]) ;
}
}
# modules
AddFilesToPackage add-ons kernel bus_managers : $(SYSTEM_ADD_ONS_BUS_MANAGERS) ;
AddFilesToPackage add-ons kernel busses agp_gart : <agp_gart>intel@x86 ;
if $(HAIKU_ATA_STACK) = 1 {
AddFilesToPackage add-ons kernel busses ata
: generic_ide_pci it8211 legacy_sata silicon_image_3112 ide_isa@x86 ;
} else {
AddFilesToPackage add-ons kernel busses ide
: generic_ide_pci it8211 legacy_sata silicon_image_3112 ide_isa@x86 ;
}
AddFilesToPackage add-ons kernel busses scsi : ahci virtio_scsi ;
AddFilesToPackage add-ons kernel busses usb : <usb>uhci <usb>ohci <usb>ehci ;
AddFilesToPackage add-ons kernel busses virtio : virtio_pci ;
AddFilesToPackage add-ons kernel console : vga_text ;
AddFilesToPackage add-ons kernel debugger
: <kdebug>demangle <kdebug>disasm@x86 <kdebug>hangman
<kdebug>invalidate_on_exit <kdebug>usb_keyboard <kdebug>qrencode
<kdebug>run_on_exit ;
AddFilesToPackage add-ons kernel file_systems : $(SYSTEM_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToPackage add-ons kernel generic
: ata_adapter@ata bios@x86,x86_64 dpc ide_adapter@ide
locked_pool mpu401 scsi_periph <module>tty ;
AddFilesToPackage add-ons kernel partitioning_systems
: amiga_rdb apple efi_gpt intel session ;
AddFilesToPackage add-ons kernel interrupt_controllers : openpic@ppc ;
if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
AddFilesToPackage add-ons kernel cpu : generic_x86 ;
}
# drivers
AddNewDriversToPackage disk scsi : scsi_cd scsi_disk ;
AddNewDriversToPackage disk virtual : virtio_block ;
AddNewDriversToPackage power : enhanced_speedstep@x86 ;
AddNewDriversToPackage power : acpi_battery@x86 ;
#AddNewDriversToPackage display : display_controls@x86 ;
# legacy drivers
AddDriversToPackage : console dprintf null random <driver>tty
zero ;
AddDriversToPackage audio hmulti : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO) ;
AddDriversToPackage audio old : $(SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD) ;
AddDriversToPackage midi : $(SYSTEM_ADD_ONS_DRIVERS_MIDI) ;
AddDriversToPackage bus : usb_raw fw_raw@x86 ;
AddDriversToPackage disk floppy : pc_floppy@x86 ;
AddDriversToPackage disk usb : usb_disk ;
AddDriversToPackage disk usb : usb_floppy ;
AddDriversToPackage printer usb : usb_printer ;
AddDriversToPackage disk virtual : nbd ;
AddDriversToPackage graphics : $(SYSTEM_ADD_ONS_DRIVERS_GRAPHICS) ;
AddDriversToPackage input : ps2_hid usb_hid wacom ;
AddDriversToPackage misc : <driver>poke <driver>mem ;
AddDriversToPackage net : $(SYSTEM_ADD_ONS_DRIVERS_NET) ;
AddDriversToPackage ports : usb_serial ;
AddDriversToPackage power : $(SYSTEM_ADD_ONS_DRIVERS_POWER) ;
# kernel
AddFilesToPackage : <revisioned>kernel_$(TARGET_ARCH) ;
# libs
AddLibrariesToPackage lib
: [ HaikuImageGetSystemLibs ] [ HaikuImageGetPrivateSystemLibs ] ;
# libnetwork.so replaces quite a few libraries
if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 {
local libNetworkAliases = libsocket.so libbind.so libnet.so ;
local lib ;
for lib in $(libNetworkAliases) {
AddSymlinkToPackage lib : libnetwork.so : $(lib) ;
}
AddSymlinkToPackage lib : libbnetapi.so : libnetapi.so ;
}
# servers
AddFilesToPackage servers : $(SYSTEM_SERVERS) ;
# apps
AddFilesToPackage : runtime_loader Deskbar Tracker ;
AddFilesToPackage bin : $(SYSTEM_BIN) consoled ;
AddFilesToPackage apps : $(SYSTEM_APPS) ;
AddFilesToPackage preferences : $(SYSTEM_PREFERENCES) ;
AddFilesToPackage demos : $(SYSTEM_DEMOS) ;
SEARCH on which = [ FDirName $(HAIKU_TOP) data bin ] ;
AddFilesToPackage bin : which ;
SEARCH on install-wifi-firmwares.sh = [ FDirName $(HAIKU_TOP) data bin ] ;
AddFilesToPackage bin : install-wifi-firmwares.sh ;
AddSymlinkToPackage bin : bash : sh ;
AddSymlinkToPackage bin : trash : untrash ;
AddSymlinkToPackage bin : less : more ;
AddSymlinkToPackage bin : gzip : gunzip ;
AddSymlinkToPackage bin : gzip : zcat ;
AddSymlinkToPackage bin : zdiff : zcmp ;
AddSymlinkToPackage bin : unzip : zipinfo ;
AddSymlinkToPackage 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 ] ;
AddFilesToPackage boot : $(bootScripts) ;
# post install scripts
local postInstallFiles = default_deskbar_items.sh ;
postInstallFiles = $(postInstallFiles:G=post-install) ;
SEARCH on $(postInstallFiles)
= [ FDirName $(HAIKU_TOP) data common boot post_install ] ;
AddFilesToPackage boot post-install : $(postInstallFiles) ;
local fortuneFiles = [ Glob $(HAIKU_TOP)/data/system/data/fortunes
: [a-zA-Z0-9]* ] ;
fortuneFiles = $(fortuneFiles:G=data!fortunes) ;
AddFilesToPackage 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 ] ;
AddFilesToPackage data fonts psfonts : $(psFonts) ;
AddFilesToPackage data fonts ttfonts : $(ttFonts) ;
local keymapFiles = [ Glob [ FDirName $(HAIKU_TOP) src data keymaps ]
: *.keymap ] ;
keymapFiles = $(keymapFiles:BG=keymap) ;
AddFilesToPackage data Keymaps : $(keymapFiles) ;
AddSymlinkToPackage data Keymaps : Swedish : Finnish ;
AddSymlinkToPackage data Keymaps : Slovene : Croatian ;
AddSymlinkToPackage 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) ;
AddFilesToPackage 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) ;
AddFilesToPackage 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) ;
AddFilesToPackage data KeyboardLayouts ThinkPad
: $(thinkPadFiles) ;
# boot module links
AddBootModuleSymlinksToPackage
acpi@x86 ata@ata pci isa@x86 config_manager dpc
ide@ide scsi usb
openpic@ppc
ata_adapter@ata ide_adapter@ide locked_pool scsi_periph
ahci generic_ide_pci it8211 legacy_sata silicon_image_3112
ide_isa@x86
<usb>uhci <usb>ohci <usb>ehci
scsi_cd scsi_disk usb_disk
virtio virtio_pci virtio_block virtio_scsi
efi_gpt
intel
bfs packagefs
;
# add-ons
AddFilesToPackage add-ons accelerants : $(SYSTEM_ADD_ONS_ACCELERANTS) ;
AddFilesToPackage add-ons Translators : $(SYSTEM_ADD_ONS_TRANSLATORS) ;
AddFilesToPackage add-ons locale catalogs : $(SYSTEM_ADD_ONS_LOCALE_CATALOGS) ;
AddFilesToPackage add-ons Tracker
: FileType-F Mark\ as… Mark\ as\ Read-R Open\ Target\ Folder-O
Open\ Terminal-T ZipOMatic-Z ;
AddSymlinkToPackage add-ons Tracker
: /boot/system/preferences/Backgrounds : Background-B ;
AddSymlinkToPackage add-ons Tracker
: /boot/system/apps/TextSearch : TextSearch-G ;
AddSymlinkToPackage add-ons Tracker
: /boot/system/apps/DiskUsage : DiskUsage-I ;
AddFilesToPackage add-ons input_server devices
: <input>keyboard <input>mouse <input>tablet <input>wacom ;
AddFilesToPackage add-ons input_server filters
: screen_saver shortcut_catcher ;
AddFilesToPackage add-ons kernel network : <net>notifications stack ;
AddFilesToPackage add-ons kernel network : dns_resolver ;
AddFilesToPackage add-ons kernel network devices : $(SYSTEM_NETWORK_DEVICES) ;
AddFilesToPackage add-ons kernel network datalink_protocols
: $(SYSTEM_NETWORK_DATALINK_PROTOCOLS) ;
AddFilesToPackage add-ons kernel network ppp: $(SYSTEM_NETWORK_PPP) ;
AddFilesToPackage add-ons kernel network protocols
: $(SYSTEM_NETWORK_PROTOCOLS) ;
AddFilesToPackage add-ons disk_systems
: <disk_system>intel <disk_system>gpt <disk_system>bfs <disk_system>ntfs ;
# the MIME DB
CopyDirectoryToPackage data : <mimedb>mime_db : : : isTarget ;
# Deskbar menu symlinks
# "Applications" links
DESKBAR_APPLICATIONS = ActivityMonitor CharacterMap DeskCalc
Devices DiskProbe DriveSetup DiskUsage Expander Installer
StyledEdit Terminal
;
local linkTarget ;
for linkTarget in $(DESKBAR_APPLICATIONS) {
AddSymlinkToPackage data deskbar menu Applications
: ../../../../apps/$(linkTarget) : $(linkTarget) ;
}
# "Desktop applets" links
DESKBAR_DESKTOP_APPLETS = LaunchBox NetworkStatus PowerStatus ProcessController
Workspaces
;
for linkTarget in $(DESKBAR_DESKTOP_APPLETS) {
AddSymlinkToPackage data deskbar menu Desktop\ applets
: ../../../../apps/$(linkTarget) : $(linkTarget) ;
}
# "Preferences" links
AddDirectoryToPackage data deskbar menu Preferences ;
DESKBAR_PREFERENCES = $(SYSTEM_PREFERENCES:B) ;
for linkTarget in $(DESKBAR_PREFERENCES) {
AddSymlinkToPackage data deskbar menu Preferences
: ../../../../preferences/$(linkTarget)
: $(linkTarget) ;
}
# Deskbar menu entries file
AddFilesToPackage data deskbar : <deskbar>menu_entries ;
# licenses
CopyDirectoryToPackage data
: [ FDirName $(HAIKU_TOP) data system data licenses ]
: licenses ;
# Copy documentation as per DiskUsage's license requirement.
CopyDirectoryToPackage documentation
: [ FDirName $(HAIKU_TOP) docs apps diskusage ]
: diskusage ;
BuildHaikuPackage $(haikuPackage) : haiku ;

View File

@ -0,0 +1,102 @@
# This package is like the HaikuDevel package, but it is meant for cross
# development, i.e. it assumes that a specific cross compiler is installed
# on the Haiku system where this package is being used.
# The main use of this package is to provide HaikuPorter with a development
# environment for a cross-build Haiku platform.
local primaryArchitecture = $(HAIKU_PACKAGING_ARCHS[1]) ;
local architecture = $(TARGET_PACKAGING_ARCH) ;
local isPrimaryArchitecture = [ MultiArchIfPrimary 1 : ] ;
local packageNameSuffix = $(primaryArchitecture) ;
local architectureSubDir ;
if ! $(isPrimaryArchitecture) {
packageNameSuffix = $(primaryArchitecture)_$(architecture) ;
architectureSubDir = $(architecture) ;
}
local additionalLibraries_stage1 ;
local additionalLibraries
= [ MultiArchDefaultGristFiles libbe.so libnetwork.so libpackage.so ] ;
local stage ;
for stage in _stage1 "" {
# first create the actual cross development package
local haikuCrossDevelSysrootPackage
= haiku_cross_devel_sysroot$(stage)_$(packageNameSuffix).hpkg ;
HaikuPackage $(haikuCrossDevelSysrootPackage) ;
local developCrossLibDirTokens = develop lib $(architectureSubDir) ;
# glue code
AddFilesToPackage $(developCrossLibDirTokens) :
<src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crti.o
<src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crtn.o
<src!system!glue!$(architecture)>init_term_dyn.o
<src!system!glue!$(architecture)>start_dyn.o
<src!system!glue!$(architecture)>haiku_version_glue.o
;
# kernel
if $(isPrimaryArchitecture) {
AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ;
}
# libraries
AddLibrariesToPackage $(developCrossLibDirTokens) :
[ MultiArchDefaultGristFiles libbsd.so ]
[ MultiArchDefaultGristFiles libroot.so : revisioned ]
$(HAIKU_SHARED_LIBSTDC++_$(architecture))
$(HAIKU_SHARED_LIBSUPC++_$(architecture))
$(additionalLibraries$(stage))
;
# static libraries
AddFilesToPackage $(developCrossLibDirTokens)
: <$(architecture)>liblocalestub.a ;
# the POSIX error code mapper library
AddFilesToPackage $(developCrossLibDirTokens)
: [ MultiArchDefaultGristFiles libposix_error_mapper.a ] ;
# headers
local developCrossHeadersDirTokens = develop headers ;
local headerDir ;
for headerDir in config glibc os posix {
CopyDirectoryToPackage $(developCrossHeadersDirTokens)
: [ FDirName $(HAIKU_TOP) headers $(headerDir) ] ;
}
# BSD and GNU compatibility headers
for headerDir in bsd gnu {
CopyDirectoryToPackage $(developCrossHeadersDirTokens)
: [ FDirName $(HAIKU_TOP) headers compatibility $(headerDir) ] ;
}
# cpp headers
if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 {
# GCC 2 only -- for GCC 4 they come with the DevelopmentBase package
CopyDirectoryToPackage $(developCrossHeadersDirTokens) c++
: [ FDirName $(HAIKU_TOP) headers cpp ] : 2.95.3 ;
}
BuildHaikuPackage $(haikuCrossDevelSysrootPackage)
: haiku_cross_devel_sysroot ;
# Now create a wrapper package which just contains the actual cross
# development package. This wrapper package can safely be installed into the
# system hierarchy of the target system, from where haikuporter will fetch
# it when needed.
local haikuCrossDevelPackage
= haiku_cross_devel$(stage)_$(packageNameSuffix).hpkg ;
HaikuPackage $(haikuCrossDevelPackage) ;
# add the wrapped package
local developCrossDirTokens = develop cross ;
AddFilesToPackage $(developCrossDirTokens)
: $(haikuCrossDevelSysrootPackage) ;
BuildHaikuPackage $(haikuCrossDevelPackage) : haiku_cross_devel ;
}

View File

@ -0,0 +1,94 @@
local architecture = $(HAIKU_PACKAGING_ARCHS[1]) ;
local haikuDevelPackage = haiku_devel.hpkg ;
HaikuPackage $(haikuDevelPackage) ;
local arch = $(TARGET_ARCH) ;
# glue code
AddFilesToPackage develop lib :
<src!system!glue!arch!$(arch)!$(architecture)>crti.o
<src!system!glue!arch!$(arch)!$(architecture)>crtn.o
<src!system!glue!$(architecture)>init_term_dyn.o
<src!system!glue!$(architecture)>start_dyn.o
<src!system!glue!$(architecture)>haiku_version_glue.o
;
# kernel
AddFilesToPackage develop lib : kernel.so : _KERNEL_ ;
# additional libraries
local developmentLibs = <revisioned>libroot_debug.so ;
AddFilesToPackage lib : $(developmentLibs) ;
# library symlinks
local lib ;
for lib in [ HaikuImageGetSystemLibs ] $(developmentLibs) {
AddSymlinkToPackage develop lib : /system/lib $(lib:BS) ;
local abiVersion = [ on $(lib) return $(HAIKU_LIB_ABI_VERSION) ] ;
if $(abiVersion) {
local abiVersionedLib = $(lib:BS).$(abiVersion) ;
AddSymlinkToPackage develop lib
: /system/lib $(abiVersionedLib) ;
}
}
# static libraries
AddFilesToPackage develop lib : <$(architecture)>liblocalestub.a ;
# the POSIX error code mapper library
AddFilesToPackage develop lib : libposix_error_mapper.a ;
# ABI independent stuff
# headers
AddHeaderDirectoryToPackage config ;
AddHeaderDirectoryToPackage glibc ;
AddHeaderDirectoryToPackage os ;
AddHeaderDirectoryToPackage posix ;
# private headers
AddHeaderDirectoryToPackage private ;
CopyDirectoryToPackage develop headers private libs compat
: [ FDirName $(HAIKU_TOP) src libs compat freebsd_network ]
: : -x *.c -x *.cpp -x *.awk -x Jamfile -x miidevs ;
CopyDirectoryToPackage develop headers private libs compat
: [ FDirName $(HAIKU_TOP) src libs compat freebsd_wlan ]
: : -x *.c -x Jamfile ;
# create be -> os symlink for now
AddSymlinkToPackage develop headers : os : be ;
# BSD and GNU compatibility headers
AddHeaderDirectoryToPackage compatibility bsd : bsd ;
AddHeaderDirectoryToPackage compatibility gnu : gnu ;
# third party libs headers
if ! $(HAIKU_BOOTSTRAP_BUILD) {
AddHeaderDirectoryToPackage libs tiff : 3rdparty ;
}
# cpp headers
if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 {
# GCC 2 only -- for GCC 4 they come with the gcc package
CopyDirectoryToPackage develop headers c++
: [ FDirName $(HAIKU_TOP) headers cpp ] : 2.95.3 ;
}
# OpenGL headers
if $(TARGET_ARCH) = x86 && ! $(HAIKU_BOOTSTRAP_BUILD) {
local mesaGlHeaders
= [ FDirName [ BuildFeatureAttribute mesa : headers : path ] GL ] ;
local mesaGlHeadersDependency = [ BuildFeatureAttribute mesa : headers ] ;
mesaGlHeaders = $(mesaGlHeaders:G=$(mesaGlHeadersDependency:G)) ;
Depends $(mesaGlHeaders) : $(mesaGlHeadersDependency) ;
CopyDirectoryToPackage develop headers os opengl
: $(mesaGlHeaders) : : : isTarget ;
}
# Deskbar menu symlinks
AddSymlinkToPackage data deskbar menu Applications
: ../../../../apps/Debugger : Debugger ;
BuildHaikuPackage $(haikuDevelPackage) : haiku_devel ;

View File

@ -0,0 +1,64 @@
local architecture = $(TARGET_PACKAGING_ARCH) ;
local haikuDevelPackage = haiku_$(architecture)_devel.hpkg ;
HaikuPackage $(haikuDevelPackage) ;
local arch = $(TARGET_ARCH) ;
# glue code
AddFilesToPackage develop lib $(architecture) :
<src!system!glue!arch!$(arch)!$(architecture)>crti.o
<src!system!glue!arch!$(arch)!$(architecture)>crtn.o
<src!system!glue!$(architecture)>init_term_dyn.o
<src!system!glue!$(architecture)>start_dyn.o
<src!system!glue!$(architecture)>haiku_version_glue.o
;
# additional libraries
local developmentLibs = <revisioned>libroot_debug.so ;
AddFilesToPackage lib : $(developmentLibs) ;
# library symlinks
local lib ;
for lib in [ HaikuImageGetSystemLibs ] $(developmentLibs) {
AddSymlinkToPackage develop lib $(architecture)
: /system/lib/$(architecture) $(lib:BS) ;
local abiVersion = [ on $(lib) return $(HAIKU_LIB_ABI_VERSION) ] ;
if $(abiVersion) {
local abiVersionedLib = $(lib:BS).$(abiVersion) ;
AddSymlinkToPackage develop lib $(architecture)
: /system/lib/$(architecture) $(abiVersionedLib) ;
}
}
# static libraries
AddFilesToPackage develop lib $(architecture)
: <$(architecture)>liblocalestub.a ;
# the POSIX error code mapper library
AddFilesToPackage develop lib $(architecture)
: libposix_error_mapper.a ;
# ABI independent stuff
# cpp headers
if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 {
# GCC 2 only -- for GCC 4 they come with the gcc package
CopyDirectoryToPackage develop headers c++
: [ FDirName $(HAIKU_TOP) headers cpp ] : 2.95.3 ;
}
# OpenGL headers
if $(TARGET_ARCH) = x86 && ! $(HAIKU_BOOTSTRAP_BUILD) {
local mesaGlHeaders
= [ FDirName [ BuildFeatureAttribute mesa : headers : path ] GL ] ;
local mesaGlHeadersDependency = [ BuildFeatureAttribute mesa : headers ] ;
mesaGlHeaders = $(mesaGlHeaders:G=$(mesaGlHeadersDependency:G)) ;
Depends $(mesaGlHeaders) : $(mesaGlHeadersDependency) ;
CopyDirectoryToPackage develop headers $(architecture) os opengl
: $(mesaGlHeaders) : : : isTarget ;
}
BuildHaikuPackage $(haikuDevelPackage) : haiku_devel_secondary ;

View File

@ -0,0 +1,13 @@
local haikuLoaderPackage = haiku_loader.hpkg ;
HaikuPackage $(haikuLoaderPackage) ;
# boot loader
AddFilesToPackage : haiku_loader ;
# Force no compression, so the stage one loader can directly execute the boot
# loader.
HAIKU_PACKAGE_COMPRESSION_LEVEL on $(haikuLoaderPackage) = 0 ;
BuildHaikuPackage $(haikuLoaderPackage) : haiku_loader ;

View File

@ -0,0 +1,49 @@
local architecture = $(TARGET_PACKAGING_ARCH) ;
local haikuPackage = haiku_$(architecture).hpkg ;
HaikuPackage $(haikuPackage) ;
# libs
AddLibrariesToPackage lib $(architecture)
: [ HaikuImageGetSystemLibs ] [ HaikuImageGetPrivateSystemLibs ] ;
# libnetwork.so replaces quite a few libraries
if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 {
local libNetworkAliases = libsocket.so libbind.so libnet.so ;
local lib ;
for lib in $(libNetworkAliases) {
AddSymlinkToPackage lib $(architecture) : libnetwork.so : $(lib) ;
}
AddSymlinkToPackage lib $(architecture) : libbnetapi.so : libnetapi.so ;
}
# # add-ons
# local addOnsDir = add-ons $(architecture) ;
#
# AddFilesToPackage $(addOnsDir) accelerants
# : $(SYSTEM_ADD_ONS_ACCELERANTS) ;
# AddFilesToPackage $(addOnsDir) Translators
# : $(SYSTEM_ADD_ONS_TRANSLATORS) ;
# AddFilesToPackage $(addOnsDir) locale catalogs
# : $(SYSTEM_ADD_ONS_LOCALE_CATALOGS) ;
#
# AddFilesToPackage $(addOnsDir) opengl :
# x86 @{
# Legacy\ Software\ Rasterizer@gcc2
# Software\ Rasterizer@!gcc2
# }@ # x86
# ;
#
# AddFilesToPackage $(addOnsDir) media : $(SYSTEM_ADD_ONS_MEDIA) ;
# AddFilesToPackage $(addOnsDir) media plugins
# : $(SYSTEM_ADD_ONS_MEDIA_PLUGINS) ;
#
# AddFilesToPackage $(addOnsDir) disk_systems
# : <disk_system>intel <disk_system>gpt <disk_system>bfs <disk_system>ntfs ;
BuildHaikuPackage $(haikuPackage) : haiku_secondary ;

View File

@ -0,0 +1,24 @@
local architecture = $(TARGET_PACKAGING_ARCH) ;
local haikuPackage = haiku_$(architecture).hpkg ;
HaikuPackage $(haikuPackage) ;
# libs
AddLibrariesToPackage lib $(architecture)
: [ HaikuImageGetSystemLibs ] [ HaikuImageGetPrivateSystemLibs ] ;
# libnetwork.so replaces quite a few libraries
if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 {
local libNetworkAliases = libsocket.so libbind.so libnet.so ;
local lib ;
for lib in $(libNetworkAliases) {
AddSymlinkToPackage lib $(architecture) : libnetwork.so : $(lib) ;
}
AddSymlinkToPackage lib $(architecture) : libbnetapi.so : libnetapi.so ;
}
BuildHaikuPackage $(haikuPackage) : haiku_secondary ;

View File

@ -0,0 +1,9 @@
local haikuUserGuidePackage = haiku_userguide.hpkg ;
HaikuPackage $(haikuUserGuidePackage) ;
CopyDirectoryToPackage documentation : [ FDirName $(HAIKU_TOP) docs userguide ]
: userguide ;
SEARCH on userguide = [ FDirName $(HAIKU_TOP) data bin ] ;
AddFilesToPackage bin : userguide ;
BuildHaikuPackage $(haikuUserGuidePackage) : haiku_userguide ;

View File

@ -0,0 +1,9 @@
local haikuWelcomePackage = haiku_welcome.hpkg ;
HaikuPackage $(haikuWelcomePackage) ;
CopyDirectoryToPackage documentation : [ FDirName $(HAIKU_TOP) docs welcome ]
: welcome ;
SEARCH on welcome = [ FDirName $(HAIKU_TOP) data bin ] ;
AddFilesToPackage bin : welcome ;
BuildHaikuPackage $(haikuWelcomePackage) : haiku_welcome ;

View File

@ -0,0 +1,12 @@
local makefileEnginePackage = makefile_engine.hpkg ;
HaikuPackage $(makefileEnginePackage) ;
# skeleton makefile and makefile-engine
local makefileEngineFiles =
<makefile-engine>makefile
<makefile-engine>makefile-engine
;
SEARCH on $(makefileEngineFiles) = [ FDirName $(HAIKU_TOP) data develop ] ;
AddFilesToPackage develop etc : $(makefileEngineFiles) ;
BuildHaikuPackage $(makefileEnginePackage) : makefile_engine ;

View File

@ -0,0 +1,11 @@
if [ FIsBuildFeatureEnabled webpositive ] {
local architecture = $(TARGET_PACKAGING_ARCH) ;
local webpositivePackage = webpositive.hpkg ;
HaikuPackage $(webpositivePackage) ;
AddFilesToPackage apps : WebPositive ;
AddSymlinkToPackage data deskbar menu Applications
: ../../../../apps/WebPositive : WebPositive ;
BuildHaikuPackage $(webpositivePackage) : webpositive ;
}

View File

@ -0,0 +1,251 @@
RemotePackageRepository HaikuPorts
: x86
: http://haiku-files.org/files/repo
:
# architecture "any" packages
be_book-2008_10_26-1
ca_root_certificates-2012_12_29-1
texi2html-1.82-2
timgmsoundfont-2004_01_24-3
wqy_microhei-0.2.0~beta-3
:
# repository architecture packages
# primary architecture (x86)
apr-1.4.6-7
apr_devel-1.4.6-7
apr_util-1.4.1-4
apr_util_devel-1.4.1-4
autoconf-2.69-4
automake-1.13.1-4
# bepdf-1.1.1~beta5_2013_04_28-1
binutils-2.23.2_2013_04_09-1
bison-2.4.3-5
bzip2-1.0.6-3
cdrtools-3.01~a07-3
cmake-2.8.5-6
ctags-5.8-3
curl-7.26.0-5
curl_devel-7.26.0-5
cvs-1.12.13.1-5
doxygen-1.6.3-4
expat-2.0.1-7
expat_devel-2.0.1-7
ffmpeg-0.10.2-4
ffmpeg_devel-0.10.2-4
flex-2.5.35-6
freetype-2.4.9-3
freetype_devel-2.4.9-3
gcc-4.7.3_2013_08_12-2
gettext-0.18.1.1-5
gettext_libintl-0.18.1.1-5
git-1.8.3.4-1
git_arch-1.8.3.4-1
git_cvs-1.8.3.4-1
git_daemon-1.8.3.4-1
git_email-1.8.3.4-1
git_svn-1.8.3.4-1
glu-9.0.0-2
glu_devel-9.0.0-2
gperf-3.0.4-1
grep-2.14-5
groff-1.20.1-2
haikuwebkit-1.1.3_2013_08_09-2
haikuwebkit_devel-1.1.3_2013_08_09-2
htmldoc-1.8.27-3
icu-4.8.1.1-4
icu_devel-4.8.1.1-4
jam-2.5_2012_10_12-1
jpeg-9-3
jpeg_devel-9-3
jpeg_tools-9-3
keymapswitcher-1.2.7.10-1
libedit-2012_06_01_3.0-1
libedit_devel-2012_06_01_3.0-1
libiconv-1.13.1-6
libiconv_devel-1.13.1-6
libogg-1.3.0-2
libogg_devel-1.3.0-2
libpcre-8.21-5
libpng-1.5.12-3
libpng_devel-1.5.12-3
libsolv-0.3.0_haiku_2013_06_16-2
libsolv_devel-0.3.0_haiku_2013_06_16-2
libtheora-1.1.1-2
libtheora_devel-1.1.1-2
libtool-2.4-8
libtool_libltdl-2.4-8
libvorbis-1.3.2-2
libvorbis_devel-1.3.2-2
libvpx-1.0.0-2
libvpx_devel-1.0.0-2
libxml2-2.8.0-5
libxml2_devel-2.8.0-5
libxml2_python-2.8.0-5
m4-1.4.16-5
make-3.82-5
man-1.6g-2
mercurial-2.2.2-3
mesa-9.1.1-1
mesa_devel-9.1.1-1
mkdepend-1.7-3
nano-2.2.6-3
ncurses-5.9-10
ncurses_devel-5.9-10
neon-0.29.6-7
neon_devel-0.29.6-7
openssh-6.0p1-8
openssl-1.0.0j-3
openssl_devel-1.0.0j-3
p7zip-9.20.1-4
pe-2.4.3_hg602-5
perl-5.10.1-6
pkgconfig-0.27.1-1
python-2.6.8-5
readline-6.2-3
scons-2.2.0-1
sed-4.2.1-6
speex-1.2~rc1-2
speex_devel-1.2~rc1-2
sqlite-3.7.13-4
sqlite_devel-3.7.13-4
subversion-1.6.18-6
subversion_devel-1.6.18-6
tar-1.26-6
texinfo-4.13a-7
vision-0.9.7.r944-1
wpa_supplicant-2.0-3
xz_utils-5.0.4-1
yasm-1.2.0-3
zlib-1.2.8-3
zlib_devel-1.2.8-3
# secondary architecture (x86_gcc2)
binutils_x86_gcc2-2.17_2013_04_21-2
curl_x86_gcc2-7.26.0-5
curl_x86_gcc2_devel-7.26.0-5
expat_x86_gcc2-2.0.1-7
expat_x86_gcc2_devel-2.0.1-7
ffmpeg_x86_gcc2-0.10.2-4
ffmpeg_x86_gcc2_devel-0.10.2-4
freetype_x86_gcc2-2.4.9-3
freetype_x86_gcc2_devel-2.4.9-3
gcc_x86_gcc2-2.95.3_2013_08_15-2
gettext_x86_gcc2-0.18.1.1-5
gettext_x86_gcc2_libintl-0.18.1.1-5
glu_x86_gcc2-9.0.0-2
glu_x86_gcc2_devel-9.0.0-2
icu_x86_gcc2-4.8.1.1-4
icu_x86_gcc2_devel-4.8.1.1-4
jpeg_x86_gcc2-9-3
jpeg_x86_gcc2_devel-9-3
libiconv_x86_gcc2-1.13.1-6
libiconv_x86_gcc2_devel-1.13.1-6
libogg_x86_gcc2-1.3.0-2
libogg_x86_gcc2_devel-1.3.0-2
libpng_x86_gcc2-1.5.12-3
libpng_x86_gcc2_devel-1.5.12-3
libsolv_x86_gcc2-0.3.0_haiku_2013_06_16-2
libsolv_x86_gcc2_devel-0.3.0_haiku_2013_06_16-2
libtheora_x86_gcc2-1.1.1-2
libtheora_x86_gcc2_devel-1.1.1-2
libvorbis_x86_gcc2-1.3.2-2
libvorbis_x86_gcc2_devel-1.3.2-2
libvpx_x86_gcc2-1.0.0-2
libvpx_x86_gcc2_devel-1.0.0-2
libxml2_x86_gcc2-2.8.0-5
libxml2_x86_gcc2_devel-2.8.0-5
mesa_x86_gcc2-7.8.2-3
mesa_x86_gcc2_devel-7.8.2-3
ncurses_x86_gcc2-5.9-10
ncurses_x86_gcc2_devel-5.9-10
openssl_x86_gcc2-1.0.0j-3
openssl_x86_gcc2_devel-1.0.0j-3
speex_x86_gcc2-1.2~rc1-2
speex_x86_gcc2_devel-1.2~rc1-2
sqlite_x86_gcc2-3.7.13-4
sqlite_x86_gcc2_devel-3.7.13-4
wonderbrush_x86_gcc2-2.1.2-4
zlib_x86_gcc2-1.2.8-3
zlib_x86_gcc2_devel-1.2.8-3
:
# source packages
apr
autoconf
automake
# bepdf
binutils
binutils_x86_gcc2
bison
bzip2
cdrtools
cmake
ctags
curl
cvs
doxygen
expat
ffmpeg
flex
freetype
gcc
gcc_x86_gcc2
gettext
git
glu
gperf
grep
groff
haikuwebkit
htmldoc
icu
jam
jpeg
keymapswitcher
libedit
libiconv
libogg
libpcre
libpng
libsolv
libtheora
libtool
libvorbis
libvpx
libxml2
m4
make
man
mercurial
mesa
mesa_x86_gcc2
mkdepend
nano
ncurses
neon
openssh
openssl
p7zip
pe
perl
pkgconfig
python
readline
scons
sed
speex
sqlite
subversion
tar
texi2html
texinfo
vision
wpa_supplicant
yasm
xz_utils
zlib
:
# debuginfo packages
grep
sed
tar
;

View File

@ -0,0 +1,198 @@
RemotePackageRepository HaikuPorts
: x86_64
: http://haiku-files.org/files/repo
:
# architecture "any" packages
be_book-2008_10_26-1
ca_root_certificates-2012_12_29-1
texi2html-1.82-2
timgmsoundfont-2004_01_24-4
wqy_microhei-0.2.0~beta-3
:
# repository architecture packages
# primary architecture (x86_64)
apr-1.4.6-7
apr_devel-1.4.6-7
apr_util-1.4.1-4
apr_util_devel-1.4.1-4
autoconf-2.69-4
automake-1.13.1-4
# bepdf-1.1.1~beta5_2013_04_28-1
binutils-2.23.2_2013_04_09-2
bison-2.4.3-5
bzip2-1.0.6-3
cdrtools-3.01~a07-3
cmake-2.8.5-6
ctags-5.8-3
curl-7.26.0-5
curl_devel-7.26.0-5
cvs-1.12.13.1-5
doxygen-1.6.3-4
expat-2.0.1-7
expat_devel-2.0.1-7
# ffmpeg-0.10.2-4
# ffmpeg_devel-0.10.2-4
flex-2.5.35-6
freetype-2.4.9-3
freetype_devel-2.4.9-3
gcc-4.7.3_2013_08_12-2
gettext-0.18.1.1-5
gettext_libintl-0.18.1.1-5
git-1.8.3.4-1
git_arch-1.8.3.4-1
git_cvs-1.8.3.4-1
git_daemon-1.8.3.4-1
git_email-1.8.3.4-1
git_svn-1.8.3.4-1
glu-9.0.0-2
glu_devel-9.0.0-2
gperf-3.0.4-1
grep-2.14-5
groff-1.20.1-2
haikuwebkit-1.1.3_2013_08_09-2
haikuwebkit_devel-1.1.3_2013_08_09-2
htmldoc-1.8.27-3
icu-4.8.1.1-4
icu_devel-4.8.1.1-4
jam-2.5_2012_10_12-1
jpeg-9-3
jpeg_devel-9-3
jpeg_tools-9-3
keymapswitcher-1.2.7.10-1
libedit-2012_06_01_3.0-1
libiconv-1.13.1-6
libiconv_devel-1.13.1-6
# libogg-1.3.0-2
# libogg_devel-1.3.0-2
libpcre-8.21-5
libpcre_devel-8.21-5
libpng-1.5.12-3
libpng_devel-1.5.12-3
libsolv-0.3.0_haiku_2013_06_16-2
libsolv_devel-0.3.0_haiku_2013_06_16-2
# libtheora-1.1.1-2
# libtheora_devel-1.1.1-2
libtool-2.4-8
libtool_libltdl-2.4-8
# libvorbis-1.3.2-2
# libvorbis_devel-1.3.2-2
# libvpx-1.0.0-2
# libvpx_devel-1.0.0-2
libxml2-2.8.0-5
libxml2_devel-2.8.0-5
libxml2_python-2.8.0-5
m4-1.4.16-5
make-3.82-5
man-1.6g-2
mercurial-2.2.2-3
mesa-9.1.1-1
mesa_devel-9.1.1-1
mkdepend-1.7-3
nano-2.2.6-3
ncurses-5.9-10
ncurses_devel-5.9-10
neon-0.29.6-7
neon_devel-0.29.6-7
openssh-6.0p1-7
openssl-1.0.0j-3
openssl_devel-1.0.0j-3
p7zip-9.20.1-5
pe-2.4.3_hg611-1
perl-5.10.1-6
pkgconfig-0.27.1-1
python-2.6.8-5
readline-6.2-3
scons-2.2.0-1
sed-4.2.1-6
# speex-1.2~rc1-2
# speex_devel-1.2~rc1-2
sqlite-3.7.13-4
sqlite_devel-3.7.13-4
subversion-1.6.18-6
subversion_devel-1.6.18-6
tar-1.26-6
texinfo-4.13a-7
vision-0.9.7.r945-1
wpa_supplicant-2.0-3
xz_utils-5.0.4-2
yasm-1.2.0-3
zlib-1.2.8-3
zlib_devel-1.2.8-3
:
# source packages
apr
autoconf
automake
# bepdf
binutils
bison
bzip2
cdrtools
cmake
ctags
curl
cvs
doxygen
expat
# ffmpeg
flex
freetype
gcc
gettext
git
glu
gperf
grep
groff
haikuwebkit
htmldoc
icu
jam
jpeg
keymapswitcher
libedit
libiconv
# libogg
libpcre
libpng
libsolv
# libtheora
libtool
# libvorbis
# libvpx
libxml2
m4
make
man
mercurial
mesa
mkdepend
nano
ncurses
neon
openssh
openssl
p7zip
pe
perl
pkgconfig
python
readline
scons
sed
# speex
sqlite
subversion
tar
texi2html
texinfo
vision
wpa_supplicant
yasm
xz_utils
zlib
:
# debuginfo packages
;

View File

@ -0,0 +1,251 @@
RemotePackageRepository HaikuPorts
: x86_gcc2
: http://haiku-files.org/files/repo
:
# architecture "any" packages
be_book-2008_10_26-1
ca_root_certificates-2012_12_29-1
texi2html-1.82-2
timgmsoundfont-2004_01_24-3
wqy_microhei-0.2.0~beta-3
:
# repository architecture packages
# primary architecture (x86_gcc2)
apr-1.4.6-7
apr_devel-1.4.6-7
apr_util-1.4.1-3
apr_util_devel-1.4.1-3
autoconf-2.69-4
automake-1.13.1-4
bepdf-1.1.1~beta5_2013_04_28-1
# bezillabrowser-2.0.0.22pre_2010_05_02-1
binutils-2.17_2013_04_21-2
bison-2.4.3-5
bzip2-1.0.6-3
cdrtools-3.01~a07-3
cmake-2.8.5-6
ctags-5.8-3
curl-7.26.0-5
curl_devel-7.26.0-5
cvs-1.12.13.1-5
doxygen-1.6.3-3
expat-2.0.1-7
expat_devel-2.0.1-7
ffmpeg-0.10.2-4
ffmpeg_devel-0.10.2-4
flex-2.5.35-6
freetype-2.4.9-3
freetype_devel-2.4.9-3
gcc-2.95.3_2013_08_15-2
gettext-0.18.1.1-5
gettext_libintl-0.18.1.1-5
git-1.8.3.4-1
git_arch-1.8.3.4-1
git_cvs-1.8.3.4-1
git_daemon-1.8.3.4-1
git_email-1.8.3.4-1
git_svn-1.8.3.4-1
glu-9.0.0-2
glu_devel-9.0.0-2
gperf-3.0.4-1
grep-2.14-5
groff-1.20.1-2
htmldoc-1.8.27-3
icu-4.8.1.1-4
icu_devel-4.8.1.1-4
jam-2.5_2012_10_12-1
jpeg-9-3
jpeg_devel-9-3
jpeg_tools-9-3
keymapswitcher-1.2.7.10-1
libedit-2012_06_01_3.0-1
libiconv-1.13.1-6
libiconv_devel-1.13.1-6
libogg-1.3.0-2
libogg_devel-1.3.0-2
libpcre-8.21-5
libpng-1.5.12-3
libpng_devel-1.5.12-3
libsolv-0.3.0_haiku_2013_06_16-2
libsolv_devel-0.3.0_haiku_2013_06_16-2
libtheora-1.1.1-2
libtheora_devel-1.1.1-2
libtool-2.4-8
libtool_libltdl-2.4-8
libvorbis-1.3.2-2
libvorbis_devel-1.3.2-2
libvpx-1.0.0-2
libvpx_devel-1.0.0-2
libxml2-2.8.0-5
libxml2_devel-2.8.0-5
libxml2_python-2.8.0-5
m4-1.4.16-5
make-3.82-5
man-1.6g-2
mercurial-2.2.2-3
mesa-7.8.2-3
mesa_devel-7.8.2-3
mkdepend-1.7-3
nano-2.2.6-3
ncurses-5.9-9
ncurses_devel-5.9-9
neon-0.29.6-6
neon_devel-0.29.6-6
openssh-6.0p1-8
openssl-1.0.0j-3
openssl_devel-1.0.0j-3
p7zip-9.20.1-4
pe-2.4.3_hg602-4
perl-5.10.1-6
pkgconfig-0.27.1-1
python-2.6.8-4
readline-6.2-3
scons-2.2.0-1
sed-4.2.1-6
speex-1.2~rc1-2
speex_devel-1.2~rc1-2
sqlite-3.7.13-4
sqlite_devel-3.7.13-4
subversion-1.6.18-6
subversion_devel-1.6.18-6
tar-1.26-6
texinfo-4.13a-7
vision-0.9.7.r944-1
wonderbrush-2.1.2-4
wpa_supplicant-2.0-3
yasm-1.2.0-3
zlib-1.2.8-3
zlib_devel-1.2.8-3
# secondary architecture (x86)
binutils_x86-2.23.2_2013_04_09-1
curl_x86-7.26.0-5
curl_x86_devel-7.26.0-5
expat_x86-2.0.1-7
expat_x86_devel-2.0.1-7
ffmpeg_x86-0.10.2-3
ffmpeg_x86_devel-0.10.2-3
freetype_x86-2.4.9-3
freetype_x86_devel-2.4.9-3
gcc_x86-4.7.3_2013_08_12-2
gettext_x86-0.18.1.1-5
gettext_x86_libintl-0.18.1.1-5
glu_x86-9.0.0-2
glu_x86_devel-9.0.0-2
haikuwebkit_x86-1.1.3_2013_08_09-2
haikuwebkit_x86_devel-1.1.3_2013_08_09-2
icu_x86-4.8.1.1-4
icu_x86_devel-4.8.1.1-4
jpeg_x86-9-3
jpeg_x86_devel-9-3
libiconv_x86-1.13.1-6
libiconv_x86_devel-1.13.1-6
libogg_x86-1.3.0-2
libogg_x86_devel-1.3.0-2
libpng_x86-1.5.12-3
libpng_x86_devel-1.5.12-3
libsolv_x86-0.3.0_haiku_2013_06_16-2
libsolv_x86_devel-0.3.0_haiku_2013_06_16-2
libtheora_x86-1.1.1-2
libtheora_x86_devel-1.1.1-2
libvorbis_x86-1.3.2-2
libvorbis_x86_devel-1.3.2-2
libvpx_x86-1.0.0-2
libvpx_x86_devel-1.0.0-2
libxml2_x86-2.8.0-5
libxml2_x86_devel-2.8.0-5
mesa_x86-9.1.1-1
mesa_x86_devel-9.1.1-1
ncurses_x86-5.9-9
ncurses_x86_devel-5.9-9
openssl_x86-1.0.0j-3
openssl_x86_devel-1.0.0j-3
speex_x86-1.2~rc1-2
speex_x86_devel-1.2~rc1-2
sqlite_x86-3.7.13-4
sqlite_x86_devel-3.7.13-4
xz_utils_x86-5.0.4-1
zlib_x86-1.2.8-3
zlib_x86_devel-1.2.8-3
:
# source packages
apr
autoconf
automake
bepdf
binutils
binutils_x86
bison
bzip2
cdrtools
cmake
ctags
curl
cvs
doxygen
expat
ffmpeg
flex
freetype
gcc
gcc_x86
gettext
git
glu
gperf
grep
groff
haikuwebkit_x86
htmldoc
icu
jam
jpeg
keymapswitcher
libedit
libiconv
libogg
libpcre
libpng
libsolv
libtheora
libtool
libvorbis
libvpx
libxml2
m4
make
man
mercurial
mesa
mesa_x86
mkdepend
nano
ncurses
neon
openssh
openssl
p7zip
pe
perl
pkgconfig
python
readline
scons
sed
speex
sqlite
subversion
tar
texi2html
texinfo
vision
wpa_supplicant
yasm
xz_utils_x86
zlib
:
# debuginfo packages
grep
sed
tar
;

View File

@ -0,0 +1,74 @@
BootstrapPackageRepository HaikuPortsCross
: x86
:
# architecture "any" packages
haikuporter-0-1
:
# repository architecture packages (stage 1)
autoconf_bootstrap-2.69-1
automake_bootstrap-1.13.1-1
binutils_bootstrap-2.23.2_2013_04_09-3
bison_bootstrap-2.4.3-1
flex_bootstrap-2.5.35-1
freetype_bootstrap-2.4.9-1
freetype_bootstrap_devel-2.4.9-1
gcc_bootstrap-4.7.3_2013_08_12-1
grep_bootstrap-2.14-1
icu_bootstrap-4.8.1.1-1
icu_bootstrap_devel-4.8.1.1-1
libtool_bootstrap-2.4-8
libtool_bootstrap_libltdl-2.4-8
m4_bootstrap-1.4.16-1
make_bootstrap-3.82-1
ncurses_bootstrap-5.9-1
ncurses_bootstrap_devel-5.9-1
python_bootstrap-2.6.8-1
sed_bootstrap-4.2.1-1
texinfo_bootstrap-4.13a-1
zlib_bootstrap-1.2.8-2
zlib_bootstrap_devel-1.2.8-2
secondary_x86_gcc2 @{
binutils_bootstrap_x86_gcc2-2.17_2013_04_21-3
freetype_bootstrap_x86_gcc2-2.4.9-1
freetype_bootstrap_x86_gcc2_devel-2.4.9-1
gcc_bootstrap_x86_gcc2-2.95.3_2013_08_15-1
icu_bootstrap_x86_gcc2-4.8.1.1-1
icu_bootstrap_x86_gcc2_devel-4.8.1.1-1
ncurses_bootstrap_x86_gcc2-5.9-1
ncurses_bootstrap_x86_gcc2_devel-5.9-1
zlib_bootstrap_x86_gcc2-1.2.8-2
zlib_bootstrap_x86_gcc2_devel-1.2.8-2
}@ # secondary_x86_gcc2
:
# repository architecture packages (stage 2)
libsolv_bootstrap-0.3.0_haiku_2013_06_16-1
libsolv_bootstrap_devel-0.3.0_haiku_2013_06_16-1
secondary_x86_gcc2 @{
libsolv_bootstrap_x86_gcc2-0.3.0_haiku_2013_06_16-1
libsolv_bootstrap_x86_gcc2_devel-0.3.0_haiku_2013_06_16-1
}@ # secondary_x86_gcc2
:
# source packages
autoconf_bootstrap
automake_bootstrap
binutils_bootstrap
bison_bootstrap
flex_bootstrap
freetype_bootstrap
gawk_bootstrap
gcc_bootstrap
grep_bootstrap
libsolv_bootstrap
libtool_bootstrap
m4_bootstrap
make_bootstrap
ncurses_bootstrap
python_bootstrap
sed_bootstrap
texinfo_bootstrap
zlib_bootstrap
:
# debuginfo packages
;

View File

@ -0,0 +1,57 @@
BootstrapPackageRepository HaikuPortsCross
: x86_64
:
# architecture "any" packages
haikuporter-0-1
:
# repository architecture packages (stage 1)
autoconf_bootstrap-2.69-1
automake_bootstrap-1.13.1-1
binutils_bootstrap-2.23.2_2013_04_09-3
bison_bootstrap-2.4.3-1
flex_bootstrap-2.5.35-1
freetype_bootstrap-2.4.9-1
freetype_bootstrap_devel-2.4.9-1
gcc_bootstrap-4.7.3_2013_08_12-1
grep_bootstrap-2.14-1
icu_bootstrap-4.8.1.1-1
icu_bootstrap_devel-4.8.1.1-1
libtool_bootstrap-2.4-8
libtool_bootstrap_libltdl-2.4-8
m4_bootstrap-1.4.16-1
make_bootstrap-3.82-1
ncurses_bootstrap-5.9-1
ncurses_bootstrap_devel-5.9-1
python_bootstrap-2.6.8-1
sed_bootstrap-4.2.1-1
texinfo_bootstrap-4.13a-1
zlib_bootstrap-1.2.8-2
zlib_bootstrap_devel-1.2.8-2
:
# repository architecture packages (stage 2)
libsolv_bootstrap-0.3.0_haiku_2013_06_16-1
libsolv_bootstrap_devel-0.3.0_haiku_2013_06_16-1
:
# source packages
autoconf_bootstrap
automake_bootstrap
binutils_bootstrap
bison_bootstrap
flex_bootstrap
freetype_bootstrap
gawk_bootstrap
gcc_bootstrap
grep_bootstrap
libsolv_bootstrap
libtool_bootstrap
m4_bootstrap
make_bootstrap
ncurses_bootstrap
python_bootstrap
sed_bootstrap
texinfo_bootstrap
zlib_bootstrap
:
# debuginfo packages
;

View File

@ -0,0 +1,74 @@
BootstrapPackageRepository HaikuPortsCross
: x86_gcc2
:
# architecture "any" packages
haikuporter-0-1
:
# repository architecture packages (stage 1)
autoconf_bootstrap-2.69-1
automake_bootstrap-1.13.1-1
binutils_bootstrap-2.17_2013_04_21-3
bison_bootstrap-2.4.3-1
flex_bootstrap-2.5.35-1
freetype_bootstrap-2.4.9-1
freetype_bootstrap_devel-2.4.9-1
gcc_bootstrap-2.95.3_2013_08_15-1
grep_bootstrap-2.14-1
icu_bootstrap-4.8.1.1-1
icu_bootstrap_devel-4.8.1.1-1
libtool_bootstrap-2.4-8
libtool_bootstrap_libltdl-2.4-8
m4_bootstrap-1.4.16-1
make_bootstrap-3.82-1
ncurses_bootstrap-5.9-1
ncurses_bootstrap_devel-5.9-1
python_bootstrap-2.6.8-1
sed_bootstrap-4.2.1-1
texinfo_bootstrap-4.13a-1
zlib_bootstrap-1.2.8-2
zlib_bootstrap_devel-1.2.8-2
secondary_x86 @{
binutils_bootstrap_x86-2.23.2_2013_04_09-3
freetype_bootstrap_x86-2.4.9-1
freetype_bootstrap_x86_devel-2.4.9-1
gcc_bootstrap_x86-4.7.3_2013_08_12-1
icu_bootstrap_x86-4.8.1.1-1
icu_bootstrap_x86_devel-4.8.1.1-1
ncurses_bootstrap_x86-5.9-1
ncurses_bootstrap_x86_devel-5.9-1
zlib_bootstrap_x86-1.2.8-2
zlib_bootstrap_x86_devel-1.2.8-2
}@ # secondary_x86
:
# repository architecture packages (stage 2)
libsolv_bootstrap-0.3.0_haiku_2013_06_16-1
libsolv_bootstrap_devel-0.3.0_haiku_2013_06_16-1
secondary_x86 @{
libsolv_bootstrap_x86-0.3.0_haiku_2013_06_16-1
libsolv_bootstrap_x86_devel-0.3.0_haiku_2013_06_16-1
}@ # secondary_x86
:
# source packages
autoconf_bootstrap
automake_bootstrap
binutils_bootstrap
bison_bootstrap
flex_bootstrap
freetype_bootstrap
gawk_bootstrap
gcc_bootstrap
grep_bootstrap
libsolv_bootstrap
libtool_bootstrap
m4_bootstrap
make_bootstrap
ncurses_bootstrap
python_bootstrap
sed_bootstrap
texinfo_bootstrap
zlib_bootstrap
:
# debuginfo packages
;

View File

@ -1,19 +1,19 @@
#!/bin/sh
# Parameters <haiku sourcedir> <buildtools dir> <haiku output dir>
# Parameters <haiku sourcedir> <buildtools dir> <install dir>
# Influential environmental variable:
# * haikuRequiredLegacyGCCVersion: The required version of the gcc. Will be
# checked against the version in the buildtools directory.
# get and check the parameters
if [ $# -lt 3 ]; then
echo Usage: $0 '<haiku sourcedir> <buildtools dir> <haiku output dir>' >&2
echo Usage: $0 '<haiku sourcedir> <buildtools dir> <install dir>' >&2
exit 1
fi
haikuSourceDir=$1
buildToolsDir=$2/legacy
haikuOutputDir=$3
installDir=$3
shift 3
additionalMakeArgs=$*
# Note: The gcc 2 build has trouble with -jN N > 1, hence we only use the
@ -62,7 +62,7 @@ fi
# create the output dir
mkdir -p $haikuOutputDir || exit 1
mkdir -p $installDir || exit 1
# get absolute paths
@ -76,13 +76,13 @@ cd $buildToolsDir
buildToolsDir=`pwd`
cd $currentDir
cd $haikuOutputDir
haikuOutputDir=`pwd`
cd $installDir
installDir=`pwd`
cd $currentDir
# create the object and installation directories for the cross compilation tools
installDir=$haikuOutputDir/cross-tools
objDir=$haikuOutputDir/cross-tools-build
objDir=${installDir}-build
binutilsObjDir=$objDir/binutils
gccObjDir=$objDir/gcc
tmpIncludeDir=$objDir/sysincludes
@ -94,6 +94,11 @@ mkdir -p $installDir $objDir $binutilsObjDir $gccObjDir $tmpIncludeDir \
$tmpLibDir || exit 1
mkdir -p $installDir/lib/gcc-lib/i586-pc-haiku/$haikuRequiredLegacyGCCVersion
gccConfigureArgs=
if [ -n "$SECONDARY_ARCH" ]; then
gccConfigureArgs="$gccConfigureArgs --with-hybrid-secondary=$SECONDARY_ARCH"
fi
# force the POSIX locale, as the build (makeinfo) might choke otherwise
export LC_ALL=POSIX
@ -108,8 +113,8 @@ cd $binutilsObjDir
CFLAGS="-O2" CXXFLAGS="-O2" $buildToolsDir/binutils/configure \
--prefix=$installDir $buildHostSpec --target=i586-pc-haiku \
--disable-nls --enable-shared=yes --disable-werror || exit 1
make $additionalMakeArgs || exit 1
make $additionalMakeArgs install || exit 1
$MAKE $additionalMakeArgs || exit 1
$MAKE $additionalMakeArgs install || exit 1
PATH=$PATH:$installDir/bin
export PATH
@ -153,7 +158,7 @@ esac
CFLAGS="-O2 -U_FORTIFY_SOURCE" CXXFLAGS="-O2" $buildToolsDir/gcc/configure \
--prefix=$installDir $buildHostSpec --target=i586-pc-haiku \
--disable-nls --enable-shared=yes --enable-languages=c,c++ \
--with-headers=$tmpIncludeDir --with-libs=$tmpLibDir \
--with-headers=$tmpIncludeDir --with-libs=$tmpLibDir $gccConfigureArgs \
|| exit 1
unset CC
@ -168,13 +173,13 @@ eval "sed $sedExpr Makefile.bak > Makefile" || exit 1
rm Makefile.bak
# make gcc
make cross || {
$MAKE cross || {
echo "ERROR: Building gcc failed." >&2
exit 1
}
# install gcc
make install-gcc-cross || {
$MAKE install-gcc-cross || {
echo "ERROR: Installing the cross compiler failed." >&2
exit 1
}
@ -184,6 +189,11 @@ make install-gcc-cross || {
# equivalent.
rm -f $installDir/lib/gcc-lib/i586-pc-haiku/$haikuRequiredLegacyGCCVersion/include/math.h
# Symlink the built-in C++ headers path to the sys-include directory. This is
# not actually needed for cross compiling Haiku itself, but simplifies using the
# cross compiler for building the bootstrap packages.
(cd $installDir/include; ln -s ../i586-pc-haiku/sys-include/c++/2.95.3 g++)
# cleanup

View File

@ -1,31 +1,21 @@
#!/bin/sh
#
# parameters <machine> <haiku sourcedir> <buildtools dir> <haiku output dir>
# parameters <machine> <haiku sourcedir> <buildtools dir> <isntall dir>
# get and check the parameters
if [ $# -lt 4 ]; then
echo Usage: $0 '<machine> <haiku sourcedir> <buildtools dir>' \
'<haiku output dir>' >&2
'<install dir>' >&2
exit 1
fi
haikuMachine=$1
haikuSourceDir=$2
buildToolsDir=$3
haikuOutputDir=$4
installDir=$4
shift 4
additionalMakeArgs=$*
case `uname` in
FreeBSD|OpenBSD)
MAKE=gmake
;;
*)
MAKE=make
;;
esac
export MAKE
case $haikuMachine in
x86_64-*)
# GCC's default is to enable multilib, but there is a bug when
@ -68,7 +58,7 @@ fi
# create the output dir
mkdir -p $haikuOutputDir || exit 1
mkdir -p $installDir || exit 1
# get absolute paths
@ -82,8 +72,9 @@ cd $buildToolsDir
buildToolsDir=$(pwd)
cd $currentDir
cd $haikuOutputDir
haikuOutputDir=$(pwd)
cd $installDir
installDir=$(pwd)
cd $currentDir
binutilsSourceDir=$buildToolsDir/binutils
gccSourceDir=$buildToolsDir/gcc
@ -104,13 +95,13 @@ fi
find $binutilsSourceDir $gccSourceDir -name \*.info -print0 | xargs -0 touch
# create the object and installation directories for the cross compilation tools
installDir=$haikuOutputDir/cross-tools
objDir=$haikuOutputDir/cross-tools-build
objDir=${installDir}-build
binutilsObjDir=$objDir/binutils
gccObjDir=$objDir/gcc
stdcxxObjDir=$objDir/stdcxx
tmpIncludeDir=$objDir/sysincludes
tmpLibDir=$objDir/syslibs
sysrootDir=$installDir/sysroot
tmpIncludeDir=$sysrootDir/boot/system/develop/headers
tmpLibDir=$sysrootDir/boot/system/develop/lib
rm -rf $installDir $objDir
@ -134,6 +125,10 @@ if [ "$HAIKU_USE_GCC_GRAPHITE" = 1 ]; then
--with-host-libstdcxx=\"-lstdc++\""
fi
if [ -n "$SECONDARY_ARCH" ]; then
gccConfigureArgs="$gccConfigureArgs --with-hybrid-secondary=$SECONDARY_ARCH"
fi
# force the POSIX locale, as the build (makeinfo) might choke otherwise
export LC_ALL=POSIX
@ -142,7 +137,9 @@ cd $binutilsObjDir
CFLAGS="-O2" CXXFLAGS="-O2" $binutilsSourceDir/configure \
--prefix=$installDir $buildHostSpec --target=$haikuMachine \
--enable-targets=$haikuMachine,i386-efi-pe,x86_64-efi-pe \
--disable-nls --disable-shared --disable-werror $binutilsConfigureArgs \
--disable-nls --disable-shared --disable-werror \
--with-sysroot=$sysrootDir \
$binutilsConfigureArgs \
|| exit 1
$MAKE $additionalMakeArgs || exit 1
$MAKE $additionalMakeArgs install || exit 1
@ -203,7 +200,7 @@ CFLAGS="-O2" CXXFLAGS="-O2" $gccSourceDir/configure \
--prefix=$installDir $buildHostSpec --target=$haikuMachine \
--disable-nls --disable-shared --with-system-zlib \
--enable-languages=c,c++ --enable-lto --enable-frame-pointer \
--with-headers=$tmpIncludeDir --with-libs=$tmpLibDir \
--with-sysroot=$sysrootDir \
$gccConfigureArgs \
|| exit 1
@ -247,6 +244,9 @@ fi
# Only the ones from the source tree should be used.
rm -rf $installDir/$haikuMachine/sys-include
# remove the sysroot dir
rm -rf $sysrootDir
# remove the objects dir
rm -rf $objDir

View File

@ -6,19 +6,25 @@ set -o errexit
# outputDir
# tmpDir
# addBuildCompatibilityLibDir
# systemPackages, commonPackages - lists of the hpkg packages copied/updated
# (in "system" and "common" respectively)
# repositories - all repository files
# downloadDir
# The following are only for image types:
# installDir
# isImage
# imagePath
# imageSize
# imageLabel
# resolvePackageDependencies
# updateOnly
# dontClearImage
# isVMwareImage
# optionalPackageDescriptions
#
# addattr
# copyattr
# getPackageDependencies
# package
# rc
# rmAttrs
# unzip
@ -31,7 +37,6 @@ set -o errexit
# The following is only for cd types:
# generate_attribute_stores
# isCD
# stripCommand
#
if [ $# -gt 0 ]; then
. $1
@ -142,29 +147,24 @@ else
fi
stripDebugInfo()
is_in_list()
{
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"
local element
for element in $2; do
if [ "$1" = "$element" ]; then
return 0
fi
done
return 1
}
extractFile()
{
# extractFile <archive> <directory> <extractedSubDir> <stripDebugSymbols>
# extractFile <archive> <directory> <extractedSubDir>
archiveFile=$1
targetExtractedDir=$2
extractedSubDir=$3
stripDebugSymbols=$4
echo "Extracting $archiveFile ..."
extractDir=$tmpDir/extract
$rmAttrs -rf "$extractDir"
@ -172,13 +172,25 @@ extractFile()
case "$archiveFile" in
*.zip)
echo "Extracting $archiveFile ..."
$unzip -q -d "$extractDir" "$archiveFile"
;;
*.tgz|*.tar.gz)
echo "Extracting $archiveFile ..."
tar -C "$extractDir" -xf "$archiveFile"
;;
*.hpkg)
echo "Extracting $archiveFile ..."
if [ -n "$extractedSubDir" ]; then
$package extract -C "$extractDir" "$archiveFile" \
"$extractedSubDir"
else
$package extract -C "$extractDir" "$archiveFile"
fi
;;
*)
echo "Unhandled archive extension in build_haiku_image extractFile()"
echo "Unhandled archive extension in build_haiku_image" \
"extractFile()"
exit 1
;;
esac
@ -189,36 +201,27 @@ 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"
$cp -r "${sPrefix}$extractDir/$extractedSubDir/." \
"${tPrefix}$targetExtractedDir"
$rmAttrs -rf "$extractDir"
}
downloadFile()
{
url=$1
path=$2
if [ ! -f "$path" ]; then
wget -O "$path" "$url"
fi
}
mkdir -p $tmpDir
copyrightsFile=$tmpDir/copyrights
$rmAttrs -f $copyrightsFile
if [ "$optionalPackageDescriptions" ]; then
cp "$optionalPackageDescriptions" $copyrightsFile
fi
if [ $isCD ]; then
# setup output dir
@ -274,70 +277,66 @@ while [ $# -gt 0 ]; do
done
# install MIME database
# TODO: It should be possible to do that in the build system too.
# resolve package dependencies
if [ -n "$resolvePackageDependencies" ]; then
echo "Resolving package dependencies ..."
if [ ! $updateOnly ]; then
mimeDBSource=$sourceDir/src/data/beos_mime
mimeDBDest=${tPrefix}home/config/settings/beos_mime
# additional packages for system
packageUrls=`$getPackageDependencies $repositories -- $systemPackages`
for packageUrl in $packageUrls; do
packageFileName=`basename $packageUrl`
packageFilePath="$downloadDir/$packageFileName"
downloadFile $packageUrl "$packageFilePath"
$cp "${sPrefix}$packageFilePath" "${tPrefix}system/packages"
systemPackages="$systemPackages $packageFilePath"
done
echo "Deleting old MIME database ..."
$rm -rf $mimeDBDest
$mkdir -p $mimeDBDest
mimeTmpDir=$tmpDir/mime
mimeDBTmpDir=$tmpDir/mime/db
mimeTmpIndex=0
mimeTmpFile=$mimeTmpDir/mimedb$$.rsrc
# create tmp dir for the MIME conversion stuff
mkdir -p $mimeDBTmpDir
echo "Installing MIME database ..."
for inSuperFile in $mimeDBSource/*.super; do
superType=$(basename $inSuperFile .super)
tmpSuperDir=$mimeDBTmpDir/$superType
# compile rdef to rsrc file and the rsrc file to attributes
$rc -o $mimeTmpFile $inSuperFile
mkdir -p $tmpSuperDir
$resattr -O -o $tmpSuperDir $mimeTmpFile
$rmAttrs $mimeTmpFile
# iterate through the sub types
for inSubFile in $mimeDBSource/$superType/*; do
# check, if the type exists
if test -f $inSubFile && grep META:TYPE $inSubFile > /dev/null 2>&1 ; then
subType=$(basename $inSubFile)
tmpSubFile=$mimeDBTmpDir/$superType/$subType
# compile rdef to rsrc file and the rsrc file to attributes
$rc -o $mimeTmpFile $inSubFile
$resattr -O -o $tmpSubFile $mimeTmpFile
$rmAttrs $mimeTmpFile
# Remove packages from the list for common, that are already in the package
# list for system.
unfilteredCommonPackages="$commonPackages"
commonPackages=
for packageFile in $unfilteredCommonPackages; do
if is_in_list "$packageFile" "$systemPackages"; then
:
else
commonPackages="$commonPackages $packageFile"
fi
done
# additional packages for common
packageUrls=`$getPackageDependencies $repositories -- $systemPackages \
$commonPackages`
for packageUrl in $packageUrls; do
packageFileName=`basename $packageUrl`
packageFilePath="$downloadDir/$packageFileName"
downloadFile $packageUrl "$packageFilePath"
$cp "${sPrefix}$packageFilePath" "${tPrefix}common/packages"
commonPackages="$commonPackages $packageFilePath"
done
fi
$cp -r ${sPrefix}$mimeDBTmpDir/. $mimeDBDest
# cleanup tmp dir
$rmAttrs -rf $mimeTmpDir
fi # ! updateOnly
# install default settings for packages
for packageFile in $systemPackages $commonPackages; do
if $package list -p $packageFile | egrep '^settings/' > /dev/null; then
extractFile $packageFile common/settings settings
fi
done
# add the concatenated copyrights as an attribute to AboutSystem
# TODO: That might not be necessary, when all third-party software everything
# is packaged. Though we might not package everything.
if [ ! $updateOnly ]; then
if [ -f $copyrightsFile ]; then
copyrightAttrs=$tmpDir/copyrightAttrs
$rmAttrs -f $copyrightAttrs
touch $copyrightAttrs
$addattr -f $copyrightsFile COPYRIGHTS $copyrightAttrs
$copyAttrs ${sPrefix}$copyrightAttrs ${tPrefix}system/apps/AboutSystem
fi
fi
# if [ ! $updateOnly ]; then
# if [ -f $copyrightsFile ]; then
# copyrightAttrs=$tmpDir/copyrightAttrs
# $rmAttrs -f $copyrightAttrs
# touch $copyrightAttrs
# $addattr -f $copyrightsFile COPYRIGHTS $copyrightAttrs
# $copyAttrs ${sPrefix}$copyrightAttrs ${tPrefix}system/apps/AboutSystem
# fi
# fi
if [ $isCD ]; then
# generate the attribute stores

125
build/scripts/build_haiku_package Executable file
View File

@ -0,0 +1,125 @@
#!/bin/sh
set -o errexit
# The first argument is the shell script that initializes the variables:
# addBuildCompatibilityLibDir
# mimeDB
# outputDir
# sourceDir
# tmpDir
# compressionLevel
# updateOnly
# cc
#
# addattr
# copyattr
# mimeset
# package
# rc
# rmAttrs
# unzip
#
if [ $# -le 1 ]; then
echo "$0: Missing parameters!" >&2
exit 1
fi
packagePath="$1"
packageInfoPath="$2"
shift 2
if [ $# -gt 0 ]; then
. $1
shift
fi
# this adds the build library dir to LD_LIBRARY_PATH
eval "$addBuildCompatibilityLibDir"
# make a clean contents dir
packageName=`basename "$packagePath"`
echo "$packageName: Removing and re-creating package contents dir ..."
contentsDir="$tmpDir/contents"
$rmAttrs -rf "$contentsDir"
mkdir -p "$contentsDir"
# map the shell commands
sPrefix=
tPrefix="$contentsDir/"
cd=cd
scd=:
cp="$copyattr -d"
copyAttrs="$copyattr"
ln=ln
mkdir=mkdir
rm=$rmAttrs
mkindex=mkindex
extractFile()
{
# extractFile <archive> <directory> <extractedSubDir>
archiveFile=$1
targetExtractedDir=$2
extractedSubDir=$3
extractDir=$tmpDir/extract
$rmAttrs -rf "$extractDir"
mkdir -p "$extractDir"
case "$archiveFile" in
*.zip)
$unzip -q -d "$extractDir" "$archiveFile"
;;
*.tgz|*.tar.gz)
tar -C "$extractDir" -xf "$archiveFile"
;;
*.hpkg)
if [ -n "$extractedSubDir" ]; then
$package extract -C "$extractDir" "$archiveFile" \
"$extractedSubDir"
else
$package extract -C "$extractDir" "$archiveFile"
fi
;;
*)
echo "Unhandled archive extension in build_haiku_image" \
"extractFile()"
exit 1
;;
esac
$cp -r "${sPrefix}$extractDir/$extractedSubDir/." \
"${tPrefix}$targetExtractedDir"
$rmAttrs -rf "$extractDir"
}
# execute the scripts preparing the package contents
echo "$packageName: Collecting package contents ..."
while [ $# -gt 0 ]; do
. $1
shift
done
# mimeset the whole package content
echo "$packageName: mimeset'ing package contents ..."
$mimeset --mimedb "$mimeDB" "$contentsDir"
# create the package
if [ ! $updateOnly ]; then
echo "$packageName: Creating the package ..."
rm -f "$packagePath"
$package create -q "-$compressionLevel" -i "$packageInfoPath" \
-C "$contentsDir" "$packagePath"
else
echo "$packageName: Updating the package ..."
$package add -q -f "-$compressionLevel" -i "$packageInfoPath" \
-C "$contentsDir" "$packagePath" .
fi

67
build/scripts/determine_haiku_revision Normal file → Executable file
View File

@ -1,13 +1,27 @@
#!/bin/sh
determineGitRevision()
{
haikuTop=$1
haikuBuildOutputDir=$2
revisionFile=$2
haikuBuildOutputDir=`dirname $revisionFile`
lastBuiltRevisionFile=${haikuBuildOutputDir}/last-built-revision
case `uname` in
Darwin)
SED=gsed
;;
*)
SED=sed
;;
esac
export SED
revision=`cat ${revisionFile} 2>/dev/null`
lastBuiltRevision=`cat $lastBuiltRevisionFile 2>/dev/null`
originalDir=`pwd`
cd ${haikuTop}
export LC_ALL=C
revision=`cat ${haikuBuildOutputDir}/haiku-revision 2>/dev/null`
lastBuiltRevision=`cat ${haikuBuildOutputDir}/last-built-revision \
2>/dev/null`
localRev=`git rev-parse HEAD`
# only determine the haiku-revision if anything has changed from
@ -25,46 +39,13 @@ determineGitRevision()
branchName=`git branch | grep '*' | cut -b 3-`
revision="$revision [$branchName]"
fi
echo $localRev >${haikuBuildOutputDir}/last-built-revision
fi
}
cd $originalDir
determineHaikuRevision()
{
haikuTop=$1
haikuBuildOutputDir=$2
case `uname` in
Darwin)
SED=gsed
;;
*)
SED=sed
;;
esac
export SED
originalDir=`pwd`
cd ${haikuTop}
export LC_ALL=C
if [ -d .svn ]; then
revision=`svn info 2>/dev/null | grep Revision | awk '{printf $2}'`
elif [ -d .git/svn ]; then
revision=`git svn info 2>/dev/null | grep Revision | awk '{printf $2}'`
elif [ -d .git ]; then
determineGitRevision $haikuTop $haikuBuildOutputDir
elif [ -d .hg ]; then
# Try searching hg log for last svn commit
# Extract from "(svn r12345) ..." line
revision=`(cd ${haikuTop} &&
hg log --no-merges --template "{desc|firstline}\n") 2> /dev/null |
grep --max-count=1 "(svn r" |
$SED -n -e 's,(svn r\(.*\)).*,\1,p'`
fi
if [ -z "$revision" ]; then
revision=0
fi
echo $revision >${haikuBuildOutputDir}/haiku-revision
cd $originalDir
}
echo $localRev >${lastBuiltRevisionFile}
echo $revision >${revisionFile}

6
build/scripts/host_build_only Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
echo "Error: The build has been configured for building the build host tools" \
"only." >&2
exit 1

View File

@ -9,7 +9,7 @@ rmAttrs=$1
shift
if [ -f $rmAttrs ]; then
$rmAttrs $@
$rmAttrs "$@"
else
rm $@
rm "$@"
fi

731
configure vendored
View File

@ -12,33 +12,32 @@ usage()
Usage: $0 <options>
options:
--alternative-gcc-output-dir <dir>
Build a Haiku installation that supports running
executables built with a gcc version incompatible
with the primary gcc (e.g. gcc 2 executables under
a gcc 4 Haiku or vice versa). <dir> specifies the
output directory of the other gcc. The directory
must already be fully configured.
Note, that a sub-jam will be executed when
building Haiku. When using a jam that is not
simply invoked by "jam", the JAM build variable
needs to be set accordingly.
To disable building the alternative libraries
the variable HAIKU_ADD_ALTERNATIVE_GCC_LIBS can be
unset in the UserBuildConfig file.
--build-cross-tools <build tools dir>
--bootstrap <haikuporter> <HaikuPorts cross repo> <HaikuPorts repo>
Prepare for a bootstrap build. No pre-built
packages will be used, instead they will be built
from the sources (in several phases).
<haikuporter> is the path to the haikuporter tool
suitable for the host platform.
<HaikuPorts cross repo> is the path to a checked
out HaikuPorts cross-compilation repository.
<HaikuPorts repo> is the path to a checked out
HaikuPorts repository.
--build-cross-tools <arch> [ <build tools dir> ]
Assume cross compilation. <build tools dir>
defines the location of the build tools sources.
They will be compiled and placed in the output
directory under "cross-tools". The HAIKU_* tools
variables will be set accordingly.
--build-cross-tools-gcc4 <arch> <build tools dir>
Like "--build-cross-tools" just that gcc 4 will
be used for cross-compilation. Note, that the
resulting Haiku installation built with gcc 4
will not be binary compatible with BeOS R5.
<arch> specifies the target architecture, either
"x86", "x86_64", "ppc", "m68k", "arm" or "mipsel".
"x86_gcc2", "x86", "x86_64", "ppc", "m68k", "arm",
or "mipsel".
This option and --cross-tools-prefix can be
specified multiple times. The first cross tools
specify the primary tools, the subsequent ones the
secondary tools (for "hybrid" images).
For the first --build-cross-tools the
<build tools dir> argument must be specified and
for the subsequent ones it must be omitted.
--cross-tools-prefix <prefix>
Assume cross compilation. <prefix> should be a
path to the directory where the cross
@ -55,6 +54,9 @@ options:
default -- any other distro (default value).
--enable-multiuser Enable experimental multiuser support.
--help Prints out this help.
--host-only Configure for building tools for the build host
only. Haiku cannot be built when configured like
this.
--include-gpl-addons Include GPL licensed add-ons.
--include-patented-code Enable code that is known to implemented patented
ideas and techniques. If this option is not
@ -73,6 +75,14 @@ options:
--target=TARGET Select build target platform.
[default=${TARGET_PLATFORM}]
valid targets=r5,bone,dano,haiku
--target-arch <arch> Haiku only: Specify the target architecture to
build for. Must be one of the architectures of the
host system. The installed build tools for that
architecture will be used.
This option can be specified multiple times. The
first occurrence specifies the primary
architecture of the Haiku to build, subsequent
ones the secondary architectures.
--update re-runs last configure invocation [must be given
as first option!]
--use-gcc-pipe Build with GCC option -pipe. Speeds up the build
@ -80,29 +90,43 @@ options:
--use-gcc-graphite Build with GCC Graphite engine for loop
optimizations. Only for gcc 4.
--use-32bit Use -m32 flag on 64bit host gcc compiler.
--use-xattr Use Linux xattr support for BeOS attribute
emulation. Warning: Make sure your file system
supports sufficient attribute sizes (4 KB per
file for all attributes won't suffice).
--use-xattr Use Linux xattr respectively *BSD extattr support
for BeOS attribute emulation. Warning: Make sure
your file system supports sufficient attribute
sizes (4 KB per file for all attributes won't
suffice).
--use-xattr-ref Use the generic BeOS attribute emulation, but use
Linux xattr respectively *BSD extattr support to
make it more robust (i.e. attribute mix-ups become
less likely).
environment variables:
HAIKU_AR The static library archiver. Defaults to "ar".
HAIKU_CC The compiler. Defaults to "gcc".
HAIKU_LD The linker. Defaults to "ld".
HAIKU_OBJCOPY The objcopy to be used. Defaults to "objcopy".
HAIKU_RANLIB The static library indexer. Defaults to "ranlib".
HAIKU_AR_x86_gcc2 The static library archiver for x86_gcc2.
Defaults to "ar".
HAIKU_CC_x86_gcc2 The x86_gcc2 compiler. Defaults to "gcc".
HAIKU_LD_x86_gcc2 The x86_gcc2 linker. Defaults to "ld".
HAIKU_OBJCOPY_x86_gcc2 The x86_gcc2 objcopy to be used. Defaults to
"objcopy".
HAIKU_RANLIB_x86_gcc2 The static library indexer for x86_gcc2. Defaults
to "ranlib".
HAIKU_STRIP_x86_gcc2 The x86_gcc2 strip command. Defaults to "strip".
HAIKU_YASM The yasm assembler (x86 only).
HAIKU_STRIP The strip command. Defaults to "strip".
HAIKU_CPPFLAGS The preprocessor flags. Defaults to "".
HAIKU_CCFLAGS The C flags. Defaults to "".
HAIKU_CXXFLAGS The C++ flags. Defaults to "".
HAIKU_LDFLAGS The linker flags. Defaults to "".
HAIKU_ARFLAGS The flags passed to HAIKU_AR for archiving.
Defaults to "cru".
HAIKU_UNARFLAGS The flags passed to HAIKU_AR for unarchiving.
Defaults to "x".
HAIKU_CPPFLAGS_<arch> The preprocessor flags for target architecture
<arch>. Defaults to "".
HAIKU_CCFLAGS_<arch> The C flags for target architecture <arch>.
Defaults to "".
HAIKU_CXXFLAGS_<arch> The C++ flags for target architecture <arch>.
Defaults to "".
HAIKU_LDFLAGS_<arch> The linker flags for target architecture <arch>.
Defaults to "".
HAIKU_ARFLAGS_<arch> The flags passed to HAIKU_AR for target
architecture <arch> for archiving. Defaults to
"cru".
HAIKU_UNARFLAGS_<arch> The flags passed to HAIKU_AR for target
architecture <arch> for unarchiving. Defaults to
"x".
Non-standard output directories:
Non-default output directories:
By default all objects, build configuration, and other related files are
stored in /path/to/haiku_source/generated. To store objects in a non-default
location, run "../../relative/path/to/haiku_source/configure <options>" from
@ -141,6 +165,19 @@ assertparams()
fi
}
# absolute_path
#
# returns the absolute path of a given path.
#
absolute_path()
{
if [[ "$1" == /* ]]; then
echo "$1"
else
echo "`pwd`/$1"
fi
}
# real_path
#
# returns the realpath of a symbolic link.
@ -156,6 +193,8 @@ real_path()
#
standard_gcc_settings()
{
local gcc=$1
if which greadlink > /dev/null 2>&1; then
readlink="greadlink -e"
elif which realpath > /dev/null 2>&1; then
@ -167,61 +206,67 @@ standard_gcc_settings()
fi
# PLATFORM_LINKLIBS
gcclib=`$HAIKU_CC -print-libgcc-file-name`
gccdir=`dirname ${gcclib}`
local gcclib=`$gcc -print-libgcc-file-name`
local gccdir=`dirname ${gcclib}`
HAIKU_GCC_RAW_VERSION=`$HAIKU_CC -dumpversion`
HAIKU_GCC_MACHINE=`$HAIKU_CC -dumpmachine`
if [ "$HAIKU_USE_GCC_GRAPHITE" != 0 ]; then
UNUSED=`echo "int main() {}" | $HAIKU_CC -xc -c -floop-block - 2>&1`
if [ $? != 0 ]; then
echo "GCC Graphite loop optimizations cannot be used"
HAIKU_USE_GCC_GRAPHITE=0
fi
fi
local gccRawVersion=`$gcc -dumpversion`
local gccMachine=`$gcc -dumpmachine`
HAIKU_GCC_LIB_DIR=${gccdir}
HAIKU_GCC_LIBGCC=${gccdir}/libgcc.a
HAIKU_GCC_GLUE_CODE="crtbegin.o crtend.o"
HAIKU_GCC_HEADERS_DIR="${gccdir}/include
${gccdir}/include-fixed"
HAIKU_GCC_LIBGCC_OBJECTS=`$HAIKU_AR t ${HAIKU_GCC_LIBGCC} | grep -v eabi.o`
# Note: We filter out eabi.o. It's present in gcc's libgcc for PPC and
# neither needed nor wanted.
local libgcc=${gccdir}/libgcc.a
case $HAIKU_GCC_RAW_VERSION in
# determine architecture from machine triple
case $gccMachine in
arm-*) targetCpu=arm;;
i?86-*) targetCpu=x86;;
m68k-*) targetCpu=m68k;;
mipsel-*) targetCpu=mipsel;;
powerpc-*) targetCpu=ppc;;
x86_64-*) targetCpu=x86_64;;
*)
echo "Unsupported gcc target machine: $gccMachine" >&2
exit 1
;;
esac
local targetArch=$targetCpu
local staticLibStdCxx
local sharedLibStdCxx
local staticLibSupCxx
local sharedLibSupCxx
local kernelLibgcc
local cxxHeaders
case $gccRawVersion in
4.*)
# for gcc 4 we use the libstdc++ and libsupc++ that come with the
# compiler
HAIKU_STATIC_LIBSTDCXX=`$HAIKU_CC -print-file-name=libstdc++.a`
HAIKU_SHARED_LIBSTDCXX=`$HAIKU_CC -print-file-name=libstdc++.so`
HAIKU_STATIC_LIBSUPCXX=`$HAIKU_CC -print-file-name=libsupc++.a`
HAIKU_SHARED_LIBSUPCXX=`$HAIKU_CC -print-file-name=libsupc++.so`
staticLibStdCxx=`$gcc -print-file-name=libstdc++.a`
sharedLibStdCxx=`$gcc -print-file-name=libstdc++.so`
staticLibSupCxx=`$gcc -print-file-name=libsupc++.a`
sharedLibSupCxx=`$gcc -print-file-name=libsupc++.so`
# If the architecture has separate runtime libraries for the
# kernel, use them.
HAIKU_KERNEL_LIBGCC=`$HAIKU_CC -print-file-name=libgcc-kernel.a`
if [ $HAIKU_KERNEL_LIBGCC = libgcc-kernel.a ]; then
HAIKU_KERNEL_LIBGCC=$HAIKU_GCC_LIBGCC
kernelLibgcc=`$gcc -print-file-name=libgcc-kernel.a`
if [ $kernelLibgcc = libgcc-kernel.a ]; then
kernelLibgcc=$libgcc
fi
HAIKU_KERNEL_LIBSUPCXX=`$HAIKU_CC -print-file-name=libsupc++-kernel.a`
if [ $HAIKU_KERNEL_LIBSUPCXX = libsupc++-kernel.a ]; then
HAIKU_KERNEL_LIBSUPCXX=$HAIKU_STATIC_LIBSUPCXX
kernelLibSupCxx=`$gcc -print-file-name=libsupc++-kernel.a`
if [ $kernelLibSupCxx = libsupc++-kernel.a ]; then
kernelLibSupCxx=$staticLibSupCxx
fi
local headers
if [ -d $gccdir/../../../../$HAIKU_GCC_MACHINE/include/c++/$HAIKU_GCC_RAW_VERSION ]; then
headers=$gccdir/../../../../$HAIKU_GCC_MACHINE/include/c++/$HAIKU_GCC_RAW_VERSION
else
headers=$gccdir/../../../../include/c++/$HAIKU_GCC_RAW_VERSION
local headersBase=$gccdir/../../../..
local headers=$headersBase/$gccMachine/include/c++/$gccRawVersion
if [ ! -d $headers ]; then
headers=$headersBase/include/c++/$gccRawVersion
fi
HAIKU_CXX_HEADERS_DIR=$headers
for d in $HAIKU_GCC_MACHINE backward ext; do
cxxHeaders=$headers
for d in $gccMachine backward ext; do
# Note: We need the line break, otherwise the line might become
# too long for jam (512 bytes max).
HAIKU_CXX_HEADERS_DIR="$HAIKU_CXX_HEADERS_DIR
$headers/$d"
cxxHeaders="$cxxHeaders $headers/$d"
done
# Unset the HAIKU_{SHARED,STATIC}_LIB{STD,SUP}CXX variables, if the
@ -229,55 +274,113 @@ standard_gcc_settings()
# symlinks to avoid problems when copying the libraries to the
# image.
if [ $HAIKU_STATIC_LIBSTDCXX = libstdc++.a ]; then
HAIKU_STATIC_LIBSTDCXX=
if [ $staticLibStdCxx = libstdc++.a ]; then
staticLibStdCxx=
else
HAIKU_STATIC_LIBSTDCXX=`$readlink $HAIKU_STATIC_LIBSTDCXX`
staticLibStdCxx=`$readlink $staticLibStdCxx`
fi
if [ $HAIKU_SHARED_LIBSTDCXX = libstdc++.so ]; then
HAIKU_SHARED_LIBSTDCXX=
if [ $sharedLibStdCxx = libstdc++.so ]; then
sharedLibStdCxx=
else
HAIKU_SHARED_LIBSTDCXX=`$readlink $HAIKU_SHARED_LIBSTDCXX`
sharedLibStdCxx=`$readlink $sharedLibStdCxx`
fi
if [ $HAIKU_STATIC_LIBSUPCXX = libsupc++.a ]; then
HAIKU_STATIC_LIBSUPCXX=
if [ $staticLibSupCxx = libsupc++.a ]; then
staticLibSupCxx=
else
HAIKU_STATIC_LIBSUPCXX=`$readlink $HAIKU_STATIC_LIBSUPCXX`
staticLibSupCxx=`$readlink $staticLibSupCxx`
fi
if [ $HAIKU_SHARED_LIBSUPCXX = libsupc++.so ]; then
HAIKU_SHARED_LIBSUPCXX=
if [ $sharedLibSupCxx = libsupc++.so ]; then
sharedLibSupCxx=
else
HAIKU_SHARED_LIBSUPCXX=`$readlink $HAIKU_SHARED_LIBSUPCXX`
sharedLibSupCxx=`$readlink $sharedLibSupCxx`
fi
;;
2.9*)
# check for correct (most up-to-date) legacy compiler and complain
# if an older one is installed
if [ $HAIKU_GCC_RAW_VERSION != $haikuRequiredLegacyGCCVersion ]; then
if [ $gccRawVersion != $haikuRequiredLegacyGCCVersion ]; then
echo "GCC version $haikuRequiredLegacyGCCVersion is required!";
echo "Please download it from www.haiku-os.org...";
exit 1;
fi
HAIKU_KERNEL_LIBGCC=$HAIKU_GCC_LIBGCC
HAIKU_KERNEL_LIBSUPCXX=
kernelLibgcc=$libgcc
kernelLibSupCxx=
targetArch=x86_gcc2
;;
esac
case $HAIKU_GCC_MACHINE in
local bootLibgcc
local bootLibSupCxx
case $gccMachine in
x86_64-*)
# Boot loader is 32-bit, need the 32-bit libs.
HAIKU_BOOT_LIBGCC=`$HAIKU_CC -m32 -print-libgcc-file-name`
HAIKU_BOOT_LIBSUPCXX=`$HAIKU_CC -m32 -print-file-name=libsupc++.a`
bootLibgcc=`$gcc -m32 -print-libgcc-file-name`
bootLibSupCxx=`$gcc -m32 -print-file-name=libsupc++.a`
;;
*)
HAIKU_BOOT_LIBGCC=$HAIKU_GCC_LIBGCC
HAIKU_BOOT_LIBSUPCXX=$HAIKU_STATIC_LIBSUPCXX
bootLibgcc=$libgcc
bootLibSupCxx=$staticLibSupCxx
;;
esac
# determine whether graphite loop optimization should/can be used
local useGraphite=`get_variable HAIKU_USE_GCC_GRAPHITE_$targetCpu`
if [ -z "$useGraphite" ]; then
useGraphite=$useGccGraphiteDefault
fi
if [ "$useGraphite" != 0 ]; then
UNUSED=`echo "int main() {}" | $gcc -xc -c -floop-block - 2>&1`
if [ $? != 0 ]; then
echo "GCC Graphite loop optimizations cannot be used on $targetArch"
useGraphite=0
fi
fi
set_variable HAIKU_CPU_$targetArch $targetCpu
get_build_tool_path CC_$targetArch "$gcc"
set_variable HAIKU_GCC_RAW_VERSION_$targetArch $gccRawVersion
set_variable HAIKU_GCC_MACHINE_$targetArch $gccMachine
set_variable HAIKU_GCC_LIB_DIR_$targetArch $gccdir
set_variable HAIKU_GCC_LIBGCC_$targetArch $libgcc
set_variable HAIKU_GCC_GLUE_CODE_$targetArch "crtbegin.o crtend.o"
set_variable HAIKU_GCC_HEADERS_DIR_$targetArch \
"${gccdir}/include ${gccdir}/include-fixed"
set_variable HAIKU_STATIC_LIBSTDCXX_$targetArch "$staticLibStdCxx"
set_variable HAIKU_SHARED_LIBSTDCXX_$targetArch "$sharedLibStdCxx"
set_variable HAIKU_STATIC_LIBSUPCXX_$targetArch "$staticLibSupCxx"
set_variable HAIKU_SHARED_LIBSUPCXX_$targetArch "$sharedLibSupCxx"
set_variable HAIKU_KERNEL_LIBSUPCXX_$targetArch "$kernelLibSupCxx"
set_variable HAIKU_BOOT_LIBSUPCXX_$targetArch "$bootLibSupCxx"
set_variable HAIKU_KERNEL_LIBGCC_$targetArch $kernelLibgcc
set_variable HAIKU_CXX_HEADERS_DIR_$targetArch "$cxxHeaders"
set_variable HAIKU_BOOT_LIBGCC_$targetArch $bootLibgcc
set_variable HAIKU_USE_GCC_GRAPHITE_$targetArch $useGraphite
standard_gcc_settings_targetArch=$targetArch
}
# set_variable
#
# Set the value of a variable.
#
set_variable()
{
eval "$1=\"$2\""
}
# get_variable
#
# Echo the value of a variable.
#
get_variable()
{
eval "echo \${$1}"
}
# set_default_value
@ -296,8 +399,7 @@ set_default_value()
get_build_tool_path()
{
local var="HAIKU_$1"
local tool=$2
local path="${crossToolsPrefix}$tool"
local path=$2
if [ -f "$path" ]; then
# get absolute path
@ -315,6 +417,17 @@ get_build_tool_path()
eval "$var=$path"
}
is_in_list()
{
local element
for element in $2; do
if [ "$1" = "$element" ]; then
return 0
fi
done
return 1
}
# get cwd and the source directory
currentDir=`pwd`
cd `dirname "$0"`
@ -328,22 +441,16 @@ configureArgs="$@"
#
platform=`uname`
platformMachine=`uname -m`
targetArch=x86
crossToolsPrefix=
targetArchs=
buildCrossTools=
buildCrossToolsScript="$sourceDir/build/scripts/build_cross_tools"
buildCrossToolsMachine=
buildCrossToolsJobs=
useGccGraphiteDefault=0
unknownArchIndex=1
haikuTargetArchs=
# exported (BuildSetup) default parameter values
#
HAIKU_GCC_RAW_VERSION=
HAIKU_GCC_MACHINE=i586-pc-haiku
HAIKU_STATIC_LIBSTDCXX=
HAIKU_SHARED_LIBSTDCXX=
HAIKU_STATIC_LIBSUPCXX=
HAIKU_SHARED_LIBSUPCXX=
HAIKU_CXX_HEADERS_DIR=
HOST_GCC_RAW_VERSION=`gcc -dumpversion`
HOST_GCC_MACHINE=`gcc -dumpmachine`
HAIKU_INCLUDE_GPL_ADDONS=0
@ -354,34 +461,44 @@ HAIKU_ENABLE_MULTIUSER=0
HAIKU_DISTRO_COMPATIBILITY=default
TARGET_PLATFORM=haiku
HAIKU_USE_GCC_PIPE=0
HAIKU_USE_GCC_GRAPHITE=0
HAIKU_HOST_USE_32BIT=0
HAIKU_HOST_USE_XATTR=0
HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR=
HAIKU_ADD_ALTERNATIVE_GCC_LIBS=0
HAIKU_HOST_USE_XATTR_REF=0
HAIKU_HOST_BUILD_ONLY=0
HOST_GCC_LD=`gcc -print-prog-name=ld`
HOST_GCC_OBJCOPY=`gcc -print-prog-name=objcopy`
SFDISK_BINARY=sfdisk
HOST_SFDISK=$SFDISK_BINARY
HOST_SHA256=
HOST_HAIKU_PORTER=
HAIKU_PORTS=
HAIKU_PORTS_CROSS=
haikuRequiredLegacyGCCVersion="2.95.3-haiku-121101"
HAIKU_PACKAGING_ARCHS=
set_default_value HAIKU_YASM yasm
if sha256sum < /dev/null > /dev/null 2>&1; then
HOST_SHA256=sha256sum
elif sha256 < /dev/null > /dev/null 2>&1; then
HOST_SHA256="sha256 -q"
else
echo "Error: Neither sha256sum nor sha256 seem to be available!" >&2
exit 1
fi
haikuRequiredLegacyGCCVersion="2.95.3-haiku-2013_08_15"
export haikuRequiredLegacyGCCVersion
# version of legacy gcc required to build haiku
set_default_value HAIKU_AR ar
set_default_value HAIKU_CC gcc
set_default_value HAIKU_LD ld
set_default_value HAIKU_OBJCOPY objcopy
set_default_value HAIKU_RANLIB ranlib
set_default_value HAIKU_ELFEDIT elfedit
set_default_value HAIKU_YASM yasm
set_default_value HAIKU_STRIP strip
set_default_value HAIKU_CPPFLAGS ""
set_default_value HAIKU_CCFLAGS ""
set_default_value HAIKU_CXXFLAGS ""
set_default_value HAIKU_LDFLAGS ""
set_default_value HAIKU_ARFLAGS cru
set_default_value HAIKU_UNARFLAGS x
supportedTargetArchs="
arm
m68k
mipsel
ppc
x86
x86_64
x86_gcc2
"
# determine output directory
if [ "$currentDir" = "$sourceDir" ]; then
@ -416,35 +533,48 @@ fi
#
while [ $# -gt 0 ] ; do
case "$1" in
--alternative-gcc-output-dir)
assertparam "$1" $#
cd $2 || exit 1
HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR=`pwd`
HAIKU_ADD_ALTERNATIVE_GCC_LIBS=1
cd $currentDir
shift 2
--bootstrap)
assertparams "$1" 3 $#
HOST_HAIKU_PORTER="`absolute_path $2`"
HAIKU_PORTS_CROSS="`absolute_path $3`"
HAIKU_PORTS="`absolute_path $4`"
shift 4
;;
--build-cross-tools) assertparam "$1" $#; buildCrossTools=$2; shift 2;;
--build-cross-tools-gcc4)
--build-cross-tools)
if [ -z "$buildCrossTools" ]; then
assertparams "$1" 2 $#
targetArch=$2
buildCrossTools=$3
buildCrossToolsScript="${buildCrossToolsScript}_gcc4"
case "$2" in
x86) HAIKU_GCC_MACHINE=i586-pc-haiku;;
x86_64) HAIKU_GCC_MACHINE=x86_64-unknown-haiku; targetArch=x86_64;;
ppc) HAIKU_GCC_MACHINE=powerpc-apple-haiku; targetArch=ppc;;
m68k) HAIKU_GCC_MACHINE=m68k-unknown-haiku; targetArch=m68k;;
arm) HAIKU_GCC_MACHINE=arm-unknown-haiku; targetArch=arm;;
mipsel) HAIKU_GCC_MACHINE=mipsel-unknown-haiku; targetArch=mips;;
*) echo "Unsupported target architecture: $2"
exit 1;;
esac
buildCrossToolsMachine=$HAIKU_GCC_MACHINE
shift 3
else
assertparam "$1" $#
targetArch=$2
shift 2
fi
case "$targetArch" in
x86_gcc2) targetMachine=i586-pc-haiku;;
x86) targetMachine=i586-pc-haiku;;
x86_64) targetMachine=x86_64-unknown-haiku;;
ppc) targetMachine=powerpc-apple-haiku;;
m68k) targetMachine=m68k-unknown-haiku;;
arm) targetMachine=arm-unknown-haiku;;
mipsel) targetMachine=mipsel-unknown-haiku;;
*)
echo "Unsupported target architecture: $2" >&2
exit 1
;;
esac
set_variable buildCrossToolsMachine_$targetArch $targetMachine
targetArchs="$targetArchs $targetArch"
HAIKU_PACKAGING_ARCHS=
;;
--cross-tools-prefix)
assertparam "$1" $#
crossToolsPrefix=$2
targetArch=unknown${unknownArchIndex}
set_variable crossToolsPrefix_$targetArch "$2"
targetArchs="$targetArchs $targetArch"
HAIKU_PACKAGING_ARCHS=
unknownArchIndex=$(($unknownArchIndex + 1))
shift 2
;;
--distro-compatibility)
@ -462,32 +592,38 @@ while [ $# -gt 0 ] ; do
;;
--enable-multiuser) HAIKU_ENABLE_MULTIUSER=1; shift 1;;
--help | -h) usage; exit 0;;
--host-only) HAIKU_HOST_BUILD_ONLY=1; shift 1;;
--include-gpl-addons) HAIKU_INCLUDE_GPL_ADDONS=1; shift 1;;
--include-patented-code) HAIKU_INCLUDE_PATENTED_CODE=1; shift 1;;
--include-sources) HAIKU_INCLUDE_SOURCES=1; shift 1;;
--include-3rdparty) HAIKU_INCLUDE_3RDPARTY=1; shift 1;;
-j*) buildCrossToolsJobs="$1"; shift 1;;
--target=*) TARGET_PLATFORM=`echo $1 | cut -d'=' -f2-`; shift 1;;
--target-arch)
assertparam "$1" $#
targetArch=$2
shift 2
if [ ! "$platform" = Haiku ]; then
echo "--target-arch can only be specified on Haiku." >&2
exit 1
fi
is_in_list "$targetArch" "$supportedTargetArchs" || (
echo "Unsupported target architecture: \"$targetArch\"" >&2
exit 1
)
haikuTargetArchs="$haikuTargetArchs $targetArch"
;;
--use-gcc-pipe) HAIKU_USE_GCC_PIPE=1; shift 1;;
--use-gcc-graphite) HAIKU_USE_GCC_GRAPHITE=1; shift 1;;
--use-gcc-graphite) useGccGraphiteDefault=1; shift 1;;
--use-32bit) HAIKU_HOST_USE_32BIT=1; shift 1;;
--use-xattr) HAIKU_HOST_USE_XATTR=1; shift 1;;
--use-xattr-ref) HAIKU_HOST_USE_XATTR_REF=1; shift 1;;
*) echo Invalid argument: \`$1\'; exit 1;;
esac
done
# detect the build platform
case "${platform}" in
BeOS) revision=`uname -r`
case "$revision" in
6.*) HOST_PLATFORM=dano ;;
5.1) HOST_PLATFORM=dano ;;
5.0.4) HOST_PLATFORM=bone ;;
5.0*) HOST_PLATFORM=r5 ;;
*) echo Unknown BeOS version: $revision
exit 1 ;;
esac
;;
Darwin) HOST_PLATFORM=darwin ;;
FreeBSD) HOST_PLATFORM=freebsd
SFDISK_BINARY=sfdisk-linux
@ -528,47 +664,170 @@ fi
# create output directory
mkdir -p "$buildOutputDir" || exit 1
if [ "$HAIKU_HOST_BUILD_ONLY" = 1 ]; then
invalidCommand=$sourceDir/build/scripts/host_build_only
HAIKU_AR=$invalidCommand
HAIKU_CC=$invalidCommand
HAIKU_LD=$invalidCommand
HAIKU_OBJCOPY=$invalidCommand
HAIKU_RANLIB=$invalidCommand
HAIKU_ELFEDIT=$invalidCommand
HAIKU_YASM=$invalidCommand
HAIKU_STRIP=$invalidCommand
else
if [ -n "$HAIKU_PACKAGING_ARCHS" ]; then
targetArchs="$HAIKU_PACKAGING_ARCHS"
fi
HAIKU_PACKAGING_ARCHS=
# On Haiku determine target architectures and tools automatically.
if [ -z "$targetArchs" ]; then
if [ $HOST_PLATFORM != haiku_host ]; then
echo "Please specify the build tools to use or build (via" \
"--cross-tools-prefix or --build-cross-tools) or specify a"
"host-only build (--host-only)." >&2
exit 1
fi
# determine primary architecture
targetArch=`package list -i /system/packages/haiku.hpkg \
| sed '/^\s*architecture:/!d; s,^\s*architecture:\s*,,'`
is_in_list "$targetArch" "$supportedTargetArchs" || (
echo "Unsupported target architecture: \"$targetArch\"" >&2
exit 1
)
targetArchs=$targetArch
set_default_value HAIKU_AR_$targetArch ar
set_default_value HAIKU_CC_$targetArch gcc
set_default_value HAIKU_LD_$targetArch ld
set_default_value HAIKU_OBJCOPY_$targetArch objcopy
set_default_value HAIKU_RANLIB_$targetArch ranlib
set_default_value HAIKU_ELFEDIT_$targetArch elfedit
set_default_value HAIKU_STRIP_$targetArch strip
# determine secondary architectures
for targetArch in $supportedTargetArchs; do
if [ -e /system/packages/haiku_$targetArch.hpkg ]; then
targetArchs="$targetArchs $targetArch"
set_default_value HAIKU_AR_$targetArch ar-$targetArch
set_default_value HAIKU_CC_$targetArch gcc-$targetArch
set_default_value HAIKU_LD_$targetArch ld-$targetArch
set_default_value HAIKU_OBJCOPY_$targetArch objcopy-$targetArch
set_default_value HAIKU_RANLIB_$targetArch ranlib-$targetArch
set_default_value HAIKU_ELFEDIT_$targetArch elfedit-$targetArch
set_default_value HAIKU_STRIP_$targetArch strip-$targetArch
fi
done
# The target architectures might have been specified explicitly.
if [ -n "$haikuTargetArchs" ]; then
for targetArch in $haikuTargetArchs; do
is_in_list "$targetArch" "$targetArchs" || (
echo "Unsupported target architecture: \"$targetArch\"." \
"Only native architectures of the host platform can" \
"be specified." >&2
exit 1
)
done
targetArchs="$haikuTargetArchs"
fi
fi
isPrimaryArch=1
for targetArch in $targetArchs; do
# Note: targetArch is "unknown<n>" at this point, if a cross-tools
# prefix was specified. The standard_gcc_settings call below will get
# the actual architecture.
crossToolsPrefix=`get_variable crossToolsPrefix_$targetArch`
# build cross tools from sources
if [ -n "$buildCrossTools" ]; then
export HAIKU_USE_GCC_GRAPHITE
"$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \
"$buildCrossTools" "$outputDir" $buildCrossToolsJobs || exit 1
crossToolsPrefix="$outputDir/cross-tools/bin/${HAIKU_GCC_MACHINE}-"
if [ -n "$buildCrossTools" -a -z "$crossToolsPrefix" ]; then
crossToolsDir="$outputDir/cross-tools-$targetArch"
targetMachine=`get_variable buildCrossToolsMachine_$targetArch`
script="$buildCrossToolsScript"
if [ $targetArch != x86_gcc2 ]; then
script="${script}_gcc4 $targetMachine"
fi
secondaryArch=
if [ -z "$isPrimaryArch" ]; then
secondaryArch=$targetArch
fi
# cross tools
if [ -n "$crossToolsPrefix" ]; then
get_build_tool_path AR ar
get_build_tool_path CC gcc
get_build_tool_path LD ld
get_build_tool_path OBJCOPY objcopy
get_build_tool_path RANLIB ranlib
get_build_tool_path STRIP strip
case $HOST_PLATFORM in
freebsd|openbsd) MAKE=gmake;;
*) MAKE=make;;
esac
MAKE=$MAKE \
SECONDARY_ARCH=$secondaryArch \
HAIKU_USE_GCC_GRAPHITE=`get_variable \
HAIKU_USE_GCC_GRAPHITE_$targetArch` \
$script "$sourceDir" "$buildCrossTools" "$crossToolsDir" \
$buildCrossToolsJobs || exit 1
crossToolsPrefix="$crossToolsDir/bin/${targetMachine}-"
fi
# prepare gcc settings
standard_gcc_settings
# prepare gcc settings and get the actual target architecture
gcc="${crossToolsPrefix}gcc"
if [ -z "${crossToolsPrefix}" ]; then
gcc=`get_variable HAIKU_CC_$targetArch`
fi
standard_gcc_settings "$gcc"
targetArch=$standard_gcc_settings_targetArch
# cross tools for gcc4 builds
# set default values for flags
set_default_value HAIKU_CPPFLAGS_$targetArch ""
set_default_value HAIKU_CCFLAGS_$targetArch ""
set_default_value HAIKU_CXXFLAGS_$targetArch ""
set_default_value HAIKU_LDFLAGS_$targetArch ""
set_default_value HAIKU_ARFLAGS_$targetArch cru
set_default_value HAIKU_UNARFLAGS_$targetArch x
# Override the cross tools variables, if the tools were built or a
# prefix was specified.
if [ -n "$crossToolsPrefix" ]; then
case $HAIKU_GCC_RAW_VERSION in
get_build_tool_path AR_$targetArch ${crossToolsPrefix}ar
get_build_tool_path LD_$targetArch ${crossToolsPrefix}ld
get_build_tool_path OBJCOPY_$targetArch ${crossToolsPrefix}objcopy
get_build_tool_path RANLIB_$targetArch ${crossToolsPrefix}ranlib
get_build_tool_path STRIP_$targetArch ${crossToolsPrefix}strip
case `get_variable HAIKU_GCC_RAW_VERSION_$targetArch` in
4.*)
get_build_tool_path ELFEDIT elfedit
get_build_tool_path ELFEDIT_$targetArch \
${crossToolsPrefix}elfedit
;;
esac
fi
# check whether the Haiku compiler really targets Haiku or BeOS
case "$HAIKU_GCC_MACHINE" in
# Get the libgcc objects. We couldn't do that in standard_gcc_settings,
# since we need "ar", which may be set later.
ar=`get_variable HAIKU_AR_$targetArch`
libgcc=`get_variable HAIKU_GCC_LIBGCC_$targetArch`
set_variable HAIKU_GCC_LIBGCC_OBJECTS_$targetArch \
"`$ar t $libgcc | grep -v eabi.o`"
# Note: We filter out eabi.o. It's present in gcc's libgcc for PPC
# and neither needed nor wanted.
# check whether the Haiku compiler really targets Haiku
targetMachine=`get_variable HAIKU_GCC_MACHINE_$targetArch`
case "$targetMachine" in
*-*-haiku) ;;
*-*-beos) ;;
*) echo The compiler specified as Haiku target compiler is not a valid \
Haiku cross-compiler. Please see ReadMe.cross-compile. >&2
*)
echo The compiler specified as Haiku target compiler is not a \
valid Haiku cross-compiler. Please see ReadMe.cross-compile. >&2
echo compiler: $HAIKU_CC
echo compiler is configured for target: $HAIKU_GCC_MACHINE
echo compiler is configured for target: $targetMachine
exit 1 ;;
esac
HAIKU_PACKAGING_ARCHS="$HAIKU_PACKAGING_ARCHS $targetArch"
isPrimaryArch=
done
fi
# Generate BuildConfig
cat << EOF > "$buildConfigFile"
# BuildConfig
@ -586,62 +845,84 @@ HAIKU_INCLUDE_3RDPARTY ?= "${HAIKU_INCLUDE_3RDPARTY}" ;
HAIKU_ENABLE_MULTIUSER ?= "${HAIKU_ENABLE_MULTIUSER}" ;
HAIKU_DISTRO_COMPATIBILITY ?= "${HAIKU_DISTRO_COMPATIBILITY}" ;
HAIKU_USE_GCC_PIPE ?= "${HAIKU_USE_GCC_PIPE}" ;
HAIKU_USE_GCC_GRAPHITE ?= "${HAIKU_USE_GCC_GRAPHITE}" ;
HAIKU_HOST_USE_32BIT ?= "${HAIKU_HOST_USE_32BIT}" ;
HAIKU_HOST_USE_XATTR ?= "${HAIKU_HOST_USE_XATTR}" ;
HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR ?= ${HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR} ;
HAIKU_ADD_ALTERNATIVE_GCC_LIBS ?= ${HAIKU_ADD_ALTERNATIVE_GCC_LIBS} ;
HAIKU_HOST_USE_XATTR_REF ?= "${HAIKU_HOST_USE_XATTR_REF}" ;
HAIKU_HOST_BUILD_ONLY ?= "${HAIKU_HOST_BUILD_ONLY}" ;
HAIKU_GCC_RAW_VERSION ?= ${HAIKU_GCC_RAW_VERSION} ;
HAIKU_GCC_MACHINE ?= ${HAIKU_GCC_MACHINE} ;
HAIKU_GCC_LIB_DIR ?= ${HAIKU_GCC_LIB_DIR} ;
HAIKU_GCC_HEADERS_DIR ?= ${HAIKU_GCC_HEADERS_DIR} ;
HAIKU_GCC_LIBGCC ?= ${HAIKU_GCC_LIBGCC} ;
HAIKU_STATIC_LIBSTDC++ ?= ${HAIKU_STATIC_LIBSTDCXX} ;
HAIKU_SHARED_LIBSTDC++ ?= ${HAIKU_SHARED_LIBSTDCXX} ;
HAIKU_STATIC_LIBSUPC++ ?= ${HAIKU_STATIC_LIBSUPCXX} ;
HAIKU_SHARED_LIBSUPC++ ?= ${HAIKU_SHARED_LIBSUPCXX} ;
HAIKU_C++_HEADERS_DIR ?= ${HAIKU_CXX_HEADERS_DIR} ;
HAIKU_KERNEL_LIBGCC ?= ${HAIKU_KERNEL_LIBGCC} ;
HAIKU_KERNEL_LIBSUPC++ ?= ${HAIKU_KERNEL_LIBSUPCXX} ;
HAIKU_BOOT_LIBGCC ?= ${HAIKU_BOOT_LIBGCC} ;
HAIKU_BOOT_LIBSUPC++ ?= ${HAIKU_BOOT_LIBSUPCXX} ;
HAIKU_PACKAGING_ARCHS ?= ${HAIKU_PACKAGING_ARCHS} ;
HAIKU_BUILD_ATTRIBUTES_DIR ?= ${HAIKU_BUILD_ATTRIBUTES_DIR} ;
HAIKU_AR ?= ${HAIKU_AR} ;
HAIKU_CC ?= ${HAIKU_CC} ;
HAIKU_LD ?= ${HAIKU_LD} ;
HAIKU_OBJCOPY ?= ${HAIKU_OBJCOPY} ;
HAIKU_RANLIB ?= ${HAIKU_RANLIB} ;
HAIKU_ELFEDIT ?= ${HAIKU_ELFEDIT} ;
HAIKU_YASM ?= ${HAIKU_YASM} ;
HAIKU_STRIP ?= ${HAIKU_STRIP} ;
HAIKU_CPPFLAGS ?= ${HAIKU_CPPFLAGS} ;
HAIKU_CCFLAGS ?= ${HAIKU_CCFLAGS} ;
HAIKU_C++FLAGS ?= ${HAIKU_CXXFLAGS} ;
HAIKU_LDFLAGS ?= ${HAIKU_LDFLAGS} ;
HAIKU_ARFLAGS ?= ${HAIKU_ARFLAGS} ;
HAIKU_UNARFLAGS ?= ${HAIKU_UNARFLAGS} ;
HOST_GCC_RAW_VERSION ?= ${HOST_GCC_RAW_VERSION} ;
HOST_GCC_MACHINE ?= ${HOST_GCC_MACHINE} ;
HOST_LD ?= ${HOST_GCC_LD} ;
HOST_OBJCOPY ?= ${HOST_GCC_OBJCOPY} ;
HOST_SFDISK ?= ${HOST_SFDISK} ;
HOST_SHA256 ?= ${HOST_SHA256} ;
HOST_HAIKU_PORTER ?= ${HOST_HAIKU_PORTER} ;
HAIKU_PORTS ?= ${HAIKU_PORTS} ;
HAIKU_PORTS_CROSS ?= ${HAIKU_PORTS_CROSS} ;
EOF
# Libgcc.a objects
for targetArch in $HAIKU_PACKAGING_ARCHS; do
variables="
HAIKU_GCC_RAW_VERSION HAIKU_GCC_RAW_VERSION
HAIKU_GCC_MACHINE HAIKU_GCC_MACHINE
HAIKU_GCC_LIB_DIR HAIKU_GCC_LIB_DIR
HAIKU_GCC_LIBGCC HAIKU_GCC_LIBGCC
HAIKU_CPU HAIKU_CPU
HAIKU_STATIC_LIBSTDC++ HAIKU_STATIC_LIBSTDCXX
HAIKU_SHARED_LIBSTDC++ HAIKU_SHARED_LIBSTDCXX
HAIKU_STATIC_LIBSUPC++ HAIKU_STATIC_LIBSUPCXX
HAIKU_SHARED_LIBSUPC++ HAIKU_SHARED_LIBSUPCXX
HAIKU_KERNEL_LIBGCC HAIKU_KERNEL_LIBGCC
HAIKU_KERNEL_LIBSUPC++ HAIKU_KERNEL_LIBSUPCXX
HAIKU_BOOT_LIBGCC HAIKU_BOOT_LIBGCC
HAIKU_BOOT_LIBSUPC++ HAIKU_BOOT_LIBSUPCXX
HAIKU_AR HAIKU_AR
HAIKU_CC HAIKU_CC
HAIKU_LD HAIKU_LD
HAIKU_OBJCOPY HAIKU_OBJCOPY
HAIKU_RANLIB HAIKU_RANLIB
HAIKU_ELFEDIT HAIKU_ELFEDIT
HAIKU_STRIP HAIKU_STRIP
HAIKU_CPPFLAGS HAIKU_CPPFLAGS
HAIKU_CCFLAGS HAIKU_CCFLAGS
HAIKU_C++FLAGS HAIKU_CXXFLAGS
HAIKU_LDFLAGS HAIKU_LDFLAGS
HAIKU_ARFLAGS HAIKU_ARFLAGS
HAIKU_UNARFLAGS HAIKU_UNARFLAGS
HAIKU_USE_GCC_GRAPHITE HAIKU_USE_GCC_GRAPHITE
"
set -- $variables
while [ $# -ge 2 ]; do
value=`get_variable ${2}_$targetArch`
echo "${1}_${targetArch} ?= $value ;" >> "$buildConfigFile"
shift 2
done
cat << EOF > "$buildOutputDir/libgccObjects"
# libgcc.a objects to be linked against libroot.so
# Note: This file has been automatically generated by configure.
# For variables that may have long values, distribute them over multiple
# lines so that jam doesn't hit the maximum line length.
variables="
HAIKU_GCC_HEADERS_DIR HAIKU_GCC_HEADERS_DIR
HAIKU_C++_HEADERS_DIR HAIKU_CXX_HEADERS_DIR
HAIKU_GCC_LIBGCC_OBJECTS HAIKU_GCC_LIBGCC_OBJECTS
"
set -- $variables
while [ $# -ge 2 ]; do
echo "${1}_${targetArch} ?= " >> "$buildConfigFile"
get_variable ${2}_$targetArch | xargs -n 1 echo " " \
>> "$buildConfigFile"
echo " ;" >> "$buildConfigFile"
shift 2
done
done
HAIKU_GCC_LIBGCC_OBJECTS ?= ${HAIKU_GCC_LIBGCC_OBJECTS} ;
EOF
# Generate a boot strap Jamfile in the output directory.

Binary file not shown.

View File

@ -1,160 +0,0 @@
#! /bin/sh
#
# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
prefix=/boot/common
exec_prefix=${prefix}
exec_prefix_set=no
includedir=/boot/develop/headers/3rdparty
libdir=${exec_prefix}/lib
enable_shared=
wl=-Wl,
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
usage()
{
cat <<EOF
Usage: freetype-config [OPTION]...
Get FreeType compilation and linking information.
Options:
--prefix display \`--prefix' value used for building the
FreeType library
--prefix=PREFIX override \`--prefix' value with PREFIX
--exec-prefix display \`--exec-prefix' value used for building
the FreeType library
--exec-prefix=EPREFIX override \`--exec-prefix' value with EPREFIX
--version display libtool version of the FreeType library
--ftversion display FreeType version number
--libs display flags for linking with the FreeType library
--libtool display library name for linking with libtool
--cflags display flags for compiling with the FreeType
library
EOF
exit $1
}
if test $# -eq 0 ; then
usage 1 1>&2
fi
while test $# -gt 0 ; do
case "$1" in
-*=*)
optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
;;
*)
optarg=
;;
esac
case $1 in
--prefix=*)
prefix=$optarg
local_prefix=yes
;;
--prefix)
echo_prefix=yes
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
local_prefix=yes
;;
--exec-prefix)
echo_exec_prefix=yes
;;
--version)
echo 9.20.3
exit 0
;;
--ftversion)
echo_ft_version=yes
;;
--cflags)
echo_cflags=yes
;;
--libs)
echo_libs=yes
;;
--libtool)
echo_libtool=yes
;;
*)
usage 1 1>&2
;;
esac
shift
done
if test "$local_prefix" = "yes" ; then
if test "$exec_prefix_set" != "yes" ; then
exec_prefix=$prefix
fi
fi
if test "$echo_prefix" = "yes" ; then
echo $prefix
fi
if test "$echo_exec_prefix" = "yes" ; then
echo $exec_prefix
fi
if test "$exec_prefix_set" = "yes" ; then
libdir=$exec_prefix/lib
else
if test "$local_prefix" = "yes" ; then
includedir=$prefix/include
libdir=$prefix/lib
fi
fi
if test "$echo_ft_version" = "yes" ; then
major=`grep define $includedir/freetype/freetype.h \
| grep FREETYPE_MAJOR \
| sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
minor=`grep define $includedir/freetype/freetype.h \
| grep FREETYPE_MINOR \
| sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
patch=`grep define $includedir/freetype/freetype.h \
| grep FREETYPE_PATCH \
| sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
echo $major.$minor.$patch
fi
if test "$echo_cflags" = "yes" ; then
cflags="-I$includedir/freetype2"
if test "$includedir" != "/usr/include" ; then
echo $cflags -I$includedir
else
echo $cflags
fi
fi
if test "$echo_libs" = "yes" ; then
rpath=
if test "$enable_shared" = "yes" ; then
eval "rpath=\"$hardcode_libdir_flag_spec\""
fi
libs="-lfreetype -lz "
if test "$libdir" != "/usr/lib" && test "$libdir" != "/usr/lib64"; then
echo -L$libdir $rpath $libs
else
echo $libs
fi
fi
if test "$echo_libtool" = "yes" ; then
convlib="libfreetype.la"
echo $libdir/$convlib
fi
# EOF

View File

@ -1,962 +0,0 @@
#!/bin/bash
#
# Copyright (c) 2009-2010 Haiku, Inc.
# Distributed under the terms of the MIT License.
#
# Authors:
# Matt Madia, mattmadia@gmail.com
#
# Synopsis:
# Provides a controlled mechanism for end-users to install certain pre-built
# OptionalPackages. The script will determine the host information: the
# default GCC, availability of secondary GCC libs, and revision. Using this
# information, the user will be limited to the appropriate OptionalPackages
# that were available for that specific revision.
#
DISCLAIMER="\
Disclaimer:\n\
This is a temporary solution for installing OptionalPackages.\n\
In time, there will be an official package manager.\n\
See these URL's for information on the in-development package manager.\n\
http://dev.haiku-os.org/wiki/PackageManagerIdeas\n\
http://dev.haiku-os.org/wiki/PackageFormat\n\
"
USAGE="\
Usage: ./installoptionalpackage [<pkg> [<pkg> ...]]\n\
or ./installoptionalpackage [-a|-s <pkg> [<pkg> ...]]\n\
or ./installoptionalpackage [-f|-h|-l]\n\
\n\
Options:\n\
-a Add one or more packages and all dependencies\n\
-s Show the final list of packages that would be installed\n\
-f Remove cached data and list installable packages\n\
-h Print this help.\n\
-l List installable packages\n\
"
declare -A availablePackages
declare availablePackagesKeys=""
declare wantsToInstall=""
declare alreadyInstalled=""
# Some Packages cannot be installed,
# as they require either the source code or compiled binaries
declare packageIgnoreList="Bluetooth Development DevelopmentMin \
DevelopmentBase ICU-devel ICU MandatoryPackages UserlandFS \
WebPositive Welcome WifiFirmwareScriptData "
function CreateInstallerScript()
{
# This function will create a secondary script, containing all of the
# information needed to install the optional package and its dependencies
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cat << EOF > ${tmpDir}/install-optpkg.sh
#!/bin/bash
tmpDir=${tmpDir}
HAIKU_GCC_VERSION[1]=${HAIKU_GCC_VERSION[1]}
isHybridBuild=${isHybridBuild}
TARGET_ARCH=${TARGET_ARCH}
HAIKU_IMAGE_HOST_NAME=`uname -n`
#TODO: possibly add a CLI option to execute InstallSourceArchive
HAIKU_INCLUDE_SOURCES=0
$urlLine
$sslPkgLine
$sslUrlLine
$webkitFileLine
declare -a functionArgs
expanderRulesFile=`finddir B_COMMON_DATA_DIRECTORY`/expander.rules
if [ -f \${expanderRulesFile} ] ; then
expanderRulesFileExists=1
fi
function ParseFunctionArguments()
{
# ParseFunctionArguments <args>
# Parse arguments for Jam wrapper functions into an array.
IN="\$@"
OIFS=\$IFS
IFS=":"
local count=0
functionArgs=( )
for x in \$IN
do
functionArgs[\${count}]="\${x}"
((count++))
done
IFS=\$OIFS
}
function TrimLeadingSpace()
{
# TrimLeadingSpace <variable name>
eval local text='\$'"\$1"
local _outvar="\$1"
local length=\${#text}
((length--))
if [ "\${text:0:1}" == ' ' ] ; then
text=\${text#' '}
fi
eval \$_outvar="'\$text'"
}
function TrimEndingSpace()
{
# TrimEndingSpace <variable name>
eval local text='\$'"\$1"
local _outvar="\$1"
local length=\${#text}
((length--))
if [ "\${text:\$length}" == ' ' ] ; then
text=\${text%' '}
fi
eval \$_outvar="'\$text'"
}
function Exit()
{
# Exit <message>
# Wrapper for Jam rule
echo "\$@"
exit 1
}
function InstallOptionalHaikuImagePackage()
{
# InstallOptionalHaikuImagePackage package : url : dirTokens : isCDPackage
# Wrapper for Jam rule
echo "Installing \$1 ..."
cd \$tmpDir
archiveFile=\`echo \$3 | sed -s "s/http.*\///"\`
if ! [ -f \$archiveFile ] ; then
echo "Downloading \$3 ..."
# TODO : add some error handling for downloads
local attempt=1
while [ \`wget -nv \$3 ; echo \$? \` -ne 0 ]; do
if [ \$attempt -eq 5 ]; then
break
fi
(( attempt++ ))
echo "Download attempt #\$attempt failed. Retrying ..."
if [ -e \$archiveFile ]; then
rm \$archiveFile
fi
done
if [ \$attempt -ge 5 ]; then
if [ -e \$archiveFile ]; then
rm \$archiveFile
fi
Exit "Max download retries exceeded. Halting installation."
fi
fi
local dirTokens='/boot'
local count=4
local i=0
for possibleToken in "\$@" ; do
if [ \$i -lt \$count ] ; then
((i++))
else
((i++))
if [ "\$possibleToken" != ':' ] ; then
dirTokens=\${dirTokens}/\$possibleToken
else
break
fi
fi
done
echo "Extracting \$archiveFile ..."
extractDir="\${dirTokens}"
local errorMessage="
...Failed while extracting \$archiveFile
You may need to manually clean up the partially extracted files.
"
case "\$archiveFile" in
*.zip)
unzip -q -o -d "\$extractDir" "\$archiveFile" \
|| Exit "\$errorMessage"
;;
*.tgz|*.tar.gz)
tar -C "\$extractDir" -xf "\$archiveFile" \
|| Exit "\$errorMessage"
;;
*)
echo "Unhandled archive extension in InstallOptionalHaikuImagePackage()"
exit 1
;;
esac
if [ -f '/boot/.OptionalPackageDescription' ] ; then
rm '/boot/.OptionalPackageDescription'
fi
rm "\$archiveFile"
}
function InstallSourceArchive()
{
if [ \$HAIKU_INCLUDE_SOURCES -gt 0 ]; then
echo "InstallSourceArchive is not implemented."
fi
}
function AddDirectoryToHaikuImage()
{
# AddDirectoryToHaikuImage directoryTokens : attributeFiles
# Wrapper for Jam rule
ParseFunctionArguments "\$@"
local dirTokens="/boot/\${functionArgs[0]}"
TrimLeadingSpace dirTokens
TrimEndingSpace dirTokens
dirTokens=\${dirTokens//' '/\/}
mkdir -p "\${dirTokens}"
}
function AddSymlinkToHaikuImage()
{
# AddSymlinkToHaikuImage <dir tokens> : <link target> [ : <link name> ]
# Wrapper for Jam rule
ParseFunctionArguments "\$@"
local dirTokens="/boot/\${functionArgs[0]}"
TrimLeadingSpace dirTokens
TrimEndingSpace dirTokens
dirTokens=\${dirTokens//' '/\/}
local linkTarget="\${functionArgs[1]}"
TrimLeadingSpace linkTarget
TrimEndingSpace linkTarget
local linkName="\${functionArgs[2]}"
TrimLeadingSpace linkName
TrimEndingSpace linkName
mkdir -p "\${dirTokens}"
if [ "\${linkName}" == '' ] ; then
ln -sf "\${linkTarget}" -t "\${dirTokens}"
else
ln -sf "\${linkTarget}" "\${dirTokens}/\${linkName}"
fi
}
function AddUserToHaikuImage()
{
# AddUserToHaikuImage user : uid : gid : home : shell : realName
# Wrapper for Jam rule
ParseFunctionArguments "\$@"
local user=\${functionArgs[0]}
local uid=\${functionArgs[1]}
local gid=\${functionArgs[2]}
local home=\${functionArgs[3]}
local shell=\${functionArgs[4]}
local realName=\${functionArgs[5]}
passwdLine="\${user}:x:\${uid}:\${gid}:\${realName}:\${home}:\${shell}"
passwdLine=\${passwdLine//' :'/':'}
passwdLine=\${passwdLine//': '/':'}
local length=\${#passwdLine}
((length--))
if [ "\${passwdLine:\$length}" == ' ' ] ; then
passwdLine=\${passwdLine%' '}
fi
passwdFile="\`finddir B_COMMON_ETC_DIRECTORY\`/passwd"
touch \${passwdFile}
local userExists=1
while read line ; do
if [ "\${passwdLine}" == "\${line}" ] ; then
userExists=0
fi
done < \${passwdFile}
if [ \$userExists -ge 1 ] ; then
echo "\${passwdLine}" >> \${passwdFile}
fi
}
function AddExpanderRuleToHaikuImage()
{
# AddExpanderRuleToHaikuImage <mimetype> : <extension> : <list> : <extract>
# Wrapper for Jam rule
ParseFunctionArguments "\$@"
local mimetype=\${functionArgs[0]}
local extension=\${functionArgs[1]}
local list=\${functionArgs[2]}
local extract=\${functionArgs[3]}
# clean up the variables
TrimLeadingSpace mimetype
TrimEndingSpace mimetype
TrimLeadingSpace extension
TrimEndingSpace extension
TrimLeadingSpace list
TrimEndingSpace list
TrimLeadingSpace extract
TrimEndingSpace extract
local rule_raw="\${mimetype}\\t\${extension}\\t\${list}\\t\${extract}"
# reset this at every invocation
ruleFound=
if [ \${expanderRulesFileExists} ] ; then
# Check if a rule for the mimetype & extension exists.
while read line ; do
existing_rule=`echo \$line | awk '{ print \$1\$2 }'`
if [ "\${mimetype}\${extension}" == "\${existing_rule}" ] ; then
ruleFound=1
break
fi
done < "\${expanderRulesFile}"
fi
if ! [ \${expanderRulesFileExists} ] || ! [ \${ruleFound} ] ; then
# Either expander.rules does not exist or a rule for mimetype &
# extension does not exist. Output the new rule directly to it.
echo -e \${rule_raw} >> \${expanderRulesFile}
fi
}
EOF
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cat ${tmpDir}/optpkg.stage2 >> ${tmpDir}/install-optpkg.sh
rm ${tmpDir}/optpkg.stage2
}
function ContainsSubstring()
{
# ContainsSubstring <stringToLookIn> <stringToLookFor>
local string="$1"
local substring="$2"
local newString=${string/${substring}/''}
if [ ${#string} -eq $((${#newString} + ${#substring})) ] ; then
return 0
fi
return 1
}
function ErrorExit()
{
echo $1
exit 1
}
function Init()
{
# Set up some directory paths
baseDir=`finddir B_COMMON_DATA_DIRECTORY`/optional-packages
tmpDir=`finddir B_COMMON_TEMP_DIRECTORY`
libDir=`finddir B_SYSTEM_LIB_DIRECTORY`
installedPackagesFile="${baseDir}/InstalledPackages"
# Make sure these files are empty.
echo "" > ${tmpDir}/optpkg.jam
echo "" > ${tmpDir}/optpkg.stage1
if ! [ -d ${baseDir} ] ; then
mkdir -p ${baseDir}
fi
DetectSystemConfiguration
DownloadAllBuildFiles
ReadInstalledPackagesIntoMemory
ReadPackageNamesIntoMemory
}
function DownloadAllBuildFiles()
{
# DownloadAllBuildFiles
# Retreive the necessary jam files from svn.
local buildFiles="BuildFeatures OptionalPackageDependencies \
OptionalPackages OptionalLibPackages"
for file in ${buildFiles} ; do
GetBuildFile ${file}
done
}
function GetBuildFile()
{
# GetBuildFile <file>
# Downloads files from Haiku's svn
local buildfile="$1"
if ! [ -f ${baseDir}/${buildfile} ] ; then
echo "Fetching ${buildfile} ..."
cd ${baseDir}
local baseURL=http://cgit.haiku-os.org/haiku/plain
local revisionTag=`uname -v | awk '{print $1}' | sed -e 's/-.*//'`
# the sed invocation above drops potential dirty markers off the
# revision tag
local url="${baseURL}/build/jam/${buildfile}?id=${revisionTag}"
wget -q ${url} -O ${buildfile} \
|| ErrorExit "...failed to download $buildfile"
fi
}
function DetectSystemConfiguration()
{
# Determine which GCC we're running
if [ -f "$libDir"/libsupc++.so ] ; then
HAIKU_GCC_VERSION[1]=4
else
HAIKU_GCC_VERSION[1]=2
fi
# Test for hybrid
if [ -d "$libDir"/gcc4 -a -d "$libDir"/gcc2 ]; then
echo "Sorry, but your build appears to be broken ..."
echo "Both gcc2 and gcc4 subdirs exist."
exit 1
elif [ -d "$libDir"/gcc4 -o -d "$libDir"/gcc2 ]; then
isHybridBuild=1
else
isHybridBuild=""
fi
# Determine the Architecture.
if [ `uname -m` == "BePC" ] ; then
TARGET_ARCH='x86'
elif [ `uname -m` == "x86_64" ] ; then
TARGET_ARCH='x86_64'
else
echo "Sorry, x86 only for now."
exit 1
fi
}
function ReadInstalledPackagesIntoMemory()
{
while read line ; do
alreadyInstalled="${alreadyInstalled} $line"
packageIgnoreList=${packageIgnoreList/"${line} "/' '}
done < ${installedPackagesFile}
}
function ReadPackageNamesIntoMemory()
{
local file="${baseDir}/OptionalPackageNames"
if ! [ -f ${file} ] ; then
GeneratePackageNames
fi
# read list into associative array
while read line ; do
local pkg=`echo ${line} | awk '{print $1}'`
local pkgDeps=${line/"${pkg} :"/}
availablePackages[${pkg}]="${pkgDeps}"
availablePackagesKeys="${availablePackagesKeys} ${pkg}"
done < ${file}
}
function GeneratePackageNames()
{
# GeneratePackageNames
# Creates a file containing available package names
# Each line shows a pakage and all of its recrusive dependencies
# "<pkg> : <dep1> <dep2> ..."
echo "Generating a list of Package Names ..."
local file="${baseDir}/OptionalPackageNames"
if [ -e "${file}" ]; then
rm "${file}"
fi
local regExp='/^if\ \[\ IsOptionalHaikuImagePackageAdded/p'
sed -n -e "$regExp" ${baseDir}/OptionalPackages > ${file}.temp
sed -n -e "$regExp" ${baseDir}/OptionalLibPackages >> ${file}.temp
while read line ; do
# in each non-filtered line, the 4th word is the optional package
local pkg=`echo ${line} | awk '{print $4}'`
nonRepeatingDeps=""
GetPackageDependencies "$pkg"
local lowerCasePkg=`echo ${pkg} | tr '[A-Z]' '[a-z]'`
if ! ContainsSubstring "${alreadyInstalled} " "${pkg} " ; then
if IsPackageAndDepsOkToInstall ${pkg} ; then
echo "${lowerCasePkg} : ${pkg} ${nonRepeatingDeps}" >> ${file}
fi
fi
done < ${file}.temp
rm ${file}.temp
}
function GetPackageDependencies()
{
# GetPackageDependencies <pkg>
# parse OptionalPackageDependencies for the single line that defines
# this optional package's dependencies.
local regExp="^OptionalPackageDependencies\ ${1}\ \:"
local inputFile="${baseDir}/OptionalPackageDependencies"
# print that single line
sed -n -e "/${regExp}\ /p" ${inputFile} > ${tmpDir}/optpkg.temp
# strip out "OptionalPackageDependencies PackageName :"
# this leaves "<dep1> .... ;"
tempDeps=`sed -e "s/${regExp}\ //" ${tmpDir}/optpkg.temp`
for foo in ${tempDeps%' ;'} ; do
# Prevent duplicate entries of the same dependency package.
if ! ContainsSubstring "${nonRepeatingDeps} " "${foo} " ; then
nonRepeatingDeps="$foo $nonRepeatingDeps "
nonRepeatingDeps="${nonRepeatingDeps// / }"
fi
done
# Recursively get the dependencies of these dependencies.
for dep in ${tempDeps%' ;'} ; do
GetPackageDependencies "$dep"
done
}
function IsPackageAndDepsOkToInstall()
{
# IsPackageAndDepsOkToInstall <pkg>
if ContainsSubstring "${packageIgnoreList}" "${1}"; then
#echo "...warning: ${1} cannot be installed"
return 1
fi
for foo in ${nonRepeatingDeps} ; do
if ContainsSubstring "${packageIgnoreList}" "${foo}"; then
#echo "...warning: ${1} cannot be installed because of ${foo}"
return 1
fi
done
return 0
}
function BuildListOfRequestedPackages()
{
if [ "$1" = '-a' ] || [ "$1" = '-s' ]; then
shift
fi
while [ $# -gt 0 ]; do
local lowerCase=`echo $1 | tr '[A-Z]' '[a-z]'`
wantsToInstall="${wantsToInstall} $lowerCase"
shift
done
}
function AddPackages()
{
# AddPackages
# If one or more packages can be installed, do it.
if BuildFinalListOfPackagesToInstall ; then
for package in ${packagesToInstall} ; do
# output the "if [ IsOptionalHaikuImagePackageAdded..." code block
local regExp="if\ \[\ IsOptionalHaikuImagePackageAdded\ ${package}\ "
for inputFile in OptionalPackages OptionalLibPackages ; do
sed -n "/^$regExp/,/^\}/p" "${baseDir}/${inputFile}" >> ${tmpDir}/optpkg.jam
done
done
ConvertJamToBash "${tmpDir}/optpkg.jam"
rm "${tmpDir}/optpkg.jam"
CreateInstallerScript
sh ${tmpDir}/install-optpkg.sh
exitcode=$?
if [ $exitcode -gt 0 ]; then
ErrorExit "... something went wrong when installing packages."
fi
rm ${tmpDir}/install-optpkg.sh
# update files to account for the newly installed packages
alreadyInstalled="${alreadyInstalled} ${packagesToInstall} "
RecordInstalledPackages
GeneratePackageNames
echo "... done."
fi
}
function BuildFinalListOfPackagesToInstall()
{
# BuildFinalListOfPackagesToInstall
packagesToInstall=""
proceedWithInstallation=false
for desiredPackage in ${wantsToInstall}; do
if IsPackageNameValid $desiredPackage ; then
for item in ${availablePackages[${desiredPackage}]} ; do
if ! ContainsSubstring "${packagesToInstall}" "${item}" ; then
packagesToInstall="${packagesToInstall} ${item}"
fi
done
proceedWithInstallation=true
fi
done
# pad the variable
packagesToInstall="${packagesToInstall} "
# remove entries that are already installed
for skip in ${alreadyInstalled}; do
packagesToInstall=${packagesToInstall/"${skip} "/}
done
# strip double spaces
packagesToInstall=${packagesToInstall/" "/" "}
if ! [ ${#packagesToInstall} -gt 1 ]; then
echo "... no packages need to be installed."
echo ""
echo "If you wish to re-install a package, run these two commands"
echo " rm ${baseDir}/OptionalPackageNames"
echo " open $installedPackagesFile"
echo "and delete the line containing the package name(s)."
echo ""
proceedWithInstallation=false
fi
if ! $proceedWithInstallation ; then
echo 'Not proceeding with installation.'
return 1
fi
echo "To be installed: ${packagesToInstall}"
return 0
}
function IsPackageNameValid()
{
# IsPackageNameValid <name>
for name in ${availablePackagesKeys} ; do
if [ "$1" == "$name" ] ; then
return 0
fi
done
return 1
}
function RecordInstalledPackages()
{
echo -e ${alreadyInstalled} | tr '\ ' '\n' | sort > ${installedPackagesFile}
}
function ConvertJamToBash()
{
# ConvertJamToBash <input file>
# The main Jam-to-Bash conversion function.
local inputFile=$1
declare -a generatedBash
countGenBashLine=0
# Parse out some variable declarations
# TODO : add these following variables to the CreateInstallerScript
# TODO : parse HAIKU_ICU_GCC_2_PACKAGE
#local regExp='/^HAIKU_ICU_GCC_2_PACKAGE/p'
#icuGcc2PkgLine=`sed -n -e "$regExp" ${baseDir}/BuildFeatures`
#ConvertVariableDeclarationLines "$regExp" 'icuGcc2PkgLine'
# TODO : parse HAIKU_ICU_GCC_4_PACKAGE
#local regExp='/^HAIKU_ICU_GCC_4_PACKAGE/p'
#icuGcc4PkgLine=`sed -n -e "$regExp" ${baseDir}/BuildFeatures`
#ConvertVariableDeclarationLines "$regExp" 'icuGcc4PkgLine'
# TODO : parse HAIKU_ICU_DEVEL_PACKAGE
#local regExp='/^HAIKU_ICU_DEVEL_PACKAGE/p'
#icuDevelPkgLine=`sed -n -e "$regExp" ${baseDir}/BuildFeatures`
#ConvertVariableDeclarationLines "$regExp" 'icuDevelPkgLine'
# TODO : fix the regex
local regExp="/^\s*HAIKU_OPENSSL_PACKAGE = .*-gcc${HAIKU_GCC_VERSION[1]}-/p"
sslPkgLine=`sed -n -e "$regExp" ${baseDir}/BuildFeatures`
ConvertVariableDeclarationLines "$regExp" 'sslPkgLine'
# TODO : fix the regex
local regExp='/^HAIKU_OPENSSL_URL/p'
sslUrlLine=`sed -n -e "$regExp" ${baseDir}/BuildFeatures`
ConvertVariableDeclarationLines "$regExp" 'sslUrlLine'
# TODO : fix the regex
local regExp='/^HAIKU_WEBKIT_FILE/p'
webkitFileLine=`sed -n -e "$regExp" ${baseDir}/BuildFeatures`
ConvertVariableDeclarationLines "$regExp" 'webkitFileLine'
local regExp='/^local\ baseURL/p'
urlLine=`sed -n -e "$regExp" ${baseDir}/OptionalPackages`
urlLine=${urlLine/local\ /''}
ConvertVariableDeclarationLines "$regExp" 'urlLine'
# Convert the easy bits.
while read line ; do
line=${line/'Echo'/'echo'}
# TODO: add support for converting for loops.
# will need to introduce curly brace counting
ConvertIfStatements "$line"
ConvertVariables "$line"
#ReplaceComparators "$line"
line=${line/"IsOptionalHaikuImagePackageAdded"/'"SomeText" !='}
generatedBash[$countGenBashLine]=${line}
((countGenBashLine++))
done < ${tmpDir}/optpkg.jam
# output stage 1 generated code
local i=0
while [ $i -lt $countGenBashLine ] ; do
echo ${generatedBash[$i]} >> ${tmpDir}/optpkg.stage1
((i++))
done
# This converts multi-line jam statements into a single line.
# --- Start awk ---
awk '
/InstallOptionalHaikuImagePackage/,/\;/{
isRule=1;
if($0~/\;/) ORS="\n";
else ORS=" "; print
}
/AddSymlinkToHaikuImage/,/\;/{
isRule=1;
if($0~/\;/) ORS="\n";
else ORS=" "; print
}
/AddUserToHaikuImage/,/\;/{
isRule=1;
if($0~/\;/) ORS="\n";
else ORS=" "; print
}
/AddExpanderRuleToHaikuImage/,/\;/{
isRule=1;
if($0~/\;/) ORS="\n";
else ORS=" "; print
}
/Exit/,/\;/{
isRule=1;
if($0~/\;/) ORS="\n";
else ORS=" "; print
}
{
if($1!='InstallOptionalHaikuImagePackage' && isRule!=1 && $1!="\;")
print $0
}
{ isRule=0; }
' ${tmpDir}/optpkg.stage1 > ${tmpDir}/optpkg.stage2 2>/dev/null
# --- End awk ---
rm ${tmpDir}/optpkg.stage1
}
function ConvertVariableDeclarationLines()
{
# ConvertVariableDeclarationLines <regex> <variable>
# One of the Jam-to-Bash conversion functions.
# Jam lines that define variables need to be parsed differently.
eval local input='$'"$2"
local regex="$1"
local _outvar="$2"
input=${input/\ =\ /=}
input=${input/\;/''}
input=${input//\(/'{'}
input=${input//\)/'}'}
eval $_outvar="'$input'"
}
function ConvertIfStatements()
{
# ConvertIfStatements <line>
# One of the Jam-to-Bash conversion functions.
line=${line//'} else {'/'else '}
line=${line//'} else if '/'elif '}
if ContainsSubstring "$line" "if " ; then
if ! ContainsSubstring "$line" "if [" ; then
line=${line/'if '/'if [ '}
fi
if ContainsSubstring "$line" '] {' ; then
line=${line/'{'/' ; then'}
elif ContainsSubstring "$line" '{' ; then
line=${line/'{'/' ] ; then'}
fi
for compound in '&&' '||' ; do
if ContainsSubstring "$line" "$compound" ; then
line=${line/"$compound"/"] $compound ["}
fi
done
ReplaceComparators "$line"
fi
# Assume all remaining closing braces are part of if statements
line=${line/'}'/'fi'}
}
function ConvertVariables()
{
# ConvertVariables
# One of the Jam-to-Bash conversion functions.
# NOTE: jam's variables are normally '$(VARIABLE)'. \n
# The issue is with '(' and ')', so let's replace them globally.
if ContainsSubstring "$line" '$(' ; then
line=${line//'('/'{'}
line=${line//')'/'}'}
fi
}
function ReplaceComparators()
{
# ReplaceComparators <line>
# One of the Jam-to-Bash conversion functions.
# Preserve string comparators for TARGET_ARCH.
if ! ContainsSubstring "$line" 'TARGET_ARCH' ; then
line=${line//'>='/'-ge'}
line=${line//'<='/'-le'}
line=${line//'>'/'-gt'}
line=${line//'<'/'-lt'}
line=${line//'!='/'-ne'}
line=${line//'='/'-eq'}
fi
}
function DisplayUsage()
{
echo -e "$DISCLAIMER"
echo -e "$USAGE"
}
function RemoveCachedFiles()
{
# RemoveCachedFiles
echo "Removing cached files ..."
if [ -e ${baseDir}/OptionalPackageNames ]; then
rm ${baseDir}/OptionalPackageNames
fi
# Unset variables, which prevents duplicate entries.
declare -A availablePackages
declare availablePackagesKeys=""
# Reinitialize
Init
}
function ListPackages()
{
# ListPackages
echo ""
echo "Optional Packages that have been installed:"
echo ${alreadyInstalled}
echo ""
echo ""
echo "Installable Optional Packages:"
# single line:
echo ${availablePackagesKeys}
# one per line:
#for package in ${availablePackagesKeys} ; do
# echo ${package}
#done
}
# If no arguments were passed to the script, display its usage and exit.
if [ "$#" -lt 1 ] ; then
DisplayUsage
exit 0
else
Init
fi
# Support `installoptionalpackage <pkg> <pkg> ...`
if [ "$1" != '-f' ] && [ "$1" != '-l' ] && [ "$1" != '-h' ] \
&& [ "$1" != '-s' ]; then
BuildListOfRequestedPackages $@
AddPackages
exit 0
fi
# Parse the arguments given to the script.
while getopts "as:fhl" opt; do
case $opt in
a)
BuildListOfRequestedPackages $@
AddPackages
exit 0
;;
f)
RemoveCachedFiles
ListPackages
exit 0
;;
h)
DisplayUsage
exit 0
;;
l)
ListPackages
exit 0
;;
s)
BuildListOfRequestedPackages $@
BuildFinalListOfPackagesToInstall
exit 0
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done

View File

@ -1,99 +0,0 @@
#!/bin/sh
#
# setgcc [ <arch> ] [ <gcc> ]
abiDir=/boot/develop/abi
abiLink=$abiDir/current
libDir=/boot/develop/lib
usage()
{
cat << EOF
Usage: $0 [ <arch> ] [ <gcc> ]
Sets the current gcc version, respectively prints it, if no arguments are
given.
<arch> - The architecture to set. Supported values: "x86", "ppc".
<gcc> - The major gcc version to set. Supported values: "gcc2", "gcc4".
EOF
}
if [ $# -gt 2 ]; then
usage
exit 1
fi
if [ $# -eq 0 ]; then
if [ -h $abiLink ]; then
abi=$(readlink $abiLink 2> /dev/null) || {
echo "Failed to read GCC symlink." >&2
exit 1
}
echo "Current GCC: $abi"
exit
else
echo "GCC symlink not installed." >&2
exit 1
fi
fi
arch=
gcc=
# parse the args
while [ $# -gt 0 ]; do
case $1 in
-h,--help) usage; exit;;
x86) arch=$1;;
ppc) arch=$1;;
gcc2|gcc4) gcc=$1;;
*) usage; exit 1;;
esac
shift
done
# use the native arch, if not given
if [ -z "$arch" ]; then
case $(uname -m) in
BePC) arch=x86;;
*) echo "Can't guess native architecture. Please specify!" >&2
exit 1;;
esac
fi
# guess the native gcc version, if not given
if [ -z "$gcc" ]; then
if [ -e /system/lib/gcc2 ]; then
gcc=gcc4
elif [ -e /system/lib/gcc4 ]; then
gcc=gcc2
elif [ -e /system/lib/libstdc++.r4.so ]; then
gcc=gcc2
else
echo "Can't guess native GCC version. Please specify!" >&2
exit 1
fi
fi
# check whether the gcc exists
count=`ls -l $abiDir/$arch/$gcc/tools/current/bin/*gcc 2>/dev/null | wc -l`
if [ $count -eq 0 ]; then
echo "Can't set GCC $arch/$gcc -- not installed." >&2
exit 1
fi
# create the symlink
( rm $abiLink && ln -sf $arch/$gcc $abiLink ) || {
echo "Failed to set GCC $arch/$gcc." >&2
exit 1
}
# create the lib symlink
libLink=$libDir/$arch
( rm -f $libLink && ln -sf $abiDir/$arch/$gcc/lib $libLink ) || {
echo "Failed to set lib $arch/$gcc." >&2
exit 1
}

View File

@ -33,6 +33,7 @@ WriteMailCatalogEntryAttribute()
}
# TODO: Several of the directories are read-only, so this doesn't work.
WriteTrackerCatalogEntryAttribute \
"$(finddir B_APPS_DIRECTORY)" B_APPS_DIRECTORY
@ -55,8 +56,6 @@ WriteTrackerCatalogEntryAttribute \
"$(finddir B_USER_SETTINGS_DIRECTORY)/Tracker/Tracker New Templates" \
"B_USER_SETTINGS_DIRECTORY/Tracker/Tracker New Templates"
WriteTrackerCatalogEntryAttribute "/boot/optional" "/boot/optional"
WriteTrackerCatalogEntryAttribute \
"$(finddir B_PREFERENCES_DIRECTORY)" B_PREFERENCES_DIRECTORY

View File

@ -1,44 +0,0 @@
#!/bin/sh
_progress () {
notify --type progress --group "MIME type updater" \
--timeout ${3:-30} \
--icon /boot/system/apps/DiskProbe \
--messageID $0_$$ \
--title "Updating file MIME types..." \
--progress $1 "$2" >/dev/null
}
_progress 0.0 "desktop files"
# Make sure files on the desktop are mimeset first
for f in $(/bin/finddir B_DESKTOP_DIRECTORY 2>/dev/null\
|| echo "/boot/home/Desktop")/*; do
if [ -f "$f" ]; then
mimeset -f "$f"
fi
done
# Make sure all apps have a MIME DB entry.
SYSTEM=$(/bin/finddir B_SYSTEM_DIRECTORY 2>/dev/null || echo "/boot/system")
mimeset -f "$SYSTEM/bin/userguide"
mimeset -f "$SYSTEM/bin/welcome"
_progress 0.1 "system applications"
mimeset -apps -f "$SYSTEM/apps"
_progress 0.2 "documentation"
mimeset -f "$SYSTEM/documentation"
_progress 0.3 "preferences"
mimeset -apps -f "$SYSTEM/preferences"
_progress 0.4 "servers"
mimeset -apps -f "$SYSTEM/servers"
_progress 0.5 "applications"
mimeset -apps -f "/boot/apps"
_progress 0.7 "application (by signature)"
query -f 'BEOS:APP_SIG=*' | xargs --no-run-if-empty mimeset -apps -f
_progress 1.0 "done" 10

View File

@ -3,7 +3,7 @@
# DO NOT EDIT!
#=====================================================================
# Start programs and open files in the boot launch folder
for file in $HOME/config/boot/launch/*
for file in $HOME/config/settings/boot/launch/*
do
/bin/open "$file" &
done

View File

@ -104,6 +104,8 @@ fi
launch $SERVERS/debug_server # launch debug_server
launch $SERVERS/package_daemon
# Init Network
if [ "$SAFEMODE" != "yes" ]; then
launch $SERVERS/net_server # launch net_server
@ -184,20 +186,21 @@ launch system/preferences/Time "" --update
if [ "$SAFEMODE" != "yes" ]; then
# Start user boot script
if [ -f $HOME/config/boot/UserBootscript ]; then
. $HOME/config/boot/UserBootscript
if [ -f $HOME/config/settings/boot/UserBootscript ]; then
. $HOME/config/settings/boot/UserBootscript
fi
fi
# Check for fresh install and run post install scripts.
freshInstallIndicator=/boot/common/settings/fresh_install
postInstallDir=/boot/common/boot/post_install
postInstallDir=boot/post-install
if [ -e $freshInstallIndicator ]; then
# wait a moment for things to calm down a bit
sleep 3
# execute scripts
for f in $postInstallDir/*.sh; do
for f in /boot/system/$postInstallDir/*.sh /boot/common/$postInstallDir/*.sh
do
if [ -f $f ]; then
echo "Running post install script $f ..." > /dev/dprintf
$f

View File

@ -6,8 +6,7 @@
export HOME=/boot/home
export LC_CTYPE="en_US.UTF-8"
BUILDHOME=/boot/develop
BETOOLS="$BUILDHOME/tools/gnupro/bin"
BUILDHOME=/boot/system/develop
case `uname -m` in
BePC|Intel|unknown)
@ -20,33 +19,23 @@ BeMac|BeBox)
BE_HOST_CPU=`uname -m`
esac
BELIBRARIES="$BUILDHOME/abi/current/library-paths/common:$BUILDHOME/lib/$BE_HOST_CPU"
# not used by Haiku, but by (legacy) applications (e.g. Pe)
BH=$BUILDHOME/headers
BEINCLUDES="$BH;$BH/be;$BH/posix;$BH/glibc;$BH/cpp;$BH/be/app;$BH/be/device;$BH/be/interface;$BH/be/locale;$BH/be/media;$BH/be/midi;$BH/be/midi2;$BH/be/net;$BH/be/kernel;$BH/be/storage;$BH/be/support;$BH/be/game;$BH/be/opengl;$BH/be/drivers;$BH/gnu;$BH/be/mail;$BH/be/translation;$BH/be/devel;$BH/be/add-ons/graphics;$BH/be/be_apps/Deskbar;$BH/be/be_apps/NetPositive;$BH/be/be_apps/Tracker"
export BUILDHOME
export BETOOLS
export BELIBRARIES
export BEINCLUDES
export BE_HOST_CPU
# for the "cc" and "ld" shell scripts
export BE_C_COMPILER=gcc
export BE_CPLUS_COMPILER="g++"
export BE_LINKER=ld
export BE_DEFAULT_C_FLAGS=""
export BE_DEFAULT_CPLUS_FLAGS=""
if [ "$SAFEMODE" != "yes" ]
then
export PATH=.:$HOME/config/bin:/boot/common/bin:/bin:/boot/apps:/boot/preferences:/boot/system/apps:/boot/system/preferences:$BETOOLS
export LIBRARY_PATH="%A/lib:$HOME/config/lib:/boot/common/lib:/boot/system/lib"
export ADDON_PATH="%A/add-ons:$HOME/config/add-ons:/boot/common/add-ons:/boot/system/add-ons"
export PATH=.:$HOME/config/non-packaged/bin:$HOME/config/bin:/boot/common/non-packaged/bin:/boot/common/bin:/bin:/boot/common/apps:/boot/common/preferences:/boot/system/apps:/boot/system/preferences
export LIBRARY_PATH="%A/lib:$HOME/config/non-packaged/lib:$HOME/config/lib:/boot/common/non-packaged/lib:/boot/common/lib:/boot/system/lib"
export ADDON_PATH="%A/add-ons:$HOME/config/non-packaged/add-ons:$HOME/config/add-ons:/boot/common/non-packaged/add-ons:/boot/common/add-ons:/boot/system/add-ons"
else
export PATH=.:/boot/common/bin:/bin:/boot/apps:/boot/preferences:/boot/system/apps:/boot/system/preferences:$BETOOLS
export LIBRARY_PATH="%A/lib:/boot/common/lib:/boot/system/lib"
export ADDON_PATH="%A/add-ons:/boot/common/add-ons:/boot/system/add-ons"
export PATH=.:/bin:/boot/common/apps:/boot/system/apps:/boot/system/preferences
export LIBRARY_PATH="%A/lib:/boot/system/lib"
export ADDON_PATH="%A/add-ons:/boot/system/add-ons"
fi
# Locale
@ -65,8 +54,8 @@ fi
if [ "$SAFEMODE" != "yes" ]
then
if [ -f $HOME/config/boot/UserSetupEnvironment ]
if [ -f $HOME/config/settings/boot/UserSetupEnvironment ]
then
. $HOME/config/boot/UserSetupEnvironment
. $HOME/config/settings/boot/UserSetupEnvironment
fi
fi

View File

@ -0,0 +1 @@
#include "/boot/system/develop/headers/os/support/Errors.h"

View File

@ -0,0 +1 @@
#include "/boot/system/develop/headers/config/HaikuConfig.h"

View File

@ -0,0 +1 @@
#include "/boot/system/develop/headers/config/types.h"

View File

@ -22,6 +22,7 @@ class BBlockCache;
class BMessenger;
class BHandler;
class BString;
class BStringList;
struct entry_ref;
@ -105,6 +106,7 @@ class BMessage {
status_t AddPoint(const char *name, BPoint aPoint);
status_t AddString(const char *name, const char *aString);
status_t AddString(const char *name, const BString &aString);
status_t AddStrings(const char *name, const BStringList &list);
status_t AddInt8(const char *name, int8 value);
status_t AddUInt8(const char *name, uint8 value);
status_t AddInt16(const char *name, int16 value);
@ -140,6 +142,7 @@ class BMessage {
status_t FindString(const char *name, int32 index, const char **string) const;
status_t FindString(const char *name, BString *string) const;
status_t FindString(const char *name, int32 index, BString *string) const;
status_t FindStrings(const char *name, BStringList *list) const;
status_t FindInt8(const char *name, int8 *value) const;
status_t FindInt8(const char *name, int32 index, int8 *value) const;
status_t FindUInt8(const char *name, uint8 *value) const;

View File

@ -0,0 +1 @@
#include <../os/interface/Gradient.h>

View File

@ -0,0 +1 @@
#include <../os/interface/IconUtils.h>

View File

@ -1 +0,0 @@
#include <../os/package/BlockBufferCacheNoLock.h>

View File

@ -0,0 +1 @@
#include <../os/package/DownloadFileRequest.h>

View File

@ -0,0 +1 @@
#include <../os/package/GlobalWritableFileInfo.h>

View File

@ -0,0 +1 @@
#include <../os/package/InstallationLocationInfo.h>

View File

@ -0,0 +1 @@
#include <../os/package/User.h>

View File

@ -0,0 +1 @@
#include <../os/package/UserSettingsFileInfo.h>

View File

@ -0,0 +1 @@
#include <../os/package/WritableFileUpdateType.h>

View File

@ -1 +0,0 @@
#include <../os/package/hpkg/BlockBufferCache.h>

View File

@ -0,0 +1 @@
#include <../os/package/hpkg/BlockBufferPool.h>

View File

@ -0,0 +1 @@
#include <../os/package/hpkg/BlockBufferPoolNoLock.h>

View File

@ -1 +0,0 @@
#include <../os/package/hpkg/BufferCache.h>

View File

@ -0,0 +1 @@
#include <../os/package/hpkg/BufferPool.h>

View File

@ -0,0 +1 @@
#include <../os/package/hpkg/NoErrorOutput.h>

View File

@ -0,0 +1 @@
#include <../os/package/hpkg/PackageAttributes.h>

Some files were not shown because too many files have changed in this diff Show More