From patchwork Thu Oct 19 13:00:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haller X-Patchwork-Id: 1851640 X-Patchwork-Delegate: fw@strlen.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fhGZSZfW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4SB7Dh4qN4z20cx for ; Fri, 20 Oct 2023 00:03:00 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235446AbjJSNC5 (ORCPT ); Thu, 19 Oct 2023 09:02:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235475AbjJSNCs (ORCPT ); Thu, 19 Oct 2023 09:02:48 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D14A49EF for ; Thu, 19 Oct 2023 06:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697720471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qu9EUZ9ye/FJWfkSGenLr9hst7Vgh0fXGa6MmSm6ZsE=; b=fhGZSZfWrNZ78ip1CIWMnzTkoENP2Zc61X5s4w0d81zSMZm1uien94Snj2b5wU3Z9wzTKP hq8HGA3wAUVHWIJ5zvW1Px6fI23gv6L42UHqjHKKs66jQEgK83Ti4hzOd1rMPEbtvPEQes BhvYBdaJqnP13uT2Zt8fXLSF/H28rJE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-390-gWqWMOn4Ncaktv8VHp3TZQ-1; Thu, 19 Oct 2023 09:01:09 -0400 X-MC-Unique: gWqWMOn4Ncaktv8VHp3TZQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0AD441C068FA for ; Thu, 19 Oct 2023 13:01:09 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 810AD8CEF; Thu, 19 Oct 2023 13:01:08 +0000 (UTC) From: Thomas Haller To: NetFilter Cc: Thomas Haller Subject: [PATCH nft v2 1/7] gitignore: ignore ".dirstamp" files Date: Thu, 19 Oct 2023 15:00:00 +0200 Message-ID: <20231019130057.2719096-2-thaller@redhat.com> In-Reply-To: <20231019130057.2719096-1-thaller@redhat.com> References: <20231019130057.2719096-1-thaller@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Those will be generated by automake, once the recursive Makefiles are gone. Signed-off-by: Thomas Haller --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2c12c4409720..a62e31f31c6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Generated by autoconf/configure/automake *.m4 +.dirstamp Makefile Makefile.in stamp-h1 From patchwork Thu Oct 19 13:00:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haller X-Patchwork-Id: 1851642 X-Patchwork-Delegate: fw@strlen.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=V0RIFe4i; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4SB7Dj4LBKz23kJ for ; Fri, 20 Oct 2023 00:03:01 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235463AbjJSNC6 (ORCPT ); Thu, 19 Oct 2023 09:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345735AbjJSNCt (ORCPT ); Thu, 19 Oct 2023 09:02:49 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C86049C1 for ; Thu, 19 Oct 2023 06:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697720473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zMO3ngPj2eLF8umIraCYOdXQ6rko6ADleL+NVmNqt50=; b=V0RIFe4ixgYTPYMnL5ZPZn+2chWh0OUPRyPxZS4OS7TlV66oEoKwH8v5X1yZroD6oU7lrt 7WdsmnIV3hTEmaFZBzNZR6DfSiJq1MEoXj9adcbUPqBMVVOLtxS0egTX+fUnn6bxBrNOsP cRB/tm0g1nBeDIePKwkxpkdoQAcJISA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-301-xUn99iPZPkOwIgE6j_95CA-1; Thu, 19 Oct 2023 09:01:11 -0400 X-MC-Unique: xUn99iPZPkOwIgE6j_95CA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C1E8D10354EA for ; Thu, 19 Oct 2023 13:01:09 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4499E503B; Thu, 19 Oct 2023 13:01:09 +0000 (UTC) From: Thomas Haller To: NetFilter Cc: Thomas Haller Subject: [PATCH nft v2 2/7] build: no recursive-make for "include/**/Makefile.am" Date: Thu, 19 Oct 2023 15:00:01 +0200 Message-ID: <20231019130057.2719096-3-thaller@redhat.com> In-Reply-To: <20231019130057.2719096-1-thaller@redhat.com> References: <20231019130057.2719096-1-thaller@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Switch from recursive-make to a single top-level Makefile. This is the first step, the following patches will continue this. Unlike meson's subdir() or C's #include, automake's SUBDIRS= does not include a Makefile. Instead, it calls `make -C $dir`. https://www.gnu.org/software/make/manual/html_node/Recursion.html https://www.gnu.org/software/automake/manual/html_node/Subdirectories.html See also, "Recursive Make Considered Harmful". https://accu.org/journals/overload/14/71/miller_2004/ This has several problems, which we an avoid with a single Makefile: - recursive-make is harder to maintain and understand as a whole. Recursive-make makes sense, when there are truly independent sub-projects. Which is not the case here. The project needs to be considered as a whole and not one directory at a time. When we add unit tests (which we should), those would reside in separate directories but have dependencies between directories. With a single Makefile, we see all at once. The build setup has an inherent complexity, and that complexity is not necessarily reduced by splitting it into more files. On the contrary it helps to have it all in once place, provided that it's sensibly structured, named and organized. - typing `make` prints irrelevant "Entering directory" messages. So much so, that at the end of the build, the terminal is filled with such messages and we have to scroll to see what even happened. - with recursive-make, during build we see: make[3]: Entering directory '.../nftables/src' CC meta.lo meta.c:13:2: error: #warning hello test [-Werror=cpp] 13 | #warning hello test | ^~~~~~~ With a single Makefile we get CC src/meta.lo src/meta.c:13:2: error: #warning hello test [-Werror=cpp] 13 | #warning hello test | ^~~~~~~ This shows the full filename -- assuming that the developer works from the top level directory. The full name is useful, for example to copy+paste into the terminal. - single Makefile is also faster: $ make && perf stat -r 200 -B make -j I measure 35msec vs. 80msec. - recursive-make limits parallel make. You have to craft the SUBDIRS= in the correct order. The dependencies between directories are limited, as make only sees "LDADD = $(top_builddir)/src/libnftables.la" and not the deeper dependencies for the library. - I presume, some people like recursive-make because of `make -C $subdir` to only rebuild one directory. Rebuilding the entire tree is already very fast, so this feature seems not relevant. Also, as dependency handling is limited, we might wrongly not rebuild a target. For example, make check touch src/meta.c make -C examples check does not rebuild "examples/nft-json-file". What we now can do with single Makefile (and better than before), is `make examples/nft-json-file`, which works as desired and rebuilds all dependencies. Signed-off-by: Thomas Haller --- Makefile.am | 75 +++++++++++++++++++++- configure.ac | 8 --- include/Makefile.am | 43 ------------- include/linux/Makefile.am | 12 ---- include/linux/netfilter/Makefile.am | 10 --- include/linux/netfilter_arp/Makefile.am | 1 - include/linux/netfilter_bridge/Makefile.am | 1 - include/linux/netfilter_ipv4/Makefile.am | 1 - include/linux/netfilter_ipv6/Makefile.am | 1 - include/nftables/Makefile.am | 1 - 10 files changed, 72 insertions(+), 81 deletions(-) delete mode 100644 include/Makefile.am delete mode 100644 include/linux/Makefile.am delete mode 100644 include/linux/netfilter/Makefile.am delete mode 100644 include/linux/netfilter_arp/Makefile.am delete mode 100644 include/linux/netfilter_bridge/Makefile.am delete mode 100644 include/linux/netfilter_ipv4/Makefile.am delete mode 100644 include/linux/netfilter_ipv6/Makefile.am delete mode 100644 include/nftables/Makefile.am diff --git a/Makefile.am b/Makefile.am index 84c3c366b86a..bfc64ebbed71 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,76 @@ -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src \ - include \ +pkginclude_HEADERS = \ + include/nftables/libnftables.h \ + $(NULL) + +noinst_HEADERS = \ + \ + include/linux/netfilter.h \ + include/linux/netfilter/nf_conntrack_common.h \ + include/linux/netfilter/nf_conntrack_tuple_common.h \ + include/linux/netfilter/nf_log.h \ + include/linux/netfilter/nf_nat.h \ + include/linux/netfilter/nf_synproxy.h \ + include/linux/netfilter/nf_tables.h \ + include/linux/netfilter/nf_tables_compat.h \ + include/linux/netfilter/nfnetlink.h \ + include/linux/netfilter/nfnetlink_hook.h \ + include/linux/netfilter/nfnetlink_osf.h \ + include/linux/netfilter_arp.h \ + include/linux/netfilter_arp/arp_tables.h \ + include/linux/netfilter_bridge.h \ + include/linux/netfilter_bridge/ebtables.h \ + include/linux/netfilter_decnet.h \ + include/linux/netfilter_ipv4.h \ + include/linux/netfilter_ipv4/ip_tables.h \ + include/linux/netfilter_ipv6.h \ + include/linux/netfilter_ipv6/ip6_tables.h \ + \ + include/cache.h \ + include/cli.h \ + include/cmd.h \ + include/ct.h \ + include/datatype.h \ + include/dccpopt.h \ + include/erec.h \ + include/expression.h \ + include/exthdr.h \ + include/fib.h \ + include/gmputil.h \ + include/hash.h \ + include/headers.h \ + include/iface.h \ + include/intervals.h \ + include/ipopt.h \ + include/json.h \ + include/list.h \ + include/meta.h \ + include/mini-gmp.h \ + include/misspell.h \ + include/mnl.h \ + include/netlink.h \ + include/nft.h \ + include/nftables.h \ + include/numgen.h \ + include/osf.h \ + include/owner.h \ + include/parser.h \ + include/payload.h \ + include/proto.h \ + include/rt.h \ + include/rule.h \ + include/sctp_chunk.h \ + include/socket.h \ + include/statement.h \ + include/tcpopt.h \ + include/utils.h \ + include/xfrm.h \ + include/xt.h \ + \ + $(NULL) + +SUBDIRS = src \ files \ doc \ examples\ diff --git a/configure.ac b/configure.ac index 7bd33bdcc2cf..67ca50fddf67 100644 --- a/configure.ac +++ b/configure.ac @@ -118,14 +118,6 @@ AC_CONFIG_FILES([ \ Makefile \ libnftables.pc \ src/Makefile \ - include/Makefile \ - include/nftables/Makefile \ - include/linux/Makefile \ - include/linux/netfilter/Makefile \ - include/linux/netfilter_arp/Makefile \ - include/linux/netfilter_bridge/Makefile \ - include/linux/netfilter_ipv4/Makefile \ - include/linux/netfilter_ipv6/Makefile \ files/Makefile \ files/examples/Makefile \ files/nftables/Makefile \ diff --git a/include/Makefile.am b/include/Makefile.am deleted file mode 100644 index 162807b03900..000000000000 --- a/include/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -SUBDIRS = linux \ - nftables - -noinst_HEADERS = cli.h \ - cache.h \ - cmd.h \ - datatype.h \ - dccpopt.h \ - nft.h \ - expression.h \ - fib.h \ - hash.h \ - intervals.h \ - ipopt.h \ - json.h \ - mini-gmp.h \ - gmputil.h \ - iface.h \ - mnl.h \ - nftables.h \ - payload.h \ - tcpopt.h \ - statement.h \ - ct.h \ - erec.h \ - exthdr.h \ - headers.h \ - list.h \ - meta.h \ - misspell.h \ - numgen.h \ - netlink.h \ - osf.h \ - owner.h \ - parser.h \ - proto.h \ - sctp_chunk.h \ - socket.h \ - rule.h \ - rt.h \ - utils.h \ - xfrm.h \ - xt.h diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am deleted file mode 100644 index eb9fc4e4a6bd..000000000000 --- a/include/linux/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -SUBDIRS = netfilter \ - netfilter_arp \ - netfilter_bridge \ - netfilter_ipv4 \ - netfilter_ipv6 - -noinst_HEADERS = netfilter_arp.h \ - netfilter_bridge.h \ - netfilter_decnet.h \ - netfilter.h \ - netfilter_ipv4.h \ - netfilter_ipv6.h diff --git a/include/linux/netfilter/Makefile.am b/include/linux/netfilter/Makefile.am deleted file mode 100644 index 22f66a7e1ebf..000000000000 --- a/include/linux/netfilter/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -noinst_HEADERS = nf_conntrack_common.h \ - nf_conntrack_tuple_common.h \ - nf_log.h \ - nf_nat.h \ - nf_tables.h \ - nf_tables_compat.h \ - nf_synproxy.h \ - nfnetlink_osf.h \ - nfnetlink_hook.h \ - nfnetlink.h diff --git a/include/linux/netfilter_arp/Makefile.am b/include/linux/netfilter_arp/Makefile.am deleted file mode 100644 index 0a16c1abd072..000000000000 --- a/include/linux/netfilter_arp/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -noinst_HEADERS = arp_tables.h diff --git a/include/linux/netfilter_bridge/Makefile.am b/include/linux/netfilter_bridge/Makefile.am deleted file mode 100644 index d2e8b38b196e..000000000000 --- a/include/linux/netfilter_bridge/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -noinst_HEADERS = ebtables.h diff --git a/include/linux/netfilter_ipv4/Makefile.am b/include/linux/netfilter_ipv4/Makefile.am deleted file mode 100644 index fec42533ab81..000000000000 --- a/include/linux/netfilter_ipv4/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -noinst_HEADERS = ip_tables.h diff --git a/include/linux/netfilter_ipv6/Makefile.am b/include/linux/netfilter_ipv6/Makefile.am deleted file mode 100644 index bec6c3f16694..000000000000 --- a/include/linux/netfilter_ipv6/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -noinst_HEADERS = ip6_tables.h diff --git a/include/nftables/Makefile.am b/include/nftables/Makefile.am deleted file mode 100644 index 5cfb0c6c5a92..000000000000 --- a/include/nftables/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -pkginclude_HEADERS = libnftables.h From patchwork Thu Oct 19 13:00:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haller X-Patchwork-Id: 1851644 X-Patchwork-Delegate: fw@strlen.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UUHoTTUc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4SB7Dr0T4zz20cx for ; Fri, 20 Oct 2023 00:03:08 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345752AbjJSNDH (ORCPT ); Thu, 19 Oct 2023 09:03:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235419AbjJSNCz (ORCPT ); Thu, 19 Oct 2023 09:02:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C341B6E97 for ; Thu, 19 Oct 2023 06:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697720487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wpmpm7HKa4ik8ND4nvCx0VVM55KQvQRfNpOpMoIb3Rc=; b=UUHoTTUct9QrwKswqOyzQQAoVOHUdppQeB782jgVeJPMYC85u8h9AGzh6m7cblhxxcx+hv ZPAOuU6F68GX2wZ5gtxqSbErkmgiacfq7ymVSUuU7NxHVCK/vk6zU+hTUeFNXkFbuYWFY9 n0EHnaRkG6tRxAc8LOMCIxrCCU5UeaE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-477-dSiQoEr-O5SkfQ4pBGjuVw-1; Thu, 19 Oct 2023 09:01:10 -0400 X-MC-Unique: dSiQoEr-O5SkfQ4pBGjuVw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8754788B7B0 for ; Thu, 19 Oct 2023 13:01:10 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09E9A10828; Thu, 19 Oct 2023 13:01:09 +0000 (UTC) From: Thomas Haller To: NetFilter Cc: Thomas Haller Subject: [PATCH nft v2 3/7] build: no recursive make for "py/Makefile.am" Date: Thu, 19 Oct 2023 15:00:02 +0200 Message-ID: <20231019130057.2719096-4-thaller@redhat.com> In-Reply-To: <20231019130057.2719096-1-thaller@redhat.com> References: <20231019130057.2719096-1-thaller@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Merge the Makefile.am under "py/" into the toplevel Makefile.am. This is a step in the effort of dropping recursive make. Signed-off-by: Thomas Haller --- Makefile.am | 20 ++++++++++++++++---- configure.ac | 1 - py/Makefile.am | 1 - 3 files changed, 16 insertions(+), 6 deletions(-) delete mode 100644 py/Makefile.am diff --git a/Makefile.am b/Makefile.am index bfc64ebbed71..8b8de7bd141a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,7 @@ ACLOCAL_AMFLAGS = -I m4 +EXTRA_DIST = + pkginclude_HEADERS = \ include/nftables/libnftables.h \ $(NULL) @@ -73,11 +75,21 @@ noinst_HEADERS = \ SUBDIRS = src \ files \ doc \ - examples\ - py + examples + +EXTRA_DIST += \ + py/pyproject.toml \ + py/setup.cfg \ + py/setup.py \ + py/src/__init__.py \ + py/src/nftables.py \ + py/src/schema.json \ + $(NULL) -EXTRA_DIST = tests \ - files +EXTRA_DIST += \ + files \ + tests \ + $(NULL) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libnftables.pc diff --git a/configure.ac b/configure.ac index 67ca50fddf67..389efbe9f730 100644 --- a/configure.ac +++ b/configure.ac @@ -123,7 +123,6 @@ AC_CONFIG_FILES([ \ files/nftables/Makefile \ files/osf/Makefile \ doc/Makefile \ - py/Makefile \ examples/Makefile \ ]) AC_OUTPUT diff --git a/py/Makefile.am b/py/Makefile.am deleted file mode 100644 index 76aa082f8709..000000000000 --- a/py/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = pyproject.toml setup.cfg setup.py src From patchwork Thu Oct 19 13:00:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haller X-Patchwork-Id: 1851643 X-Patchwork-Delegate: fw@strlen.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=i988rn38; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4SB7Dp6fBgz20cx for ; Fri, 20 Oct 2023 00:03:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235390AbjJSNDG (ORCPT ); Thu, 19 Oct 2023 09:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235394AbjJSNCz (ORCPT ); Thu, 19 Oct 2023 09:02:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B8274EED for ; Thu, 19 Oct 2023 06:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697720473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uv9yeMyN0M+R6ZQ96W2JhwShhrevNm7NogGyyAZuH6g=; b=i988rn38q9d+vkVJapNXwR22vUwWTnplYNXhxJXjCP0dWzc4XMK3A7pt7VCjYjpsws4RZw +54lsFuGC7BQfzscA8c5vdP1BU0vACRmwjWm8fuIfqVJdAbCcj01EWNkUAx7r9nKvfrqMT 2xenCx8Y/Avqfc5kGe1Cc7WWjZc1fBs= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-336-ly_uAyOAMYO2Yf1VmGEl7g-1; Thu, 19 Oct 2023 09:01:11 -0400 X-MC-Unique: ly_uAyOAMYO2Yf1VmGEl7g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4A4FC3C17097 for ; Thu, 19 Oct 2023 13:01:11 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1F91503B; Thu, 19 Oct 2023 13:01:10 +0000 (UTC) From: Thomas Haller To: NetFilter Cc: Thomas Haller Subject: [PATCH nft v2 4/7] build: no recursive make for "files/**/Makefile.am" Date: Thu, 19 Oct 2023 15:00:03 +0200 Message-ID: <20231019130057.2719096-5-thaller@redhat.com> In-Reply-To: <20231019130057.2719096-1-thaller@redhat.com> References: <20231019130057.2719096-1-thaller@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Merge the Makefile.am under "files/" into the toplevel Makefile.am. This is a step in the effort of dropping recursive make. Signed-off-by: Thomas Haller --- Makefile.am | 43 +++++++++++++++++++++++++++++++++++++- configure.ac | 4 ---- files/Makefile.am | 3 --- files/examples/Makefile.am | 5 ----- files/nftables/Makefile.am | 14 ------------- files/osf/Makefile.am | 2 -- 6 files changed, 42 insertions(+), 29 deletions(-) delete mode 100644 files/Makefile.am delete mode 100644 files/examples/Makefile.am delete mode 100644 files/nftables/Makefile.am delete mode 100644 files/osf/Makefile.am diff --git a/Makefile.am b/Makefile.am index 8b8de7bd141a..83f25dd8574b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,8 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = +############################################################################### + pkginclude_HEADERS = \ include/nftables/libnftables.h \ $(NULL) @@ -72,11 +74,48 @@ noinst_HEADERS = \ \ $(NULL) +############################################################################### + SUBDIRS = src \ - files \ doc \ examples +############################################################################### + +dist_pkgdata_DATA = \ + files/nftables/all-in-one.nft \ + files/nftables/arp-filter.nft \ + files/nftables/bridge-filter.nft \ + files/nftables/inet-filter.nft \ + files/nftables/inet-nat.nft \ + files/nftables/ipv4-filter.nft \ + files/nftables/ipv4-mangle.nft \ + files/nftables/ipv4-nat.nft \ + files/nftables/ipv4-raw.nft \ + files/nftables/ipv6-filter.nft \ + files/nftables/ipv6-mangle.nft \ + files/nftables/ipv6-nat.nft \ + files/nftables/ipv6-raw.nft \ + files/nftables/netdev-ingress.nft \ + $(NULL) + +pkgdocdir = ${docdir}/examples + +dist_pkgdoc_SCRIPTS = \ + files/examples/ct_helpers.nft \ + files/examples/load_balancing.nft \ + files/examples/secmark.nft \ + files/examples/sets_and_maps.nft \ + $(NULL) + +pkgsysconfdir = ${sysconfdir}/nftables/osf + +dist_pkgsysconf_DATA = \ + files/osf/pf.os \ + $(NULL) + +############################################################################### + EXTRA_DIST += \ py/pyproject.toml \ py/setup.cfg \ @@ -86,6 +125,8 @@ EXTRA_DIST += \ py/src/schema.json \ $(NULL) +############################################################################### + EXTRA_DIST += \ files \ tests \ diff --git a/configure.ac b/configure.ac index 389efbe9f730..23581f91341d 100644 --- a/configure.ac +++ b/configure.ac @@ -118,10 +118,6 @@ AC_CONFIG_FILES([ \ Makefile \ libnftables.pc \ src/Makefile \ - files/Makefile \ - files/examples/Makefile \ - files/nftables/Makefile \ - files/osf/Makefile \ doc/Makefile \ examples/Makefile \ ]) diff --git a/files/Makefile.am b/files/Makefile.am deleted file mode 100644 index 7deec1512977..000000000000 --- a/files/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = nftables \ - examples \ - osf diff --git a/files/examples/Makefile.am b/files/examples/Makefile.am deleted file mode 100644 index b29e9f614203..000000000000 --- a/files/examples/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -pkgdocdir = ${docdir}/examples -dist_pkgdoc_SCRIPTS = ct_helpers.nft \ - load_balancing.nft \ - secmark.nft \ - sets_and_maps.nft diff --git a/files/nftables/Makefile.am b/files/nftables/Makefile.am deleted file mode 100644 index ee88dd896743..000000000000 --- a/files/nftables/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -dist_pkgdata_DATA = all-in-one.nft \ - arp-filter.nft \ - bridge-filter.nft \ - inet-filter.nft \ - inet-nat.nft \ - ipv4-filter.nft \ - ipv4-mangle.nft \ - ipv4-nat.nft \ - ipv4-raw.nft \ - ipv6-filter.nft \ - ipv6-mangle.nft \ - ipv6-nat.nft \ - ipv6-raw.nft \ - netdev-ingress.nft diff --git a/files/osf/Makefile.am b/files/osf/Makefile.am deleted file mode 100644 index d80196dd7388..000000000000 --- a/files/osf/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -pkgsysconfdir = ${sysconfdir}/nftables/osf -dist_pkgsysconf_DATA = pf.os From patchwork Thu Oct 19 13:00:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haller X-Patchwork-Id: 1851645 X-Patchwork-Delegate: fw@strlen.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eAVto0Hj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4SB7Ds29VGz20cx for ; Fri, 20 Oct 2023 00:03:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235374AbjJSNDI (ORCPT ); Thu, 19 Oct 2023 09:03:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235387AbjJSNC4 (ORCPT ); Thu, 19 Oct 2023 09:02:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35B4E5FE4 for ; Thu, 19 Oct 2023 06:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697720477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w1rIv6k5i7Iacy3WCcR0scODbf8AJxwp35J68BiaIYU=; b=eAVto0HjixJqmSA1L6E9DfUE2AW3/omNKrMT0t3sihuXUF6kk3P4cmDZs1+Od5u6bhzi/e vmLYk/l3ksGUOLCIBGQa6xYV8XuizNuaFGKVH8Zu04FgyXB7tgJd934NYhO3cExbnqhwGU eDGbvTBywArE+Q5Qc4AFGwDijI6BvQ4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-7-uFc9LrJMO1ClHzb-YbPIDg-1; Thu, 19 Oct 2023 09:01:12 -0400 X-MC-Unique: uFc9LrJMO1ClHzb-YbPIDg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2D06F1C06E11 for ; Thu, 19 Oct 2023 13:01:12 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85594503B; Thu, 19 Oct 2023 13:01:11 +0000 (UTC) From: Thomas Haller To: NetFilter Cc: Thomas Haller Subject: [PATCH nft v2 5/7] build: no recursive make for "src/Makefile.am" Date: Thu, 19 Oct 2023 15:00:04 +0200 Message-ID: <20231019130057.2719096-6-thaller@redhat.com> In-Reply-To: <20231019130057.2719096-1-thaller@redhat.com> References: <20231019130057.2719096-1-thaller@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Merge the Makefile.am under "src/" into the toplevel Makefile.am. This is a step in the effort of dropping recursive make. Signed-off-by: Thomas Haller --- Make_global.am | 21 ----- Makefile.am | 214 +++++++++++++++++++++++++++++++++++++++++++++++- configure.ac | 1 - src/Makefile.am | 123 ---------------------------- 4 files changed, 213 insertions(+), 146 deletions(-) delete mode 100644 Make_global.am delete mode 100644 src/Makefile.am diff --git a/Make_global.am b/Make_global.am deleted file mode 100644 index 5bb541f61388..000000000000 --- a/Make_global.am +++ /dev/null @@ -1,21 +0,0 @@ -# This is _NOT_ the library release version, it's an API version. -# Extracted from Chapter 6 "Library interface versions" of the libtool docs. -# -# -# Here are a set of rules to help you update your library version information: -# -# 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 since the last public release, then -# set age to 0. -# -# -libnftables_LIBVERSION=2:0:1 diff --git a/Makefile.am b/Makefile.am index 83f25dd8574b..b89d60e32d8c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,34 @@ +# This is _NOT_ the library release version, it's an API version. +# Extracted from Chapter 6 "Library interface versions" of the libtool docs. +# +# +# Here are a set of rules to help you update your library version information: +# +# 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 since the last public release, then +# set age to 0. +# +# +libnftables_LIBVERSION = 2:0:1 + +############################################################################### + ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = +BUILT_SOURCES = +lib_LTLIBRARIES = +noinst_LTLIBRARIES = +sbin_PROGRAMS = ############################################################################### @@ -76,7 +104,191 @@ noinst_HEADERS = \ ############################################################################### -SUBDIRS = src \ +AM_CPPFLAGS = \ + "-I$(srcdir)/include" \ + "-DDEFAULT_INCLUDE_PATH=\"${sysconfdir}\"" \ + $(LIBMNL_CFLAGS) \ + $(LIBNFTNL_CFLAGS) \ + $(NULL) + +if BUILD_DEBUG +AM_CPPFLAGS += -g -DDEBUG +endif +if BUILD_XTABLES +AM_CPPFLAGS += $(XTABLES_CFLAGS) +endif +if BUILD_MINIGMP +AM_CPPFLAGS += -DHAVE_MINIGMP +endif +if BUILD_JSON +AM_CPPFLAGS += -DHAVE_JSON +endif +if BUILD_XTABLES +AM_CPPFLAGS += -DHAVE_XTABLES +endif + +AM_CFLAGS = \ + -Wall \ + \ + -Waggregate-return \ + -Wbad-function-cast \ + -Wcast-align \ + -Wdeclaration-after-statement \ + -Wformat-nonliteral \ + -Wformat-security \ + -Winit-self \ + -Wmissing-declarations \ + -Wmissing-format-attribute \ + -Wmissing-prototypes \ + -Wsign-compare \ + -Wstrict-prototypes \ + -Wundef \ + -Wunused \ + -Wwrite-strings \ + \ + $(GCC_FVISIBILITY_HIDDEN) \ + \ + $(NULL) + +AM_YFLAGS = -d -Wno-yacc + +############################################################################### + +BUILT_SOURCES += src/parser_bison.h + +# yacc and lex generate dirty code +noinst_LTLIBRARIES += src/libparser.la + +src_libparser_la_SOURCES = \ + src/parser_bison.y \ + src/scanner.l \ + $(NULL) + +src_libparser_la_CFLAGS = \ + $(AM_CFLAGS) \ + -Wno-implicit-function-declaration \ + -Wno-missing-declarations \ + -Wno-missing-prototypes \ + -Wno-nested-externs \ + -Wno-redundant-decls \ + -Wno-undef \ + -Wno-unused-but-set-variable \ + $(NULL) + +############################################################################### + +if BUILD_MINIGMP + +noinst_LTLIBRARIES += src/libminigmp.la + +src_libminigmp_la_SOURCES = src/mini-gmp.c + +src_libminigmp_la_CFLAGS = \ + $(AM_CFLAGS) \ + -Wno-sign-compare \ + $(NULL) + +endif + +############################################################################### + +lib_LTLIBRARIES += src/libnftables.la + +src_libnftables_la_SOURCES = \ + src/libnftables.map \ + \ + src/cache.c \ + src/cmd.c \ + src/ct.c \ + src/datatype.c \ + src/dccpopt.c \ + src/erec.c \ + src/evaluate.c \ + src/expression.c \ + src/exthdr.c \ + src/fib.c \ + src/gmputil.c \ + src/hash.c \ + src/iface.c \ + src/intervals.c \ + src/ipopt.c \ + src/libnftables.c \ + src/mergesort.c \ + src/meta.c \ + src/misspell.c \ + src/mnl.c \ + src/monitor.c \ + src/netlink.c \ + src/netlink_delinearize.c \ + src/netlink_linearize.c \ + src/nfnl_osf.c \ + src/nftutils.c \ + src/nftutils.h \ + src/numgen.c \ + src/optimize.c \ + src/osf.c \ + src/owner.c \ + src/payload.c \ + src/print.c \ + src/proto.c \ + src/rt.c \ + src/rule.c \ + src/sctp_chunk.c \ + src/segtree.c \ + src/socket.c \ + src/statement.c \ + src/tcpopt.c \ + src/utils.c \ + src/xfrm.c \ + $(NULL) + +src_libnftables_la_SOURCES += src/xt.c + +if BUILD_JSON +src_libnftables_la_SOURCES += \ + src/json.c \ + src/parser_json.c \ + $(NULL) +endif + +src_libnftables_la_LDFLAGS = \ + -version-info "${libnftables_LIBVERSION}" \ + -Wl,--version-script="$(srcdir)/src//libnftables.map" \ + $(NULL) + +src_libnftables_la_LIBADD = \ + $(LIBMNL_LIBS) \ + $(LIBNFTNL_LIBS) \ + src/libparser.la \ + $(NULL) + +if BUILD_MINIGMP +src_libnftables_la_LIBADD += src/libminigmp.la +endif + +if BUILD_XTABLES +src_libnftables_la_LIBADD += $(XTABLES_LIBS) +endif + +if BUILD_JSON +src_libnftables_la_LIBADD += $(JANSSON_LIBS) +endif + +############################################################################### + +sbin_PROGRAMS += src/nft + +src_nft_SOURCES = src/main.c + +if BUILD_CLI +src_nft_SOURCES += src/cli.c +endif + +src_nft_LDADD = src/libnftables.la + +############################################################################### + +SUBDIRS = \ doc \ examples diff --git a/configure.ac b/configure.ac index 23581f91341d..79024e49ab28 100644 --- a/configure.ac +++ b/configure.ac @@ -117,7 +117,6 @@ AC_CHECK_DECLS([getprotobyname_r, getprotobynumber_r, getservbyport_r], [], [], AC_CONFIG_FILES([ \ Makefile \ libnftables.pc \ - src/Makefile \ doc/Makefile \ examples/Makefile \ ]) diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 63a4ef43dae3..000000000000 --- a/src/Makefile.am +++ /dev/null @@ -1,123 +0,0 @@ -include $(top_srcdir)/Make_global.am - -sbin_PROGRAMS = nft - -AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CPPFLAGS += -DDEFAULT_INCLUDE_PATH="\"${sysconfdir}\"" \ - ${LIBMNL_CFLAGS} ${LIBNFTNL_CFLAGS} -if BUILD_DEBUG -AM_CPPFLAGS += -g -DDEBUG -endif -if BUILD_XTABLES -AM_CPPFLAGS += ${XTABLES_CFLAGS} -endif -if BUILD_MINIGMP -AM_CPPFLAGS += -DHAVE_MINIGMP -endif -if BUILD_JSON -AM_CPPFLAGS += -DHAVE_JSON -endif -if BUILD_XTABLES -AM_CPPFLAGS += -DHAVE_XTABLES -endif - -AM_CFLAGS = -Wall \ - -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ - -Wdeclaration-after-statement -Wsign-compare -Winit-self \ - -Wformat-nonliteral -Wformat-security -Wmissing-format-attribute \ - -Wcast-align -Wundef -Wbad-function-cast \ - -Waggregate-return -Wunused -Wwrite-strings ${GCC_FVISIBILITY_HIDDEN} - - -AM_YFLAGS = -d -Wno-yacc - -BUILT_SOURCES = parser_bison.h - -lib_LTLIBRARIES = libnftables.la - -libnftables_la_SOURCES = \ - rule.c \ - statement.c \ - cache.c \ - cmd.c \ - datatype.c \ - expression.c \ - evaluate.c \ - proto.c \ - payload.c \ - exthdr.c \ - fib.c \ - hash.c \ - intervals.c \ - ipopt.c \ - meta.c \ - rt.c \ - numgen.c \ - ct.c \ - xfrm.c \ - netlink.c \ - netlink_linearize.c \ - netlink_delinearize.c \ - misspell.c \ - monitor.c \ - owner.c \ - segtree.c \ - gmputil.c \ - utils.c \ - nftutils.c \ - nftutils.h \ - erec.c \ - mnl.c \ - iface.c \ - mergesort.c \ - optimize.c \ - osf.c \ - nfnl_osf.c \ - tcpopt.c \ - socket.c \ - print.c \ - sctp_chunk.c \ - dccpopt.c \ - libnftables.c \ - libnftables.map - -# yacc and lex generate dirty code -noinst_LTLIBRARIES = libparser.la -libparser_la_SOURCES = parser_bison.y scanner.l -libparser_la_CFLAGS = ${AM_CFLAGS} \ - -Wno-missing-prototypes \ - -Wno-missing-declarations \ - -Wno-implicit-function-declaration \ - -Wno-unused-but-set-variable \ - -Wno-nested-externs \ - -Wno-undef \ - -Wno-redundant-decls - -libnftables_la_LIBADD = ${LIBMNL_LIBS} ${LIBNFTNL_LIBS} libparser.la -libnftables_la_LDFLAGS = -version-info ${libnftables_LIBVERSION} \ - -Wl,--version-script=$(srcdir)/libnftables.map - -if BUILD_MINIGMP -noinst_LTLIBRARIES += libminigmp.la -libminigmp_la_SOURCES = mini-gmp.c -libminigmp_la_CFLAGS = ${AM_CFLAGS} -Wno-sign-compare -libnftables_la_LIBADD += libminigmp.la -endif - -libnftables_la_SOURCES += xt.c -if BUILD_XTABLES -libnftables_la_LIBADD += ${XTABLES_LIBS} -endif - -nft_SOURCES = main.c - -if BUILD_CLI -nft_SOURCES += cli.c -endif - -if BUILD_JSON -libnftables_la_SOURCES += json.c parser_json.c -libnftables_la_LIBADD += ${JANSSON_LIBS} -endif - -nft_LDADD = libnftables.la From patchwork Thu Oct 19 13:00:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haller X-Patchwork-Id: 1851647 X-Patchwork-Delegate: fw@strlen.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CexOfsFR; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4SB7Dt6c4sz23jP for ; Fri, 20 Oct 2023 00:03:10 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235387AbjJSNDK (ORCPT ); Thu, 19 Oct 2023 09:03:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235456AbjJSNC6 (ORCPT ); Thu, 19 Oct 2023 09:02:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 040DE6A45 for ; Thu, 19 Oct 2023 06:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697720483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zVG8ciedwP/ZYgu2AO3RcbwEEBcp2HEQVS+7k0qPYDs=; b=CexOfsFRsqwytwPuZYktZHat3wTEZlc4GgibYdJ93h8scbQIO0tC7BjnyzLtfdyRKOc0LL 7sBLbpy4YF2FbdNWRyNEudDj9x/1zfHBCOCVJrIb1GrxBghbiXkQ3wj/S29JveC2Gxz26e T7oV13rQs3if512Hlf137uqMc2BPvAg= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-83-TO04UvOnMWCY3YK86GlP8A-1; Thu, 19 Oct 2023 09:01:13 -0400 X-MC-Unique: TO04UvOnMWCY3YK86GlP8A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E64703C17089 for ; Thu, 19 Oct 2023 13:01:12 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 683E8503C; Thu, 19 Oct 2023 13:01:12 +0000 (UTC) From: Thomas Haller To: NetFilter Cc: Thomas Haller Subject: [PATCH nft v2 6/7] build: no recursive make for "examples/Makefile.am" Date: Thu, 19 Oct 2023 15:00:05 +0200 Message-ID: <20231019130057.2719096-7-thaller@redhat.com> In-Reply-To: <20231019130057.2719096-1-thaller@redhat.com> References: <20231019130057.2719096-1-thaller@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Merge the Makefile.am under "examples/" into the toplevel Makefile.am. This is a step in the effort of dropping recursive make. Signed-off-by: Thomas Haller --- Makefile.am | 19 ++++++++++++++++--- configure.ac | 1 - examples/Makefile.am | 6 ------ 3 files changed, 16 insertions(+), 10 deletions(-) delete mode 100644 examples/Makefile.am diff --git a/Makefile.am b/Makefile.am index b89d60e32d8c..af82f021203a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,9 +26,11 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = BUILT_SOURCES = +LDADD = lib_LTLIBRARIES = noinst_LTLIBRARIES = sbin_PROGRAMS = +check_PROGRAMS = ############################################################################### @@ -288,9 +290,20 @@ src_nft_LDADD = src/libnftables.la ############################################################################### -SUBDIRS = \ - doc \ - examples +SUBDIRS = doc + +############################################################################### + + +check_PROGRAMS += examples/nft-buffer + +examples_nft_buffer_AM_CPPFLAGS = -I$(srcdir)/include +examples_nft_buffer_LDADD = src/libnftables.la + +check_PROGRAMS += examples/nft-json-file + +examples_nft_json_file_AM_CPPFLAGS = -I$(srcdir)/include +examples_nft_json_file_LDADD = src/libnftables.la ############################################################################### diff --git a/configure.ac b/configure.ac index 79024e49ab28..c5e4113898a0 100644 --- a/configure.ac +++ b/configure.ac @@ -118,7 +118,6 @@ AC_CONFIG_FILES([ \ Makefile \ libnftables.pc \ doc/Makefile \ - examples/Makefile \ ]) AC_OUTPUT diff --git a/examples/Makefile.am b/examples/Makefile.am deleted file mode 100644 index 3b8b0b6708dc..000000000000 --- a/examples/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -check_PROGRAMS = nft-buffer \ - nft-json-file - -AM_CPPFLAGS = -I$(top_srcdir)/include - -LDADD = $(top_builddir)/src/libnftables.la From patchwork Thu Oct 19 13:00:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haller X-Patchwork-Id: 1851646 X-Patchwork-Delegate: fw@strlen.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ajGK5RFt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4SB7Dt2kf0z20cx for ; Fri, 20 Oct 2023 00:03:10 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345812AbjJSNDJ (ORCPT ); Thu, 19 Oct 2023 09:03:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235444AbjJSNC5 (ORCPT ); Thu, 19 Oct 2023 09:02:57 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B3F047AF for ; Thu, 19 Oct 2023 06:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697720482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=woYz2kCCb8ZRZf9svrjdls5JXPoOC5AyXDhf1jmRb+o=; b=ajGK5RFt8hpjV1qqEKzrJCGtJ8EIKKRI2VxSwtuTI+bUvxD5cRH/k8jiKdTek66OvSvDlC MJJGoKfAn/q6/l/7bicBvq2gLdbKD0Eh1w8iywJi/VkIURp+A6y54irqjq+7AwxbuwqN3y 9H4hYEpjCyYopIFicy8hrUPMzj9Yq5s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-VOrbjg-oNJ2lcRwblnY06g-1; Thu, 19 Oct 2023 09:01:14 -0400 X-MC-Unique: VOrbjg-oNJ2lcRwblnY06g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AA94610201E0 for ; Thu, 19 Oct 2023 13:01:13 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C9DE10828; Thu, 19 Oct 2023 13:01:13 +0000 (UTC) From: Thomas Haller To: NetFilter Cc: Thomas Haller Subject: [PATCH nft v2 7/7] build: no recursive make for "doc/Makefile.am" Date: Thu, 19 Oct 2023 15:00:06 +0200 Message-ID: <20231019130057.2719096-8-thaller@redhat.com> In-Reply-To: <20231019130057.2719096-1-thaller@redhat.com> References: <20231019130057.2719096-1-thaller@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Merge the Makefile.am under "doc/" into the toplevel Makefile.am. This is a step in the effort of dropping recursive make. Signed-off-by: Thomas Haller --- Makefile.am | 60 ++++++++++++++++++++++++++++++++++++++++++++----- configure.ac | 1 - doc/Makefile.am | 30 ------------------------- 3 files changed, 55 insertions(+), 36 deletions(-) delete mode 100644 doc/Makefile.am diff --git a/Makefile.am b/Makefile.am index af82f021203a..0ed831a19e95 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,6 +31,8 @@ lib_LTLIBRARIES = noinst_LTLIBRARIES = sbin_PROGRAMS = check_PROGRAMS = +dist_man_MANS = +CLEANFILES = ############################################################################### @@ -290,11 +292,6 @@ src_nft_LDADD = src/libnftables.la ############################################################################### -SUBDIRS = doc - -############################################################################### - - check_PROGRAMS += examples/nft-buffer examples_nft_buffer_AM_CPPFLAGS = -I$(srcdir)/include @@ -307,6 +304,59 @@ examples_nft_json_file_LDADD = src/libnftables.la ############################################################################### +if BUILD_MAN + +dist_man_MANS += \ + doc/nft.8 \ + doc/libnftables-json.5 \ + doc/libnftables.3 \ + $(NULL) + +A2X_OPTS_MANPAGE = \ + -L \ + --doctype manpage \ + --format manpage \ + -D "${builddir}/doc" \ + $(NULL) + +ASCIIDOC_MAIN = doc/nft.txt + +ASCIIDOC_INCLUDES = \ + doc/data-types.txt \ + doc/payload-expression.txt \ + doc/primary-expression.txt \ + doc/stateful-objects.txt \ + doc/statements.txt \ + $(NULL) + +ASCIIDOCS = \ + $(ASCIIDOC_MAIN) \ + $(ASCIIDOC_INCLUDES) \ + $(NULL) + +EXTRA_DIST += \ + $(ASCIIDOCS) \ + doc/libnftables-json.adoc \ + doc/libnftables.adoc \ + $(NULL) + +CLEANFILES += doc/*~ + +doc/nft.8: $(ASCIIDOCS) + $(AM_V_GEN)$(A2X) $(A2X_OPTS_MANPAGE) $< + +.adoc.3: + $(AM_V_GEN)$(A2X) $(A2X_OPTS_MANPAGE) $< + +.adoc.5: + $(AM_V_GEN)$(A2X) $(A2X_OPTS_MANPAGE) $< + +MAINTAINERCLEANFILES = ${dist_man_MANS} + +endif + +############################################################################### + dist_pkgdata_DATA = \ files/nftables/all-in-one.nft \ files/nftables/arp-filter.nft \ diff --git a/configure.ac b/configure.ac index c5e4113898a0..724a4ae726c1 100644 --- a/configure.ac +++ b/configure.ac @@ -117,7 +117,6 @@ AC_CHECK_DECLS([getprotobyname_r, getprotobynumber_r, getservbyport_r], [], [], AC_CONFIG_FILES([ \ Makefile \ libnftables.pc \ - doc/Makefile \ ]) AC_OUTPUT diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index b43cb08d2d14..000000000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -if BUILD_MAN -dist_man_MANS = nft.8 libnftables-json.5 libnftables.3 - -A2X_OPTS_MANPAGE = -L --doctype manpage --format manpage -D ${builddir} - -ASCIIDOC_MAIN = nft.txt -ASCIIDOC_INCLUDES = \ - data-types.txt \ - payload-expression.txt \ - primary-expression.txt \ - stateful-objects.txt \ - statements.txt -ASCIIDOCS = ${ASCIIDOC_MAIN} ${ASCIIDOC_INCLUDES} - -EXTRA_DIST = ${ASCIIDOCS} libnftables-json.adoc libnftables.adoc - -CLEANFILES = \ - *~ - -nft.8: ${ASCIIDOCS} - ${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} $< - -.adoc.3: - ${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} $< - -.adoc.5: - ${AM_V_GEN}${A2X} ${A2X_OPTS_MANPAGE} $< - -MAINTAINERCLEANFILES = ${dist_man_MANS} -endif