Compiling Libsocket scripts for Android

Source: Internet
Author: User

#!/bin/bashu32=0 #编译64位arm时 u32=0 When compiling 32-bit arm u32=1 other parameters do not need to be changed target=android-24host=darwin-x86_64tool= Aarch64-linux-android #arm-linux-androideabi aarch64-linux-android
arch=arch-arm64 #arch-arm arch-arm64if [$U 32-ne 0]; Then echo "32-bit Arm" Tool=arm-linux-androideabi arch=arch-armfitoolchain= $TOOL-4.9
Export Ndk_root=/users/musictom/library/android/sdk/ndk-bundle/export sysroot= "$NDK _root/platforms/$TARGET/$ARCH "Export cppflags="-i$ndk_root/platforms/$TARGET/$ARCH/usr/include-i$ndk_root/toolchains/$TOOLCHAIN/prebuilt/$ Host/user/include "Export ldflags="-l$ndk_root/platforms/$TARGET/$ARCH/usr/lib--sysroot= $SYSROOT "
Rm-f *.so *.o$ndk_root/toolchains/$TOOLCHAIN/prebuilt/$HOST/bin/$TOOL-gcc-wall-fpic-o2-c. /c/inet/libinetsocket.c $CPPFLAGS $ndk_root/toolchains/$TOOLCHAIN/prebuilt/$HOST/bin/$TOOL-gcc-wall-fpic-o2-c. /c/unix/libunixsocket.c $CPPFLAGS $ndk_root/toolchains/$TOOLCHAIN/prebuilt/$HOST/bin/$TOOL-gcc-shared-o libsocket.so LIBINETSOCKET.O LIBUNIXSOCKET.O $LDFLAGSrm-F *.O
CP *.so $NDK _root/toolchains/$TOOLCHAIN/prebuilt/$HOST/user/lib/mkdir $NDK _root/toolchains/$TOOLCHAIN/prebuilt/$ Host/user/include/socketcp. /HEADERS/*.HPP $NDK _root/toolchains/$TOOLCHAIN/prebuilt/$HOST/user/include/socket/cp. /headers/*.h $NDK _root/toolchains/$TOOLCHAIN/prebuilt/$HOST/user/include/socket/

Reference https://github.com/gcesarmza/curl-android-ios/blob/master/curl-compile-scripts/build_Android.sh

Compiling Libsocket scripts for Android

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.