~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to m4/pandora_cinttypes.m4

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
])