configure: add the --prefix option

This commit add the '--prefix' option to the iproute2 configure script.

This mimics the '--prefix' option that autotools configure provides, and
will be used later to allow users or packagers to set the lib directory.

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
Andrea Claudi 2021-10-14 10:50:54 +02:00 committed by David Ahern
parent 4b8bca5f9e
commit 0ee1950b5c
1 changed files with 8 additions and 0 deletions

8
configure vendored
View File

@ -3,6 +3,7 @@
# This is not an autoconf generated configure # This is not an autoconf generated configure
INCLUDE="$PWD/include" INCLUDE="$PWD/include"
PREFIX="/usr"
# Output file which is input to Makefile # Output file which is input to Makefile
CONFIG=config.mk CONFIG=config.mk
@ -490,6 +491,7 @@ Usage: $0 [OPTIONS]
--libbpf_force <on|off> Enable/disable libbpf by force. Available options: --libbpf_force <on|off> Enable/disable libbpf by force. Available options:
on: require link against libbpf, quit config if no libbpf support on: require link against libbpf, quit config if no libbpf support
off: disable libbpf probing off: disable libbpf probing
--prefix <dir> Path prefix of the lib files to install
-h | --help Show this usage info -h | --help Show this usage info
EOF EOF
exit $1 exit $1
@ -516,6 +518,11 @@ else
LIBBPF_FORCE="$1" ;; LIBBPF_FORCE="$1" ;;
--libbpf_force=*) --libbpf_force=*)
LIBBPF_FORCE="${1#*=}" ;; LIBBPF_FORCE="${1#*=}" ;;
--prefix)
shift
PREFIX="$1" ;;
--prefix=*)
PREFIX="${1#*=}" ;;
-h | --help) -h | --help)
usage 0 ;; usage 0 ;;
--*) --*)
@ -536,6 +543,7 @@ if [ "${LIBBPF_FORCE-unused}" != "unused" ]; then
usage 1 usage 1
fi fi
fi fi
[ -z "$PREFIX" ] && usage 1
echo "# Generated config based on" $INCLUDE >$CONFIG echo "# Generated config based on" $INCLUDE >$CONFIG
quiet_config >> $CONFIG quiet_config >> $CONFIG