You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/07/19 11:01:50 UTC

svn commit: r795496 - /commons/sandbox/runtime/trunk/src/main/native/configure

Author: mturk
Date: Sun Jul 19 09:01:49 2009
New Revision: 795496

URL: http://svn.apache.org/viewvc?rev=795496&view=rev
Log:
Check for compiler version

Modified:
    commons/sandbox/runtime/trunk/src/main/native/configure

Modified: commons/sandbox/runtime/trunk/src/main/native/configure
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=795496&r1=795495&r2=795496&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Sun Jul 19 09:01:49 2009
@@ -84,6 +84,8 @@
 zlib_lib=""
 cccinc="stdio"
 makefiles="Makefile"
+cc_ver_major=0
+cc_ver_minor=0
 
 for o
 do
@@ -438,6 +440,28 @@
         ;;
 esac
 
+case "$host-$cc" in
+    *-gcc      )
+        v=`gcc --version 2>&1 | head -1 | sed 's/.* \([0-9].[0-9].[0-9]*\).*/\1/'`
+        cc_ver_major=`echo $v | sed 's/^\([0-9]\).*/\1/'`
+        cc_ver_minor=`echo $v | sed 's/^[0-9].\([0-9]\).*/\1/'`
+        if [ ".$has_maintainer_mode" != .yes ]; then
+            varadds ccflags "-fno-stack-protector"
+        fi
+    ;;
+    windows-cl )
+        v=`cl /? 2>&1 | head -1 | sed 's/.*Version \([0-9]*.[0-9]*\).*/\1/'`
+        cc_ver_major=`echo $v | sed 's/^\([0-9]*\).*/\1/'`
+        cc_ver_minor=`echo $v | sed 's/^[0-9]*.\([0-9]*\).*/\1/'`
+        if [ ".$has_maintainer_mode" != .yes ]; then
+            if [ ${cc_ver_major}0 -gt 130 ]; then
+                # Visual Studio 2005 and later
+                varadds ccflags "-GS-"
+            fi
+        fi
+    ;;
+esac
+
 case "$host$bits-$cc" in
     hpux64-cc    )
         varadds ccflags "+DD64"
@@ -450,7 +474,7 @@
         ;;
     windows64-cl )
         varadds ccflags "-DWIN64 -D_WIN64"
-        if [ ".$mach" = ".ia64" ]; then
+        if [ ".$mach" = .ia64 ]; then
             varadds ccflags "-D_IA64_=1"
             varadds shflags "/MACHINE:IA64"
         else