You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 line
1.2 KiB

  1. #!/bin/sh
  2. ret=0
  3. #
  4. # Check that the Win32 config.h is in sync with config.h.in
  5. #
  6. config_h_in=$(dirname "$0")/../config.h.in
  7. win32_config_h=$(dirname "$0")/../win32/config.h
  8. failure=0
  9. for key in $(sed -ne 's/.*#undef *\([A-Za-z0-9_]*\).*/\1/p' "$config_h_in");
  10. do
  11. if ! grep '[ef] \<'"$key"'\>' "$win32_config_h" >/dev/null 2>&1; then
  12. echo "error: $key missing from win32/config.h"
  13. failure=1
  14. fi
  15. done
  16. if test "$failure" != "0"; then
  17. ret=1
  18. else
  19. echo "0 errors in Win32 config.h"
  20. fi
  21. #
  22. # Check that we have no tabs or trailing spaces in the source code
  23. #
  24. failure=0
  25. for dir in caca cxx examples ruby tools; do
  26. pushd ../$dir >/dev/null
  27. # Dirty hack to print the $(SOURCES) variable
  28. for x in $(make -s ID SHELL='echo @@$(SOURCES)@@' | tr -d '\n' | sed 's/.*@@\([^@]*\)@@.*/\1/');
  29. do
  30. if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then
  31. echo "error: $dir/$x contains trailing spaces"
  32. failure=1
  33. fi
  34. if grep ' ' "$x" >/dev/null 2>&1; then
  35. echo "error: $dir/$x contains tabs"
  36. failure=1
  37. fi
  38. done
  39. popd >/dev/null
  40. done
  41. if test "$failure" != "0"; then
  42. ret=1
  43. else
  44. echo "0 errors in source code"
  45. fi
  46. if test "$ret" != "0"; then
  47. exit 1
  48. fi
  49. exit 0