-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindi.patch
109 lines (102 loc) · 4.36 KB
/
indi.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7369d3d..f54215c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,7 +122,7 @@ set_package_properties(CFITSIO PROPERTIES DESCRIPTION "A library for reading and
#
#################################################################################################
if (INDI_BUILD_SERVER)
-if (WIN32 OR ANDROID)
+if (WIN32)
message(WARNING "INDI Server is only supported under Linux, BSD, MacOS, and Cygwin while current system is " ${CMAKE_SYSTEM_NAME})
else()
@@ -143,7 +143,7 @@ ENDIF ()
add_executable(indiserver ${indiserver_SRC})
target_link_libraries(indiserver ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS indiserver RUNTIME DESTINATION bin)
-endif (WIN32 OR ANDROID)
+endif (WIN32)
endif (INDI_BUILD_SERVER)
#################################################################################################
@@ -153,7 +153,7 @@ endif (INDI_BUILD_SERVER)
# Supported OS: Linux, BSD, MacOS, Windows, Cygwin
# N.B. Windows support pending migration of networking code
#################################################################################################
-if (INDI_BUILD_CLIENT AND NOT ANDROID)
+if (INDI_BUILD_CLIENT)
# 1. Dependencies
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
@@ -206,7 +206,7 @@ endif (NOT CYGWIN AND NOT WIN32)
target_link_libraries(indiclient ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS indiclient ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/baseclient.h DESTINATION ${INCLUDE_INSTALL_DIR}/libindi COMPONENT Devel)
-endif (INDI_BUILD_CLIENT AND NOT ANDROID)
+endif (INDI_BUILD_CLIENT)
#################################################################################################
#
@@ -308,7 +308,7 @@ endif (INDI_BUILD_WEBSOCKET)
#
#################################################################################################
if (INDI_BUILD_DRIVERS)
-if (WIN32 OR ANDROID)
+if (WIN32)
message(WARNING "INDI drivers are only supported under Linux, BSD, MacOS, and Cygwin while current system is " ${CMAKE_SYSTEM_NAME})
else(WIN32 OR ANDROID)
# 1. Dependencies
@@ -321,7 +321,11 @@ find_package(CURL REQUIRED)
find_package(GSL REQUIRED)
find_package(JPEG REQUIRED)
# Math Library
-FIND_LIBRARY(M_LIB m)
+if (ANDROID)
+ set(M_LIB -lm)
+else ()
+ FIND_LIBRARY(M_LIB m)
+endif(ANDROID)
# 2. Includes
include_directories( ${CMAKE_CURRENT_BINARY_DIR})
include_directories( ${CMAKE_CURRENT_SOURCE_DIR})
@@ -2002,7 +2006,7 @@ ELSE()
MESSAGE (STATUS "GTEST not found, not building unit tests")
ENDIF (GTEST_FOUND)
-endif (WIN32 OR ANDROID)
+endif (WIN32)
endif(INDI_BUILD_DRIVERS)
###################################################################################################
diff --git a/cmake_modules/CMakeCommon.cmake b/cmake_modules/CMakeCommon.cmake
index 013d32f..6d96fd2 100644
--- a/cmake_modules/CMakeCommon.cmake
+++ b/cmake_modules/CMakeCommon.cmake
@@ -47,7 +47,7 @@ IF (UNIX OR APPLE OR ANDROID)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEC_COMP_FLAGS}")
SET(SEC_LINK_FLAGS "")
IF (NOT APPLE AND NOT CYGWIN AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
- SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now")
+ SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed -liconv -Wl,--no-as-needed -landroid-wordexp")
ENDIF ()
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SEC_LINK_FLAGS}")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SEC_LINK_FLAGS}")
diff --git a/libs/indibase/connectionplugins/connectiontcp.cpp b/libs/indibase/connectionplugins/connectiontcp.cpp
index 44ba96d..24b9a36 100644
--- a/libs/indibase/connectionplugins/connectiontcp.cpp
+++ b/libs/indibase/connectionplugins/connectiontcp.cpp
@@ -31,7 +31,7 @@
#include <unistd.h>
#include <regex>
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__ANDROID__)
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
diff --git a/libs/indicom.c b/libs/indicom.c
index 6718d5b..a6777fc 100644
--- a/libs/indicom.c
+++ b/libs/indicom.c
@@ -378,7 +378,6 @@ int tty_timeout_microseconds(int fd, long timeout_seconds, long timeout_microsec
{
#if defined(_WIN32) || defined(ANDROID)
INDI_UNUSED(fd);
- INDI_UNUSED(timeout);
return TTY_ERRNO;
#else