starpu_check_macros.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. #
  3. # StarPU --- Runtime system for heterogeneous multicore architectures.
  4. #
  5. # Copyright (C) 2016, 2017 CNRS
  6. #
  7. # StarPU is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU Lesser General Public License as published by
  9. # the Free Software Foundation; either version 2.1 of the License, or (at
  10. # your option) any later version.
  11. #
  12. # StarPU is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. #
  16. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. dirname=$(dirname $0)
  18. INC_DIRS=$(find $dirname/../../../ -name include -type d)
  19. STARPU_H_FILES=$(find $INC_DIRS -name '*.h')
  20. STARPU_CONFIG=$dirname/../../../include/starpu_config.h.in
  21. STARPU_CONFIG_DISPLAY=$(python -c "import os.path; print os.path.relpath('$STARPU_CONFIG', '.')")
  22. macros1=$(grep 'ifdef' $STARPU_H_FILES|grep STARPU|awk '{print $NF}')
  23. macros2=$(grep defined $STARPU_H_FILES | tr ' (' '\012' | grep STARPU | sed 's/defined//' | tr -d '()!,')
  24. macros=$(echo $macros1 $macros2 | tr ' ' '\012' | sort | uniq)
  25. for m in $macros
  26. do
  27. count=$(grep -c $m $STARPU_CONFIG)
  28. if test "$count" -eq "0"
  29. then
  30. echo $m missing in $STARPU_CONFIG_DISPLAY
  31. fi
  32. done