build.sh 777 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. # -*- coding: utf-8 -*-
  3. basedir="$(realpath "$0" | xargs dirname)"
  4. info()
  5. {
  6. echo "--- $*"
  7. }
  8. error()
  9. {
  10. echo "=== ERROR: $*" >&2
  11. }
  12. warning()
  13. {
  14. echo "=== WARNING: $*" >&2
  15. }
  16. die()
  17. {
  18. error "$*"
  19. exit 1
  20. }
  21. [ -x "$basedir/setup.py" -a -f "$basedir/Cargo.toml" ] ||\
  22. die "basedir sanity check failed"
  23. cd "$basedir" || die "cd basedir failed."
  24. export CFLAGS="-O3 -pipe"
  25. export CPPFLAGS=
  26. export CXXFLAGS=
  27. python3 ./setup.py build || die "Python build failed."
  28. cargo update || die "Cargo update failed."
  29. cargo auditable build --release || die "Cargo build failed."
  30. cargo audit bin --deny warnings \
  31. target/release/cms-fsd \
  32. target/release/cms-cgi \
  33. target/release/cms-postd \
  34. || die "Cargo audit failed."
  35. # vim: ts=4 sw=4 expandtab