-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since we wanted to transfer llvm from bee-files to pkg-scripts, here is the currently installed version. The build is almost the same as the bee version with the exception of the build directory structure.
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#! /bin/bash | ||
|
||
PKG=llvm | ||
VERSION=12.0.1 | ||
BUILD=0 | ||
|
||
PREFIX=/pkg/$PKG-$VERSION-$BUILD | ||
if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi | ||
|
||
set -xe | ||
umask 022 | ||
|
||
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp | ||
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR ) | ||
mkdir -p $BUILD_TMPDIR/home | ||
export TMPDIR=$BUILD_TMPDIR | ||
export HOME=$BUILD_TMPDIR/home | ||
|
||
exec </dev/null | ||
|
||
mkdir -p $PREFIX | ||
cat >$PREFIX/profile <<-EOF | ||
PATH=$PREFIX/bin:\$PATH | ||
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi | ||
EOF | ||
. $PREFIX/profile | ||
|
||
export MAKEFLAGS="-j $(nproc)" | ||
|
||
BUILDDIR=$PREFIX/build | ||
|
||
mkdir -p $BUILDDIR | ||
cd $BUILDDIR | ||
|
||
test -e llvm-12.0.1.src.tar.xz || wget https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/llvm-12.0.1.src.tar.xz | ||
test -d llvm-12.0.1 || (mkdir llvm-12.0.1; tar xvf llvm-12.0.1.src.tar.xz -C llvm-12.0.1 --strip-components 1) | ||
cd llvm-12.0.1 | ||
|
||
mkdir -p build | ||
cd build/ | ||
cmake \ | ||
-DCMAKE_INSTALL_PREFIX=$PREFIX \ | ||
-DCMAKE_INSTALL_LIBDIR=/usr/lib \ | ||
-DCMAKE_COLOR_MAKEFILE=OFF \ | ||
-DCMAKE_VERBOSE_MAKEFILE=ON \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DLLVM_BUILD_LLVM_DYLIB=ON \ | ||
-DLLVM_LINK_LLVM_DYLIB=ON \ | ||
-DLLVM_ENABLE_RTTI=ON \ | ||
-DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;BPF" \ | ||
-DLLVM_BUILD_TESTS=ON \ | ||
-DLLVM_INSTALL_UTILS=ON \ | ||
-Wno-dev \ | ||
-G Ninja \ | ||
.. | ||
|
||
ninja -v -C . | ||
ninja -v -C . install | ||
|
||
exit |