Only use Gtk::Window::set_default_icon_name method when available (#695279)
GParted fails to compile on RHEL/CentOS 5.9 because it doesn't provide the Gtk::Window::set_default_icon_name() method. The "gtkmm GTK::Window Class Reference" document says that set_default_icon_name() is available in gtkmm >= 2.6, however it is not available in RHEL/CentOS 5.9 with gtkmm 2.10. Add an autoconf compile and link check for the set_default_icon_name() method and make GParted only use the method when available. Bug #695279 - GParted doesn't compile on RHEL / CentOS 5.9
This commit is contained in:
parent
456932846b
commit
a042107883
29
configure.in
29
configure.in
|
@ -263,6 +263,35 @@ PKG_CHECK_EXISTS(
|
|||
)
|
||||
|
||||
|
||||
dnl Check for Gtk::Window::set_default_icon_name() method
|
||||
dnl NOTE:
|
||||
dnl The documentation says that set_default_icon_name() is available in gtkmm >= 2.6.
|
||||
dnl gtkmm GTK::Window Class Reference
|
||||
dnl https://developer.gnome.org/gtkmm/3.6/classGtk_1_1Window.html#a533d03e9b92d8ccd142ab3a44005cae4
|
||||
dnl However it is not available in RHEL/CentOS 5.9 with gtkmm 2.10. Therefore a package
|
||||
dnl version check isn't sufficient. Instead perform a more accurate, but slower, compile
|
||||
dnl and link a test program check.
|
||||
AC_LANG_PUSH([C++])
|
||||
CXXFLAGS_save="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS `pkg-config gtkmm-2.4 --cflags --libs`"
|
||||
AC_MSG_CHECKING([for Gtk::Window::set_default_icon_name method])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <gtkmm.h>]],
|
||||
[[Gtk::Window mywindow;
|
||||
mywindow.set_default_icon_name("myappname");
|
||||
]]
|
||||
)],
|
||||
[AC_DEFINE([HAVE_SET_DEFAULT_ICON_NAME], 1,
|
||||
[Define to 1 if gtkmm-2.4 provides Gtk::Window::set_default_icon_name() method.])
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[AC_MSG_RESULT([no])]
|
||||
)
|
||||
CXXFLAGS="$CXXFLAGS_save"
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
|
||||
dnl GTKMM 2.16 needed for gtk_show_uri()
|
||||
PKG_CHECK_EXISTS([gtkmm-2.4 >= 2.16.0],
|
||||
[AC_DEFINE([HAVE_GTK_SHOW_URI], 1, [Define to 1 if you have gtk_show_uri])],
|
||||
|
|
|
@ -75,14 +75,16 @@ Win_GParted::Win_GParted( const std::vector<Glib::ustring> & user_devices )
|
|||
this ->set_title( _("GParted") );
|
||||
this ->set_default_size( 775, 500 );
|
||||
|
||||
#ifdef HAVE_SET_DEFAULT_ICON_NAME
|
||||
try
|
||||
{
|
||||
this ->set_default_icon_name( "gparted" ) ;
|
||||
}
|
||||
catch ( Glib::Exception & e )
|
||||
{
|
||||
{
|
||||
std::cout << e .what() << std::endl ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//Pack the main box
|
||||
this ->add( vbox_main );
|
||||
|
|
Loading…
Reference in New Issue