[gparted] Only check for ped_file_system_resize() once if possible (#734718)



commit 080b3b080d48456180d84c04cdbc1766ccf9c96d
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Wed Aug 6 23:17:00 2014 +0100

    Only check for ped_file_system_resize() once if possible (#734718)
    
    If ped_file_system_resize() function is found in the parted library
    don't bother to go on to check for it in the parted-fs-resize library.
    
    Bug #734718 - Update Autoconf version specific libparted checks and
                  defines to feature specific ones

 configure.ac |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9be0292..c500def 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,20 +158,23 @@ dnl the library is found.
 dnl
 dnl As the default action-if-found is overridden, LIBS isn't extended so
 dnl saving and restoring LIBS isn't required.
+have_old_lp_fs_resize_api=no
 AC_CHECK_LIB(
        [parted], [ped_file_system_resize],
-       [have_old_lp_fs_resize_api=yes],
-       [have_old_lp_fs_resize_api=no]
+       [have_old_lp_fs_resize_api=yes]
 )
 
 
-dnl Check for ped_file_system_resize() function in the parted-fs-resize
-dnl library to determine the need to use the new library.  Available in
-dnl parted >= 3.1.
-AC_CHECK_LIB(
-       [parted-fs-resize], [ped_file_system_resize],
-       [have_new_lp_fs_resize_lib=yes],
-       [have_new_lp_fs_resize_lib=no]
+dnl If not already found, check for ped_file_system_resize() function in
+dnl the parted-fs-resize library to determine the need to use the new
+dnl library.  Available in parted >= 3.1.
+have_new_lp_fs_resize_lib=no
+AS_IF(
+       [test "x$have_old_lp_fs_resize_api" != xyes],
+       [AC_CHECK_LIB(
+               [parted-fs-resize], [ped_file_system_resize],
+               [have_new_lp_fs_resize_lib=yes]
+       )]
 )
 
 


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