]> git.sesse.net Git - vlc/commitdiff
x265: detect X265_BUILD
authorRafaël Carré <funman@videolan.org>
Mon, 14 Oct 2013 10:48:31 +0000 (12:48 +0200)
committerRafaël Carré <funman@videolan.org>
Mon, 14 Oct 2013 14:49:39 +0000 (16:49 +0200)
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)

configure.ac

index be30c5355b17279d08f3b97f1594c1f541c77877..d5e2d81c805cd0c7baa7182569d443dafb3469e7 100644 (file)
@@ -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])