netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Jakub Kicinski <jakub.kicinski@netronome.com>, netdev@vger.kernel.org
Cc: alexei.starovoitov@gmail.com, oss-drivers@netronome.com
Subject: Re: [PATCH net-next] bpf: install libbpf headers on 'make install'
Date: Tue, 25 Jul 2017 18:51:20 +0200	[thread overview]
Message-ID: <59777708.7000707@iogearbox.net> (raw)
In-Reply-To: <20170724212236.21903-1-jakub.kicinski@netronome.com>

On 07/24/2017 11:22 PM, Jakub Kicinski wrote:
> Install the bpf.h header to $(prefix)/include/bpf/ directory.
> This is necessary to build standalone applications using libbpf,
> without the need to clone the kernel sources and point to them.
>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> ---
> I'm not 100% sure if it's OK to export the header file and which
> directory it should end up in (bpf/? libbpf/?).

Given the Makefile is heavily derived from tools/lib/traceevent/,
we should probably have a similar install_headers target instead,
in order to keep semantics similar. /include/bpf/ should be good.

>   tools/lib/bpf/Makefile | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index 1f5300e56b44..22dad416e0bd 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -46,6 +46,7 @@ else
>   endif
>
>   prefix ?= /usr/local
> +headerdir = $(prefix)/include/bpf/
>   libdir = $(prefix)/$(libdir_relative)
>   man_dir = $(prefix)/share/man
>   man_dir_SQ = '$(subst ','\'',$(man_dir))'
> @@ -90,11 +91,13 @@ endif
>   export prefix libdir src obj
>
>   # Shell quotes
> +headerdir_SQ = $(subst ','\'',$(headerdir))
>   libdir_SQ = $(subst ','\'',$(libdir))
>   libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
>   plugin_dir_SQ = $(subst ','\'',$(plugin_dir))
>
>   LIB_FILE = libbpf.a libbpf.so
> +HEADER_FILE = bpf.h
>
>   VERSION		= $(BPF_VERSION)
>   PATCHLEVEL	= $(BPF_PATCHLEVEL)
> @@ -189,7 +192,11 @@ install_lib: all_cmd
>   	$(call QUIET_INSTALL, $(LIB_FILE)) \
>   		$(call do_install,$(LIB_FILE),$(libdir_SQ))
>
> -install: install_lib
> +install_hdr: all_cmd
> +	$(call QUIET_INSTALL, $(HEADER_FILE)) \
> +		$(call do_install,$(HEADER_FILE),$(headerdir_SQ))
> +
> +install: install_lib install_hdr
>
>   ### Cleaning rules
>
>

  reply	other threads:[~2017-07-25 16:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24 21:22 [PATCH net-next] bpf: install libbpf headers on 'make install' Jakub Kicinski
2017-07-25 16:51 ` Daniel Borkmann [this message]
2017-07-25 18:17 ` [PATCH net-next v2] " Jakub Kicinski
2017-07-25 19:45   ` Daniel Borkmann
2017-07-26 20:43   ` David Miller

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=59777708.7000707@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=alexei.starovoitov@gmail.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.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;
as well as URLs for NNTP newsgroup(s).