Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools lib traceevent: Remove hard coded install paths from pkg-config 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 <tstoyanov@vmware.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190418211556.5a12adc3@oasis.local.home
Link: http://lkml.kernel.org/r/20190329144546.5819-1-tstoyanov@vmware.com
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Tzvetomir Stoyanov and committed by
Arnaldo Carvalho de Melo
53dbabfe b399ec21

+11 -6
+9 -4
tools/lib/traceevent/Makefile
··· 50 50 man_dir_SQ = '$(subst ','\'',$(man_dir))' 51 51 pkgconfig_dir ?= $(word 1,$(shell $(PKG_CONFIG) \ 52 52 --variable pc_path pkg-config | tr ":" " ")) 53 + includedir_relative = traceevent 54 + includedir = $(prefix)/include/$(includedir_relative) 55 + includedir_SQ = '$(subst ','\'',$(includedir))' 53 56 54 57 export man_dir man_dir_SQ INSTALL 55 58 export DESTDIR DESTDIR_SQ ··· 282 279 cp -f ${PKG_CONFIG_FILE}.template ${PKG_CONFIG_FILE}; \ 283 280 sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; \ 284 281 sed -i "s|LIB_VERSION|${EVENT_PARSE_VERSION}|g" ${PKG_CONFIG_FILE}; \ 282 + sed -i "s|LIB_DIR|${libdir}|g" ${PKG_CONFIG_FILE}; \ 283 + sed -i "s|HEADER_DIR|$(includedir)|g" ${PKG_CONFIG_FILE}; \ 285 284 $(call do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644); \ 286 285 else \ 287 286 (echo Failed to locate pkg-config directory) 1>&2; \ ··· 305 300 306 301 install_headers: 307 302 $(call QUIET_INSTALL, headers) \ 308 - $(call do_install,event-parse.h,$(prefix)/include/traceevent,644); \ 309 - $(call do_install,event-utils.h,$(prefix)/include/traceevent,644); \ 310 - $(call do_install,trace-seq.h,$(prefix)/include/traceevent,644); \ 311 - $(call do_install,kbuffer.h,$(prefix)/include/traceevent,644) 303 + $(call do_install,event-parse.h,$(DESTDIR)$(includedir_SQ),644); \ 304 + $(call do_install,event-utils.h,$(DESTDIR)$(includedir_SQ),644); \ 305 + $(call do_install,trace-seq.h,$(DESTDIR)$(includedir_SQ),644); \ 306 + $(call do_install,kbuffer.h,$(DESTDIR)$(includedir_SQ),644) 312 307 313 308 install: install_lib 314 309
+2 -2
tools/lib/traceevent/libtraceevent.pc.template
··· 1 1 prefix=INSTALL_PREFIX 2 - libdir=${prefix}/lib64 3 - includedir=${prefix}/include/traceevent 2 + libdir=LIB_DIR 3 + includedir=HEADER_DIR 4 4 5 5 Name: libtraceevent 6 6 URL: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git