From e173a1ec1c0c1f48e355f3cbc34c0114e336ff88 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 21 Jul 2013 04:10:48 +0200 Subject: [PATCH] Integrate building the HaikuPorts bootstrap packages * Add configure option --bootstrap which allows specifying the haikuporter and HaikuPorts repository paths. * Add rules for supporting a second repository type. The PackageRepository rule is now private and RemotePackageRepository is used for remote repositories. The new BootstrapPackageRepository rule is for defining a bootstrap repository (there will probably be only the HaikuPorts cross repository) whose packages can be built as needed via haikuporter. * Rename DownloadPackage to FetchPackage. * Define repository HaikuPortsCross. * HaikuCrossDevel package(s): There are now two sets of packages: A "stage1" set with the same content as before and a final set additionally containing the libraries libbe, libnetwork, libpackage. Those are needed for building the libsolv bootstrap package while for building them we need other bootstrap packages (ICU, libz). This is basically all that's required to build a bootstrap Haiku completely from sources, with a few caveats: * There's no ICU bootstrap recipe yet (so one has to cheat and use the prebuilt package ATM). * Probably doesn't work on Haiku yet (tested on Linux only). * A 32 bit environment must be used (otherwise building the gcc 2 bootstrap package fails). * Building with multiple jobs doesn't work yet, since haikuporter uses common directories for building different packages and there's no explicit serialization yet. * Haven't tested the resulting image save for booting it. So it probably needs a bit more work before it can actually build the final HaikuPorts packages. --- Jamrules | 7 +- build/jam/ImageRules | 2 +- build/jam/MiscRules | 2 +- build/jam/RepositoryRules | 258 ++++++++++++++++-- build/jam/images/HaikuImageCommon | 3 +- build/jam/packages/HaikuCrossDevel | 131 ++++----- build/jam/repositories/HaikuPorts/x86_gcc2 | 2 +- .../jam/repositories/HaikuPortsCross/x86_gcc2 | 59 ++++ configure | 39 ++- 9 files changed, 410 insertions(+), 93 deletions(-) create mode 100644 build/jam/repositories/HaikuPortsCross/x86_gcc2 diff --git a/Jamrules b/Jamrules index 5274327827..80189fad71 100644 --- a/Jamrules +++ b/Jamrules @@ -59,8 +59,13 @@ 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 HaikuPorts { +for repository in $(repositories) { local repositoryDirectory = [ FDirName $(repositoriesDirectory) $(repository) ] ; local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ; diff --git a/build/jam/ImageRules b/build/jam/ImageRules index 2d59eb3a87..f9846c0494 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -1021,7 +1021,7 @@ rule AddHaikuImagePackages packages : installationLocation HAIKU_ADDED_PACKAGES += $(package) ; # download the package file and add it to the image - local file = [ DownloadPackage $(package) ] ; + local file = [ FetchPackage $(package) ] ; if $(HAIKU_UPDATE_ALL_PACKAGES) { HAIKU_INCLUDE_IN_IMAGE on $(file) = 1 ; diff --git a/build/jam/MiscRules b/build/jam/MiscRules index fc1d318b04..64ffffd8da 100644 --- a/build/jam/MiscRules +++ b/build/jam/MiscRules @@ -790,7 +790,7 @@ rule ExtractBuildFeatureArchives feature : list } local package = $(list[2]) ; - local file = [ DownloadPackage $(list[3]) ] ; + local file = [ FetchPackage $(list[3]) ] ; local fileName = $(file:BS) ; list = $(list[4-]) ; diff --git a/build/jam/RepositoryRules b/build/jam/RepositoryRules index 6c33e6f8e0..f263853ef6 100644 --- a/build/jam/RepositoryRules +++ b/build/jam/RepositoryRules @@ -1,9 +1,32 @@ +#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) ; @@ -12,56 +35,104 @@ rule AddRepositoryPackage repository : architecture : baseName : version 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) ; } - local packageFamily = [ PackageFamily $(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]) ; - AddRepositoryPackage $(repository) : $(architecture) : $(baseName) - : $(version) ; + packageTargets += [ AddRepositoryPackage $(repository) : $(architecture) + : $(baseName) : $(version) ] ; if $(baseName) in $(sourcePackages) { AddRepositoryPackage $(repository) : source : $(baseName)_source : $(version) ; } if $(baseName) in $(debugInfoPackages) { - AddRepositoryPackage $(repository) : $(architecture) - : $(baseName)_debuginfo : $(version) ; + packageTargets += [ AddRepositoryPackage $(repository) + : $(architecture) : $(baseName)_debuginfo : $(version) ] ; } } + + return $(packageTargets) ; } -rule PackageRepository repository : architecture : repositoryUrl : anyPackages - : packages : sourcePackages : debugInfoPackages +rule PackageRepository repository : architecture : anyPackages : packages + : sourcePackages : debugInfoPackages { - repository = $(repository:G=repository) ; - if $(architecture) != $(HAIKU_PACKAGING_ARCH) { return ; } HAIKU_REPOSITORIES += $(repository) ; - HAIKU_REPOSITORY_URL on $(repository) = $(repositoryUrl) ; HAIKU_REPOSITORY_DEFINITION_FILE on $(repository) = $(HAIKU_REPOSITORY_JAMFILE) ; - AddRepositoryPackages $(repository) : any : $(anyPackages) - : $(sourcePackages) : $(debugInfoPackages) ; - AddRepositoryPackages $(repository) : $(architecture) : $(packages) - : $(sourcePackages) : $(debugInfoPackages) ; + 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 ; @@ -152,6 +223,150 @@ actions RepositoryConfig1 } +#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 haikuCrossDevelPackage = [ on $(package) + return $(HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGE) ] ; + + local packageFile = $(fileName) ; + 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. + + HAIKU_REPOSITORY_BUILD_DIRECTORY on $(packageFile) = $(outputDir) ; + + Depends $(packageFile) : $(haikuCrossDevelPackage) $(configFile) ; + BootstrapRepositoryFetchPackage1 $(packageFile) + : $(haikuCrossDevelPackage) ; + + 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)" + if [[ "$haikuCrossDevelPackage" != /* ]]; then + haikuCrossDevelPackage="`pwd`/$haikuCrossDevelPackage" + fi + + # determine the portName + portName=`basename "$package" | sed 's@-.*@@'` + case $portName in + *_devel|*_doc|*_source|*_debuginfo) + portName=`echo $portName | sed 's@_[^_]*$@@'` + ;; + esac + + cd $(HAIKU_REPOSITORY_BUILD_DIRECTORY) + + $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) + $(HOST_HAIKU_PORTER) --cross-devel-package "$haikuCrossDevelPackage" \ + $portName +} + + +actions BuildBootstrapRepositoryConfig +{ +cat > $(1) << EOF +PACKAGER="The Haiku build system " +TREE_PATH="$(HAIKU_PORTS_CROSS)" +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) + if [[ "$gcc" = /* ]]; then + if [ `basename $gcc` = $(HAIKU_GCC_MACHINE)-gcc ]; then + dir=`dirname $gcc` + dir=`dirname $dir` + echo CROSS_TOOLS="$dir" >> $(1) + fi + fi +} + + +rule BootstrapPackageRepository repository : architecture + : anyPackages : packagesStage1 : packagesStage2 : sourcePackages + : debugInfoPackages +{ + repository = $(repository:G=repository) ; + + SetRepositoryMethod $(repository) : PackageFamily + : BootstrapRepositoryPackageFamily ; + SetRepositoryMethod $(repository) : FetchPackage + : BootstrapRepositoryFetchPackage ; + + # register repository with stage 1 packages + local packageTargets = [ PackageRepository $(repository) : $(architecture) + : $(anyPackages) : $(packagesStage1) : $(sourcePackages) + : $(debugInfoPackages) ] ; + if ! $(packageTargets) { + return ; + } + HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGE on $(packageTargets) + = haiku_cross_devel_sysroot_stage1_$(HAIKU_PACKAGING_ARCH).hpkg ; + + # add stage 2 packages + packageTargets = [ AddRepositoryPackages $(repository) : $(architecture) + : $(packagesStage2) : $(sourcePackages) : $(debugInfoPackages) ] ; + HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGE on $(packageTargets) + = haiku_cross_devel_sysroot_$(HAIKU_PACKAGING_ARCH).hpkg ; + + # prepare the config file for the HaikuPorts cross build + local outputDir = [ FDirName $(HAIKU_PACKAGE_REPOSITORIES_DIR) + $(repository:G=)-build ] ; + local configFile = haikuports.conf ; + configFile = $(configFile:G=repository-config-$(repository:G=)) ; + MakeLocate $(configFile) : $(outputDir) ; + NoUpdate $(configFile) ; + Depends $(configFile) : package mimeset mime_db ; + HAIKU_REPOSITORY_BUILD_DIRECTORY on $(configFile) = $(outputDir) ; + BuildBootstrapRepositoryConfig $(configFile) + : package mimeset mime_db ; + + HAIKU_REPOSITORY_BUILD_CONFIG_FILE on $(repository) = $(configFile) ; + HAIKU_REPOSITORY_BUILD_DIRECTORY on $(repository) = $(outputDir) ; +} + + +#pragma mark - Public + + rule IsPackageAvailable package { if $(package) in $(HAIKU_AVAILABLE_PACKAGES) { @@ -162,7 +377,7 @@ rule IsPackageAvailable package } -rule DownloadPackage packageName +rule FetchPackage packageName { if ! [ IsPackageAvailable $(packageName) ] { Exit "DownloadPackage: package" $(packageName) "not available!" ; @@ -177,16 +392,7 @@ rule DownloadPackage packageName = [ on $(packageFamily) return $(HAIKU_PACKAGE_VERSIONS[1]) ] ; local fileName = [ on $(package) return $(HAIKU_PACKAGE_FILE_NAME) ] ; local repository = [ on $(package) return $(HAIKU_PACKAGE_REPOSITORY) ] ; - 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) ; + return [ InvokeRepositoryMethod $(repository) : FetchPackage : $(package) + : $(fileName) ] ; } diff --git a/build/jam/images/HaikuImageCommon b/build/jam/images/HaikuImageCommon index 610f30a7ab..66627895ee 100644 --- a/build/jam/images/HaikuImageCommon +++ b/build/jam/images/HaikuImageCommon @@ -94,7 +94,8 @@ if $(HOST_RM_ATTRS_TARGET) { # always want to do that in non-update mode, but also in update mode when all # packages are updated. local resolvePackageDependencies ; -if ! [ IsUpdateHaikuImageOnly ] || $(HAIKU_UPDATE_ALL_PACKAGES) { +if ( ! [ IsUpdateHaikuImageOnly ] || $(HAIKU_UPDATE_ALL_PACKAGES) ) + && ! $(HAIKU_BOOTSTRAP_BUILD) { resolvePackageDependencies = 1 ; } AddVariableToScript $(script) : resolvePackageDependencies diff --git a/build/jam/packages/HaikuCrossDevel b/build/jam/packages/HaikuCrossDevel index 3e56c4e041..d99380702a 100644 --- a/build/jam/packages/HaikuCrossDevel +++ b/build/jam/packages/HaikuCrossDevel @@ -4,73 +4,82 @@ # The main use of this package is to provide HaikuPorter with a development # environment for a cross-build Haiku platform. -# first create the actual cross development package +local additionalLibraries_stage1 ; +local additionalLibraries = libbe.so libnetwork.so libpackage.so ; -local haikuCrossDevelSysrootPackage - = haiku_cross_devel_sysroot_$(HAIKU_PACKAGING_ARCH).hpkg ; -HaikuPackage $(haikuCrossDevelSysrootPackage) ; +local stage ; +for stage in _stage1 "" { + # first create the actual cross development package -local developCrossLibDirTokens = develop lib ; + local haikuCrossDevelSysrootPackage + = haiku_cross_devel_sysroot$(stage)_$(HAIKU_PACKAGING_ARCH).hpkg ; + HaikuPackage $(haikuCrossDevelSysrootPackage) ; -# glue code -AddFilesToPackage $(developCrossLibDirTokens) : - crti.o - crtn.o - init_term_dyn.o - start_dyn.o - haiku_version_glue.o -; + local developCrossLibDirTokens = develop lib ; -# kernel -AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ; + # glue code + AddFilesToPackage $(developCrossLibDirTokens) : + crti.o + crtn.o + init_term_dyn.o + start_dyn.o + haiku_version_glue.o + ; -# libraries -AddLibrariesToPackage $(developCrossLibDirTokens) : - libbsd.so - libroot.so - $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++) -; + # kernel + AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ; -# static libraries -AddFilesToPackage $(developCrossLibDirTokens) : liblocalestub.a ; + # libraries + AddLibrariesToPackage $(developCrossLibDirTokens) : + libbsd.so + libroot.so + $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++) + $(additionalLibraries$(stage)) + ; -# the POSIX error code mapper library -AddFilesToPackage $(developCrossLibDirTokens) : libposix_error_mapper.a ; + # static libraries + AddFilesToPackage $(developCrossLibDirTokens) : liblocalestub.a ; -# headers -local developCrossHeadersDirTokens = develop headers ; -local headerDir ; -for headerDir in config glibc os posix { - CopyDirectoryToPackage $(developCrossHeadersDirTokens) - : [ FDirName $(HAIKU_TOP) headers $(headerDir) ] ; + # the POSIX error code mapper library + AddFilesToPackage $(developCrossLibDirTokens) : 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[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)_$(HAIKU_PACKAGING_ARCH).hpkg ; + HaikuPackage $(haikuCrossDevelPackage) ; + + # add the wrapped package + local developCrossDirTokens = develop cross ; + AddFilesToPackage $(developCrossDirTokens) + : $(haikuCrossDevelSysrootPackage) ; + + BuildHaikuPackage $(haikuCrossDevelPackage) : haiku_cross_devel ; } - -# BSD and GNU compatibility headers -for headerDir in bsd gnu { - CopyDirectoryToPackage $(developCrossHeadersDirTokens) - : [ FDirName $(HAIKU_TOP) headers compatibility $(headerDir) ] ; -} - -# cpp headers -if $(HAIKU_GCC_VERSION[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_$(HAIKU_PACKAGING_ARCH).hpkg ; -HaikuPackage $(haikuCrossDevelPackage) ; - -# add the wrapped package -local developCrossDirTokens = develop cross ; -AddFilesToPackage $(developCrossDirTokens) : $(haikuCrossDevelSysrootPackage) ; - -BuildHaikuPackage $(haikuCrossDevelPackage) : haiku_cross_devel ; diff --git a/build/jam/repositories/HaikuPorts/x86_gcc2 b/build/jam/repositories/HaikuPorts/x86_gcc2 index 1560fb748a..7945801490 100644 --- a/build/jam/repositories/HaikuPorts/x86_gcc2 +++ b/build/jam/repositories/HaikuPorts/x86_gcc2 @@ -1,4 +1,4 @@ -PackageRepository HaikuPorts +RemotePackageRepository HaikuPorts : x86_gcc2 : http://haiku-files.org/files/repo : diff --git a/build/jam/repositories/HaikuPortsCross/x86_gcc2 b/build/jam/repositories/HaikuPortsCross/x86_gcc2 new file mode 100644 index 0000000000..f9cc32e124 --- /dev/null +++ b/build/jam/repositories/HaikuPortsCross/x86_gcc2 @@ -0,0 +1,59 @@ +BootstrapPackageRepository HaikuPortsCross + : x86_gcc2 + : + # architecture "any" packages + : + # repository architecture packages (stage 1) + autoconf_bootstrap-2.69-1 + automake_bootstrap-1.13.1-1 + binutils_bootstrap-2.17_2013_04_21-2 + 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_07_15-2 + grep_bootstrap-2.14-1 +# TODO: No actual ICU bootstrap recipe yet. +icu_bootstrap-4.8.1.1-3 +icu_bootstrap_devel-4.8.1.1-3 + libtool_bootstrap-2.4-8 + libtool_bootstrap_libltdl-2.4-8 + m4_bootstrap-1.4.16-1 + make_bootstrap-3.82-1 + makeinfo_bootstrap-4.13a-1 + ncurses_bootstrap-5.9-1 + ncurses_bootstrap_devel-5.9-1 + python_bootstrap-2.6.8-1 + sed_bootstrap-4.2.1-1 +# Available, but probably not needed: +# 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 + makeinfo_bootstrap + ncurses_bootstrap + python_bootstrap + sed_bootstrap + texinfo_bootstrap + zlib_bootstrap + : + # debuginfo packages + ; diff --git a/configure b/configure index ca1a5ace1a..3ecb896d1c 100755 --- a/configure +++ b/configure @@ -12,6 +12,16 @@ usage() Usage: $0 options: + --bootstrap + Prepare for a bootstrap build. No pre-built + packages will be used, instead they will be built + from the sources (in several phases). + is the path to the haikuporter tool + suitable for the host platform. + is the path to a checked + out HaikuPorts cross-compilation repository. + is the path to a checked out + HaikuPorts repository. --build-cross-tools Assume cross compilation. defines the location of the build tools sources. @@ -135,6 +145,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. @@ -376,6 +399,9 @@ 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= if sha256sum < /dev/null > /dev/null 2>&1; then HOST_SHA256=sha256sum @@ -438,6 +464,13 @@ fi # while [ $# -gt 0 ] ; do case "$1" in + --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) assertparams "$1" 2 $# @@ -449,7 +482,7 @@ while [ $# -gt 0 ] ; do ppc) HAIKU_GCC_MACHINE=powerpc-apple-haiku;; m68k) HAIKU_GCC_MACHINE=m68k-unknown-haiku;; arm) HAIKU_GCC_MACHINE=arm-unknown-haiku;; - mipsel) HAIKU_GCC_MACHINE=mipsel-unknown-haiku; + mipsel) HAIKU_GCC_MACHINE=mipsel-unknown-haiku;; *) echo "Unsupported target architecture: $2" exit 1;; esac @@ -664,6 +697,10 @@ 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