mirror of
https://linux.maple.camp/git/ahill/maplelinux-bootstrap.git
synced 2026-02-11 10:13:35 +00:00
Successfully packaged LLVM!
This commit is contained in:
@@ -7,6 +7,15 @@ SRC_PATCHES="
|
||||
SRC_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.8/llvm-project-21.1.8.src.tar.xz"
|
||||
SRC_VERSION="21.1.8"
|
||||
|
||||
# TODO: Figure out why libunwind installs headers at /include
|
||||
# TODO: Figure out why libc++ installs headers at /include
|
||||
# TODO: Fix data directory for libclc (/share/clc -> /usr/share/clc)
|
||||
# TODO: Fix pkgconfig directory for libclc (/share/pkgconfig -> /lib/pkgconfig)
|
||||
# TODO: Fix data directory for libc++ (/share/libc++ -> /usr/share/libc++)
|
||||
# TODO: Should /lib/cmake be moved to /usr/share?
|
||||
# TODO: Should /lib/$TT_TARGET simply be a symlink to /lib?
|
||||
# TODO: Should /usr/include/$TT_TARGET simply be a symlink to /usr/include?
|
||||
|
||||
build() {
|
||||
tar xf ../$SRC_FILENAME
|
||||
cd llvm-project-$SRC_VERSION.src/
|
||||
@@ -24,6 +33,9 @@ build() {
|
||||
# as cc and ld to function. Because of this, we enable
|
||||
# LLVM_INSTALL_BINUTILS_SYMLINKS and LLVM_INSTALL_CCTOOLS_SYMLINKS for
|
||||
# compatibility's sake. ~ahill
|
||||
# NOTE: LLVM uses the GNUInstallDirs module to determine where to write
|
||||
# files. ~ahill
|
||||
# See also: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
|
||||
cmake -B build -S llvm \
|
||||
-DCLANG_DEFAULT_CXX_STDLIB=libc++ \
|
||||
-DCLANG_DEFAULT_LINKER=lld \
|
||||
@@ -31,11 +43,12 @@ build() {
|
||||
-DCLANG_DEFAULT_UNWINDLIB=libunwind \
|
||||
-DCLANG_VENDOR=Maple \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_DOCDIR=usr/share/doc \
|
||||
-DCMAKE_INSTALL_DATAROOTDIR=$(echo $TT_DATADIR | cut -c 2-) \
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=$(echo $TT_INCLUDEDIR | cut -c 2-) \
|
||||
-DCMAKE_INSTALL_LIBEXECDIR=$(echo $TT_LIBDIR | cut -c 2-) \
|
||||
-DCMAKE_INSTALL_MANDIR=usr/share/man \
|
||||
-DCMAKE_INSTALL_PREFIX=$TT_INSTALLDIR \
|
||||
-DCMAKE_INSTALL_RUNSTATEDIR=$(echo $TT_RUNDIR | cut -c 2-) \
|
||||
-DCMAKE_INSTALL_SBINDIR=$(echo $TT_BINDIR | cut -c 2-) \
|
||||
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF \
|
||||
-DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \
|
||||
-DLIBCXX_CXX_ABI=libcxxabi \
|
||||
@@ -58,4 +71,11 @@ build() {
|
||||
ln -sf clang $TT_INSTALLDIR/bin/cc
|
||||
ln -sf clang++ $TT_INSTALLDIR/bin/c++
|
||||
ln -sf ld.lld $TT_INSTALLDIR/bin/ld
|
||||
# NOTE: Finally, LLVM really doesn't play nice with its own rules. If I tell
|
||||
# it to install in a certain directory, it *might* listen to me. This
|
||||
# takes care of all the stuff it didn't install correctly. ~ahill
|
||||
mv $TT_INSTALLDIR/include/* $TT_INSTALLDIR/usr/include/
|
||||
rm -rf $TT_INSTALLDIR/include
|
||||
mv $TT_INSTALLDIR/share/* $TT_INSTALLDIR/usr/share/
|
||||
rm -rf $TT_INSTALLDIR/share
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user