1 # SPDX-License-Identifier: GPL-2.0-only
3 include $(TOPDIR
)/rules.mk
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
:=9cec8bf1952f885192749a9dc0318a54633b717aaf05c438d504efd83f5201e4
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)"
98 bridge_loop_avoidance \
101 distributed_arp_table \
113 multicast_forceflood \
123 throughput_override \
134 bridge_loop_avoidance \
135 distributed_arp_table \
144 multicast_forceflood \
149 throughput_override \
171 config-extratools
:= \
174 ifeq ($(BUILD_VARIANT
),tiny
)
181 ifeq ($(BUILD_VARIANT
),default
)
190 ifeq ($(BUILD_VARIANT
),full
)
196 $(config-extratools
) \
201 $(subst $(space
),,$(foreach opt
,$(config-
$(1)),CONFIG_
$(opt
)=$(1)
206 $(call ConfigVars
,n
)$(call ConfigVars
,y
)
208 $(eval
$(call shexport
,batctl_config
))
210 MAKE_FLAGS
+= $$$$$(call shvar
,batctl_config
)
212 define Package
/batctl-tiny
/install
213 $(INSTALL_DIR
) $(1)/usr
/libexec
214 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-tiny
217 define Package
/batctl-default
/install
218 $(INSTALL_DIR
) $(1)/usr
/libexec
219 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-default
222 define Package
/batctl-full
/install
223 $(INSTALL_DIR
) $(1)/usr
/libexec
224 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/batctl
$(1)/usr
/libexec
/batctl-full
227 $(eval
$(call BuildPackage
,batctl-default
))
228 $(eval
$(call BuildPackage
,batctl-tiny
))
229 $(eval
$(call BuildPackage
,batctl-full
))