|
|
87177b |
From 935d2e39c8341178adbfcf7ae037b9f64dbc2d6e Mon Sep 17 00:00:00 2001
|
|
|
87177b |
Message-Id: <935d2e39c8341178adbfcf7ae037b9f64dbc2d6e.1637749821.git.aclaudi@redhat.com>
|
|
|
87177b |
In-Reply-To: <cef782ca658d695c5ca2d174ba1f89cba6bd84e5.1637749821.git.aclaudi@redhat.com>
|
|
|
87177b |
References: <cef782ca658d695c5ca2d174ba1f89cba6bd84e5.1637749821.git.aclaudi@redhat.com>
|
|
|
87177b |
From: Andrea Claudi <aclaudi@redhat.com>
|
|
|
87177b |
Date: Wed, 24 Nov 2021 11:28:09 +0100
|
|
|
87177b |
Subject: [PATCH] configure: add the --libdir option
|
|
|
87177b |
|
|
|
87177b |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2009355
|
|
|
87177b |
Upstream Status: iproute2.git commit cee0cf84
|
|
|
87177b |
|
|
|
87177b |
commit cee0cf84bd32c8d9215f0c155187ad99d52a69b1
|
|
|
87177b |
Author: Andrea Claudi <aclaudi@redhat.com>
|
|
|
87177b |
Date: Thu Oct 14 10:50:55 2021 +0200
|
|
|
87177b |
|
|
|
87177b |
configure: add the --libdir option
|
|
|
87177b |
|
|
|
87177b |
This commit allows users/packagers to choose a lib directory to store
|
|
|
87177b |
iproute2 lib files.
|
|
|
87177b |
|
|
|
87177b |
At the moment iproute2 ship lib files in /usr/lib and offers no way to
|
|
|
87177b |
modify this setting. However, according to the FHS, distros may choose
|
|
|
87177b |
"one or more variants of the /lib directory on systems which support
|
|
|
87177b |
more than one binary format" (e.g. /usr/lib64 on Fedora).
|
|
|
87177b |
|
|
|
87177b |
As Luca states in commit a3272b93725a ("configure: restore backward
|
|
|
87177b |
compatibility"), packaging systems may assume that 'configure' is from
|
|
|
87177b |
autotools, and try to pass it some parameters.
|
|
|
87177b |
|
|
|
87177b |
Allowing the '--libdir=/path/to/libdir' syntax, we can use this to our
|
|
|
87177b |
advantage, and let the lib directory to be chosen by the distro
|
|
|
87177b |
packaging system.
|
|
|
87177b |
|
|
|
87177b |
Note that LIBDIR uses "\${prefix}/lib" as default value because autoconf
|
|
|
87177b |
allows this to be expanded to the --prefix value at configure runtime.
|
|
|
87177b |
"\${prefix}" is replaced with the PREFIX value in check_lib_dir().
|
|
|
87177b |
|
|
|
87177b |
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
|
|
|
87177b |
Acked-by: Phil Sutter <phil@nwl.cc>
|
|
|
87177b |
Signed-off-by: David Ahern <dsahern@kernel.org>
|
|
|
87177b |
---
|
|
|
87177b |
Makefile | 7 ++++---
|
|
|
87177b |
configure | 18 ++++++++++++++++++
|
|
|
87177b |
2 files changed, 22 insertions(+), 3 deletions(-)
|
|
|
87177b |
|
|
|
87177b |
diff --git a/Makefile b/Makefile
|
|
|
87177b |
index 5bc11477..45655ca4 100644
|
|
|
87177b |
--- a/Makefile
|
|
|
87177b |
+++ b/Makefile
|
|
|
87177b |
@@ -1,6 +1,8 @@
|
|
|
87177b |
# SPDX-License-Identifier: GPL-2.0
|
|
|
87177b |
# Top level Makefile for iproute2
|
|
|
87177b |
|
|
|
87177b |
+-include config.mk
|
|
|
87177b |
+
|
|
|
87177b |
ifeq ("$(origin V)", "command line")
|
|
|
87177b |
VERBOSE = $(V)
|
|
|
87177b |
endif
|
|
|
87177b |
@@ -13,7 +15,6 @@ MAKEFLAGS += --no-print-directory
|
|
|
87177b |
endif
|
|
|
87177b |
|
|
|
87177b |
PREFIX?=/usr
|
|
|
87177b |
-LIBDIR?=$(PREFIX)/lib
|
|
|
87177b |
SBINDIR?=/sbin
|
|
|
87177b |
CONFDIR?=/etc/iproute2
|
|
|
87177b |
NETNS_RUN_DIR?=/var/run/netns
|
|
|
87177b |
@@ -60,7 +61,7 @@ SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma dcb man vdpa
|
|
|
87177b |
LIBNETLINK=../lib/libutil.a ../lib/libnetlink.a
|
|
|
87177b |
LDLIBS += $(LIBNETLINK)
|
|
|
87177b |
|
|
|
87177b |
-all: config
|
|
|
87177b |
+all: config.mk
|
|
|
87177b |
@set -e; \
|
|
|
87177b |
for i in $(SUBDIRS); \
|
|
|
87177b |
do echo; echo $$i; $(MAKE) -C $$i; done
|
|
|
87177b |
@@ -80,7 +81,7 @@ help:
|
|
|
87177b |
@echo "Make Arguments:"
|
|
|
87177b |
@echo " V=[0|1] - set build verbosity level"
|
|
|
87177b |
|
|
|
87177b |
-config:
|
|
|
87177b |
+config.mk:
|
|
|
87177b |
@if [ ! -f config.mk -o configure -nt config.mk ]; then \
|
|
|
87177b |
sh configure $(KERNEL_INCLUDE); \
|
|
|
87177b |
fi
|
|
|
87177b |
diff --git a/configure b/configure
|
|
|
87177b |
index 05e23eff..8ddff43c 100755
|
|
|
87177b |
--- a/configure
|
|
|
87177b |
+++ b/configure
|
|
|
87177b |
@@ -4,6 +4,7 @@
|
|
|
87177b |
|
|
|
87177b |
INCLUDE="$PWD/include"
|
|
|
87177b |
PREFIX="/usr"
|
|
|
87177b |
+LIBDIR="\${prefix}/lib"
|
|
|
87177b |
|
|
|
87177b |
# Output file which is input to Makefile
|
|
|
87177b |
CONFIG=config.mk
|
|
|
87177b |
@@ -149,6 +150,15 @@ EOF
|
|
|
87177b |
rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
|
|
|
87177b |
}
|
|
|
87177b |
|
|
|
87177b |
+check_lib_dir()
|
|
|
87177b |
+{
|
|
|
87177b |
+ LIBDIR=$(echo $LIBDIR | sed "s|\${prefix}|$PREFIX|")
|
|
|
87177b |
+
|
|
|
87177b |
+ echo -n "lib directory: "
|
|
|
87177b |
+ echo "$LIBDIR"
|
|
|
87177b |
+ echo "LIBDIR:=$LIBDIR" >> $CONFIG
|
|
|
87177b |
+}
|
|
|
87177b |
+
|
|
|
87177b |
check_ipt()
|
|
|
87177b |
{
|
|
|
87177b |
if ! grep TC_CONFIG_XT $CONFIG > /dev/null; then
|
|
|
87177b |
@@ -487,6 +497,7 @@ usage()
|
|
|
87177b |
cat <
|
|
|
87177b |
Usage: $0 [OPTIONS]
|
|
|
87177b |
--include_dir <dir> Path to iproute2 include dir
|
|
|
87177b |
+ --libdir <dir> Path to iproute2 lib dir
|
|
|
87177b |
--libbpf_dir <dir> Path to libbpf DESTDIR
|
|
|
87177b |
--libbpf_force <on|off> Enable/disable libbpf by force. Available options:
|
|
|
87177b |
on: require link against libbpf, quit config if no libbpf support
|
|
|
87177b |
@@ -508,6 +519,11 @@ else
|
|
|
87177b |
INCLUDE="$1" ;;
|
|
|
87177b |
--include_dir=*)
|
|
|
87177b |
INCLUDE="${1#*=}" ;;
|
|
|
87177b |
+ --libdir)
|
|
|
87177b |
+ shift
|
|
|
87177b |
+ LIBDIR="$1" ;;
|
|
|
87177b |
+ --libdir=*)
|
|
|
87177b |
+ LIBDIR="${1#*=}" ;;
|
|
|
87177b |
--libbpf_dir)
|
|
|
87177b |
shift
|
|
|
87177b |
LIBBPF_DIR="$1" ;;
|
|
|
87177b |
@@ -544,6 +560,7 @@ if [ "${LIBBPF_FORCE-unused}" != "unused" ]; then
|
|
|
87177b |
fi
|
|
|
87177b |
fi
|
|
|
87177b |
[ -z "$PREFIX" ] && usage 1
|
|
|
87177b |
+[ -z "$LIBDIR" ] && usage 1
|
|
|
87177b |
|
|
|
87177b |
echo "# Generated config based on" $INCLUDE >$CONFIG
|
|
|
87177b |
quiet_config >> $CONFIG
|
|
|
87177b |
@@ -568,6 +585,7 @@ if ! grep -q TC_CONFIG_NO_XT $CONFIG; then
|
|
|
87177b |
fi
|
|
|
87177b |
|
|
|
87177b |
echo
|
|
|
87177b |
+check_lib_dir
|
|
|
87177b |
if ! grep -q TC_CONFIG_NO_XT $CONFIG; then
|
|
|
87177b |
echo -n "iptables modules directory: "
|
|
|
87177b |
check_ipt_lib_dir
|
|
|
87177b |
--
|
|
|
87177b |
2.31.1
|
|
|
87177b |
|