Coder Social home page Coder Social logo

abaelhe / android-platform-ndk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crystax/android-platform-ndk

0.0 1.0 0.0 33.33 MB

CrystaX NDK - Native Development Kit for Android

Home Page: https://www.crystax.net/android/ndk

Makefile 7.56% Awk 0.25% HTML 0.14% Shell 7.97% Python 1.24% Groff 0.92% C++ 56.98% Ruby 1.80% Batchfile 0.16% CMake 0.37% C 19.82% Objective-C 0.07% Assembly 0.13% GDB 0.01% M4 0.52% TeX 1.12% DIGITAL Command Language 0.02% Perl 0.87% Yacc 0.07% Objective-C++ 0.01%

android-platform-ndk's Introduction

Android Native Development Kit (NDK)

The latest version of this document is available at https://android.googlesource.com/platform/ndk/+/master/README.md.

Note: This document is for developers of the NDK, not developers that use the NDK.

The NDK allows Android application developers to include native code in their Android application packages, compiled as JNI shared libraries.

Other Resources

This doc gives a high level overview of the NDK's build, packaging, and test process. For other use cases, or more in depth documentation, refer to the following sources:

Building the NDK

Both Linux and Windows host binaries are built on Linux machines. Windows host binaries are built via MinGW cross compiler. Systems without a working MinGW compiler can use build/tools/build-mingw64-toolchain.sh to generate their own and be added to the PATH for build scripts to discover.

Building binaries for Mac OS X requires at least 10.8.

Target headers and binaries are built on Linux.

Components

The NDK consists of three parts: host binaries, target prebuilts, and others (build system, docs, samples, tests).

Host Binaries

  • toolchains/ contains GCC and Clang toolchains.
    • $TOOLCHAIN/config.mk contains ARCH and ABIS this toolchain can handle.
    • $TOOLCHAIN/setup.mk contains toolchain-specific default CFLAGS/LDFLAGS when this toolchain is used.
  • prebuilt/$HOST_TAG contains build dependencies and additional tools.
    • make, awk, python, yasm, and for Windows: cmp.exe and echo.exe
    • ndk-depends, ndk-stack and ndk-gdb can also be found here.

Target Headers and Binaries

  • platforms/android-$VERSION/arch-$ARCH_NAME/ contains headers and libraries for each API level.
    • The build system sets --sysroot to one of these directories based on user-specified APP_ABI and APP_PLATFORM.
  • sources/cxx-stl/$STL contains the headers and libraries for the various C++ STLs.
  • prebuilt/android-$ARCH/gdbserver contains gdbserver.

Others

  • build/ contains the ndk-build system and scripts to rebuild NDK.
  • sources/android and sources/third_party contain modules that can be used in apps (cpufeatures, native_app_glue, etc) via $(call import-module, $MODULE)
  • tests/

Prerequisites

  • AOSP NDK Repository

    • Check out the branch master-ndk

      repo init -u https://android.googlesource.com/platform/manifest \
          -b master-ndk
      
      # Googlers, use
      repo init -u \
          persistent-https://android.git.corp.google.com/platform/manifest \
          -b master-ndk
  • Additional Linux Dependencies (available from apt):

    • bison
    • flex
    • libtool
    • mingw-w64
    • pbzip2 (optional, improves packaging times)
    • texinfo
    • python3 (used for Vulkan validation layer generation)
    • python-lxml (used for Vulkan validation layer generation)
  • Mac OS X also requires Xcode.

Host/Target prebuilts

For Linux or Darwin:

$ python checkbuild.py

For Windows, from Linux:

$ python checkbuild.py --system windows  # Or windows64.

checkbuild.py also accepts a variety of other options to speed up local builds, namely --arch and --module.

Packaging

By default, checkbuild.py will also package the NDK and run basic tests. To skip the packaging step, use the --no-package flag. Note that running the tests does require the packaging step.

If you need to re-run just the packaging step without going through a build, packaging is handled by build/tools/package.py.

Testing

Testing is discussed in Testing.md.

android-platform-ndk's People

Contributors

billnapier avatar brettchabot avatar capachino avatar courtney-g avatar danalbert avatar ddougherty avatar digit-android avatar dimitry- avatar dmsck avatar drwulf avatar egnor avatar egor-kochetov-intel avatar enh-google avatar fadden avatar fredquintana avatar gkasten avatar jackpal avatar jmgao avatar loganchien avatar marcone avatar mdhorn avatar mingwandroid avatar mritter-g avatar mstorsjo avatar pixelflinger avatar reed-at-google avatar scottamain avatar tommynnguyen avatar vmurashev avatar zuav avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.