test-includes.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. # Test script to check uintptr_t and 64-bit types for warnings
  3. #
  4. # It builds a few boards with different toolchains. If there are no warnings
  5. # then all is well.
  6. #
  7. # Usage:
  8. #
  9. # Make sure that your toolchains are correct at the bottom of this file
  10. #
  11. # Then:
  12. # ./test/stdint/test-includes.sh
  13. out=/tmp/test-includes.tmp
  14. try_test() {
  15. local board=$1
  16. local arch=$2
  17. local soc=$3
  18. local gcc=$4
  19. local flags="$5"
  20. echo $@
  21. if ! which ${gcc} >/dev/null 2>&1; then
  22. echo "Not found: ${gcc}"
  23. return
  24. fi
  25. rm -rf ${out}
  26. mkdir -p ${out}
  27. touch ${out}/config.h
  28. mkdir -p ${out}/generated
  29. touch ${out}/generated/generic-asm-offsets.h
  30. mkdir -p ${out}/include/asm
  31. ln -s $(pwd)/arch/${arch}/include/asm/arch-${soc} \
  32. ${out}/include/asm/arch
  33. cmd="${gcc} -c -D__KERNEL__ ${flags} \
  34. -fno-builtin -ffreestanding \
  35. -Iarch/${arch}/include \
  36. -Iinclude \
  37. -I${out} -I${out}/include \
  38. -include configs/${board}.h test/stdint/int-types.c \
  39. -o /dev/null"
  40. $cmd
  41. }
  42. try_both() {
  43. try_test $@
  44. }
  45. # board arch soc path-to-gcc
  46. try_both sandbox sandbox - gcc
  47. try_both coreboot x86 - x86_64-linux-gnu-gcc
  48. try_both seaboard arm tegra20 /opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/bin/arm-linux-gnueabihf-gcc