summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-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"