From 93c9a1fd02da3c61c10c370b9abb12569105b24a Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 29 Dec 2019 00:55:51 +0100 Subject: [PATCH] update --- danio_gcc.sh | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/danio_gcc.sh b/danio_gcc.sh index 9c40c66..b0e5312 100755 --- a/danio_gcc.sh +++ b/danio_gcc.sh @@ -30,17 +30,17 @@ runit() fi case "${2}" in 64) - export CC="cc -m64" - export CXX="c++ -m64" ;; + export CC="${CROSS_COMPILE}gcc -m64" + export CXX="${CROSS_COMPILE}g++ -m64" ;; 32) - export CC="cc -m32" - export CXX="c++ -m32" ;; + export CC="${CROSS_COMPILE}gcc -m32" + export CXX="${CROSS_COMPILE}g++ -m32" ;; esac mkdir -pv out logs if echo "${glibc_version}" | grep -q "/"; then - export glibc_version_="`echo ${libc_version} | tr '/' '-'`" + export glibc_version_="`echo ${glibc_version} | tr '/' '-'`" else - export glibc_version_="${libc_version}" + export glibc_version_="${glibc_version}" fi #### TU NIE ZMIENIAJ ^^^ @@ -109,7 +109,7 @@ runit() strip_n_pack() { #find ${PREFIX} -type f -not -path *${TARGET}/${TARGET}/* | xargs file | grep "ELF" | cut -f 1 -d ":" | xargs strip -S --strip-unneeded #for host - find ${PREFIX} -type f | xargs file | grep "ELF" | cut -f 1 -d ":" | xargs strip -S --strip-unneeded #for host + find ${PREFIX} -type f | xargs file | grep "ELF" | cut -f 1 -d ":" | xargs ${CROSS_COMPILE}strip -S --strip-unneeded #for host find ${PREFIX}/${TARGET} -type f -name "*.a" | xargs ${TARGET}-strip -S --strip-unneeded #for sysroot find ${PREFIX}/${TARGET} -type f -name "*.a" | xargs ${TARGET}-ranlib #for sysroot find ${PREFIX}/${TARGET} -type f | xargs file | grep "ELF" | cut -f 1 -d ":" | xargs ${TARGET}-strip -S --strip-unneeded #for sysroot @@ -127,19 +127,6 @@ runit() fi fi } - test_gcc() - { - echo -n "int main(){return 0;}" >test.cpp - if ${TARGET}-g++ test.cpp -o test; then - echo "${TARGET}-g++ TEST PASSED" - rm -rf test{.cpp,} - return 0 - else - echo "${TARGET}-g++ TEST FAILED" - rm -rf test{.cpp,} - return 1 - fi - } if [ "${clean}" -ne "0" ]; then rm -rf build-* logs @@ -154,11 +141,6 @@ runit() echo "Error at \"build\" section" return 1 fi - if ! test_gcc; then - trap - EXIT - echo "Error at \"test_gcc\" section" - return 1 - fi if ! strip_n_pack ${2}; then trap - EXIT echo "Error at \"strip_n_pack ${2}\" section"