|
|
@@ -28,9 +28,10 @@ PRINT_USAGE() {
|
|
|
echo "build.sh [options]"
|
|
|
echo ""
|
|
|
echo "options:"
|
|
|
- echo " --arch=[*] Set target arch (x86)"
|
|
|
- echo " --cxx=PATH Path to Clang++ (see example below)"
|
|
|
+ echo " --arch=[*] Set target arch (x86)"
|
|
|
echo " --cc=PATH Path to Clang (see example below)"
|
|
|
+ echo " --cxx=PATH Path to Clang++ (see example below)"
|
|
|
+ echo " --create-deb=V Create .deb package with given V version"
|
|
|
echo " -d, --debug Debug build (by default Release build)"
|
|
|
echo " --embed-icu Download and embed ICU-57 statically"
|
|
|
echo " -h, --help Show help"
|
|
|
@@ -39,21 +40,22 @@ PRINT_USAGE() {
|
|
|
echo " -n, --ninja Build with ninja instead of make"
|
|
|
echo " --no-icu Compile without unicode/icu support"
|
|
|
echo " --no-jit Disable JIT"
|
|
|
- echo " --xcode Generate XCode project"
|
|
|
- echo " -t, --test-build Test build (by default Release build)"
|
|
|
+ echo " --lto Enables LLVM Full LTO"
|
|
|
+ echo " --lto-thin Enables LLVM Thin LTO - xcode 8+ or clang 3.9+"
|
|
|
echo " --static Build as static library (by default shared library)"
|
|
|
echo " --sanitize=CHECKS Build with clang -fsanitize checks,"
|
|
|
echo " e.g. undefined,signed-integer-overflow"
|
|
|
- echo " -v, --verbose Display verbose output including all options"
|
|
|
- echo " --create-deb=V Create .deb package with given V version"
|
|
|
+ echo " -t, --test-build Test build (by default Release build)"
|
|
|
+ echo " --xcode Generate XCode project"
|
|
|
echo " --without=FEATURE,FEATURE,..."
|
|
|
echo " Disable FEATUREs from JSRT experimental"
|
|
|
echo " features."
|
|
|
+ echo " -v, --verbose Display verbose output including all options"
|
|
|
echo ""
|
|
|
echo "example:"
|
|
|
echo " ./build.sh --cxx=/path/to/clang++ --cc=/path/to/clang -j"
|
|
|
echo "with icu:"
|
|
|
- echo " ./build.sh --icu=/usr/local/Cellar/icu4c/version/include/"
|
|
|
+ echo " ./build.sh --icu=/usr/local/opt/icu4c/include"
|
|
|
echo ""
|
|
|
}
|
|
|
|
|
|
@@ -75,6 +77,7 @@ ARCH="-DCC_TARGETS_AMD64_SH=1"
|
|
|
OS_LINUX=0
|
|
|
OS_APT_GET=0
|
|
|
OS_UNIX=0
|
|
|
+LTO=""
|
|
|
|
|
|
if [ -f "/proc/version" ]; then
|
|
|
OS_LINUX=1
|
|
|
@@ -187,6 +190,14 @@ while [[ $# -gt 0 ]]; do
|
|
|
ICU_PATH="-DICU_INCLUDE_PATH_SH=${ICU_PATH:6}"
|
|
|
;;
|
|
|
|
|
|
+ --lto)
|
|
|
+ LTO="-DENABLE_FULL_LTO_SH=1"
|
|
|
+ ;;
|
|
|
+
|
|
|
+ --lto-thin)
|
|
|
+ LTO="-DENABLE_THIN_LTO_SH=1"
|
|
|
+ ;;
|
|
|
+
|
|
|
-n | --ninja)
|
|
|
CMAKE_GEN="-G Ninja"
|
|
|
MAKE=ninja
|
|
|
@@ -321,7 +332,7 @@ else
|
|
|
fi
|
|
|
|
|
|
echo Generating $BUILD_TYPE makefiles
|
|
|
-cmake $CMAKE_GEN $CC_PREFIX $ICU_PATH $STATIC_LIBRARY $ARCH \
|
|
|
+cmake $CMAKE_GEN $CC_PREFIX $ICU_PATH $LTO $STATIC_LIBRARY $ARCH \
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE $SANITIZE $NO_JIT $WITHOUT_FEATURES ../..
|
|
|
|
|
|
_RET=$?
|