1# UserBuildConfig ReadMe 2# ---------------------- 3 4# UserBuildConfig can be used to customize the build according to your needs. 5# If existent it is included by the build system, but it is ignored by svn. 6# This file documents a few examples, what can be done. Don't just rename it 7# to UserBuildConfig -- you don't want all the things to happen, that are 8# specified here. Rather create an empty UserBuildConfig and copy the lines 9# you really want, or start out with UserBuildConfig.sample. 10# Of course, noone reads ReadMe files, so they will just get an error here 11# when copying it and jamming: 12Exit You must NOT copy UserBuildConfig.ReadMe directly but use parts of it! ; 13 14 15# Adding timezone and keymap settings 16AddSymlinkToHaikuImage home config settings 17 : /boot/beos/etc/timezones/Europe/Paris : timezone ; 18 19AddFilesToHaikuImage home config settings : <keymap>US-International 20 : Key_map ; 21 22 23# Adjusting Build Variables 24 25# The following variables can be configured per subdirectory (or subtree) or 26# even per object file: 27# 28# CCFLAGS C++FLAGS DEBUG DEFINES HDRS LINKFLAGS OPTIM OPTIMIZE SYSHDRS 29# WARNINGS 30# HOST_WARNING_CCFLAGS HOST_WARNING_C++FLAGS 31# TARGET_WARNING_CCFLAGS TARGET_WARNING_C++FLAGS 32# PLATFORM SUPPORTED_PLATFORMS 33# 34# The following examples would work analogously for any of these variables. 35 36# Turn off warnings in directory src/system/kernel. As fourth (scope) parameter 37# "local" is specified, which means, that this setting applies only to the 38# given directory, but not any of its subdirectories. 39SetConfigVar WARNINGS : HAIKU_TOP src system kernel : 0 : local ; 40 41# Set the debug level for directory src/system/boot/loader and recursively all 42# of its subdirectories (scope is "global") to 1. All affected generated files 43# will be put into another subtree of the "generated" directory, which allows 44# for fast switching between normal and debug builds. 45SetConfigVar DEBUG : HAIKU_TOP src system boot loader : 1 : global ; 46 47# Add "RUN_WITHOUT_REGISTRAR" to the DEFINES for the directory src/kits and 48# all of its subdirectories. 49AppendToConfigVar DEFINES : HAIKU_TOP src kits : RUN_WITHOUT_REGISTRAR 50 : global ; 51 52# Set the debug level for file src/bin/gdb/gdb/haiku-nat.c (note, that 53# the object file must be specified) to 1. It is worth mentioning, that the 54# executable the object file is linked into (gdb), will still be placed in 55# generated/objects/.../release/... Only when setting DEBUG for the executable, 56# too, it will be placed in .../debug_1/.... Apart from that, the DEBUG variable 57# has no effect on executables or other shared objects. 58DEBUG on <src!bin!gdb!gdb!>haiku-nat.o = 1 ; 59 60 61# Haiku Image Related Modifications 62 63# Create a 100 MB image at /tmp/walter.image. 64HAIKU_IMAGE_NAME = walter.image ; 65HAIKU_IMAGE_DIR = /tmp ; 66HAIKU_IMAGE_SIZE = 100 ; 67 68# Name the VMWare image walter.vmdk (in directory $(HAIKU_IMAGE_DIR)). 69HAIKU_VMWARE_IMAGE_NAME = walter.vmdk ; 70 71# Install Haiku in directory /Haiku. 72HAIKU_INSTALL_DIR = /Haiku ; 73 74# If the image does already exist it won't be zeroed out. It will nevertheless 75# freshly be initialized with BFS. Useful when installing Haiku on a partition. 76HAIKU_DONT_CLEAR_IMAGE = 1 ; 77 78 79# Affects the haiku-image, haiku-vmware-image, and install-haiku targets. Only 80# targets on which the HAIKU_INCLUDE_IN_IMAGE variable has been set will be 81# updated in the image file/installation directory. 82# The update-image, update-vmware-image, and update-install targets always invoke 83# this rule, so one likely doesn't ever need to do it manually. 84SetUpdateHaikuImageOnly 1 ; 85 86# libbe.so and the kernel will be updated on image updates. Note that this 87# generally doesn't work for pseudo targets (it does where special support 88# has been added, like for "kernel"). 89HAIKU_INCLUDE_IN_IMAGE on libbe.so kernel = 1 ; 90 91# Add "crashing_app" to the beos/bin directory of the Haiku image/installation. 92# Note, that this also makes the image depend on the target, i.e. it is 93# automatically updated when the image is built. 94AddFilesToHaikuImage beos bin : crashing_app ; 95 96# Make a symlink to home/config/bin/crash. 97AddSymlinkToHaikuImage home config bin : /beos/bin/crashing_app : crash ; 98 99# Adds the source directories src/kits/storage and src/tests/servers/debug 100# (recursively) to the image (as /boot/home/HaikuSources/src/kits/storage 101# and /boot/home/HaikuSources/src/tests/servers/debug respectively). 102# Note that the second directory will also be copied, if the image will only 103# be updated; the first one won't in that case. 104AddSourceDirectoryToHaikuImage src/kits/storage ; 105AddSourceDirectoryToHaikuImage src/tests/servers/debug : 1 ; 106 107# Copy the jam sources (assuming they are located ../buildtools/jam relatively 108# to your Haiku sources) to the image as /boot/home/Desktop/jam-src, excluding 109# any file or directory named ".svn" and any source path that matches the 110# pattern "*/jam/./bin.*". Note that the "*" character needs to be escaped with 111# two backslashes (one because it goes through a shell and one to quote the 112# first one in jam), and that the build system always appends "/." to the source 113# path (hence this pattern). Just as AddSourceDirectoryToHaikuImage this rule 114# can also take another optional parameter indicating whether the directory shall 115# also be copied in update mode. 116CopyDirectoryToHaikuImage home Desktop 117 : $(HAIKU_TOP)/../buildtools/jam 118 : "jam-src" : -x .svn -X \\*/jam/./bin.\\* ; 119 120# Unzips the given zip archive onto the image under /boot/develop/tools. 121UnzipArchiveToHaikuImage develop tools 122 : /home/bonefish/develop/haiku/misc/gcc-2.95.3-beos-070218/gcc-2.95.3_binutils-2.17_rel-070218.zip ; 123 124# Add the optional package WonderBrush to the image. The package is downloaded 125# via wget (i.e. wget must be installed). 126AddOptionalHaikuImagePackages WonderBrush ; 127 128# Add all available optional packages. 129HAIKU_ADD_ALL_OPTIONAL_PACKAGES = 1 ; 130 131# Add the libraries built with the alternative gcc version. The alternative 132# gcc generated directory must have been specified via the configure option 133# --alternative-gcc-output-dir. Note, that a sub-jam will be executed. When 134# using a jam that is not simply invoked by "jam", set the JAM build variable 135# accordingly. 136HAIKU_ADD_ALTERNATIVE_GCC_LIBS = 1 ; 137 138# Specify scripts that shall be run when populating the image/installation 139# directory. The "early" script is run before anything has been copied onto 140# the image/into the installation directory. The "late" script is run after 141# everything has been copied, but before the MIME database is installed. 142HAIKU_IMAGE_EARLY_USER_SCRIPTS = $(HAIKU_TOP)/../early-image-script.sh ; 143HAIKU_IMAGE_LATE_USER_SCRIPTS = $(HAIKU_TOP)/../late-image-script.sh ; 144 145# Set name and real name of the root user. Defaults to "baron" and "Root User". 146HAIKU_ROOT_USER_NAME = bond ; 147HAIKU_ROOT_USER_REAL_NAME = "James Bond" ; 148 149# Set host name to "mybox". By default the installation doesn't have a host 150# name. 151HAIKU_IMAGE_HOST_NAME = mybox ; 152 153# Add user "walter" with user ID 1000 and group ID 100 (note, that a group with 154# that ID should exist -- 100 already exists and is the "users" group), home 155# directory "/boot/home", shell "/bin/bash", and real name "Just Walter" to the 156# image. 157AddUserToHaikuImage walter : 1000 : 100 : /boot/home : /bin/bash 158 : "Just Walter" ; 159 160# Add group "party" with group ID 101 and members "baron" and "walter" to the 161# image. 162AddGroupToHaikuImage party : 101 : baron walter ; 163 164 165# Build Profiles 166 167# A build profile is a named set of settings for building a Haiku image or 168# installation. The following lines define five different build profiles: 169# disk - Installation on device /dev/sda57. All optional packages will be 170# included. Profile type "disk" implies "HAIKU_DONT_CLEAR_IMAGE = 1". 171# qemu - A plain 200 MB disk image (type "image") named "haiku-qemu.image". 172# Since only the image name is given, the default location will be 173# chosen for the image, unless HAIKU_IMAGE_DIR has been set 174# beforehand. 175# vmware - A 400 MB VMware image (type "vmware-image"). It will not be zeroed, 176# if not necessary. The optional packages Development and Pe will be 177# installed. No image name or path is given, so the defaults 178# ("haiku.vmdk" in the generated directory) will be used, unless the 179# respective variables are set. 180# crash - Similar to the vmware profile, but created at a specific location 181# and 1 GB size. Furthermore a "crash-tests" directory will be copied 182# to the image. 183# install - Installation in directory "/Haiku2" (type "install"). 184 185DefineBuildProfile disk : disk : "/dev/sda57" ; 186DefineBuildProfile qemu : image : "haiku-qemu.image" ; 187DefineBuildProfile vmware : vmware-image ; 188DefineBuildProfile crash : vmware-image 189 : "/home/foobar/vmware/Virtual Machines/CrashOMatic/CrashOMatic.vmdk" ; 190DefineBuildProfile install : install : /Haiku2 ; 191 192switch $(HAIKU_BUILD_PROFILE) { 193 case "disk" : { 194 HAIKU_ADD_ALL_OPTIONAL_PACKAGES = 1 ; 195 } 196 197 case "qemu" : { 198 HAIKU_IMAGE_SIZE = 200 ; 199 } 200 201 case "vmware" : { 202 HAIKU_IMAGE_SIZE = 400 ; 203 HAIKU_DONT_CLEAR_IMAGE = 1 ; 204 AddOptionalHaikuImagePackages Development Pe ; 205 } 206 207 case "crash" : { 208 HAIKU_IMAGE_SIZE = 1024 ; 209 HAIKU_DONT_CLEAR_IMAGE = 1 ; 210 AddOptionalHaikuImagePackages Development Pe ; 211 CopyDirectoryToHaikuImage home Desktop : $(HAIKU_TOP)/../crash-tests ; 212 } 213} 214 215# By specifying the build profile name as first (non-option) parameter on the 216# jam command line prefixed by an "@" character, the profile will be selected. 217# The second parameter specifies the action to be performed, further optional 218# parameters may follow. Jam command line examples: 219# 220# jam -q @disk build 221# -> Equivalent to running "jam -q haiku-image" with the settings for the 222# "disk" profile. "build" is the default action, so it could even be 223# omitted. 224# jam -q @vmware update kernel 225# -> Equivalent to running "jam -q update-vmware-image kernel" with the 226# settings for the "vmware" profile. 227# jam -q @crash mount 228# -> Enters the bfs_shell mounting the image specified by the "crash" profile. 229# 230# Note, that the build system will automatically define the build profiles 231# "image", "vmware-image", and "install", unless they are already defined in 232# the UserBuildConfig. They correspond to the respective build profile types 233# and use the values of the variables HAIKU[_VMWARE]_IMAGE_NAME, 234# HAIKU_IMAGE_DIR, HAIKU_INSTALL_DIR, respectively their default values. 235# "jam -q @image" will therefore be equivalent to "jam -q haiku-image". 236 237 238# Creating Sourceable Shell Scripts 239 240# If you use shell scripts (e.g. for testing) that need to access targets or 241# build system properties, you can tell the build system to generate a 242# variables defining shell script you can source from your shell script. 243 244# General setup for the shell script to generate. Name is test.inc, located 245# in the output directory. 246MakeLocate test.inc : $(HAIKU_OUTPUT_DIR) ; 247Always test.inc ; 248 249# Define variable "outputDir" in the shell script, with the value of 250# HAIKU_OUTPUT_DIR. 251AddVariableToScript test.inc : outputDir : $(HAIKU_OUTPUT_DIR) ; 252 253# Define variables "bfsShell" and "fsShellCommand" referring to the 254# generated bfs_shell and fs_shell_command respectively. 255AddTargetVariableToScript test.inc : bfs_shell : bfsShell ; 256AddTargetVariableToScript test.inc : fs_shell_command : fsShellCommand ; 257 258# If no variable name is given, the name (without grist) of the target is 259# used, i.e. a variable "rc" referring to the rc command built for the host 260# platform is defined in the script. 261AddTargetVariableToScript test.inc : <build>rc ; 262 263 264# Optimizing Jamfile Parsing Times / Third Party Inclusion 265 266# Setting this variable will prevent the root Jamfile to include the Jamfile 267# in the src directory. Instead only the directories required for building the 268# build tools are included. Only useful in combination with DeferredSubInclude. 269HAIKU_DONT_INCLUDE_SRC = 1 ; 270 271# Schedule the given subdirectory for inclusion at the end of the root 272# Jamfile (directly using SubInclude here is not possible). Using this 273# feature together with HAIKU_DONT_INCLUDE_SRC allows developers working 274# only on a subproject to reduce Jamfile parsing times considerably. 275DeferredSubInclude HAIKU_TOP src tests add-ons kernel file_systems 276 userlandfs ; 277 278# Schedule src/3rdparty/myproject/Jamfile.haiku for later inclusion. The "local" 279# parameter specifies that the alternative Jamfile name shall not be used for 280# any subdirectory of the given directory (i.e. "Jamfile" will be used as 281# usual). Omitting this parameter or specifying "global" will cause the given 282# name to be used recursively. 283DeferredSubInclude HAIKU_TOP src 3rdparty myproject : Jamfile.haiku : local ; 284 285 286# Copy the posix test suite onto the image (or on the installation) into 287# "home/posixtestsuite" directory, including the run script. 288HAIKU_ADD_POSIX_TEST_SUITE_TO_IMAGE = 1 ; 289