mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
55 lines
859 B
Text
Executable file
55 lines
859 B
Text
Executable file
: unix wrapper for macOS cc : 2020-05-13 :
|
|
|
|
HOSTTYPE=darwin.generic
|
|
|
|
case " $* " in
|
|
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
|
esac
|
|
|
|
CC=/usr/bin/cc
|
|
op=init
|
|
for arg
|
|
do case $op in
|
|
init) op=ld
|
|
set ''
|
|
;;
|
|
esac
|
|
case $arg in
|
|
-c) op=cc
|
|
;;
|
|
-E) op=cpp
|
|
continue
|
|
;;
|
|
-G) op=dll
|
|
continue
|
|
;;
|
|
-lc) continue
|
|
;;
|
|
-lm) continue
|
|
;;
|
|
-O) arg='-Os' # default to small code: Apple compiles its /bin/ksh with -Os
|
|
;;
|
|
esac
|
|
set "$@" "$arg"
|
|
done
|
|
case $# in
|
|
0) ;;
|
|
*) shift ;;
|
|
esac
|
|
case $* in
|
|
-v) $CC "$@"; exit ;;
|
|
esac
|
|
case $op in
|
|
init) echo "cc: arguments expected" >&2
|
|
exit 1
|
|
;;
|
|
cpp) $CC -E "$@"
|
|
;;
|
|
cc) $CC -DSHOPT_SPAWN=0 -D_ast_int8_t=int64_t -D_lib_memccpy \
|
|
-Wno-unused-value -Wno-parentheses -Wno-macro-redefined "$@"
|
|
;;
|
|
dll) $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@"
|
|
;;
|
|
ld) $CC -Wl,-search_paths_first "$@"
|
|
;;
|
|
esac
|