diff options
author | 2015-03-16 17:55:04 +0000 | |
---|---|---|
committer | 2015-03-18 13:39:47 +0000 | |
commit | b5ecdabfef7438cc12cb1fd5738f11a7a6a36f08 (patch) | |
tree | 67e9505da4e47a19bb514a96a08e64d6a86e5c84 /compile.sh | |
parent | ef03359be57475e434f82ab39de4663ca880c035 (diff) |
Make JDK not need tools/jdk/jdk symlinked
--
MOS_MIGRATED_REVID=88742425
Diffstat (limited to 'compile.sh')
-rwxr-xr-x | compile.sh | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/compile.sh b/compile.sh index e6e15141c2..acfee06baa 100755 --- a/compile.sh +++ b/compile.sh @@ -84,6 +84,9 @@ EOF touch fromhost/empty.c # For use with Homebrew. archive_dir=$(dirname $(dirname $homebrew_header)) + ARCHIVE_CFLAGS="-I${archive_dir}/include" + LDFLAGS="-L${archive_dir}/lib -larchive $LDFLAGS" + cp ${archive_dir}/lib/*.a ${archive_dir}/include/*.h fromhost/ cat << EOF > fromhost/BUILD package(default_visibility = ["//visibility:public"]) @@ -103,6 +106,14 @@ EOF cp /opt/local/include/archive.h /opt/local/include/archive_entry.h fromhost/ cp /opt/local/lib/{libarchive,liblzo2,liblzma,libcharset,libbz2,libxml2,libz,libiconv}.a \ fromhost/ + + ARCHIVE_CFLAGS="-Ifromhost" + # Link libarchive statically + LDFLAGS="fromhost/libarchive.a fromhost/liblzo2.a \ + fromhost/liblzma.a fromhost/libcharset.a \ + fromhost/libbz2.a fromhost/libxml2.a \ + fromhost/libz.a fromhost/libiconv.a \ + $LDFLAGS" cat << EOF > fromhost/BUILD package(default_visibility = ["//visibility:public"]) cc_library( @@ -112,6 +123,8 @@ cc_library( includes = ["."], ) EOF + else + log "WARNING: Could not find libarchive installation, proceeding bravely." fi esac } @@ -144,27 +157,6 @@ darwin) || fail "Could not find JAVA_HOME, please ensure a JDK (version 1.8+) is installed." fi PROTOC=${PROTOC:-third_party/protobuf/protoc.darwin} - - homebrew_header=$(ls -1 $(brew --prefix 2>/dev/null)/Cellar/libarchive/*/include/archive.h 2>/dev/null | head -n1) - if [[ -e $homebrew_header ]]; then - # For use with Homebrew. - archive_dir=$(dirname $(dirname $homebrew_header)) - ARCHIVE_CFLAGS="-I${archive_dir}/include" - LDFLAGS="-L${archive_dir}/lib -larchive $LDFLAGS" - - elif [[ -e /opt/local/include/archive.h ]]; then - # For use with Macports. - ARCHIVE_CFLAGS="-Ifromhost" - # Link libarchive statically - LDFLAGS="fromhost/libarchive.a fromhost/liblzo2.a \ - fromhost/liblzma.a fromhost/libcharset.a \ - fromhost/libbz2.a fromhost/libxml2.a \ - fromhost/libz.a fromhost/libiconv.a \ - $LDFLAGS" - else - log "WARNING: Could not find libarchive installation, proceeding bravely." - fi - ;; msys*|mingw*) @@ -428,13 +420,13 @@ if [[ $PLATFORM == "linux" ]]; then fi cp src/main/tools/build_interface_so output/build_interface_so -cp src/main/tools/jdk.WORKSPACE output/jdk.WORKSPACE +cp src/main/tools/jdk.* output touch output/client_info chmod 755 output/client_info log "Creating Bazel self-extracting archive..." -TO_ZIP="libblaze.jar ${JNILIB} build-runfiles${EXE_EXT} process-wrapper${EXE_EXT} client_info build_interface_so ${MSYS_DLLS} jdk.WORKSPACE" +TO_ZIP="libblaze.jar ${JNILIB} build-runfiles${EXE_EXT} process-wrapper${EXE_EXT} client_info build_interface_so ${MSYS_DLLS} jdk.WORKSPACE jdk.BUILD" if [[ $PLATFORM == "linux" ]]; then TO_ZIP="$TO_ZIP namespace-sandbox${EXE_EXT}" fi |