haiku/build/jam/HaikuImage
Ingo Weinhold 9b0dd52858 Support for adding libraries compiled with the alternative gcc (2 vs.
4). One has to have a (fully configured) "generated" directory for the
alternative gcc and specify it using the new option
"--alternative-gcc-output-dir" when configuring the main build.
Additionally the build variable HAIKU_ADD_ALTERNATIVE_GCC_LIBS has to be
set to "1".

If that has been done, when building the image a sub-jam is invoked that
generates the alternative libs and zips them. The main-jam unzips them
into the correct directory in the image. Note that the JAM build
variable has to be set when using a jam executable not invoked by "jam".

Tested with gcc 2 NetPositive, Pe, and FireFox under gcc 4 Haiku, and
with a few of the standard gcc 4 Haiku apps under gcc 2 Haiku. Seems to
work fine so far.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25536 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-17 23:47:39 +00:00

678 lines
25 KiB
Plaintext

# 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).
# create directories that will remain empty
AddDirectoryToHaikuImage home Desktop ;
AddDirectoryToHaikuImage home config bin ;
AddDirectoryToHaikuImage home config lib ;
AddDirectoryToHaikuImage home mail ;
AddDirectoryToHaikuImage var empty ;
AddDirectoryToHaikuImage var log ;
AddDirectoryToHaikuImage var tmp ;
local X86_ONLY = ;
local PPC_ONLY = ;
if $(TARGET_ARCH) = x86 {
X86_ONLY = "" ;
} else if $(TARGET_ARCH) = ppc {
X86_ONLY = ;
}
local GPL_ONLY = ;
if $(INCLUDE_GPL_ADDONS) = 1 {
GPL_ONLY = "" ;
}
BEOS_BIN = "[" addattr alert arp base64 basename bc beep bootman bzip2 cal cat
catattr chgrp chmod chop chown chroot cksum clear clockconfig cmp comm
compress cp copyattr $(X86_ONLY)CortexAddOnHost
csplit ctags cut date dc dd desklink df diff diff3 dircolors dirname
draggers driveinfo dstcheck du echo eject env error expand expr
expr factor false fdinfo ffm find finddir fmt fold fortune frcode ftp ftpd
funzip fwcontrol
gawk $(X86_ONLY)gdb grep groups gzip gzexe hd head hey hostname id ident
ideinfo idestatus ifconfig <bin>install installsound iroster isvolume join
keymap kill less lessecho lesskey link listarea listattr listdev listimage
listport listres listsem ln locate logger login logname ls lsindex m4 make
makebootable md5sum merge mimeset mkdos mkdir mkfifo mkfs mkindex modifiers mount
mount_nfs mountvolume mv nc netstat nl nohup od open passwd paste patch
pathchk pc ping play playfile playsound playwav pr prio printenv printf ps
ptx pwd query quit readlink release renice rescan rlog rm rmattr rmindex
rmdir roster route safemode screen_blanker sed setdecor settype setversion
setvolume seq sh sha1sum shar shred shuf shutdown sleep sort split stat
strace stty su sum sync sysinfo tac tail tar tcpdump tcptester tee telnet
telnetd test top touch tput tr traceroute
translate true tsort tty uname unchop unexpand unmount uniq unrar unshar
unzip unzipsfx <bin>updatedb uptime urlwrapper usb_dev_info useradd uudecode
uuencode vdir
version vim waitfor wc wget whoami xargs xres yes zdiff zforce zgrep zip
zipcloak <bin>zipgrep zipnote zipsplit zmore znew
;
BEOS_APPS = AboutSystem ActivityMonitor CodyCam DeskCalc DiskProbe DriveSetup
CDPlayer Expander Icon-O-Matic Installer LaunchBox Magnify Mail MediaPlayer
MidiPlayer NetworkStatus PackageInstaller People PowerStatus
ProcessController ShowImage SoundRecorder StyledEdit Terminal TV Workspaces
;
BEOS_PREFERENCES = Appearance Backgrounds DataTranslations E-mail
FileTypes Fonts Keyboard Keymap Media Menu Mouse Network Printers Screen
ScreenSaver Sounds Time VirtualMemory
;
BEOS_DEMOS = BSnow Chart Clock $(X86_ONLY)Cortex FontDemo
$(X86_ONLY)GLDirectMode $(X86_ONLY)GLTeapot Mandelbrot Pairs PictureTest
Playground Pulse Sudoku
;
BEOS_SYSTEM_LIBS = libbe.so $(HAIKU_LIBSTDC++) libmedia.so libtracker.so
libtranslation.so libbnetapi.so libnetwork.so libdebug.so libbsd.so
libmail.so libtextencoding.so libz.so libfreetype.so libpng.so libmidi.so
libmidi2.so libdevice.so libgame.so libscreensaver.so <revisioned>libroot.so
$(X86_ONLY)libGL.so libfluidsynth.so liblpsolve55.so liblinprog.so libalm.so
libilmimf.so
;
BEOS_SYSTEM_SERVERS = registrar debug_server syslog_daemon media_server
net_server media_addon_server input_server app_server fake_app_server
midi_server print_server mail_daemon
;
BEOS_NETWORK_DEVICES = ethernet loopback ;
BEOS_NETWORK_DATALINK_PROTOCOLS = ethernet_frame <module>arp loopback_frame
ipv4_datagram ;
#BEOS_NETWORK_PPP = ipcp modem pap pppoe ;
BEOS_NETWORK_PROTOCOLS = ipv4 tcp udp icmp unix ;
BEOS_ADD_ONS_ACCELERANTS = $(X86_ONLY)radeon.accelerant $(X86_ONLY)nvidia.accelerant
$(X86_ONLY)matrox.accelerant $(X86_ONLY)neomagic.accelerant
$(X86_ONLY)intel_extreme.accelerant $(X86_ONLY)s3savage.accelerant vesa.accelerant
#$(X86_ONLY)via.accelerant
#$(X86_ONLY)vmware.accelerant
;
BEOS_ADD_ONS_TRANSLATORS = BMPTranslator EXRTranslator GIFTranslator JPEGTranslator
JPEG2000Translator PCXTranslator PNGTranslator PPMTranslator RAWTranslator
RTF-Translator SGITranslator STXTTranslator TGATranslator
TIFFTranslator WonderBrushTranslator
;
BEOS_ADD_ONS_MEDIA = cortex_audioadapter.media_addon cortex_flanger.media_addon
dvb.media_addon
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
#legacy.media_addon
;
BEOS_ADD_ONS_MEDIA_PLUGINS = $(GPL_ONLY)ac3_decoder
aiff_reader au_reader $(X86_ONLY)avcodec avi_reader
matroska mov_reader
mp3_decoder mp3_reader
mp4_reader musepack
ogg raw_decoder speex
# theora
vorbis wav_reader
;
BEOS_ADD_ONS_PRINT = Canon\ LIPS3\ Compatible Canon\ LIPS4\ Compatible
PCL5\ Compatible PCL6\ Compatible PDF\ Writer PS\ Compatible Preview
;
BEOS_ADD_ONS_PRINT_TRANSPORT = HP\ JetDirect IPP LPR Parallel\ Port
Print\ To\ File Serial\ Port USB\ Port
;
BEOS_ADD_ONS_SCREENSAVERS = Haiku IFS Spider ;
BEOS_ADD_ONS_DRIVERS_AUDIO = auich auvia emuxki ; #hda
BEOS_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon $(X86_ONLY)nvidia
$(X86_ONLY)neomagic $(X86_ONLY)matrox $(X86_ONLY)intel_extreme
$(X86_ONLY)s3savage vesa #$(X86_ONLY)via #$(X86_ONLY)vmware
;
BEOS_ADD_ONS_DRIVERS_MIDI = emuxki ;
BEOS_ADD_ONS_DRIVERS_NET = $(X86_ONLY)3com etherpci $(X86_ONLY)ipro1000
$(X86_ONLY)rtl8139 rtl8169 sis900 $(X86_ONLY)via_rhine wb840
$(X86_ONLY)ipro100 $(X86_ONLY)nforce #vlance
$(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect usb_ecm
$(GPL_ONLY)bcm440x $(GPL_ONLY)bcm570x
;
#BEOS_ADD_ONS_DRIVERS_ACPI = $(X86_ONLY)acpi_button ;
BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi
config_manager agp_gart usb firewire
;
BEOS_ADD_ONS_FILE_SYSTEMS = bfs fat iso9660 ;
#cdda googlefs nfs $(GPL_ONLY)ntfs ;
# modules
AddFilesToHaikuImage beos system add-ons kernel bus_managers
: $(BEOS_ADD_ONS_BUS_MANAGERS) ;
AddFilesToHaikuImage beos system add-ons kernel busses agp_gart
: $(X86_ONLY)<agp_gart>intel ;
AddFilesToHaikuImage beos system add-ons kernel busses ide
: generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata ;
AddFilesToHaikuImage beos system add-ons kernel busses scsi
: ahci ;
AddFilesToHaikuImage beos system add-ons kernel busses usb
: <usb>uhci <usb>ehci ;
AddFilesToHaikuImage beos system add-ons kernel console : vga_text ;
AddFilesToHaikuImage beos system add-ons kernel debugger
: <kdebug>hangman <kdebug>invalidate_on_exit ;
AddFilesToHaikuImage beos system add-ons kernel file_systems
: $(BEOS_ADD_ONS_FILE_SYSTEMS) ;
AddFilesToHaikuImage beos system add-ons kernel generic
: block_io dpc fast_log ide_adapter locked_pool mpu401 scsi_periph ;
AddFilesToHaikuImage beos system add-ons kernel partitioning_systems
: intel session ;
AddFilesToHaikuImage beos system add-ons kernel interrupt_controllers
: $(PPC_ONLY)openpic ;
if $(TARGET_ARCH) = x86 {
AddFilesToHaikuImage beos system add-ons kernel cpu : generic_x86 ;
}
# drivers
AddDriversToHaikuImage : console dprintf $(X86_ONLY)keyboard null
random <driver>tty zero ;
AddDriversToHaikuImage audio hmulti : $(BEOS_ADD_ONS_DRIVERS_AUDIO) ;
AddDriversToHaikuImage midi : $(BEOS_ADD_ONS_DRIVERS_MIDI) ;
AddDriversToHaikuImage bus : fw_raw usb_raw ;
AddDriversToHaikuImage disk scsi : scsi_cd scsi_dsk ;
AddDriversToHaikuImage disk usb : usb_disk ;
AddDriversToHaikuImage disk virtual : nbd ;
AddDriversToHaikuImage dvb : cx23882 ;
AddDriversToHaikuImage graphics : $(BEOS_ADD_ONS_DRIVERS_GRAPHICS) ;
AddDriversToHaikuImage input : ps2_hid usb_hid wacom ;
AddDriversToHaikuImage misc : <driver>poke <driver>test ;
AddDriversToHaikuImage net : $(BEOS_ADD_ONS_DRIVERS_NET) ;
#AddDriversToHaikuImage power : $(BEOS_ADD_ONS_DRIVERS_ACPI) ;
# kernel
AddFilesToHaikuImage beos system : <revisioned>kernel_$(TARGET_ARCH) ;
# libs
AddFilesToHaikuImage beos system lib : $(BEOS_SYSTEM_LIBS) ;
# libnetwork.so replaces quite a few libraries
BEOS_SYSTEM_LIBS_LIBNETWORK_ALIASES
= libsocket.so libbind.so libnet.so ;
local lib ;
for lib in $(BEOS_SYSTEM_LIBS_LIBNETWORK_ALIASES) {
AddSymlinkToHaikuImage beos system lib : libnetwork.so : $(lib) ;
}
AddSymlinkToHaikuImage beos system lib : libbnetapi.so : libnetapi.so ;
# libGL.so has GLUT built-in
if $(TARGET_ARCH) = x86 {
AddSymlinkToHaikuImage beos system lib : $(X86_ONLY)libGL.so : libglut.so ;
}
# servers
AddFilesToHaikuImage beos system servers : $(BEOS_SYSTEM_SERVERS) ;
# apps
AddFilesToHaikuImage beos system : runtime_loader Deskbar Tracker ;
AddFilesToHaikuImage beos bin : $(BEOS_BIN) consoled ;
AddFilesToHaikuImage beos apps : $(BEOS_APPS) ;
AddFilesToHaikuImage beos preferences : $(BEOS_PREFERENCES) ;
AddFilesToHaikuImage beos demos : $(BEOS_DEMOS) ;
SEARCH on which = [ FDirName $(HAIKU_TOP) data bin ] ;
AddFilesToHaikuImage beos bin : which ;
AddSymlinkToHaikuImage beos bin : sh : bash ;
AddSymlinkToHaikuImage home Desktop : /boot/home : Home ;
# Deskbar Application links
AddDirectoryToHaikuImage home config be Applications ;
DESKBAR_APPLICATIONS = ActivityMonitor CodyCam CDPlayer DeskCalc DiskProbe
DriveSetup Icon-O-Matic Magnify Mail MediaPlayer MidiPlayer People
SoundRecorder StyledEdit Terminal TV
;
local app ;
for app in $(DESKBAR_APPLICATIONS) {
AddSymlinkToHaikuImage home config be Applications
: /boot/beos/apps/$(app) : $(app) ;
}
# Deskbar Desktop Applets links
AddDirectoryToHaikuImage home config be Desktop\ Applets ;
DESKBAR_DESKTOP_APPLETS = LaunchBox NetworkStatus PowerStatus ProcessController
Workspaces
;
for app in $(DESKBAR_DESKTOP_APPLETS) {
AddSymlinkToHaikuImage home config be Desktop\ Applets
: /boot/beos/apps/$(app) : $(app) ;
}
# Deskbar Preferences and Demos links
AddSymlinkToHaikuImage home config be : /boot/beos/preferences : Preferences ;
AddSymlinkToHaikuImage home config be : /boot/beos/demos : Demos ;
AddSymlinkToHaikuImage beos bin : bzip2 : bunzip2 ;
AddSymlinkToHaikuImage beos bin : less : more ;
AddSymlinkToHaikuImage beos bin : gzip : gunzip ;
AddSymlinkToHaikuImage beos bin : gzip : zcat ;
AddSymlinkToHaikuImage beos bin : zdiff : zcmp ;
AddSymlinkToHaikuImage beos bin : unzip : zipinfo ;
AddSymlinkToHaikuImage beos bin : gawk : awk ;
AddSymlinkToHaikuImage beos bin : grep : egrep ;
AddSymlinkToHaikuImage beos bin : grep : fgrep ;
AddSymlinkToHaikuImage beos bin : vim : vi ;
AddSymlinkToHaikuImage beos bin : vim : view ;
# scripts and data files
local bootScripts = Bootscript Bootscript.cd SetupEnvironment Netscript InstallerInitScript
InstallerFinishScript ;
SEARCH on $(bootScripts) = [ FDirName $(HAIKU_TOP) data system boot ] ;
AddFilesToHaikuImage beos system boot : $(bootScripts) ;
local logoArtwork = "HAIKU logo - white on blue - big.png"
"HAIKU logo - white on blue - small.png" ;
SEARCH on $(logoArtwork) = [ FDirName $(HAIKU_TOP) data artwork ] ;
AddFilesToHaikuImage beos etc artwork : $(logoArtwork) ;
AddDirectoryToHaikuImage beos etc sounds ;
# Mail spell check dictionaries
local spellFiles = words geekspeak ;
spellFiles = $(spellFiles:G=spell) ;
SEARCH on $(spellFiles)
= [ FDirName $(HAIKU_TOP) src apps mail ] ;
AddFilesToHaikuImage beos etc word_dictionary : $(spellFiles) ;
local svgFiles = "lion.svg" ;
SEARCH on $(svgFiles)
= [ FDirName $(HAIKU_TOP) src tests kits interface picture ] ;
AddFilesToHaikuImage beos etc artwork : $(svgFiles) ;
# TODO: Use data/etc/termcap or src/libs/termcap.src?
local etcFiles = inputrc profile termcap teapot.data ;
etcFiles = $(etcFiles:G=etc) ;
SEARCH on $(etcFiles) = [ FDirName $(HAIKU_TOP) data etc ] ;
AddFilesToHaikuImage beos etc : $(etcFiles) ;
local fortuneFiles = Art Computers Education Food Fortunes Goedel Haiku
Humorists Kids Law "Linux cookies" Love Magic Medicine Miscellaneous
News "One Liners" "OS Fortunes" Pets Platitudes Riddles "Songs & Poems"
Sports "Tech Support Excuses" ;
fortuneFiles = $(fortuneFiles:G=etc!fortunes) ;
SEARCH on $(fortuneFiles) = [ FDirName $(HAIKU_TOP) data etc fortunes ] ;
AddFilesToHaikuImage beos etc fortunes : $(fortuneFiles) ;
local fontDir = [ FDirName $(HAIKU_TOP) data etc fonts ] ;
local psFonts = [ Glob $(fontDir)/psfonts : *.afm *.pfb ] ;
local ttFonts = [ Glob $(fontDir)/ttfonts : *.ttf ] ;
AddFilesToHaikuImage beos etc fonts psfonts : $(psFonts) ;
AddFilesToHaikuImage beos etc fonts ttfonts : $(ttFonts) ;
local kanbeDir = [ FDirName $(HAIKU_TOP) data etc KanBe ] ;
local kanbeDefault = [ Glob $(kanbeDir)/default : *.canna *.gz ] ;
local kanbeDic = [ Glob $(kanbeDir)/dic : *.cbp ] ;
local kanbeDicCanna = [ Glob $(kanbeDir)/dic/canna
: *.cld *.ctd *.cbd *.dir ] ;
AddFilesToHaikuImage beos etc KanBe default : $(kanbeDefault) ;
AddFilesToHaikuImage beos etc KanBe dic : $(kanbeDic) ;
AddFilesToHaikuImage beos etc KanBe dic canna : $(kanbeDicCanna) ;
AddDirectoryToHaikuImage beos etc KanBe dic group ;
AddDirectoryToHaikuImage beos etc KanBe dic user ;
local keymapFiles = [ GLOB [ FDirName $(HAIKU_TOP) src data etc keymaps ]
: *.keymap ] ;
keymapFiles = $(keymapFiles:BG=keymap) ;
AddFilesToHaikuImage beos etc Keymap : $(keymapFiles) ;
AddSymlinkToHaikuImage beos etc Keymap : Swedish : Finnish ;
AddSymlinkToHaikuImage beos etc Keymap : Slovene : Croatian ;
AddSymlinkToHaikuImage beos etc Keymap : US-International : Brazilian ;
local timezones = [ FTimeZoneBinaries $(HAIKU_TIME_ZONE_SOURCES) : : true ] ;
for timezone in $(timezones) {
local dir = [ on $(timezone) return $(RELATIVE_TIMEZONE_DIR) ] ;
AddFilesToHaikuImage beos etc timezones $(dir) : $(timezone) ;
}
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) ;
# post install scripts and fresh install indicator file
local postInstallFiles = mime_update.sh ;
postInstallFiles = $(postInstallFiles:G=post-install) ;
SEARCH on $(postInstallFiles)
= [ FDirName $(HAIKU_TOP) data common boot post_install ] ;
SEARCH on <post-install>fresh_install
= [ FDirName $(HAIKU_TOP) data common settings ] ;
AddFilesToHaikuImage common boot post_install : $(postInstallFiles) ;
AddFilesToHaikuImage common settings : <post-install>fresh_install ;
# boot loader
AddFilesToHaikuImage beos system : zbeos ;
# boot module links
AddBootModuleSymlinksToHaikuImage
pci $(X86_ONLY)isa config_manager ide scsi
$(PPC_ONLY)openpic
block_io fast_log ide_adapter locked_pool scsi_periph
ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 legacy_sata
scsi_cd scsi_dsk
intel
bfs
;
# add-ons
AddFilesToHaikuImage beos system add-ons accelerants
: $(BEOS_ADD_ONS_ACCELERANTS) ;
AddFilesToHaikuImage beos system add-ons opengl
: $(X86_ONLY)Mesa\ Software\ Renderer ;
AddFilesToHaikuImage beos system add-ons Translators
: $(BEOS_ADD_ONS_TRANSLATORS) ;
AddFilesToHaikuImage beos system add-ons mail_daemon inbound_protocols : POP3 IMAP ;
AddFilesToHaikuImage beos system add-ons mail_daemon outbound_protocols : SMTP ;
AddFilesToHaikuImage beos system add-ons mail_daemon inbound_filters : Match\ Header Spam\ Filter R5\ Daemon\ Filter ;
AddFilesToHaikuImage beos system add-ons mail_daemon outbound_filters : Fortune ;
AddFilesToHaikuImage beos system add-ons mail_daemon system_filters : Inbox New\ Mail\ Notification Outbox Message\ Parser ;
AddFilesToHaikuImage beos system add-ons media : $(BEOS_ADD_ONS_MEDIA) ;
AddFilesToHaikuImage beos system add-ons media plugins
: $(BEOS_ADD_ONS_MEDIA_PLUGINS) ;
AddFilesToHaikuImage beos system add-ons Tracker : FileType-F ZipOMatic-Z ;
AddSymlinkToHaikuImage beos system add-ons Tracker
: /boot/beos/preferences/Backgrounds : Background-B ;
AddFilesToHaikuImage beos system add-ons input_server devices
: <input>keyboard <input>mouse <input>wacom ;
AddFilesToHaikuImage beos system add-ons input_server filters : screen_saver ;
AddFilesToHaikuImage beos system add-ons kernel network : stack ;
AddFilesToHaikuImage beos system add-ons kernel network devices
: $(BEOS_NETWORK_DEVICES) ;
AddFilesToHaikuImage beos system add-ons kernel network datalink_protocols
: $(BEOS_NETWORK_DATALINK_PROTOCOLS) ;
AddFilesToHaikuImage beos system add-ons kernel network ppp
: $(BEOS_NETWORK_PPP) ;
AddFilesToHaikuImage beos system add-ons kernel network protocols
: $(BEOS_NETWORK_PROTOCOLS) ;
AddFilesToHaikuImage beos system add-ons Print : $(BEOS_ADD_ONS_PRINT) ;
AddFilesToHaikuImage beos system add-ons Print transport
: $(BEOS_ADD_ONS_PRINT_TRANSPORT) ;
AddFilesToHaikuImage beos system add-ons Screen\ Savers
: $(BEOS_ADD_ONS_SCREENSAVERS) ;
AddFilesToHaikuImage beos system add-ons disk_systems
: <disk_system>intel <disk_system>bfs ;
AddDirectoryToHaikuImage home config add-ons Tracker ;
AddDirectoryToHaikuImage home config add-ons Screen\ Savers ;
AddDirectoryToHaikuImage home config add-ons Translators ;
AddDirectoryToHaikuImage beos etc synth ;
AddDirectoryToHaikuImage beos system add-ons input_server methods ;
# optional
AddFilesToHaikuImage optional beos system add-ons input_server methods : canna ;
# 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 ;
# licenses
CopyDirectoryToHaikuImage beos etc
: [ FDirName $(HAIKU_TOP) data etc licenses ]
: licenses : -x .svn ;
#pragma mark - Alternative GCC Libraries
# build a zip file with the system libs
# (used by another jam that wants to build a Haiku with alternative GCC
# libraries included)
rule ZipTargets zipFile : targets
{
Depends $(zipFile) : <build>zip $(targets) ;
ZipTargets1 $(zipFile) : <build>zip $(targets) ;
}
actions ZipTargets1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(RM) "$(1)"
$(2[1]) -jy "$(1)" $(2[2-])
}
local alternativeSystemLibsZip = <image>alternative_system_libs.zip ;
MakeLocate $(alternativeSystemLibsZip) : $(HAIKU_OUTPUT_DIR) ;
# collect the targets we would install in the lib directory
local alternativeSystemLibs ;
local libTargets = [ FFilesInHaikuImageDirectory beos system lib ] ;
local libTarget ;
for libTarget in $(libTargets) {
alternativeSystemLibs += [ on $(libTarget) return $(TARGET) ] ;
}
# collect the symlinks we would install in the lib directory
libTargets = [ FSymlinksInHaikuImageDirectory beos system lib ] ;
local tmpAlternativeLibDir
= [ FDirName $(HAIKU_OUTPUT_DIR) tmp alternativeLibs ] ;
for libTarget in $(libTargets) {
# We need to create actual symlinks, we can zip later.
local symlinkTarget = <alternative-system-lib>$(libTarget:BS) ;
MakeLocate $(symlinkTarget) : $(tmpAlternativeLibDir) ;
SymLink $(symlinkTarget) : [ on $(libTarget) return $(SYMLINK_TARGET) ] ;
alternativeSystemLibs += $(symlinkTarget) ;
}
ZipTargets $(alternativeSystemLibsZip) : $(alternativeSystemLibs) ;
if $(HAIKU_ADD_ALTERNATIVE_GCC_LIBS) && $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR) {
# let another jam build a zip with the system libraries
rule InvokeSubJam target : directory : jamLine
{
DIRECTORY on $(target) = $(directory) ;
COMMAND_LINE on $(target) = $(jamLine) ;
Always $(target) ;
InvokeSubJam1 $(target) ;
}
actions InvokeSubJam1
{
cd $(DIRECTORY)
$(JAM:E=jam) -q $(COMMAND_LINE) ;
}
local otherAlternativeSystemLibsZip
= <other-image>alternative_system_libs.zip ;
MakeLocate $(otherAlternativeSystemLibsZip)
: $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR) ;
InvokeSubJam $(otherAlternativeSystemLibsZip)
: $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR)
: "'<image>alternative_system_libs.zip'" ;
local libSubDir ;
if $(HAIKU_GCC_VERSION[1]) = 2 {
libSubDir = gcc4 ;
} else {
libSubDir = gcc2 ;
}
# install the alternative libs in the right directory
UnzipArchiveToHaikuImage beos system lib $(libSubDir)
: $(otherAlternativeSystemLibsZip) ;
}
#pragma mark - Optional Packages
HAIKU_IMAGE_OPTIONAL_PACKAGE_DESCRIPTIONS = ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalPackages ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) OptionalTestPackages ] ;
local optionalPackageDescriptions ;
if $(HAIKU_IMAGE_OPTIONAL_PACKAGE_DESCRIPTIONS) {
optionalPackageDescriptions = <haiku-image>optional_package_descriptions ;
MakeLocate $(optionalPackageDescriptions)
: $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ;
Depends $(optionalPackageDescriptions)
: $(HAIKU_IMAGE_OPTIONAL_PACKAGE_DESCRIPTIONS) ;
actions together BuildOptionalPackageDescriptions
{
cat $(2) > $(1)
}
BuildOptionalPackageDescriptions $(optionalPackageDescriptions)
: $(HAIKU_IMAGE_OPTIONAL_PACKAGE_DESCRIPTIONS) ;
}
#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
# 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) ; # 100 MB
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) : 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>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 ;
}
if $(optionalPackageDescriptions) {
AddTargetVariableToScript $(script) : $(optionalPackageDescriptions)
: optionalPackageDescriptions ;
}
# 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_UNZIP_FILES_SCRIPT = <HaikuImage>haiku.image-unzip-files ;
MakeLocate $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT)
$(HAIKU_IMAGE_UNZIP_FILES_SCRIPT) : $(HAIKU_OUTPUT_DIR) ;
CreateHaikuImageMakeDirectoriesScript $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) ;
CreateHaikuImageCopyFilesScript $(HAIKU_IMAGE_COPY_FILES_SCRIPT) ;
CreateHaikuImageUnzipFilesScript $(HAIKU_IMAGE_UNZIP_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_UNZIP_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_UNZIP_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) ;