From 7c605f573122d346c20d9ac3be6db05959f4eaf8 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 8 Oct 2019 15:17:59 +0200 Subject: Add a configure option to disable building the tools If this option is used, only libsquashfs is built and installed, and the test cases for the other helper libraries are deactivated. Signed-off-by: David Oberhollenzer --- Makefile.am | 8 ++++++-- configure.ac | 29 ++++++++++++++++++++--------- tests/Makemodule.am | 36 +++++++++++++++++++----------------- 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/Makefile.am b/Makefile.am index cbf21b9..e603912 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,16 +15,20 @@ pkgconfig_DATA = EXTRA_DIST = autogen.sh LICENSE-gpl.txt LICENSE-lgpl.txt README.md CHANGELOG.md TESTS = +include lib/sqfs/Makemodule.am +include lib/util/Makemodule.am + +if BUILD_TOOLS include doc/Makemodule.am include lib/fstree/Makemodule.am -include lib/sqfs/Makemodule.am include lib/common/Makemodule.am include lib/tar/Makemodule.am -include lib/util/Makemodule.am include tar/Makemodule.am include mkfs/Makemodule.am include unpack/Makemodule.am include difftool/Makemodule.am +endif + include tests/Makemodule.am if HAVE_DOXYGEN diff --git a/configure.ac b/configure.ac index 4eaa61c..018b3f6 100644 --- a/configure.ac +++ b/configure.ac @@ -69,6 +69,13 @@ AC_ARG_WITH([pthread], [Build without pthread based block compressor])], [want_pthread="${withval}"], [want_pthread="yes"]) +AC_ARG_WITH([tools], + [AS_HELP_STRING([--without-tools], + [Only build libsquashfs, do not build the tools.])], + [build_tools="${withval}"], [build_tools="yes"]) + +AM_CONDITIONAL([BUILD_TOOLS], [test "x$build_tools" = "xyes"]) + ##### Doxygen reference manual ##### AC_CHECK_PROGS([DOXYGEN], [doxygen]) @@ -131,17 +138,21 @@ if test "x$want_lzo" != "xno"; then ) fi -AM_CONDITIONAL([WITH_SELINUX], [false]) +if test "x$build_tools" = "xyes"; then + AM_CONDITIONAL([WITH_SELINUX], [false]) -if test "x$want_selinux" != "xno"; then - AM_CONDITIONAL([WITH_SELINUX], [true]) + if test "x$want_selinux" != "xno"; then + AM_CONDITIONAL([WITH_SELINUX], [true]) - PKG_CHECK_MODULES(LIBSELINUX, [libselinux], [], - [AM_CONDITIONAL([WITH_SELINUX], [false])]) - AC_CHECK_HEADERS([selinux/selinux.h], [], - [AM_CONDITIONAL([WITH_SELINUX], [false])]) - AC_CHECK_HEADERS([selinux/label.h], [], - [AM_CONDITIONAL([WITH_SELINUX], [false])]) + PKG_CHECK_MODULES(LIBSELINUX, [libselinux], [], + [AM_CONDITIONAL([WITH_SELINUX], [false])]) + AC_CHECK_HEADERS([selinux/selinux.h], [], + [AM_CONDITIONAL([WITH_SELINUX], [false])]) + AC_CHECK_HEADERS([selinux/label.h], [], + [AM_CONDITIONAL([WITH_SELINUX], [false])]) + fi +else + want_selinux="no" fi case "$want_xz" in diff --git a/tests/Makemodule.am b/tests/Makemodule.am index 8a2241f..45565bb 100644 --- a/tests/Makemodule.am +++ b/tests/Makemodule.am @@ -1,6 +1,17 @@ test_canonicalize_name_SOURCES = tests/canonicalize_name.c test_canonicalize_name_LDADD = libutil.la +test_str_table_SOURCES = tests/str_table.c +test_str_table_LDADD = libutil.la +test_str_table_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(top_srcdir)/tests + +test_abi_SOURCES = tests/abi.c +test_abi_LDADD = libsquashfs.la + +check_PROGRAMS += test_canonicalize_name test_str_table test_abi +TESTS += test_canonicalize_name test_str_table test_abi + +if BUILD_TOOLS test_mknode_simple_SOURCES = tests/mknode_simple.c test_mknode_simple_LDADD = libfstree.a @@ -66,36 +77,27 @@ test_tar_xattr_schily_LDADD = libtar.a libutil.la test_tar_xattr_schily_CPPFLAGS = $(AM_CPPFLAGS) test_tar_xattr_schily_CPPFLAGS += -DTESTPATH=$(top_srcdir)/tests/tar -test_str_table_SOURCES = tests/str_table.c -test_str_table_LDADD = libutil.la -test_str_table_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(top_srcdir)/tests - -test_abi_SOURCES = tests/abi.c -test_abi_LDADD = libsquashfs.la - fstree_fuzz_SOURCES = tests/fstree_fuzz.c fstree_fuzz_LDADD = libfstree.a libutil.la tar_fuzz_SOURCES = tests/tar_fuzz.c tar_fuzz_LDADD = libtar.a libutil.la -check_PROGRAMS += test_canonicalize_name test_mknode_simple test_mknode_slink -check_PROGRAMS += test_mknode_reg test_mknode_dir test_gen_inode_table -check_PROGRAMS += test_add_by_path test_get_path test_fstree_sort -check_PROGRAMS += test_fstree_from_file test_fstree_init -check_PROGRAMS += test_tar_ustar test_tar_pax test_tar_gnu test_tar_sparse_gnu -check_PROGRAMS += test_tar_sparse_gnu1 test_tar_sparse_gnu2 -check_PROGRAMS += test_tar_xattr_bsd test_tar_xattr_schily test_str_table -check_PROGRAMS += test_abi +check_PROGRAMS += test_mknode_simple test_mknode_slink test_mknode_reg +check_PROGRAMS += test_mknode_dir test_gen_inode_table test_add_by_path +check_PROGRAMS += test_get_path test_fstree_sort test_fstree_from_file +check_PROGRAMS += test_fstree_init test_tar_ustar test_tar_pax test_tar_gnu +check_PROGRAMS += test_tar_sparse_gnu test_tar_sparse_gnu1 test_tar_sparse_gnu2 +check_PROGRAMS += test_tar_xattr_bsd test_tar_xattr_schily noinst_PROGRAMS += fstree_fuzz tar_fuzz -TESTS += test_canonicalize_name test_mknode_simple test_mknode_slink +TESTS += test_mknode_simple test_mknode_slink TESTS += test_mknode_reg test_mknode_dir test_gen_inode_table TESTS += test_add_by_path test_get_path test_fstree_sort test_fstree_from_file TESTS += test_fstree_init test_tar_ustar test_tar_pax TESTS += test_tar_gnu test_tar_sparse_gnu test_tar_sparse_gnu1 TESTS += test_tar_sparse_gnu2 test_tar_xattr_bsd test_tar_xattr_schily -TESTS += test_str_table test_abi +endif EXTRA_DIST += $(top_srcdir)/tests/tar $(top_srcdir)/tests/words.txt -- cgit v1.2.3