[gparted] Fix configuration version mismatch when using custom install of libparted (#753525)



commit 050366f6911d60c84803650bac117b30959f83af
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Tue Aug 11 18:18:54 2015 +0100

    Fix configuration version mismatch when using custom install of libparted (#753525)
    
    When configuring GParted build with a custom install of libparted the
    configure script is using the wrong version number for the version of
    libparted.  It uses the version of the system install of libparted,
    rather that the version of the specified custom install of libparted.
    
    For example configuring GParted build on CentOS 7 with system provided
    libparted 3.1 and custom install of libparted 3.2 from GIT in
    /tmp/parted-3.2-git:
        $ export CPPFLAGS=-I/tmp/parted-3.2-git/include
        $ export LDFLAGS=-L/tmp/parted-3.2-git/lib
        $ export LD_RUN_PATH=/tmp/parted-3.2-git/lib
        $ ./configure
        ...
        checking for libparted >= 1.7.1 (querying pkg-config)... 3.1
        checking for 2.0 <= libparted <= 3.0 (loop table creation doesn't delete old partitions)... (cached) 
no
        checking for libparted >= 2.2 (improved pt re-read)... (cached) yes
        checking for ped_file_system_resize in -lparted... no
        checking for ped_file_system_resize in -lparted-fs-resize... yes
        checking for libparted >= 3.2 (online resize)... (cached) no
        ...
        $ make
        $ ldd src/gpartedbin | fgrep libparted
            libparted-fs-resize.so.0 => /tmp/parted-3.2-git/lib/libparted-fs-resize.so.0 (0x00007f9a460ee000)
            libparted.so.2 => /tmp/parted-3.2-git/lib/libparted.so.2 (0x00007f9a45ea3000)
    Configure script used version 3.1 as reported by pkg-config to make most
    of the decisions (those version related checks with cached results) but
    the executable was still linked with the custom libparted 3.2 install.
    
    Temporarily rename the system libparted pkg-config file out of the way:
        # cd /usr/lib64/pkgconfig
        # mv libparted.pc libparted.pc-NOT
    and reconfigure the GParted build:
        $ ./configure
        ...
        checking for libparted >= 1.7.1 (querying pkg-config)... not found
        checking for libparted >= 1.7.1 (querying libparted)... 3.2.25-5a92
        checking for 2.0 <= libparted <= 3.0 (loop table creation doesn't delete old partitions)... (cached) 
no
        checking for libparted >= 2.2 (improved pt re-read)... (cached) yes
        checking for ped_file_system_resize in -lparted... no
        checking for ped_file_system_resize in -lparted-fs-resize... yes
        checking for libparted >= 3.2 (online resize)... (cached) yes
        ...
    Now configure is having to compile a program with the custom install of
    libparted and gets the correct version.
    
    Restore libparted pkg-config file:
        # mv libparted.pc-NOT libparted.pc
    and this time set environment variable PKG_CONFIG_PATH to inform
    pkg-config of the additional directory to search for .pc files before
    the default system location:
        $ export PKG_CONFIG_PATH=/tmp/parted-3.2-git/lib/pkgconfig
        $ ./configure
        ...
        checking for libparted >= 1.7.1 (querying pkg-config)... 3.2.25-5a92
        checking for 2.0 <= libparted <= 3.0 (loop table creation doesn't delete old partitions)... (cached) 
no
        checking for libparted >= 2.2 (improved pt re-read)... (cached) yes
        checking for ped_file_system_resize in -lparted... no
        checking for ped_file_system_resize in -lparted-fs-resize... yes
        checking for libparted >= 3.2 (online resize)... (cached) yes
        ...
    Now configure is getting the correct version of the custom install of
    libparted when querying pkg-config and thus making the correct
    decisions.
    
    Update the README file to reflect the need to also set the
    PKG_CONFIG_PATH environment variable when building GParted with a custom
    install of libparted.
    
    Bug 753525 - Configuration issues when using non-system location or
                 non-released versions of libparted

 README |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/README b/README
index ac7f644..2d9805e 100644
--- a/README
+++ b/README
@@ -159,6 +159,7 @@ c. Building using a Specific (lib)parted Version
         export CPPFLAGS=-I/usr/local/include
         export LDFLAGS=-L/usr/local/lib
         export LD_RUN_PATH=/usr/local/lib
+        export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
 
    4) Build gparted using steps listed above in "Building from Source".
 


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