check-exports 667 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. #
  3. # This test checks that libjansson.so exports the correct symbols.
  4. #
  5. SOFILE="../src/.libs/libjansson.so"
  6. # The list of symbols, which the shared object should export, is read
  7. # from the def file, which is used in Windows builds
  8. grep 'json_' $top_srcdir/src/jansson.def \
  9. | sed -e 's/ //g' \
  10. | sort \
  11. >$test_log/exports
  12. nm -D $SOFILE >/dev/null >$test_log/symbols 2>/dev/null \
  13. || exit 77 # Skip if "nm -D" doesn't seem to work
  14. grep ' [DT] ' $test_log/symbols | cut -d' ' -f3 | grep -v '^_' | sort >$test_log/output
  15. if ! cmp -s $test_log/exports $test_log/output; then
  16. diff -u $test_log/exports $test_log/output >&2
  17. exit 1
  18. fi