From fd26c1a2f0eb9ea53b41e471b1ea31cf341ac151 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Sat, 25 May 2019 09:58:30 +0100 Subject: configure: move directory options to ./configure libdir is hardcoded to ${prefix}/lib in Makefile. Fedora x86_64 uses /usr/lib64 and this means libaries will be installed in the wrong place. This patch moves prefix, includedir, libdir, and mandir into ./configure for easier customization. To build and install on Fedora x86_64: # ./configure --libdir=/usr/lib64 # make && make install Signed-off-by: Stefan Hajnoczi Signed-off-by: Jens Axboe --- configure | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index ef71a14..19c2b54 100755 --- a/configure +++ b/configure @@ -10,6 +10,10 @@ else fi cc=gcc +prefix=/usr +includedir="$prefix/include" +libdir="$prefix/lib" +mandir="$prefix/man" TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c" TMPC2="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}-2.c" @@ -98,11 +102,60 @@ has() { type "$1" >/dev/null 2>&1 } +output_mak() { + echo "$1=$2" >> $config_host_mak +} + output_sym() { - echo "$1=y" >> $config_host_mak + output_mak "$1" "y" echo "#define $1" >> $config_host_h } +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 <