diff options
-rwxr-xr-x | androidconfigure | 71 | ||||
-rw-r--r-- | lib/curl_config.h | 43 | ||||
-rw-r--r-- | local-configure.patch | 67 |
3 files changed, 120 insertions, 61 deletions
diff --git a/androidconfigure b/androidconfigure index d9f25f44..f807e964 100755 --- a/androidconfigure +++ b/androidconfigure @@ -5,14 +5,15 @@ set -e if [[ "${TARGET_PRODUCT}" != "aosp_arm" ]]; then # Some of the include paths below assume that this is an arm 32bit configure # run. - echo "Run 'lunch aosp_arm-eng' first." >&2 + echo "Run 'lunch aosp_arm-eng' and build the current version first." >&2 exit 1 fi cd $(dirname "$0") -export CC="$(ls "${ANDROID_TOOLCHAIN}" | grep "\-gcc$" | grep -v kernel)" -export LD="$(ls "${ANDROID_TOOLCHAIN}" | grep "\-ld$" | grep -v kernel)" +HOST="arm-linux-androideabi" +export CC="${ANDROID_TOOLCHAIN}/${HOST}-gcc" +export LD="${ANDROID_TOOLCHAIN}/${HOST}-ld" T="${ANDROID_BUILD_TOP}" CFLAGS=( @@ -36,20 +37,60 @@ CFLAGS=( "-fno-strict-aliasing" "-nostdlib" ) - -./buildconf CFLAGS="${CFLAGS[@]}" -./configure \ - --host=arm-linux-androideabi \ - CFLAGS="${CFLAGS}" \ - LIBS="-lc" \ - CPPFLAGS="${CFLAGS} -I${T}/external/zlib/src" \ - LDFLAGS="-L${ANDROID_PRODUCT_OUT}/obj/lib/" \ - --disable-ntlm-wb \ - --enable-ipv6 \ - --with-ssl="${T}/external/boringssl" \ - --with-zlib \ + +CONFIGURE_ARGS=( + --host="${HOST}" + CFLAGS="${CFLAGS}" + LIBS="-lc" + CPPFLAGS="${CFLAGS} -I${T}/external/zlib/src" + LDFLAGS="-L${ANDROID_PRODUCT_OUT}/system/lib/" + + # Disable NTLM delegation to winbind's ntlm_auth. + --disable-ntlm-wb + + ### Disable many protocols unused in Android systems: + --disable-telnet + --disable-tftp + --disable-smb + --disable-gopher + + # Disable LDAP and LDAPS support. + --disable-ldap + --disable-ldaps + + # Disable mail protocols (IMAP, POP3). + --disable-pop3 + --disable-imap + --disable-smtp + + # Disable RTSP support (RFC 2326 / 7826). + --disable-rtsp + + # Disable DICT support (RFC 2229). + --disable-dict + + + ### Enable HTTP, FTP and FILE explicitly. These are enabled by default but + # listed here as documentation. + --enable-http + --enable-ftp + --enable-file + --enable-proxy + + # Enabled IPv6. + --enable-ipv6 + + --with-ssl="${T}/external/boringssl" + --with-zlib --with-ca-path="/system/etc/security/cacerts" +) + +# Show the commands on the terminal. +set -x + +./buildconf +./configure "${CONFIGURE_ARGS[@]}" # Apply local changes to the default configure output. patch -p1 --no-backup-if-mismatch < local-configure.patch diff --git a/lib/curl_config.h b/lib/curl_config.h index bd0b5c77..6ba8faca 100644 --- a/lib/curl_config.h +++ b/lib/curl_config.h @@ -17,7 +17,7 @@ /* #undef CURL_DISABLE_CRYPTO_AUTH */ /* to disable DICT */ -/* #undef CURL_DISABLE_DICT */ +#define CURL_DISABLE_DICT 1 /* to disable FILE */ /* #undef CURL_DISABLE_FILE */ @@ -26,13 +26,13 @@ /* #undef CURL_DISABLE_FTP */ /* to disable Gopher */ -/* #undef CURL_DISABLE_GOPHER */ +#define CURL_DISABLE_GOPHER 1 /* to disable HTTP */ /* #undef CURL_DISABLE_HTTP */ /* to disable IMAP */ -/* #undef CURL_DISABLE_IMAP */ +#define CURL_DISABLE_IMAP 1 /* to disable LDAP */ #define CURL_DISABLE_LDAP 1 @@ -44,25 +44,25 @@ /* #undef CURL_DISABLE_LIBCURL_OPTION */ /* to disable POP3 */ -/* #undef CURL_DISABLE_POP3 */ +#define CURL_DISABLE_POP3 1 /* to disable proxies */ /* #undef CURL_DISABLE_PROXY */ /* to disable RTSP */ -/* #undef CURL_DISABLE_RTSP */ +#define CURL_DISABLE_RTSP 1 /* to disable SMB/CIFS */ -/* #undef CURL_DISABLE_SMB */ +#define CURL_DISABLE_SMB 1 /* to disable SMTP */ -/* #undef CURL_DISABLE_SMTP */ +#define CURL_DISABLE_SMTP 1 /* to disable TELNET */ -/* #undef CURL_DISABLE_TELNET */ +#define CURL_DISABLE_TELNET 1 /* to disable TFTP */ -/* #undef CURL_DISABLE_TFTP */ +#define CURL_DISABLE_TFTP 1 /* to disable TLS-SRP authentication */ /* #undef CURL_DISABLE_TLS_SRP */ @@ -129,6 +129,7 @@ /* Define to 1 if you have the clock_gettime function and monotonic timer. */ #if !defined(__APPLE__) +/* CLOCK_MONOTONIC is not defined in mac when building for the host. */ #define HAVE_CLOCK_GETTIME_MONOTONIC 1 #endif @@ -378,7 +379,7 @@ /* #undef HAVE_LDAP_INIT_FD */ /* Use LDAPS implementation */ -#define HAVE_LDAP_SSL 1 +/* #undef HAVE_LDAP_SSL */ /* Define to 1 if you have the ldap_ssl.h header file. */ /* #undef HAVE_LDAP_SSL_H */ @@ -548,7 +549,7 @@ /* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ /* Define to 1 if you have the <sgtty.h> header file. */ -#define HAVE_SGTTY_H 1 +/* #undef HAVE_SGTTY_H */ /* Define to 1 if you have the sigaction function. */ #define HAVE_SIGACTION 1 @@ -692,7 +693,7 @@ #define HAVE_SYS_UN_H 1 /* Define to 1 if you have the <sys/utime.h> header file. */ -#define HAVE_SYS_UTIME_H 1 +/* #undef HAVE_SYS_UTIME_H */ /* Define to 1 if you have the <sys/wait.h> header file. */ #define HAVE_SYS_WAIT_H 1 @@ -871,27 +872,9 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 -/* The size of `long', as computed by sizeof. */ -/* #undef SIZEOF_LONG */ - -/* The size of `long long', as computed by sizeof. */ -/* #undef SIZEOF_LONG_LONG */ - -/* The size of `off_t', as computed by sizeof. */ -#define SIZEOF_OFF_T 8 - /* The size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 -/* The size of `size_t', as computed by sizeof. */ -/* #undef SIZEOF_SIZE_T */ - -/* The size of `time_t', as computed by sizeof. */ -/* #undef SIZEOF_TIME_T */ - -/* The size of `void*', as computed by sizeof. */ -/* #undef SIZEOF_VOIDP */ - /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 diff --git a/local-configure.patch b/local-configure.patch index b3444fec..25bb3c4e 100644 --- a/local-configure.patch +++ b/local-configure.patch @@ -1,57 +1,92 @@ diff --git a/lib/curl_config.h b/lib/curl_config.h -index d3d74dc..526bcf7 100644 +index 273593ba6..6ba8faca3 100644 --- a/lib/curl_config.h +++ b/lib/curl_config.h @@ -128,7 +128,10 @@ #define HAVE_BORINGSSL 1 /* Define to 1 if you have the clock_gettime function and monotonic timer. */ -+#ifndef __APPLE__ ++#if !defined(__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 */ -@@ -442,10 +445,14 @@ +@@ -430,10 +433,14 @@ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the memrchr function or macro. */ -+#ifndef __APPLE__ ++#if !defined(__APPLE__) #define HAVE_MEMRCHR 1 +#endif /* Define to 1 if you have the MSG_NOSIGNAL flag. */ -+#ifndef __APPLE__ ++#if !defined(__APPLE__) #define HAVE_MSG_NOSIGNAL 1 +#endif /* Define to 1 if you have the <netdb.h> header file. */ #define HAVE_NETDB_H 1 -@@ -858,7 +865,7 @@ +@@ -787,9 +794,6 @@ + /* Define absolute filename for winbind's ntlm_auth helper. */ + /* #undef NTLM_WB_FILE */ + +-/* cpu-machine-OS */ +-#define OS "arm-unknown-linux-androideabi" +- + /* Name of package */ + #define PACKAGE "curl" + +@@ -827,7 +831,7 @@ + #define RECV_TYPE_ARG4 int + + /* Define to the function return type for recv. */ +-#define RECV_TYPE_RETV int ++#define RECV_TYPE_RETV ssize_t + + /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void +@@ -845,7 +849,7 @@ + #define SELECT_TYPE_ARG5 struct timeval * + + /* Define to the function return type for select. */ +-#define SELECT_TYPE_RETV int ++#define SELECT_TYPE_RETV ssize_t - /* Define to the type qualifier of arg 5 for select. */ --#define SELECT_QUAL_ARG5 -+#define SELECT_QUAL_ARG5 + /* Define to the type qualifier of arg 2 for send. */ + #define SEND_QUAL_ARG2 const +@@ -863,32 +867,14 @@ + #define SEND_TYPE_ARG4 int - /* Define to the type of arg 1 for select. */ - #define SELECT_TYPE_ARG1 int -@@ -890,18 +897,9 @@ /* Define to the function return type for send. */ - #define SEND_TYPE_RETV int +-#define SEND_TYPE_RETV int ++#define SEND_TYPE_RETV ssize_t + + /* The size of `int', as computed by sizeof. */ + #define SIZEOF_INT 4 -/* The size of `long', as computed by sizeof. */ -#define SIZEOF_LONG 4 - - /* The size of `long long', as computed by sizeof. */ - /* #undef SIZEOF_LONG_LONG */ - +-/* The size of `long long', as computed by sizeof. */ +-/* #undef SIZEOF_LONG_LONG */ +- -/* The size of `off_t', as computed by sizeof. */ -#define SIZEOF_OFF_T 8 - + /* The size of `short', as computed by sizeof. */ + #define SIZEOF_SHORT 2 + +-/* The size of `size_t', as computed by sizeof. */ +-#define SIZEOF_SIZE_T 4 +- +-/* The size of `time_t', as computed by sizeof. */ +-#define SIZEOF_TIME_T 4 +- -/* The size of `void*', as computed by sizeof. */ -#define SIZEOF_VOIDP 4 - /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 + |