From 7a4e2c3763cc374f8b3bd1a2cb7fe0d40c43b322 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 20 Oct 2011 17:46:06 +0200 Subject: synchronized guess_env and platform.mk with Wolframe --- makefiles/gmake/guess_env | 44 +++++++++++++++++++++++++++++--------------- makefiles/gmake/platform.mk | 20 ++++++++++++++++++++ 2 files changed, 49 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 + diff --git a/makefiles/gmake/platform.mk b/makefiles/gmake/platform.mk index 095d9bd..df7c488 100644 --- a/makefiles/gmake/platform.mk +++ b/makefiles/gmake/platform.mk @@ -27,6 +27,26 @@ LINUX_DIST ?= $(shell $(SHELL) $(TOPDIR)/makefiles/gmake/guess_env --linux-dist LINUX_REV ?= $(shell $(SHELL) $(TOPDIR)/makefiles/gmake/guess_env --linux-rev $(CC) "$(CURDIR)" $(TOPDIR)) endif +# set library path on Intel/AMD +ifeq "$(ARCH)" "x86" +ifeq "$(LINUX_DIST)" "arch" +LIBDIR=/usr/lib32 +else +LIBDIR=/usr/lib +endif +else +LIBDIR=/usr/lib +endif +ifeq "$(ARCH)" "x86_64" +ifeq "$(LINUX_DIST)" "arch" +LIBDIR=/usr/lib +else +LIBDIR=/usr/lib64 +endif +else +LIBDIR=/usr/lib +endif + # platform specific flags ######################### -- cgit v1.2.3-54-g00ecf