Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (37 sloc) 1.45 KB
#!/bin/bash
needs_tool cmake ## since llvm 3.9, cmake is the only way to build this
needs_tool python ## needs python 2.7 to compile
depends_on libxml ## c-index-test requires libxml and there's no way to disable that
ENABLE_SANITIZER=yes
if ! test_cc_expr "link.h" "Elf64_Dyn a = _DYNAMIC[0]"; then
ENABLE_SANITIZER=no
add_caveat "Your libc doesn't have _DYNAMIC in <link.h>, sanitizer support was disabled."
fi
fetch_source http://releases.llvm.org/6.0.1/llvm-6.0.1.src.tar.xz 09a6316c5225cab255ba12391e7abe5ff4d28935
do_unpack
rm -f "$SRCDIR"/configure
if [[ ${BASH_SOURCE##*/} == clang ]]; then
fetch_source http://releases.llvm.org/6.0.1/cfe-6.0.1.src.tar.xz d93d8f3e3d7eb549ac58507383f7fcbdd78804d7
intree_unpack tools/clang
if [[ $ENABLE_SANITIZER == yes ]]; then
fetch_source http://releases.llvm.org/6.0.1/compiler-rt-6.0.1.src.tar.xz 4a61bd09f31d3079e921205bb93fb7d05a95946b
intree_unpack projects/compiler-rt
fi
fetch_source http://releases.llvm.org/6.0.1/clang-tools-extra-6.0.1.src.tar.xz 0e4077e46dba66f9db17eb55b1e913b44cb19fd3
intree_unpack tools/clang/tools/extra
fi
CONFFLAGS=(
-DOCAMLFIND=
-DOCAML_STDLIB_PATH=
-DHAVE_OCAMLOPT=FALSE
-DLLVM_OPTIMIZED_TABLEGEN=ON
-DLLVM_BUILD_LLVM_DYLIB=ON
-DLLVM_BUILD_TESTS=ON
-DLLVM_BUILD_EXAMPLES=OFF
-DLLVM_LINK_LLVM_DYLIB=ON
-DLLVM_ENABLE_LIBEDIT=OFF
-DLLVM_ENABLE_ZLIB=OFF
-DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_ENABLE_LIBXML2=OFF
)
do_compile_outside "${CONFFLAGS[@]}"