Fix autoconf check for set_default_icon_name method (#695279)

The autoconf check for the Gtk::Window::set_default_icon_name() method
was failing to detect its availability, but only on Ubuntu >= 11.10.

Turns out that the autoconf check incorrectly defined the link libraries
via the C++ flags variable CXXFLAGS, rather than the LIBS variable.
This resulted in the libraries being specified in the wrong order on the
command line.  The test only failed when Ubuntu also added the
"--as-needed" flag to the linker by default [1] which required the
libraries to be correctly specified at the end of the command line.

[1] Ubuntu 11.10 Release Notes, GCC 4.6 Toolchain
    https://wiki.ubuntu.com/OneiricOcelot/ReleaseNotes#GCC_4.6_Toolchain

This fixes commit:

    a042107883
    Only use Gtk::Window::set_default_icon_name method when available

Bug #695279 - GParted doesn't compile on RHEL / CentOS 5.9
This commit is contained in:
Mike Fleetwood 2013-04-29 19:48:43 +01:00 committed by Curtis Gedak
parent 9475731ac8
commit b7b2af4f5e
1 changed files with 4 additions and 1 deletions

View File

@ -297,7 +297,9 @@ dnl version check isn't sufficient. Instead perform a more accurate, but slower
dnl and link a test program check.
AC_LANG_PUSH([C++])
CXXFLAGS_save="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS `pkg-config gtkmm-2.4 --cflags --libs`"
CXXFLAGS="$CXXFLAGS `pkg-config gtkmm-2.4 --cflags`"
LIBS_save="$LIBS"
LIBS="`pkg-config gtkmm-2.4 --libs`"
AC_MSG_CHECKING([for Gtk::Window::set_default_icon_name method])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
@ -316,6 +318,7 @@ AC_LINK_IFELSE(
]
)
CXXFLAGS="$CXXFLAGS_save"
LIBS="$LIBS_save"
AC_LANG_POP([C++])