[vlc-devel] [PATCH] configure.ac disable/don't load avcapture module and its framework if AVFoundation is not present (OS 10.6)
Felix Paul Kühne
fkuehne.videolan at gmail.com
Fri Apr 19 14:43:50 CEST 2013
On 19.04.2013, at 14:19, Rémi Denis-Courmont <remi at remlab.net> wrote:
> On Fri, 19 Apr 2013 13:38:42 +0200, Michael Feurstein
> <michael.feurstein at gmail.com> wrote:
>> ---
>> configure.ac | 16 +++++++++++-----
>> 1 file changed, 11 insertions(+), 5 deletions(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 632fb88..f6fd935 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -1925,14 +1925,23 @@ AM_CONDITIONAL(HAVE_QTKIT, [test "${SYS}" =
>> "darwin" -a "x${enable_macosx_qtkit}
>>
>> dnl
>> dnl AVFoundation
>> +AC_SUBST(have_avfoundation, ["no"])
>
> WTF?
>
>> AC_ARG_ENABLE(macosx-avfoundation,
>> [ --enable-macosx-avfoundation Mac OS X avcapture (video) module
>> (default enabled on Mac OS X)])
>> if test "x${enable_macosx_avfoundation}" != "xno" &&
>> (test "${SYS}" = "darwin" || test "${enable_macosx_avfoundation}" =
>> "yes")
>> then
>> - VLC_ADD_PLUGIN([avcapture])
>> + SAVED_LIBS="${LIBS}"
>> + LIBS="-framework AVFoundation"
>> + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
>> [])],[have_avfoundation=yes],[have_avfoundation=no])
>> + LIBS="${SAVED_LIBS}"
>> + if test "${have_avfoundation}" != "no"
>> + then
>> + VLC_ADD_LIBS([macosx],[-Wl,-framework,AVFoundation])
>> + VLC_ADD_PLUGIN([avcapture])
>> + fi
>> fi
>> -AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${SYS}" = "darwin" -a
>> "x${enable_macosx_avfoundation}" != "xno"])
>> +AM_CONDITIONAL(HAVE_AVFOUNDATION, [test "${have_avfoundation}" !=
> "no"])
>
> WTH do you need *both* a conditonal and VLC_ADD_PLUGIN?!
While arguably clean, this suits the way it is done for a few access modules already.
I'll have a look at the documentation and will provide a cleaner solution within the next couple of days.
Cheers,
Felix
More information about the vlc-devel
mailing list