repo/extra/mold/build
Dylan Araps 970b16ac31
mold: 0.9.3
See the README file.

---

READMEs like this one are something I want to add to each package.
This solves the lack of a description for each package as well as
the disconnect between Wiki pages and the software itself.

The website can leverage these files to provide full documentation
for each package. This will also make 'kiss help <pkg>' work.
2021-08-15 08:26:16 +03:00

27 lines
867 B
Bash
Executable File

#!/bin/sh -e
#
# This build system is a little funky. I want to contribute upstream to get the
# whole thing buildable with Makefiles (no Cmake).
make -C xxhash
# Point mold to the local xxhash.
export CXXFLAGS="-L$PWD/xxhash -I$PWD/xxhash $CXXFLAGS"
# Prevent the build system from overwriting CC/CXX.
sed /clang/d Makefile > _
mv -f _ Makefile
# CMAKE_GENERATOR must be set to force usage of Makefiles. The build system
# calls cmake and proceeds to assume that Makefiles will be used with it.
make CMAKE_GENERATOR= LDFLAGS="$LDFLAGS -static"
make install
# Create a symbolic link so users can use mold as the linker system-wide
# (without need for special CFLAGS/CXXFLAGS).
ln -s mold "$1/usr/bin/ld"
# To tell GCC to use mold we must put a symlink to it in a directory and set it
# to search for the linker within.
ln -s ../../bin/mold "$1/usr/lib/mold/ld"