[gparted] Add configure check for libparted version 3.0.0 or higher
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Add configure check for libparted version 3.0.0 or higher
- Date: Thu, 9 Jun 2011 16:01:39 +0000 (UTC)
commit 13568bcee7dad4e63346c4570d0238c68831730d
Author: Curtis Gedak <gedakc gmail com>
Date: Wed Jun 8 10:38:55 2011 -0600
Add configure check for libparted version 3.0.0 or higher
This enhancement is in preparation for addressing the following bug
report:
Bug #651559 - Doesn't compile against parted 3.0
configure.in | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 53 insertions(+), 1 deletions(-)
---
diff --git a/configure.in b/configure.in
index 427de2a..436051d 100644
--- a/configure.in
+++ b/configure.in
@@ -131,6 +131,55 @@ int main ()
LIBS="$LIBS_save"
+dnl======================
+dnl check whether libparted >= 3.0 (libparted is missing file system resizing API)
+dnl======================
+LIBPARTED_VERSION=3.0
+AC_MSG_CHECKING([if libparted >= $LIBPARTED_VERSION (libparted is missing file system resizing API)])
+LIBS_save="$LIBS"
+LIBS="-lparted -luuid -ldl"
+need_work_around=yes
+AC_TRY_RUN([
+#include <stdio.h>
+#include <parted/parted.h>
+
+int main ()
+{
+ int min_major = 0;
+ int min_minor = 0;
+ int min_micro = 0;
+ int major = 0;
+ int minor = 0;
+ int micro = 0;
+
+ if ( ( sscanf( "$LIBPARTED_VERSION", "%d.%d.%d", &min_major, &min_minor, &min_micro ) == 3 ) ||
+ ( sscanf( "$LIBPARTED_VERSION", "%d.%d", &min_major, &min_minor ) == 2 ) ||
+ ( sscanf( "$LIBPARTED_VERSION", "%d", &min_major ) == 1 )
+ )
+ {
+ if ( ( sscanf( ped_get_version(), "%d.%d.%d", &major, &minor, µ ) == 3 ) ||
+ ( sscanf( ped_get_version(), "%d.%d", &major, &minor ) == 2 ) ||
+ ( sscanf( ped_get_version(), "%d", &major ) == 1 )
+ )
+ {
+ return ! ( (major > min_major) ||
+ ( (major == min_major) && (minor > min_minor) ) ||
+ ( (major == min_major) && (minor == min_minor) && (micro >= min_micro) )
+ ) ;
+ }
+ }
+
+ return 1 ;
+}
+], [AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_LIBPARTED_3_0_0_PLUS], [1], [Define to 1 if libparted >= 3.0])
+ have_lp_fs_resize_api=no]
+, [AC_MSG_RESULT([no])
+ have_lp_fs_resize_api=yes]
+)
+LIBS="$LIBS_save"
+
+
dnl GTKMM
PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 > 2.8])
AC_SUBST([GTKMM_LIBS])
@@ -215,9 +264,12 @@ echo " Installing into prefix : $prefix"
echo ""
echo " Build documentation? : $enable_doc"
echo ""
+echo " Use native libparted dmraid support? : $enable_libparted_dmraid"
+echo ""
+echo " --- Features Based On Libparted Version ---"
echo " Need partition table re-read work around? : $need_pt_reread_work_around"
echo " Supports sector sizes > 512 bytes? : $support_sector_size_gt_512"
-echo " Use native libparted dmraid support? : $enable_libparted_dmraid"
+echo " Have libparted file system resizing API? : $have_lp_fs_resize_api"
echo ""
echo " If all settings are OK, type make and make install "
echo "=================================================================="
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]