destatic.sh 638 B

12345678910111213141516
  1. # Simple script to make all static functions in the main source
  2. # unstatic. This allows backtracing functions (such as that used
  3. # in Memento, in particular on Android) to pick up symbol names
  4. # nicely.
  5. #
  6. # This script can be reversed using restatic.sh
  7. # Allow for the fact that mujs might not be present
  8. MUJS_SRC=
  9. test -d thirdparty/mujs && MUJS_SRC=thirdparty/mujs
  10. # Convert everything
  11. sed -i '/^static inline/b;/^static const/b;s!^static !/\*static \*/!' $(find source platform/android/viewer platform/java $MUJS_SRC -name '*.c')
  12. # Convert source/tools back again.
  13. sed -i 's!/\*static \*/!static !' $(find source/tools -name '*.c')