]> git.ipfire.org Git - thirdparty/kmod.git/blobdiff - Makefile.am
test-modprobe: share single function for kcmdline tests
[thirdparty/kmod.git] / Makefile.am
index 6679deb1e3632ed9923cc354386e32d455285f23..24a586e795ce2f2e489f06dcc948a1241ec4b23a 100644 (file)
@@ -31,18 +31,35 @@ SED_PROCESS = \
        -e 's,@exec_prefix\@,$(exec_prefix),g' \
        -e 's,@libdir\@,$(libdir),g' \
        -e 's,@includedir\@,$(includedir),g' \
+       -e 's,@libzstd_CFLAGS\@,${libzstd_CFLAGS},g' \
+       -e 's,@libzstd_LIBS\@,${libzstd_LIBS},g' \
        -e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \
        -e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
        -e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
        -e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
+       -e 's,@libcrypto_CFLAGS\@,${libcrypto_CFLAGS},g' \
+       -e 's,@libcrypto_LIBS\@,${libcrypto_LIBS},g' \
        < $< > $@ || rm $@
 
 %.pc: %.pc.in Makefile
        $(SED_PROCESS)
 
-LIBKMOD_CURRENT=4
-LIBKMOD_REVISION=11
-LIBKMOD_AGE=2
+# Rules for libtool versioning (from https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html)
+# 1. Start with version information of ‘0:0:0’ for each libtool library.
+# 2. Update the version information only immediately before a public release of
+#    your software. More frequent updates are unnecessary, and only guarantee that
+#    the current interface number gets larger faster.
+# 3. If the library source code has changed at all since the last update, then
+#    increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
+# 4. If any interfaces have been added, removed, or changed since the last
+#    update, increment current, and set revision to 0.
+# 5. If any interfaces have been added since the last public release, then
+#    increment age.
+# 6. If any interfaces have been removed or changed since the last public
+#    release, then set age to 0.
+LIBKMOD_CURRENT=5
+LIBKMOD_REVISION=6
+LIBKMOD_AGE=3
 
 noinst_LTLIBRARIES = shared/libshared.la
 shared_libshared_la_SOURCES = \
@@ -52,6 +69,8 @@ shared_libshared_la_SOURCES = \
        shared/array.h \
        shared/hash.c \
        shared/hash.h \
+       shared/scratchbuf.c \
+       shared/scratchbuf.h \
        shared/strbuf.c \
        shared/strbuf.h \
        shared/util.c \
@@ -64,6 +83,7 @@ libkmod_libkmod_la_SOURCES = \
        libkmod/libkmod.h \
        libkmod/libkmod-internal.h \
        libkmod/libkmod.c \
+       libkmod/libkmod-builtin.c \
        libkmod/libkmod-list.c \
        libkmod/libkmod-config.c \
        libkmod/libkmod-index.c \
@@ -85,7 +105,7 @@ libkmod_libkmod_la_DEPENDENCIES = \
        ${top_srcdir}/libkmod/libkmod.sym
 libkmod_libkmod_la_LIBADD = \
        shared/libshared.la \
-       ${liblzma_LIBS} ${zlib_LIBS}
+       ${libzstd_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libcrypto_LIBS}
 
 noinst_LTLIBRARIES += libkmod/libkmod-internal.la
 libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
@@ -169,7 +189,10 @@ CPYTHON_MODULE_CFLAGS = \
        $(AM_CFLAGS) -DCPYTHON_COMPILING_IN_PYPY=0 \
        $(PYTHON_NOWARN) $(PYTHON_CFLAGS) \
        -fvisibility=default
-CPYTHON_MODULE_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared
+# Filter -Wl,--no-undefined to fix build with python 3.8
+comma = ,
+CPYTHON_MODULE_LDFLAGS = $(subst -Wl$(comma)--no-undefined,,$(AM_LDFLAGS))
+CPYTHON_MODULE_LDFLAGS += -module -avoid-version -shared
 
 if BUILD_PYTHON
 pkgpyexec_LTLIBRARIES = \
@@ -226,7 +249,7 @@ CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) &
                                find $(ROOTFS) -type d -exec chmod +w {} \; && \
                                find $(ROOTFS) -type f -name .gitignore -exec rm -f {} \; && \
                                $(top_srcdir)/testsuite/populate-modules.sh \
-                                       $(MODULE_PLAYGROUND) $(ROOTFS) ) && \
+                                       $(MODULE_PLAYGROUND) $(ROOTFS) $(top_builddir)/config.h ) && \
                                touch testsuite/stamp-rootfs
 
 build-module-playground:
@@ -257,17 +280,12 @@ TESTSUITE_OVERRIDE_LIBS = \
 TESTSUITE_OVERRIDE_LIBS_LDFLAGS = \
        avoid-version -module -shared -export-dynamic -rpath /nowhere -ldl
 
-check-sysconfdir:
-       $(AM_V_at)if test "$(sysconfdir)" != "/etc" -a "$(sysconfdir)" != "/etc/"; then \
-               echo "warning: Some tests will fail without --sysconfdir=/etc" >&2; \
-       fi
-.PHONY: check-sysconfdir
-
-check-am: rootfs check-sysconfdir
+check-am: rootfs
 
 
 EXTRA_DIST += \
        testsuite/module-playground/cache \
+       testsuite/module-playground/dummy.pkcs7 \
        testsuite/module-playground/dummy.sha1 \
        testsuite/module-playground/dummy.sha256 \
        testsuite/module-playground/Makefile \
@@ -284,6 +302,12 @@ EXTRA_DIST += \
        testsuite/module-playground/mod-loop-c.c \
        testsuite/module-playground/mod-loop-d.c \
        testsuite/module-playground/mod-loop-e.c \
+       testsuite/module-playground/mod-loop-f.c \
+       testsuite/module-playground/mod-loop-g.c \
+       testsuite/module-playground/mod-loop-h.c \
+       testsuite/module-playground/mod-loop-i.c \
+       testsuite/module-playground/mod-loop-j.c \
+       testsuite/module-playground/mod-loop-k.c \
        testsuite/module-playground/mod-loop.h \
        testsuite/module-playground/mod-simple.c \
        testsuite/module-playground/mod-simple-i386.ko \
@@ -311,6 +335,10 @@ TESTSUITE_LDADD = \
        testsuite/libtestsuite.la libkmod/libkmod-internal.la \
        shared/libshared.la
 
+if KMOD_SYSCONFDIR_NOT_ETC
+TESTSUITE_CPPFLAGS += -DKMOD_SYSCONFDIR_NOT_ETC
+endif
+
 check_LTLIBRARIES += testsuite/libtestsuite.la
 testsuite_libtestsuite_la_SOURCES = \
        testsuite/testsuite.c testsuite/testsuite.h
@@ -322,6 +350,7 @@ testsuite_libtestsuite_la_LIBADD = -lrt
 TESTSUITE = \
        testsuite/test-hash \
        testsuite/test-array \
+       testsuite/test-scratchbuf \
        testsuite/test-strbuf \
        testsuite/test-init \
        testsuite/test-initstate \
@@ -349,6 +378,9 @@ testsuite_test_hash_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 testsuite_test_array_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_array_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 
+testsuite_test_scratchbuf_LDADD = $(TESTSUITE_LDADD)
+testsuite_test_scratchbuf_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
+
 testsuite_test_strbuf_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_strbuf_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 
@@ -392,7 +424,7 @@ DISTCLEAN_LOCAL_HOOKS += testsuite-distclean
 EXTRA_DIST += testsuite/rootfs-pristine
 
 DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-python --sysconfdir=/etc \
-       --with-zlib \
+       --with-zlib --with-zstd --with-openssl \
        --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir)
 
 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
@@ -400,8 +432,6 @@ distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
 buildtest-TESTS:
        $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
 
-DISTCLEANFILES += $(DOLT_CLEANFILES)
-
 # ------------------------------------------------------------------------------
 # coverage
 # ------------------------------------------------------------------------------
@@ -447,7 +477,7 @@ endif
 
 kmod-coverity-%.tar.xz:
        rm -rf $< cov-int
-       ./bootstrap-configure --disable-python --disable-manpages
+       ./autogen.sh c --disable-python --disable-manpages
        make clean
        cov-build --dir cov-int make -j 4
        tar caf $@ cov-int
@@ -486,3 +516,13 @@ tar: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
 
 tar-sync: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
        kup put kmod-$(VERSION).tar.xz  kmod-$(VERSION).tar.sign /pub/linux/utils/kernel/kmod/
+
+# ------------------------------------------------------------------------------
+# mkosi
+# ------------------------------------------------------------------------------
+
+DISTRO ?= "arch"
+
+mkosi:
+       -$(MKDIR_P) $(top_srcdir)/testsuite/mkosi/mkosi.cache
+       $(MKOSI) -C $(top_srcdir)/testsuite/mkosi --build-sources ../../ --default mkosi.${DISTRO} -fi