pandora-build v0.74
[awesomized/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 ac_cv_cxx_cinttypes=""
12 for location in tr1/cinttypes boost/cinttypes cinttypes; do
13 if test -z "$ac_cv_cxx_cinttypes"; then
14 AC_TRY_COMPILE([#include $ac_cv_cxx_cstdint;
15 #include <$location>],
16 [uint32_t foo= UINT32_C(1)],
17 [ac_cv_cxx_cinttypes="<$location>";])
18 fi
19 done
20 AC_LANG_POP()
21 if test -n "$ac_cv_cxx_cinttypes"; then
22 AC_MSG_RESULT([$ac_cv_cxx_cinttypes])
23 else
24 AC_DEFINE([__STDC_LIMIT_MACROS],[1],[Use STDC Limit Macros in C++])
25 ac_cv_cxx_cinttypes="<inttypes.h>"
26 AC_MSG_RESULT()
27 AC_MSG_WARN([Could not find a cinttypes header.])
28 fi
29 AC_DEFINE_UNQUOTED(CINTTYPES_H,$ac_cv_cxx_cinttypes,
30 [the location of <cinttypes>])
31 ])