Added macro definition to allow Serval code to know if it is being

built on Android or not, and set default instance path accordingly.
This commit is contained in:
gardners 2012-02-17 01:03:59 +10:30
parent 22d113d3db
commit 16d61dcaf3
2 changed files with 7 additions and 1 deletions

View File

@ -52,7 +52,7 @@ LOCAL_CFLAGS += \
-DHAVE_ERRNO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRINGS_H=1 -DHAVE_UNISTD_H=1 \
-DHAVE_STRING_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_SOCKET_H=1 \
-DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_POLL_H=1 -DHAVE_NETDB_H=1 \
-DHAVE_SYS_ENDIAN_H=1
-DHAVE_SYS_ENDIAN_H=1 -DANDROID=1
include $(BUILD_SHARED_LIBRARY)

View File

@ -96,6 +96,12 @@ struct in_addr {
//FIXME #include <getopt.h>
#include <ctype.h>
#ifdef ANDROID
#define DEFAULT_INSTANCE_PATH "/data/data/org.servalproject/var/serval-node"
#else
#define DEFAULT_INSTANCE_PATH "/var/serval-node"
#endif
/* UDP Port numbers for various Serval services.
The overlay mesh works over DNA */
#define PORT_DNA 4110