From 43ffdc82fa3ef632638cf5e6899811fc4b01d351 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 2 Aug 2012 20:19:14 +0200 Subject: [PATCH] build-sys: don't compile lib{mount,blkid} tests when --disable-static specified The tests often depend on private (non-API) library functions. Signed-off-by: Karel Zak --- Documentation/howto-tests.txt | 3 +++ configure.ac | 2 ++ libblkid/src/Makemodule.am | 4 ++++ libmount/src/Makemodule.am | 3 +++ 4 files changed, 12 insertions(+) diff --git a/Documentation/howto-tests.txt b/Documentation/howto-tests.txt index f41628e997..ca14b2b953 100644 --- a/Documentation/howto-tests.txt +++ b/Documentation/howto-tests.txt @@ -9,6 +9,9 @@ $ make check + Note that the configure option --disable-static disables many of libmount and + libblkid unit tests. + Run all tests including tests that require root permissions: # cd tests diff --git a/configure.ac b/configure.ac index 99f1df0253..763ecff9b2 100644 --- a/configure.ac +++ b/configure.ac @@ -725,6 +725,7 @@ if test "x$build_libblkid" = xyes; then AC_DEFINE(HAVE_LIBBLKID, 1, [Define to 1 if you have the -lblkid.]) fi AM_CONDITIONAL(BUILD_LIBBLKID, test "x$build_libblkid" = xyes) +AM_CONDITIONAL(BUILD_LIBBLKID_TESTS, test "x$build_libblkid" = xyes -a "x$enable_static" = xyes) dnl dnl libmount @@ -738,6 +739,7 @@ UL_REQUIRES_LINUX([libmount]) UL_REQUIRES_BUILD([libmount], [libblkid]) UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier]) AM_CONDITIONAL(BUILD_LIBMOUNT, test "x$build_libmount" = xyes) +AM_CONDITIONAL(BUILD_LIBMOUNT_TESTS, test "x$build_libmount" = xyes -a "x$enable_static" = xyes) AC_SUBST([LIBMOUNT_VERSION]) AC_SUBST([LIBMOUNT_VERSION_INFO]) diff --git a/libblkid/src/Makemodule.am b/libblkid/src/Makemodule.am index b168c7c1e9..de60458014 100644 --- a/libblkid/src/Makemodule.am +++ b/libblkid/src/Makemodule.am @@ -131,6 +131,7 @@ EXTRA_DIST += \ libblkid/src/blkid.sym \ libblkid/src/blkid.h.in +if BUILD_LIBBLKID_TESTS check_PROGRAMS += \ test_blkid_cache \ test_blkid_config \ @@ -210,6 +211,9 @@ test_blkid_verify_CFLAGS = $(blkid_tests_cflags) test_blkid_verify_LDFLAGS = $(blkid_tests_ldflags) test_blkid_verify_LDADD = $(blkid_tests_ldadd) +endif # BUILD_LIBBLKID_TESTS + + # move lib from $(usrlib_execdir) to $(libdir) if needed install-exec-hook-libblkid: if test "$(usrlib_execdir)" != "$(libdir)"; then \ diff --git a/libmount/src/Makemodule.am b/libmount/src/Makemodule.am index 8a6b2adf7e..494e02a34d 100644 --- a/libmount/src/Makemodule.am +++ b/libmount/src/Makemodule.am @@ -50,6 +50,7 @@ EXTRA_DIST += \ libmount/src/libmount.sym \ libmount/src/libmount.h.in +if BUILD_LIBMOUNT_TESTS check_PROGRAMS += \ test_mount_cache \ test_mount_context \ @@ -114,6 +115,8 @@ test_mount_version_CFLAGS = $(libmount_tests_cflags) test_mount_version_LDFLAGS = $(libmount_tests_ldflags) test_mount_version_LDADD = $(libmount_tests_ldadd) +endif # BUILD_LIBMOUNT_TESTS + # move lib from $(usrlib_execdir) to $(libdir) if needed install-exec-hook-libmount: -- 2.47.3