gustavogenovese / curl-android-ios

Static libcurl to be used in Android and iOS apps. Build scripts included. No Android source required
641 stars 255 forks source link

Curl failed to build with NDK r16 unified headers #46

Closed pixelblender closed 6 years ago

pixelblender commented 7 years ago

Hi,

OpenSSL build just fine but curl's configure process is broken with NDK r16 unified headers:

Android/sdk/ndk-bundle/prebuilt/darwin-x86_64/bin/../../../toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-cpp" fails sanity check

Thank you for the awesome project and keep up the good work.

heyask commented 6 years ago

Did you solved? same error. I'm using mac. My "config.log" shows errors like this.

configure:3220: checking whether to enable compiler warnings as errors
arm-linux-androideabi-gcc: error: unrecognized command line option '-V'
arm-linux-androideabi-gcc: fatal error: no input files
arm-linux-androideabi-gcc: error: unrecognized command line option '-qversion'
arm-linux-androideabi-gcc: fatal error: no input files
conftest.c:9:19: fatal error: stdio.h: No such file or directory
conftest.c:10:19: fatal error: stdio.h: No such file or directory
|    These don't provoke an error unfortunately, instead are silently treated
|    as 'x'.  The following induces an error, until -std is added to get
arm-linux-androideabi-gcc: error: unrecognized command line option '-qlanglvl=extc89'
|    These don't provoke an error unfortunately, instead are silently treated
|    as 'x'.  The following induces an error, until -std is added to get
arm-linux-androideabi-gcc: error: unrecognized command line option '-qlanglvl=ansi'
|    These don't provoke an error unfortunately, instead are silently treated
|    as 'x'.  The following induces an error, until -std is added to get
arm-linux-androideabi-gcc: error: unrecognized command line option '-std'
|    These don't provoke an error unfortunately, instead are silently treated
|    as 'x'.  The following induces an error, until -std is added to get
<command-line>:0:1: error: missing '(' after predicate
conftest.c:10:19: fatal error: stdio.h: No such file or directory
|    These don't provoke an error unfortunately, instead are silently treated
|    as 'x'.  The following induces an error, until -std is added to get
<command-line>:0:1: error: missing '(' after predicate
conftest.c:10:19: fatal error: stdio.h: No such file or directory
|    These don't provoke an error unfortunately, instead are silently treated
|    as 'x'.  The following induces an error, until -std is added to get
arm-linux-androideabi-gcc: error: unrecognized command line option '-Xc'
|    These don't provoke an error unfortunately, instead are silently treated
|    as 'x'.  The following induces an error, until -std is added to get
/Users/abc/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/include-fixed/limits.h:168:61: error: no include path in which to search for limits.h
|            Syntax error
/Users/abc/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/include-fixed/limits.h:168:61: error: no include path in which to search for limits.h
|            Syntax error
configure:4940: error: in `/Users/abc/Downloads/curl-android-ios/curl':
configure:4942: error: C preprocessor "/Users/abc/Library/Android/sdk/ndk-bundle/prebuilt/darwin-x86_64/bin/../../../toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-cpp" fails sanity check
heyask commented 6 years ago

solved. you have to use "TARGET=android-9" in build_Android.sh. I edited it to "android-14" because I don't have platforms directory named "android-9" in ndk-bundle. That was the problem. I re-downloaded Android NDK, and copy android-9 to ndk-bundle/platform directory.

Good!

FullStackChad commented 6 years ago

Thanks for the update @heyask, but where did you copy android-9 from? With ~/SDK/platforms/ I found Android-9 but it's a complete different file from the ndk-bundle/platforms. e.g. arch-arm,arch-mips,& arch-x86 are missing from it. I re-downloaded Android NDK and put that there and as expected it didn't work.

Configured for android.

*** Because of configuration changes, you MUST do the following before
*** building:

    make depend
Android NDK: android-9 is unsupported. Using minimum supported version android-14.    
make: Entering directory `/Users/user/Desktop/CurlPrj/curl-android-ios/curl-compile-scripts'
/Users/user/Library/Android/sdk/ndk-bundle/build/core/setup-app.mk:81: Android NDK: Application targets deprecated ABI(s): mips64 armeabi mips    
/Users/user/Library/Android/sdk/ndk-bundle/build/core/setup-app.mk:82: Android NDK: Support for these ABIs will be removed in a future NDK release.    
make: Nothing to be done for `ssl'.
make: Nothing to be done for `crypto'.
make: Leaving directory `/Users/user/Desktop/CurlPrj/curl-android-ios/curl-compile-scripts'
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... (assumed no)
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for arm-linux-androideabi-gcc... /Users/user/Library/Android/sdk/ndk-bundle/prebuilt/darwin-x86_64/bin/../../../toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc
checking whether the C compiler works... no
configure: error: in `/Users/user/Desktop/CurlPrj/curl-android-ios/curl':
configure: error: C compiler cannot create executables
See `config.log' for more details
Error running the configure program
sonyyt commented 6 years ago

I experienced the same problem with ShawnnSnow....the same error log.

gustavogenovese commented 6 years ago

It should be working with the last commit