~clint-fewbar/gearmand/fix-const-libmemcached-gcc47

« back to all changes in this revision

Viewing changes to m4/have_cstdint.m4

  • Committer: Brian Aker
  • Date: 2012-09-11 10:26:52 UTC
  • Revision ID: brian@tangent.org-20120911102652-lw6r3ttex4lw9oom
Autoconf fixes plus compiler issues on OSX.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
42
42
 
43
 
#serial 1
44
 
 
45
 
 
46
 
AC_DEFUN([AX_CXX_CSTDINT],
47
 
    [
 
43
#serial 2
 
44
 
 
45
 
 
46
AC_DEFUN([AX_CXX_CSTDINT], [
48
47
    AC_REQUIRE([AC_PROG_CXX])
49
48
    AC_REQUIRE([AC_PROG_CXXCPP])
50
49
 
51
 
    AC_MSG_CHECKING(the location of cstdint)
52
 
    AC_LANG_PUSH([C++])
53
 
    save_CXXFLAGS="${CXXFLAGS}"
54
 
    CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
55
 
    ac_cv_cxx_cstdint=""
56
 
 
57
 
    AC_LANG_PUSH([C++])
58
 
#    AC_CACHE_CHECK([for location of cstdint], [ac_cv_cxx_cstdint],
59
 
#      [
60
 
# Look for cstdint
61
 
      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <cstdint>], [ uint32_t t ])],
62
 
        [ac_cv_cxx_cstdint="<cstdint>"],
63
 
        [
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>"],
67
 
          [
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>"])
71
 
 
72
 
          ])
73
 
        ])
74
 
#      ])
75
 
 
76
 
  AC_LANG_POP()
77
 
 
78
 
  CXXFLAGS="${save_CXXFLAGS}"
79
 
  if test -n "$ac_cv_cxx_cstdint"; then
80
 
    AC_MSG_RESULT([$ac_cv_cxx_cstdint])
81
 
  else
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])
85
 
  fi
86
 
 
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], [
 
51
      AC_LANG_PUSH([C++])
 
52
      save_CXXFLAGS="${CXXFLAGS}"
 
53
      CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
 
54
 
 
55
      AC_COMPILE_IFELSE([
 
56
        AC_LANG_PROGRAM([#include <cstdint>], [ uint32_t t ])],
 
57
        [ac_cxx_cstdint_cstdint="<cstdint>"])
 
58
 
 
59
      AC_COMPILE_IFELSE([
 
60
        AC_LANG_PROGRAM([#include <tr1/cstdint>], [ uint32_t t ])],
 
61
        [ac_cxx_cstdint_tr1_cstdint="<tr1/cstdint>"])
 
62
 
 
63
      AC_COMPILE_IFELSE([
 
64
        AC_LANG_PROGRAM([#include <boost/cstdint.hpp>], [ uint32_t t ])],
 
65
        [ac_cxx_cstdint_boost_cstdint_hpp="<boost/cstdint.hpp>"])
 
66
 
 
67
      AC_LANG_POP
 
68
      CXXFLAGS="${save_CXXFLAGS}"
 
69
 
 
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])
 
73
      ])
 
74
 
 
75
  AS_IF([test -n "$ac_cv_cxx_cstdint"], [
 
76
      AC_MSG_RESULT([$ac_cv_cxx_cstdint])
 
77
      ],[
 
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])
 
81
      ])
 
82
 
 
83
AC_DEFINE_UNQUOTED([CSTDINT_H],[$ac_cv_cxx_cstdint], [the location of <cstdint>])
88
84
 
89
85
  ])