- Add an option to build network management controller microservice

- Respect CC/CXX and drop superfluous GH_ACCOUNT while I'm at it

PR:		215031 (modified)
Approved by:	maintainer timeout (since 2016-12-03)
This commit is contained in:
Alexey Dokuchaev 2017-03-07 15:49:27 +00:00
parent 7b0cbba528
commit ea21911cba
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=435612
2 changed files with 31 additions and 1 deletions

View file

@ -15,12 +15,17 @@ USES= gmake
USE_RC_SUBR= zerotier
USE_GITHUB= yes
GH_ACCOUNT= zerotier
GH_PROJECT= ZeroTierOne
CFLAGS+= -flax-vector-conversions
PLIST_FILES= bin/zerotier-cli bin/zerotier-idtool sbin/zerotier-one
OPTIONS_DEFINE= CONTROLLER
CONTROLLER_DESC= Network management controller microservice support
CONTROLLER_USES= sqlite
CONTROLLER_MAKE_ARGS= ZT_ENABLE_NETWORK_CONTROLLER=1
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/zerotier-one ${STAGEDIR}${PREFIX}/sbin/
.for l in zerotier-cli zerotier-idtool

View file

@ -0,0 +1,25 @@
--- make-freebsd.mk.orig 2016-07-22 03:29:15 UTC
+++ make-freebsd.mk
@@ -1,5 +1,5 @@
-CC=cc
-CXX=c++
+CC?=cc
+CXX?=c++
INCLUDES=
DEFS=
@@ -18,6 +18,14 @@ ifeq ($(ZT_ENABLE_CLUSTER),1)
DEFS+=-DZT_ENABLE_CLUSTER
endif
+# Build with ZT_ENABLE_NETWORK_CONTROLLER=1 to build with SQLite network controller
+ifeq ($(ZT_ENABLE_NETWORK_CONTROLLER),1)
+ DEFS+=-DZT_ENABLE_NETWORK_CONTROLLER
+ INCLUDES+=-I$(LOCALBASE)/include
+ LDFLAGS+=-L$(LOCALBASE)/lib -lsqlite3
+ OBJS+=controller/SqliteNetworkController.o
+endif
+
# "make debug" is a shortcut for this
ifeq ($(ZT_DEBUG),1)
DEFS+=-DZT_TRACE