diff options
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | src/ptunnel.h | 2 | ||||
-rw-r--r-- | src/utils.c | 1 |
3 files changed, 14 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 36ddddc..4de8642 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,9 @@ case x"${host}" in use_msw=yes PROGRAM_EXT=".exe" ;; + *-androideabi) + use_android=yes + ;; esac AM_SILENT_RULES([yes]) @@ -35,10 +38,16 @@ dnl Check for std includes. AC_CHECK_HEADERS([stdarg.h stdio.h unistd.h stdlib.h string.h stdint.h time.h signal.h assert.h],, [AC_MSG_ERROR([Missing essential std headers.])]) if test x"${use_msw}" != x"yes"; then - AC_CHECK_HEADERS([sys/unistd.h sys/types.h sys/socket.h netinet/in.h arpa/inet.h netdb.h pthread.h errno.h net/ethernet.h syslog.h pwd.h grp.h],, + if test x"${use_android}" != x"yes"; then + AC_CHECK_HEADERS([sys/unistd.h],,[AC_MSG_ERROR([Missing essential non-Windows/Android std headers.])]) + fi + AC_CHECK_HEADERS([sys/types.h sys/socket.h netinet/in.h arpa/inet.h netdb.h pthread.h errno.h net/ethernet.h syslog.h pwd.h grp.h],, [AC_MSG_ERROR([Missing essential non-Windows std headers.])]) AC_SEARCH_LIBS([pthread_create], [pthread],, [AC_MSG_ERROR([Missing pthread library.])],) + if test x"${use_android}" != x"yes"; then + AC_CHECK_FUNCS([signal],,[AC_MSG_ERROR([Missing essential non-Android std functions.])]) + fi AC_CHECK_FUNCS([pthread_mutex_init pthread_mutex_lock pthread_mutex_unlock syslog getaddrinfo freeaddrinfo gai_strerror],, [AC_MSG_ERROR([Missing essential Linux std functions.])]) else @@ -104,7 +113,7 @@ struct foo { ,[AC_MSG_ERROR([Your compiler does not support \`__attribute__ ((packed))\`.])]) dnl Check for std functions. -AC_CHECK_FUNCS([malloc calloc free memcpy memset signal printf sprintf vsnprintf strerror strlen strncmp strstr strtol strtoul fopen fprintf gettimeofday close fclose exit getopt_long],, +AC_CHECK_FUNCS([malloc calloc free memcpy memset printf sprintf vsnprintf strerror strlen strncmp strstr strtol strtoul fopen fprintf gettimeofday close fclose exit getopt_long],, [AC_MSG_ERROR([Missing essential std functions.])]) dnl `--disable-pcap`: Enabled if found. diff --git a/src/ptunnel.h b/src/ptunnel.h index 966f5ba..8f77458 100644 --- a/src/ptunnel.h +++ b/src/ptunnel.h @@ -45,7 +45,9 @@ #define PING_TUNNEL_H 1 #ifndef WIN32 +#ifndef __ANDROID__ #include <sys/unistd.h> +#endif #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> diff --git a/src/utils.c b/src/utils.c index 2cbebc4..66ed4c0 100644 --- a/src/utils.c +++ b/src/utils.c @@ -51,6 +51,7 @@ #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> +#include <netinet/in.h> #else #include <ws2tcpip.h> #endif |