configure 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/sh
  2. set -e
  3. echo '---------------------------------------------------------------------'
  4. echo 'SoftEther VPN for Unix'
  5. echo
  6. echo 'Copyright (c) SoftEther VPN Project at University of Tsukuba, Japan.'
  7. echo 'Copyright (c) Daiyuu Nobori. All Rights Reserved.'
  8. echo
  9. echo 'This program is free software; you can redistribute it and/or'
  10. echo 'modify it under the terms of the GNU General Public License'
  11. echo 'version 2 as published by the Free Software Foundation.'
  12. echo
  13. echo 'Read and understand README.TXT, LICENSE.TXT and WARNING.TXT before use.'
  14. echo '---------------------------------------------------------------------'
  15. echo
  16. echo 'Welcome to the corner-cutting configure script !'
  17. echo
  18. if [ ! -d "tmp" ]; then
  19. mkdir tmp
  20. fi
  21. if [ ! -z ${CMAKE_INSTALL_PREFIX+x} ]; then
  22. CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
  23. fi
  24. if [ -z ${OPENSSL_ROOT_DIR} ]; then
  25. unameOut="$(uname -s)"
  26. if [ "$unameOut" = "Darwin" ]; then
  27. echo "Environment variable OPENSSL_ROOT_DIR not set, using default Homebrew path: /usr/local/opt/openssl/"
  28. export OPENSSL_ROOT_DIR="/usr/local/opt/openssl/"
  29. fi
  30. fi
  31. if [ -x "$(command -v rpm)" ]; then
  32. echo "'rpm' executable found, CPack will generate RPM packages."
  33. CMAKE_FLAGS="-DCPACK_GENERATOR='RPM' ${CMAKE_FLAGS}"
  34. else
  35. echo "'rpm' executable not found, CPack will generate DEB packages."
  36. CMAKE_FLAGS="-DCPACK_GENERATOR='DEB' ${CMAKE_FLAGS}"
  37. fi
  38. echo ""
  39. (cd tmp && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_FLAGS} .. || exit 1)
  40. echo ""
  41. echo "The Makefile is generated. Run 'make -C tmp' to build SoftEther VPN."