diff --git a/build/scripts/convert_build_config_to_shell_format.pl b/build/scripts/convert_build_config_to_shell_format.pl deleted file mode 100644 index 5ae62f19d8..0000000000 --- a/build/scripts/convert_build_config_to_shell_format.pl +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/perl - -use warnings; -use strict; - -=head1 convert_build_config_to_shell_format - -This simple script converts its standard input from the jam-specific format -that is being used in BuildSetup into a format that's understood by sh. - -=cut - -my $data; -while (my $line = <>) { - $data .= $line; - if ($data =~ m{\s*([+\w]+)\s*\?=\s*\"?([^;]*?)\"?\s*;}gms) { - my ($variable, $value) = ($1, $2); - $variable =~ tr{+}{X}; # '+' is illegal as part of shell variable - print "$variable='$value'\n"; - $data = ''; - } -} - diff --git a/configure b/configure index 6b9a2fd775..ce9d38040d 100755 --- a/configure +++ b/configure @@ -12,6 +12,9 @@ usage() Usage: $0 options: + --help Prints out this help. + --update Re-runs last configure invocation [must be given + as first option!] --bootstrap Prepare for a bootstrap build. No pre-built packages will be used, instead they will be built @@ -51,7 +54,6 @@ options: official -- the official Haiku distribution. compatible -- a Haiku Compatible (tm) distro. default -- any other distro (default value). - --help Prints out this help. --host-only Configure for building tools for the build host only. Haiku cannot be built when configured like this. @@ -59,7 +61,7 @@ options: ideas and techniques. If this option is not specified, the resulting distribution may still implement patented ideas and techniques. This - option only disables code that is currently known + option only enables code that is currently known to be problematic. --include-sources Includes the source code of projects that require either an offer of source code or a copy of the @@ -81,8 +83,6 @@ options: first occurrence specifies the primary architecture of the Haiku to build, subsequent ones the secondary architectures. - --update re-runs last configure invocation [must be given - as first option!] --use-clang Build with host Clang instead of GCC cross compiler, targeting --use-gcc-pipe Build with GCC option -pipe. Speeds up the build @@ -415,6 +415,17 @@ cd "$currentDir" # backup the passed arguments configureArgs="$@" +configurePath=$0 + +# backup relevant environs +configureEnvirons= +for var in `env`; do + case "$var" in + CC\=*|HAIKU*\=*) + configureEnvirons="$configureEnvirons $var" + ;; + esac +done # internal default parameter values # @@ -502,17 +513,20 @@ if [ "$1" = "--update" ]; then echo $0 --update: \'$buildConfigFile\' not found - updating not possible. exit 1 fi - if ! type perl >/dev/null 2>&1; then - echo $0 --update: \'perl\' not found - updating not possible. + # get last configure invocation and flags from BuildConfig and call ourselves with it + lastPwd=`grep "#d " "$buildConfigFile" | cut -c 4-` + lastConfig=`grep "#c " "$buildConfigFile" | cut -c 4-` + lastEnv=`grep "#e " "$buildConfigFile" | cut -c 4-` + lastArgs=`grep "#a " "$buildConfigFile" | cut -c 4-` + if [ -z "$lastConfig" ]; then + echo "$0 --update: The previous configure invocation was not properly" \ + "encoded into '$buildConfigFile' - updating not possible." exit 1 fi - # convert BuildConfig from jam format to shell format and evaluate it - shellConfigFile="${buildConfigFile}.shell" - perl "$sourceDir/build/scripts/convert_build_config_to_shell_format.pl" \ - <"$buildConfigFile" >"$shellConfigFile" - . "$shellConfigFile" - rm "$shellConfigFile" - shift + cd $lastPwd + export $lastEnv + $lastConfig $lastArgs + exit $? fi # parse parameters @@ -791,14 +805,18 @@ else *) MAKE=make;; esac - MAKE=$MAKE \ - SECONDARY_ARCH=$secondaryArch \ - HAIKU_USE_GCC_GRAPHITE=`get_variable \ - HAIKU_USE_GCC_GRAPHITE_$targetArch` \ - HAIKU_USE_GCC_PIPE=$HAIKU_USE_GCC_PIPE \ - HAIKU_USE_GDB="$gdbSources" \ - "$script" $scriptArgs "$sourceDir" "$buildCrossTools" \ - "$crossToolsDir" $buildCrossToolsJobs || exit 1 + if [ ! -d "$crossToolsDir" ]; then + MAKE=$MAKE \ + SECONDARY_ARCH=$secondaryArch \ + HAIKU_USE_GCC_GRAPHITE=`get_variable \ + HAIKU_USE_GCC_GRAPHITE_$targetArch` \ + HAIKU_USE_GCC_PIPE=$HAIKU_USE_GCC_PIPE \ + HAIKU_USE_GDB="$gdbSources" \ + "$script" $scriptArgs "$sourceDir" "$buildCrossTools" \ + "$crossToolsDir" $buildCrossToolsJobs || exit 1 + else + echo "$targetArch crosstools already exist in $crossToolsDir; skipping build" + fi crossToolsPrefix="$crossToolsDir/bin/${targetMachine}-" fi @@ -863,10 +881,14 @@ fi # Generate BuildConfig cat << EOF > "$buildConfigFile" -# BuildConfig -# Note: This file has been automatically generated by configure with the -# following arguments: -# ${configureArgs} +# -- WARNING -- +# This file was AUTOMATICALLY GENERATED by configure, and will be completely +# overwritten the next time configure is run. +# +#d ${currentDir} +#c ${configurePath} +#e ${configureEnvirons} +#a ${configureArgs} TARGET_PLATFORM ?= "${TARGET_PLATFORM}" ; HOST_PLATFORM ?= "${HOST_PLATFORM}" ;