autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] Extend AC_PROG_CXX to check for standards conformance


From: Roger Leigh
Subject: [patch] Extend AC_PROG_CXX to check for standards conformance
Date: Sun, 20 Jan 2013 21:27:05 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Patch attached.  Probably not in its final form, but I hope
it will be useful as a basis for discussion.

This is like the existing C89/99/11 checks, but for C++.
In this patch, I've implemented three checks:

AC_PROG_CXX_CXX98
AC_PROG_CXX_CXX98TR1
AC_PROG_CXX_CXX11

and AC_PROG_CXX will try them in the order
  AC_PROG_CXX_CXX11, AC_PROG_CXX_CXX98TR1, AC_PROG_CXX_CXX98
in order to put the compiler in the highest available mode
by default.  Each one performs a set of language and/or
library tests for each standard version.

Note that like the C equivalents, these are marked deprecated
and are not usable in their own right.  I'm still of the opinion
that it's useful to restrict the compiler to a minimum standard
so that you can
- prevent the use of features you don't want to use
- ensure that the features you do want are present
So ideally, I'd like to re-enable the C and C++ standard-
specific checks, if the consensus is that these remain useful,
and also add AC_PROG_CC_C11, which is currently missing.

Other points for discussion:
- The flags for non-GCC compilers were obtained from online
  documentation.  They are untested, and may be wrong; they
  are certainly not complete since I don't use non-GCC
  compilers myself.  Fairly trivial to test and update if
  anyone has access to such compilers.
- The feature tests are restricted to those which pass with
  GCC 4.7.  Depending upon which other compilers we want to
  put into "C++11 mode", this test set may need reducing to
  the common set which are usable across different compilers
  and/or compiler versions.

I've not updated the manual yet; I'll do this if people are
generally happy with things.


Kind regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800

Attachment: 0001-AC_PROG_CXX-Add-checks-for-C-11-C-98TR1-and-C-98.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]