~drizzle-pbxt/drizzle/drizzle-pbxt-2

« back to all changes in this revision

Viewing changes to m4/pandora_check_cxx_standard.m4

  • Committer: Paul McCullagh
  • Date: 2009-11-10 14:18:39 UTC
  • mfrom: (1038.1.7 drizzle-pbxt-pre-merge)
  • Revision ID: paul.mccullagh@primebase.org-20091110141839-2j3k43b17ag6f605
Merged Drizzle trunk and PBXT 1.0.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
AC_DEFUN([AC_CXX_CHECK_STANDARD],[
2
 
  AC_CACHE_CHECK([what C++ standard the compiler supports],
3
 
    [ac_cv_cxx_standard],[
4
 
    AC_LANG_PUSH(C++)
5
 
    save_CXXFLAGS="${CXXFLAGS}"
6
 
    CXXFLAGS="-std=gnu++0x ${CXXFLAGS}"
7
 
    AC_COMPILE_IFELSE(
8
 
      [AC_LANG_PROGRAM(
9
 
        [[
10
 
#include <string>
 
1
dnl  Copyright (C) 2009 Sun Microsystems
 
2
dnl This file is free software; Sun Microsystems
 
3
dnl gives unlimited permission to copy and/or distribute it,
 
4
dnl with or without modifications, as long as this notice is preserved.
11
5
 
12
 
using namespace std;
13
 
        ]],[[
14
 
string foo("test string");
15
 
        ]])],
16
 
        [ac_cv_cxx_standard="gnu++0x"],
17
 
        [ac_cv_cxx_standard="gnu++98"])
18
 
    CXXFLAGS="${save_CXXFLAGS}"
19
 
    AC_LANG_POP()
20
 
  ])
21
 
  CXXFLAGS="-std=${ac_cv_cxx_standard} ${CXXFLAGS}"
 
6
AC_DEFUN([PANDORA_CHECK_CXX_STANDARD],[
 
7
  AC_REQUIRE([AC_CXX_COMPILE_STDCXX_0X])
 
8
  AS_IF([test "$GCC" = "yes"],
 
9
        [AS_IF([test "$ac_cv_cxx_compile_cxx0x_native" = "yes"],[],
 
10
               [AS_IF([test "$ac_cv_cxx_compile_cxx0x_gxx" = "yes"],
 
11
                      [CXXFLAGS="-std=gnu++0x ${CXXFLAGS}"],
 
12
                      [CXXFLAGS="-std=gnu++98"])
 
13
               ])
 
14
        ])
 
15
  AC_CXX_HEADER_STDCXX_98
22
16
])