Files
UniXNU/scripts/linux/install
T
smeng9andClaude Opus 5.5 6dc20ebe08 build(linux): install the kernel step toolchain on a Linux host
scripts/linux/setup-toolchain.py, run once as root, builds into
/opt/unixnu-linux (or PREFIX, or $UNIXNU_TOOLCHAIN):

- clang from llvm-project 58c46bae2118 with llvm-xnu-builtin-type.patch,
  which adds __builtin_xnu_type_signature, __builtin_xnu_type_summary,
  __builtin_xnu_types_compatible and xnu_usage_semantics; kalloc.h uses
  the builtins with no fallback;
- cctools-port 1030.6.3-ld64-956.6 (its master, ld64-609, corrupts the
  kernel link), with libdispatch for ld64;
- mig and migcom from bootstrap_cmds-138;
- iig-port, with iig-port-darwin-target.patch;
- xnu-host-cc, the host compiler for xnu's SETUP tools;
- lzfse for the kernelcache.

It installs the Command Line Tools shims (clang, clang++, cc, install,
gm4) under the prefix and xcrun, plutil and codesign in /usr/bin, where
xnu's makefiles call them. libmacho.a and libstuff.a go to /usr/lib and
libdispatch to /usr/local. Each step is skipped when its output exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:48:06 +08:00

17 lines
696 B
Bash
Executable File

#!/bin/bash
# install(1) shim: BSD install, which is what xnu's makefiles assume.
# libkern/libkern/Makefile calls plain `install $(DATA_INSTALL_FLAGS) $< $@`
# with DATA_INSTALL_FLAGS = "-c -S -m 0644". GNU install reads -S as
# "--suffix=<arg>" and swallows the -m, so the copy fails. Drop the BSD-only
# flags and hand the rest to GNU install.
args=()
while [ $# -gt 0 ]; do
case "$1" in
-S|-c) shift ;; # BSD: safe-copy / copy (GNU default)
-p) shift ;; # BSD: preserve mtime
-b|-C) shift ;; # BSD: backup / compare-then-copy
*) args+=("$1"); shift ;;
esac
done
exec /usr/bin/install "${args[@]}"