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 +} + +while true; do + case "$1" in + --libbpf-dir) + LIBBPF_DIR="$2" + shift 2 ;; + --no-libbpf) + NO_LIBBPF_CHECK=1 + shift ;; + -h | --help) + usage 0 ;; + "") + break ;; + *) + usage 1 ;; + esac +done + + echo "# Generated config based on" $INCLUDE >$CONFIG quiet_config >> $CONFIG @@ -476,8 +505,10 @@ check_setns echo -n "SELinux support: " check_selinux -echo -n "libbpf support: " -check_libbpf +if [ -z $NO_LIBBPF_CHECK ]; then + echo -n "libbpf support: " + check_libbpf +fi echo -n "ELF support: " check_elf $ ./configure -h Usage: ./configure [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 Thanks Hangbin