[vlc-devel] [PATCH v2 7/9] android: fix nanf detection

Thomas Guillem tom at gllm.fr
Fri Oct 10 12:01:47 CEST 2014


This patch break android build for android/x86:
http://buildbot.videolan.org/builders/android-bin-x86/builds/391/steps/Build/logs/stdio.

On NDK, libm.so from android-9/x86 has nanf symbol but not the others
archs for the same api.
The problem is that nanf is not present in headers for all archs.

I tested on an Intel device: libm.so has nanf symbol, but it's risky to
assume all intel devices as nanf.

I can force #undef HAVE_NANF for android and x86, but I'm feeling tired
of all theses hacks...

On Thu, Oct 9, 2014, at 19:08, Rémi Denis-Courmont wrote:
> Le jeudi 9 octobre 2014, 18:45:25 Thomas Guillem a écrit :
> > ---
> >  configure.ac         | 6 ++++++
> >  include/vlc_fixups.h | 2 +-
> >  2 files changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 2b13d5b..1958a8f 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -696,6 +696,12 @@ AC_CHECK_LIB(m,lrintf, [
> >    AC_DEFINE(HAVE_LRINTF, 1, [Define to 1 if you have the lrintf function])
> >    VLC_ADD_LIBS([skins2],[-lm])
> >  ])
> > +AC_CHECK_FUNC(nanf, , [
> > +  AC_CHECK_LIB(m, nanf, [
> > +    AC_DEFINE(HAVE_NANF, 1, [Define to 1 if you have the NANF function])
> > +    VLC_ADD_LIBS([libvlccore],[-lm])
> 
> I know cargo cult is a popular religion among programmers, but I would
> prefer 
> if the VLC code base remained agnostic. (*)
> 
> > +  ])
> > +])
> > 
> >  dnl Check for dynamic plugins
> >  LIBDL=""
> > diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
> > index a4b9b2d..e515763 100644
> > --- a/include/vlc_fixups.h
> > +++ b/include/vlc_fixups.h
> > @@ -353,7 +353,7 @@ long nrand48 (unsigned short subi[3]);
> > 
> >  /* math.h */
> > 
> > -#ifdef __ANDROID__
> > +#ifndef HAVE_NANF
> >  #define nanf(tagp) NAN
> >  #endif
> 
> (*) Please remove useless stuff.
> 
> -- 
> Rémi Denis-Courmont
> http://www.remlab.net/
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list