llvm
This commit is contained in:
parent
339745fd2e
commit
dbcbb364c9
|
@ -1,12 +1,9 @@
|
||||||
/* llvm-config.h stub */
|
#include <bits/wordsize.h>
|
||||||
|
|
||||||
#ifndef __STUB__LLVMCONFIG_H__
|
#if __WORDSIZE == 32
|
||||||
#define __STUB__LLVMCONFIG_H__
|
#include "llvm-config-32.h"
|
||||||
|
#elif __WORDSIZE == 64
|
||||||
#if defined(__x86_64__)
|
|
||||||
#include "llvm-config-64.h"
|
#include "llvm-config-64.h"
|
||||||
#else
|
#else
|
||||||
#include "llvm-config-32.h"
|
#error "Unknown word size"
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,38 +1,87 @@
|
||||||
# Tanım: LLVM derleyicisi
|
# Tanım: LLVM derleyicisi
|
||||||
# URL: http://llvm.org/
|
# URL: https://llvm.org/
|
||||||
# Paketçi: milisarge
|
# Paketçi: milisarge
|
||||||
# Gerekler: python cmake
|
# Gerekler: libffi python ocaml swig cmake libedit
|
||||||
|
# Grup: geliştirme
|
||||||
|
|
||||||
isim=llvm
|
isim=llvm
|
||||||
surum=4.0.0
|
surum=6.0.1
|
||||||
devir=1
|
devir=1
|
||||||
kaynak=(http://llvm.org/releases/$surum/$isim-$surum.src.tar.xz \
|
kaynak=(https://llvm.org/releases/6.0.1/llvm-6.0.1.src.tar.xz
|
||||||
|
https://llvm.org/releases/6.0.1/cfe-6.0.1.src.tar.xz
|
||||||
|
https://releases.llvm.org/6.0.1/clang-tools-extra-6.0.1.src.tar.xz
|
||||||
|
https://llvm.org/releases/6.0.1/compiler-rt-6.0.1.src.tar.xz
|
||||||
|
https://llvm.org/releases/6.0.1/lldb-6.0.1.src.tar.xz
|
||||||
llvm-config.h)
|
llvm-config.h)
|
||||||
|
|
||||||
derle() {
|
derle() {
|
||||||
export CC=gcc
|
cd llvm-${surum}.src
|
||||||
export CXX=g++
|
mv ${SRC}/cfe-${surum}.src tools/clang
|
||||||
|
mv ${SRC}/clang-tools-extra-${surum}.src tools/clang/tools/extra
|
||||||
cd $isim-$surum.src
|
mv ${SRC}/compiler-rt-${surum}.src projects/compiler-rt
|
||||||
|
mv ${SRC}/lldb-${surum}.src tools/lldb
|
||||||
mkdir build
|
chmod -R u=rwX,go=rX ${SRC}/llvm-${surum}.src
|
||||||
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
|
export PKG_CONFIG_PATH='/usr/lib/pkgconfig'
|
||||||
|
_ffi_include_flags=$(pkg-config --cflags-only-I libffi)
|
||||||
|
_ffi_libs_flags=$(pkg-config --libs-only-L libffi)
|
||||||
|
_cxx_headers="/usr/include/c++/5.3.0"
|
||||||
|
cmake -G 'Unix Makefiles' \
|
||||||
|
-DCMAKE_BUILD_TYPE:STRING=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
|
||||||
|
-DLLVM_TARGETS_TO_BUILD=all \
|
||||||
|
-DLLVM_APPEND_VC_REV:BOOL=ON \
|
||||||
|
-DLLVM_ENABLE_RTTI:BOOL=ON \
|
||||||
|
-DLLVM_ENABLE_FFI:BOOL=ON \
|
||||||
|
-DFFI_INCLUDE_DIR:PATH="${_ffi_include_flags#-I}" \
|
||||||
|
-DFFI_LIBRARY_DIR:PATH="${_ffi_libs_flags#-L}" \
|
||||||
|
-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
|
||||||
|
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
|
||||||
|
-DLLVM_BINUTILS_INCDIR:PATH=/usr/include \
|
||||||
|
"../"
|
||||||
|
make
|
||||||
|
# install in clang packaging
|
||||||
|
sed -i '/clang\/cmake_install.cmake/d' tools/cmake_install.cmake
|
||||||
|
sed -i '/compiler-rt\/cmake_install.cmake/d' projects/cmake_install.cmake
|
||||||
|
# install in lldb
|
||||||
|
sed -i '/\(clang\|lldb\)\/cmake_install.cmake/d' tools/cmake_install.cmake
|
||||||
|
# install in clang-tools-extra
|
||||||
|
sed -i '/extra\/cmake_install.cmake/d' tools/clang/tools/cmake_install.cmake
|
||||||
|
make DESTDIR=${PKG} install
|
||||||
|
# Fix permissions of static libs
|
||||||
|
chmod -x ${PKG}/usr/lib/*.a
|
||||||
|
install -D -m644 ${SRC}/llvm-${surum}.src/LICENSE.TXT ${PKG}/usr/share/licenses/${isim}/LICENSE
|
||||||
|
|
||||||
cmake -DLLVM_ENABLE_CXX1Y=1 \
|
cd build/tools/clang
|
||||||
-DLLVM_INCLUDE_EXAMPLES=0 \
|
make DESTDIR=${PKG} install
|
||||||
-DLLVM_INCLUDE_TESTS=0 \
|
|
||||||
-DLLVM_ENABLE_OCAMLDOC=0 \
|
|
||||||
-DLLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF' \
|
|
||||||
-DLLVM_BUILD_LLVM_DYLIB=1 \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr ..
|
|
||||||
|
|
||||||
MAKEFLAGS="$MAKEFLAGS" make
|
cd ../../projects/compiler-rt
|
||||||
make DESTDIR=$PKG install
|
make DESTDIR=${PKG} install
|
||||||
|
chmod -x ${PKG}/usr/lib/*.a
|
||||||
|
# part of clang-analyzer
|
||||||
|
rm ${PKG}/usr/bin/scan-build
|
||||||
|
rm ${PKG}/usr/bin/scan-view
|
||||||
|
|
||||||
# multilib stub
|
cd ${SRC}/llvm-${surum}.src/tools/clang
|
||||||
mv $PKG/usr/include/llvm/Config/llvm-config{,-64}.h
|
install -d ${PKG}/usr/{bin,lib/clang-analyzer}
|
||||||
|
for _tool in scan-{build,view}; do
|
||||||
|
cp -a tools/${_tool} ${PKG}/usr/lib/clang-analyzer
|
||||||
|
ln -s /usr/lib/clang-analyzer/${_tool}/${_tool} ${PKG}/usr/bin
|
||||||
|
done
|
||||||
|
# Python scripts
|
||||||
|
python2 -m compileall ${PKG}/usr/lib/clang-analyzer
|
||||||
|
python2 -O -m compileall ${PKG}/usr/lib/clang-analyzer
|
||||||
|
|
||||||
install -m 0644 $SRC/llvm-config.h $PKG/usr/include/llvm/Config/
|
cd build/tools/lldb
|
||||||
|
make DESTDIR=${PKG} install
|
||||||
|
python2 -m compileall ${PKG}/usr/lib/python2.7/site-packages/lldb
|
||||||
|
python2 -O -m compileall ${PKG}/usr/lib/python2.7/site-packages/lldb
|
||||||
|
# part of LLVM
|
||||||
|
rm ${PKG}/usr/lib/python2.7/site-packages/six.py
|
||||||
|
|
||||||
|
cd build/tools/clang/tools/extra
|
||||||
|
make DESTDIR=${PKG} install
|
||||||
|
mv "$PKG/usr/include/llvm/Config/llvm-config"{,-64}.h
|
||||||
|
cp "$SRC/llvm-config.h" "$PKG/usr/include/llvm/Config/llvm-config.h"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue