llvm 9.0.1
This commit is contained in:
Regular → Executable
+65
-44
@@ -3,70 +3,91 @@
|
||||
# Licensed under the GNU General Public License, version 3.
|
||||
# See the file http://www.gnu.org/licenses/gpl.txt
|
||||
|
||||
from pisi.actionsapi import get
|
||||
from pisi.actionsapi import autotools
|
||||
from pisi.actionsapi import pisitools
|
||||
from pisi.actionsapi import cmaketools
|
||||
from pisi.actionsapi import shelltools
|
||||
from pisi.actionsapi import get
|
||||
from pisi.actionsapi import cmaketools
|
||||
|
||||
libdir = "/usr/lib32/llvm" if get.buildTYPE() == "emul32" else "/usr/lib/llvm"
|
||||
lib = "lib32" if get.buildTYPE() == "emul32" else "lib"
|
||||
libdir = "/usr/%s/llvm" % lib
|
||||
|
||||
|
||||
def setup():
|
||||
options = "-DCMAKE_BUILD_TYPE=Release \
|
||||
-DLLVM_BUILD_LLVM_DYLIB=ON \
|
||||
-DLLVM_LINK_LLVM_DYLIB=ON \
|
||||
-DLLVM_INSTALL_UTILS=ON \
|
||||
-DLLVM_ENABLE_RTTI=ON \
|
||||
-DLLVM_ENABLE_FFI=ON \
|
||||
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR \
|
||||
-DLLVM_BUILD_TESTS=ON \
|
||||
-DLLVM_BUILD_DOCS=OFF \
|
||||
-DLLVM_ENABLE_SPHINX=ON \
|
||||
-DLLVM_ENABLE_DOXYGEN=OFF \
|
||||
-DSPHINX_WARNINGS_AS_ERRORS=OFF \
|
||||
-DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
|
||||
-DLLVM_BINUTILS_INCDIR=/usr/include \
|
||||
"
|
||||
def setup():
|
||||
|
||||
if get.buildTYPE() != "emul32":
|
||||
if not shelltools.can_access_directory("tools/clang"):
|
||||
shelltools.move("../clang-%s.src" % get.srcVERSION(), "tools/clang")
|
||||
shelltools.move("../clang-tools-extra-%s.src" % get.srcVERSION(), "tools/clang/tools/extra")
|
||||
shelltools.move("../lld-%s.src" % get.srcVERSION(), "tools/lld")
|
||||
shelltools.move("../lldb-%s.src" % get.srcVERSION(), "tools/lldb")
|
||||
shelltools.move("../compiler-rt-%s.src" % get.srcVERSION(), "projects/compiler-rt")
|
||||
if not shelltools.can_access_directory("tools/clang"):
|
||||
shelltools.system("tar xf ../clang-%s.src.tar.xz -C tools" % get.srcVERSION())
|
||||
shelltools.move("tools/clang-%s.src" % get.srcVERSION(), "tools/clang")
|
||||
|
||||
shelltools.system("tar xf ../clang-tools-extra-%s.src.tar.xz -C tools" % get.srcVERSION())
|
||||
shelltools.move("tools/clang-tools-extra-*", "tools/clang/extra")
|
||||
|
||||
else:
|
||||
shelltools.system("tar xf ../lldb-%s.src.tar.xz -C tools" % get.srcVERSION())
|
||||
shelltools.move("tools/lldb-*", "tools/lldb")
|
||||
|
||||
shelltools.system("tar xf ../lld-%s.src.tar.xz -C tools" % get.srcVERSION())
|
||||
shelltools.move("tools/lld-*", "tools/lld")
|
||||
|
||||
shelltools.system("tar xf ../polly-%s.src.tar.xz -C tools" % get.srcVERSION())
|
||||
shelltools.move("tools/polly-*", "tools/polly")
|
||||
|
||||
if not shelltools.can_access_directory("projects/compiler-rt"):
|
||||
shelltools.system("tar xf ../compiler-rt-%s.src.tar.xz -C projects" % get.srcVERSION())
|
||||
shelltools.move("projects/compiler-rt-%s.src" % get.srcVERSION(), "projects/compiler-rt")
|
||||
|
||||
shelltools.export("CC", "clang")
|
||||
shelltools.export("CXX", "clang++")
|
||||
|
||||
|
||||
if get.buildTYPE() == "emul32":
|
||||
shelltools.export("CC", "clang -m32")
|
||||
shelltools.export("CXX", "clang++ -m32")
|
||||
shelltools.export("PKG_CONFIG_PATH","/usr/lib32/pkgconfig")
|
||||
|
||||
shelltools.makedirs("build")
|
||||
shelltools.makedirs("build")
|
||||
|
||||
shelltools.cd("build")
|
||||
|
||||
if get.buildTYPE() != "emul32":
|
||||
options = "-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DLLVM_TARGET_ARCH:STRING=x86_64 \
|
||||
-DLLVM_DEFAULT_TARGET_TRIPLE=%s \
|
||||
" % get.HOST()
|
||||
else:
|
||||
pisitools.flags.replace("-march=\S+", "-march=i686 -m32")
|
||||
options = "-DCMAKE_INSTALL_PREFIX=/emul32 \
|
||||
-DLLVM_TARGET_ARCH:STRING=i686 \
|
||||
-DLLVM_LIBDIR_SUFFIX=32 \
|
||||
-DLLVM_DEFAULT_TARGET_TRIPLE='i686-pc-linux-gnu' \
|
||||
"
|
||||
options += "-DCMAKE_C_FLAGS_RELEASE=%s \
|
||||
-DCMAKE_CXX_FLAGS_RELEASE=%s \
|
||||
" % (get.CFLAGS(), get.CXXFLAGS())
|
||||
|
||||
cmaketools.configure(options, sourceDir=".." )
|
||||
options = "-DCMAKE_C_FLAGS:STRING=-m64 \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_CXX_FLAGS:STRING=-m64 \
|
||||
-DLLVM_TARGET_ARCH:STRING=x86_64 \
|
||||
-DLLVM_DEFAULT_TARGET_TRIPLE=%s " % get.HOST()
|
||||
|
||||
|
||||
if get.buildTYPE() == "emul32":
|
||||
options = " -DCMAKE_C_FLAGS:STRING=-m32 \
|
||||
-DCMAKE_INSTALL_PREFIX=/emul32 \
|
||||
-DLLVM_TARGET_ARCH:STRING=i686 \
|
||||
-DLLVM_LIBDIR_SUFFIX=32 \
|
||||
-DLLVM_DEFAULT_TARGET_TRIPLE='i686-pc-linux-gnu' \
|
||||
-DCMAKE_CXX_FLAGS:STRING=-m32"
|
||||
|
||||
|
||||
cmaketools.configure("-DCMAKE_BUILD_TYPE=Release \
|
||||
%s \
|
||||
-DLLVM_ENABLE_FFI=ON \
|
||||
-DLLVM_BUILD_DOCS=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DLLVM_ENABLE_RTTI=ON \
|
||||
-DLLVM_ENABLE_EH=ON \
|
||||
-DLLVM_INCLUDEDIR=/usr/include \
|
||||
-DLLVM_ENABLE_ASSERTIONS=OFF \
|
||||
-DFFI_INCLUDE_DIR=/usr/lib/libffi-3.2.1/include \
|
||||
-DENABLE_SHARED=ON" % options, sourceDir=".." )
|
||||
|
||||
def build():
|
||||
shelltools.makedirs("build")
|
||||
shelltools.cd("build")
|
||||
|
||||
cmaketools.make()
|
||||
|
||||
def install():
|
||||
shelltools.cd("build")
|
||||
shelltools.makedirs("build")
|
||||
shelltools.cd("build")
|
||||
|
||||
cmaketools.rawInstall("DESTDIR=%s" % get.installDIR())
|
||||
|
||||
if get.buildTYPE() == "emul32":
|
||||
|
||||
Reference in New Issue
Block a user