Skip to content

Standardize on non-zero checks for configure #27308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ opt_core() {
fi
done
else
if [ ! -z "$META" ]
if [ -n "$META" ]
then
OP="$OP=<$META>"
fi
Expand Down Expand Up @@ -317,7 +317,7 @@ envopt() {
fi

# If script or environment provided a value, save it.
if [ ! -z "$VV" ]
if [ -n "$VV" ]
then
putvar $V
fi
Expand Down Expand Up @@ -767,7 +767,7 @@ probe CFG_LLDB lldb
# On MacOS X, invoking `javac` pops up a dialog if the JDK is not
# installed. Since `javac` is only used if `antlr4` is available,
# probe for it only in this case.
if [ ! -z "$CFG_ANTLR4" ]
if [ -n "$CFG_ANTLR4" ]
then
probe CFG_JAVAC javac
fi
Expand All @@ -786,14 +786,14 @@ then
fi
fi

if [ ! -z "$CFG_GDB" ]
if [ -n "$CFG_GDB" ]
then
# Store GDB's version
CFG_GDB_VERSION=$($CFG_GDB --version 2>/dev/null | head -1)
putvar CFG_GDB_VERSION
fi

if [ ! -z "$CFG_LLDB" ]
if [ -n "$CFG_LLDB" ]
then
# Store LLDB's version
CFG_LLDB_VERSION=$($CFG_LLDB --version 2>/dev/null | head -1)
Expand All @@ -819,7 +819,7 @@ step_msg "looking for target specific programs"

probe CFG_ADB adb

if [ ! -z "$CFG_PANDOC" ]
if [ -n "$CFG_PANDOC" ]
then
# Extract "MAJOR MINOR" from Pandoc's version number
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc' |
Expand All @@ -845,7 +845,7 @@ then
BIN_SUF=.exe
fi

if [ ! -z "$CFG_ENABLE_LOCAL_RUST" ]
if [ -n "$CFG_ENABLE_LOCAL_RUST" ]
then
system_rustc=$(which rustc)
if [ -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
Expand Down Expand Up @@ -930,18 +930,18 @@ fi

# 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.
if [ ! -z "$CFG_ENABLE_CLANG" ]
if [ -n "$CFG_ENABLE_CLANG" ]
then
putvar CFG_ENABLE_CLANG
fi

# Same with jemalloc. save the setting here.
if [ ! -z "$CFG_DISABLE_JEMALLOC" ]
if [ -n "$CFG_DISABLE_JEMALLOC" ]
then
putvar CFG_DISABLE_JEMALLOC
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
step_msg "using custom LLVM at $CFG_LLVM_ROOT"

Expand Down Expand Up @@ -970,7 +970,7 @@ fi
# CFG_ENABLE_CLANG is set, that indicates that we are opting into
# running such safeguards.

if [ ! -z "$CC" ]
if [ -n "$CC" ]
then
msg "skipping compiler inference steps; using provided CC=$CC"
CFG_CC="$CC"
Expand All @@ -983,7 +983,7 @@ then
putvar CFG_USING_CLANG
fi
else
if [ ! -z "$CFG_ENABLE_CLANG" ]
if [ -n "$CFG_ENABLE_CLANG" ]
then
if [ -z "$CFG_CLANG" ]
then
Expand All @@ -997,7 +997,7 @@ else
fi
fi

if [ ! -z "$CFG_ENABLE_CLANG" ]
if [ -n "$CFG_ENABLE_CLANG" ]
then
case "$CC" in
(''|*clang)
Expand All @@ -1013,7 +1013,7 @@ then
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')
fi

if [ ! -z "$CFG_OSX_CLANG_VERSION" ]
if [ -n "$CFG_OSX_CLANG_VERSION" ]
then
case $CFG_OSX_CLANG_VERSION in
(7.0*)
Expand Down Expand Up @@ -1042,7 +1042,7 @@ then
esac
fi

if [ ! -z "$CFG_ENABLE_CCACHE" ]
if [ -n "$CFG_ENABLE_CCACHE" ]
then
if [ -z "$CFG_CCACHE" ]
then
Expand Down Expand Up @@ -1199,7 +1199,7 @@ do
;;
esac
bindir="${CFG_MSVC_ROOT}/VC/bin"
if [ ! -z "$msvc_part" ]; then
if [ -n "$msvc_part" ]; then
bindir="$bindir/$msvc_part"
fi
eval CFG_MSVC_BINDIR_$bits="\"$bindir\""
Expand Down Expand Up @@ -1229,7 +1229,7 @@ do
esac
done

if [ ! -z "$CFG_PERF" ]
if [ -n "$CFG_PERF" ]
then
HAVE_PERF_LOGFD=`$CFG_PERF stat --log-fd 2>&1 | grep 'unknown option'`
if [ -z "$HAVE_PERF_LOGFD" ];
Expand Down Expand Up @@ -1339,11 +1339,11 @@ then
"${CFG_GIT}" submodule init

# 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"
"${CFG_GIT}" submodule deinit src/llvm
fi
if [ ! -z "${CFG_JEMALLOC_ROOT}" ]; then
if [ -n "${CFG_JEMALLOC_ROOT}" ]; then
msg "git: submodule deinit src/jemalloc"
"${CFG_GIT}" submodule deinit src/jemalloc
fi
Expand Down Expand Up @@ -1390,7 +1390,7 @@ do
if [ -z $CFG_LLVM_ROOT ]
then
LLVM_BUILD_DIR=${CFG_BUILD_DIR}$t/llvm
if [ ! -z "$CFG_DISABLE_OPTIMIZE_LLVM" ]
if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]
then
LLVM_DBG_OPTS="--enable-debug-symbols --disable-optimized"
# Just use LLVM straight from its build directory to
Expand Down Expand Up @@ -1446,7 +1446,7 @@ do
msg "configuring LLVM for $t with cmake"

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"
else
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release"
Expand Down Expand Up @@ -1538,7 +1538,7 @@ do

(*)
msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC"
if [ ! -z "$CFG_ENABLE_CCACHE" ]
if [ -n "$CFG_ENABLE_CCACHE" ]
then
if [ -z "$CFG_CCACHE" ]
then
Expand Down Expand Up @@ -1672,20 +1672,20 @@ putvar CFG_MANDIR

# Avoid spurious warnings from clang by feeding it original source on
# 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
CFG_CCACHE_CPP2=1
putvar CFG_CCACHE_CPP2
fi

if [ ! -z "$CFG_ENABLE_CCACHE" ]
if [ -n "$CFG_ENABLE_CCACHE" ]
then
CFG_CCACHE_BASEDIR=${CFG_SRC_DIR}
putvar CFG_CCACHE_BASEDIR
fi


if [ ! -z $BAD_PANDOC ]
if [ -n $BAD_PANDOC ]
then
CFG_PANDOC=
putvar CFG_PANDOC
Expand Down