diff options
author | Chris Koying Browet <cbro@semperpax.com> | 2016-07-08 10:17:34 +0200 |
---|---|---|
committer | Chris "Koying" Browet <cbro@semperpax.com> | 2017-08-13 11:42:17 +0200 |
commit | e6c79d3beeb4eedf638a475af023839a332b399f (patch) | |
tree | 2cb0cf4098291332fe0cef9964964930c2b5e23e /tools | |
parent | a9ea915e652eab1852e6f7e66f8ec73be0c01112 (diff) |
CHG: [droid] split SDK and NDK api level. They are unrelated
Use the NDK level for everything native paths related. SDK level is irrelevant.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/buildsteps/android-arm64-v8a/configure-depends | 5 | ||||
-rw-r--r-- | tools/buildsteps/android/configure-depends | 5 | ||||
-rw-r--r-- | tools/buildsteps/androidx86/configure-depends | 5 | ||||
-rw-r--r-- | tools/buildsteps/defaultenv | 7 | ||||
-rw-r--r-- | tools/depends/Makefile.include.in | 3 | ||||
-rw-r--r-- | tools/depends/configure.ac | 43 | ||||
-rw-r--r-- | tools/depends/target/Toolchain.cmake.in | 2 |
7 files changed, 45 insertions, 25 deletions
diff --git a/tools/buildsteps/android-arm64-v8a/configure-depends b/tools/buildsteps/android-arm64-v8a/configure-depends index 705bc53349..95ec12cb22 100644 --- a/tools/buildsteps/android-arm64-v8a/configure-depends +++ b/tools/buildsteps/android-arm64-v8a/configure-depends @@ -5,7 +5,7 @@ XBMC_PLATFORM_DIR=android NDK_ARCH=aarch64 #the following paths must exist on the slave and use the defined scheme here! NDK_PATH=$ANDROID_DEV_ROOT/android-ndk-r$NDK_VERSION -TOOLCHAIN=$ANDROID_DEV_ROOT/android-toolchain-$NDK_ARCH-$SDK_VERSION-r$NDK_VERSION +TOOLCHAIN=$ANDROID_DEV_ROOT/android-toolchain-$NDK_ARCH-$NDK_API-r$NDK_VERSION if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then @@ -13,8 +13,9 @@ then --with-tarballs=$TARBALLS \ --host=aarch64-linux-android \ --with-sdk-path=$SDK_PATH \ - --with-ndk=$NDK_PATH \ + --with-ndk-path=$NDK_PATH \ $(if [ "$SDK_VERSION" != "Default" ]; then echo --with-sdk=android-$SDK_VERSION;fi) \ + $(if [ "$NDK_API" != "Default" ]; then echo --with-ndk=$NDK_API;fi) \ --with-toolchain=$TOOLCHAIN \ --prefix=$XBMC_DEPENDS_ROOT \ --enable-neon $DEBUG_SWITCH diff --git a/tools/buildsteps/android/configure-depends b/tools/buildsteps/android/configure-depends index edcfbc7032..81f03a0e10 100644 --- a/tools/buildsteps/android/configure-depends +++ b/tools/buildsteps/android/configure-depends @@ -5,7 +5,7 @@ XBMC_PLATFORM_DIR=android NDK_ARCH="arm" #the following paths must exist on the slave and use the defined scheme here! NDK_PATH=$ANDROID_DEV_ROOT/android-ndk-r$NDK_VERSION -TOOLCHAIN=$ANDROID_DEV_ROOT/android-toolchain-$NDK_ARCH-$SDK_VERSION-r$NDK_VERSION +TOOLCHAIN=$ANDROID_DEV_ROOT/android-toolchain-$NDK_ARCH-$NDK_API-r$NDK_VERSION if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then @@ -13,8 +13,9 @@ then --with-tarballs=$TARBALLS \ --host=arm-linux-androideabi \ --with-sdk-path=$SDK_PATH \ - --with-ndk=$NDK_PATH \ + --with-ndk-path=$NDK_PATH \ $(if [ "$SDK_VERSION" != "Default" ]; then echo --with-sdk=android-$SDK_VERSION;fi) \ + $(if [ "$NDK_API" != "Default" ]; then echo --with-ndk=$NDK_API;fi) \ --with-toolchain=$TOOLCHAIN \ --prefix=$XBMC_DEPENDS_ROOT \ --enable-neon $DEBUG_SWITCH diff --git a/tools/buildsteps/androidx86/configure-depends b/tools/buildsteps/androidx86/configure-depends index 9a6e31ceed..92baf59dd3 100644 --- a/tools/buildsteps/androidx86/configure-depends +++ b/tools/buildsteps/androidx86/configure-depends @@ -5,7 +5,7 @@ XBMC_PLATFORM_DIR=android NDK_ARCH=x86 #the following paths must exist on the slave and use the defined scheme here! NDK_PATH=$ANDROID_DEV_ROOT/android-ndk-r$NDK_VERSION -TOOLCHAIN=$ANDROID_DEV_ROOT/android-toolchain-$NDK_ARCH-$SDK_VERSION-r$NDK_VERSION +TOOLCHAIN=$ANDROID_DEV_ROOT/android-toolchain-$NDK_ARCH-$NDK_API-r$NDK_VERSION if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then @@ -13,8 +13,9 @@ then --with-tarballs=$TARBALLS \ --host=i686-linux-android \ --with-sdk-path=$SDK_PATH \ - --with-ndk=$NDK_PATH \ + --with-ndk-path=$NDK_PATH \ $(if [ "$SDK_VERSION" != "Default" ]; then echo --with-sdk=android-$SDK_VERSION;fi) \ + $(if [ "$NDK_API" != "Default" ]; then echo --with-ndk=$NDK_API;fi) \ --with-toolchain=$TOOLCHAIN \ --prefix=$XBMC_DEPENDS_ROOT $DEBUG_SWITCH fi diff --git a/tools/buildsteps/defaultenv b/tools/buildsteps/defaultenv index 39e66ae3c0..68737e6517 100644 --- a/tools/buildsteps/defaultenv +++ b/tools/buildsteps/defaultenv @@ -1,6 +1,7 @@ BUILDTHREADS=${BUILDTHREADS:-1} SDK_VERSION=${SDK_VERSION:-"Default"} NDK_VERSION=${NDK_VERSION:-"Default"} +NDK_API=${NDK_API:-"Default"} Configuration=${Configuration:-"Default"} XBMC_DEPENDS_ROOT=${XBMC_DEPENDS_ROOT:-"Default"} DARWIN_ARM_CPU=${DARWIN_ARM_CPU:-"Default"} @@ -35,6 +36,7 @@ case $XBMC_PLATFORM_DIR in android) DEFAULT_SDK_VERSION="21" DEFAULT_NDK_VERSION="14b" + DEFAULT_NDK_API="21" DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends DEFAULT_CONFIGURATION="Debug" ;; @@ -61,6 +63,11 @@ then NDK_VERSION=$DEFAULT_NDK_VERSION fi +if [ "$NDK_API" == "Default" ] +then + NDK_API=$DEFAULT_NDK_API +fi + if [ "$XBMC_DEPENDS_ROOT" == "Default" ] then XBMC_DEPENDS_ROOT=$DEFAULT_XBMC_DEPENDS_ROOT diff --git a/tools/depends/Makefile.include.in b/tools/depends/Makefile.include.in index a35cc85c71..41a7fa869d 100644 --- a/tools/depends/Makefile.include.in +++ b/tools/depends/Makefile.include.in @@ -2,7 +2,7 @@ abs_top_srcdir=@abs_top_srcdir@ DEBUG_BUILD=@use_debug@ TOOLCHAIN=@use_toolchain@ -NDKROOT=@use_ndk@ +NDKROOT=@use_ndk_path@ SDKROOT=@use_sdk_path@ CMAKE_SOURCE_DIR=$(abspath $(abs_top_srcdir)/../../) TARBALLS_LOCATION=@use_tarballs@ @@ -11,6 +11,7 @@ HOST=@use_host@ CPU=@use_cpu@ NATIVEPLATFORM=@build_cpu@-@build_os@-native SDK_PLATFORM=@use_sdk@ +NDK_LEVEL=@use_ndk_api@ RETRIEVE_TOOL=@CURL@ ARCHIVE_TOOL=@TAR@ PREFIX=@prefix@/@deps_dir@ diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac index 21b8edb088..317c7f754a 100644 --- a/tools/depends/configure.ac +++ b/tools/depends/configure.ac @@ -68,10 +68,10 @@ AC_ARG_WITH([cpu], [optional. specify target cpu. guessed if not specified])], [use_cpu=$withval],use_cpu=auto) -AC_ARG_WITH([ndk], - [AS_HELP_STRING([--with-ndk], +AC_ARG_WITH([ndk-path], + [AS_HELP_STRING([--with-ndk-path], [specify path to ndk (required for android only)])], - [use_ndk=$withval]) + [use_ndk_path=$withval]) AC_ARG_WITH([sdk-path], [AS_HELP_STRING([--with-sdk-path], @@ -83,6 +83,11 @@ AC_ARG_WITH([sdk], [specify sdk platform version (optional for android). default is android-21])], [use_sdk=$withval]) +AC_ARG_WITH([ndk-api], + [AS_HELP_STRING([--with-ndk-api], + [spcify ndk level (optional for android). default is 21])], + [use_ndk_api=$withval]) + AC_ARG_ENABLE([gplv3], [AS_HELP_STRING([--enable-gplv3], [enable gplv3 components. default is yes])], @@ -161,15 +166,16 @@ case $host in use_cpu="armeabi-v7a" fi use_sdk="${use_sdk:-android-21}" - deps_dir="$use_host-$use_sdk-$build_type" + use_ndk_api="${use_ndk_api:-21}" + deps_dir="$use_host-$use_ndk_api-$build_type" platform_cflags="-DANDROID -fexceptions -fPIC -DPIC -D_GLIBCXX_USE_C99_MATH_TR1" optimize_flags="-Os" if test "x$use_cpu" = "xarmeabi-v7a"; then platform_cflags+=" -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon" fi - platform_ldflags="-L$prefix/$deps_dir/lib/$use_sdk" + platform_ldflags="-L$prefix/$deps_dir/lib/android-$use_ndk_api" platform_cxxflags="$platform_cflags -frtti" - platform_includes="-I$prefix/$deps_dir/include/$use_sdk" + platform_includes="-I$prefix/$deps_dir/include/android-$use_ndk_api" platform_os="android" #android builds are always cross cross_compiling="yes" @@ -179,15 +185,16 @@ case $host in use_cpu="arm64-v8a" fi use_sdk="${use_sdk:-android-21}" - deps_dir="$use_host-$use_sdk-$build_type" + use_ndk_api="${use_ndk_api:-21}" + deps_dir="$use_host-$use_ndk_api-$build_type" platform_cflags="-DANDROID -fexceptions -fPIC -DPIC -D_GLIBCXX_USE_C99_MATH_TR1" optimize_flags="-Os" if test "x$use_cpu" = "xarm64-v8a"; then platform_cflags+=" -march=armv8-a -mtune=cortex-a53" fi - platform_ldflags="-L$prefix/$deps_dir/lib/$use_sdk" + platform_ldflags="-L$prefix/$deps_dir/lib/android-$use_ndk_api" platform_cxxflags="$platform_cflags -frtti" - platform_includes="-I$prefix/$deps_dir/include/$use_sdk" + platform_includes="-I$prefix/$deps_dir/include/android-$use_ndk_api" platform_os="android" #android builds are always cross cross_compiling="yes" @@ -197,12 +204,13 @@ case $host in use_cpu=$host_cpu fi use_sdk="${use_sdk:-android-21}" - deps_dir="$use_host-$use_sdk-$build_type" + use_ndk_api="${use_ndk_api:-21}" + deps_dir="$use_host-$use_ndk_api-$build_type" platform_cflags="-DANDROID -fexceptions -fPIC -DPIC -D_GLIBCXX_USE_C99_MATH_TR1" optimize_flags="-Os" - platform_ldflags="-L$prefix/$deps_dir/lib/$use_sdk" + platform_ldflags="-L$prefix/$deps_dir/lib/android-$use_ndk_api" platform_cxxflags="$platform_cflags -frtti" - platform_includes="-I$prefix/$deps_dir/include/$use_sdk" + platform_includes="-I$prefix/$deps_dir/include/android-$use_ndk_api" platform_os="android" #android builds are always cross cross_compiling="yes" @@ -524,12 +532,12 @@ if test -z $use_tarballs; then fi if test "$platform_os" == "android"; then - if test -z $use_ndk; then + if test -z $use_ndk_path; then AC_MSG_ERROR("NDK path is required for android") fi - if ([! test -f "$use_ndk/source.properties"] && [! test -f "$use_ndk/RELEASE.TXT"]) ; then - AC_MSG_ERROR("$use_ndk is not an NDK directory") + if ([! test -f "$use_ndk_path/source.properties"] && [! test -f "$use_ndk_path/RELEASE.TXT"]) ; then + AC_MSG_ERROR("$use_ndk_path is not an NDK directory") fi if test -z $use_sdk_path; then @@ -540,7 +548,7 @@ if test "$platform_os" == "android"; then AC_MSG_ERROR(verify sdk path) fi - if [ ! test -f $use_ndk/sources/android/native_app_glue/android_native_app_glue.h ]; then + if [ ! test -f $use_ndk_path/sources/android/native_app_glue/android_native_app_glue.h ]; then AC_MSG_ERROR(verify ndk path) fi @@ -639,8 +647,9 @@ fi if test "$platform_os" == "android"; then echo -e AC_SUBST(use_sdk_path) - AC_SUBST(use_ndk) + AC_SUBST(use_ndk_path) AC_SUBST(use_sdk) + AC_SUBST(use_ndk_api) AC_SUBST(build_tools_path) fi diff --git a/tools/depends/target/Toolchain.cmake.in b/tools/depends/target/Toolchain.cmake.in index 4aab3f55d5..8946094ae6 100644 --- a/tools/depends/target/Toolchain.cmake.in +++ b/tools/depends/target/Toolchain.cmake.in @@ -79,7 +79,7 @@ endif() # add Android directories and tools if(CORE_SYSTEM_NAME STREQUAL android) - set(NDKROOT @use_ndk@) + set(NDKROOT @use_ndk_path@) set(SDKROOT @use_sdk_path@) set(SDK_PLATFORM @use_sdk@) string(REPLACE ":" ";" SDK_BUILDTOOLS_PATH "@build_tools_path@") |