From: <wsf...@us...> - 2012-10-07 18:50:47
|
Revision: 13866 http://swig.svn.sourceforge.net/swig/?rev=13866&view=rev Author: wsfulton Date: 2012-10-07 18:50:41 +0000 (Sun, 07 Oct 2012) Log Message: ----------- Modify autoconf macro to be more flexible about how it is used - sets CXX11FLAGS, HAVE_CXX11_COMPILER and option to not error out Modified Paths: -------------- branches/gsoc2009-matevz/Tools/config/ax_cxx_compile_stdcxx_11.m4 Modified: branches/gsoc2009-matevz/Tools/config/ax_cxx_compile_stdcxx_11.m4 =================================================================== --- branches/gsoc2009-matevz/Tools/config/ax_cxx_compile_stdcxx_11.m4 2012-10-05 19:19:56 UTC (rev 13865) +++ branches/gsoc2009-matevz/Tools/config/ax_cxx_compile_stdcxx_11.m4 2012-10-07 18:50:41 UTC (rev 13866) @@ -4,15 +4,18 @@ # # SYNOPSIS # -# AX_CXX_COMPILE_STDCXX_11([ext|noext]) +# AX_CXX_COMPILE_STDCXX_11([ext|noext], [nostop]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXXFLAGS to enable support. -# Errors out if no mode that supports C++11 baseline syntax can be found. -# The argument, if specified, indicates whether you insist on an extended -# mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -std=c++11). +# CXX11FLAGS will also contain any necessary switches to enable support. +# HAVE_CXX11_COMPILER will additionally be set to yes if there is support. +# If the second argument is not specified, errors out if no mode that +# supports C++11 baseline syntax can be found. The first argument, if +# specified, indicates whether you insist on an extended mode +# (e.g. -std=gnu++11) or a strict conformance mode (e.g. -std=c++11). # If neither is specified, you get whatever works, with preference for an # extended mode. # @@ -20,6 +23,7 @@ # # Copyright (c) 2008 Benjamin Kosnik <bk...@re...> # Copyright (c) 2012 Zack Weinberg <za...@pa...> +# Copyright (c) 2012 William Fulton <ws...@fu...> # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice @@ -50,8 +54,12 @@ [$1], [ext], [], [$1], [noext], [], [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl + m4_if([$2], [], [], + [$2], [nostop], [], + [m4_fatal([invalid argument `$2' to AX_CXX_COMPILE_STDCXX_11])])dnl AC_LANG_ASSERT([C++])dnl ac_success=no + CXX11FLAGS= AC_CACHE_CHECK(whether $CXX supports C++11 features by default, ax_cv_cxx_compile_cxx11, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], @@ -75,6 +83,7 @@ CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" + CXX11FLAGS=$switch ac_success=yes break fi @@ -95,6 +104,7 @@ CXXFLAGS="$ac_save_CXXFLAGS"]) if eval test x\$$cachevar = xyes; then CXXFLAGS="$CXXFLAGS $switch" + CXX11FLAGS=$switch ac_success=yes break fi @@ -102,6 +112,10 @@ fi]) if test x$ac_success = xno; then - AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) + if test x$2 != xnostop; then + AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) + fi + else + HAVE_CXX11_COMPILER=yes fi ]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |