[vlc-commits] configure.ac disable/don' t load avcapture module and its framework if AVFoundation is not present ( OS 10.6)

Michael Feurstein git at videolan.org
Fri Apr 19 13:48:33 CEST 2013


vlc | branch: master | Michael Feurstein <michael.feurstein at gmail.com> | Fri Apr 19 13:38:42 2013 +0200| [8f4422c523ad1bd24e6262f64afe9d48836ecead] | committer: Felix Paul Kühne

configure.ac disable/don't load avcapture module and its framework if AVFoundation is not present (OS 10.6)

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8f4422c523ad1bd24e6262f64afe9d48836ecead
---

 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"])
 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"])
 
 dnl
 dnl  Demux plugins
@@ -3762,9 +3771,6 @@ then
 
   VLC_ADD_LIBS([macosx], [-Wl,-framework,QTKit -Wl,-framework,IOKit -Wl,-framework,AddressBook -Wl,-framework,WebKit -Wl,-framework,CoreAudio -Wl,-framework,SystemConfiguration -Wl,-framework,ScriptingBridge])
 
-  AC_CHECK_HEADERS(AVFoundation/AVFoundation.h,
-                       [VLC_ADD_LIBS([macosx],[-Wl,-framework,AVFoundation])])
-
   if test ! -d ${CONTRIB_DIR}/Sparkle.framework
   then
     AC_MSG_ERROR([Sparkle framework is required and was not found in ${CONTRIB_DIR}])



More information about the vlc-commits mailing list