run_stage.sh 763 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. set -xe
  3. export RAW_CFLAGS="$CFLAGS"
  4. export RAW_CXXFLAGS="$CXXFLAGS"
  5. export RAW_LDFLAGS="$LDFLAGS"
  6. [[ -n "$STAGE_CFLAGS" ]] && export CFLAGS="$CFLAGS $STAGE_CFLAGS"
  7. [[ -n "$STAGE_CXXFLAGS" ]] && export CXXFLAGS="$CXXFLAGS $STAGE_CXXFLAGS"
  8. [[ -n "$STAGE_LDFLAGS" ]] && export LDFLAGS="$LDFLAGS $STAGE_LDFLAGS"
  9. if [[ -n "$STAGENAME" && -f /cache.tar.xz ]]; then
  10. mkdir -p "/$STAGENAME"
  11. tar xaf /cache.tar.xz -C "/$STAGENAME"
  12. cd "/$STAGENAME"
  13. elif [[ -n "$STAGENAME" ]]; then
  14. mkdir -p "/$STAGENAME"
  15. cd "/$STAGENAME"
  16. fi
  17. git config --global --add safe.directory "$PWD"
  18. source "$1"
  19. if [[ -z "$2" ]]; then
  20. ffbuild_dockerbuild
  21. else
  22. "$2"
  23. fi
  24. rm -rf "$FFBUILD_PREFIX"/bin
  25. if [[ -n "$STAGENAME" ]]; then
  26. rm -rf "/$STAGENAME"
  27. fi