mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-10 02:29:06 +08:00
pkgconfig: use literal ${prefix} to allow override
Various workflows (--define-prefix, --define-variable=prefix) require variables in the pc file to use a literal so that it is overridden. Change the Makefile so that, by default and unless is specified, it is set as expected. Signed-off-by: Luca Boccassi <bluca@debian.org>
This commit is contained in:
committed by
Andrii Nakryiko
parent
a3a5e9688a
commit
051a4009f9
@@ -66,6 +66,13 @@ else
|
|||||||
LIBSUBDIR := lib
|
LIBSUBDIR := lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# By default let the pc file itself use ${prefix} in includedir/libdir so that
|
||||||
|
# the prefix can be overridden at runtime (eg: --define-prefix)
|
||||||
|
ifndef LIBDIR
|
||||||
|
LIBDIR_PC := $$\{prefix\}/$(LIBSUBDIR)
|
||||||
|
else
|
||||||
|
LIBDIR_PC := $(LIBDIR)
|
||||||
|
endif
|
||||||
PREFIX ?= /usr
|
PREFIX ?= /usr
|
||||||
LIBDIR ?= $(PREFIX)/$(LIBSUBDIR)
|
LIBDIR ?= $(PREFIX)/$(LIBSUBDIR)
|
||||||
INCLUDEDIR ?= $(PREFIX)/include
|
INCLUDEDIR ?= $(PREFIX)/include
|
||||||
@@ -93,7 +100,7 @@ $(OBJDIR)/libbpf.so.$(LIBBPF_VERSION): $(SHARED_OBJS)
|
|||||||
|
|
||||||
$(OBJDIR)/libbpf.pc:
|
$(OBJDIR)/libbpf.pc:
|
||||||
$(Q)sed -e "s|@PREFIX@|$(PREFIX)|" \
|
$(Q)sed -e "s|@PREFIX@|$(PREFIX)|" \
|
||||||
-e "s|@LIBDIR@|$(LIBDIR)|" \
|
-e "s|@LIBDIR@|$(LIBDIR_PC)|" \
|
||||||
-e "s|@VERSION@|$(LIBBPF_VERSION)|" \
|
-e "s|@VERSION@|$(LIBBPF_VERSION)|" \
|
||||||
< libbpf.pc.template > $@
|
< libbpf.pc.template > $@
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user