~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
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
7
AC_DEFUN([PANDORA_CXX_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.
8
  [AC_MSG_CHECKING(the location of cstdint)
779.2.11 by Monty Taylor
General build cleanup - removed cruft, removed depreated checks.
9
   AC_LANG_PUSH(C++)
1241.11.1 by Monty Taylor
pandora-build v0.85 - Fixed C++ standard setting.
10
   save_CXXFLAGS="${CXXFLAGS}"
11
   CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
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.
12
   ac_cv_cxx_cstdint=""
13
   for location in tr1/cstdint boost/cstdint cstdint; do
14
     if test -z "$ac_cv_cxx_cstdint"; then
15
       AC_TRY_COMPILE([#include <$location>],
16
                      [uint32_t t],
17
                      [ac_cv_cxx_cstdint="<$location>";])
18
     fi
19
   done
779.2.11 by Monty Taylor
General build cleanup - removed cruft, removed depreated checks.
20
   AC_LANG_POP()
1241.11.1 by Monty Taylor
pandora-build v0.85 - Fixed C++ standard setting.
21
   CXXFLAGS="${save_CXXFLAGS}"
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.
22
   if test -n "$ac_cv_cxx_cstdint"; then
23
      AC_MSG_RESULT([$ac_cv_cxx_cstdint])
24
   else
612.2.4 by Monty Taylor
Moved some defines to config.h. Stopped including config.h directly anywhere.
25
      AC_DEFINE([__STDC_CONSTANT_MACROS],[1],[Use STDC Constant Macros in C++])
26
      AC_DEFINE([__STDC_FORMAT_MACROS],[1],[Use STDC Format Macros in C++])
481.1.18 by Monty
Fixed m4 files for older C compilers that don't have ext/cstdint, etc.
27
      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.
28
      AC_MSG_RESULT()
481.1.18 by Monty
Fixed m4 files for older C compilers that don't have ext/cstdint, etc.
29
      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.
30
   fi
481.1.18 by Monty
Fixed m4 files for older C compilers that don't have ext/cstdint, etc.
31
   AC_DEFINE_UNQUOTED(CSTDINT_H,$ac_cv_cxx_cstdint,
32
                      [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.
33
])