symbols.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. #
  3. # Run this script in a directory that contains a valid SQLite makefile in
  4. # order to verify that unintentionally exported symbols.
  5. #
  6. make sqlite3.c
  7. echo '****** Exported symbols from a build including RTREE, FTS4 & FTS5 ******'
  8. gcc -c -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE \
  9. -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_STAT3 \
  10. -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_UNLOCK_NOTIFY \
  11. -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_ATOMIC_WRITE \
  12. -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_SESSION \
  13. -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY \
  14. sqlite3.c
  15. nm sqlite3.o | grep ' [TD] ' | sort -k 3
  16. echo '****** Surplus symbols from a build including RTREE, FTS4 & FTS5 ******'
  17. nm sqlite3.o | grep ' [TD] ' |
  18. egrep -v ' .*sqlite3(session|rebaser|changeset|changegroup)?_'
  19. echo '****** Dependencies of the core. No extensions. No OS interface *******'
  20. gcc -c -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_STAT3 \
  21. -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_UNLOCK_NOTIFY \
  22. -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_ATOMIC_WRITE \
  23. -DSQLITE_OS_OTHER -DSQLITE_THREADSAFE=0 \
  24. sqlite3.c
  25. nm sqlite3.o | grep ' U ' | sort -k 3
  26. echo '****** Dependencies including RTREE & FTS4 *******'
  27. gcc -c -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE \
  28. -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_STAT3 \
  29. -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_UNLOCK_NOTIFY \
  30. -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_ATOMIC_WRITE \
  31. sqlite3.c
  32. nm sqlite3.o | grep ' U ' | sort -k 3