[vlc-commits] x265: detect X265_BUILD

Rafaël Carré git at videolan.org
Mon Oct 14 16:49:55 CEST 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Oct 14 12:48:31 2013 +0200| [229e2709b3f6f0a04a4cf907be1a3147eff9f3f8] | committer: Rafaël Carré

x265: detect X265_BUILD

As the library symbols are suffixed with the exact build version, and
it is not clear yet whether the API will be broken or simply extended,
watch for the exact version number (which is 1)

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

 configure.ac |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index be30c53..d5e2d81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2725,13 +2725,18 @@ dnl x265 encoder
 AC_ARG_ENABLE(x265,
   AS_HELP_STRING([--enable-x265],[H265 / HEVC encoding support with libx265 (default enabled)]))
 AS_IF( [test "${enable_x265}" != "no"],[
-  AC_CHECK_HEADER([x265.h], [
-      AC_CHECK_LIB([x265],[x265_encoder_open], [
-        VLC_ADD_PLUGIN([x265])
-        VLC_ADD_LIBS([x265], [-lx265 -lstdc++ -lm -lpthread])
-      ], [
-        AC_MSG_ERROR([x265 library not found])
-      ], [-lstdc++ -lm -lpthread])
+  AC_PREPROC_IFELSE([AC_LANG_SOURCE([
+#include <x265.h>
+#if X265_BUILD != 1
+# error Fail
+#endif
+  ])], [
+    AC_CHECK_LIB([x265],[x265_encoder_open_1], [
+      VLC_ADD_PLUGIN([x265])
+      VLC_ADD_LIBS([x265], [-lx265 -lstdc++ -lm -lpthread])
+    ], [
+      AC_MSG_ERROR([x265 library not found])
+    ], [-lstdc++ -lm -lpthread])
   ], [
     AS_IF([test "${enable_x265}" = "yes"], [
         AC_MSG_ERROR([x265.h not found])



More information about the vlc-commits mailing list