// A single compiler name for build systems such as libtool that independently // expand CC and its arguments. Repeating musl's specs option makes GCC fail. module main import os fn main() { root := os.getenv('VPAC_MAKEPKG_ROOT') if !os.is_abs_path(root) { eprintln('vinix-cc requires an absolute VPAC_MAKEPKG_ROOT') exit(1) } specs := os.join_path(root, 'usr/lib/musl-gcc-sysroot.specs') if !os.is_file(specs) { eprintln('vinix-cc: missing installed musl specs at ${specs}') exit(1) } compiler := os.getenv_opt('VINIX_REAL_CC') or { 'gcc' } mut args := ['--sysroot=${root}', '-specs=${specs}'] args << os.args[1..] os.execvp(compiler, args) or { eprintln('vinix-cc: ${compiler}: ${err}') exit(1) } }