blob: 67d8b0928c6da2c496ab7548984358f1ce7cf6cd [file] [log] [blame]
cristy964cb7f2010-04-25 23:18:00 +00001# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_cxx_namespace_std.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_CXX_NAMESPACE_STD
8#
9# DESCRIPTION
10#
11# If the compiler supports namespace std, define HAVE_NAMESPACE_STD.
12#
13# LICENSE
14#
15# Copyright (c) 2009 Todd Veldhuizen
16# Copyright (c) 2009 Luc Maisonobe <luc@spaceroots.org>
17#
18# Copying and distribution of this file, with or without modification, are
19# permitted in any medium without royalty provided the copyright notice
20# and this notice are preserved. This file is offered as-is, without any
21# warranty.
22
23#serial 6
24
25AU_ALIAS([AC_CXX_NAMESPACE_STD], [AX_CXX_NAMESPACE_STD])
26AC_DEFUN([AX_CXX_NAMESPACE_STD], [
27 AC_CACHE_CHECK(if g++ supports namespace std,
28 ax_cv_cxx_have_std_namespace,
29 [AC_LANG_SAVE
30 AC_LANG_CPLUSPLUS
31 AC_TRY_COMPILE([#include <iostream>
32 std::istream& is = std::cin;],,
33 ax_cv_cxx_have_std_namespace=yes, ax_cv_cxx_have_std_namespace=no)
34 AC_LANG_RESTORE
35 ])
36 if test "$ax_cv_cxx_have_std_namespace" = yes; then
37 AC_DEFINE(HAVE_NAMESPACE_STD,,[Define if g++ supports namespace std. ])
38 fi
39])