aboutsummarylogtreecommitdiffstats
path: root/mold.sh.in
blob: f4a0ef99c9f4b189f5591b0390e6fa41a02fe205 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/bash
#
#   mold.sh - Compile with the fast mold linker
#

[[ -n "$LIBMAKEPKG_BUILDENV_MOLD_SH" ]] && return
LIBMAKEPKG_BUILDENV_MOLD_SH=1

LIBRARY=${LIBRARY:-'/usr/share/makepkg'}

source "$LIBRARY/util/option.sh"

build_options+=('mold')
buildenv_functions+=('buildenv_mold')

buildenv_mold() {
  if
  check_buildoption "mold" "y"; then
	LDFLAGS="${LDFLAGS} -fuse-ld=mold"
  fi
}