~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 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([AC_CXX_CINTTYPES],
8
  [AC_REQUIRE([AC_CXX_CSTDINT])
779.2.11 by Monty Taylor
General build cleanup - removed cruft, removed depreated checks.
9
   AC_MSG_CHECKING(the location of cinttypes)
10
   AC_LANG_PUSH(C++)
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.
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
779.2.11 by Monty Taylor
General build cleanup - removed cruft, removed depreated checks.
20
   AC_LANG_POP()
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.
21
   if test -n "$ac_cv_cxx_cinttypes"; then
22
      AC_MSG_RESULT([$ac_cv_cxx_cinttypes])
23
   else
612.2.4 by Monty Taylor
Moved some defines to config.h. Stopped including config.h directly anywhere.
24
      AC_DEFINE([__STDC_LIMIT_MACROS],[1],[Use STDC Limit Macros in C++])
481.1.18 by Monty
Fixed m4 files for older C compilers that don't have ext/cstdint, etc.
25
      ac_cv_cxx_cinttypes="<inttypes.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.
26
      AC_MSG_RESULT()
481.1.18 by Monty
Fixed m4 files for older C compilers that don't have ext/cstdint, etc.
27
      AC_MSG_WARN([Could not find a cinttypes 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.
28
   fi
481.1.18 by Monty
Fixed m4 files for older C compilers that don't have ext/cstdint, etc.
29
   AC_DEFINE_UNQUOTED(CINTTYPES_H,$ac_cv_cxx_cinttypes,
30
                      [the location of <cinttypes>])
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.
31
])