/chromium-webcl/src/third_party/talloc/script/abi_checks.sh

https://bitbucket.org/peixuan/chromium_r197479_base · Shell · 80 lines · 38 code · 14 blank · 28 comment · 6 complexity · aaed3dd9ed261747a07ba36435113e0f MD5 · raw file

  1. #!/bin/sh
  2. #
  3. # abi_checks.sh - check for possible abi changes
  4. #
  5. # Copyright (C) 2009 Michael Adam <obnox@samba.org>
  6. #
  7. # This program is free software; you can redistribute it and/or modify it
  8. # under the terms of the GNU General Public License as published by the Free
  9. # Software Foundation; either version 3 of the License, or (at your option)
  10. # any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful, but WITHOUT
  13. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. # more details.
  16. #
  17. # You should have received a copy of the GNU General Public License along with
  18. # this program; if not, see <http://www.gnu.org/licenses/>.
  19. #
  20. #
  21. # USAGE: abi_checks.sh LIBNAME header1 [header2 ...]
  22. #
  23. # This script creates symbol and signature lists from the provided header
  24. # files with the aid of the mksyms.sh and mksigs.pl scripts (saved as
  25. # $LIBNAME.exports.check and $LIBNAME.sigatures.check). It then compares
  26. # the resulting files with the files $LIBNAME.exports and $LIBNME.signatures
  27. # which it expects to find in the current directory.
  28. #
  29. LANG=C; export LANG
  30. LC_ALL=C; export LC_ALL
  31. LC_COLLATE=C; export LC_COLLATE
  32. exit_status=0
  33. script=$0
  34. dir_name=$(dirname ${script})
  35. if test x"$1" = "x" ; then
  36. echo "USAGE: ${script} libname header [header ...]"
  37. exit 1
  38. fi
  39. libname="$1"
  40. shift
  41. if test x"$1" = "x" ; then
  42. echo "USAGE: ${script} libname header [header ...]"
  43. exit 1
  44. fi
  45. headers="$*"
  46. exports_file=${libname}.exports
  47. exports_file_check=${exports_file}.check
  48. signatures_file=${libname}.signatures
  49. signatures_file_check=${signatures_file}.check
  50. ${dir_name}/mksyms.sh awk ${exports_file_check} ${headers} 2>&1 > /dev/null
  51. cat ${headers} | ${dir_name}/mksigs.pl | sort| uniq > ${signatures_file_check} 2> /dev/null
  52. diff -u ${exports_file} ${exports_file_check}
  53. if test "x$?" != "x0" ; then
  54. echo "WARNING: possible ABI change detected in exports!"
  55. let exit_status++
  56. else
  57. echo "exports check: OK"
  58. fi
  59. diff -u ${signatures_file} ${signatures_file_check}
  60. if test "x$?" != "x0" ; then
  61. echo "WARNING: possible ABI change detected in signatures!"
  62. let exit_status++
  63. else
  64. echo "signatures check: OK"
  65. fi
  66. exit $exit_status