patchGNU Autoconf Archive - Patches: patch #7985, Feature additions to...

 
 

patch #7985: Feature additions to AX_CXX_COMPILE_STDCXX_11 macro

Submitter:  None
Submitted:  Thu 28 Mar 2013 05:35:19 PM UTC
   
 
Priority:  3 - Low Status:  Done
Assigned to:  simons Originator Email:  -email is unavailable-
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 01 Apr 2013 11:23:07 AM UTC, comment #7: 

The new version was pushed in commit ccd1d4f54b07b46b7e12b4b21b821a3f6e539d06. I've also updated the synopsis line to reflect the second argument that has been added.

I hope the macro is fine now?

Peter Simons <simons>
Group administrator
Fri 29 Mar 2013 11:08:56 PM UTC, comment #6: 

Only one more nit from me:


# SYNOPSIS
#
#   AX_CXX_COMPILE_STDCXX_11([ext|noext])


this needs to be updated to mention the new second argument.  Sorry for missing it earlier.

Zack Weinberg <zackw>
Fri 29 Mar 2013 10:40:23 PM UTC, comment #5: 

Attempt 2 is attached.

(file #27718)

Roy Stogner <roystgnr>
Fri 29 Mar 2013 06:44:28 PM UTC, comment #4: 

On experimentation, it appears that the effect of having AM_CONDITIONAL in a configure.ac that lacks AM_INIT_AUTOMAKE is mostly harmless (you get a pair of substitutions in config.status which probably aren't meaningful, but don't do any harm either).  However, you cannot have AM_CONDITIONAL nested inside a shell conditional, and that by itself is (IMHO) a strong argument for not having it embedded in a macro.

Zack Weinberg <zackw>
Fri 29 Mar 2013 06:13:35 PM UTC, comment #3: 

I'll try to have a version ready for upload with the bug and the criticisms fixed shortly (unless someone else has already started on it?); thanks for the feedback.

The only criticism-fix that should cause problems for me is the removal of AM_CONDITIONAL; however if the alternatives here are "my users need an extra line in their configure.ac" versus "users without automake can't use the macro" then the former is preferable.

Roy Stogner <roystgnr>
Fri 29 Mar 2013 05:52:32 PM UTC, comment #2: 

There appears to be one outright bug: ax_cv_cxx_compile_cxx11_required is initialized to either 'true' or 'false', but is later tested against 'no'.  (Use of 'true' and 'false' in this context is contra standard Autoconf practice, it should be 'yes' and 'no'.)  If 'true' is replaced with 'yes' and 'false' with 'no', then the sense of the conditional is also backward.

I also have a few minor criticisms:

  • When the macro is used in "C++11 support is mandatory" mode, it should not set the shell variable HAVE_CXX11 nor should it make any AC_SUBST, AC_DEFINE, or AM_CONDITIONAL definitions.


  • The embedded use of AM_CONDITIONAL introduces an invisible dependency on automake; this should probably be removed altogether.


  • ax_cv_cxx_compile_cxx11_required is not the result of a test and should not have a cv name.


  • Use of 'true'/'false' to toggle mandatory/optional means that configure.ac will be less readable than it could be.  Why not 'mandatory' or 'optional' keywords?


  • `dnl`s were removed in a few places, perhaps because they appeared to be unnecessary.  Their purpose was to suppress extra blank lines in the generated configure script.
Zack Weinberg <zackw>
Fri 29 Mar 2013 05:29:34 PM UTC, comment #1: 

I have pushed your patch in commit dca23d5eef837f335e13f946534eccb4ab416df5.

Zack, Benjamin, could you please take a look at those changes to check that everything is fine?

Peter Simons <simons>
Group administrator
Thu 28 Mar 2013 05:35:19 PM UTC, original submission:  

The attached version of ax_cxx_compile_stdcxx_11.m4 has several changes:

The C++11 test code includes the "auto" keyword

AC_LANG_PUSH/POP rather than AC_LANG_ASSERT makes it more robust to use

An optional second argument makes it possible to test for C++11 and return the result with an AC_DEFINE/AC_SUBST/AM_CONDITIONAL without erroring out if support is not found.

This new version should be nearly backwards-compatible with the old; the obvious exception being when compilers which implement a subset of C++11 not including "auto" are used with codes for which that subset would have been sufficient.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #27718:  ax_cxx_compile_stdcxx_11.m4 added by roystgnr (4KiB - application/x-m4)
file #27704:  ax_cxx_compile_stdcxx_11.m4 added by None (4KiB - application/x-m4)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by roystgnr (Posted a comment)
  • -email is unavailable- added by zackw (Posted a comment)
  • -email is unavailable- added by simons (Posted a comment)
  • -email is unavailable- added by simons
  • -email is unavailable- added by simons
  • -email is unavailable- added by None (Submitted the item)
  •  

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-04-06 simons StatusReady For Test Done
        Open/ClosedOpen Closed
    2013-03-29 roystgnr Attached File- Added ax_cxx_compile_stdcxx_11.m4, #27718
    2013-03-29 simons StatusNone Ready For Test
        Assigned toNone simons
        Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-
    2013-03-28 None Attached File- Added ax_cxx_compile_stdcxx_11.m4, #27704

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code