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
7
AC_DEFUN([PANDORA_CXX_CINTTYPES],
8
[AC_REQUIRE([PANDORA_CXX_CSTDINT])
9
AC_MSG_CHECKING(the location of cinttypes)
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>";])
23
CXXFLAGS="${save_CXXFLAGS}"
24
if test -n "$ac_cv_cxx_cinttypes"; then
25
AC_MSG_RESULT([$ac_cv_cxx_cinttypes])
27
ac_cv_cxx_cinttypes="<inttypes.h>"
29
AC_MSG_WARN([Could not find a cinttypes header.])
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>])