From patchwork Fri Mar 29 14:45:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tzvetomir Stoyanov X-Patchwork-Id: 10877221 X-Patchwork-Delegate: rostedt@goodmis.org 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 098E71708 for ; Fri, 29 Mar 2019 14:45:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA42128A72 for ; Fri, 29 Mar 2019 14:45:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEB6E28E5C; Fri, 29 Mar 2019 14:45:50 +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 7B65828A72 for ; Fri, 29 Mar 2019 14:45:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728737AbfC2Opu (ORCPT ); Fri, 29 Mar 2019 10:45:50 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35674 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729184AbfC2Opu (ORCPT ); Fri, 29 Mar 2019 10:45:50 -0400 Received: by mail-wr1-f67.google.com with SMTP id w1so2949173wrp.2; Fri, 29 Mar 2019 07:45:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=woXlb6ivRqHuTA55bFh89ymhKduhc5nZwdZTGOtsw5k=; b=TfSHEd1htSKvXygSD0dqwl/2OQFh8MGzj7VgW5Xpp2JXr5DMrypikrfalXWUfNNFIw AvRnPXxqfwIbSQFH/fLXzmsi1ZKg4KGPzLVfDOrcLAszkAPKjfId4g7cFuo4nsq8PLQI fPwfrY5AbhN9Ew1rkIqOfC7JETiKV0R54/ClP5+GRmY7k0B2e8Qdwj6SjtI68gfH5nFE erjuL1n7zZ4Au2X0z+WPvDAd2HmHWvCGMm2nM5tLvYEUQqURpRm//Zx9Nioqlb5idR0C 6Vy1N/l8ZKcCfsPvVSUIF0RH0ryFJ7ATzYsVSeNZR1clVcuVmQPaEEiTvrL+dIxr6rQO cVag== X-Gm-Message-State: APjAAAUNWMDstTfq5+rdNd5DNmSBuoThGjGEbbSCmAJajO+O3aI/KvMW xUZXM4tX4GFTh7O1CfbiHTWMdppt X-Google-Smtp-Source: APXvYqx6vccNWPXruElK/seOhQY77Wg+XYjCPYr7CAfJWa1/qSykdNOhPIM/eKW7xpfCqPHGea/log== X-Received: by 2002:adf:deca:: with SMTP id i10mr6574315wrn.88.1553870748215; Fri, 29 Mar 2019 07:45:48 -0700 (PDT) Received: from oberon.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id 4sm1754266wmg.12.2019.03.29.07.45.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 07:45:47 -0700 (PDT) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] tools/lib/traceevent: Remove hardcoded install paths from pkg-config file Date: Fri, 29 Mar 2019 16:45:46 +0200 Message-Id: <20190329144546.5819-1-tstoyanov@vmware.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Install directories of header and library files are hardcoded in pkg-config templete file. They must be configurable, the Makefile should set them on the compilation / install stage. Signed-off-by: Tzvetomir Stoyanov --- tools/lib/traceevent/Makefile | 13 +++++++++---- tools/lib/traceevent/libtraceevent.pc.template | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile index 67fe5d7ef190..6419a24058ab 100644 --- a/tools/lib/traceevent/Makefile +++ b/tools/lib/traceevent/Makefile @@ -50,6 +50,9 @@ man_dir = $(prefix)/share/man man_dir_SQ = '$(subst ','\'',$(man_dir))' pkgconfig_dir ?= $(word 1,$(shell $(PKG_CONFIG) \ --variable pc_path pkg-config | tr ":" " ")) +includedir_relative = traceevent +includedir = $(prefix)/include/$(includedir_relative) +includedir_SQ = '$(subst ','\'',$(includedir))' export man_dir man_dir_SQ INSTALL export DESTDIR DESTDIR_SQ @@ -279,6 +282,8 @@ define do_install_pkgconfig_file cp -f ${PKG_CONFIG_FILE}.template ${PKG_CONFIG_FILE}; \ sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; \ sed -i "s|LIB_VERSION|${EVENT_PARSE_VERSION}|g" ${PKG_CONFIG_FILE}; \ + sed -i "s|LIB_DIR|${libdir}|g" ${PKG_CONFIG_FILE}; \ + sed -i "s|HEADER_DIR|$(includedir)|g" ${PKG_CONFIG_FILE}; \ $(call do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644); \ else \ (echo Failed to locate pkg-config directory) 1>&2; \ @@ -300,10 +305,10 @@ install_pkgconfig: install_headers: $(call QUIET_INSTALL, headers) \ - $(call do_install,event-parse.h,$(prefix)/include/traceevent,644); \ - $(call do_install,event-utils.h,$(prefix)/include/traceevent,644); \ - $(call do_install,trace-seq.h,$(prefix)/include/traceevent,644); \ - $(call do_install,kbuffer.h,$(prefix)/include/traceevent,644) + $(call do_install,event-parse.h,$(DESTDIR)$(includedir_SQ),644); \ + $(call do_install,event-utils.h,$(DESTDIR)$(includedir_SQ),644); \ + $(call do_install,trace-seq.h,$(DESTDIR)$(includedir_SQ),644); \ + $(call do_install,kbuffer.h,$(DESTDIR)$(includedir_SQ),644) install: install_lib diff --git a/tools/lib/traceevent/libtraceevent.pc.template b/tools/lib/traceevent/libtraceevent.pc.template index 42e4d6cb6b9e..86384fcd57f1 100644 --- a/tools/lib/traceevent/libtraceevent.pc.template +++ b/tools/lib/traceevent/libtraceevent.pc.template @@ -1,6 +1,6 @@ prefix=INSTALL_PREFIX -libdir=${prefix}/lib64 -includedir=${prefix}/include/traceevent +libdir=LIB_DIR +includedir=HEADER_DIR Name: libtraceevent URL: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git