PeterGriffin
PeterGriffin

Reputation: 910

Porting cURL to Android with NDK

Good day to you. I'm currently struggling at porting cURL onto my Android app - many subjects do talk about this, but no single post or tutorial or whatever does clearly say what to do or just don't work at all.

I do own every single tool needed, have the latest version of cURL (7.28.0). I tried to do it using cross-compiling and a toolchain (part that work good) but when I'm trying to configure the curl-7.28.0, the ./configure --host=arm-linux-androideabi (or any argument that is pass) return the following error :

./configure: line 20: $'\r' : unknown command
./configure: line 35: Syntax error near unexpected token « newline »
'/configure: line 35: `     ;;

If someone had already gone through this and does have the memories of the steps he followed or knows what I do wrong, it would be a blessing if you could help my poor soul ! Thanks in advance.

Note : I'm using Cygwin.

Upvotes: 1

Views: 483

Answers (2)

devsnd
devsnd

Reputation: 7722

Since you are using Cygwin, I suspect that you have tonj convert all the newlines to the windows format for it to work:

It seems that configure has only \r, or so called "carriage returns", as new line character. This is actually the notation used by OSX. Most *nixes use just a single newline character to work (\n). Only windows needs both: a "carriage return" and a newline character: e.g. \r\n.

You can use any professional text editor to change this, for example notepad++.

Upvotes: 1

Seva Alekseyev
Seva Alekseyev

Reputation: 61388

Looks like a newline issue in whatever file configure is reading. On Windows, lines in text files are terminated with CR/LF (\r\n) - many Unixy tools choke on that.

Visual Studio, among other tools, can recode line termination. Open a file, File\Advanced Save Options, choose Unix line format, then save.

On *nix there's a tool called dos2unix that does the same.

Upvotes: 1

Related Questions