Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1605417ybb; Fri, 29 Mar 2019 07:46:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgh//EoSVgurCDZnThSXT4VK6yBhCedaRogGQ2VcHcMopnCC7qwkVIYJrivLHJuigJ3MBi X-Received: by 2002:a63:c54a:: with SMTP id g10mr24279337pgd.71.1553870803500; Fri, 29 Mar 2019 07:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553870803; cv=none; d=google.com; s=arc-20160816; b=zpfjbf/V4QpB9KxRTpf3J0xN5LK+Zuo64GF88Pw0TDGVburj5QB1tBtYqZZCHsjcRC gOu/tix99aFJGmVxdA/BCsNcHVHi90M/jMN9Ly5oGmv0fyE/kcy4CrPIL+wmFJ7pXDqB rI2oudEezFWLXyJeHYowhbbvNionM2Ni+LfDtSXsLgyTZNKx42jqHlyZpu1yY1V2S2sa 1tbzKGdnuIm2oI5uSnftb8Fp1mGz0ZHMTC3orqmpHjriZmtLSKvwXn7S2h3EcnzmJ2Eo B8SwhnvcfCPY8kdjvIu8lwNlaQLnGOXCCJHzEBktozFFG4ClAU8Y4/MSsZZuMDN+b3Ht onFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=woXlb6ivRqHuTA55bFh89ymhKduhc5nZwdZTGOtsw5k=; b=QpYVCrjMd0WRHjCRbgVH8bHOpNafBSQmWl6dYemH+DeroEBS7WmVnRP2piYizTT+H3 X5PiZUU1OpaWDKmim8D09ERRxmLhjnyXJ5HVJgQ/8abAvWIf4KRfkvKf9ync0QiFZT/a fb7sIJ2s+jbZF0Ibe68p3BJTKMkkifP/wuHoQKidjQdbR2W7eG0RWQnBIXbFW96zBuTD ny4EdB+hBCbzw+5rL0rmjzKhEwTFdtf+QcpBZRCubcl1y+qGzvvXTchlH+mKoTbjoIAc JQEeGKjv2yNo4tg+I9qRUMLLf6sMmrZuINpSLBcuSpw4dYT2T0PfAGsohVJ1LHmrEp7m WGAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si2002267plr.379.2019.03.29.07.46.27; Fri, 29 Mar 2019 07:46:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729276AbfC2Opu (ORCPT + 99 others); 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-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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.20.1