diff options
Diffstat (limited to 'src/tools/zcc')
| -rwxr-xr-x | src/tools/zcc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/zcc b/src/tools/zcc index 19904ea..3fb8f0c 100755 --- a/src/tools/zcc +++ b/src/tools/zcc @@ -22,7 +22,7 @@ while [ $# -gt 0 ]; do case "$1" in -o) [ $# -ge 2 ] || { echo "zcc: -o needs a name" >&2; exit 2; }; out="$2"; shift 2 ;; -k) keep=1; shift ;; - -h|--help) sed -n '2,15p' "$0"; exit 0 ;; + -h|--help) printf '%s\n' 'usage: src/tools/zcc [-o OUT] [-k] FILE.zc' 'compiles a source file into a standalone binary; links statically where supported.' 'options:' ' -o OUT output binary path; defaults to the source basename without .zc' ' -k keep the temporary build directory' ' --help, -h show this help and exit' 'environment: CC selects the c compiler; CFLAGS adds compiler flags.'; exit 0 ;; -*) echo "zcc: unknown option $1" >&2; exit 2 ;; *) break ;; esac @@ -49,6 +49,6 @@ if ! printf 'int main(void){return 0;}\n' | $CC -x c -static -o "$work/probe" - static="" echo "zcc: this toolchain cannot link -static; the binary is dynamic" >&2 fi -$CC -O2 -w -fwrapv ${CFLAGS:-} $static "$work/run/micro.c" "$work/run/port_linux.c" \ +$CC -O2 -w -fwrapv -pthread -DZY_THREADS ${CFLAGS:-} $static "$work/run/micro.c" "$work/run/port_linux.c" \ -I"$work/run" -o "$out" echo "zcc: wrote $out ($(wc -c < "$out" | tr -d ' ') bytes)" |
