lddcheck 489 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. if [ -z "$1" ]; then
  3. exit 0
  4. fi
  5. libtool="$1"; shift
  6. input="$1"; shift
  7. output="$1"; shift
  8. case "$input" in #((
  9. *.la)
  10. . "$input"
  11. if test -z "$dlname"; then
  12. exit 0
  13. fi
  14. real=$(dirname "$input")"/.libs/$dlname"
  15. if ldd -r "$real" | c++filt | grep "undefined symbol"; then
  16. exit 1
  17. fi
  18. ;;
  19. *)
  20. if "${libtool}" --mode=execute ldd -r "$input" | c++filt | \
  21. grep "undefined symbol"; then
  22. exit 1
  23. fi
  24. ;;
  25. esac
  26. if test -n "$output"; then
  27. >"$output"
  28. fi
  29. exit 0