summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Vigor <kvigor@gmail.com>2019-08-28 09:53:10 -0700
committerJens Axboe <axboe@kernel.dk>2019-08-28 11:41:39 -0600
commit413ee338d46e4f6f2e5c89627b6279b809d4288a (patch)
tree5eedb34f3abbdeeeb30b2e4f7f860b9de9b975f6
parent6e9dd0c8c50b5988a0c77532c9c2bd6afd4790d2 (diff)
downloadliburing-413ee338d46e4f6f2e5c89627b6279b809d4288a.tar.gz
liburing-413ee338d46e4f6f2e5c89627b6279b809d4288a.tar.bz2
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 <axboe@kernel.dk>
-rwxr-xr-xconfigure88
1 files 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 <<EOF
+
+Usage: configure [options]
+Options: [defaults in brackets after descriptions]
+ --help print this message
+ --prefix=PATH install in PATH [$prefix]
+ --includedir=PATH install headers in PATH [$includedir]
+ --libdir=PATH install libraries in PATH [$libdir]
+ --mandir=PATH install man pages in PATH [$mandir]
+EOF
+exit 0
+fi
TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
TMPC2="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}-2.c"
@@ -115,42 +159,6 @@ print_and_output_mak() {
print_config "$1" "$2"
output_mak "$1" "$2"
}
-
-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 "$show_help" = "yes"; then
-cat <<EOF
-
-Usage: configure [options]
-Options: [defaults in brackets after descriptions]
- --help print this message
- --prefix=PATH install in PATH [$prefix]
- --includedir=PATH install headers in PATH [$includedir]
- --libdir=PATH install libraries in PATH [$libdir]
- --mandir=PATH install man pages in PATH [$mandir]
-EOF
-exit 0
-fi
-
print_and_output_mak "prefix" "$prefix"
print_and_output_mak "includedir" "$includedir"
print_and_output_mak "libdir" "$libdir"