gcc_version_test.sh 851 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. # test make cfg with all the gcc versions in gcc_versions.txt
  3. # should be run from the main sip-router directory
  4. # Depends on: test/gcc_version.sh and test/gcc_versions.txt
  5. if [ ! -e test/gcc_version.sh -o ! -r test/gcc_versions.txt -o ! -r Makefile ]
  6. then
  7. echo "ERROR: wrong path, this test must be run from the main"\
  8. " sip-router directory"
  9. exit 1
  10. fi
  11. while read v ; do
  12. GCC_VERSION=$v make CC=test/gcc_version.sh cfg-defs >/dev/null
  13. if [ $? -ne 0 -o ! -r config.mak ]; then
  14. echo "ERROR: make cfg failed for version \"$v\""
  15. exit 1
  16. fi
  17. COMPILER=`egrep -o -- "-DCOMPILER='\"[^\"' ]+ [2-9]\.[0-9]{1,2}(\.[0-9]{1,2})?\"'" config.mak`
  18. if [ $? -ne 0 -o -z "$COMPILER" ]; then
  19. echo "ERROR: bad ver: \"$v\" => `egrep -o -- "-DCOMPILER='[^']*'" config.mak`"
  20. exit 1
  21. fi
  22. echo "ok: \"$v\" => $COMPILER"
  23. done < test/gcc_versions.txt