]> git.sesse.net Git - vlc/commitdiff
Move the libVA detection to auto
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 8 Jan 2010 17:37:46 +0000 (18:37 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 8 Jan 2010 18:35:11 +0000 (19:35 +0100)
It now autodetects the presence of libVA pkg:
It will fail if --enable-libva is defined and it is not present
It will be activated if nothing is specified and libVA pkg is present

Moreover, it will check the presence of the avcodec/libva.h

configure.ac

index dfb4a9ca6846aa8c6a549400897b8319f52bb2a2..b2632bab2b516bdef91dbf70dac35879229271c5 100644 (file)
@@ -2954,19 +2954,29 @@ dnl
 dnl libva needs avcodec
 dnl
 AC_ARG_ENABLE(libva,
-  [  --enable-libva          libva VAAPI support (default disabled)])
-AS_IF([test "${enable_libva}" = "yes"], [
+  [  --enable-libva          libva VAAPI support (default auto)])
+
+AS_IF([test "${enable_libva}" != "no"], [
   AS_IF([test "x${have_avcodec}" = "xyes"], [
     PKG_CHECK_MODULES(LIBVA, [libva libva-x11],
       [
-        VLC_ADD_LIBS([avcodec],[$LIBVA_LIBS])
-        VLC_ADD_CFLAGS([avcodec],[$LIBVA_CFLAGS])
-        AC_DEFINE(HAVE_AVCODEC_VAAPI, 1, [Define if avcodec has to be built with VAAPI support.])
+        AC_CHECK_HEADERS(libavcodec/vaapi.h, [
+           VLC_ADD_LIBS([avcodec],[$LIBVA_LIBS])
+           VLC_ADD_CFLAGS([avcodec],[$LIBVA_CFLAGS])
+           AC_DEFINE(HAVE_AVCODEC_VAAPI, 1, [Define if avcodec has to be built with VAAPI support.])
+           echo "VAAPI acceleration activated"
+        ],[
+       AS_IF([test "${enable_libva}" == "yes"],
+             [AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing])],
+              [AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])])
+        ])
       ],[
-        AC_MSG_ERROR([Could not find libva.])
-    ])
+       AS_IF([test "${enable_libva}" == "yes"],
+              [AC_MSG_ERROR([Could not find required libva.])],
+              [AC_MSG_WARN([libva not found  ])])
+      ])
   ],[
-    AC_MSG_ERROR([libva VAAPI support depends on libavcodec.])
+    AC_MSG_ERROR([libva VAAPI support depends on libavcodec. You cannot use --disable-avcodec.])
   ])
 ])