40
40
# modified version of the Autoconf Macro, you may extend this special
41
41
# exception to the GPL to apply to your modified version as well.
46
AC_DEFUN([AX_CXX_CSTDINT],
46
AC_DEFUN([AX_CXX_CSTDINT], [
48
47
AC_REQUIRE([AC_PROG_CXX])
49
48
AC_REQUIRE([AC_PROG_CXXCPP])
51
AC_MSG_CHECKING(the location of cstdint)
53
save_CXXFLAGS="${CXXFLAGS}"
54
CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
58
# AC_CACHE_CHECK([for location of cstdint], [ac_cv_cxx_cstdint],
61
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <cstdint>], [ uint32_t t ])],
62
[ac_cv_cxx_cstdint="<cstdint>"],
64
# Look for tr1/cstdint
65
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <tr1/cstdint>], [ uint32_t t ])],
66
[ac_cv_cxx_cstdint="<tr1/cstdint>"],
68
# Look for boost/cstdint.hpp
69
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <boost/cstdint.hpp>], [ uint32_t t ])],
70
[ac_cv_cxx_cstdint="<boost/cstdint.hpp>"])
78
CXXFLAGS="${save_CXXFLAGS}"
79
if test -n "$ac_cv_cxx_cstdint"; then
80
AC_MSG_RESULT([$ac_cv_cxx_cstdint])
82
ac_cv_cxx_cstdint="<stdint.h>"
83
AC_MSG_WARN([Could not find a cstdint header.])
84
AC_MSG_RESULT([$ac_cv_cxx_cstdint])
87
AC_DEFINE_UNQUOTED(CSTDINT_H,$ac_cv_cxx_cstdint, [the location of <cstdint>])
50
AC_CACHE_CHECK([for location of cstdint], [ac_cv_cxx_cstdint], [
52
save_CXXFLAGS="${CXXFLAGS}"
53
CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
56
AC_LANG_PROGRAM([#include <cstdint>], [ uint32_t t ])],
57
[ac_cxx_cstdint_cstdint="<cstdint>"])
60
AC_LANG_PROGRAM([#include <tr1/cstdint>], [ uint32_t t ])],
61
[ac_cxx_cstdint_tr1_cstdint="<tr1/cstdint>"])
64
AC_LANG_PROGRAM([#include <boost/cstdint.hpp>], [ uint32_t t ])],
65
[ac_cxx_cstdint_boost_cstdint_hpp="<boost/cstdint.hpp>"])
68
CXXFLAGS="${save_CXXFLAGS}"
70
AS_IF([test -n "$ac_cxx_cstdint_cstdint"], [ac_cv_cxx_cstdint=$ac_cxx_cstdint_cstdint],
71
[test -n "$ac_cxx_cstdint_tr1_cstdint"], [ac_cv_cxx_cstdint=$ac_cxx_cstdint_tr1_cstdint],
72
[test -n "$ac_cxx_cstdint_boost_cstdint_hpp"], [ac_cv_cxx_cstdint=$ac_cxx_cstdint_boost_cstdint_hpp])
75
AS_IF([test -n "$ac_cv_cxx_cstdint"], [
76
AC_MSG_RESULT([$ac_cv_cxx_cstdint])
78
ac_cv_cxx_cstdint="<stdint.h>"
79
AC_MSG_WARN([Could not find a cstdint header.])
80
AC_MSG_RESULT([$ac_cv_cxx_cstdint])
83
AC_DEFINE_UNQUOTED([CSTDINT_H],[$ac_cv_cxx_cstdint], [the location of <cstdint>])