From 51e3caeb188e3b98797fb390ca131ae80add91ed Mon Sep 17 00:00:00 2001 From: Song Tang Date: Wed, 9 Apr 2025 12:52:32 +1000 Subject: [PATCH 1/2] Conditionally check static libraries --- configure.ac | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9120132..98b03f1 100644 --- a/configure.ac +++ b/configure.ac @@ -67,8 +67,14 @@ PKG_CHECK_MODULES( ], [AC_MSG_ERROR([libconfig library not found])])] ) -AC_CHECK_LIB([intl], [libintl_dgettext]) # needed to statically link libparted, but not given in its pkgconfig file -AC_CHECK_LIB([uuid], [uuid_generate]) # needed to statically link libparted, but not given in its pkgconfig file +# Libraries needed for static linking with parted +if echo "$LDFLAGS" | grep -q "static"; then + AC_CHECK_LIB([intl], [libintl_dgettext]) + AC_CHECK_LIB([uuid], [uuid_generate]) + AC_CHECK_LIB([devmapper], [dm_task_create], [LIBS="-ldevmapper $LIBS"], [AC_MSG_ERROR([devmapper library not found])]) + AC_CHECK_LIB([blkid], [blkid_new_probe], [LIBS="-lblkid $LIBS"], [AC_MSG_ERROR([blkid library not found])]) +fi + PKG_CHECK_MODULES([PARTED], [libparted]) AC_CHECK_LIB([pthread], [main], ,[AC_MSG_ERROR([pthread development library not found])]) From 16d988557785f0f42683f49dcf02e0e8edbf170c Mon Sep 17 00:00:00 2001 From: Song Tang Date: Wed, 9 Apr 2025 13:22:08 +1000 Subject: [PATCH 2/2] Remove libintl from static linking library It is not needed with parted-3.6 --- configure.ac | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 98b03f1..f513554 100644 --- a/configure.ac +++ b/configure.ac @@ -69,10 +69,9 @@ PKG_CHECK_MODULES( # Libraries needed for static linking with parted if echo "$LDFLAGS" | grep -q "static"; then - AC_CHECK_LIB([intl], [libintl_dgettext]) - AC_CHECK_LIB([uuid], [uuid_generate]) - AC_CHECK_LIB([devmapper], [dm_task_create], [LIBS="-ldevmapper $LIBS"], [AC_MSG_ERROR([devmapper library not found])]) - AC_CHECK_LIB([blkid], [blkid_new_probe], [LIBS="-lblkid $LIBS"], [AC_MSG_ERROR([blkid library not found])]) + AC_CHECK_LIB([uuid], [uuid_generate], [LIBS="-luuid $LIBS"], [AC_MSG_ERROR([libuuid is required for static linking but not found])]) + AC_CHECK_LIB([devmapper], [dm_task_create], [LIBS="-ldevmapper $LIBS"], [AC_MSG_ERROR([libdevmapper is required for static linking but not found])]) + AC_CHECK_LIB([blkid], [blkid_new_probe], [LIBS="-lblkid $LIBS"], [AC_MSG_ERROR([libblkid is required for static linking but not found])]) fi PKG_CHECK_MODULES([PARTED], [libparted])