mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 07:18:40 +01:00
configure: Do --update check earlier.
Previously we initialized variables and ran a few $CC tests first (which was what the old version of --update needed.) Now, we can do it almost immediately after the script begins. Spotted by running --update on a GCCless system (as the $CC tests gave warning messages due to no GCC, while CC= was set in --update environs.)
This commit is contained in:
parent
1c307243f5
commit
a107d3b4f9
80
configure
vendored
80
configure
vendored
@ -477,18 +477,46 @@ if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
|
||||
usage; exit 0;
|
||||
fi
|
||||
|
||||
# ensure umask is not too restrictive
|
||||
if [ $(umask) -gt 22 ]; then
|
||||
echo "Your umask is too restrictive (should be: <= 0022; is actually:" $(umask)")"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# get cwd and the source directory
|
||||
currentDir=`pwd`
|
||||
cd `dirname "$0"`
|
||||
sourceDir=`pwd`
|
||||
cd "$currentDir"
|
||||
|
||||
# determine output directory
|
||||
if [ "$currentDir" = "$sourceDir" ]; then
|
||||
outputDir=$currentDir/generated
|
||||
else
|
||||
outputDir=$currentDir
|
||||
fi
|
||||
buildOutputDir="$outputDir/build"
|
||||
HAIKU_BUILD_ATTRIBUTES_DIR="$outputDir/attributes"
|
||||
buildConfigFile="$buildOutputDir/BuildConfig"
|
||||
|
||||
# check for update request
|
||||
if [ "$1" = "--update" ]; then
|
||||
if ! [ -e "$buildConfigFile" ]; then
|
||||
echo $0 --update: \'$buildConfigFile\' not found - updating not possible.
|
||||
exit 1
|
||||
fi
|
||||
# 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
|
||||
cd $lastPwd
|
||||
if [ -n "$lastEnv" ]; then
|
||||
export $lastEnv
|
||||
fi
|
||||
$lastConfig $lastArgs
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# backup the passed arguments
|
||||
configureArgs="$@"
|
||||
configurePath=$0
|
||||
@ -503,6 +531,12 @@ for var in `env`; do
|
||||
esac
|
||||
done
|
||||
|
||||
# ensure umask is not too restrictive
|
||||
if [ $(umask) -gt 22 ]; then
|
||||
echo "Your umask is too restrictive (should be: <= 0022; is actually:" $(umask)")"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# internal default parameter values
|
||||
#
|
||||
platform=`uname`
|
||||
@ -572,40 +606,6 @@ supportedTargetArchs="
|
||||
x86_gcc2
|
||||
"
|
||||
|
||||
# determine output directory
|
||||
if [ "$currentDir" = "$sourceDir" ]; then
|
||||
outputDir=$currentDir/generated
|
||||
else
|
||||
outputDir=$currentDir
|
||||
fi
|
||||
buildOutputDir="$outputDir/build"
|
||||
HAIKU_BUILD_ATTRIBUTES_DIR="$outputDir/attributes"
|
||||
buildConfigFile="$buildOutputDir/BuildConfig"
|
||||
|
||||
# check for update request
|
||||
if [ "$1" = "--update" ]; then
|
||||
if ! [ -e "$buildConfigFile" ]; then
|
||||
echo $0 --update: \'$buildConfigFile\' not found - updating not possible.
|
||||
exit 1
|
||||
fi
|
||||
# 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
|
||||
cd $lastPwd
|
||||
if [ -n "$lastEnv" ]; then
|
||||
export $lastEnv
|
||||
fi
|
||||
$lastConfig $lastArgs
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# parse parameters
|
||||
#
|
||||
while [ $# -gt 0 ] ; do
|
||||
|
Loading…
Reference in New Issue
Block a user