Mercurial > hg > aboriginal
changeset 782:5c6ebb711b72
Check for both prerequisite compilers of a canadian cross, and use $ARCH-cc instead of $ARCH-gcc more.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 05 Jul 2009 17:30:01 -0500 |
parents | d8c780ed3686 |
children | db06a8c1bfed |
files | root-filesystem.sh |
diffstat | 1 files changed, 13 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/root-filesystem.sh Sat Jul 04 20:31:32 2009 -0500 +++ b/root-filesystem.sh Sun Jul 05 17:30:01 2009 -0500 @@ -14,11 +14,14 @@ # Die if our prerequisite isn't there. -if [ -z "$(which "$ARCH-cc")" ] -then - [ -z "$FAIL_QUIET" ] && echo No "$ARCH-cc" in '$PATH'. >&2 - exit 1 -fi +for i in "$ARCH" "$FROM_ARCH" +do + if [ -z "$(which "${i}-cc")" ] + then + [ -z "$FAIL_QUIET" ] && echo No "${i}-cc" in '$PATH'. >&2 + exit 1 + fi +done # Announce start of stage. @@ -183,7 +186,7 @@ # build and install gcc wrapper script. mv "${TOOLS}/bin/${PROGRAM_PREFIX}gcc" "${TOOLS}/bin/${PROGRAM_PREFIX}rawgcc" && -"${FROM_ARCH}-gcc" "${SOURCES}"/toys/ccwrap.c -Os -s \ +"${FROM_ARCH}-cc" "${SOURCES}"/toys/ccwrap.c -Os -s \ -o "${TOOLS}/bin/${PROGRAM_PREFIX}gcc" -DGIMME_AN_S $STATIC_FLAGS \ -DGCC_UNWRAPPED_NAME='"'"${PROGRAM_PREFIX}rawgcc"'"' && @@ -280,7 +283,7 @@ # Build and install make setupfor make -CC="${ARCH}-gcc" ./configure --prefix="${TOOLS}" --build="${CROSS_HOST}" \ +CC="${ARCH}-cc" ./configure --prefix="${TOOLS}" --build="${CROSS_HOST}" \ --host="${CROSS_TARGET}" && make -j $CPUS && make -j $CPUS install && @@ -300,7 +303,7 @@ bash_cv_have_mbstate_t=yes bash_cv_getenv_redef=no EOF -CC="${ARCH}-gcc" RANLIB="${ARCH}-ranlib" ./configure --prefix="${TOOLS}" \ +CC="${ARCH}-cc" RANLIB="${ARCH}-ranlib" ./configure --prefix="${TOOLS}" \ --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --cache-file=config.cache \ --without-bash-malloc --disable-readline && # note: doesn't work with -j @@ -330,8 +333,8 @@ # Put statically and dynamically linked hello world programs on there for # test purposes. -"${ARCH}-gcc" "${SOURCES}/toys/hello.c" -Os -s -o "${TOOLS}/bin/hello-dynamic" && -"${ARCH}-gcc" "${SOURCES}/toys/hello.c" -Os -s -static -o "${TOOLS}/bin/hello-static" +"${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os -s -o "${TOOLS}/bin/hello-dynamic" && +"${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os -s -static -o "${TOOLS}/bin/hello-static" [ $? -ne 0 ] && dienow