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
This commit is contained in:
Mike Fleetwood 2014-08-06 23:17:00 +01:00 committed by Curtis Gedak
parent ed4ea6cf03
commit 080b3b080d
1 changed files with 12 additions and 9 deletions

View File

@ -158,20 +158,23 @@ dnl the library is found.
dnl dnl
dnl As the default action-if-found is overridden, LIBS isn't extended so dnl As the default action-if-found is overridden, LIBS isn't extended so
dnl saving and restoring LIBS isn't required. dnl saving and restoring LIBS isn't required.
have_old_lp_fs_resize_api=no
AC_CHECK_LIB( AC_CHECK_LIB(
[parted], [ped_file_system_resize], [parted], [ped_file_system_resize],
[have_old_lp_fs_resize_api=yes], [have_old_lp_fs_resize_api=yes]
[have_old_lp_fs_resize_api=no]
) )
dnl Check for ped_file_system_resize() function in the parted-fs-resize dnl If not already found, check for ped_file_system_resize() function in
dnl library to determine the need to use the new library. Available in dnl the parted-fs-resize library to determine the need to use the new
dnl parted >= 3.1. dnl library. Available in parted >= 3.1.
AC_CHECK_LIB( have_new_lp_fs_resize_lib=no
[parted-fs-resize], [ped_file_system_resize], AS_IF(
[have_new_lp_fs_resize_lib=yes], [test "x$have_old_lp_fs_resize_api" != xyes],
[have_new_lp_fs_resize_lib=no] [AC_CHECK_LIB(
[parted-fs-resize], [ped_file_system_resize],
[have_new_lp_fs_resize_lib=yes]
)]
) )