https://github.com/aluvalasuman/openssl1.0.1g-android

http://stackoverflow.com/questions/7827836/build-openssl-with-just-rsa-and-aes


./Configure android shared no-des no-rc2 no-rc4 no-rc5 no-md2 no-md4 no-ripemd no-mdc2 no-dsa no-dh no-ec no-ecdsa no-ecdh no-ssl2 no-ssl3 no-idea no-err no-krb5 no-engine no-hw no-camellia no-seed no-bf no-cast no-sock no-ssl no-srtp no-tlsext no-cms no-jpake no-capieng --prefix=`pwd`/android/libs/armeabi --openssldir=openssl





# Don't forget to adjust this to your NDK path
export ANDROID_NDK=~/Documents/Develop/android/android-ndk-r9d

export NDK=${ANDROID_NDK}

export TOOLCHAIN_INSTALL_DIR=`pwd`/../android/android-toolchain-arm

$NDK/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=arm-linux-androideabi-4.8 --install-dir=$TOOLCHAIN_INSTALL_DIR
export TOOLCHAIN_PATH=$TOOLCHAIN_INSTALL_DIR/bin
export TOOL=arm-linux-androideabi
export NDK_TOOLCHAIN_BASENAME=${TOOLCHAIN_PATH}/${TOOL}
export CC=$NDK_TOOLCHAIN_BASENAME-gcc
export CXX=$NDK_TOOLCHAIN_BASENAME-g++
export CPP=${NDK_TOOLCHAIN_BASENAME}-cpp
export LINK=${CXX}
export LD=$NDK_TOOLCHAIN_BASENAME-ld
export AR=$NDK_TOOLCHAIN_BASENAME-ar
export AS=${NDK_TOOLCHAIN_BASENAME}-as
export RANLIB=$NDK_TOOLCHAIN_BASENAME-ranlib
export STRIP=$NDK_TOOLCHAIN_BASENAME-strip
export NM=${NDK_TOOLCHAIN_BASENAME}-nm
export OBJDUMP=${NDK_TOOLCHAIN_BASENAME}-objdump
export ARCH_FLAGS="-mthumb"
export ARCH_LINK=
export CPPFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 "
export CXXFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -frtti -fexceptions "
export CFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 "
export LDFLAGS=" ${ARCH_LINK} "

./Configure android shared no-des no-rc2 no-rc4 no-rc5 no-md2 no-md4 no-ripemd no-mdc2 no-dsa no-dh no-ec no-ecdsa no-ecdh no-ssl2 no-ssl3 no-idea no-err no-krb5 no-engine no-hw no-camellia no-seed no-bf no-cast no-srtp no-cms no-jpake no-capieng --prefix=`pwd`/android/libs/armeabi --openssldir=openssl
make
make install

#no-sock no-ssl no-tlsext 

# Don't forget to adjust this to your NDK path
export ANDROID_NDK=~/Documents/Develop/android/android-ndk-r9d

export NDK=${ANDROID_NDK}

export TOOLCHAIN_INSTALL_DIR=`pwd`/../android/android-toolchain-armv7

$NDK/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=arm-linux-androideabi-4.8 --install-dir=$TOOLCHAIN_INSTALL_DIR
export TOOLCHAIN_PATH=$TOOLCHAIN_INSTALL_DIR/bin
export TOOL=arm-linux-androideabi
export NDK_TOOLCHAIN_BASENAME=${TOOLCHAIN_PATH}/${TOOL}
export CC=$NDK_TOOLCHAIN_BASENAME-gcc
export CXX=$NDK_TOOLCHAIN_BASENAME-g++
export CPP=${NDK_TOOLCHAIN_BASENAME}-cpp
export LINK=${CXX}
export LD=$NDK_TOOLCHAIN_BASENAME-ld
export AR=$NDK_TOOLCHAIN_BASENAME-ar
export AS=${NDK_TOOLCHAIN_BASENAME}-as
export RANLIB=$NDK_TOOLCHAIN_BASENAME-ranlib
export STRIP=$NDK_TOOLCHAIN_BASENAME-strip
export NM=${NDK_TOOLCHAIN_BASENAME}-nm
export OBJDUMP=${NDK_TOOLCHAIN_BASENAME}-objdump
export ARCH_FLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16"
export ARCH_LINK="-march=armv7-a -Wl,--fix-cortex-a8"
export CPPFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 "
export CXXFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -frtti -fexceptions "
export CFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 "
export LDFLAGS=" ${ARCH_LINK} "


./Configure android shared no-des no-rc2 no-rc4 no-rc5 no-md2 no-md4 no-ripemd no-mdc2 no-dsa no-dh no-ec no-ecdsa no-ecdh no-ssl2 no-ssl3 no-idea no-err no-krb5 no-engine no-hw no-camellia no-seed no-bf no-cast no-srtp no-cms no-jpake no-capieng --prefix=`pwd`/android/libs/armeabi-v7a --openssldir=openssl
make
make install

# Don't forget to adjust this to your NDK path
export ANDROID_NDK=~/Documents/Develop/android/android-ndk-r9d

export NDK=${ANDROID_NDK}

export TOOLCHAIN_INSTALL_DIR=`pwd`/../android/android-toolchain-x86

$NDK/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=x86-4.8 --install-dir=$TOOLCHAIN_INSTALL_DIR

export TOOLCHAIN_PATH=$TOOLCHAIN_INSTALL_DIR/bin
export TOOL=i686-linux-android
export NDK_TOOLCHAIN_BASENAME=${TOOLCHAIN_PATH}/${TOOL}
export CC=$NDK_TOOLCHAIN_BASENAME-gcc
export CXX=$NDK_TOOLCHAIN_BASENAME-g++
export CPP=${NDK_TOOLCHAIN_BASENAME}-cpp
export LINK=${CXX}
export LD=$NDK_TOOLCHAIN_BASENAME-ld
export AR=$NDK_TOOLCHAIN_BASENAME-ar
export AS=${NDK_TOOLCHAIN_BASENAME}-as
export RANLIB=$NDK_TOOLCHAIN_BASENAME-ranlib
export STRIP=$NDK_TOOLCHAIN_BASENAME-strip
export NM=${NDK_TOOLCHAIN_BASENAME}-nm
export OBJDUMP=${NDK_TOOLCHAIN_BASENAME}-objdump
export ARCH_FLAGS="-march=i686 -msse3 -mstackrealign -mfpmath=sse"
export ARCH_LINK=
export CPPFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 "
export CXXFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -frtti -fexceptions "
export CFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 "
export LDFLAGS=" ${ARCH_LINK} "


./Configure android shared no-des no-rc2 no-rc4 no-rc5 no-md2 no-md4 no-ripemd no-mdc2 no-dsa no-dh no-ec no-ecdsa no-ecdh no-ssl2 no-ssl3 no-idea no-err no-krb5 no-engine no-hw no-camellia no-seed no-bf no-cast no-srtp no-cms no-jpake no-capieng --prefix=`pwd`/android/libs/x86 --openssldir=openssl
make
make install


Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐