cross-do 838 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env bash
  2. cross_log=cross_build_$$.log
  3. enabled_log=${LOG}
  4. # if the target architecture is different from the host,
  5. # TARGET_ARCH must be set to one of ['ia32', 'x86_64', 'arm', 'mips']
  6. # export TARGET_ARCH='arm'
  7. export CROSS=${CROSS_COMPILE}
  8. export CC=${CROSS}gcc
  9. export AR=${CROSS}ar
  10. export RANLIB=${CROSS}ranlib
  11. export CFLAGS=${CROSS_CFLAGS}
  12. export LDFLAGS=${CROSS_LDFLAGS}
  13. gcc_version=$(${CC} --version)
  14. log_filename="${cross_log%.*}"
  15. echo Using $gcc_version
  16. rm -rf build_*
  17. if [ "x$enabled_log" == "x1" ]; then
  18. echo Compiler CC: $CC > $cross_log
  19. echo Compiler CFLAGS: $CFLAGS >> $cross_log
  20. echo Compiler LDFLAGS: $LDFLAGS >> $cross_log
  21. time ./do >> $cross_log 2>&1
  22. mv cjdroute ${log_filename}_cjdroute
  23. else
  24. echo Compiler CC: $CC
  25. echo Compiler CFLAGS: $CFLAGS
  26. echo Compiler LDFLAGS: $LDFLAGS
  27. time ./do
  28. fi