#!/bin/sh
# clang cross-compiler front for ZETA (BeOS x86, gcc2-ABI-compatible C)
H=$HOME/Desktop/ZetaNetSurf/hdr_cs
RES=$(clang -print-resource-dir)/include
[ -d $H/posix ] || hdiutil attach $HOME/Desktop/ZetaNetSurf/hdr_cs.sparsebundle -mountpoint $H >/dev/null 2>&1
exec clang --target=i386-unknown-elf -march=pentium -mno-sse -mno-mmx -mno-sse2 \
  -fPIC -Wa,-mrelax-relocations=no -Xclang -mrelax-relocations=no -fno-stack-protector -fno-asynchronous-unwind-tables -fno-unwind-tables \
  -fshort-wchar -fgnu89-inline -fno-builtin-printf -nostdinc -isystem $H/overlay -isystem $RES -isystem $H/posix -isystem $H -isystem $H/be -isystem $H/be/bone -isystem $H/be/kernel -isystem $H/be/support -isystem $H/extra \
  -include $H/zns_prefix.h -D__BEOS__ -D__INTEL__ -Wno-unknown-warning-option -Wno-error \
  -Wno-implicit-function-declaration -Wno-int-conversion -Wno-incompatible-pointer-types \
  "$@" -g0
