Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiyuu Nobori <da.git@softether.co.jp>2016-11-27 12:01:13 +0300
committerGitHub <noreply@github.com>2016-11-27 12:01:13 +0300
commit6bd15af4f3041a5376d4fca63ebbf51b025bb6a4 (patch)
tree73e2ce3756837b389b970bb8f7d8519f98ff1ce5
parentc18fd5c12e4fe365a680f4f245c203a664764d4f (diff)
parentccc9def4956260a734e2a85c2c2969b72329e72c (diff)
Merge pull request #96 from berolinux/master
Try to autodetect OS and CPU instead of requiring user input
-rwxr-xr-xconfigure130
1 files changed, 80 insertions, 50 deletions
diff --git a/configure b/configure
index 9dba653c..ab755932 100755
--- a/configure
+++ b/configure
@@ -16,66 +16,96 @@ echo
echo 'Welcome to the corner-cutting configure script !'
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=""
-if test "$TMP" = "1"
-then
+case "`uname -s`" in
+Linux)
OS="linux"
-fi
-if test "$TMP" = "2"
-then
+ ;;
+FreeBSD)
OS="freebsd"
-fi
-if test "$TMP" = "3"
-then
+ ;;
+SunOS)
OS="solaris"
-fi
-if test "$TMP" = "4"
-then
+ ;;
+Darwin)
OS="macos"
-fi
-if test "$TMP" = "5"
-then
+ ;;
+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" = ""
-then
- echo "Wrong number."
- exit 1
-fi
+ if test "$OS" = ""
+ then
+ echo "Wrong number."
+ exit 1
+ 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=""
-if test "$TMP" = "1"
-then
- CPU="32bit"
-fi
-if test "$TMP" = "2"
-then
- CPU="64bit"
-fi
+case "`uname -m`" in
+x86_64|amd64|aarch64|arm64|armv8*|mips64|ppc64|sparc64|alpha|ia64)
+ CPU=64bit
+ ;;
+i?86|x86pc|i86pc|armv4*|armv5*|armv6*|armv7*)
+ CPU=32bit
+ ;;
+*)
+ 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" = ""
-then
- echo "Wrong number."
- exit 1
-fi
+ if test "$CPU" = ""
+ then
+ echo "Wrong number."
+ exit 1
+ fi
+ ;;
+esac
cp src/makefiles/${OS}_${CPU}.mak Makefile