I am facing the following issue when trying to compile a c program using openssl for android x-86. I set up the environment variables as follows using the following script:
After running the script I have the following environment.
./setenv-android_x86.sh find: /dev/fd/3: Not a directory find: /dev/fd/4: Not a directory Error: FIPS_SIG does not specify incore module. Please edit this script. ANDROID_NDK_ROOT: /opt/android-ndk-r9d-x86 ANDROID_ARCH: arch-x86 ANDROID_EABI: x86-4.6 ANDROID_API: android-18 ANDROID_SYSROOT: /opt/android-ndk-r9d-x86/platforms/android-18/arch-x86 ANDROID_TOOLCHAIN: /opt/android-ndk-r9d-x86/toolchains/x86-4.6/prebuilt/darwin-x86_64/bin FIPS_SIG: CROSS_COMPILE: i686-linux-android- ANDROID_DEV: /opt/android-ndk-r9d-x86/platforms/android-18/arch-x86/usr
However when trying to compile with the following command I get the following error:
pwd /opt/android-ndk-r9d-x86/bin
./i686-linux-android-gcc Test.c -o test -lcrypto
fatal error: openssl/conf.h: No such file or directory
When I locate for the openssl/conf.h I see the file is available in many places:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/openssl/conf.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/openssl/conf.h /data/local/arm/ssl/include/openssl/conf.h /data/local/ssl/include/openssl/conf.h /openssl/include/openssl/conf.h /openssl-1.0.1e/include/openssl/conf.h /openssl-1.0.1g/include/openssl/conf.h /opt/local/include/openssl/conf.h /usr/include/openssl/conf.h /usr/local/include/openssl/conf.h /usr/local/ssl/android-14/include/openssl/conf.h /usr/local/ssl/android-18/include/openssl/conf.h
/usr/local/ssl/android-18-x86/include/openssl/conf.h /usr/local/ssl/include/openssl/conf.h
I think the proper path is this:
/usr/local/ssl/android-18-x86/include/openssl/conf.h
I tried with the -L option but with no luck.
-L/usr/local/ssl/android-18-x86/include/
Can anybody please explain how to setup the path properly to solve this issue. (finally there is no issue with the C code as it compiles properly with gcc)