From 8bef8d86441770799ca16c849c1a580d10c46547 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sun, 8 Mar 2026 19:38:59 +0300 Subject: [PATCH] 1 --- src/Makefile.am | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 40b10d51..93afbd33 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,17 +23,31 @@ utun_CORE_SOURCES = \ control_server.c # Platform-specific TUN sources -utun_TUN_SOURCES = tun_linux.c -utun_TUN_LIBS = +# Use AM_CONDITIONAL to select the right source file if OS_WINDOWS utun_TUN_SOURCES = tun_windows.c utun_TUN_LIBS = -liphlpapi -lws2_32 -ladvapi32 -lbcrypt -ldbghelp +AM_CONDITIONAL(TUN_FREEBSD, [false]) +AM_CONDITIONAL(TUN_LINUX, [false]) endif if OS_FREEBSD utun_TUN_SOURCES = tun_freebsd.c utun_TUN_LIBS = +AM_CONDITIONAL(TUN_FREEBSD, [true]) +AM_CONDITIONAL(TUN_LINUX, [false]) +endif + +if OS_WINDOWS +else + if OS_FREEBSD + else + utun_TUN_SOURCES = tun_linux.c + utun_TUN_LIBS = + AM_CONDITIONAL(TUN_FREEBSD, [false]) + AM_CONDITIONAL(TUN_LINUX, [true]) + endif endif # TinyCrypt sources (only used without OpenSSL)