changeset 652:71e6b0d31f00

dev/llvm: add more options
author David Demelier <markand@malikania.fr>
date Mon, 29 Jul 2019 20:35:00 +0200
parents 02482c86d4f3
children f231cc801094
files dev/llvm/llvm.sh
diffstat 1 files changed, 53 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/dev/llvm/llvm.sh	Mon Jul 29 20:30:00 2019 +0200
+++ b/dev/llvm/llvm.sh	Mon Jul 29 20:35:00 2019 +0200
@@ -22,7 +22,7 @@
 PKGSUMMARY="low level virtual machine compiler infrastructure"
 PKGDOWNLOAD="https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKGVERSION/$PKGNAME-$PKGVERSION.src.tar.xz"
 PKGDEPENDS="lib/ncurses python/python compression/zlib dev/cmake:build"
-PKGOPTIONS="DOXYGEN LIBCXX LLD SPHINX STATIC TARGETS"
+PKGOPTIONS="DOXYGEN FFI LIBCXX LIBEDIT LIBXML2 LLD NCURSES SPHINX STATIC TARGETS ZLIB"
 
 : ${CHOST:=$(uname -m)-linux-musl}
 : ${CC:=clang}
@@ -30,33 +30,67 @@
 : ${CXX:=clang++}
 : ${CXXFLAGS:=-O2}
 : ${DOXYGEN:=yes}
+: ${FFI:=no}
 : ${LIBCXX:=yes}
+: ${LIBEDIT:=yes}
+: ${LIBXML2:=yes}
 : ${LLD:=yes}
+: ${NCURSES:=yes}
 : ${SPHINX:=yes}
 : ${STATIC:=no}
 : ${TARGETS:=all}
+: ${ZLIB:=yes}
+
+if [ "$DOXYGEN" = "yes" ]; then
+	PKGDEPENDS="dev/doxygen:build $PKGDEPENDS"
+	with_doxygen="-DLLVM_ENABLE_DOXYGEN=On"
+else
+	with_doxygen="-DLLVM_ENABLE_DOXYGEN=Off"
+fi
+
+if [ "$FFI" = "yes" ]; then
+	PKGDEPENDS="lib/libffi $PKGDEPENDS"
+	with_ffi="-DLLVM_ENABLE_FFI=On"
+else
+	with_ffi="-DLLVM_ENABLE_FFI=Off"
+fi
 
 if [ "$LIBCXX" = "yes" ]; then
+	PKGDEPENDS="lib/libc++ $PKGDEPENDS"
 	with_libcxx="-DLLVM_ENABLE_LIBCXX=On"
 else
 	with_libcxx="-DLLVM_ENABLE_LIBCXX=Off"
 fi
 
+if [ "$LIBEDIT" = "yes" ]; then
+	PKGDEPENDS="lib/libedit $PKGDEPENDS"
+	with_libedit="-DLLVM_ENABLE_LIBEDIT=On"
+else
+	with_libedit="-DLLVM_ENABLE_LIBEDIT=Off"
+fi
+
+if [ "$LIBXML2" = "yes" ]; then
+	PKGDEPENDS="text/libxml2 $PKGDEPENDS"
+	with_libxml2="-DLLVM_ENABLE_LIBXML2=On"
+else
+	with_libxml2="-DLLVM_ENABLE_LIBXML2=Off"
+fi
+
 if [ "$LLD" = "yes" ]; then
 	with_lld="-DLLVM_ENABLE_LLD=On"
 else
 	with_lld="-DLLVM_ENABLE_LLD=Off"
 fi
 
-if [ "$DOXYGEN" = "yes" ]; then
-	PKGDEPENDS="dev/doxygen $PKGDEPENDS"
-	with_doxygen="-DLLVM_ENABLE_DOXYGEN=On"
+if [ "$NCURSES" = "yes" ]; then
+	PKGDEPENDS="lib/ncurses $PKGDEPENDS"
+	with_ncurses="-DLLVM_ENABLE_TERMINFO=On"
 else
-	with_doxygen="-DLLVM_ENABLE_DOXYGEN=Off"
+	with_ncurses="-DLLVM_ENABLE_TERMINFO=Off"
 fi
 
 if [ "$SPHINX" = "yes" ]; then
-	PKGDEPENDS="dev/sphinx $PKGDEPENDS"
+	PKGDEPENDS="dev/sphinx:build $PKGDEPENDS"
 	with_sphinx="-DLLVM_ENABLE_SPHINX=On"
 else
 	with_sphinx="-DLLVM_ENABLE_SPHINX=Off"
@@ -68,6 +102,13 @@
 	with_static="-DLLVM_BUILD_LLVM_DYLIB=On -DLLVM_LINK_LLVM_DYLIB=On"
 fi
 
+if [ "$ZLIB" = "yes" ]; then
+	PKGDEPENDS="compression/zlib $PKGDEPENDS"
+	with_zlib="-DLLVM_ENABLE_ZLIB=On"
+else
+	with_zlib="-DLLVM_ENABLE_ZLIB=Off"
+fi
+
 build()
 {
 	rm -rf $PKGNAME-$PKGVERSION.src
@@ -87,10 +128,15 @@
 		-DLLVM_HOST_TRIPLE=$CHOST \
 		-DLLVM_TARGETS_TO_BUILD=$TARGETS \
 		$with_doxygen \
+		$with_ffi \
 		$with_libcxx \
+		$with_libedit \
+		$with_libxml2 \
 		$with_lld \
+		$with_ncurses \
 		$with_sphinx \
-		$with_static
+		$with_static \
+		$with_zlib
 	make
 	make DESTDIR=$DESTDIR install
 	cd ..