~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/cxx_cstdint.m4

  • Committer: Monty Taylor
  • Date: 2009-03-04 02:16:28 UTC
  • mto: (917.1.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: mordred@inaugust.com-20090304021628-rfq0b16uoi09g8tx
Fix to make VPATH builds work again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# We check two things: where the include file is for cstdint. We
 
2
# include AC_TRY_COMPILE for all the combinations we've seen in the
 
3
# wild.  We define one of HAVE_CSTDINT or HAVE_TR1_CSTDINT or 
 
4
# HAVE_BOOST_CSTDINT depending
 
5
# on location.
 
6
 
 
7
AC_DEFUN([AC_CXX_CSTDINT],
 
8
  [AC_MSG_CHECKING(the location of cstdint)
 
9
   AC_LANG_PUSH(C++)
 
10
   ac_cv_cxx_cstdint=""
 
11
   for location in tr1/cstdint boost/cstdint cstdint; do
 
12
     if test -z "$ac_cv_cxx_cstdint"; then
 
13
       AC_TRY_COMPILE([#include <$location>],
 
14
                      [uint32_t t],
 
15
                      [ac_cv_cxx_cstdint="<$location>";])
 
16
     fi
 
17
   done
 
18
   AC_LANG_POP()
 
19
   if test -n "$ac_cv_cxx_cstdint"; then
 
20
      AC_MSG_RESULT([$ac_cv_cxx_cstdint])
 
21
   else
 
22
      AC_DEFINE([__STDC_CONSTANT_MACROS],[1],[Use STDC Constant Macros in C++])
 
23
      AC_DEFINE([__STDC_FORMAT_MACROS],[1],[Use STDC Format Macros in C++])
 
24
      ac_cv_cxx_cstdint="<stdint.h>"
 
25
      AC_MSG_RESULT()
 
26
      AC_MSG_WARN([Could not find a cstdint header.])
 
27
   fi
 
28
   AC_DEFINE_UNQUOTED(CSTDINT_H,$ac_cv_cxx_cstdint,
 
29
                      [the location of <cstdint>])
 
30
])