Changes in tools/xcw/bin/helenos-cc [b501de7:1b9a853] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/xcw/bin/helenos-cc
rb501de7 r1b9a853 32 32 # 33 33 34 35 34 36 XCW="$(dirname "$0")" 35 SRC_ROOT="$XCW/../../.."37 BUILD_ROOT="$(dirname "$(dirname "$(dirname "$XCW")")")" 36 38 if [ -z "$EXPORT_DIR" ]; then 37 EXPORT_DIR="$ SRC_ROOT/uspace/export"39 EXPORT_DIR="$BUILD_ROOT/export" 38 40 fi 39 UARCH="$("$XCW"/helenos-bld-config --uarch)"40 CC="$("$XCW"/helenos-bld-config --cc)"41 CFLAGS="$("$XCW"/helenos-bld-config --cflags)"42 ENDIAN="$("$XCW"/helenos-bld-config --endian)"43 41 44 echo helenos-cc "$@" 45 "$CC" \ 46 -O3 -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32LE -finput-charset=UTF-8 \ 47 $CFLAGS \ 48 -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \ 49 -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings -ggdb \ 50 -fno-omit-frame-pointer \ 51 -D "$ENDIAN" \ 52 "$@" \ 53 -I"$XCW"/../include \ 54 -I"$EXPORT_DIR"/include/libc \ 55 -I"$EXPORT_DIR"/include 42 HELENOS_EXPORT_ROOT="$EXPORT_DIR" 43 44 source "${EXPORT_DIR}/config.sh" 45 46 # CC is a compilation driver, so we should check which stage of compilation 47 # is actually running and select which flags to provide. This makes no 48 # difference for GCC, but e.g. clang warns when a flag is provided that is 49 # unused 50 51 needs_cflags=true 52 needs_ldflags=true 53 54 for flag in "$@"; do 55 case "$flag" in 56 -E) 57 needs_cflags=false 58 needs_ldflags=false 59 break 60 ;; 61 -c|-S) 62 needs_ldflags=false 63 break 64 ;; 65 esac 66 done 67 68 flags="-fwide-exec-charset=UTF-32LE -finput-charset=UTF-8 -fexec-charset=UTF-8" 69 flags="$flags -isystem ${HELENOS_EXPORT_ROOT}/include/libc -idirafter ${HELENOS_EXPORT_ROOT}/include" 70 71 if $needs_cflags; then 72 flags="$flags -O3 \ 73 -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \ 74 -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings -ggdb" 75 76 flags="$flags $HELENOS_CFLAGS" 77 fi 78 79 if $needs_ldflags; then 80 flags="$flags $HELENOS_LDFLAGS" 81 fi 82 83 flags="$flags $@" 84 85 if $needs_ldflags; then 86 flags="$flags $HELENOS_LDLIBS" 87 fi 88 89 echo "helenos-cc" "$@" 90 PATH="$HELENOS_CROSS_PATH:$PATH" "${HELENOS_TARGET}-gcc" $flags
Note:
See TracChangeset
for help on using the changeset viewer.