Skip to content

Commit

Permalink
tools lib traceevent: Remove hard coded install paths from pkg-config…
Browse files Browse the repository at this point in the history
… file

Install directories of header and library files are hard coded in
pkg-config template file.

They must be configurable, the Makefile should set them on the
compilation / install stage.

Signed-off-by: Tzvetomir Stoyanov <[email protected]>
Cc: Jiri Olsa <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
tzstoyanov authored and acmel committed May 15, 2019
1 parent b399ec2 commit 53dbabf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions tools/lib/traceevent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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; \
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tools/lib/traceevent/libtraceevent.pc.template
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 53dbabf

Please sign in to comment.