You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/03/31 03:14:24 UTC

[05/51] git commit: Fix cmpxchg16b configure test

Fix cmpxchg16b configure test


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a51a4395
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a51a4395
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a51a4395

Branch: refs/heads/3.3.x
Commit: a51a4395dc3ed642750ccb316ce312ee12af95eb
Parents: a9b6516
Author: James Peach <jp...@apache.org>
Authored: Sat Mar 16 20:11:10 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sat Mar 16 20:11:10 2013 -0700

----------------------------------------------------------------------
 build/common.m4 |   12 ++++--------
 configure.ac    |    8 +++-----
 2 files changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a51a4395/build/common.m4
----------------------------------------------------------------------
diff --git a/build/common.m4 b/build/common.m4
index df08fc1..7c37129 100644
--- a/build/common.m4
+++ b/build/common.m4
@@ -171,6 +171,9 @@ dnl is false if the code doesn't compile cleanly.  For compilers
 dnl where it is not known how to activate a "fail-on-error" mode,
 dnl it is undefined which of the sets of actions will be run.
 dnl
+dnl We actually always try to link the resulting program, since gcc has
+dnl a nasty habit of compiling code that cannot subsequently be linked.
+dnl
 AC_DEFUN([TS_TRY_COMPILE_NO_WARNING],
 [ats_save_CFLAGS=$CFLAGS
  CFLAGS="$CFLAGS $CFLAGS_WARN"
@@ -178,14 +181,7 @@ AC_DEFUN([TS_TRY_COMPILE_NO_WARNING],
    CFLAGS="$CFLAGS -Werror"
  fi
  CFLAGS=$(echo $CFLAGS | sed -e 's/^-w$//' -e 's/^-w //' -e 's/ -w$//' -e 's/ -w / /')
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-  [#include "confdefs.h"
-  ]
-  [[$1]]
-  [int main(int argc, const char *const *argv) {]
-  [[$2]]
-  [   return 0; }]])],
-  [$3], [$4])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([$1], [$2])], [$3], [$4])
  CFLAGS=$ats_save_CFLAGS
 ])
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a51a4395/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 2db8c46..fe1648a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1108,8 +1108,7 @@ AC_SUBST(need_union_semun)
 AC_MSG_CHECKING(for 128bit CAS support)
 AC_LANG_PUSH([C++])
 
-TS_TRY_COMPILE_NO_WARNING(
-  [],[
+TS_TRY_COMPILE_NO_WARNING([],[
     __int128_t x = 0;
     __sync_bool_compare_and_swap(&x,0,10);
   ], [
@@ -1117,11 +1116,10 @@ TS_TRY_COMPILE_NO_WARNING(
     has_128bit_cas=1
   ], [
       dnl If 128bit CAS fails, try again with the -mcx16 option. GCC needs this;
-      dnl clang doesn't; icc isunknown but presumed sane.
+      dnl clang doesn't; icc is unknown but presumed sane.
     __saved_CXXFLAGS="${CXXFLAGS}"
     TS_ADDTO(CXXFLAGS, [-mcx16])
-    TS_TRY_COMPILE_NO_WARNING(
-      [],[
+    TS_TRY_COMPILE_NO_WARNING([],[
         __int128_t x = 0;
         __sync_bool_compare_and_swap(&x,0,10);
       ], [