~drizzle-trunk/drizzle/development

481.1.9 by Monty Taylor
Added autoconf tests for location of cstdint and cinttypes. Use those in C++ programs now, so that we don't have to define _STDC_LIMIT_MACROS, etc by hand. Stop, in fact, defining those by hand.
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_SAVE
10
   AC_LANG_CPLUSPLUS
11
   ac_cv_cxx_cstdint=""
12
   for location in tr1/cstdint boost/cstdint cstdint; do
13
     if test -z "$ac_cv_cxx_cstdint"; then
14
       AC_TRY_COMPILE([#include <$location>],
15
                      [uint32_t t],
16
                      [ac_cv_cxx_cstdint="<$location>";])
17
     fi
18
   done
19
   if test -n "$ac_cv_cxx_cstdint"; then
20
      AC_MSG_RESULT([$ac_cv_cxx_cstdint])
21
   else
481.1.18 by Monty
Fixed m4 files for older C compilers that don't have ext/cstdint, etc.
22
      CXXFLAGS="${CXXFLAGS}  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS"
23
      ac_cv_cxx_cstdint="<stdint.h>"
481.1.9 by Monty Taylor
Added autoconf tests for location of cstdint and cinttypes. Use those in C++ programs now, so that we don't have to define _STDC_LIMIT_MACROS, etc by hand. Stop, in fact, defining those by hand.
24
      AC_MSG_RESULT()
481.1.18 by Monty
Fixed m4 files for older C compilers that don't have ext/cstdint, etc.
25
      AC_MSG_WARN([Could not find a cstdint header.])
481.1.9 by Monty Taylor
Added autoconf tests for location of cstdint and cinttypes. Use those in C++ programs now, so that we don't have to define _STDC_LIMIT_MACROS, etc by hand. Stop, in fact, defining those by hand.
26
   fi
481.1.18 by Monty
Fixed m4 files for older C compilers that don't have ext/cstdint, etc.
27
   AC_DEFINE_UNQUOTED(CSTDINT_H,$ac_cv_cxx_cstdint,
28
                      [the location of <cstdint>])
481.1.9 by Monty Taylor
Added autoconf tests for location of cstdint and cinttypes. Use those in C++ programs now, so that we don't have to define _STDC_LIMIT_MACROS, etc by hand. Stop, in fact, defining those by hand.
29
])