Fixed dtrace building.
[m6w6/libmemcached] / m4 / pandora_cinttypes.m4
1 # We check two things: where the include file is for cinttypes. We
2 # include AC_TRY_COMPILE for all the combinations we've seen in the
3 # wild. We define one of HAVE_CINTTYPES or HAVE_TR1_CINTTYPES or
4 # HAVE_BOOST_CINTTYPES depending
5 # on location.
6
7 AC_DEFUN([PANDORA_CXX_CINTTYPES],
8 [AC_REQUIRE([PANDORA_CXX_CSTDINT])
9 AC_MSG_CHECKING(the location of cinttypes)
10 AC_LANG_PUSH(C++)
11 save_CXXFLAGS="${CXXFLAGS}"
12 CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
13 ac_cv_cxx_cinttypes=""
14 for location in tr1/cinttypes boost/cinttypes cinttypes; do
15 if test -z "$ac_cv_cxx_cinttypes"; then
16 AC_TRY_COMPILE([#include $ac_cv_cxx_cstdint;
17 #include <$location>],
18 [uint32_t foo= UINT32_C(1)],
19 [ac_cv_cxx_cinttypes="<$location>";])
20 fi
21 done
22 AC_LANG_POP()
23 CXXFLAGS="${save_CXXFLAGS}"
24 if test -n "$ac_cv_cxx_cinttypes"; then
25 AC_MSG_RESULT([$ac_cv_cxx_cinttypes])
26 else
27 ac_cv_cxx_cinttypes="<inttypes.h>"
28 AC_MSG_RESULT()
29 AC_MSG_WARN([Could not find a cinttypes header.])
30 fi
31 AC_DEFINE([__STDC_LIMIT_MACROS],[1],[Use STDC Limit Macros in C++])
32 AC_DEFINE_UNQUOTED(CINTTYPES_H,$ac_cv_cxx_cinttypes,
33 [the location of <cinttypes>])
34 ])