Skip to content

Commit f75c2e7

Browse files
committed
initial commit
Signed-off-by: Felix Fietkau <[email protected]>
0 parents  commit f75c2e7

33 files changed

+8608
-0
lines changed

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Makefile
2+
CMakeCache.txt
3+
CMakeFiles
4+
*.cmake
5+
*.a
6+
*.so
7+
*.dylib
8+
unetd

CMakeLists.txt

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cmake_minimum_required(VERSION 3.3)
2+
3+
PROJECT(unetd C)
4+
5+
6+
SET(SOURCES
7+
main.c ubus.c network.c host.c service.c pex.c utils.c
8+
curve25519.c siphash.c
9+
wg.c wg-dummy.c wg-user.c
10+
)
11+
12+
SET(RUNSTATEDIR /var/run)
13+
14+
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations -DRUNSTATEDIR="${RUNSTATEDIR}")
15+
FIND_LIBRARY(libjson NAMES json-c json)
16+
17+
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
18+
FIND_LIBRARY(nl nl-tiny)
19+
SET(SOURCES ${SOURCES} wg-linux.c)
20+
ELSE()
21+
SET(nl "")
22+
ENDIF()
23+
24+
ADD_EXECUTABLE(unetd ${SOURCES})
25+
TARGET_LINK_LIBRARIES(unetd ubox ubus blobmsg_json ${libjson} ${nl})
26+
27+
INSTALL(TARGETS unetd
28+
RUNTIME DESTINATION sbin
29+
LIBRARY DESTINATION lib
30+
)

0 commit comments

Comments
 (0)