2014-01-04 17:00:08 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2018-08-11 09:40:44 +03:00
|
|
|
set -e
|
|
|
|
|
2014-01-04 17:00:08 +04:00
|
|
|
echo '---------------------------------------------------------------------'
|
|
|
|
echo 'SoftEther VPN for Unix'
|
|
|
|
echo
|
2018-12-02 03:37:24 +03:00
|
|
|
echo 'Copyright (c) all contributors on SoftEther VPN project in GitHub.'
|
|
|
|
echo 'Copyright (c) Daiyuu Nobori, SoftEther Project at University of Tsukuba, and SoftEther Corporation.'
|
2014-01-04 17:00:08 +04:00
|
|
|
echo
|
2018-12-02 03:37:24 +03:00
|
|
|
echo 'Licensed under the Apache License, Version 2.0 (the License).'
|
2014-01-07 00:40:52 +04:00
|
|
|
echo
|
2018-12-02 03:37:24 +03:00
|
|
|
echo 'Read and understand README, LICENSE and WARNING before use.'
|
2014-01-04 17:00:08 +04:00
|
|
|
echo '---------------------------------------------------------------------'
|
|
|
|
echo
|
|
|
|
|
|
|
|
echo 'Welcome to the corner-cutting configure script !'
|
|
|
|
echo
|
2014-08-18 15:48:08 +04:00
|
|
|
|
2018-05-22 23:20:41 +03:00
|
|
|
if [ ! -d "tmp" ]; then
|
|
|
|
mkdir tmp
|
|
|
|
fi
|
2014-01-04 17:00:08 +04:00
|
|
|
|
2020-03-20 12:56:56 +03:00
|
|
|
if [ ! -z ${CMAKE_FLAGS+x} ]; then
|
|
|
|
CMAKE_FLAGS="${CMAKE_FLAGS}"
|
|
|
|
fi
|
|
|
|
|
2018-06-28 14:23:21 +03:00
|
|
|
if [ ! -z ${CMAKE_INSTALL_PREFIX+x} ]; then
|
2020-03-20 12:56:56 +03:00
|
|
|
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ${CMAKE_FLAGS}"
|
2018-06-28 14:23:21 +03:00
|
|
|
fi
|
|
|
|
|
2018-07-31 12:49:55 +03:00
|
|
|
if [ -z ${OPENSSL_ROOT_DIR} ]; then
|
|
|
|
unameOut="$(uname -s)"
|
|
|
|
if [ "$unameOut" = "Darwin" ]; then
|
|
|
|
echo "Environment variable OPENSSL_ROOT_DIR not set, using default Homebrew path: /usr/local/opt/openssl/"
|
|
|
|
export OPENSSL_ROOT_DIR="/usr/local/opt/openssl/"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-12-15 20:32:19 +03:00
|
|
|
if [ ! -z ${CPACK_GENERATOR+x} ]; then
|
|
|
|
echo "CPACK_GENERATOR is set, CPack will generate ${CPACK_GENERATOR} packages."
|
|
|
|
CMAKE_FLAGS="-DCPACK_GENERATOR=${CPACK_GENERATOR} ${CMAKE_FLAGS}"
|
|
|
|
elif [ -x "$(command -v rpm)" ]; then
|
2018-08-17 22:48:27 +03:00
|
|
|
echo "'rpm' executable found, CPack will generate RPM packages."
|
2018-08-13 06:48:45 +03:00
|
|
|
CMAKE_FLAGS="-DCPACK_GENERATOR='RPM' ${CMAKE_FLAGS}"
|
|
|
|
else
|
2018-08-17 22:48:27 +03:00
|
|
|
echo "'rpm' executable not found, CPack will generate DEB packages."
|
2018-08-13 06:48:45 +03:00
|
|
|
CMAKE_FLAGS="-DCPACK_GENERATOR='DEB' ${CMAKE_FLAGS}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
2018-11-17 23:56:19 +03:00
|
|
|
(cd tmp && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_FLAGS} .. || exit 1)
|
2018-06-28 14:23:21 +03:00
|
|
|
|
2014-01-04 17:00:08 +04:00
|
|
|
|
2018-05-22 23:20:41 +03:00
|
|
|
echo ""
|
2014-01-04 17:00:08 +04:00
|
|
|
|
2018-05-22 23:20:41 +03:00
|
|
|
echo "The Makefile is generated. Run 'make -C tmp' to build SoftEther VPN."
|