Standardize on non-zero checks for configure
This commit is contained in:
parent
cf7e825ecd
commit
f3bfbda665
50
configure
vendored
50
configure
vendored
@ -283,7 +283,7 @@ opt_core() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
if [ ! -z "$META" ]
|
if [ -n "$META" ]
|
||||||
then
|
then
|
||||||
OP="$OP=<$META>"
|
OP="$OP=<$META>"
|
||||||
fi
|
fi
|
||||||
@ -317,7 +317,7 @@ envopt() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# If script or environment provided a value, save it.
|
# If script or environment provided a value, save it.
|
||||||
if [ ! -z "$VV" ]
|
if [ -n "$VV" ]
|
||||||
then
|
then
|
||||||
putvar $V
|
putvar $V
|
||||||
fi
|
fi
|
||||||
@ -767,7 +767,7 @@ probe CFG_LLDB lldb
|
|||||||
# On MacOS X, invoking `javac` pops up a dialog if the JDK is not
|
# On MacOS X, invoking `javac` pops up a dialog if the JDK is not
|
||||||
# installed. Since `javac` is only used if `antlr4` is available,
|
# installed. Since `javac` is only used if `antlr4` is available,
|
||||||
# probe for it only in this case.
|
# probe for it only in this case.
|
||||||
if [ ! -z "$CFG_ANTLR4" ]
|
if [ -n "$CFG_ANTLR4" ]
|
||||||
then
|
then
|
||||||
probe CFG_JAVAC javac
|
probe CFG_JAVAC javac
|
||||||
fi
|
fi
|
||||||
@ -786,14 +786,14 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_GDB" ]
|
if [ -n "$CFG_GDB" ]
|
||||||
then
|
then
|
||||||
# Store GDB's version
|
# Store GDB's version
|
||||||
CFG_GDB_VERSION=$($CFG_GDB --version 2>/dev/null | head -1)
|
CFG_GDB_VERSION=$($CFG_GDB --version 2>/dev/null | head -1)
|
||||||
putvar CFG_GDB_VERSION
|
putvar CFG_GDB_VERSION
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_LLDB" ]
|
if [ -n "$CFG_LLDB" ]
|
||||||
then
|
then
|
||||||
# Store LLDB's version
|
# Store LLDB's version
|
||||||
CFG_LLDB_VERSION=$($CFG_LLDB --version 2>/dev/null | head -1)
|
CFG_LLDB_VERSION=$($CFG_LLDB --version 2>/dev/null | head -1)
|
||||||
@ -819,7 +819,7 @@ step_msg "looking for target specific programs"
|
|||||||
|
|
||||||
probe CFG_ADB adb
|
probe CFG_ADB adb
|
||||||
|
|
||||||
if [ ! -z "$CFG_PANDOC" ]
|
if [ -n "$CFG_PANDOC" ]
|
||||||
then
|
then
|
||||||
# Extract "MAJOR MINOR" from Pandoc's version number
|
# Extract "MAJOR MINOR" from Pandoc's version number
|
||||||
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc' |
|
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc' |
|
||||||
@ -845,7 +845,7 @@ then
|
|||||||
BIN_SUF=.exe
|
BIN_SUF=.exe
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_ENABLE_LOCAL_RUST" ]
|
if [ -n "$CFG_ENABLE_LOCAL_RUST" ]
|
||||||
then
|
then
|
||||||
system_rustc=$(which rustc)
|
system_rustc=$(which rustc)
|
||||||
if [ -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
|
if [ -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
|
||||||
@ -930,18 +930,18 @@ fi
|
|||||||
|
|
||||||
# Okay, at this point, we have made up our minds about whether we are
|
# Okay, at this point, we have made up our minds about whether we are
|
||||||
# going to force CFG_ENABLE_CLANG or not; save the setting if so.
|
# going to force CFG_ENABLE_CLANG or not; save the setting if so.
|
||||||
if [ ! -z "$CFG_ENABLE_CLANG" ]
|
if [ -n "$CFG_ENABLE_CLANG" ]
|
||||||
then
|
then
|
||||||
putvar CFG_ENABLE_CLANG
|
putvar CFG_ENABLE_CLANG
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Same with jemalloc. save the setting here.
|
# Same with jemalloc. save the setting here.
|
||||||
if [ ! -z "$CFG_DISABLE_JEMALLOC" ]
|
if [ -n "$CFG_DISABLE_JEMALLOC" ]
|
||||||
then
|
then
|
||||||
putvar CFG_DISABLE_JEMALLOC
|
putvar CFG_DISABLE_JEMALLOC
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_LLVM_ROOT" -a -z "$CFG_DISABLE_LLVM_VERSION_CHECK" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
|
if [ -n "$CFG_LLVM_ROOT" -a -z "$CFG_DISABLE_LLVM_VERSION_CHECK" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
|
||||||
then
|
then
|
||||||
step_msg "using custom LLVM at $CFG_LLVM_ROOT"
|
step_msg "using custom LLVM at $CFG_LLVM_ROOT"
|
||||||
|
|
||||||
@ -970,7 +970,7 @@ fi
|
|||||||
# CFG_ENABLE_CLANG is set, that indicates that we are opting into
|
# CFG_ENABLE_CLANG is set, that indicates that we are opting into
|
||||||
# running such safeguards.
|
# running such safeguards.
|
||||||
|
|
||||||
if [ ! -z "$CC" ]
|
if [ -n "$CC" ]
|
||||||
then
|
then
|
||||||
msg "skipping compiler inference steps; using provided CC=$CC"
|
msg "skipping compiler inference steps; using provided CC=$CC"
|
||||||
CFG_CC="$CC"
|
CFG_CC="$CC"
|
||||||
@ -983,7 +983,7 @@ then
|
|||||||
putvar CFG_USING_CLANG
|
putvar CFG_USING_CLANG
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ ! -z "$CFG_ENABLE_CLANG" ]
|
if [ -n "$CFG_ENABLE_CLANG" ]
|
||||||
then
|
then
|
||||||
if [ -z "$CFG_CLANG" ]
|
if [ -z "$CFG_CLANG" ]
|
||||||
then
|
then
|
||||||
@ -997,7 +997,7 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_ENABLE_CLANG" ]
|
if [ -n "$CFG_ENABLE_CLANG" ]
|
||||||
then
|
then
|
||||||
case "$CC" in
|
case "$CC" in
|
||||||
(''|*clang)
|
(''|*clang)
|
||||||
@ -1013,7 +1013,7 @@ then
|
|||||||
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')
|
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_OSX_CLANG_VERSION" ]
|
if [ -n "$CFG_OSX_CLANG_VERSION" ]
|
||||||
then
|
then
|
||||||
case $CFG_OSX_CLANG_VERSION in
|
case $CFG_OSX_CLANG_VERSION in
|
||||||
(7.0*)
|
(7.0*)
|
||||||
@ -1042,7 +1042,7 @@ then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_ENABLE_CCACHE" ]
|
if [ -n "$CFG_ENABLE_CCACHE" ]
|
||||||
then
|
then
|
||||||
if [ -z "$CFG_CCACHE" ]
|
if [ -z "$CFG_CCACHE" ]
|
||||||
then
|
then
|
||||||
@ -1199,7 +1199,7 @@ do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
bindir="${CFG_MSVC_ROOT}/VC/bin"
|
bindir="${CFG_MSVC_ROOT}/VC/bin"
|
||||||
if [ ! -z "$msvc_part" ]; then
|
if [ -n "$msvc_part" ]; then
|
||||||
bindir="$bindir/$msvc_part"
|
bindir="$bindir/$msvc_part"
|
||||||
fi
|
fi
|
||||||
eval CFG_MSVC_BINDIR_$bits="\"$bindir\""
|
eval CFG_MSVC_BINDIR_$bits="\"$bindir\""
|
||||||
@ -1229,7 +1229,7 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ ! -z "$CFG_PERF" ]
|
if [ -n "$CFG_PERF" ]
|
||||||
then
|
then
|
||||||
HAVE_PERF_LOGFD=`$CFG_PERF stat --log-fd 2>&1 | grep 'unknown option'`
|
HAVE_PERF_LOGFD=`$CFG_PERF stat --log-fd 2>&1 | grep 'unknown option'`
|
||||||
if [ -z "$HAVE_PERF_LOGFD" ];
|
if [ -z "$HAVE_PERF_LOGFD" ];
|
||||||
@ -1339,11 +1339,11 @@ then
|
|||||||
"${CFG_GIT}" submodule init
|
"${CFG_GIT}" submodule init
|
||||||
|
|
||||||
# Disable submodules that we're not using
|
# Disable submodules that we're not using
|
||||||
if [ ! -z "${CFG_LLVM_ROOT}" ]; then
|
if [ -n "${CFG_LLVM_ROOT}" ]; then
|
||||||
msg "git: submodule deinit src/llvm"
|
msg "git: submodule deinit src/llvm"
|
||||||
"${CFG_GIT}" submodule deinit src/llvm
|
"${CFG_GIT}" submodule deinit src/llvm
|
||||||
fi
|
fi
|
||||||
if [ ! -z "${CFG_JEMALLOC_ROOT}" ]; then
|
if [ -n "${CFG_JEMALLOC_ROOT}" ]; then
|
||||||
msg "git: submodule deinit src/jemalloc"
|
msg "git: submodule deinit src/jemalloc"
|
||||||
"${CFG_GIT}" submodule deinit src/jemalloc
|
"${CFG_GIT}" submodule deinit src/jemalloc
|
||||||
fi
|
fi
|
||||||
@ -1390,7 +1390,7 @@ do
|
|||||||
if [ -z $CFG_LLVM_ROOT ]
|
if [ -z $CFG_LLVM_ROOT ]
|
||||||
then
|
then
|
||||||
LLVM_BUILD_DIR=${CFG_BUILD_DIR}$t/llvm
|
LLVM_BUILD_DIR=${CFG_BUILD_DIR}$t/llvm
|
||||||
if [ ! -z "$CFG_DISABLE_OPTIMIZE_LLVM" ]
|
if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]
|
||||||
then
|
then
|
||||||
LLVM_DBG_OPTS="--enable-debug-symbols --disable-optimized"
|
LLVM_DBG_OPTS="--enable-debug-symbols --disable-optimized"
|
||||||
# Just use LLVM straight from its build directory to
|
# Just use LLVM straight from its build directory to
|
||||||
@ -1446,7 +1446,7 @@ do
|
|||||||
msg "configuring LLVM for $t with cmake"
|
msg "configuring LLVM for $t with cmake"
|
||||||
|
|
||||||
CMAKE_ARGS="-DLLVM_INCLUDE_TESTS=OFF"
|
CMAKE_ARGS="-DLLVM_INCLUDE_TESTS=OFF"
|
||||||
if [ ! -z "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then
|
if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then
|
||||||
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug"
|
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug"
|
||||||
else
|
else
|
||||||
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release"
|
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release"
|
||||||
@ -1538,7 +1538,7 @@ do
|
|||||||
|
|
||||||
(*)
|
(*)
|
||||||
msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC"
|
msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC"
|
||||||
if [ ! -z "$CFG_ENABLE_CCACHE" ]
|
if [ -n "$CFG_ENABLE_CCACHE" ]
|
||||||
then
|
then
|
||||||
if [ -z "$CFG_CCACHE" ]
|
if [ -z "$CFG_CCACHE" ]
|
||||||
then
|
then
|
||||||
@ -1672,20 +1672,20 @@ putvar CFG_MANDIR
|
|||||||
|
|
||||||
# Avoid spurious warnings from clang by feeding it original source on
|
# Avoid spurious warnings from clang by feeding it original source on
|
||||||
# ccache-miss rather than preprocessed input.
|
# ccache-miss rather than preprocessed input.
|
||||||
if [ ! -z "$CFG_ENABLE_CCACHE" ] && [ ! -z "$CFG_USING_CLANG" ]
|
if [ -n "$CFG_ENABLE_CCACHE" ] && [ -n "$CFG_USING_CLANG" ]
|
||||||
then
|
then
|
||||||
CFG_CCACHE_CPP2=1
|
CFG_CCACHE_CPP2=1
|
||||||
putvar CFG_CCACHE_CPP2
|
putvar CFG_CCACHE_CPP2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z "$CFG_ENABLE_CCACHE" ]
|
if [ -n "$CFG_ENABLE_CCACHE" ]
|
||||||
then
|
then
|
||||||
CFG_CCACHE_BASEDIR=${CFG_SRC_DIR}
|
CFG_CCACHE_BASEDIR=${CFG_SRC_DIR}
|
||||||
putvar CFG_CCACHE_BASEDIR
|
putvar CFG_CCACHE_BASEDIR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ ! -z $BAD_PANDOC ]
|
if [ -n $BAD_PANDOC ]
|
||||||
then
|
then
|
||||||
CFG_PANDOC=
|
CFG_PANDOC=
|
||||||
putvar CFG_PANDOC
|
putvar CFG_PANDOC
|
||||||
|
Loading…
Reference in New Issue
Block a user