From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9654EC43381 for ; Wed, 20 Mar 2019 17:21:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68C3620850 for ; Wed, 20 Mar 2019 17:21:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=fomichev-me.20150623.gappssmtp.com header.i=@fomichev-me.20150623.gappssmtp.com header.b="qfYCvXgT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726830AbfCTRVR (ORCPT ); Wed, 20 Mar 2019 13:21:17 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:47084 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726123AbfCTRVQ (ORCPT ); Wed, 20 Mar 2019 13:21:16 -0400 Received: by mail-pf1-f195.google.com with SMTP id 9so2147845pfj.13 for ; Wed, 20 Mar 2019 10:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fomichev-me.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cVXsm5lNDd6CLjBfZY5ZUY5t/LhuzKKWgteSYJ152qk=; b=qfYCvXgT/yuwJ7mFUxIb+j0ItiY5CCHU1cpJE83UGsfOQrpyp22TWEqKaGdKTE/7hW 4wxtypK6rYSNyCgRRKzhZeMc4q8T1KkZr7HROxuzDogvmOjMU+K1ba0wpkqVX8ic9NBk o/7tjj6xTWppI++K7uke1Ru3NsAXrJfYjzaXdjXaWkFJSpe+EygJcE+uak5xKZpOQP6X Y2rG2k5qViNIrwobP1jkOCpA95yo+yqJPl59p/ZrVvJCAYhdMMjAspNGBf7+2Pt4UqUv oTDBDImcsO/CcS9BVoQR/wumZSD7+xjujcZHitDZbuI3jglcxIRdevVZh+ZzYXOY6AcM EGpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cVXsm5lNDd6CLjBfZY5ZUY5t/LhuzKKWgteSYJ152qk=; b=SFau6oTyI5/36J4PP6AYzOW9Lo92S9Bqc53SL01jjRJZ7bjyy18f3cYuB6FBSftoiu bKZ6KiDwB98lcf7FkQahXB7Kh/EnLJNkr+Lt5Gk9sbqHsJmQLqAH06N8e0hzaQ04J2OB vCRI6rnmtWlHT4jSrGqMgGibNLJ3bjeYEjmijZH2EB9ZoEK4X0Nq4Q0rz4wilczXUWHA hilPI0xi55bscxxsrtaGrVKD2RZ1UduYGNLFmc8doD+MZ7VXFBuumep775RnWCTz0zP7 KOOFn/huEyaD4utg66flcFck946OBRPDhv2n7XuLDGVbGLhUH5xDPxrZkRsdizunrhvy QxlQ== X-Gm-Message-State: APjAAAWamDYfsPmc/G9o0zd+/4t6CTZo7AmDX0VXPQN66szgNSTORuLo AV91uCRKH9zVLK86y05GWrVJsOcyz0A= X-Google-Smtp-Source: APXvYqxVfJkAHRmbqn1snXRglfocLUBSKCHkAuzuMK6H8KbQsi9KNJkvBCKCyyxd31KO8c+9AW2qpQ== X-Received: by 2002:a63:cc03:: with SMTP id x3mr8358686pgf.121.1553102476364; Wed, 20 Mar 2019 10:21:16 -0700 (PDT) Received: from localhost ([2601:646:8f00:18d9:d0fa:7a4b:764f:de48]) by smtp.gmail.com with ESMTPSA id n65sm8386510pfb.160.2019.03.20.10.21.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2019 10:21:15 -0700 (PDT) Date: Wed, 20 Mar 2019 10:21:14 -0700 From: Stanislav Fomichev To: Luca Boccassi Cc: netdev@vger.kernel.org Subject: Re: [PATCH bpf-next v2] tools/bpf: generate pkg-config file for libbpf Message-ID: <20190320172114.GK7431@mini-arch.hsd1.ca.comcast.net> References: <20190319210639.6282-1-bluca@debian.org> <20190319230042.32087-1-bluca@debian.org> <20190319231713.GG7431@mini-arch.hsd1.ca.comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 03/20, Luca Boccassi wrote: > On Wed, 2019-03-20 at 13:22 +0000, Luca Boccassi wrote: > > On Tue, 2019-03-19 at 16:17 -0700, Stanislav Fomichev wrote: > > > On 03/19, Luca Boccassi wrote: > > > > Generate a libbpf.pc file at build time so that users can rely > > > > on pkg-config to find the library, its CFLAGS and LDFLAGS. > > > > > > > > Signed-off-by: Luca Boccassi > > > > --- > > > > v2: use QUIET_GEN instead of QUIET_LINK to generate pc file, > > > > save kernel version in its own variable instead of calling > > > > make inline > > > > > > > > tools/lib/bpf/.gitignore | 1 + > > > > tools/lib/bpf/Makefile | 19 ++++++++++++++++--- > > > > tools/lib/bpf/libbpf.pc.template | 11 +++++++++++ > > > > 3 files changed, 28 insertions(+), 3 deletions(-) > > > > create mode 100644 tools/lib/bpf/libbpf.pc.template > > > > > > > > diff --git a/tools/lib/bpf/.gitignore b/tools/lib/bpf/.gitignore > > > > index 4db74758c674..7d9e182a1f51 100644 > > > > --- a/tools/lib/bpf/.gitignore > > > > +++ b/tools/lib/bpf/.gitignore > > > > @@ -1,3 +1,4 @@ > > > > libbpf_version.h > > > > +libbpf.pc > > > > FEATURE-DUMP.libbpf > > > > test_libbpf > > > > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile > > > > index a05c43468bd0..1df3ebfb3118 100644 > > > > --- a/tools/lib/bpf/Makefile > > > > +++ b/tools/lib/bpf/Makefile > > > > @@ -80,6 +80,7 @@ libdir_SQ = $(subst ','\'',$(libdir)) > > > > libdir_relative_SQ = $(subst ','\'',$(libdir_relative)) > > > > > > > > LIB_FILE = libbpf.a libbpf.so > > > > +PC_FILE = libbpf.pc > > > > > > > > VERSION = $(BPF_VERSION) > > > > PATCHLEVEL = $(BPF_PATCHLEVEL) > > > > @@ -89,6 +90,7 @@ OBJ = $@ > > > > N = > > > > > > > > LIBBPF_VERSION = > > > > $(BPF_VERSION).$(BPF_PATCHLEVEL).$(BPF_EXTRAVERSION) > > > > +KERNEL_VERSION = $(shell make --no-print-directory -sC ../../.. > > > > kernelversion) > > > Oh, we do already have LIBBPF_VERSION, why not use that? This way > > > you don't need to do anything for out-of-tree libbpf from github. > > > > > > I don't remember what was the strategy regarding libbpf versioning, > > > but > > > that 0.0.1 should be changed to something sensible (be set to the > > > kernel > > > version upon release?) > > > > [re-sending as reply via phone added html and the list daemon said > > no- > > no] > > > > That looks like the ABI version though, rather than the source > > version? > > The source version is more appropriate for the PC file > > That said, the versioning looks looks like it could use some love and > it's not really a factor that should gate a pkg-config file and could > be done separately if required, so in v3 I've removed KERNEL_VERSION > and used LIBBPF_VERSION as you suggested. Agree :-) There was some conversation recently about incrementing it per kernel release vs real api change. I don't remember what the outcome was exactly. > Thanks for reviewing! > > -- > Kind regards, > Luca Boccassi