summaryrefslogtreecommitdiff
path: root/makefiles/gmake/guess_env
diff options
context:
space:
mode:
Diffstat (limited to 'makefiles/gmake/guess_env')
-rwxr-xr-xmakefiles/gmake/guess_env44
1 files changed, 29 insertions, 15 deletions
diff --git a/makefiles/gmake/guess_env b/makefiles/gmake/guess_env
index 136e21b..e1c66e3 100755
--- a/makefiles/gmake/guess_env
+++ b/makefiles/gmake/guess_env
@@ -27,6 +27,15 @@ case "$UNAME_SYSTEM.$UNAME_RELEASE" in
elif test -f /etc/redhat-release; then
LINUX_DIST='redhat'
LINUX_REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*// | cut -f 1 -d .`
+ elif test -f /etc/SuSE-release; then
+ grep "SUSE Linux Enterprise Server" /etc/SuSE-release
+ if test $? = 0; then
+ LINUX_DIST='sles'
+ LINUX_REV=`grep VERSION /etc/SuSE-release | cut -f 3 -d ' '`
+ else
+ LINUX_DIST='suse'
+ LINUX_REV=`grep VERSION /etc/SuSE-release | cut -f 3 -d ' '`
+ fi
else
LINUX_DIST='unknown'
LINUX_REV='unknown'
@@ -52,13 +61,13 @@ case "$UNAME_SYSTEM.$UNAME_RELEASE" in
OS_MAJOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 1`
OS_MINOR_VERSION=`echo $UNAME_RELEASE | cut -d . -f 2`
;;
-
+
CYGWIN_NT*) PLATFORM=CYGWIN
_tmp=`echo $UNAME_SYSTEM | cut -d - -f 2`
OS_MAJOR_VERSION=`echo $_tmp | cut -d . -f 1`
OS_MINOR_VERSION=`echo $_tmp | cut -d . -f 2`
;;
-
+
*)
PLATFORM=UNKNOWN
echo "Unknown platform '$UNAME_SYSTEM $UNAME_RELEASE'"
@@ -74,7 +83,7 @@ case "$UNAME_MACHINE" in
;;
sun4u) ARCH=sun4u
;;
-
+
*) ARCH=UNKNOWN
echo "Unknown architecture '$UNAME_MACHINE'"
exit 1
@@ -90,8 +99,11 @@ fi
# the compiler and version
-# what compiler do we have (we can't relly on it's name as it may be a cc link to the binary!)
+# do we have ccache or distcc in CC, then check the compiler, not the wrapper
CC=$2
+CC=`echo $CC | sed 's/distcc//g' | sed 's/ccache//g'`
+
+# what compiler do we have (we can't relly on it's name as it may be a cc link to the binary!)
(( $CC -v 2>&1 | $TAIL1 ) | grep -i GCC ) 2>/dev/null 1>/dev/null
if test $? = 0; then
COMPILER='gcc'
@@ -100,7 +112,8 @@ else
if test $? = 0; then
COMPILER='tcc'
else
- ( $CC -V 2>&1 | grep l_cproc_p ) >/dev/null
+# ( $CC -V 2>&1 | grep l_cproc_p ) >/dev/null
+ ( $CC -V 2>&1 | grep "Intel(R) C" | grep "Compiler" ) >/dev/null
if test $? = 0; then
COMPILER='icc'
else
@@ -161,43 +174,43 @@ fi
case "$1" in
--platform) echo $PLATFORM
;;
-
+
--os-major-version) echo $OS_MAJOR_VERSION
;;
-
+
--os-minor-version) echo $OS_MINOR_VERSION
;;
-
+
--arch) echo $ARCH
;;
--compiler) echo $COMPILER
;;
-
+
--gcc-major-version) echo $GCC_MAJOR_VERSION
;;
-
+
--gcc-minor-version) echo $GCC_MINOR_VERSION
;;
--tcc-major-version) echo $TCC_MAJOR_VERSION
;;
-
+
--tcc-minor-version) echo $TCC_MINOR_VERSION
;;
-
+
--icc-major-version) echo $ICC_MAJOR_VERSION
;;
-
+
--icc-minor-version) echo $ICC_MINOR_VERSION
;;
-
+
--spro-major-version) echo $SPRO_MAJOR_VERSION
;;
--pcc-major-version) echo $PCC_MAJOR_VERSION
;;
-
+
--pcc-minor-version) echo $PCC_MINOR_VERSION
;;
esac
@@ -225,3 +238,4 @@ LINUX_DIST=$LINUX_DIST
LINUX_REV=$LINUX_REV
EOF
fi
+