xdp-tools: fix compilation wrongly using host header
[openwrt/openwrt.git] / package / network / utils / xdp-tools / patches / 010-configure-respect-LDFLAGS.patch
1 --- a/configure
2 +++ b/configure
3 @@ -176,7 +176,7 @@ int main(int argc, char **argv) {
4 return 0;
5 }
6 EOF
7 - libpcap_err=$($CC -o $TMPDIR/libpcaptest $TMPDIR/libpcaptest.c $LIBPCAP_CFLAGS $LIBPCAP_LDLIBS 2>&1)
8 + libpcap_err=$($CC -o $TMPDIR/libpcaptest $TMPDIR/libpcaptest.c $LIBPCAP_CFLAGS $LIBPCAP_LDLIBS $LDFLAGS 2>&1)
9 if [ "$?" -eq "0" ]; then
10 echo "HAVE_PCAP:=y" >>$CONFIG
11 [ -n "$LIBPCAP_CFLAGS" ] && echo 'CFLAGS += ' $LIBPCAP_CFLAGS >> $CONFIG
12 @@ -224,7 +224,7 @@ int main(int argc, char **argv) {
13 return 0;
14 }
15 EOF
16 - libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS 2>&1)
17 + libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS 2>&1)
18 if [ "$?" -eq "0" ]; then
19 echo "HAVE_FEATURES+=${config_var}" >>"$CONFIG"
20 echo "yes"
21 @@ -291,7 +291,7 @@ int main(int argc, char **argv) {
22 }
23 EOF
24
25 - libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS 2>&1)
26 + libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS 2>&1)
27 if [ "$?" -eq "0" ]; then
28 echo "SYSTEM_LIBBPF:=y" >>$CONFIG
29 echo "LIBBPF_VERSION=$LIBBPF_VERSION" >>$CONFIG