Fix for compiling c++ with pthreads
authorBrian Aker <brian@tangent.org>
Fri, 22 Nov 2013 12:27:05 +0000 (07:27 -0500)
committerBrian Aker <brian@tangent.org>
Fri, 22 Nov 2013 12:27:05 +0000 (07:27 -0500)
configure.ac
m4/ax_pthread.m4

index 696f9baef0053eaaea1f30bee708c6d8bbdb92ef..2b7bfd5490af01a33087355eacf8595f5db723ac 100644 (file)
@@ -60,7 +60,7 @@ AS_IF([test "x${ac_cv_prog_cc_c99}" == "xno"],[AC_MSG_ERROR([No c99 compatible c
 AC_DEFUN([CHECK_CXX0X],[
           AC_LANG_PUSH([C++])
           AX_CHECK_COMPILE_FLAG([-std=c++0x],[
-                                 CXXFLAGS="$CXXFLAGS -std=c++0x"])
+                                 CXX="$CXX -std=c++0x"])
           AC_LANG_POP([C++])
           ])
 CHECK_CXX0X
@@ -71,10 +71,6 @@ AX_PLATFORM
 
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
-AX_CXX_HEADER_STDCXX_98
-AS_IF([test "x$ax_cv_cxx_stdcxx_98" = "xno"],
-      [AC_MSG_ERROR([Your system lacks a new enough C++ compiler])])
-
 AC_DEFUN([LIBMEMCACHED_PROTOCOL],
          [AC_ARG_ENABLE([libmemcachedprotocol],
                         [AS_HELP_STRING([--enable-libmemcachedprotocol],
@@ -297,8 +293,10 @@ SOCKET_SEND_FLAGS
 AX_UUID_GENERATE_TIME_SAFE
 
 AC_DEFUN([CHECK_FOR_PTHREAD_AND_SASL],
-         [AX_PTHREAD(, [AC_MSG_ERROR([could not find libpthread])])
+         [AC_LANG_PUSH([C++])
+         AX_PTHREAD(, [AC_MSG_ERROR([could not find libpthread])])
          AX_PTHREAD_TIMEDJOIN_NP
+         AC_LANG_POP([C++])
 
          # The sasl functions should only be visible if we build with sasl support
          #
index ebea7fb511c1e2c41f28bc1735d1cfa314af21c0..007f6276a42ba81c531a0d581eb768d2d0843f37 100644 (file)
@@ -87,7 +87,6 @@
 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
 AC_DEFUN([AX_PTHREAD], [
 AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_PUSH([C])
 ax_pthread_ok=no
 
 # We used to check for pthread.h first, but this fails if pthread.h
@@ -328,5 +327,4 @@ else
         ax_pthread_ok=no
         $2
 fi
-AC_LANG_POP
 ])dnl AX_PTHREAD