Closed hollychen503 closed 6 years ago
Aha, I known how to fix it.
Modify the /path/to/python-for-android/python-build/openssl/Makefile
Change the ANDROID_API to your NDK platform version. The default is android-4. It may not in your NDK anymore.
for example:
# setup arch depended variables: arm
$(OPENSSL_BIN_arm): export ANDROID_API := android-19
Same issue for me. Shouldn't that API version be pulled from some outside variable?
Please use NDK 10e. I try to build with NDK 13 and then 11, some problem with these NDK and can not solve it (I have no much time to solve them...)
I got a similar problem but in my case I got an error about "i686-linux-android-gcc" not being found.
On the first run: NDK_PATH=$HOME/Downloads/android-ndk-r10e make build
PYBINR=python CWD=/home/darkxdroid/Downloads/python-for-android/python-build make -C openssl build make[1]: Entering directory '/home/darkxdroid/Downloads/python-for-android/python-build/openssl' if ! wget \ wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz; \ then \ https://www.openssl.org/source/old/1.0.2/openssl-1.0.2j.tar.gz; \ fi --2017-03-15 15:30:59-- http://wget/ Resolving wget (wget)... failed: Name or service not known. wget: unable to resolve host address ‘wget’ --2017-03-15 15:30:59-- https://www.openssl.org/source/openssl-1.0.2j.tar.gz Resolving www.openssl.org (www.openssl.org)... 23.40.185.130, 2600:1403:1:286::c1e, 2600:1403:1:28d::c1e Connecting to www.openssl.org (www.openssl.org)|23.40.185.130|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 5307912 (5.1M) [application/x-gzip] Saving to: ‘openssl-1.0.2j.tar.gz’
openssl-1.0.2j.tar.gz 100%[=====================================================>] 5.06M 1.21MB/s in 4.7s
2017-03-15 15:31:05 (1.08 MB/s) - ‘openssl-1.0.2j.tar.gz’ saved [5307912/5307912]
FINISHED --2017-03-15 15:31:05-- Total wall clock time: 5.8s Downloaded: 1 files, 5.1M in 4.7s (1.08 MB/s) /bin/sh: 4: https://www.openssl.org/source/old/1.0.2/openssl-1.0.2j.tar.gz: not found Makefile:59: recipe for target 'openssl-1.0.2j.tar.gz' failed make[1]: [openssl-1.0.2j.tar.gz] Error 127 make[1]: Leaving directory '/home/darkxdroid/Downloads/python-for-android/python-build/openssl' Makefile:78: recipe for target '.build_openssl' failed make: [.build_openssl] Error 2
After fail I ran it again and get a different error:
Configured for android-x86.
Because of configuration changes, you MUST do the following before building:
make depend
make -C .build_x86/ depend make[2]: Entering directory '/home/darkxdroid/Downloads/python-for-android/python-build/openssl/.build_x86' making depend in crypto... make[3]: Entering directory '/home/darkxdroid/Downloads/python-for-android/python-build/openssl/.build_x86/crypto' ../util/domd: 26: ../util/domd: i686-linux-android-gcc: not found Makefile:136: recipe for target 'local_depend' failed make[3]: [local_depend] Error 1 make[3]: Leaving directory '/home/darkxdroid/Downloads/python-for-android/python-build/openssl/.build_x86/crypto' Makefile:475: recipe for target 'depend' failed make[2]: [depend] Error 1 make[2]: Leaving directory '/home/darkxdroid/Downloads/python-for-android/python-build/openssl/.build_x86' Makefile:106: recipe for target '.build_x86/libcrypto.so' failed make[1]: [.build_x86/libcrypto.so] Error 2 make[1]: Leaving directory '/home/darkxdroid/Downloads/python-for-android/python-build/openssl' Makefile:78: recipe for target '.build_openssl' failed make: [.build_openssl] Error 2
Thank you for your report. I success to build the openssl with a latest Makefile script.
Below are core code of compile for android-x86.
./showenv.sh
.apt install xutils-dev
for opensll.$(OPENSSL_BIN_x86): export ANDROID_API := android-9
$(OPENSSL_BIN_x86): \
export ANDROID_TOOLCHAIN=$(NDK_PATH)/toolchains/$(eabi_x86)/prebuilt/$(host)/bin
$(OPENSSL_BIN_x86): export PATH:=$(ANDROID_TOOLCHAIN):$(PATH)
$(OPENSSL_BIN_x86): export _ANDROID_ARCH=arch-x86
$(OPENSSL_BIN_x86): export _ANDROID_EABI=$(eabi_x86)
$(OPENSSL_BIN_x86): export MACHINE=i686
$(OPENSSL_BIN_x86): export ARCH=x86
$(OPENSSL_BIN_x86): PREFIX=$(CWD)/$(PYBINR)_$(ARCH)/$(PYBINR)
$(OPENSSL_BIN_x86): export CROSS_COMPILE="i686-linux-android-"
$(OPENSSL_BIN_x86): export PATH:=$(ANDROID_TOOLCHAIN):$(PATH)
$(OPENSSL_BIN_x86): \
export ANDROID_TOOLS="i686-linux-android-gcc arm-linux-androideabi-ranlib arm-linux-androideabi-ld"
$(OPENSSL_BIN_x86): .build_x86/Makefile
./showenv.sh
cd $(dir $<); perl $(perlopt) Makefile.org
cd $(dir $<); ./config $(__PIE_CFLAGS) shared no-ssl2 no-ssl3 no-comp no-hw no-engine \
--openssldir=$(PREFIX)/share --prefix=$(PREFIX)
make -C $(dir $<) depend
make -C $(dir $<) all
make -C $(dir $<) install_sw
I cloned the git repo! So i Suppose it's the last one and I did install the package. I used the ndkr10e... I managed to to build the first part involving the sdk but I stumble with that problem on the ndk part as you can see.
Using Linux Mint 18
The output of "showenv.sh" are empty variables
Sorry but can you tell me the path to the logs?
Build log: console output is all. please see my logs. >>> log.txt.zip
If you want to save the log, type the command to start build (in python3-alpha directory)::
$ NDK_PATH=~/install/android-ndk-r10e make .build_openssl 2>&1 | tee log.txt
The pre-build version got a negative number for os.path.getsize() with 4GB file. So I try to build my version to test. ( http://stackoverflow.com/questions/5167120/why-does-os-path-getsize-return-a-negative-number-for-a-10gb-file )
But I got a fatal error when building openssl
ubuntu 16.04 android-ndk-r13b
build command: