aboutsummaryrefslogtreecommitdiff
path: root/app/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'app/CMakeLists.txt')
-rw-r--r--app/CMakeLists.txt54
1 files changed, 54 insertions, 0 deletions
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
new file mode 100644
index 0000000..d115cb6
--- /dev/null
+++ b/app/CMakeLists.txt
@@ -0,0 +1,54 @@
1cmake_minimum_required(VERSION 3.4.1)
2include(ExternalProject)
3
4set(xCONFIG
5 "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN} ${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}"
6 "LD=${CMAKE_LINKER}"
7 "AR=${CMAKE_AR}"
8 "RANLIB=${CMAKE_RANLIB}"
9 "CFLAGS=${CMAKE_C_FLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}"
10 "LDFLAGS=${CMAKE_STATIC_LINKER_FLAGS} ${CMAKE_C_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}"
11 "--host=${CMAKE_C_COMPILER_TARGET}"
12)
13
14if(${ANDROID_ABI} STREQUAL "mips64")
15 list(APPEND xCONFIG --disable-asm)
16endif()
17
18ExternalProject_Add(lzo
19 URL http://files.pacien.net/tmp/lzo-2.10.tar.gz
20 URL_HASH SHA1=4924676a9bae5db58ef129dc1cebce3baa3c4b5d
21 CONFIGURE_COMMAND <SOURCE_DIR>/configure ${xCONFIG} --disable-shared
22 BUILD_COMMAND make -j4
23 INSTALL_COMMAND make install DESTDIR=${CMAKE_CURRENT_BINARY_DIR} &&
24 rm -r <BINARY_DIR>
25)
26
27ExternalProject_Add(libressl
28 URL http://files.pacien.net/tmp/libressl-2.5.4.tar.gz
29 URL_HASH SHA256=107a5b522fbb8318d4c3be668075e5e607296f0a9255d71674caa94571336efa
30 CONFIGURE_COMMAND <SOURCE_DIR>/configure ${xCONFIG} --disable-shared
31 BUILD_COMMAND make -j4 -C crypto
32 INSTALL_COMMAND make -C crypto install DESTDIR=${CMAKE_CURRENT_BINARY_DIR} &&
33 make -C include install DESTDIR=${CMAKE_CURRENT_BINARY_DIR} &&
34 rm -r <BINARY_DIR>
35)
36
37ExternalProject_Add(tinc
38 DEPENDS lzo libressl
39 URL http://files.pacien.net/tmp/tinc-1.1pre15-SNAPSHOT.tar.gz
40 CONFIGURE_COMMAND autoreconf -fsi <SOURCE_DIR> &&
41 <SOURCE_DIR>/configure ${xCONFIG}
42 --with-openssl=${CMAKE_CURRENT_BINARY_DIR}/usr/local
43 --with-lzo=${CMAKE_CURRENT_BINARY_DIR}/usr/local
44 --disable-curses
45 --disable-readline
46 BUILD_COMMAND make -j4 -C src
47 INSTALL_COMMAND make -C src install DESTDIR=${CMAKE_CURRENT_BINARY_DIR} &&
48 ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/usr/local/sbin/tinc ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtinc.so &&
49 ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/usr/local/sbin/tincd ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtincd.so &&
50 rm -r <BINARY_DIR>
51)
52
53add_library(exec SHARED src/main/c/exec.c)
54add_dependencies(exec tinc)