1 # SPDX-License-Identifier: GPL-2.0-only
3 include $(TOPDIR
)/rules.mk
7 PKG_RELEASE
:=$(AUTORELEASE
)
9 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
10 PKG_SOURCE_URL
:=https
://downloads.open-mesh.org
/batman
/releases
/batman-adv-
$(PKG_VERSION
)
11 PKG_HASH
:=893966f9a2d6a50721de124ce62da5d3de9c20e05576ca482bc5704cc5a6f73d
12 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
14 PKG_MAINTAINER
:=Simon Wunderlich
<sw@simonwunderlich.de
>
15 PKG_LICENSE
:=GPL-2.0
-only ISC MIT
16 PKG_LICENSE_FILES
:=LICENSES
/preferred
/GPL-2.0 LICENSES
/preferred
/MIT LICENSES
/deprecated
/ISC
18 include $(INCLUDE_DIR
)/package.mk
20 define Package
/batctl
/Default
23 URL
:=https
://www.open-mesh.org
/
24 DEPENDS
:=+libnl-tiny
+libc
+librt
28 define Package
/batctl
/description
29 batctl is a more intuitive managment utility for B.A.T.M.A.N.
-Advanced.
30 It is an easier method for configuring batman-adv and provides some
31 additional tools for debugging
as well. This package builds
32 version
$(PKG_VERSION
) of the user space utility.
35 define Package
/batctl-tiny
36 $(call Package
/batctl
/Default
)
37 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Minimal
)
39 ALTERNATIVES
:=100:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-tiny
42 define Package
/batctl-tiny
/description
43 $(Package
/batctl
/description
)
44 Only configuration relevant subcommands are enabled.
47 define Package
/batctl-default
48 $(call Package
/batctl
/Default
)
49 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Default
)
51 ALTERNATIVES
:=200:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-default
54 define Package
/batctl-default
/description
55 $(Package
/batctl
/description
)
56 Standard subcommands for configuration and online debugging are enabled.
59 define Package
/batctl-full
60 $(call Package
/batctl
/Default
)
61 TITLE
:=B.A.T.M.A.N. Advanced user space configuration tool
(Full
)
63 ALTERNATIVES
:=300:/usr
/sbin
/batctl
:/usr
/libexec
/batctl-full
66 define Package
/batctl-full
/description
67 $(Package
/batctl
/description
)
68 Subcommands for configuration
, online and offline debugging are enabled.
71 # The linker can identify unused sections of a binary when each symbol is stored
72 # in a separate section. This mostly removes unused linker sections and reduces
73 # the size by ~3% on mipsel.
75 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
76 TARGET_LDFLAGS
+= -Wl
,--gc-sections
78 # Link-time optimization allows to move parts of the optimization from the single
79 # source file to the global source view. This is done by emitting the GIMPLE
80 # representation in each object file and analyzing it again during the link step.
82 TARGET_CFLAGS
+= -flto
83 TARGET_LDFLAGS
+= -fuse-linker-plugin
86 LIBNL_NAME
="libnl-tiny" \
87 LIBNL_GENL_NAME
="libnl-tiny"
90 REVISION
="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)"
100 bridge_loop_avoidance \
104 distributed_arp_table \
121 multicast_forceflood \
133 throughput_override \
139 transtable_global_json \
140 transtable_local_json \
147 bridge_loop_avoidance \
148 distributed_arp_table \
157 multicast_forceflood \
162 throughput_override \
187 transtable_global_json \
188 transtable_local_json \
199 config-extratools
:= \
202 ifeq ($(BUILD_VARIANT
),tiny
)
209 ifeq ($(BUILD_VARIANT
),default
)
219 ifeq ($(BUILD_VARIANT
),full
)
226 $(config-extratools
) \
231 $(subst $(space
),,$(foreach opt
,$(config-
$(1)),CONFIG_
$(opt
)=$(1)
236 $(call ConfigVars
,n
)$(call ConfigVars
,y
)
238 $(eval
$(call shexport
,batctl_config
))
240 MAKE_FLAGS
+= $$$$$(call shvar
,batctl_config
)
242 define Package
/batctl-tiny
/install
243 $(INSTALL_DIR
) $(1)/usr
/libexec
244 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-tiny
247 define Package
/batctl-default
/install
248 $(INSTALL_DIR
) $(1)/usr
/libexec
249 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-default
252 define Package
/batctl-full
/install
253 $(INSTALL_DIR
) $(1)/usr
/libexec
254 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-full
257 $(eval
$(call BuildPackage
,batctl-default
))
258 $(eval
$(call BuildPackage
,batctl-tiny
))
259 $(eval
$(call BuildPackage
,batctl-full
))