[gparted] Fix autoconf check for set_default_icon_name method (#695279)



commit b7b2af4f5eee7445c626b5f91f5890bd7fd3f3ca
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Mon Apr 29 19:48:43 2013 +0100

    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:
    
        a04210788399736ff7f097cb75650ebcbd0a4950
        Only use Gtk::Window::set_default_icon_name method when available
    
    Bug #695279 - GParted doesn't compile on RHEL / CentOS 5.9

 configure.ac |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c28f71d..c75318d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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++])
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]