1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/cmd/INIT/cc.darwin
Martijn Dekker a638e724d0 INIT/cc.darwin: revert inadvertent change in SHOPT_SPAWN
(cherry picked from commit def69c3315d1d357b3e067a186913991ea2abdf3)
2020-06-12 01:45:14 +02:00

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