From: Kris Van Hees <kris.van.hees@oracle.com>
To: Nick Alcock <nick.alcock@oracle.com>
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com,
kris.van.hees@oracle.com
Subject: Re: [PATCH v2 6/9] build: add a pkg-config file for dtrace consumers: use it
Date: Fri, 2 Aug 2024 01:30:41 -0400 [thread overview]
Message-ID: <ZqxvAf4/9vBb+Nnv@oracle.com> (raw)
In-Reply-To: <20240801132156.286780-7-nick.alcock@oracle.com>
On Thu, Aug 01, 2024 at 02:21:53PM +0100, Nick Alcock wrote:
> This lets you relocate the include path anywhere you like: users of
> <dtrace.h> et al should invoke $(pkg-config --cflags dtrace) and
> $(pkg-config --libs dtrace) to get the dtrace consumer header directory and
> -ldtrace invocation for linking.
>
> Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
> runtest.sh | 2 +-
> uts/Build | 10 ++++++----
> uts/dtrace.pc.in | 8 ++++++++
> 3 files changed, 15 insertions(+), 5 deletions(-)
> create mode 100644 uts/dtrace.pc.in
>
> diff --git a/runtest.sh b/runtest.sh
> index cc9703e12c16..817f4a90487d 100755
> --- a/runtest.sh
> +++ b/runtest.sh
> @@ -579,7 +579,7 @@ else
> dtrace="/usr/sbin/dtrace"
> test_libdir="installed"
> test_ldflags=""
> - test_cppflags="-DARCH_$arch $(pkg-config --cflags dtrace_sdt)"
> + test_cppflags="-DARCH_$arch $(pkg-config --cflags dtrace_sdt) $(pkg-config --cflags dtrace)"
>
> if [[ ! -x $dtrace ]]; then
> echo "$dtrace not available." >&2
> diff --git a/uts/Build b/uts/Build
> index feafa21369f2..7948e9f2d084 100644
> --- a/uts/Build
> +++ b/uts/Build
> @@ -22,7 +22,7 @@ PROBE_HEADERS_INSTALL := common/sys/sdt.h \
>
> # The pkg-config files undergo a few translations with sed before installation.
>
> -SHARE_PKG_CONFIG_INSTALL := dtrace_sdt.pc
> +SHARE_PKG_CONFIG_INSTALL := dtrace.pc dtrace_sdt.pc
>
> install::
> mkdir -p $(INSTINCLUDEDIR)/sys
> @@ -34,7 +34,9 @@ install::
> mkdir -p $(INSTPKGCONFIGDIR)
> $(call describe-install-target,$(INSTPKGCONFIGDIR),$(SHARE_PKG_CONFIG_INSTALL))
> for name in $(SHARE_PKG_CONFIG_INSTALL); do \
> - cd $(uts_DIR) && \
> - sed 's,@SDTINCLUDEDIR@,$(SDTINCLUDEDIR),g; s,@VERSION@,$(VERSION),g' < \
> - $${name}.in > $(INSTPKGCONFIGDIR)/$$name; \
> + (cd $(uts_DIR) && \
> + sed -e 's,@SDTINCLUDEDIR@,$(SDTINCLUDEDIR),g;' \
> + -e 's,@INCLUDEDIR@,$(INCLUDEDIR),g;' \
> + -e 's,@VERSION@,$(VERSION),g' < \
> + $${name}.in > $(INSTPKGCONFIGDIR)/$$name;) \
> done
> diff --git a/uts/dtrace.pc.in b/uts/dtrace.pc.in
> new file mode 100644
> index 000000000000..58aa46fc75c9
> --- /dev/null
> +++ b/uts/dtrace.pc.in
> @@ -0,0 +1,8 @@
> +includedir = @INCLUDEDIR@
> +libdir = @LIBDIR@
> +
> +Name: DTrace
> +Description: DTrace consumer headers
> +Version: @VERSION@
> +Cflags: -I${includedir}
> +Libs: -L${libdir} -ldtrace
> --
> 2.46.0.277.ge12b8151ed
next prev parent reply other threads:[~2024-08-02 5:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 13:21 [PATCH v2 0/9] relocatable DTrace Nick Alcock
2024-08-01 13:21 ` [PATCH v2 1/9] spec: install sdt*.h in /usr/lib64/dtrace/include/sys Nick Alcock
2024-08-02 5:23 ` Kris Van Hees
2024-08-01 13:21 ` [PATCH v2 2/9] build: initial pkg-config support Nick Alcock
2024-08-02 5:24 ` Kris Van Hees
2024-08-01 13:21 ` [PATCH v2 3/9] build: track configured vars Nick Alcock
2024-08-02 5:28 ` Kris Van Hees
2024-08-01 13:21 ` [PATCH v2 4/9] build: --bindir is supposed to be equivalent to --sbindir Nick Alcock
2024-08-02 5:28 ` Kris Van Hees
2024-08-01 13:21 ` [PATCH v2 5/9] build: the TESTDIR is relative to the LIBDIR by default Nick Alcock
2024-08-02 5:29 ` Kris Van Hees
2024-08-01 13:21 ` [PATCH v2 6/9] build: add a pkg-config file for dtrace consumers: use it Nick Alcock
2024-08-02 5:30 ` Kris Van Hees [this message]
2024-08-01 13:21 ` [PATCH v2 7/9] runtest: remove obsolete kernel coverage data collection Nick Alcock
2024-08-02 5:31 ` Kris Van Hees
2024-08-01 13:21 ` [PATCH v2 8/9] build: make dtrace and dtprobed relocatable Nick Alcock
2024-08-02 5:31 ` Kris Van Hees
2024-08-01 13:21 ` [PATCH v2 9/9] test: work when relocated Nick Alcock
2024-08-02 5:32 ` Kris Van Hees
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZqxvAf4/9vBb+Nnv@oracle.com \
--to=kris.van.hees@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=nick.alcock@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox