From 09f236e0d168758ba69b8b35e23c199c7d2d7f2e Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Fri, 21 Feb 2025 17:09:37 -0600 Subject: [PATCH] build: Drop autotools Simplify our lives by handling just one build system. Signed-off-by: Lucas De Marchi --- Makefile.am | 448 --------------------------------------- autogen.sh | 84 -------- configure.ac | 360 ------------------------------- libkmod/docs/Makefile.am | 34 --- m4/.gitignore | 6 - m4/attributes.m4 | 277 ------------------------ m4/features.m4 | 24 --- man/Makefile.am | 28 --- meson.build | 6 - 9 files changed, 1267 deletions(-) delete mode 100644 Makefile.am delete mode 100755 autogen.sh delete mode 100644 configure.ac delete mode 100644 libkmod/docs/Makefile.am delete mode 100644 m4/.gitignore delete mode 100644 m4/attributes.m4 delete mode 100644 m4/features.m4 delete mode 100644 man/Makefile.am diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 3401265b..00000000 --- a/Makefile.am +++ /dev/null @@ -1,448 +0,0 @@ -SUBDIRS = . libkmod/docs - -if BUILD_MANPAGES -SUBDIRS += man -endif - -DISTCLEAN_LOCAL_HOOKS = -EXTRA_DIST = -CLEANFILES = $(BUILT_FILES) -DISTCLEANFILES = -BUILT_FILES = -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -AM_MAKEFLAGS = --no-print-directory - -GCC_COLORS ?= 'yes' -export GCC_COLORS - -# meson bits -EXTRA_DIST += \ - libkmod/docs/meson.build \ - man/meson.build \ - meson.build \ - meson_options.txt \ - testsuite/meson.build \ - scripts/build-scdoc.sh \ - scripts/sanitizer-env.sh \ - scripts/test-gtkdoc.sh - -AM_CPPFLAGS = \ - -include $(top_builddir)/config.h \ - -I$(top_srcdir) \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DDISTCONFDIR=\""$(distconfdir)"\" \ - -DMODULE_DIRECTORY=\""$(module_directory)"\" \ - ${zlib_CFLAGS} - -AM_CFLAGS = $(OUR_CFLAGS) -AM_LDFLAGS = $(OUR_LDFLAGS) - -# 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=7 -LIBKMOD_REVISION=1 -LIBKMOD_AGE=5 - -noinst_LTLIBRARIES = shared/libshared.la -shared_libshared_la_SOURCES = \ - shared/array.c \ - shared/array.h \ - shared/elf-note.h \ - shared/hash.c \ - shared/hash.h \ - shared/macro.h \ - shared/missing.h \ - shared/strbuf.c \ - shared/strbuf.h \ - shared/util.c \ - shared/util.h - -include_HEADERS = libkmod/libkmod.h -lib_LTLIBRARIES = libkmod/libkmod.la - -libkmod_libkmod_la_SOURCES = \ - libkmod/libkmod-builtin.c \ - libkmod/libkmod.c \ - libkmod/libkmod-config.c \ - libkmod/libkmod-elf.c \ - libkmod/libkmod-file.c \ - libkmod/libkmod.h \ - libkmod/libkmod-index.c \ - libkmod/libkmod-index.h \ - libkmod/libkmod-internal-file.h \ - libkmod/libkmod-internal.h \ - libkmod/libkmod-list.c \ - libkmod/libkmod-module.c \ - libkmod/libkmod-signature.c - -if ENABLE_XZ -libkmod_libkmod_la_SOURCES += libkmod/libkmod-file-xz.c -endif - -if ENABLE_ZLIB -libkmod_libkmod_la_SOURCES += libkmod/libkmod-file-zlib.c -endif - -if ENABLE_ZSTD -libkmod_libkmod_la_SOURCES += libkmod/libkmod-file-zstd.c -endif - -EXTRA_DIST += libkmod/libkmod.sym -EXTRA_DIST += libkmod/README \ - libkmod/COPYING testsuite/COPYING tools/COPYING COPYING - -libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \ - -version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \ - -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym -libkmod_libkmod_la_DEPENDENCIES = \ - shared/libshared.la \ - ${top_srcdir}/libkmod/libkmod.sym -libkmod_libkmod_la_LIBADD = \ - shared/libshared.la \ - ${libzstd_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libcrypto_LIBS} - -noinst_LTLIBRARIES += libkmod/libkmod-internal.la -libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES) -libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \ - -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym -libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES) -libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD) - -pkgconfig_DATA = libkmod/libkmod.pc -noarch_pkgconfig_DATA = tools/kmod.pc - -bashcompletiondir=@bashcompletiondir@ -dist_bashcompletion_DATA = \ - shell-completion/bash/insmod \ - shell-completion/bash/kmod \ - shell-completion/bash/lsmod \ - shell-completion/bash/rmmod - -fishcompletiondir=@fishcompletiondir@ -dist_fishcompletion_DATA = \ - shell-completion/fish/insmod.fish \ - shell-completion/fish/lsmod.fish \ - shell-completion/fish/rmmod.fish - -zshcompletiondir=@zshcompletiondir@ -dist_zshcompletion_DATA = \ - shell-completion/zsh/_insmod \ - shell-completion/zsh/_lsmod \ - shell-completion/zsh/_rmmod - -install-exec-hook: -if BUILD_TOOLS - for tool in insmod lsmod rmmod depmod modprobe modinfo; do \ - $(MKDIR_P) $(DESTDIR)$(sbindir); \ - $(LN_S) --force --relative $(DESTDIR)$(bindir)/kmod $(DESTDIR)$(sbindir)/$$tool; \ - done -endif - -uninstall-hook: -if BUILD_TOOLS - for tool in insmod lsmod rmmod depmod modprobe modinfo; do \ - rm -f $(DESTDIR)$(bindir)/$$tool; \ - done -endif - -if BUILD_TOOLS -bin_PROGRAMS = tools/kmod - -noinst_SCRIPTS = \ - tools/insmod tools/rmmod tools/lsmod \ - tools/modprobe tools/modinfo tools/depmod - -tools_kmod_SOURCES = \ - tools/depmod.c \ - tools/insmod.c \ - tools/kmod.c \ - tools/kmod.h \ - tools/log.c \ - tools/log.h \ - tools/lsmod.c \ - tools/modinfo.c \ - tools/modprobe.c \ - tools/opt.c \ - tools/opt.h \ - tools/rmmod.c \ - tools/static-nodes.c - -tools_kmod_LDADD = \ - shared/libshared.la \ - libkmod/libkmod-internal.la - -${noinst_SCRIPTS}: tools/kmod - $(AM_V_GEN) ($(RM) $@; \ - $(LN_S) $(notdir $<) $@) -endif - -# ------------------------------------------------------------------------------ -# TESTSUITE -# ------------------------------------------------------------------------------ - -EXTRA_DIST += scripts/setup-modules.sh -EXTRA_DIST += scripts/setup-rootfs.sh - -MODULE_PLAYGROUND = testsuite/module-playground -BUILD_MODULES = $(AM_V_GEN) $(top_srcdir)/scripts/setup-modules.sh $(top_srcdir) $(top_builddir) $(MODULE_PLAYGROUND) -ROOTFS = testsuite/rootfs -ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine -CREATE_ROOTFS = $(AM_V_GEN) $(top_srcdir)/scripts/setup-rootfs.sh $(ROOTFS_PRISTINE) $(ROOTFS) $(MODULE_PLAYGROUND) $(top_builddir)/config.h $(sysconfdir) $(module_directory) - -build-module-playground: - $(BUILD_MODULES) - - -rootfs: build-module-playground - $(CREATE_ROOTFS) - -.PHONY: rootfs build-playground - -$(ROOTFS): $(ROOTFS_PRISTINE) - $(CREATE_ROOTFS) - -TESTSUITE_OVERRIDE_LIBS = \ - testsuite/uname.la testsuite/path.la \ - testsuite/init_module.la \ - testsuite/delete_module.la -TESTSUITE_OVERRIDE_LIBS_LDFLAGS = \ - -avoid-version -module -shared -rpath /nowhere -ldl - -check-am: rootfs - - -EXTRA_DIST += \ - testsuite/module-playground/dummy.pkcs7 \ - testsuite/module-playground/dummy.sha1 \ - testsuite/module-playground/dummy.sha256 \ - testsuite/module-playground/Kbuild \ - 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-weakdep.c \ - testsuite/module-playground/README - -check_LTLIBRARIES = $(TESTSUITE_OVERRIDE_LIBS) - -testsuite_uname_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) -testsuite_path_la_CPPFLAGS = $(AM_CPPFLAGS) \ - -DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\" -testsuite_path_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) - -testsuite_delete_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) -testsuite_init_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) -testsuite_init_module_la_SOURCES = testsuite/init_module.c \ - testsuite/stripped-module.h -testsuite_init_module_la_LIBADD = libkmod/libkmod-internal.la - -TESTSUITE_CPPFLAGS = $(AM_CPPFLAGS) \ - -DTESTSUITE_ROOTFS=\"$(abs_top_builddir)/$(ROOTFS)/\" \ - -DTOOLS_DIR=\"$(abs_top_builddir)/tools\" \ - -DOVERRIDE_LIBDIR=\"$(abs_top_builddir)/testsuite/.libs/\" -TESTSUITE_LDADD = \ - testsuite/libtestsuite.la libkmod/libkmod-internal.la \ - shared/libshared.la - -check_LTLIBRARIES += testsuite/libtestsuite.la -testsuite_libtestsuite_la_SOURCES = \ - testsuite/testsuite.c testsuite/testsuite.h -testsuite_libtestsuite_la_DEPENDENCIES = \ - $(ROOTFS) $(TESTSUITE_OVERRIDE_LIBS) -testsuite_libtestsuite_la_CPPFLAGS = $(TESTSUITE_CPPFLAGS) -testsuite_libtestsuite_la_LIBADD = -lrt - -TESTSUITE = \ - testsuite/test-array \ - testsuite/test-blacklist \ - testsuite/test-dependencies \ - testsuite/test-depmod \ - testsuite/test-hash \ - testsuite/test-init \ - testsuite/test-initstate \ - testsuite/test-list \ - testsuite/test-loaded \ - testsuite/test-modinfo \ - testsuite/test-modprobe \ - testsuite/test-new-module \ - testsuite/test-strbuf \ - testsuite/test-testsuite \ - testsuite/test-util \ - testsuite/test-weakdep - -check_PROGRAMS = $(TESTSUITE) -TESTS = $(TESTSUITE) - -testsuite_test_testsuite_LDADD = \ - testsuite/libtestsuite.la shared/libshared.la -testsuite_test_testsuite_CPPFLAGS = $(TESTSUITE_CPPFLAGS) - -testsuite_test_hash_LDADD = $(TESTSUITE_LDADD) -testsuite_test_hash_CPPFLAGS = $(TESTSUITE_CPPFLAGS) - -testsuite_test_array_LDADD = $(TESTSUITE_LDADD) -testsuite_test_array_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) -testsuite_test_modinfo_CPPFLAGS = $(TESTSUITE_CPPFLAGS) -testsuite_test_util_LDADD = $(TESTSUITE_LDADD) -testsuite_test_util_CPPFLAGS = $(TESTSUITE_CPPFLAGS) -testsuite_test_new_module_LDADD = $(TESTSUITE_LDADD) -testsuite_test_new_module_CPPFLAGS = $(TESTSUITE_CPPFLAGS) -testsuite_test_modprobe_LDADD = $(TESTSUITE_LDADD) -testsuite_test_modprobe_CPPFLAGS = $(TESTSUITE_CPPFLAGS) -testsuite_test_blacklist_LDADD = $(TESTSUITE_LDADD) -testsuite_test_blacklist_CPPFLAGS = $(TESTSUITE_CPPFLAGS) -testsuite_test_dependencies_LDADD = $(TESTSUITE_LDADD) -testsuite_test_dependencies_CPPFLAGS = $(TESTSUITE_CPPFLAGS) -testsuite_test_depmod_LDADD = $(TESTSUITE_LDADD) -testsuite_test_depmod_CPPFLAGS = $(TESTSUITE_CPPFLAGS) -testsuite_test_list_LDADD = $(TESTSUITE_LDADD) -testsuite_test_list_CPPFLAGS = $(TESTSUITE_CPPFLAGS) -testsuite_test_weakdep_LDADD = $(TESTSUITE_LDADD) -testsuite_test_weakdep_CPPFLAGS = $(TESTSUITE_CPPFLAGS) - -testsuite-distclean: - $(RM) -r $(ROOTFS) - $(RM) testsuite/stamp-rootfs - $(MAKE) -C $(MODULE_PLAYGROUND) clean - if test "$(top_srcdir)" != "$(top_builddir)"; then \ - $(RM) -rf testsuite/module-playground; \ - fi - -DISTCLEAN_LOCAL_HOOKS += testsuite-distclean -EXTRA_DIST += testsuite/rootfs-pristine - -AM_DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --sysconfdir=/etc \ - --with-zlib --with-zstd --with-xz --with-openssl \ - --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \ - --with-fishcompletiondir=$$dc_install_base/$(fishcompletiondir) \ - --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) - -distclean-local: $(DISTCLEAN_LOCAL_HOOKS) - -buildtest-TESTS: - $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS) - -# ------------------------------------------------------------------------------ -# coverage -# ------------------------------------------------------------------------------ - -# .PHONY so it always rebuilds it -.PHONY: coverage lcov-run lcov-report coverage-sync - -# run lcov from scratch, always -coverage: all - $(MAKE) lcov-run - $(MAKE) lcov-report - -coverage_dir = coverage -coverage_opts = --base-directory $(srcdir) --directory $(builddir) \ - --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))' - -if ENABLE_COVERAGE -# reset run coverage tests -lcov-run: - @rm -rf $(coverage_dir) - lcov $(coverage_opts) --zerocounters - -$(MAKE) check - -# generate report based on current coverage data -lcov-report: - $(MKDIR_P) $(coverage_dir) - lcov $(coverage_opts) --capture --no-external --ignore-errors graph \ - | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info - lcov --remove $(coverage_dir)/.lcov.info --output-file $(coverage_dir)/.lcov-clean.info 'test-*' - genhtml -t "kmod test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov-clean.info - @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html" - -else - -lcov-run lcov-report: - echo "Need to reconfigure with --enable-coverage" - -endif - -# ------------------------------------------------------------------------------ -# coverity -# ------------------------------------------------------------------------------ - -kmod-coverity-%.tar.xz: - rm -rf $< cov-int - ./autogen.sh c --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 -# ------------------------------------------------------------------------------ - -git-release: - head -1 NEWS | grep -q "kmod $(VERSION)" - git commit -a -s -m "kmod $(VERSION)" - git tag -m "kmod $(VERSION)" -s v$(VERSION) - git gc --prune=0 - -kmod-$(VERSION).tar.xz: - make distcheck - -kmod-$(VERSION).tar.sign: - xz -d -c kmod-$(VERSION).tar.xz | gpg --armor --detach-sign --output kmod-$(VERSION).tar.sign - -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/ diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 33f363f0..00000000 --- a/autogen.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh - -set -e - -oldpwd=$(pwd) - -if [ -n "$MESON_DIST_ROOT" ]; then - topdir="$MESON_DIST_ROOT" -else - topdir=$(dirname $0) -fi - -cd $topdir - -gtkdocize --docdir libkmod/docs || NO_GTK_DOC="yes" -if [ "x$NO_GTK_DOC" = "xyes" ] -then - for f in libkmod/docs/gtk-doc.make m4/gtk-doc.m4 - do - rm -f $f - touch $f - done -fi - -autoreconf --force --install --symlink - -libdir() { - echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd) -} - -args="\ ---prefix=/usr \ ---sysconfdir=/etc \ ---libdir=$(libdir /usr/lib) \ -" - -if [ -f "$topdir/.config.args" ]; then - args="$args $(cat $topdir/.config.args)" -fi - -cd $oldpwd - -hackargs="\ ---enable-debug \ ---enable-gtk-doc \ ---with-zstd \ ---with-xz \ ---with-zlib \ ---with-openssl \ -" - -if [ "x$1" = "xc" ]; then - shift - $topdir/configure CFLAGS='-g -O2' $args $hackargs "$@" - make clean -elif [ "x$1" = "xg" ]; then - shift - $topdir/configure CFLAGS='-g -Og' $args "$@" - make clean -elif [ "x$1" = "xl" ]; then - shift - $topdir/configure CC=clang CXX=clang++ $args "$@" - make clean -elif [ "x$1" = "xa" ]; then - shift - $topdir/configure CFLAGS='-g -O2 -Wsuggest-attribute=pure -Wsuggest-attribute=const' $args "$@" - make clean -elif [ "x$1" = "xs" ]; then - shift - scan-build $topdir/configure CFLAGS='-g -O0 -std=gnu11' $args "$@" - scan-build make -else - echo - echo "----------------------------------------------------------------" - echo "Initialized build system. For a common configuration please run:" - echo "----------------------------------------------------------------" - echo - echo "$topdir/configure CFLAGS='-g -O2' $args" - echo - echo If you are debugging or hacking on kmod, consider configuring - echo like below: - echo - echo "$topdir/configure CFLAGS='-g -O2' $args $hackargs" -fi diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 8946e0c8..00000000 --- a/configure.ac +++ /dev/null @@ -1,360 +0,0 @@ -AC_PREREQ(2.64) -AC_INIT([kmod], - [34], - [linux-modules@vger.kernel.org], - [kmod], - [http://git.kernel.org/?p=utils/kernel/kmod/kmod.git]) - -AC_CONFIG_SRCDIR([libkmod/libkmod.c]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS(config.h) -AC_CONFIG_AUX_DIR([build-aux]) - -AC_USE_SYSTEM_EXTENSIONS -AC_SYS_LARGEFILE -AC_PREFIX_DEFAULT([/usr]) -AM_MAINTAINER_MODE([enable]) -AM_INIT_AUTOMAKE([foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests]) -AM_SILENT_RULES([yes]) -LT_INIT([disable-static pic-only]) - -AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by kmod])]) -AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by kmod])]) - -module_compressions="" -module_signatures="legacy" - -##################################################################### -# Program checks and configurations -##################################################################### - -AC_PROG_SED -AC_PROG_MKDIR_P -AC_PROG_LN_S -PKG_PROG_PKG_CONFIG - -AC_PROG_CC_C99 - -##################################################################### -# Function and structure checks -##################################################################### - -AC_CHECK_FUNCS_ONCE([open64 stat64 fopen64 __stat64_time64]) -AC_CHECK_FUNCS_ONCE([secure_getenv]) - -CC_CHECK_FUNC_BUILTIN([__builtin_clz]) -CC_CHECK_FUNC_BUILTIN([__builtin_types_compatible_p]) -CC_CHECK_FUNC_BUILTIN([__builtin_uadd_overflow], [ ], [ ]) -CC_CHECK_FUNC_BUILTIN([__builtin_uaddl_overflow], [ ], [ ]) -CC_CHECK_FUNC_BUILTIN([__builtin_uaddll_overflow], [ ], [ ]) -CC_CHECK_FUNC_BUILTIN([__builtin_umul_overflow], [ ], [ ]) -CC_CHECK_FUNC_BUILTIN([__builtin_umull_overflow], [ ], [ ]) -CC_CHECK_FUNC_BUILTIN([__builtin_umulll_overflow], [ ], [ ]) - -# dietlibc doesn't have st.st_mtim struct member -AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include ]) - -# basename may be only available in libgen.h with the POSIX behavior, -# not desired here -AC_CHECK_DECLS_ONCE([[basename]], [], [], [[#include ]]) -AC_CHECK_DECLS_ONCE([[__xstat]], [], [], [[#include - _Noreturn int foo(void) { exit(0); }]])], - [AC_DEFINE([HAVE_NORETURN], [1], [Define if _Noreturn is available]) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - - -##################################################################### -# --with- -##################################################################### - -AC_ARG_WITH([distconfdir], AS_HELP_STRING([--with-distconfdir=DIR], [directory to search for distribution configuration files]), - [], [with_distconfdir='${prefix}/lib']) -AC_SUBST([distconfdir], [$with_distconfdir]) - -# Ideally this would be $prefix/lib/modules but default to /lib/modules for compatibility with earlier versions -AC_ARG_WITH([module_directory], - AS_HELP_STRING([--with-module-directory=DIR], [directory in which to look for kernel modules @<:@default=/lib/modules@:>@]), - [], [with_module_directory=/lib/modules]) -AC_SUBST([module_directory], [$with_module_directory]) - -# Check all directory arguments for consistency. -for ac_var in distconfdir module_directory -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*@<:@^/@:>@\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - @<:@\\/$@:>@* | ?:@<:@\\/@:>@* ) continue;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -AC_ARG_WITH([zstd], - AS_HELP_STRING([--with-zstd], [handle Zstandard-compressed modules @<:@default=disabled@:>@]), - [], [with_zstd=no]) -AS_IF([test "x$with_zstd" != "xno"], [ - PKG_CHECK_MODULES([libzstd], [libzstd >= 1.4.4], [LIBS="$LIBS $libzstd_LIBS"]) - AC_DEFINE([ENABLE_ZSTD], [1], [Zstandard for modules.]) - module_compressions="zstd $module_compressions" -], [ - AC_DEFINE([ENABLE_ZSTD], [0], [Zstandard for modules.]) - AC_MSG_NOTICE([Zstandard support not requested]) -]) -CC_FEATURE_APPEND([with_features], [with_zstd], [ZSTD]) -AM_CONDITIONAL([ENABLE_ZSTD], [test "x$with_zstd" != "xno"]) -AC_DEFINE([ENABLE_ZSTD_DLOPEN], [0], [dlopen zstd]) - -AC_ARG_WITH([xz], - AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]), - [], [with_xz=no]) -AS_IF([test "x$with_xz" != "xno"], [ - PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99], [LIBS="$LIBS $liblzma_LIBS"]) - AC_DEFINE([ENABLE_XZ], [1], [xz for modules.]) - module_compressions="xz $module_compressions" -], [ - AC_DEFINE([ENABLE_XZ], [0], [xz for modules.]) - AC_MSG_NOTICE([Xz support not requested]) -]) -CC_FEATURE_APPEND([with_features], [with_xz], [XZ]) -AM_CONDITIONAL([ENABLE_XZ], [test "x$with_xz" != "xno"]) -AC_DEFINE([ENABLE_XZ_DLOPEN], [0], [dlopen xz]) - -AC_ARG_WITH([zlib], - AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]), - [], [with_zlib=no]) -AS_IF([test "x$with_zlib" != "xno"], [ - PKG_CHECK_MODULES([zlib], [zlib], [LIBS="$LIBS $zlib_LIBS"]) - AC_DEFINE([ENABLE_ZLIB], [1], [zlib for modules.]) - module_compressions="gzip $module_compressions" -], [ - AC_DEFINE([ENABLE_ZLIB], [0], [zlib for modules.]) - AC_MSG_NOTICE([zlib support not requested]) -]) -CC_FEATURE_APPEND([with_features], [with_zlib], [ZLIB]) -AM_CONDITIONAL([ENABLE_ZLIB], [test "x$with_zlib" != "xno"]) -AC_DEFINE([ENABLE_ZLIB_DLOPEN], [0], [dlopen zlib]) - -AC_ARG_WITH([openssl], - AS_HELP_STRING([--with-openssl], [handle PKCS7 signatures @<:@default=disabled@:>@]), - [], [with_openssl=no]) -AS_IF([test "x$with_openssl" != "xno"], [ - PKG_CHECK_MODULES([libcrypto], [libcrypto >= 1.1.0], [LIBS="$LIBS $libcrypto_LIBS"]) - AC_DEFINE([ENABLE_OPENSSL], [1], [openssl for modinfo.]) - module_signatures="PKCS7 $module_signatures" -], [ - AC_DEFINE([ENABLE_OPENSSL], [0], [openssl for modinfo.]) - AC_MSG_NOTICE([openssl support not requested]) -]) -CC_FEATURE_APPEND([with_features], [with_openssl], [LIBCRYPTO]) - -AC_ARG_WITH([bashcompletiondir], - AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]), - [], - [AS_IF([$($PKG_CONFIG --exists bash-completion)], [ - with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion) - ] , [ - with_bashcompletiondir=${datadir}/bash-completion/completions - ])]) -AC_SUBST([bashcompletiondir], [$with_bashcompletiondir]) - -AC_ARG_WITH([fishcompletiondir], - AS_HELP_STRING([--with-fishcompletiondir=DIR], [Fish completions directory]), - [], - [AS_IF([$($PKG_CONFIG --exists fish)], [ - with_fishcompletiondir=$($PKG_CONFIG --variable=completionsdir fish) - ] , [ - with_fishcompletiondir=${datadir}/fish/vendor_functions.d - ])]) -AC_SUBST([fishcompletiondir], [$with_fishcompletiondir]) - -AC_ARG_WITH([zshcompletiondir], - AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]), - [], - [with_zshcompletiondir=${datadir}/zsh/site-functions]) -AC_SUBST([zshcompletiondir], [$with_zshcompletiondir]) - -##################################################################### -# --enable- -##################################################################### - -AC_ARG_ENABLE([tools], - AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]), - [], enable_tools=yes) -AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"]) - -AC_ARG_ENABLE([manpages], - AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]), - [], enable_manpages=yes) -AS_IF([test "x$enable_manpages" = "xyes"], [ - AC_PATH_PROG([SCDOC], [scdoc]) - AS_IF([test "x$SCDOC" = "x"],[ - AC_MSG_ERROR([*** scdoc needed for building manpages. Either install it or pass --disable-manpages]) - ])]) -AM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"]) - -AC_ARG_ENABLE([logging], - AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]), - [], enable_logging=yes) -AS_IF([test "x$enable_logging" = "xyes"], [ - AC_DEFINE(ENABLE_LOGGING, [1], [System logging.]) -], [ - AC_DEFINE(ENABLE_LOGGING, [0], [System logging.]) -]) - -AC_ARG_ENABLE([debug], - AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]), - [], [enable_debug=no]) -AS_IF([test "x$enable_debug" = "xyes"], [ - AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) -], [ - AC_DEFINE(ENABLE_DEBUG, [0], [Debug messages.]) -]) -AC_DEFINE(ENABLE_ELFDBG, [0], [Debug elf parsing messages.]) - -AC_ARG_ENABLE([coverage], - AS_HELP_STRING([--enable-coverage], [enable test coverage @<:@default=disabled@:>@]), - [], [enable_coverage=no]) -AS_IF([test "x$enable_coverage" = "xyes"], [ - AC_CHECK_PROG(have_coverage, [lcov], [yes], [no]) - AS_IF([test "x$have_coverage" = xno],[ - AC_MSG_ERROR([*** lcov support requested but the program was not found]) - ], [ - lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`" - lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`" - AS_IF([test "$lcov_version_major" -lt 1 -o "$lcov_version_minor" -lt 10], [ - AC_MSG_ERROR([*** lcov version is too old. 1.10 required]) - ], [ - have_coverage=yes - CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\ - -fprofile-arcs \ - -ftest-coverage]) - ]) - ]) -]) -AM_CONDITIONAL([ENABLE_COVERAGE], [test "x$enable_coverage" = "xyes"]) - -m4_ifdef([GTK_DOC_CHECK], [ -GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat]) -], [ -AM_CONDITIONAL([ENABLE_GTK_DOC], false)]) - -PKG_INSTALLDIR -PKG_NOARCH_INSTALLDIR - -##################################################################### -# Default CFLAGS and LDFLAGS -##################################################################### - -CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\ - -pipe \ - -fdata-sections \ - -fdiagnostics-show-option \ - -ffunction-sections \ - -fno-common \ - -fvisibility=hidden \ - -W \ - -Wall \ - -Wchar-subscripts \ - -Wdeclaration-after-statement \ - -Wendif-labels \ - -Wextra \ - -Wfloat-equal \ - -Wformat=2 \ - -Wformat-nonliteral \ - -Wformat-security \ - -Winit-self \ - -Wlogical-op \ - -Wmissing-declarations \ - -Wmissing-include-dirs \ - -Wmissing-noreturn \ - -Wmissing-prototypes \ - -Wnested-externs \ - -Wno-attributes=clang::suppress \ - -Wno-unused-parameter \ - -Wold-style-definition \ - -Wpointer-arith \ - -Wredundant-decls \ - -Wshadow \ - -Wsign-compare \ - -Wstrict-aliasing=3 \ - -Wstrict-prototypes \ - -Wtype-limits \ - -Wundef \ - -Wuninitialized \ - -Wvla \ - -Wwrite-strings]) -AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags") - - -CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \ - -Wl,--as-needed \ - -Wl,--no-undefined \ - -Wl,--gc-sections]) -AC_SUBST([OUR_LDFLAGS], $with_ldflags) - -AC_DEFINE_UNQUOTED(KMOD_FEATURES, ["$with_features"], [Features in this build]) - -##################################################################### -# Generate files from *.in -##################################################################### - -AC_SUBST([module_compressions], $module_compressions) -AC_SUBST([module_signatures], $module_signatures) - -AC_CONFIG_FILES([ - Makefile - man/Makefile - libkmod/docs/Makefile - libkmod/docs/version.xml - libkmod/libkmod.pc - tools/kmod.pc -]) - - -##################################################################### - -AC_OUTPUT -AC_MSG_RESULT([ - $PACKAGE $VERSION - ======= - - module_directory: ${module_directory} - prefix: ${prefix} - sysconfdir: ${sysconfdir} - distconfdir: ${distconfdir} - libdir: ${libdir} - includedir: ${includedir} - bindir: ${bindir} - Bash completions dir: ${with_bashcompletiondir} - - compiler: ${CC} - cflags: ${with_cflags} ${CFLAGS} - ldflags: ${with_ldflags} ${LDFLAGS} - - tools: ${enable_tools} - logging: ${enable_logging} - compression: zstd=${with_zstd} xz=${with_xz} zlib=${with_zlib} - debug: ${enable_debug} - coverage: ${enable_coverage} - doc: ${enable_gtk_doc} - man: ${enable_manpages} - - features: ${with_features} -]) diff --git a/libkmod/docs/Makefile.am b/libkmod/docs/Makefile.am deleted file mode 100644 index 41482e92..00000000 --- a/libkmod/docs/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ - -AUTOMAKE_OPTIONS = 1.11 - -DOC_MODULE = libkmod - -DOC_MODULE_VERSION = 3 - -DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml - -DOC_SOURCE_DIR = $(top_srcdir)/libkmod - -SCAN_OPTIONS = --ignore-decorators="KMOD_EXPORT" - -MKDB_OPTIONS = --xml-mode --output-format=xml --name-space kmod - -MKHTML_OPTIONS = --path=$(abs_srcdir)/doc --path=$(abs_builddir)/doc - -HFILE_GLOB = $(top_srcdir)/libkmod/libkmod.h -CFILE_GLOB = $(top_srcdir)/libkmod/libkmod.c $(top_srcdir)/libkmod/libkmod-module.c $(top_srcdir)/libkmod/libkmod-list.c - -IGNORE_HFILES = \ - libkmod-index.h \ - libkmod-internal-file.h \ - libkmod-internal.h - -content_files = version.xml - -EXTRA_DIST = - -if ENABLE_GTK_DOC -include $(top_srcdir)/libkmod/docs/gtk-doc.make -else -EXTRA_DIST += libkmod-docs.xml libkmod-sections.txt -endif diff --git a/m4/.gitignore b/m4/.gitignore deleted file mode 100644 index d59889ae..00000000 --- a/m4/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -libtool.m4 -ltoptions.m4 -ltsugar.m4 -ltversion.m4 -lt~obsolete.m4 -gtk-doc.m4 diff --git a/m4/attributes.m4 b/m4/attributes.m4 deleted file mode 100644 index a22bb586..00000000 --- a/m4/attributes.m4 +++ /dev/null @@ -1,277 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later WITH Autoconf-exception-macro -# -# Copyright (c) 2006-2008 Diego Pettenò -# Copyright (c) 2006-2008 xine project -# Copyright (c) 2012 Lucas De Marchi - -# Check if FLAG in ENV-VAR is supported by compiler and append it -# to WHERE-TO-APPEND variable. Note that we invert -Wno-* checks to -# -W* as gcc cannot test for negated warnings. -# CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG]) - -AC_DEFUN([CC_CHECK_FLAG_APPEND], [ - AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2], - AS_TR_SH([cc_cv_$2_$3]), - [eval "AS_TR_SH([cc_save_$2])='${$2}'" - eval "AS_TR_SH([$2])='-Werror `echo "$3" | sed 's/^-Wno-/-W/'`'" - AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return 0; } ])], - [eval "AS_TR_SH([cc_cv_$2_$3])='yes'"], - [eval "AS_TR_SH([cc_cv_$2_$3])='no'"]) - eval "AS_TR_SH([$2])='$cc_save_$2'"]) - - AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes], - [eval "$1='${$1} $3'"]) -]) - -dnl CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2]) -AC_DEFUN([CC_CHECK_FLAGS_APPEND], [ - for flag in $3; do - CC_CHECK_FLAG_APPEND($1, $2, $flag) - done -]) - -dnl Check if the flag is supported by linker (cacheable) -dnl CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) - - -dnl Check if the flag is supported by linker -dnl CC_CHECK_LDFLAGS_SILENT([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) -AC_DEFUN([CC_CHECK_LDFLAGS_SILENT], [ - AC_CACHE_VAL(AS_TR_SH([cc_cv_ldflags_$1]), - [ac_save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $1" - AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 1; }])], - [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"], - [eval "AS_TR_SH([cc_cv_ldflags_$1])="]) - LDFLAGS="$ac_save_LDFLAGS" - ]) - - AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes], - [$2], [$3]) -]) - -dnl Check if the flag is supported by linker (cacheable) -dnl CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) - -AC_DEFUN([CC_CHECK_LDFLAGS], [ - AC_CACHE_CHECK([if $CC supports $1 flag], - AS_TR_SH([cc_cv_ldflags_$1]), - CC_CHECK_LDFLAGS_SILENT([$1]) dnl Don't execute actions here! - ) - - AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes], - [$2], [$3]) -]) - -dnl define the LDFLAGS_NOUNDEFINED variable with the correct value for -dnl the current linker to avoid undefined references in a shared object. -AC_DEFUN([CC_NOUNDEFINED], [ - dnl We check $host for which systems to enable this for. - AC_REQUIRE([AC_CANONICAL_HOST]) - - case $host in - dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads - dnl are requested, as different implementations are present; to avoid problems - dnl use -Wl,-z,defs only for those platform not behaving this way. - *-freebsd* | *-openbsd*) ;; - *) - dnl First of all check for the --no-undefined variant of GNU ld. This allows - dnl for a much more readable command line, so that people can understand what - dnl it does without going to look for what the heck -z defs does. - for possible_flags in "-Wl,--no-undefined" "-Wl,-z,defs"; do - CC_CHECK_LDFLAGS([$possible_flags], [LDFLAGS_NOUNDEFINED="$possible_flags"]) - break - done - ;; - esac - - AC_SUBST([LDFLAGS_NOUNDEFINED]) -]) - -dnl Check for a -Werror flag or equivalent. -Werror is the GCC -dnl and ICC flag that tells the compiler to treat all the warnings -dnl as fatal. We usually need this option to make sure that some -dnl constructs (like attributes) are not simply ignored. -dnl -dnl Other compilers don't support -Werror per se, but they support -dnl an equivalent flag: -dnl - Sun Studio compiler supports -errwarn=%all -AC_DEFUN([CC_CHECK_WERROR], [ - AC_CACHE_CHECK( - [for $CC way to treat warnings as errors], - [cc_cv_werror], - [CC_CHECK_CFLAGS_SILENT([-Werror], [cc_cv_werror=-Werror], - [CC_CHECK_CFLAGS_SILENT([-errwarn=%all], [cc_cv_werror=-errwarn=%all])]) - ]) -]) - -AC_DEFUN([CC_CHECK_ATTRIBUTE], [ - AC_REQUIRE([CC_CHECK_WERROR]) - AC_CACHE_CHECK([if $CC supports __attribute__(( ifelse([$2], , [$1], [$2]) ))], - AS_TR_SH([cc_cv_attribute_$1]), - [ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $cc_cv_werror" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([$3])], - [eval "AS_TR_SH([cc_cv_attribute_$1])='yes'"], - [eval "AS_TR_SH([cc_cv_attribute_$1])='no'"]) - CFLAGS="$ac_save_CFLAGS" - ]) - - AS_IF([eval test x$]AS_TR_SH([cc_cv_attribute_$1])[ = xyes], - [AC_DEFINE( - AS_TR_CPP([SUPPORT_ATTRIBUTE_$1]), 1, - [Define this if the compiler supports __attribute__(( ifelse([$2], , [$1], [$2]) ))] - ) - $4], - [$5]) -]) - -AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [ - CC_CHECK_ATTRIBUTE( - [constructor],, - [void __attribute__((constructor)) ctor() { int a; }], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_FORMAT], [ - CC_CHECK_ATTRIBUTE( - [format], [format(printf, n, n)], - [void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { fmt = (void *)0; }], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_FORMAT_ARG], [ - CC_CHECK_ATTRIBUTE( - [format_arg], [format_arg(printf)], - [char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; }], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [ - CC_CHECK_ATTRIBUTE( - [visibility_$1], [visibility("$1")], - [void __attribute__((visibility("$1"))) $1_function() { }], - [$2], [$3]) -]) - -AC_DEFUN([CC_ATTRIBUTE_NONNULL], [ - CC_CHECK_ATTRIBUTE( - [nonnull], [nonnull()], - [void __attribute__((nonnull())) some_function(void *foo, void *bar) { foo = (void*)0; bar = (void*)0; }], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_UNUSED], [ - CC_CHECK_ATTRIBUTE( - [unused], , - [void some_function(void *foo, __attribute__((unused)) void *bar);], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_SENTINEL], [ - CC_CHECK_ATTRIBUTE( - [sentinel], , - [void some_function(void *foo, ...) __attribute__((sentinel));], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [ - CC_CHECK_ATTRIBUTE( - [deprecated], , - [void some_function(void *foo, ...) __attribute__((deprecated));], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_ALIAS], [ - CC_CHECK_ATTRIBUTE( - [alias], [weak, alias], - [void other_function(void *foo) { } - void some_function(void *foo) __attribute__((weak, alias("other_function")));], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_MALLOC], [ - CC_CHECK_ATTRIBUTE( - [malloc], , - [void * __attribute__((malloc)) my_alloc(int n);], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_PACKED], [ - CC_CHECK_ATTRIBUTE( - [packed], , - [struct astructure { char a; int b; long c; void *d; } __attribute__((packed));], - [$1], [$2]) -]) - -AC_DEFUN([CC_ATTRIBUTE_CONST], [ - CC_CHECK_ATTRIBUTE( - [const], , - [int __attribute__((const)) twopow(int n) { return 1 << n; } ], - [$1], [$2]) -]) - -AC_DEFUN([CC_FLAG_VISIBILITY], [ - AC_REQUIRE([CC_CHECK_WERROR]) - AC_CACHE_CHECK([if $CC supports -fvisibility=hidden], - [cc_cv_flag_visibility], - [cc_flag_visibility_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $cc_cv_werror" - CC_CHECK_CFLAGS_SILENT([-fvisibility=hidden], - cc_cv_flag_visibility='yes', - cc_cv_flag_visibility='no') - CFLAGS="$cc_flag_visibility_save_CFLAGS"]) - - AS_IF([test "x$cc_cv_flag_visibility" = "xyes"], - [AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1, - [Define this if the compiler supports the -fvisibility flag]) - $1], - [$2]) -]) - -AC_DEFUN([CC_CHECK_FUNC_BUILTIN], [ - m4_pushdef([UPNAME], m4_translit([$1], [-a-z], [_A-Z])) - AC_CACHE_CHECK([if compiler has $1 builtin function], - [cc_cv_have_$1], - [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [ - m4_case([$1], - [__builtin_clz], [$1(0)], - [__builtin_types_compatible_p], [$1(int, int)], - [__builtin_uaddl_overflow], [$1(0UL, 0UL, (void*)0)], - [__builtin_uaddll_overflow], [$1(0ULL, 0ULL, (void*)0)], - [__builtin_expect], [$1(0, 0)] - )])], - [cc_cv_have_$1=yes], - [cc_cv_have_$1=no])]) - - AS_IF([test "x$cc_cv_have_$1" = "xyes"], - [AC_DEFINE([HAVE_]m4_defn([UPNAME]), 1, [Define to 1 if compiler has $1() builtin function]) - $2], - [AS_IF([test "x$3" = "x"], [AC_MSG_ERROR([*** builtin function not found: $1()])], - [AC_DEFINE([HAVE_]m4_defn([UPNAME]), 0) - $3])] - ) - m4_popdef([UPNAME]) -]) - -AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [ - AC_REQUIRE([CC_CHECK_WERROR]) - AC_CACHE_CHECK([highest __attribute__ ((aligned ())) supported], - [cc_cv_attribute_aligned], - [ac_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $cc_cv_werror" - for cc_attribute_align_try in 64 32 16 8 4 2; do - AC_COMPILE_IFELSE([AC_LANG_SOURCE([ - int main() { - static char c __attribute__ ((aligned($cc_attribute_align_try))) = 0; - return c; - }])], [cc_cv_attribute_aligned=$cc_attribute_align_try; break]) - done - CFLAGS="$ac_save_CFLAGS" - ]) - - if test "x$cc_cv_attribute_aligned" != "x"; then - AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], [$cc_cv_attribute_aligned], - [Define the highest alignment supported]) - fi -]) diff --git a/m4/features.m4 b/m4/features.m4 deleted file mode 100644 index 6384a052..00000000 --- a/m4/features.m4 +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later WITH Autoconf-exception-macro -# -# Copyright (c) 2015 Lucas De Marchi - -# CC_FEATURE_APPEND([FLAGS], [ENV-TO-CHECK], [FLAG-NAME]) -AC_DEFUN([CC_FEATURE_APPEND], [ - AS_VAR_PUSHDEF([FLAGS], [$1])dnl - AS_VAR_PUSHDEF([ENV_CHECK], [$2])dnl - AS_VAR_PUSHDEF([FLAG_NAME], [$3])dnl - - AS_CASE([" AS_VAR_GET(FLAGS) " ], - [*" FLAG_NAME "*], [AC_RUN_LOG([: FLAGS already contains FLAG_NAME])], - [ - AS_IF([test "x$FLAGS" != "x"], [AS_VAR_APPEND(FLAGS, " ")]) - AS_IF([test "x$ENV_CHECK" = "xyes"], - [AS_VAR_APPEND(FLAGS, "+FLAG_NAME")], - [AS_VAR_APPEND(FLAGS, "-FLAG_NAME")]) - ] - ) - - AS_VAR_POPDEF([FLAG_NAME])dnl - AS_VAR_POPDEF([ENV_CHECK])dnl - AS_VAR_POPDEF([FLAGS])dnl -]) diff --git a/man/Makefile.am b/man/Makefile.am deleted file mode 100644 index 6356d878..00000000 --- a/man/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -MAN5 = depmod.d.5 modprobe.d.5 modules.dep.5 -MAN8 = kmod.8 depmod.8 insmod.8 lsmod.8 rmmod.8 modprobe.8 modinfo.8 -MAN_STUB = modules.dep.bin.5 - -AM_V_SCDOC = $(AM_V_SCDOC_$(V)) -AM_V_SCDOC_ = $(AM_V_SCDOC_$(AM_DEFAULT_VERBOSITY)) -AM_V_SCDOC_0 = @echo " SCDOC " $@; - -if BUILD_TOOLS -dist_man_MANS = $(MAN5) $(MAN8) $(MAN_STUB) -endif - -EXTRA_DIST = $(MAN5:%.5=%.5.scd) $(MAN8:%.8=%.8.scd) -CLEANFILES = $(filter-out $(MAN_STUB), $(dist_man_MANS)) - -define generate_manpage - $(AM_V_SCDOC)cat $< | \ - sed -e 's|@SYSCONFDIR@|$(sysconfdir)|g' | \ - sed -e 's|@DISTCONFDIR@|$(distconfdir)|g' | \ - sed -e 's|@MODULE_DIRECTORY@|$(module_directory)|g' | \ - $(SCDOC) > $@ -endef - -%.5: %.5.scd - $(generate_manpage) - -%.8: %.8.scd - $(generate_manpage) diff --git a/meson.build b/meson.build index f0ad0413..a4ffe972 100644 --- a/meson.build +++ b/meson.build @@ -544,12 +544,6 @@ if get_option('build-tests') subdir('testsuite') endif -# ------------------------------------------------------------------------------ -# dist && autotools compat -# ------------------------------------------------------------------------------ - -meson.add_dist_script('autogen.sh') - # ------------------------------------------------------------------ # documentation # ------------------------------------------------------------------ -- 2.47.2