From 413ee338d46e4f6f2e5c89627b6279b809d4288a Mon Sep 17 00:00:00 2001 From: Kevin Vigor Date: Wed, 28 Aug 2019 09:53:10 -0700 Subject: liburing: specifying --prefix to configure script was ineffective, fix. The configure script used the default value of the prefix variable (/usr) to determine the includedir etc. *before* parsing the command line to determine if the user specified a prefix. This made configure --prefix ineffective. Fix. Tested with configure --help, configure --prefix, configure --prefix --includedir Signed-off-by: Jens Axboe --- configure | 88 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/configure b/configure index 19c2b54..0b185b8 100755 --- a/configure +++ b/configure @@ -10,10 +10,54 @@ else fi cc=gcc -prefix=/usr -includedir="$prefix/include" -libdir="$prefix/lib" -mandir="$prefix/man" + +for opt do + optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') + case "$opt" in + --help|-h) show_help=yes + ;; + --prefix=*) prefix="$optarg" + ;; + --includedir=*) includedir="$optarg" + ;; + --libdir=*) libdir="$optarg" + ;; + --mandir=*) mandir="$optarg" + ;; + *) + echo "ERROR: unkown option $opt" + echo "Try '$0 --help' for more information" + exit 1 + ;; + esac +done + +if test -z "$prefix"; then + prefix=/usr +fi +if test -z "$includedir"; then + includedir="$prefix/include" +fi +if test -z "$libdir"; then + libdir="$prefix/lib" +fi +if test -z "$mandir"; then + mandir="$prefix/man" +fi + +if test "$show_help" = "yes"; then +cat <