Add configure option --host-only
When specified, the build will be configured for building build host tools only.
This commit is contained in:
@@ -119,7 +119,11 @@ HAIKU_CONFIG_HEADERS = [ FDirName $(HAIKU_TOP) build user_config_headers ]
|
|||||||
# haiku target platform settings
|
# haiku target platform settings
|
||||||
|
|
||||||
# analyze GCC version
|
# analyze GCC version
|
||||||
HAIKU_GCC_VERSION = [ FAnalyzeGCCVersion HAIKU_GCC_RAW_VERSION ] ;
|
if $(HAIKU_HOST_BUILD_ONLY) = 1 {
|
||||||
|
HAIKU_GCC_VERSION = 0 0 0 ;
|
||||||
|
} else {
|
||||||
|
HAIKU_GCC_VERSION = [ FAnalyzeGCCVersion HAIKU_GCC_RAW_VERSION ] ;
|
||||||
|
}
|
||||||
|
|
||||||
# enable GCC -pipe option, if requested
|
# enable GCC -pipe option, if requested
|
||||||
if $(HAIKU_USE_GCC_PIPE) = 1 {
|
if $(HAIKU_USE_GCC_PIPE) = 1 {
|
||||||
|
|||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "Error: The build has been configured for building the build host tools" \
|
||||||
|
"only." >&2
|
||||||
|
exit 1
|
||||||
|
|
||||||
@@ -41,6 +41,9 @@ options:
|
|||||||
default -- any other distro (default value).
|
default -- any other distro (default value).
|
||||||
--enable-multiuser Enable experimental multiuser support.
|
--enable-multiuser Enable experimental multiuser support.
|
||||||
--help Prints out this help.
|
--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-gpl-addons Include GPL licensed add-ons.
|
||||||
--include-patented-code Enable code that is known to implemented patented
|
--include-patented-code Enable code that is known to implemented patented
|
||||||
ideas and techniques. If this option is not
|
ideas and techniques. If this option is not
|
||||||
@@ -349,6 +352,7 @@ HAIKU_USE_GCC_GRAPHITE=0
|
|||||||
HAIKU_HOST_USE_32BIT=0
|
HAIKU_HOST_USE_32BIT=0
|
||||||
HAIKU_HOST_USE_XATTR=0
|
HAIKU_HOST_USE_XATTR=0
|
||||||
HAIKU_HOST_USE_XATTR_REF=0
|
HAIKU_HOST_USE_XATTR_REF=0
|
||||||
|
HAIKU_HOST_BUILD_ONLY=0
|
||||||
HOST_GCC_LD=`gcc -print-prog-name=ld`
|
HOST_GCC_LD=`gcc -print-prog-name=ld`
|
||||||
HOST_GCC_OBJCOPY=`gcc -print-prog-name=objcopy`
|
HOST_GCC_OBJCOPY=`gcc -print-prog-name=objcopy`
|
||||||
SFDISK_BINARY=sfdisk
|
SFDISK_BINARY=sfdisk
|
||||||
@@ -444,6 +448,7 @@ while [ $# -gt 0 ] ; do
|
|||||||
;;
|
;;
|
||||||
--enable-multiuser) HAIKU_ENABLE_MULTIUSER=1; shift 1;;
|
--enable-multiuser) HAIKU_ENABLE_MULTIUSER=1; shift 1;;
|
||||||
--help | -h) usage; exit 0;;
|
--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-gpl-addons) HAIKU_INCLUDE_GPL_ADDONS=1; shift 1;;
|
||||||
--include-patented-code) HAIKU_INCLUDE_PATENTED_CODE=1; shift 1;;
|
--include-patented-code) HAIKU_INCLUDE_PATENTED_CODE=1; shift 1;;
|
||||||
--include-sources) HAIKU_INCLUDE_SOURCES=1; shift 1;;
|
--include-sources) HAIKU_INCLUDE_SOURCES=1; shift 1;;
|
||||||
@@ -511,47 +516,59 @@ fi
|
|||||||
# create output directory
|
# create output directory
|
||||||
mkdir -p "$buildOutputDir" || exit 1
|
mkdir -p "$buildOutputDir" || exit 1
|
||||||
|
|
||||||
# build cross tools from sources
|
if [ "$HAIKU_HOST_BUILD_ONLY" = 1 ]; then
|
||||||
if [ -n "$buildCrossTools" ]; then
|
invalidCommand=$sourceDir/build/scripts/host_build_only
|
||||||
export HAIKU_USE_GCC_GRAPHITE
|
HAIKU_AR=$invalidCommand
|
||||||
"$buildCrossToolsScript" $buildCrossToolsMachine "$sourceDir" \
|
HAIKU_CC=$invalidCommand
|
||||||
"$buildCrossTools" "$outputDir" $buildCrossToolsJobs || exit 1
|
HAIKU_LD=$invalidCommand
|
||||||
crossToolsPrefix="$outputDir/cross-tools/bin/${HAIKU_GCC_MACHINE}-"
|
HAIKU_OBJCOPY=$invalidCommand
|
||||||
fi
|
HAIKU_RANLIB=$invalidCommand
|
||||||
|
HAIKU_ELFEDIT=$invalidCommand
|
||||||
|
HAIKU_YASM=$invalidCommand
|
||||||
|
HAIKU_STRIP=$invalidCommand
|
||||||
|
else
|
||||||
|
# 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}-"
|
||||||
|
fi
|
||||||
|
|
||||||
# cross tools
|
# cross tools
|
||||||
if [ -n "$crossToolsPrefix" ]; then
|
if [ -n "$crossToolsPrefix" ]; then
|
||||||
get_build_tool_path AR ar
|
get_build_tool_path AR ar
|
||||||
get_build_tool_path CC gcc
|
get_build_tool_path CC gcc
|
||||||
get_build_tool_path LD ld
|
get_build_tool_path LD ld
|
||||||
get_build_tool_path OBJCOPY objcopy
|
get_build_tool_path OBJCOPY objcopy
|
||||||
get_build_tool_path RANLIB ranlib
|
get_build_tool_path RANLIB ranlib
|
||||||
get_build_tool_path STRIP strip
|
get_build_tool_path STRIP strip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# prepare gcc settings
|
# prepare gcc settings
|
||||||
standard_gcc_settings
|
standard_gcc_settings
|
||||||
|
|
||||||
# cross tools for gcc4 builds
|
# cross tools for gcc4 builds
|
||||||
if [ -n "$crossToolsPrefix" ]; then
|
if [ -n "$crossToolsPrefix" ]; then
|
||||||
case $HAIKU_GCC_RAW_VERSION in
|
case $HAIKU_GCC_RAW_VERSION in
|
||||||
4.*)
|
4.*)
|
||||||
get_build_tool_path ELFEDIT elfedit
|
get_build_tool_path ELFEDIT elfedit
|
||||||
;;
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check whether the Haiku compiler really targets Haiku or BeOS
|
||||||
|
case "$HAIKU_GCC_MACHINE" 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 compiler: $HAIKU_CC
|
||||||
|
echo compiler is configured for target: $HAIKU_GCC_MACHINE
|
||||||
|
exit 1 ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check whether the Haiku compiler really targets Haiku or BeOS
|
|
||||||
case "$HAIKU_GCC_MACHINE" 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 compiler: $HAIKU_CC
|
|
||||||
echo compiler is configured for target: $HAIKU_GCC_MACHINE
|
|
||||||
exit 1 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Generate BuildConfig
|
# Generate BuildConfig
|
||||||
cat << EOF > "$buildConfigFile"
|
cat << EOF > "$buildConfigFile"
|
||||||
# BuildConfig
|
# BuildConfig
|
||||||
@@ -573,6 +590,7 @@ HAIKU_USE_GCC_GRAPHITE ?= "${HAIKU_USE_GCC_GRAPHITE}" ;
|
|||||||
HAIKU_HOST_USE_32BIT ?= "${HAIKU_HOST_USE_32BIT}" ;
|
HAIKU_HOST_USE_32BIT ?= "${HAIKU_HOST_USE_32BIT}" ;
|
||||||
HAIKU_HOST_USE_XATTR ?= "${HAIKU_HOST_USE_XATTR}" ;
|
HAIKU_HOST_USE_XATTR ?= "${HAIKU_HOST_USE_XATTR}" ;
|
||||||
HAIKU_HOST_USE_XATTR_REF ?= "${HAIKU_HOST_USE_XATTR_REF}" ;
|
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_RAW_VERSION ?= ${HAIKU_GCC_RAW_VERSION} ;
|
||||||
HAIKU_GCC_MACHINE ?= ${HAIKU_GCC_MACHINE} ;
|
HAIKU_GCC_MACHINE ?= ${HAIKU_GCC_MACHINE} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user