1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

Merge pull request #96 from berolinux/master

Try to autodetect OS and CPU instead of requiring user input
This commit is contained in:
Daiyuu Nobori 2016-11-27 18:01:13 +09:00 committed by GitHub
commit 6bd15af4f3

130
configure vendored
View File

@ -16,66 +16,96 @@ echo
echo 'Welcome to the corner-cutting configure script !' echo 'Welcome to the corner-cutting configure script !'
echo echo
echo 'Select your operating system below:'
echo ' 1: Linux'
echo ' 2: FreeBSD'
echo ' 3: Solaris'
echo ' 4: Mac OS X'
echo ' 5: OpenBSD'
echo
echo -n 'Which is your operating system (1 - 5) ? : '
read TMP
echo
OS="" OS=""
if test "$TMP" = "1" case "`uname -s`" in
then Linux)
OS="linux" OS="linux"
fi ;;
if test "$TMP" = "2" FreeBSD)
then
OS="freebsd" OS="freebsd"
fi ;;
if test "$TMP" = "3" SunOS)
then
OS="solaris" OS="solaris"
fi ;;
if test "$TMP" = "4" Darwin)
then
OS="macos" OS="macos"
fi ;;
if test "$TMP" = "5" OpenBSD)
then
OS="openbsd" OS="openbsd"
fi ;;
*)
echo 'Select your operating system below:'
echo ' 1: Linux'
echo ' 2: FreeBSD'
echo ' 3: Solaris'
echo ' 4: Mac OS X'
echo ' 5: OpenBSD'
echo
echo -n 'Which is your operating system (1 - 5) ? : '
read TMP
echo
if test "$TMP" = "1"
then
OS="linux"
fi
if test "$TMP" = "2"
then
OS="freebsd"
fi
if test "$TMP" = "3"
then
OS="solaris"
fi
if test "$TMP" = "4"
then
OS="macos"
fi
if test "$TMP" = "5"
then
OS="openbsd"
fi
if test "$OS" = "" if test "$OS" = ""
then then
echo "Wrong number." echo "Wrong number."
exit 1 exit 1
fi fi
;;
esac
echo 'Select your CPU bits below:'
echo ' 1: 32-bit'
echo ' 2: 64-bit'
echo
echo -n 'Which is the type of your CPU (1 - 2) ? : '
read TMP
echo
CPU="" CPU=""
if test "$TMP" = "1" case "`uname -m`" in
then x86_64|amd64|aarch64|arm64|armv8*|mips64|ppc64|sparc64|alpha|ia64)
CPU="32bit" CPU=64bit
fi ;;
if test "$TMP" = "2" i?86|x86pc|i86pc|armv4*|armv5*|armv6*|armv7*)
then CPU=32bit
CPU="64bit" ;;
fi *)
echo 'Select your CPU bits below:'
echo ' 1: 32-bit'
echo ' 2: 64-bit'
echo
echo -n 'Which is the type of your CPU (1 - 2) ? : '
read TMP
echo
if test "$TMP" = "1"
then
CPU="32bit"
fi
if test "$TMP" = "2"
then
CPU="64bit"
fi
if test "$CPU" = "" if test "$CPU" = ""
then then
echo "Wrong number." echo "Wrong number."
exit 1 exit 1
fi fi
;;
esac
cp src/makefiles/${OS}_${CPU}.mak Makefile cp src/makefiles/${OS}_${CPU}.mak Makefile