From patchwork Sat Oct 2 16:41:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Claudi X-Patchwork-Id: 12532315 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAE92C433F5 for ; Sat, 2 Oct 2021 16:53:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE19061AEE for ; Sat, 2 Oct 2021 16:53:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233664AbhJBQp1 (ORCPT ); Sat, 2 Oct 2021 12:45:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27344 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233656AbhJBQpY (ORCPT ); Sat, 2 Oct 2021 12:45:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633193018; 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=3Q56F8alOjjoETinKdCi9lhlS7jiIZcwAjQIl5WxwzI=; b=SA/rMJEiBkxX/sW1nE6neWUU7BTxOx7Mpm/3XkvirvQXWJrH8ckC5S3Jk0VVCoMdf8LxBP Kn0R6LuERyDIPYWjbzFN25lHezq/6SEHHRsWlZ8zR8dpG2WUnyIRTCw3hwofZF0CWhxkNl Ag5GYIamG9GfdQu64O8i1h+8SVKcHLk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-OfsZTbypN22FUkpSFiFAXA-1; Sat, 02 Oct 2021 12:43:37 -0400 X-MC-Unique: OfsZTbypN22FUkpSFiFAXA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5251D1808308; Sat, 2 Oct 2021 16:43:36 +0000 (UTC) Received: from renaissance-vector.redhat.com (unknown [10.39.192.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 13C285D740; Sat, 2 Oct 2021 16:43:34 +0000 (UTC) From: Andrea Claudi To: netdev@vger.kernel.org Cc: stephen@networkplumber.org, dsahern@gmail.com, bluca@debian.org Subject: [PATCH 1/2 iproute2] configure: support --param=value style Date: Sat, 2 Oct 2021 18:41:20 +0200 Message-Id: <754f3aaeae85cdc9aec0a7b609803a0281e1fabb.1633191885.git.aclaudi@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com This commit makes it possible to specify values for configure params using the common autotools configure syntax '--param=value'. Signed-off-by: Andrea Claudi --- configure | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure b/configure index 7f4f3bd9..f0c81ee1 100755 --- a/configure +++ b/configure @@ -504,15 +504,28 @@ else --include_dir) INCLUDE=$2 shift 2 ;; + --include_dir=*) + INCLUDE="${1#*=}" + shift ;; --libbpf_dir) LIBBPF_DIR="$2" shift 2 ;; + --libbpf_dir=*) + LIBBPF_DIR="${1#*=}" + shift ;; --libbpf_force) if [ "$2" != 'on' ] && [ "$2" != 'off' ]; then usage 1 fi LIBBPF_FORCE=$2 shift 2 ;; + --libbpf_force=*) + libbpf_f="${1#*=}" + if [ "$libbpf_f" != 'on' ] && [ "$libbpf_f" != 'off' ]; then + usage 1 + fi + LIBBPF_FORCE="$libbpf_f" + shift ;; -h | --help) usage 0 ;; "") From patchwork Sat Oct 2 16:41:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Claudi X-Patchwork-Id: 12532313 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3BA0C4332F for ; Sat, 2 Oct 2021 16:53:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C612161B28 for ; Sat, 2 Oct 2021 16:53:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233674AbhJBQp3 (ORCPT ); Sat, 2 Oct 2021 12:45:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47106 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233659AbhJBQp0 (ORCPT ); Sat, 2 Oct 2021 12:45:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633193020; 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=mPVKKmzJ904TlkYHJ+uR1Am9wdvn/NnuT6zIrlFo9Rk=; b=CXtYYNSaF3m9C1dULAJk771BeDkXqSZWVhE6HQzI8YDh6i/6UMjC80IJB4PcBVo3YOZKYK lnj8ceT8LdEe0XZq1yTlAQaVOWkUE0gqXXMbVMkYVa+M5egdvrWclLiLsAeUQFrUKpVDvM Z6696Ywa3HxkzwuiB6+bSkVGCT+0GQk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-428-KBwS3PngOMiW53nqPj6udA-1; Sat, 02 Oct 2021 12:43:39 -0400 X-MC-Unique: KBwS3PngOMiW53nqPj6udA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 11D2C1808308; Sat, 2 Oct 2021 16:43:38 +0000 (UTC) Received: from renaissance-vector.redhat.com (unknown [10.39.192.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id C04A35D740; Sat, 2 Oct 2021 16:43:36 +0000 (UTC) From: Andrea Claudi To: netdev@vger.kernel.org Cc: stephen@networkplumber.org, dsahern@gmail.com, bluca@debian.org Subject: [PATCH 2/2 iproute2] configure: add the --libdir param Date: Sat, 2 Oct 2021 18:41:21 +0200 Message-Id: <1047327c1350db0fe3df84d7eb96bf45955fa795.1633191885.git.aclaudi@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com This commit allows users/packagers to choose a lib directory to store iproute2 lib files. At the moment iproute2 ship lib files in /usr/lib and offers no way to modify this setting. However, according to the FHS, distros may choose "one or more variants of the /lib directory on systems which support more than one binary format" (e.g. /usr/lib64 on Fedora). As Luca states in commit a3272b93725a ("configure: restore backward compatibility"), packaging systems may assume that 'configure' is from autotools, and try to pass it some parameters. Allowing the '--libdir=/path/to/libdir' syntax, we can use this to our advantage, and let the lib directory to be chosen by the distro packaging system. Signed-off-by: Andrea Claudi --- Makefile | 7 ++++--- configure | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5bc11477..45655ca4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 # Top level Makefile for iproute2 +-include config.mk + ifeq ("$(origin V)", "command line") VERBOSE = $(V) endif @@ -13,7 +15,6 @@ MAKEFLAGS += --no-print-directory endif PREFIX?=/usr -LIBDIR?=$(PREFIX)/lib SBINDIR?=/sbin CONFDIR?=/etc/iproute2 NETNS_RUN_DIR?=/var/run/netns @@ -60,7 +61,7 @@ SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma dcb man vdpa LIBNETLINK=../lib/libutil.a ../lib/libnetlink.a LDLIBS += $(LIBNETLINK) -all: config +all: config.mk @set -e; \ for i in $(SUBDIRS); \ do echo; echo $$i; $(MAKE) -C $$i; done @@ -80,7 +81,7 @@ help: @echo "Make Arguments:" @echo " V=[0|1] - set build verbosity level" -config: +config.mk: @if [ ! -f config.mk -o configure -nt config.mk ]; then \ sh configure $(KERNEL_INCLUDE); \ fi diff --git a/configure b/configure index f0c81ee1..a1b0261a 100755 --- a/configure +++ b/configure @@ -148,6 +148,19 @@ EOF rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest } +check_lib_dir() +{ + echo -n "lib directory: " + if [ -n "$LIB_DIR" ]; then + echo "$LIB_DIR" + echo "LIBDIR:=$LIB_DIR" >> $CONFIG + return + fi + + echo "/usr/lib" + echo "LIBDIR:=/usr/lib" >> $CONFIG +} + check_ipt() { if ! grep TC_CONFIG_XT $CONFIG > /dev/null; then @@ -486,6 +499,7 @@ usage() cat <