Changeset: 594cf02392d7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=594cf02392d7
Modified Files:
        configure.ag
Branch: default
Log Message:

Merge with Jan2014 branch.


diffs (115 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -129,6 +129,7 @@ case "$CC" in
        9.*)    CC="$CC -no-gcc";;
        10.*)   CC="$CC -no-gcc";;
        11.*)   CC="$CC -no-gcc";;
+       *)      AC_MSG_WARN([icc ($CC) $icc_ver not handled, yet]);;
        esac
        ;;
 esac
@@ -383,14 +384,48 @@ case $host in
        ;;
 esac
 
+dnl  (try to) determine compiler type (gcc, icc, clang) (and version)
+dnl  independent of call ($CC) and result of AC_PROG_CC() ($GCC)
+dnl  (e.g., on OSX, Apple pretends its clang were gcc)
+AC_MSG_CHECKING(compiler type & version)
 gcc_ver=""
 icc_ver=""
-case $GCC-$CC in
-yes-*clang*)
+CC_ver=""
+CC_version="`$CC --version 2>&1`"
+case "$CC_version" in
+*gcc*GCC*)
+       gcc_ver="`$CC -dumpversion 2>/dev/null`"
+       CC_ver="gcc-$gcc_ver"
+       ;;
+*icc*ICC*)
+       icc_ver="`$CC -dumpversion 2>/dev/null`"
+       CC_ver="icc-$icc_ver"
+       ;;
+*clang*)
        dnl  `clang -dumpversion` reports the original/old gcc version it is 
based on
-       gcc_ver="`$CC -v 2>&1 | grep -w '[[Vv]]ersion [[0-9]]\+\.[[0-9]]\+' | 
sed 's|^.*[[Vv]]ersion \([[0-9]]\+\(\.[[0-9]]\+\)\+\).*$|\1|'`";;
-yes-*) gcc_ver="`$CC -dumpversion 2>/dev/null`";;
--*icc*)        icc_ver="`$CC -dumpversion 2>/dev/null`";;
+       gcc_ver="`$CC -v 2>&1 | grep -w '[[Vv]]ersion [[0-9]]\+\.[[0-9]]\+' | 
sed 's|^.*[[Vv]]ersion \([[0-9]]\+\(\.[[0-9]]\+\)\+\).*$|\1|'`"
+       CC_ver="clang-$gcc_ver"
+       ;;
+*)
+       AC_MSG_WARN([compiler not recognized: `$CC --version` says
+$CC_version
+       ]);;
+esac
+AC_MSG_RESULT($CC_ver)
+
+dnl  sanity/consistency check
+case "$GCC!$CC!$CC_ver" in
+yes!*clang*!clang-*)   ;;
+yes!*gcc*!clang-*)     ;;
+yes!*gcc*!gcc-*)       ;;
+!*icc*!icc-*)  ;;
+*)     AC_MSG_WARN([compiler potentially not (correctly) recognized:
+GCC=$GCC
+CC=$CC
+CC_ver=$CC_ver
+CC_version=
+$CC_version
+       ]);;
 esac
 
 AC_ARG_WITH(bits,
@@ -563,15 +598,15 @@ yes-*-*)
        MCHECK_ADD_FLAG([-Wmissing-include-dirs])
        MCHECK_ADD_FLAG([-Wlogical-op])
 
-       dnl  With clang 2.8 & 3.3 dnl (no other tested) and gcc < 4.5
+       dnl  With clang 2.8 & 3.3 (no other tested, yet) and gcc < 4.5
        dnl  (tested 3.4.6, 4.2.1, 4.3.2, 4.4.4, 4.4.5, 4.5.1, 4.5.2),
        dnl  "-Wunreachable-code" triggers numerous "will never be
        dnl  executed" (at least) in our stream code, mostly (if
        dnl  not all) false positives, though, as well as in
        dnl  YACC/BISON-generated code; thus, we do not use
        dnl  "-Wunreachable-code" with clang 2.8 and gcc < 4.5 .
-       case "$CC-$gcc_ver" in
-       *clang*-2.8|*clang*-3.3|*gcc*-[[0-3]].*|*gcc*-4.[[0-4]].*)
+       case "$CC_ver" in
+       clang-2.8|clang-3.3|gcc-[[0-3]].*|gcc-4.[[0-4]].*)
                ;;
        *)
                MCHECK_ADD_FLAG([-Wunreachable-code])
@@ -912,8 +947,8 @@ if test "x$enable_optimize" = xyes; then
        JAVACFLAGS="`echo "$JAVACFLAGS" | sed -e 's| -g | |g' -e 's| 
-g:[[a-z]]* | |g' -e 's|^ ||' -e 's| $||'`"
        dnl  Optimization flags
        JAVACFLAGS="$JAVACFLAGS -g:none -O"
-       case "$GCC-$CC" in
-       yes-*clang*)
+       case "$GCC-$CC_ver" in
+       yes-clang-*)
          CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -finline-functions"
          ;;
        yes-*)
@@ -1834,8 +1869,17 @@ if test "x$have_pthread" != xno; then
 
        save_LIBS="$LIBS"
        save_CPPFLAGS="$CPPFLAGS"
-       case $GCC-$have_pthread in
-               yes-auto|yes-yes)
+       case $GCC-$have_pthread-$CC_ver in
+               yes-auto-clang-*|yes-yes-clang-*)
+                       # clang does not seem to have / require -pthread as
+                       # compiler option; in fact, on Mac OSX Mavericks,
+                       # "Apple LLVM version 5.0 (clang-500.2.79) (based on
+                       # LLVM 3.3svn)" complains about "error: argument
+                       # unused during compilation: '-pthread'"
+                       PTHREAD_LIBS="-pthread"
+                       LIBS="$LIBS $PTHREAD_LIBS"
+               ;;
+               yes-auto-*|yes-yes-*)
                        # use GCC's knowledge about the target platform, sets 
flags
                        # for both the preprocessor as well as the linker
                        PTHREAD_INCS="-pthread"
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to