Subject: Re: [PATCHv3 iproute2-next 1/5] configure: add check_libbpf() for later libbpf support

From: Toke Høiland-Jørgensen <[email-masked]>
Date: Wed, 04 Nov 2020 12:09:15 +0100

Hangbin Liu <[email-masked]> writes:

> On Tue, Nov 03, 2020 at 10:32:37AM -0700, David Ahern wrote:
>> configure scripts usually allow you to control options directly,
>> overriding the autoprobe.
>
> What do you think of the follow update? It's a little rough and only controls
> libbpf.
>
> $ git diff
> diff --git a/configure b/configure
> index 711bb69c..be35c024 100755
> --- a/configure
> +++ b/configure
> @@ -442,6 +442,35 @@ endif
>  EOF
>  }
>
> +usage()
> +{
> +       cat <<EOF
> +Usage: $0 [OPTIONS]
> +  -h | --help                  Show this usage info
> +  --no-libbpf                  build the package without libbpf
> +  --libbpf-dir=DIR             build the package with self defined libbpf dir
> +EOF
> +       exit $1
> +}

This would be the only command line arg that configure takes; all other
options are passed via the environment. I think we should be consistent
here; and since converting the whole configure script is probably out of
scope for this patch, why not just use the existing FORCE_LIBBPF
variable?

I.e., FORCE_LIBBPF=on will fail if not libbpf is present,
FORCE_LIBBPF=off will disable libbpf entirely, and if the variable is
unset, libbpf will be used if found?

Alternatively, keep them as two separate variables (FORCE_LIBBPF and
DISABLE_LIBBPF?). I don't have any strong preference as to which of
those is best, but I think they'd both be more consistent with the
existing configure script logic...

-Toke