Enable C++11 compilation when using libsigc++ 2.5.1 and later (#758545)

As with glibmm [1] the latest versions of libsigc++ also uses ISO C++
2011 features.  The NEWS file [2] says:

    2.5.1 (unstable):

    * Use (and require) C++11
      (Kjell Ahlstedt)
    * Using C++11 lambda functions to create sigc::slots:
      Avoid the need for SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE.
      (Kjell Ahlstedt)

Without enabling C++11 compiler features, compilation of GParted with
libsigc++ 2.5.1 and later fails with errors such as theses:

    /usr/include/sigc++-2.0/sigc++/trackable.h:40:3: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++0x-compat]
       trackable_callback(void* data, func_destroy_notify func) noexcept
       ^

[1] d6d7cb2bbf
    Enable C++11 compilation when using glibmm 2.45.40 and later (#756035)

[2] libsigc++ 2.5.1 NEWS file
    https://git.gnome.org/browse/libsigcplusplus/tree/NEWS?h=2.5.1

Bug 758545 - gparted-0.24.0 fails to build with gnome 3.18 mm packages
             (on Gentoo)
This commit is contained in:
Mike Fleetwood 2016-03-24 16:09:43 +00:00 committed by Curtis Gedak
parent 7cf90f9e42
commit 707bae6fed
1 changed files with 18 additions and 3 deletions

View File

@ -259,15 +259,30 @@ PKG_CHECK_EXISTS(
)
dnl Check for glibmm >= 2.45.40 and if found enable required C++11 compilation.
need_cxx_compile_stdcxx_11=no
dnl Check for glibmm >= 2.45.40 which requires 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()
[need_cxx_compile_stdcxx_11=yes
AC_MSG_RESULT([yes])
],
[AC_MSG_RESULT([no])]
)
dnl Check for libsigc++ >= 2.5.1 which requires C++11 compilation.
AC_MSG_CHECKING([for libsigc++ >= 2.5.1 which requires C++11 compilation])
PKG_CHECK_EXISTS(
[sigc++-2.0 >= 2.5.1],
[need_cxx_compile_stdcxx_11=yes
AC_MSG_RESULT([yes])
],
[AC_MSG_RESULT([no])]
)
dnl Enable C++11 compilation only if required.
if test "x$need_cxx_compile_stdcxx_11" = xyes; then
AX_CXX_COMPILE_STDCXX_11()
fi
dnl======================