naccyde / rpms / systemd

Forked from rpms/systemd 11 months ago
Clone
7570e2
From a975d2b983bee77423ffbb29803403e0c3cba5bc Mon Sep 17 00:00:00 2001
7570e2
Message-Id: <a975d2b983bee77423ffbb29803403e0c3cba5bc.1637749821.git.aclaudi@redhat.com>
7570e2
In-Reply-To: <cef782ca658d695c5ca2d174ba1f89cba6bd84e5.1637749821.git.aclaudi@redhat.com>
7570e2
References: <cef782ca658d695c5ca2d174ba1f89cba6bd84e5.1637749821.git.aclaudi@redhat.com>
7570e2
From: Andrea Claudi <aclaudi@redhat.com>
7570e2
Date: Wed, 24 Nov 2021 11:28:08 +0100
7570e2
Subject: [PATCH] configure: add the --prefix option
7570e2
7570e2
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2009355
7570e2
Upstream Status: iproute2.git commit 0ee1950b
7570e2
7570e2
commit 0ee1950b5c38986ea896606810231f5f9d761a00
7570e2
Author: Andrea Claudi <aclaudi@redhat.com>
7570e2
Date:   Thu Oct 14 10:50:54 2021 +0200
7570e2
7570e2
    configure: add the --prefix option
7570e2
7570e2
    This commit add the '--prefix' option to the iproute2 configure script.
7570e2
7570e2
    This mimics the '--prefix' option that autotools configure provides, and
7570e2
    will be used later to allow users or packagers to set the lib directory.
7570e2
7570e2
    Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
7570e2
    Acked-by: Phil Sutter <phil@nwl.cc>
7570e2
    Signed-off-by: David Ahern <dsahern@kernel.org>
7570e2
---
7570e2
 configure | 8 ++++++++
7570e2
 1 file changed, 8 insertions(+)
7570e2
7570e2
diff --git a/configure b/configure
7570e2
index 9a2645d9..05e23eff 100755
7570e2
--- a/configure
7570e2
+++ b/configure
7570e2
@@ -3,6 +3,7 @@
7570e2
 # This is not an autoconf generated configure
7570e2
 
7570e2
 INCLUDE="$PWD/include"
7570e2
+PREFIX="/usr"
7570e2
 
7570e2
 # Output file which is input to Makefile
7570e2
 CONFIG=config.mk
7570e2
@@ -490,6 +491,7 @@ Usage: $0 [OPTIONS]
7570e2
 	--libbpf_force <on|off>		Enable/disable libbpf by force. Available options:
7570e2
 					  on: require link against libbpf, quit config if no libbpf support
7570e2
 					  off: disable libbpf probing
7570e2
+	--prefix <dir>			Path prefix of the lib files to install
7570e2
 	-h | --help			Show this usage info
7570e2
 EOF
7570e2
 	exit $1
7570e2
@@ -516,6 +518,11 @@ else
7570e2
 				LIBBPF_FORCE="$1" ;;
7570e2
 			--libbpf_force=*)
7570e2
 				LIBBPF_FORCE="${1#*=}" ;;
7570e2
+			--prefix)
7570e2
+				shift
7570e2
+				PREFIX="$1" ;;
7570e2
+			--prefix=*)
7570e2
+				PREFIX="${1#*=}" ;;
7570e2
 			-h | --help)
7570e2
 				usage 0 ;;
7570e2
 			--*)
7570e2
@@ -536,6 +543,7 @@ if [ "${LIBBPF_FORCE-unused}" != "unused" ]; then
7570e2
 		usage 1
7570e2
 	fi
7570e2
 fi
7570e2
+[ -z "$PREFIX" ] && usage 1
7570e2
 
7570e2
 echo "# Generated config based on" $INCLUDE >$CONFIG
7570e2
 quiet_config >> $CONFIG
7570e2
-- 
7570e2
2.31.1
7570e2