aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2015-12-09 18:19:00 -0800
committerAlex Deymo <deymo@google.com>2015-12-10 13:58:19 -0800
commit48fb0babc830c89225209701c4157af80d3ef347 (patch)
treef2c1515354655bf8f8a312f7c2cf896340fdc8b9
parentd240c7008fde86f7fcd4475d2b52de2332d905a5 (diff)
downloadcurl-48fb0babc830c89225209701c4157af80d3ef347.tar.gz
Compile libcurl for the host.
Bug: 24619596 TEST=mma Change-Id: I0ec88cfc35690542abd029ce81255f34de3b8eb4
-rw-r--r--Android.mk20
-rw-r--r--lib/cookie.c1
-rw-r--r--lib/curl_config.h9
-rw-r--r--lib/warnless.c1
4 files changed, 28 insertions, 3 deletions
diff --git a/Android.mk b/Android.mk
index 13f1787ca..d338b9622 100644
--- a/Android.mk
+++ b/Android.mk
@@ -40,6 +40,24 @@ include $(BUILD_STATIC_LIBRARY)
#########################
# Build the libcurl shared library
+libcurl_shared_libs := libcrypto libssl libz
+
+include $(CLEAR_VARS)
+include $(LOCAL_PATH)/lib/Makefile.inc
+
+LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES))
+LOCAL_C_INCLUDES := $(curl_includes)
+LOCAL_CFLAGS := \
+ $(curl_CFLAGS) \
+ -D_GNU_SOURCE=1
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
+
+LOCAL_MODULE:= libcurl-host
+LOCAL_MODULE_TAGS := optional
+LOCAL_SHARED_LIBRARIES := $(libcurl_shared_libs:=-host)
+
+include $(BUILD_HOST_SHARED_LIBRARY)
+
include $(CLEAR_VARS)
include $(LOCAL_PATH)/lib/Makefile.inc
@@ -50,7 +68,7 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_MODULE:= libcurl
LOCAL_MODULE_TAGS := optional
-LOCAL_SHARED_LIBRARIES := libcrypto libssl libz
+LOCAL_SHARED_LIBRARIES := $(libcurl_shared_libs)
include $(BUILD_SHARED_LIBRARY)
diff --git a/lib/cookie.c b/lib/cookie.c
index 94f2a8b85..ea717a6f2 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -79,7 +79,6 @@ Example set of cookies:
13-Jun-1988 03:04:55 GMT; domain=.fidelity.com; path=/; secure
****/
-
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
diff --git a/lib/curl_config.h b/lib/curl_config.h
index 88124ffe4..434cf9b5a 100644
--- a/lib/curl_config.h
+++ b/lib/curl_config.h
@@ -125,7 +125,10 @@
#define HAVE_BORINGSSL 1
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
+#ifndef __APPLE__
+/* CLOCK_MONOTONIC is not defined in mac when building for the host. */
#define HAVE_CLOCK_GETTIME_MONOTONIC 1
+#endif
/* Define to 1 if you have the closesocket function. */
/* #undef HAVE_CLOSESOCKET */
@@ -435,10 +438,14 @@
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the memrchr function or macro. */
+#ifndef __APPLE__
#define HAVE_MEMRCHR 1
+#endif
/* Define to 1 if you have the MSG_NOSIGNAL flag. */
+#ifndef __APPLE__
#define HAVE_MSG_NOSIGNAL 1
+#endif
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
@@ -839,7 +846,7 @@
#define RETSIGTYPE void
/* Define to the type qualifier of arg 5 for select. */
-#define SELECT_QUAL_ARG5
+#define SELECT_QUAL_ARG5
/* Define to the type of arg 1 for select. */
#define SELECT_TYPE_ARG1 int
diff --git a/lib/warnless.c b/lib/warnless.c
index 8d4bbdf51..9482b44ff 100644
--- a/lib/warnless.c
+++ b/lib/warnless.c
@@ -22,6 +22,7 @@
#include "curl_setup.h"
#include "stdint.h"
+#include "limits.h"
#if defined(__INTEL_COMPILER) && defined(__unix__)