2、下载主目录下configure,因为接下来编译的时候要用到curl_config.h,这个是在configure时生成的:
./configure --host=arm-linux CC=arm-linux-gnueabi-gcc
LOCAL_PATH := $(call my-dir) CURL_TOP := $(LOCAL_PATH) include $(CLEAR_VARS) include $(CURL_TOP)/lib/Android.mk
LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ file.c timeval.c base64.c hostip.c progress.c formdata.c \ cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \ ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c \ netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c \ curl_fnmatch.c fileinfo.c ftplistparser.c wildcard.c krb5.c \ memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c multi.c \ content_encoding.c share.c http_digest.c md4.c md5.c \ http_negotiate.c inet_pton.c strtoofft.c strerror.c amigaos.c \ hostasyn.c hostip4.c hostip6.c hostsyn.c inet_ntop.c parsedate.c \ select.c gtls.c sslgen.c tftp.c splay.c strdup.c socks.c ssh.c nss.c \ qssl.c rawstr.c curl_addrinfo.c socks_gssapi.c socks_sspi.c \ curl_sspi.c slist.c nonblock.c curl_memrchr.c imap.c pop3.c smtp.c \ pingpong.c rtsp.c curl_threads.c warnless.c hmac.c polarssl.c \ polarssl_threadlock.c curl_rtmp.c openldap.c curl_gethostname.c \ gopher.c axtls.c idn_win32.c http_negotiate_sspi.c cyassl.c \ http_proxy.c non-ascii.c asyn-ares.c asyn-thread.c curl_gssapi.c \ curl_ntlm.c curl_ntlm_wb.c curl_ntlm_core.c curl_ntlm_msgs.c \ curl_sasl.c curl_schannel.c curl_multibyte.c curl_darwinssl.c \ hostcheck.c bundles.c conncache.c pipeline.c dotdot.c x509asn1.c \ gskit.c LOCAL_C_INCLUDES :=./ \ $(LOCAL_PATH)/../include # /opt/arm-linux-gnueabi/arm-linux-gnueabi/libc/usr/include/ \ # /opt/arm-linux-gnueabi/arm-linux-gnueabi/libc/usr/include/arm-linux-gnueabi/ LOCAL_CFLAGS := -DHAVE_CONFIG_H -I../include/curl -I../include -I../include -I../lib -I../lib -DBUILDING_LIBCURL -DCURL_HIDDEN_SYMBOLS -fvisibility=hidden -O2 -Wno-system-headers -fPIC -DPIC LOCAL_LDLIBS:= -lc -ldl LOCAL_MODULE:=libcurl include $(BUILD_SHARED_LIBRARY)
/home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c:44:23: fatal error: ifaddrs.h: No such file or directory compilation terminated.
/home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c:47:23: fatal error: stropts.h: No such file or directory compilation terminated.同样在在lib/curl_config.h中把HAVE_STROPTS_H宏注释掉就ok了,
/home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c: In function 'Curl_if_is_interface_name': /home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c:75:47: error: dereferencing pointer to incomplete type /home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c:76:29: error: dereferencing pointer to incomplete type /home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c: In function 'Curl_if2ip': /home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c:97:47: error: dereferencing pointer to incomplete type /home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c:98:15: error: dereferencing pointer to incomplete type /home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c:99:17: error: dereferencing pointer to incomplete type /home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c:100:33: error: dereferencing pointer to incomplete type /home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c:127:51: error: dereferencing pointer to incomplete type /home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/jni/lib/if2ip.c:135:36: error: dereferencing pointer to incomplete type make: *** [/home/usrhome/johnny.he/androidworkspace/jni_compile/jni_curl-7.32.2/obj/local/armeabi/objs/curl/if2ip.o] Error 1
LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ shell.c \ sqlite3.c \ LOCAL_C_INCLUDES :=./ LOCAL_CFLAGS := -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.8.0.2\" "-DPACKAGE_STRING=\"sqlite 3.8.0.2\"" -DPACKAGE_BUGREPORT= \"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.8.0.2\" -D_FILE_OFFSET_BITS=64 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 - DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 - DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 - DHAVE_STRERROR_R=1 -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 LOCAL_LDLIBS:= -lc -ldl LOCAL_MODULE:=libsqlite3 include $(BUILD_SHARED_LIBRARY)