Where can I find file GNUmakefile-android.patch which there is mentioned?
The downloads are at the bottom of the page.
Now my GNUmakefile looks like this:
> # Set in the environment
> ifeq ($(IS_CROSS_COMPILE),1)
> ISX86=0
> IS_LINUX=0
> IS_MINGW=0
> IS_DARWIN=0
> UNAME=CrossCompile
> endif
This unsets the "host" flags used by the Makefile. Otherwise, Crypto++ will set CXXFLAGS
for the host (i.e, your Desktop computer), and not the target (i.e., your Android device).
Next you need the CXXFLAGS
for the target. From the same tutorial:
ifeq ($(IS_ANDROID),1)
CPP=arm-linux-androideabi-cpp
CXX=arm-linux-androideabi-g++
AR=arm-linux-androideabi-ar
RANLIB=arm-linux-androideabi-ranlib
LD=arm-linux-androideabi-ld
CXXFLAGS += -fPIC -DCRYPTOPP_DISABLE_ASM --sysroot=$(ANDROID_SYSROOT) -I$(ANDROID_STL_INC)
LDLIBS += $(ANDROID_STL_LIB)
endif
There's also a couple of one/two liners to ensure some Android specific includes are found.
The last question should be: where is IS_CROSS_COMPILE
, IS_ANDROID
, ANDROID_SYSROOT
and friends set? The answer is in setenv-android.sh
.
The download for setenv-android.sh
is at the bottom of the page, too.
When I execute command 'make static dynamic cryptest.exe' I get this error:
g++ -DNDEBUG -g -O2 -march=native -DCRYPTOPP_DISABLE_ASM -pipe -c shacal2.cpp
You did not run setenv-android.sh
. As the tutorial states, the compiler command that you should see:
arm-linux-androideabi-g++ -DNDEBUG -g -O2 -DCRYPTOPP_DISABLE_ASM -pipe -fPIC
--sysroot=/opt/android-ndk-r9/platforms/android-14/arch-arm -I/opt/android-ndk-r9/sources/
cxx-stl/stlport/stlport/ -c 3way.cpp
...
I am using cygwin to compile this.
The tutorial was written against the Android NDK. The procedures and scripts were tested on Linux and Mac OS X.
The NDK should work with Cygwin; and Crypto++ should work with Cygwin. However, the combination of Android and Cygwin on Windows was never tested, and the Makefile might need more tuning. I just don't know because its was never tested.
Can you set up a Linux virtual machine in Windows? It might be easier to complete the process.
When I execute command 'make static dynamic cryptest.exe'...
For completeness, cryptest.exe
will fail if its executed on the host computer. You should push cryptest.exe
to the device via adb
(along with the test vectors), and then execute it on the device. I think the tutorial covers that too.