AC_DEFUN([AX_GOOGLE_BENCHMARK],[
  GOOGLE_BENCHMARK=yes

  CPPFLAGS_SAVED="$CPPFLAGS"
  AC_LANG_PUSH(C++)

  AC_CHECK_LIB([benchmark],[main],[true],[GOOGLE_BENCHMARK=no])
  AC_CHECK_HEADERS([benchmark/benchmark.h],[true],[GOOGLE_BENCHMARK=no])

  AC_LANG_POP
  CPPFLAGS="$CPPFLAGS_SAVED"

  AC_SUBST(GOOGLE_BENCHMARK)
])

AX_GOOGLE_BENCHMARK
