[Android] [PATCH 1/6] contrib: Support other Android architectures than ARM

Rafaël Carré funman at videolan.org
Tue Jul 17 18:55:13 CEST 2012


Le 2012-07-15 22:28, Edward Wang a écrit :
> ---
>  contrib/bootstrap    |   17 +++++++++++++++--
>  contrib/src/main.mak |    4 ++--
>  2 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/contrib/bootstrap b/contrib/bootstrap
> index 35866aa..4eb558f 100755
> --- a/contrib/bootstrap
> +++ b/contrib/bootstrap
> @@ -216,10 +216,23 @@ case "${OS}" in
>  	*bsd*)
>  		add_make_enabled "HAVE_BSD"
>  		;;
> -	linux-androideabi)
> +	*android*)
>  		check_android_sdk
>  		add_make_enabled "HAVE_LINUX" "HAVE_ANDROID"
> -		add_make "PATH = ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:${PATH}"
> +		case "${HOST}" in
> +			*arm*)
> +			add_make "PATH = ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:${PATH}"
> +			add_make "PLATFORM_SHORT_ARCH := arm"
> +			;;
> +			*i686*)
> +			add_make "PATH = ${ANDROID_NDK}/toolchains/x86-4.4.3/prebuilt/linux-x86/bin/:${PATH}"
> +			add_make "PLATFORM_SHORT_ARCH := x86"
> +			;;
> +			*mipsel*)
> +			add_make "PATH = ${ANDROID_NDK}/toolchains/mipsel-linux-android-4.4.3/prebuilt/linux-x86/bin/:${PATH}"
> +			add_make "PLATFORM_SHORT_ARCH := mips"
> +			;;
> +		esac
>  		;;
>  	*linux*)
>  		add_make_enabled "HAVE_LINUX"
> diff --git a/contrib/src/main.mak b/contrib/src/main.mak
> index 4c4d974..f750970 100644
> --- a/contrib/src/main.mak
> +++ b/contrib/src/main.mak
> @@ -100,8 +100,8 @@ endif
>  endif
>  
>  ifdef HAVE_ANDROID
> -CC :=  $(HOST)-gcc --sysroot=$(ANDROID_NDK)/platforms/android-9/arch-arm
> -CXX := $(HOST)-g++ --sysroot=$(ANDROID_NDK)/platforms/android-9/arch-arm
> +CC :=  $(HOST)-gcc --sysroot=$(ANDROID_NDK)/platforms/android-9/arch-$(PLATFORM_SHORT_ARCH)
> +CXX := $(HOST)-g++ --sysroot=$(ANDROID_NDK)/platforms/android-9/arch-$(PLATFORM_SHORT_ARCH)
>  EXTRA_CFLAGS += -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/include
>  EXTRA_CFLAGS += -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/$(ANDROID_ABI)/include
>  endif
> 

lgtm, except the possible confusion between PLATFORM_SHORT_ARCH and
_TAG.. although perhaps ANDROID_ARCH is a better name perhaps ?


More information about the Android mailing list