diff mbox series

[1/2,iproute2] configure: support --param=value style

Message ID 754f3aaeae85cdc9aec0a7b609803a0281e1fabb.1633191885.git.aclaudi@redhat.com (mailing list archive)
State Changes Requested
Delegated to: David Ahern
Headers show
Series configure: add support for libdir param | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Andrea Claudi Oct. 2, 2021, 4:41 p.m. UTC
This commit makes it possible to specify values for configure params
using the common autotools configure syntax '--param=value'.

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
 configure | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

David Ahern Oct. 4, 2021, 1:28 a.m. UTC | #1
On 10/2/21 10:41 AM, Andrea Claudi wrote:
> 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 ;;

We should be able to consolidate these into 1 case like:

			--libbpf_dir|--libbpf_dir=)

and then handle the difference in argument style. e.g.,

			LIBBPF_FORCE="${1#*=}"
			if [ -z "${LIBBPF_FORCE}" ]; then
				LIBBPF_FORCE=$2
				shift
			fi

			....


>  			--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 ;;
>  			"")
>
diff mbox series

Patch

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 ;;
 			"")