libbpf / bpftool

Automated upstream mirror for bpftool stand-alone build.
Other
411 stars 72 forks source link

mirror: Set DESTDIR to empty when building libbpf #140

Closed dylanorz closed 7 months ago

dylanorz commented 7 months ago

If a value is assigned to the variable DESTDIR when compiling bpftool, this variable will be passed to libbpf's Makefile.

In this case, libbpf's header files will be installed in an unexpected directory, causing bpftool to be unable to find the header files.

when run this command

OUTPUT=/root/output_3rd/bpftool_build/ DESTDIR=/root/output_3rd/bpftool_root/ V=1 make -j8 install

Part of the output is as follows, we can see that the path is wrong

make[1]: 进入目录“/root/bpftool/libbpf/src”
mkdir -p /root/output_3rd/bpftool_build/libbpf/staticobjs
if [ ! -d '/root/output_3rd/bpftool_root//root/output_3rd/bpftool_build/libbpf/include/bpf' ]; then install -d -m 755 '/root/output_3rd/bpftool_root//root/output_3rd/bpftool_build/libbpf/include/bpf'; fi;
cc -I. -I../include -I../include/uapi -g -O2 -Werror -Wall -std=gnu89 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wno-unknown-warning-option -Wno-format-overflow   -c bpf.c -o /root/output_3rd/bpftool_build/libbpf/staticobjs/bpf.o
dylanorz commented 7 months ago

I just have a request, could you please move DESTDIR to the same locations and order (with regards to PREFIX) as they appear in the Makefile from the kernel repo? The two Makefile are mostly similar, and keeping them as close as possible helps with sync-ups.

I've modified this pr as per your suggestion