configure 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. set -e
  3. echo '---------------------------------------------------------------------'
  4. echo 'SoftEther VPN for Unix'
  5. echo
  6. echo 'Copyright (c) all contributors on SoftEther VPN project in GitHub.'
  7. echo 'Copyright (c) Daiyuu Nobori, SoftEther Project at University of Tsukuba, and SoftEther Corporation.'
  8. echo
  9. echo 'Licensed under the Apache License, Version 2.0 (the License).'
  10. echo
  11. echo 'Read and understand README, LICENSE and WARNING before use.'
  12. echo '---------------------------------------------------------------------'
  13. echo
  14. echo 'Welcome to the corner-cutting configure script !'
  15. echo
  16. if [ ! -d "tmp" ]; then
  17. mkdir tmp
  18. fi
  19. if [ ! -z ${CMAKE_INSTALL_PREFIX+x} ]; then
  20. CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
  21. fi
  22. if [ -z ${OPENSSL_ROOT_DIR} ]; then
  23. unameOut="$(uname -s)"
  24. if [ "$unameOut" = "Darwin" ]; then
  25. echo "Environment variable OPENSSL_ROOT_DIR not set, using default Homebrew path: /usr/local/opt/openssl/"
  26. export OPENSSL_ROOT_DIR="/usr/local/opt/openssl/"
  27. fi
  28. fi
  29. if [ -x "$(command -v rpm)" ]; then
  30. echo "'rpm' executable found, CPack will generate RPM packages."
  31. CMAKE_FLAGS="-DCPACK_GENERATOR='RPM' ${CMAKE_FLAGS}"
  32. else
  33. echo "'rpm' executable not found, CPack will generate DEB packages."
  34. CMAKE_FLAGS="-DCPACK_GENERATOR='DEB' ${CMAKE_FLAGS}"
  35. fi
  36. echo ""
  37. (cd tmp && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_FLAGS} .. || exit 1)
  38. echo ""
  39. echo "The Makefile is generated. Run 'make -C tmp' to build SoftEther VPN."