@@ -283,7 +283,7 @@ opt_core() {
283
283
fi
284
284
done
285
285
else
286
- if [ -n " $META " ]
286
+ if [ ! -z " $META " ]
287
287
then
288
288
OP=" $OP =<$META >"
289
289
fi
@@ -317,7 +317,7 @@ envopt() {
317
317
fi
318
318
319
319
# If script or environment provided a value, save it.
320
- if [ -n " $VV " ]
320
+ if [ ! -z " $VV " ]
321
321
then
322
322
putvar $V
323
323
fi
@@ -601,9 +601,7 @@ valopt llvm-root "" "set LLVM root"
601
601
valopt python " " " set path to python"
602
602
valopt jemalloc-root " " " set directory where libjemalloc_pic.a is located"
603
603
valopt build " ${DEFAULT_BUILD} " " GNUs ./configure syntax LLVM build triple"
604
- valopt android-cross-path " /opt/ndk_standalone" " Android NDK standalone path (deprecated)"
605
- valopt arm-linux-androideabi-ndk " " " arm-linux-androideabi NDK standalone path"
606
- valopt aarch64-linux-android-ndk " " " aarch64-linux-android NDK standalone path"
604
+ valopt android-cross-path " /opt/ndk_standalone" " Android NDK standalone path"
607
605
valopt release-channel " dev" " the name of the release channel to build"
608
606
valopt musl-root " /usr/local" " MUSL root installation directory"
609
607
@@ -769,7 +767,7 @@ probe CFG_LLDB lldb
769
767
# On MacOS X, invoking `javac` pops up a dialog if the JDK is not
770
768
# installed. Since `javac` is only used if `antlr4` is available,
771
769
# probe for it only in this case.
772
- if [ -n " $CFG_ANTLR4 " ]
770
+ if [ ! -z " $CFG_ANTLR4 " ]
773
771
then
774
772
probe CFG_JAVAC javac
775
773
fi
@@ -788,14 +786,14 @@ then
788
786
fi
789
787
fi
790
788
791
- if [ -n " $CFG_GDB " ]
789
+ if [ ! -z " $CFG_GDB " ]
792
790
then
793
791
# Store GDB's version
794
792
CFG_GDB_VERSION=$( $CFG_GDB --version 2> /dev/null | head -1)
795
793
putvar CFG_GDB_VERSION
796
794
fi
797
795
798
- if [ -n " $CFG_LLDB " ]
796
+ if [ ! -z " $CFG_LLDB " ]
799
797
then
800
798
# Store LLDB's version
801
799
CFG_LLDB_VERSION=$( $CFG_LLDB --version 2> /dev/null | head -1)
@@ -821,7 +819,7 @@ step_msg "looking for target specific programs"
821
819
822
820
probe CFG_ADB adb
823
821
824
- if [ -n " $CFG_PANDOC " ]
822
+ if [ ! -z " $CFG_PANDOC " ]
825
823
then
826
824
# Extract "MAJOR MINOR" from Pandoc's version number
827
825
PV_MAJOR_MINOR=$( pandoc --version | grep ' ^pandoc' |
847
845
BIN_SUF=.exe
848
846
fi
849
847
850
- if [ -n " $CFG_ENABLE_LOCAL_RUST " ]
848
+ if [ ! -z " $CFG_ENABLE_LOCAL_RUST " ]
851
849
then
852
850
system_rustc=$( which rustc)
853
851
if [ -f ${CFG_LOCAL_RUST_ROOT} /bin/rustc${BIN_SUF} ]
932
930
933
931
# Okay, at this point, we have made up our minds about whether we are
934
932
# going to force CFG_ENABLE_CLANG or not; save the setting if so.
935
- if [ -n " $CFG_ENABLE_CLANG " ]
933
+ if [ ! -z " $CFG_ENABLE_CLANG " ]
936
934
then
937
935
putvar CFG_ENABLE_CLANG
938
936
fi
939
937
940
938
# Same with jemalloc. save the setting here.
941
- if [ -n " $CFG_DISABLE_JEMALLOC " ]
939
+ if [ ! -z " $CFG_DISABLE_JEMALLOC " ]
942
940
then
943
941
putvar CFG_DISABLE_JEMALLOC
944
942
fi
945
943
946
- if [ -n " $CFG_LLVM_ROOT " -a -z " $CFG_DISABLE_LLVM_VERSION_CHECK " -a -e " $CFG_LLVM_ROOT /bin/llvm-config" ]
944
+ if [ ! -z " $CFG_LLVM_ROOT " -a -z " $CFG_DISABLE_LLVM_VERSION_CHECK " -a -e " $CFG_LLVM_ROOT /bin/llvm-config" ]
947
945
then
948
946
step_msg " using custom LLVM at $CFG_LLVM_ROOT "
949
947
972
970
# CFG_ENABLE_CLANG is set, that indicates that we are opting into
973
971
# running such safeguards.
974
972
975
- if [ -n " $CC " ]
973
+ if [ ! -z " $CC " ]
976
974
then
977
975
msg " skipping compiler inference steps; using provided CC=$CC "
978
976
CFG_CC=" $CC "
985
983
putvar CFG_USING_CLANG
986
984
fi
987
985
else
988
- if [ -n " $CFG_ENABLE_CLANG " ]
986
+ if [ ! -z " $CFG_ENABLE_CLANG " ]
989
987
then
990
988
if [ -z " $CFG_CLANG " ]
991
989
then
999
997
fi
1000
998
fi
1001
999
1002
- if [ -n " $CFG_ENABLE_CLANG " ]
1000
+ if [ ! -z " $CFG_ENABLE_CLANG " ]
1003
1001
then
1004
1002
case " $CC " in
1005
1003
(' ' |* clang)
@@ -1015,7 +1013,7 @@ then
1015
1013
CFG_CLANG_VERSION=$( echo $CFG_CLANG_REPORTED_VERSION | sed ' s/.*version \(.*\) .*/\1/' )
1016
1014
fi
1017
1015
1018
- if [ -n " $CFG_OSX_CLANG_VERSION " ]
1016
+ if [ ! -z " $CFG_OSX_CLANG_VERSION " ]
1019
1017
then
1020
1018
case $CFG_OSX_CLANG_VERSION in
1021
1019
(7.0* )
@@ -1044,7 +1042,7 @@ then
1044
1042
esac
1045
1043
fi
1046
1044
1047
- if [ -n " $CFG_ENABLE_CCACHE " ]
1045
+ if [ ! -z " $CFG_ENABLE_CCACHE " ]
1048
1046
then
1049
1047
if [ -z " $CFG_CCACHE " ]
1050
1048
then
@@ -1114,24 +1112,20 @@ do
1114
1112
fi
1115
1113
1116
1114
case $i in
1117
- * android* )
1118
- upper_snake_target=$( echo " $i " | tr ' [:lower:]' ' [:upper:]' | tr ' \-' ' \_' )
1119
- eval ndk=\$ " CFG_${upper_snake_target} _NDK"
1120
- if [ -z " $ndk " ]
1115
+ arm-linux-androideabi)
1116
+
1117
+ if [ ! -f $CFG_ANDROID_CROSS_PATH /bin/arm-linux-androideabi-gcc ]
1121
1118
then
1122
- ndk=$CFG_ANDROID_CROSS_PATH
1123
- eval " CFG_${upper_snake_target} _NDK" =$CFG_ANDROID_CROSS_PATH
1124
- warn " generic/default Android NDK option is deprecated (use --$i -ndk option instead)"
1119
+ err " NDK $CFG_ANDROID_CROSS_PATH /bin/arm-linux-androideabi-gcc not found"
1120
+ fi
1121
+ if [ ! -f $CFG_ANDROID_CROSS_PATH /bin/arm-linux-androideabi-g++ ]
1122
+ then
1123
+ err " NDK $CFG_ANDROID_CROSS_PATH /bin/arm-linux-androideabi-g++ not found"
1124
+ fi
1125
+ if [ ! -f $CFG_ANDROID_CROSS_PATH /bin/arm-linux-androideabi-ar ]
1126
+ then
1127
+ err " NDK $CFG_ANDROID_CROSS_PATH /bin/arm-linux-androideabi-ar not found"
1125
1128
fi
1126
-
1127
- # Perform a basic sanity check of the NDK
1128
- for android_ndk_tool in " $ndk /bin/$i -gcc" " $ndk /bin/$i -g++" " $ndk /bin/$i -ar"
1129
- do
1130
- if [ ! -f $android_ndk_tool ]
1131
- then
1132
- err " NDK tool $android_ndk_tool not found (bad or missing --$i -ndk option?)"
1133
- fi
1134
- done
1135
1129
;;
1136
1130
1137
1131
arm-apple-darwin)
@@ -1183,13 +1177,8 @@ do
1183
1177
# INCLUDE and LIB variables for MSVC so we can set those in the
1184
1178
# build system as well.
1185
1179
install=$( reg QUERY \
1186
- ' HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14 .0' \
1180
+ ' HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12 .0' \
1187
1181
-v InstallDir)
1188
- if [ -z " $install " ]; then
1189
- install=$( reg QUERY \
1190
- ' HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
1191
- -v InstallDir)
1192
- fi
1193
1182
need_ok " couldn't find visual studio install root"
1194
1183
CFG_MSVC_ROOT=$( echo " $install " | grep InstallDir | sed ' s/.*REG_SZ[ ]*//' )
1195
1184
CFG_MSVC_ROOT=$( dirname " $CFG_MSVC_ROOT " )
1210
1199
;;
1211
1200
esac
1212
1201
bindir=" ${CFG_MSVC_ROOT} /VC/bin"
1213
- if [ -n " $msvc_part " ]; then
1202
+ if [ ! -z " $msvc_part " ]; then
1214
1203
bindir=" $bindir /$msvc_part "
1215
1204
fi
1216
1205
eval CFG_MSVC_BINDIR_$bits =" \" $bindir \" "
1240
1229
esac
1241
1230
done
1242
1231
1243
- if [ -n " $CFG_PERF " ]
1232
+ if [ ! -z " $CFG_PERF " ]
1244
1233
then
1245
1234
HAVE_PERF_LOGFD=` $CFG_PERF stat --log-fd 2>&1 | grep ' unknown option' `
1246
1235
if [ -z " $HAVE_PERF_LOGFD " ];
@@ -1350,11 +1339,11 @@ then
1350
1339
" ${CFG_GIT} " submodule init
1351
1340
1352
1341
# Disable submodules that we're not using
1353
- if [ -n " ${CFG_LLVM_ROOT} " ]; then
1342
+ if [ ! -z " ${CFG_LLVM_ROOT} " ]; then
1354
1343
msg " git: submodule deinit src/llvm"
1355
1344
" ${CFG_GIT} " submodule deinit src/llvm
1356
1345
fi
1357
- if [ -n " ${CFG_JEMALLOC_ROOT} " ]; then
1346
+ if [ ! -z " ${CFG_JEMALLOC_ROOT} " ]; then
1358
1347
msg " git: submodule deinit src/jemalloc"
1359
1348
" ${CFG_GIT} " submodule deinit src/jemalloc
1360
1349
fi
1401
1390
if [ -z $CFG_LLVM_ROOT ]
1402
1391
then
1403
1392
LLVM_BUILD_DIR=${CFG_BUILD_DIR} $t /llvm
1404
- if [ -n " $CFG_DISABLE_OPTIMIZE_LLVM " ]
1393
+ if [ ! -z " $CFG_DISABLE_OPTIMIZE_LLVM " ]
1405
1394
then
1406
1395
LLVM_DBG_OPTS=" --enable-debug-symbols --disable-optimized"
1407
1396
# Just use LLVM straight from its build directory to
1457
1446
msg " configuring LLVM for $t with cmake"
1458
1447
1459
1448
CMAKE_ARGS=" -DLLVM_INCLUDE_TESTS=OFF"
1460
- if [ -n " $CFG_DISABLE_OPTIMIZE_LLVM " ]; then
1449
+ if [ ! -z " $CFG_DISABLE_OPTIMIZE_LLVM " ]; then
1461
1450
CMAKE_ARGS=" $CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug"
1462
1451
else
1463
1452
CMAKE_ARGS=" $CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release"
@@ -1471,22 +1460,12 @@ do
1471
1460
1472
1461
msg " configuring LLVM with:"
1473
1462
msg " $CMAKE_ARGS "
1474
- case " $CFG_MSVC_ROOT " in
1475
- * 14.0* )
1476
- generator=" Visual Studio 14 2015"
1477
- ;;
1478
- * 12.0* )
1479
- generator=" Visual Studio 12 2013"
1480
- ;;
1481
- * )
1482
- err " can't determine generator for LLVM cmake"
1483
- ;;
1484
- esac
1485
1463
case " $t " in
1486
1464
x86_64-* )
1487
- generator=" $generator Win64"
1465
+ generator=" Visual Studio 12 2013 Win64"
1488
1466
;;
1489
1467
i686-* )
1468
+ generator=" Visual Studio 12 2013"
1490
1469
;;
1491
1470
* )
1492
1471
err " can only build LLVM for x86 platforms"
1559
1538
1560
1539
(* )
1561
1540
msg " inferring LLVM_CXX/CC from CXX/CC = $CXX /$CC "
1562
- if [ -n " $CFG_ENABLE_CCACHE " ]
1541
+ if [ ! -z " $CFG_ENABLE_CCACHE " ]
1563
1542
then
1564
1543
if [ -z " $CFG_CCACHE " ]
1565
1544
then
@@ -1688,26 +1667,25 @@ putvar CFG_HOST
1688
1667
putvar CFG_TARGET
1689
1668
putvar CFG_LIBDIR_RELATIVE
1690
1669
putvar CFG_DISABLE_MANAGE_SUBMODULES
1691
- putvar CFG_AARCH64_LINUX_ANDROID_NDK
1692
- putvar CFG_ARM_LINUX_ANDROIDEABI_NDK
1670
+ putvar CFG_ANDROID_CROSS_PATH
1693
1671
putvar CFG_MANDIR
1694
1672
1695
1673
# Avoid spurious warnings from clang by feeding it original source on
1696
1674
# ccache-miss rather than preprocessed input.
1697
- if [ -n " $CFG_ENABLE_CCACHE " ] && [ -n " $CFG_USING_CLANG " ]
1675
+ if [ ! -z " $CFG_ENABLE_CCACHE " ] && [ ! -z " $CFG_USING_CLANG " ]
1698
1676
then
1699
1677
CFG_CCACHE_CPP2=1
1700
1678
putvar CFG_CCACHE_CPP2
1701
1679
fi
1702
1680
1703
- if [ -n " $CFG_ENABLE_CCACHE " ]
1681
+ if [ ! -z " $CFG_ENABLE_CCACHE " ]
1704
1682
then
1705
1683
CFG_CCACHE_BASEDIR=${CFG_SRC_DIR}
1706
1684
putvar CFG_CCACHE_BASEDIR
1707
1685
fi
1708
1686
1709
1687
1710
- if [ -n $BAD_PANDOC ]
1688
+ if [ ! -z $BAD_PANDOC ]
1711
1689
then
1712
1690
CFG_PANDOC=
1713
1691
putvar CFG_PANDOC
0 commit comments