Headers and libraries also archived
[harbours.git] / gcc / gcc.template
blob4acf5fceab792ba816b1958d458f86e931eb2cad
1 #!/bin/sh
3 run_it() {
4 # echo "[GCC $PWD]:" "$@"
5 exec "$@"
8 # These will be replaced by m4
9 cross_cc="CROSS_CC"
10 ppflags="PPFLAGS -D__helenos__"
11 cflags="CFLAGS"
12 ldflags="LDFLAGS"
14 running_pp=false
15 running_ld=false
16 running_cc=false
18 # Guess what is actually running...
19 for flag in "$@"; do
20 case "$flag" in
21 -E) running_pp=true ;;
22 -c) running_cc=true ;;
23 *) ;;
24 esac
25 done
27 # ...and pass the correct flags
28 if $running_pp; then
29 run_it $cross_cc $ppflags "$@"
30 elif $running_cc; then
31 run_it $cross_cc $ppflags $cflags "$@"
32 else
33 run_it $cross_cc $ppflags $cflags "$@" $ldflags