From patchwork Sat May 25 08:58:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 10960685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9AD014B6 for ; Sat, 25 May 2019 09:06:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D980B28A2D for ; Sat, 25 May 2019 09:06:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDD3028A7D; Sat, 25 May 2019 09:06:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 768A028A2D for ; Sat, 25 May 2019 09:06:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726497AbfEYJGv (ORCPT ); Sat, 25 May 2019 05:06:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49894 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726376AbfEYJGu (ORCPT ); Sat, 25 May 2019 05:06:50 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 846DF3083392; Sat, 25 May 2019 09:06:50 +0000 (UTC) Received: from localhost (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 192545C206; Sat, 25 May 2019 09:06:49 +0000 (UTC) From: Stefan Hajnoczi To: Jens Axboe Cc: linux-block@vger.kernel.org, Aarushi Mehta , Julia Suvorova , Stefan Hajnoczi Subject: [PATCH liburing 2/2] configure: move directory options to ./configure Date: Sat, 25 May 2019 09:58:30 +0100 Message-Id: <20190525085830.31577-3-stefanha@redhat.com> In-Reply-To: <20190525085830.31577-1-stefanha@redhat.com> References: <20190525085830.31577-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sat, 25 May 2019 09:06:50 +0000 (UTC) Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- configure | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- Makefile | 4 ---- 2 files changed, 54 insertions(+), 5 deletions(-) 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 <&/dev/null` && echo "rpmbuild" || echo "rpm") INSTALL=install -prefix ?= /usr -includedir=$(prefix)/include -libdir=$(prefix)/lib -mandir=$(prefix)/man default: all