summaryrefslogtreecommitdiff
path: root/bootstrap.sh
diff options
context:
space:
mode:
authorAlexander Hill <ahill@breadpudding.dev>2025-11-16 20:08:27 -0500
committerAlexander Hill <ahill@breadpudding.dev>2025-11-16 20:08:27 -0500
commita4c9aa19c75bcc57be72cf82df9978cadaee5051 (patch)
tree53441e84c791e721d1f2578b84f1bf4de0c79796 /bootstrap.sh
parent9772d7f49dbef2178379ac912ee31e6cf9684f1f (diff)
Bootstrapped GNU Make and added LibreSSL
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-xbootstrap.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
index 9210ddd..8011690 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -184,6 +184,10 @@ export CXXFLAGS="$CXXFLAGS -isystem $BOOTSTRAP/root/usr/include/c++/v1 -nostdinc
# NOTE: We're using sed to remove newlines instead of dirname's own -z switch
# because -z adds a null byte, which messes with the files generated by
# LLVM's build process. ~ahill
+# NOTE: Many build scripts still rely on the old Unix names for tools such 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
NATIVE_TOOL_DIR=$(dirname $(which llvm-tblgen) | sed -z "s/\n//g")
cd llvm-project-*/
cmake -S llvm -B build-llvm \
@@ -200,6 +204,8 @@ cmake -S llvm -B build-llvm \
-DLLVM_ENABLE_PROJECTS="clang;lld;llvm" \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_HOST_TRIPLE=$TARGET \
+ -DLLVM_INSTALL_BINUTILS_SYMLINKS=ON \
+ -DLLVM_INSTALL_CCTOOLS_SYMLINKS=ON \
-DLLVM_NATIVE_TOOL_DIR=$NATIVE_TOOL_DIR \
-DLLVM_TABLEGEN=$NATIVE_TOOL_DIR/llvm-tblgen
cmake --build build-llvm
@@ -227,5 +233,26 @@ make -O -j $PROCS
make -O -j $PROCS install CONFIG_PREFIX=$BOOTSTRAP/root
cd ..
+# Build Make
+MAKE_VERSION=$(sed -En "s/SRC_VERSION=\"?(.+)\"/\1/p" $SPEC/make/make.spec)
+tar xf $SOURCES/make/$MAKE_VERSION/make-*.tar*
+cd make-*/
+./configure \
+ --bindir=/bin \
+ --datarootdir=/usr/share \
+ --enable-year2038 \
+ --host=$TARGET \
+ --includedir=/usr/include \
+ --libdir=/lib \
+ --libexecdir=/lib \
+ --localstatedir=/var \
+ --prefix=/ \
+ --runstatedir=/run \
+ --sbindir=/bin \
+ --sysconfdir=/etc
+make -O -j $PROCS
+make -O -j $PROCS install DESTDIR=$BOOTSTRAP/root
+cd ..
+
# Install Treetap
cp $BOOTSTRAP/../treetap $BOOTSTRAP/root/bin/ \ No newline at end of file