Mercurial > hg > aboriginal
annotate sources/sections/ccwrap.sh @ 1664:35b8949e9d9c
Very basic musl support. Still needs debugging and to be enabled per-target.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 02 Jul 2014 20:05:36 -0500 |
parents | c5b158bdaa3f |
children | a87931846137 |
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 |
1664
35b8949e9d9c
Very basic musl support. Still needs debugging and to be enabled per-target.
Rob Landley <rob@landley.net>
parents:
1489
diff
changeset
|
10 mkdir -p "$STAGE_DIR/bin" && |
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
|
11 "$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
|
12 -o "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cc" $STATIC_FLAGS && |
1664
35b8949e9d9c
Very basic musl support. Still needs debugging and to be enabled per-target.
Rob Landley <rob@landley.net>
parents:
1489
diff
changeset
|
13 echo -e "#!/bin/bash\n\n${TOOLCHAIN_PREFIX}cc -E "'"$@"' \ |
35b8949e9d9c
Very basic musl support. Still needs debugging and to be enabled per-target.
Rob Landley <rob@landley.net>
parents:
1489
diff
changeset
|
14 > "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cpp" && |
35b8949e9d9c
Very basic musl support. Still needs debugging and to be enabled per-target.
Rob Landley <rob@landley.net>
parents:
1489
diff
changeset
|
15 chmod +x "$STAGE_DIR/bin/${TOOLCHAIN_PREFIX}cpp" || dienow |