From c3a050bad1b687f2cca0215956aac9af7ff3cf57 Mon Sep 17 00:00:00 2001 From: Jan Vaclav Date: Mon, 29 Apr 2024 11:22:54 +0200 Subject: [PATCH] build: break autotools configuration to warn about deprecation We are planning on completely dropping Autotools in the future. This breaks the build process with an argument to ignore the deprecation, so that anyone building NM is warned of this change. (cherry picked from commit d115dcec50975343b3f1f8ff437c26113858c701) --- Makefile.am | 1 + NEWS | 5 +++++ configure.ac | 14 ++++++++++++++ contrib/fedora/rpm/NetworkManager.spec | 3 ++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 7eb2b9f865..9f3163004a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -159,6 +159,7 @@ DISTCHECK_CONFIGURE_FLAGS = \ --enable-ifcfg-rh \ --enable-ifupdown \ --disable-dependency-tracking \ + --disable-autotools-deprecation \ $(NULL) dist-configure-check: diff --git a/NEWS b/NEWS index 05f67f716e..baf5a7afd6 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,11 @@ subject to change and not guaranteed to be compatible with the later release. USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE! +* Building with autotools is now deprecated and will be completely removed + in the next development cycle. We recommend using meson to build + NetworkManager -- for basic setup, see the CONTRIBUTING.md file. + To ignore this deprecation and still build with Autotools, you can specify + the '--disable-autotools-deprecation' argument when configuring. * Support changing the OpenSSL ciphers for 802.1X authentication via connection property "802-1x.openssl-ciphers". * The reason why a device is unmanaged is now properly set in the diff --git a/configure.ac b/configure.ac index 5a7f25a51a..c49e693e0d 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,20 @@ AC_INIT([NetworkManager], [nm_version], [http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager], [NetworkManager]) +deprecation_message() { + echo "Building with Autotools is deprecated; meson is the recommended way to build NetworkManager." + echo "To learn more, see the CONTRIBUTING.md file." + echo "To ignore this, pass '--disable-autotools-deprecation' when configuring." + exit 1 +} + +AC_ARG_ENABLE([autotools-deprecation], + AS_HELP_STRING([--disable-autotools-deprecation], + [Building with autotools is deprecated, passing this argument overrides this error.]), + [ test "$enableval" != "no" && deprecation_message ], + [ deprecation_message ] +) + AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index f55d243dd6..9e17053a76 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -918,7 +918,8 @@ autoreconf --install --force --with-resolvconf=no \ --with-netconfig=no \ --with-config-dns-rc-manager-default=%{dns_rc_manager_default} \ - --with-config-logging-backend-default=%{logging_backend_default} + --with-config-logging-backend-default=%{logging_backend_default} \ + --disable-autotools-deprecation %make_build