distribution/packages/devel/libbpf/patches/libbpf-fix-crosscompile-and-sysroot.patch

43 lines
1.3 KiB
Diff

diff --git a/src/Makefile b/src/Makefile
index 81ea6b8..7ab5f13 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -67,15 +67,12 @@ INSTALL = install
DESTDIR ?=
HOSTARCH = $(firstword $(subst -, ,$(shell $(CC) -dumpmachine)))
-ifeq ($(filter-out %64 %64be %64eb %64le %64el s390x, $(HOSTARCH)),)
- LIBSUBDIR := lib64
-else
- LIBSUBDIR := lib
-endif
+LIBSUBDIR := lib
# 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
+ PREFIX_PC := /usr
LIBDIR_PC := $$\{prefix\}/$(LIBSUBDIR)
else
LIBDIR_PC := $(LIBDIR)
@@ -106,7 +103,7 @@ $(OBJDIR)/libbpf.so.$(LIBBPF_VERSION): $(SHARED_OBJS)
$^ $(ALL_LDFLAGS) -o $@
$(OBJDIR)/libbpf.pc: force
- $(Q)sed -e "s|@PREFIX@|$(PREFIX)|" \
+ $(Q)sed -e "s|@PREFIX@|$(PREFIX_PC)|" \
-e "s|@LIBDIR@|$(LIBDIR_PC)|" \
-e "s|@VERSION@|$(LIBBPF_VERSION)|" \
< libbpf.pc.template > $@
diff --git a/src/libbpf.pc.template b/src/libbpf.pc.template
index b45ed53..fe6ddde 100644
--- a/src/libbpf.pc.template
+++ b/src/libbpf.pc.template
@@ -7,6 +7,6 @@ includedir=${prefix}/include
Name: libbpf
Description: BPF library
Version: @VERSION@
-Libs: -L${libdir} -lbpf
+Libs: -L${libdir} -lbpf -lz
Requires.private: libelf zlib
Cflags: -I${includedir}