diff options
author | Deposite Pirate | 2018-09-16 18:48:36 +0200 |
---|---|---|
committer | Deposite Pirate | 2018-09-16 18:48:36 +0200 |
commit | d150a5f3e462fa7fe194a805a4aa0076f4d03ab9 (patch) | |
tree | ce5e44d69c5f3175bfdbd1e3717b52c5dcca5638 /development/llvm/llvm.build | |
parent | f29d3519ce073ec30f99754d93304324f7f26d65 (diff) |
Add ports.
Diffstat (limited to 'development/llvm/llvm.build')
-rwxr-xr-x | development/llvm/llvm.build | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/development/llvm/llvm.build b/development/llvm/llvm.build new file mode 100755 index 0000000..9995b32 --- /dev/null +++ b/development/llvm/llvm.build @@ -0,0 +1,145 @@ +#!/bin/bash +# +# Maintainer: Deposite Pirate <ofni.sknuplatem@etaripd> + +source /usr/src/ports/Build/build.sh + +NAME=llvm +VERSION=3.3 +BUILD=1 +DEPENDS=('libraries >= 20130606-1') + +# Description + +cat > ${PKG}/install/slack-desc <<EOF +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + +$(padd)|-----handy-ruler------------------------------------------------------| +${NAME}: llvm (The Low Level Virtual Machine) +${NAME}: +${NAME}: LLVM is a compiler infrastructure designed for compile-time, +${NAME}: link-time, runtime, and idle-time optimization of programs from +${NAME}: arbitrary programming languages. +${NAME}: +${NAME}: This package includes 'clang', a C, C++, Objective C and Objective +${NAME}: C++ frontend for the LLVM compiler. +${NAME}: +${NAME}: Homepage: http://llvm.org +${NAME}: +EOF + +PYTHONSITEDIR="${SYS_DIR[lib]}/python2.7/site-packages" + +# Sources + +SRCNAME[0]=cfe +SRCVERS[0]=${VERSION} +SRCPACK[0]=http://llvm.org/releases/${SRCNAME[0]}-${SRCVERS[0]}.src.tar.gz +SRCROOT[0]=${NAME}-${VERSION}.src +SRCOPTS[0]="nosrcroot" + +build0() +{ + install.dir tools + mv cfe-${VERSION}.src tools/clang +} + +SRCNAME[1]=compiler-rt +SRCVERS[1]=${VERSION} +SRCPACK[1]=http://llvm.org/releases/${SRCNAME[1]}-${SRCVERS[1]}.src.tar.gz +SRCROOT[1]=${NAME}-${VERSION}.src +SRCOPTS[1]="nosrcroot" + +build1() +{ + install.dir projects + mv compiler-rt-${VERSION}.src projects/compiler-rt +} + +SRCNAME[2]=${NAME} +SRCVERS[2]=${VERSION} +SRCPACK[2]=http://llvm.org/releases/${SRCNAME[2]}-${SRCVERS[2]}.src.tar.gz +SRCROOT[2]=${NAME}-${VERSION}.src + +build2() +{ +# Fix insecure rpath +sed -i 's|$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))||g' Makefile.rules +#FIXME: convert to CMake one of these days +CPPFLAGS="$(pkg-config --cflags libffi)" \ +CFLAGS="${FLAGS}" CXXFLAGS="${FLAGS}" \ +./configure \ + --build="${ARCH}-slackware-linux" \ + --disable-expensive-checks \ + --disable-debug-runtime \ + --disable-assertions \ + --prefix="${SYS_DIR[usr]}" \ + --mandir="${SYS_DIR[man]}" \ + --sysconfdir="${SYS_DIR[etc]}" \ + --libdir="${SYS_DIR[lib]}" \ + --localstatedir="${SYS_DIR[var]}" \ + --with-binutils-include="${SYS_DIR[usr]}/include" \ + --with-udis86="${SYS_DIR[usr]}" \ + --with-python="${SYS_DIR[bin]}/python2" \ + --disable-docs \ + --disable-expensive-checks \ + --disable-debug-runtime \ + --disable-assertions \ + --enable-experimental-targets="R600" \ + --enable-shared \ + --enable-optimized \ + --enable-libffi \ + --enable-bindings=none \ + --enable-targets=all +make ${JOBS} VERBOSE=1 REQUIRES_RTTI=1 +make install DESTDIR="${PKG}" +doc CREDITS.TXT +license LICENSE.TXT +# GCC headers +( + cd ${PKG}${SYS_DIR[lib]}/clang/${SRCVERS[2]} + ln -s ${SYS_DIR[lib]}64/gcc/x86_64-slackware-linux/4.8.0/include + ln -s ${SYS_DIR[lib]}64/gcc/x86_64-slackware-linux/4.8.0/include-fixed +) +# LTO +#FIXME: lib64 +install.dir ${PKG}${SYS_DIR[lib]}64/bfd-plugins +( + cd ${PKG}${SYS_DIR[lib]}64/bfd-plugins + ln -sf ${SYS_DIR[lib]}/LLVMgold.so +) +#FIXME Where is LLVMgold.so? +# Clean up cruft +rm -f \ + ${PKG}${SYS_DIR[lib]}/*LLVMHello.* \ + ${PKG}${SYS_DIR[html]} +chmod -x ${PKG}${SYS_DIR[lib]}/*.a +#FIXME: this should end up in a subpackage +# Install also the clang-analyzer +install.dir ${PKG}${PYTHONSITEDIR}/clang-analyzer +for f in scan-{build,view}; do + cp -r tools/clang/tools/${f} ${PKG}${PYTHONSITEDIR}/clang-analyzer + ln -s ${PYTHONSITEDIR}/clang-analyzer/${f}/${f} ${PKG}${SYS_DIR[bin]}/${f} +done +install.dir ${PKG}${SYS_DIR[man]}/man1 +install.man tools/clang/tools/scan-build/scan-build.1 ${PKG}${SYS_DIR[man]}/man1 +rm -f ${PKG}${PYTHONSITEDIR}/clang-analyzer/scan-build/scan-build.{1,bat} +( + cd ${PKG}${PYTHONSITEDIR}/clang-analyzer/scan-build + ln -sf ${SYS_DIR[bin]}/clang +) +# Use Python 2 +sed -i \ + -e 's|env python$|&2|' \ + -e 's|/usr/bin/python$|&2|' \ + "${PKG}${PYTHONSITEDIR}/clang-analyzer/scan-view/scan-view" \ + "${PKG}${PYTHONSITEDIR}/clang-analyzer/scan-build/set-xcode-analyzer" +# Compile Python scripts +python2 -m compileall "${PKG}${PYTHONSITEDIR}/clang-analyzer" +python2 -O -m compileall "${PKG}${PYTHONSITEDIR}/clang-analyzer" +} |