1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/musl/musl.conf
3 # Copyright (C) 2018 - 2021 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2.
10 # --- T2-COPYRIGHT-NOTE-END ---
12 if atstage toolchain; then
13 var_append confopt ' ' '--prefix=$sysroot --includedir=$sysroot$includedir'
14 var_remove_regex confopt ' ' '--host=.*' # overrides --target=, ..!
16 var_remove makeinstopt ' ' 'install'
17 var_append makeinstopt ' ' 'install-headers'
20 [ "$SDECFG_X8664_X32" = 1 ] && var_append patchfiles ' ' "$confdir/*.patch.x32"
22 function musl_postinstall() {
23 # Musl's dynamic linker comes with ldd functionality built in
24 # so just create a symlink from ld-musl-...
25 # TODO: fix linker to use $libdir (lib64)
26 local cpu=`echo $arch | arch2uname`
27 [ "$SDECFG_X8664_X32" = 1 ] && cpu=x32
28 ln -sfv ../../lib/ld-musl-$cpu.so.1 $root$bindir/ldd
32 local slibdir="${libdir##*/}"
33 if [ $slibdir != lib ]; then
34 cat > ld-musl.path <<-EOT
47 cat > ld-musl.path <<-EOT
55 mv -vf ld-musl.path $root/etc/ld-musl-$cpu.path
57 # for binutils to find the non /usr paths, TODO: patch binutils!
58 ln -svf ld-musl-$cpu.path $root/etc/ld.so.conf
61 hook_add premake 5 'touch include/{*/,}* arch/*/bits/*.h'
62 hook_add postinstall 5 'musl_postinstall'