lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  7 Oct 2021 15:40:03 +0200
From:   Andrea Claudi <aclaudi@...hat.com>
To:     netdev@...r.kernel.org
Cc:     stephen@...workplumber.org, dsahern@...il.com, bluca@...ian.org,
        phil@....cc, haliu@...hat.com
Subject: [PATCH iproute2 v4 3/5] configure: support --param=value style

This commit makes it possible to specify values for configure params
using the common autotools configure syntax '--param=value'.

To avoid code duplication, semantic check on libbpf_force is moved to a
dedicated function.

Signed-off-by: Andrea Claudi <aclaudi@...hat.com>
---
 configure | 36 +++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 27db3ecb..08e7410b 100755
--- a/configure
+++ b/configure
@@ -485,12 +485,12 @@ usage()
 {
 	cat <<EOF
 Usage: $0 [OPTIONS]
-	--include_dir <dir>	Path to iproute2 include dir
-	--libbpf_dir <dir>	Path to libbpf DESTDIR
-	--libbpf_force		Enable/disable libbpf by force. Available options:
-				  on: require link against libbpf, quit config if no libbpf support
-				  off: disable libbpf probing
-	-h | --help		Show this usage info
+	--include_dir <dir>		Path to iproute2 include dir
+	--libbpf_dir <dir>		Path to libbpf DESTDIR
+	--libbpf_force <on|off>		Enable/disable libbpf by force.
+					  on: require link against libbpf, quit config if no libbpf support
+					  off: disable libbpf probing
+	-h | --help			Show this usage info
 EOF
 	exit $1
 }
@@ -500,6 +500,13 @@ check_value()
 	[ -z "$1" ] && usage 1
 }
 
+check_onoff()
+{
+	if [ "$1" != 'on' ] && [ "$1" != 'off' ]; then
+		usage 1
+	fi
+}
+
 # Compat with the old INCLUDE path setting method.
 if [ $# -eq 1 ] && [ "$(echo $1 | cut -c 1)" != '-' ]; then
 	INCLUDE="$1"
@@ -510,16 +517,26 @@ else
 				INCLUDE=$2
 				check_value "$INCLUDE"
 				shift 2 ;;
+			--include_dir=*)
+				INCLUDE="${1#*=}"
+				check_value "$INCLUDE"
+				shift ;;
 			--libbpf_dir)
 				LIBBPF_DIR="$2"
 				check_value "$LIBBPF_DIR"
 				shift 2 ;;
+			--libbpf_dir=*)
+				LIBBPF_DIR="${1#*=}"
+				check_value "$LIBBPF_DIR"
+				shift ;;
 			--libbpf_force)
-				if [ "$2" != 'on' ] && [ "$2" != 'off' ]; then
-					usage 1
-				fi
 				LIBBPF_FORCE=$2
+				check_onoff "$LIBBPF_FORCE"
 				shift 2 ;;
+			--libbpf_force=*)
+				LIBBPF_FORCE="${1#*=}"
+				check_onoff "$LIBBPF_FORCE"
+				shift ;;
 			-h | --help)
 				usage 0 ;;
 			"")
@@ -528,6 +545,7 @@ else
 				shift 1 ;;
 		esac
 	done
+
 fi
 
 echo "# Generated config based on" $INCLUDE >$CONFIG
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ