[vlc-devel] [vlc-commits] contrib: set android specifics

Rémi Denis-Courmont remi at remlab.net
Sun Nov 27 10:11:18 CET 2011


Le dimanche 27 novembre 2011 10:57:06 Rafaël Carré, vous avez écrit :
> vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sun Nov 27
> 03:56:20 2011 -0500| [a8fe060f3f5e17af2aa7b7bafb599b80e4a3181f] |
> committer: Rafaël Carré
> 
> contrib: set android specifics
> 
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a8fe060f3f5e17af2a
> > a7b7bafb599b80e4a3181f
> 
> ---
> 
>  contrib/bootstrap    |   11 +++++++++++
>  contrib/src/main.mak |   17 +++++++++++++++++
>  2 files changed, 28 insertions(+), 0 deletions(-)
> 
> diff --git a/contrib/bootstrap b/contrib/bootstrap
> index 647a600..170b8f1 100755
> --- a/contrib/bootstrap
> +++ b/contrib/bootstrap
> @@ -151,6 +151,13 @@ check_macosx_sdk()
>     add_make "OSX_VERSION ?= ${OSX_VERSION}"
>  }
> 
> +check_android_sdk()
> +{
> +	[ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment
> variable" && exit 1

Maybe it's just me, but && && && && looks so ugly compared to if then else fi.

And errors go to >&2.

> +	add_make "ANDROID_NDK := ${ANDROID_NDK}"
> +	test -z "${NO_NEON}" && add_make_enabled "HAVE_NEON"

I really do not care about Android but I don't know where you guys are hoping 
to go with that. Users cannot be relied on to know if their device supports 
NEONv1, can they? Run-time detection is the only viable choice IMHO.

> +}

> +
>  test -z "$PREFIX" || add_make "PREFIX := $PREFIX"
>  test -z "$BUILD_DISCS" || add_make_enabled "BUILD_DISCS"
>  test -z "$BUILD_ENCODERS" || add_make_enabled "BUILD_ENCODERS"
> @@ -170,6 +177,10 @@ case "${OS}" in
>  	*bsd*)
>  		add_make_enabled "HAVE_BSD"
>  		;;
> +	linux-androideabi)
> +		check_android_sdk
> +		add_make_enabled "HAVE_LINUX" "HAVE_ANDROID"
> +		;;
>  	*linux*)
>  		add_make_enabled "HAVE_LINUX"
>  		;;
> diff --git a/contrib/src/main.mak b/contrib/src/main.mak
> index 2e69863..5ec18ee 100644
> --- a/contrib/src/main.mak
> +++ b/contrib/src/main.mak
> @@ -92,6 +92,23 @@ STRIP := $(HOST)-strip
>  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

Not that I care either but this will fail miserably for non-ARM Android ports.

> +
> +# Kludge for C++ prebuilt compiler
> +EXTRA_CFLAGS += -D__STDC_VERSION__=199901L
> +EXTRA_CFLAGS += -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/include
> +ifdef HAVE_NEON
> +    EXTRA_CFLAGS +=
> -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include
> +else
> +    EXTRA_CFLAGS +=
> -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include +endif
> +
> +# Change HOST to not confuse autotools
> +HOST=arm-eabi
> +endif
> +

This smells like missing autoreconf invocations to me (or missing overwrite of 
config.sub and config.guess, the Debian way).

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list