conf.sh 639 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. set -eux
  3. add_flag() {
  4. printf ' %s ' "$@"
  5. }
  6. conf_linux() {
  7. HOST="${HOST:-nonexistent}"
  8. if [ "$HOST" = mingw ]; then
  9. cross=".ci/cross/windows/amd64"
  10. else
  11. cross=".ci/cross/linux/$HOST"
  12. fi
  13. if [ -f "$cross" ]; then
  14. add_flag --cross-file "$cross"
  15. fi
  16. add_flag -Dminiupnpc=auto -Duml=true
  17. }
  18. conf_windows() {
  19. add_flag -Dminiupnpc=auto
  20. }
  21. conf_macos() {
  22. openssl=$(brew --prefix openssl)
  23. add_flag -Dminiupnpc=auto -Dpkg_config_path="$openssl/lib/pkgconfig"
  24. }
  25. add_flag -Dbuildtype=release "$@"
  26. case "$(uname -s)" in
  27. Linux) conf_linux ;;
  28. MINGW*) conf_windows ;;
  29. Darwin) conf_macos ;;
  30. *) exit 1 ;;
  31. esac