]> git.ipfire.org Git - thirdparty/kmod.git/blobdiff - Makefile.am
Do not check for undefined symbols when building the Python modules
[thirdparty/kmod.git] / Makefile.am
index 7774759c5928814663488a678a6e8b3f6467604b..8e9c90d8c011d8ece553c31cbf3bb5bba25bec19 100644 (file)
@@ -7,6 +7,7 @@ endif
 DISTCLEAN_LOCAL_HOOKS =
 EXTRA_DIST =
 CLEANFILES = $(BUILT_FILES)
+DISTCLEANFILES =
 BUILT_FILES =
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 AM_MAKEFLAGS = --no-print-directory
@@ -34,14 +35,16 @@ SED_PROCESS = \
        -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=9
-LIBKMOD_AGE=2
+LIBKMOD_CURRENT=5
+LIBKMOD_REVISION=4
+LIBKMOD_AGE=3
 
 noinst_LTLIBRARIES = shared/libshared.la
 shared_libshared_la_SOURCES = \
@@ -51,6 +54,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 \
@@ -84,7 +89,7 @@ libkmod_libkmod_la_DEPENDENCIES = \
        ${top_srcdir}/libkmod/libkmod.sym
 libkmod_libkmod_la_LIBADD = \
        shared/libshared.la \
-       ${liblzma_LIBS} ${zlib_LIBS}
+       ${liblzma_LIBS} ${zlib_LIBS} ${libcrypto_LIBS}
 
 noinst_LTLIBRARIES += libkmod/libkmod-internal.la
 libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
@@ -127,6 +132,13 @@ tools_kmod_SOURCES = \
        tools/modinfo.c tools/modprobe.c \
        tools/depmod.c tools/log.h tools/log.c \
        tools/static-nodes.c
+
+if BUILD_EXPERIMENTAL
+tools_kmod_SOURCES += \
+       tools/insert.c \
+       tools/remove.c
+endif
+
 tools_kmod_LDADD = \
        shared/libshared.la \
        libkmod/libkmod-internal.la
@@ -161,7 +173,7 @@ 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
+CPYTHON_MODULE_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared -Wl,-z,undefs
 
 if BUILD_PYTHON
 pkgpyexec_LTLIBRARIES = \
@@ -215,10 +227,11 @@ ROOTFS = testsuite/rootfs
 ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine
 CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) && \
                                cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \
-                               touch testsuite/stamp-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) ) && \
+                               touch testsuite/stamp-rootfs
 
 build-module-playground:
        $(AM_V_GEN)if test "$(top_srcdir)" != "$(top_builddir)"; then \
@@ -226,7 +239,12 @@ build-module-playground:
                cp -r $(top_srcdir)/$(MODULE_PLAYGROUND) $(top_builddir)/$(MODULE_PLAYGROUND) && \
                find $(top_builddir)/$(MODULE_PLAYGROUND) -type d -exec chmod +w {} \; ; \
                fi
+if BUILD_MODULES
        $(MAKE) -C $(MODULE_PLAYGROUND)
+else
+       $(MAKE) -C $(MODULE_PLAYGROUND) FAKE_BUILD=1
+endif
+
 
 rootfs: build-module-playground
        $(CREATE_ROOTFS)
@@ -252,13 +270,37 @@ check-sysconfdir:
 check-am: rootfs check-sysconfdir
 
 
-EXTRA_DIST += testsuite/module-playground/Makefile \
-             testsuite/module-playground/mod-foo.c \
-             testsuite/module-playground/mod-foo-a.c \
-             testsuite/module-playground/mod-foo-b.c \
-             testsuite/module-playground/mod-foo-c.c \
-             testsuite/module-playground/mod-simple.c
-
+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 \
+       testsuite/module-playground/Makefile.arch \
+       testsuite/module-playground/mod-fake-cciss.c \
+       testsuite/module-playground/mod-fake-hpsa.c \
+       testsuite/module-playground/mod-fake-scsi-mod.c \
+       testsuite/module-playground/mod-foo-a.c \
+       testsuite/module-playground/mod-foo-b.c \
+       testsuite/module-playground/mod-foo.c \
+       testsuite/module-playground/mod-foo-c.c \
+       testsuite/module-playground/mod-loop-a.c \
+       testsuite/module-playground/mod-loop-b.c \
+       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 \
+       testsuite/module-playground/mod-simple-sparc64.ko \
+       testsuite/module-playground/mod-simple-x86_64.ko \
+       testsuite/module-playground/README
 
 check_LTLIBRARIES = $(TESTSUITE_OVERRIDE_LIBS)
 
@@ -291,13 +333,21 @@ testsuite_libtestsuite_la_LIBADD = -lrt
 TESTSUITE = \
        testsuite/test-hash \
        testsuite/test-array \
+       testsuite/test-scratchbuf \
        testsuite/test-strbuf \
-       testsuite/test-init testsuite/test-testsuite testsuite/test-loaded \
+       testsuite/test-init \
+       testsuite/test-initstate \
+       testsuite/test-testsuite testsuite/test-loaded \
        testsuite/test-modinfo testsuite/test-util testsuite/test-new-module \
        testsuite/test-modprobe testsuite/test-blacklist \
        testsuite/test-dependencies testsuite/test-depmod \
        testsuite/test-list
 
+if BUILD_EXPERIMENTAL
+TESTSUITE += \
+       testsuite/test-tools
+endif
+
 check_PROGRAMS = $(TESTSUITE)
 TESTS = $(TESTSUITE)
 
@@ -311,11 +361,16 @@ 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)
 
 testsuite_test_init_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_init_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
+testsuite_test_initstate_LDADD = $(TESTSUITE_LDADD)
+testsuite_test_initstate_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 testsuite_test_loaded_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_loaded_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 testsuite_test_modinfo_LDADD = $(TESTSUITE_LDADD)
@@ -335,6 +390,11 @@ testsuite_test_depmod_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 testsuite_test_list_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_list_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 
+if BUILD_EXPERIMENTAL
+testsuite_test_tools_LDADD = $(TESTSUITE_LDADD)
+testsuite_test_tools_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
+endif
+
 testsuite-distclean:
        $(RM) -r $(ROOTFS)
        $(RM) testsuite/stamp-rootfs
@@ -347,7 +407,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-openssl \
        --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir)
 
 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
@@ -394,6 +454,31 @@ lcov-run lcov-report:
 
 endif
 
+# ------------------------------------------------------------------------------
+# coverity
+# ------------------------------------------------------------------------------
+
+kmod-coverity-%.tar.xz:
+       rm -rf $< cov-int
+       ./autogen.sh c --disable-python --disable-manpages
+       make clean
+       cov-build --dir cov-int make -j 4
+       tar caf $@ cov-int
+
+coverity-tar: kmod-coverity-$(shell git describe  2>/dev/null).tar.xz
+
+coverity-sync: kmod-coverity-$(shell git describe 2>/dev/null).tar.xz
+       @echo "uploading coverity tarball"
+       @curl --form token=$(COVERITY_KMOD_TOKEN) \
+               --form email=lucas.de.marchi@gmail.com \
+               --form file=@$< \
+               --form version="$(shell git describe)" \
+               --form description="" \
+               https://scan.coverity.com/builds?project=kmod
+
+coverity-clean:
+       rm -rf kmod-coverity-*.tar.xz cov-int
+
 # ------------------------------------------------------------------------------
 # custom release helpers
 # ------------------------------------------------------------------------------
@@ -414,3 +499,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