Mercurial > hg > aboriginal
annotate sources/sections/ccwrap.sh @ 1489:c5b158bdaa3f
Replace cpp with cc -E so it's funneled through ccwrap as well.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 22 Jan 2012 18:38:58 -0600 |
parents | a36e985f6198 |
children | 35b8949e9d9c |
rev | line source |
---|---|
1210
a36e985f6198
Untangle static vs cross for ccwrap section.
Rob Landley <rob@landley.net>
parents:
1207
diff
changeset
|
1 # build and install gcc wrapper |
905
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
1085
2e03f846b21e
Build ccwrap static unless BUILD_STATIC=none or we're doing the simple cross compiler.
Rob Landley <rob@landley.net>
parents:
981
diff
changeset
|
3 # Which compiler do we build the wrapper with, and should it be static? |
905
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 |
1210
a36e985f6198
Untangle static vs cross for ccwrap section.
Rob Landley <rob@landley.net>
parents:
1207
diff
changeset
|
5 [ "$BUILD_STATIC" == none ] && STATIC_FLAGS= || STATIC_FLAGS=--static |
a36e985f6198
Untangle static vs cross for ccwrap section.
Rob Landley <rob@landley.net>
parents:
1207
diff
changeset
|
6 [ -z "$HOST_ARCH" ] && TEMP="$CC" || TEMP="${HOST_ARCH}-cc" |
905
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 # Build wrapper binary |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 |
920
a69213462fbe
If "$CCWRAP" is quoted it gets passed in as a blank argument when empty, confusing the compiler.
Rob Landley <rob@landley.net>
parents:
918
diff
changeset
|
10 "$TEMP" "$SOURCES/toys/ccwrap.c" -Os $CFLAGS \ |
1489
c5b158bdaa3f
Replace cpp with cc -E so it's funneled through ccwrap as well.
Rob Landley <rob@landley.net>
parents:
1210
diff
changeset
|
11 -o "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cc" $STATIC_FLAGS && |
c5b158bdaa3f
Replace cpp with cc -E so it's funneled through ccwrap as well.
Rob Landley <rob@landley.net>
parents:
1210
diff
changeset
|
12 echo -e '#!/bin/bash\n\ncc -E "$@"' > "$STAGE_DIR/bin/cpp" && |
c5b158bdaa3f
Replace cpp with cc -E so it's funneled through ccwrap as well.
Rob Landley <rob@landley.net>
parents:
1210
diff
changeset
|
13 chmod +x "$STAGE_DIR/bin/cpp" || dienow |