system_test.sh 746 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. # Copyright 2020-2022 Yury Gribov
  3. #
  4. # Use of this source code is governed by MIT license that can be
  5. # found in the LICENSE.txt file.
  6. #
  7. # Wrapper for ld which automatically calls implib-gen.
  8. # To enable, add it to PATH.
  9. # Flags are passed via env variable IMPLIBSO_LD_OPTIONS.
  10. # Runs implib-gen on all installed libraries
  11. set -eu
  12. if test "${1:-}" != noscan; then
  13. rm -f libs.txt
  14. for lib in $(find /lib /usr/lib /usr/local/lib -name \*.so\*); do
  15. if file $lib | grep -q 'ELF .* LSB shared object'; then
  16. echo $lib >> libs.txt
  17. fi
  18. done
  19. fi
  20. for lib in $(cat libs.txt); do
  21. echo "Checking $lib..."
  22. ./implib-gen.py -q --vtables $lib
  23. name=$(basename $lib)
  24. gcc -Wall -Wextra -Werror -c $name*.[cS]
  25. rm $name*
  26. done