All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2-next] Only compile mnl_utils when HAVE_LIBMNL is defined
@ 2020-12-03  4:11 David Ahern
  2020-12-03 21:45 ` Petr Machata
  0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2020-12-03  4:11 UTC (permalink / raw)
  To: netdev; +Cc: me, David Ahern

From: David Ahern <dsahern@gmail.com>

New lib/mnl_utils.c fails to compile if libmnl is not installed:

  mnl_utils.c:9:10: fatal error: libmnl/libmnl.h: No such file or directory
      9 | #include <libmnl/libmnl.h>

Make it dependent on HAVE_LIBMNL.

Fixes: 72858c7b77d0 ("lib: Extract from devlink/mnlg a helper, mnlu_socket_open()")
Signed-off-by: David Ahern <dsahern@gmail.com>
---
 lib/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/Makefile b/lib/Makefile
index e37585c6..603ea83e 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -13,7 +13,10 @@ UTILOBJ += bpf_libbpf.o
 endif
 endif
 
-NLOBJ=libgenl.o libnetlink.o mnl_utils.o
+NLOBJ=libgenl.o libnetlink.o
+ifeq ($(HAVE_LIBMNL),y)
+NLOBJ += mnl_utils.o
+endif
 
 all: libnetlink.a libutil.a
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2-next] Only compile mnl_utils when HAVE_LIBMNL is defined
  2020-12-03  4:11 [PATCH iproute2-next] Only compile mnl_utils when HAVE_LIBMNL is defined David Ahern
@ 2020-12-03 21:45 ` Petr Machata
  2020-12-03 22:39   ` David Ahern
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Machata @ 2020-12-03 21:45 UTC (permalink / raw)
  To: David Ahern; +Cc: netdev, me, David Ahern


David Ahern <dsahern@kernel.org> writes:

> diff --git a/lib/Makefile b/lib/Makefile
> index e37585c6..603ea83e 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -13,7 +13,10 @@ UTILOBJ += bpf_libbpf.o
>  endif
>  endif
>  
> -NLOBJ=libgenl.o libnetlink.o mnl_utils.o
> +NLOBJ=libgenl.o libnetlink.o
> +ifeq ($(HAVE_LIBMNL),y)

This should test HAVE_MNL, not HAVE_LIBMNL.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2-next] Only compile mnl_utils when HAVE_LIBMNL is defined
  2020-12-03 21:45 ` Petr Machata
@ 2020-12-03 22:39   ` David Ahern
  0 siblings, 0 replies; 3+ messages in thread
From: David Ahern @ 2020-12-03 22:39 UTC (permalink / raw)
  To: Petr Machata, David Ahern; +Cc: netdev

On 12/3/20 2:45 PM, Petr Machata wrote:
> 
> David Ahern <dsahern@kernel.org> writes:
> 
>> diff --git a/lib/Makefile b/lib/Makefile
>> index e37585c6..603ea83e 100644
>> --- a/lib/Makefile
>> +++ b/lib/Makefile
>> @@ -13,7 +13,10 @@ UTILOBJ += bpf_libbpf.o
>>  endif
>>  endif
>>  
>> -NLOBJ=libgenl.o libnetlink.o mnl_utils.o
>> +NLOBJ=libgenl.o libnetlink.o
>> +ifeq ($(HAVE_LIBMNL),y)
> 
> This should test HAVE_MNL, not HAVE_LIBMNL.
> 

d'oh. thanks for catching that.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-03 22:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  4:11 [PATCH iproute2-next] Only compile mnl_utils when HAVE_LIBMNL is defined David Ahern
2020-12-03 21:45 ` Petr Machata
2020-12-03 22:39   ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.