cURL / Mailing Lists / curl-library / Single Mail


Re: Questions on building libcurl for Android

From: Ram <>
Date: Thu, 30 Aug 2012 15:57:06 -0700

On Tue, Aug 28, 2012 at 7:46 PM, Guenter <> wrote:

> ok, just did a quick build of recent release 7.27.0 in the background on
> my W2K3 server with an older Cygwin installation, and it worked like a
> charm! See the buildlog here:
> I did setup this some time ago already, so I didnt remember how I did
> integrate the standalone toolchain into Cygwin - so here's the way I did it
> (assuming that your Cygwin installation is on the C root = C:\Cygwin):
> - create a new empty folder C:\Cygwin\arm-linux-**androideabi
Thank you again, Guenter, all your responses have been very helpful and
that finally helped get a working build using cygwin
Yesterday, I was able to ndk-build an Android build and verify that an app
with the curl_easy_perform API correctly made an HTTP request from within
the Android emulator.

Ultimately, you were correct in guessing that the build issues might have
been specific to NDK r8b.

When building with NDK 8b, I consistently got the same build error
(described in my prior emails) while running the configure script. This
happened with 4.4.4 compiler as well as the 4.6 compiler.
However, when I used the NDK 7c toolchain (cross-compiler), the configure
script worked fine and did its job in around 8 minutes (in cygwin).
I used *"./configure --host=arm-linux-androideabi --with-zlib --enable-ipv6*"
which you had mentioned in an earlier post
"make" took very little time and created a libcurl.a file for Android.

I then took the libcurl.a file and integrated it into the Android build (by
creating a new file for the libcurl module).
Btw as an fyi - I did run into a couple of build issues which don't
directly impact my work.

1. make fails when run a second time.
When I run make a second time, I get the following errors.(make clean
doesn't eliminate the error)
*Making all in lib
make[1]: Entering directory
.deps/libcurl_la-amigaos.Plo:1: *** multiple target patterns. Stop.
make[1]: Leaving directory
Makefile:443: recipe for target `all-recursive' failed
make: *** [all-recursive] Error 1
This isn't a big issue for me, because -for now- I don't need to make code
changes or build multiple times.
I can do a rebuild on a new clean source tree.
However, I only need to build once and use the prebuilt .a file for my
Android app. So I didn't immediately search for a way to fix the problem.

2. The file doesn't get built. I get the following error from
*libtool: link: arm-linux-androideabi-gcc -g0 -O2 -Wno-system-headers -o
.libs/curl hugehelp.o tool_binmode.o tool_bname.o tool_cb_dbg.o
tool_cb_hdr.o tool_cb_prg.o tool_cb_rea.o tool_cb_see.o tool_cb_wrt.o
tool_cfgable.o tool_convert.o tool_dirhie.o tool_doswin.o tool_easysrc.o
tool_formparse.o tool_getparam.o tool_getpass.o tool_help.o tool_helpers.o
tool_homedir.o tool_libinfo.o tool_main.o tool_metalink.o tool_mfiles.o
tool_msgs.o tool_operate.o tool_operhlp.o tool_panykey.o tool_paramhlp.o
tool_parsecfg.o tool_setopt.o tool_sleep.o tool_urlglob.o tool_util.o
tool_vms.o tool_writeenv.o tool_writeout.o tool_xattr.o strtoofft.o
strdup.o rawstr.o nonblock.o ../lib/.libs/ -lz -Wl,-rpath -
format not recognized; treating as linker script
collect2: ld returned 1 exit status
Makefile:541: recipe for target `curl' failed
make[2]: *** [curl] Error 1
make[2]: Leaving directory
Makefile:479: recipe for target `all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory
Makefile:443: recipe for target `all-recursive' failed
make: *** [all-recursive] Error 1

I don't plan to use the .so file. My app needs the .a static library file.
So this wasn't a priority for me, though I should probably look at this
error (and the previous one) at some later time.

In any case, for now, I've got the basic build working and that is great. I
now need to work on other parts of my app and will study the libcurl apis
and work on the http request portion of my app, sometime next month.
Regards Ram

List admin:
Received on 2012-08-31