Enable C++11 compilation when using glibmm 2.45.40 and later (#756035)

Glibmm 2.45.40 and later uses features in the ISO C++ 2011 standard.
The NEWS file [1] says:

    Changes in 2.46 compared to 2.44:

    General:
    * Use, and require C++11, using features such as move operations,
      noexcept auto, = delete, nulltpr, override.
      (Murray Cumming, Kjell Ahlstedt)

Also found this by Murray Cumming [2]:

    glibmm 2.45.40 requires C++11, both for its own build and by any
    apps that use it.  gtkmm also now requires C++11.

    I think you are seeing a symptom of building the application without
    C++11 support.  For instance, using CXXFLAGS="--std=c++11", though
    you'd be better of using an m4 macro such as
    AX_CXX_COMPILE_STDCXX_11().

Without enabling C++11 compiler features, compilation of GParted with
the latest glibmm library fails with errors such as these:

    /usr/include/glibmm-2.4/glibmm/ustring.h:267:14: error: expected ';' at end of member declaration
       ~ustring() noexcept;
                ^
    /usr/include/glibmm-2.4/glibmm/ustring.h:267:14: error: 'noexcept' does not name a type
       ~ustring() noexcept;
                  ^
    /usr/include/glibmm-2.4/glibmm/ustring.h:267:14: note: C++11 'noexcept' only available with -std=c++11 or -std=gnu++11

[1] glibmm NEWS file
    https://git.gnome.org/browse/glibmm/tree/NEWS?id=934e8290ce913b12e251ea617d0fc8ac53c385c6

[2] https://bugs.launchpad.net/ubuntu/+source/glibmm2.4/+bug/1478367

Bug 756035 - GParted does not compile with newer gtkmm libraries in
             Fedora 23
This commit is contained in:
Mike Fleetwood 2015-10-04 11:26:51 +01:00 committed by Curtis Gedak
parent f97cac9ab4
commit d6d7cb2bbf
1 changed files with 11 additions and 0 deletions

View File

@ -272,6 +272,17 @@ PKG_CHECK_EXISTS(
)
dnl Check for glibmm >= 2.45.40 and if found enable required C++11 compilation.
AC_MSG_CHECKING([for glibmm >= 2.45.40 which requires C++11 compilation])
PKG_CHECK_EXISTS(
[glibmm-2.4 >= 2.45.40],
[AC_MSG_RESULT([yes])
AX_CXX_COMPILE_STDCXX_11()
],
[AC_MSG_RESULT([no])]
)
dnl======================
dnl check whether to build documentation - gnome-doc-utils
dnl======================