[haiku-commits] Re: BRANCH HaikuPM-github.package-management [2ebcd86] src/bin/package_repo src/tools/package_repo build/jam

  • From: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 27 Apr 2014 18:57:13 +1200

On 4 July 2013 09:30, HaikuPM-github.package-management
<community@xxxxxxxxxxxx> wrote:
>
> 2ebcd86: Add configure option --host-only
>
>   When specified, the build will be configured for building build host
>   tools only.
>
>                                     [ Ingo Weinhold <ingo_weinhold@xxxxxx> ]
############################################################################
>
> Commit:      2ebcd86dfe64e3c44c30350b3bc83228eeb2b8d4
> Author:      Ingo Weinhold <ingo_weinhold@xxxxxx>
> Date:        Wed Jul  3 21:19:00 2013 UTC
>
> Add configure option --host-only
>
> When specified, the build will be configured for building build host
> tools only.
>
> ----------------------------------------------------------------------------
>
> diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup
> index fa906c6..a12fdde 100644
> --- a/build/jam/BuildSetup
> +++ b/build/jam/BuildSetup
> @@ -119,7 +119,11 @@ HAIKU_CONFIG_HEADERS = [ FDirName $(HAIKU_TOP) build 
> user_config_headers ]
>  # haiku target platform settings
>
>  # 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
>  if $(HAIKU_USE_GCC_PIPE) = 1 {
> diff --git a/build/scripts/host_build_only b/build/scripts/host_build_only
> new file mode 100755
> index 0000000..dd9f2d6
> --- /dev/null
> +++ b/build/scripts/host_build_only
> @@ -0,0 +1,6 @@
> +#!/bin/sh
> +
> +echo "Error: The build has been configured for building the build host 
> tools" \
> +       "only." >&2
> +exit 1
> +
> diff --git a/configure b/configure
> index f7903d8..76b2efe 100755
> --- a/configure
> +++ b/configure
> @@ -41,6 +41,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
> @@ -349,6 +352,7 @@ HAIKU_USE_GCC_GRAPHITE=0
>  HAIKU_HOST_USE_32BIT=0
>  HAIKU_HOST_USE_XATTR=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
> @@ -444,6 +448,7 @@ 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;;
> @@ -511,47 +516,59 @@ fi
>  # create output directory
>  mkdir -p "$buildOutputDir" || exit 1
>
> -# 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
> +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
> +       # 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
> -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
> -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
> +       fi
>
> -# prepare gcc settings
> -standard_gcc_settings
> +       # prepare gcc settings
> +       standard_gcc_settings
>
> -# cross tools for gcc4 builds
> -if [ -n "$crossToolsPrefix" ]; then
> -       case $HAIKU_GCC_RAW_VERSION in
> -               4.*)
> -                       get_build_tool_path ELFEDIT elfedit
> -               ;;
> +       # cross tools for gcc4 builds
> +       if [ -n "$crossToolsPrefix" ]; then
> +               case $HAIKU_GCC_RAW_VERSION in
> +                       4.*)
> +                               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
>  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
>  cat << EOF > "$buildConfigFile"
>  # BuildConfig
> @@ -573,6 +590,7 @@ 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_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} ;
>
>

Was this option, --host-only, ever supposed to do anything useful? It
seems like the intent is to build the cross-compilers and set up a
sysroot to accompany it... but I can't see how it does anything at all
at present

Other related posts: