add libdav1d codec, add remap_a/v_codec option keywords
[goodguy/cinelerra.git] / cinelerra-5.1 / configure.ac
index c2211b32012f9d35eafd8e86d1d5e5b21d3d869b..a8098cbe4bc6234cb248d0118c4ccaa3c6c777f5 100644 (file)
@@ -11,7 +11,9 @@ AC_PROG_CXX
 CFG_CFLAGS+=" -fno-omit-frame-pointer -fno-math-errno -fno-signed-zeros"
 CFG_CFLAGS+=" -pthread -Wall"
 # misguided pedantic warnings
+#  this is extra work, not a gain...
 CFG_CFLAGS+=" -Wno-unknown-warning"
+CFG_CFLAGS+=" -Wno-attributes"
 CFG_CFLAGS+=" -Wno-unused-result"
 CFG_CFLAGS+=" -Wno-stringop-overflow"
 CFG_CFLAGS+=" -Wno-format-truncation"
@@ -54,6 +56,10 @@ CHECK_WITH([libzmpeg],[build libzmpeg],[LIBZMPEG],[yes])
 CHECK_WITH([commercial],[enable commercial capture],[COMMERCIAL],[yes])
 CHECK_WITH([thirdparty],[use thirdparty build],[CIN_3RDPARTY],[yes])
 CHECK_WITH([shuttle],[shuttle device],[SHUTTLE],[yes])
+CHECK_WITH([vaapi],[video acceleration api],[VAAPI],[yes])
+CHECK_WITH([vdpau],[video decode+presentation api for unix],[VDPAU],[yes])
+CHECK_WITH([nv],[nvenc/nvdec ffnvcodec api],[NV],[yes])
+CHECK_WITH([cuda],[nv cuda plugins],[CUDA],[auto])
 
 if test "x$WANT_LV2" != "xno"; then
   GTK2_LIBS=`pkg-config --libs gtk+-2.0`
@@ -180,7 +186,7 @@ PKG_3RD([esound],[no],
   [ . ])
 
 PKG_3RD([ffmpeg],[yes],
-  [ffmpeg-4.1],
+  [ffmpeg-4.2],
   [ libavutil/libavutil.a \
     libavcodec/libavcodec.a \
     libpostproc/libpostproc.a \
@@ -225,10 +231,9 @@ PKG_3RD([flac],[auto],
   [ include ])
 
 PKG_3RD([giflib],[yes],
-  [giflib-5.1.4],
-  [ lib/.libs/libgif.a \
-    util/libgetarg.a ],
-  [ lib ])
+  [giflib-5.1.6],
+  [ libgif.a ],
+  [ . ])
 
 PKG_3RD([ilmbase],[auto],
   [ilmbase-2.2.1],
@@ -367,37 +372,37 @@ PKG_3RD([x265],[auto],
   [ . source ])
 
 PKG_3RD([libvpx],[auto],
-  [libvpx-1.7.0],
+  [libvpx-1.8.0],
   [ libvpx.a ],
   [ . ])
 
 PKG_3RD([lv2],[auto],
-  [lv2-1.14.0],
+  [lv2-1.16.0],
   [ ],
   [ usr/local/include usr/local/lib64/lv2 usr/local/lib/lv2 ])
 
 PKG_3RD([sratom],[auto],
-  [sratom-0.6.0],
+  [sratom-0.6.2],
   [ usr/local/lib/libsratom-0.a ],
   [ usr/local/include ])
 
 PKG_3RD([serd],[auto],
-  [serd-0.28.0],
+  [serd-0.30.0],
   [ usr/local/lib/libserd-0.a ],
   [ usr/local/include ])
 
 PKG_3RD([sord],[auto],
-  [sord-0.16.0],
+  [sord-0.16.2],
   [ usr/local/lib/libsord-0.a ],
   [ usr/local/include ])
 
 PKG_3RD([lilv],[auto],
-  [lilv-0.24.2],
+  [lilv-0.24.4],
   [ usr/local/lib/liblilv-0.a ],
   [ usr/local/include ])
 
 PKG_3RD([suil],[auto],
-  [suil-0.8.4],
+  [suil-0.10.2],
   [ usr/local/lib/libsuil-0.a ],
   [ usr/local/include ])
 
@@ -406,11 +411,21 @@ PKG_3RD([libaom],[auto],
   [ usr/local/lib*/libaom*.a ],
   [ usr/local/include ])
 
+PKG_3RD([dav1d],[auto],
+  [dav1d-0.4.0],
+  [ usr/local/lib*/libdav1d*.a ],
+  [ usr/local/include ])
+
 PKG_3RD([libwebp],[auto],
   [libwebp-1.0.2],
   [ usr/local/lib*/libwebp*.a ],
   [ usr/local/include ])
 
+PKG_3RD([ffnvcodec],[auto],
+  [ffnvcodec],
+  [ ],
+  [ . ])
+
 AC_SUBST(STATIC_PKGS)
 
 AC_DEFUN([CHECK_ENABLE], [
@@ -436,10 +451,30 @@ AC_DEFUN([REQUIRE_PROG], [
  fi
 ])
 
-# Checks for programs.
+## arch dep tests
+ARCH=[`uname -m`]
+I86=[`expr "x$ARCH" : 'xi[346]86.*'`]
+X86=[`expr "x$ARCH" : 'x..._64*'`]
+
+if test "x$I86$X86" != "x00" ; then
+  # Checks for ix86 programs.
+  REQUIRE_PROG(NASM, [nasm])
+  # libx264 nasm fix
+  AC_MSG_CHECKING([nasm x264 compatible])
+  echo "vmovdqa32 [[eax]]{k1}{z}, zmm0" > conftest.asm
+  nasm conftest.asm -o conftest.o > /dev/null 2>&1
+  if test $? != 0 ; then
+   AC_MSG_RESULT([no])
+   AC_MSG_WARN([libx264 built without assembly code])
+   X264_CFG_PARAMS="$X264_CFG_PARAMS --disable-asm"
+  else
+   AC_MSG_RESULT([yes])
+  fi
+  rm -f conftest.asm conftest.o
+  REQUIRE_PROG(YASM, [yasm])
+fi
+## end arch dep tests
 
-REQUIRE_PROG(NASM, [nasm])
-REQUIRE_PROG(YASM, [yasm])
 REQUIRE_PROG(OBJCOPY, [objcopy])
 if test "x$FATAL_ERROR" != "x"; then
  AC_MSG_ERROR("fatal eror.")
@@ -447,19 +482,6 @@ fi
 CHECK_PROG(PACTL, [pactl])
 WANT_PACTL=$PROG_PACTL
 
-# libx264 nasm fix
-AC_MSG_CHECKING([nasm x264 compatible])
-echo "vmovdqa32 [[eax]]{k1}{z}, zmm0" > conftest.asm
-nasm conftest.asm -o conftest.o > /dev/null 2>&1
-if test $? != 0 ; then
- AC_MSG_RESULT([no])
- AC_MSG_WARN([libx264 built without assembly code])
- X264_CFG_PARAMS="$X264_CFG_PARAMS --disable-asm"
-else
- AC_MSG_RESULT([yes])
-fi
-rm -f conftest.asm conftest.o
-
 AC_CHECK_DECL([X_HAVE_UTF8_STRING],,[no_utf=yes],[#include <X11/Xlib.h>])
 if test "$no_utf" = "yes"; then
   AC_MSG_ERROR([Cinelerra requires utf8 support in X Windows.])
@@ -486,15 +508,19 @@ if test "x$HAVE_$1" != "xno"; then
  if test "x$PKG_$1" = "x" -o "x$WANT_STATIC_BUILD" = "xno" -a "x$PKG_$1" = "xauto"; then
   AC_CHECK_LIB([$2], [$3], [HAVE_$1=yes], [HAVE_$1=no], [$4])
   AC_SUBST([HAVE_$1])
-  if test "x$HAVE_$1" = "xyes"; then
-   if test "x$PKG_$1" = "x"; then
-    SYSTEM_LIBS+=" -l[$2]"
-    for lib in [$4]; do SYSTEM_LIBS+=" $lib"; done
-   else
-    SHARED_$1+=" -l[$2]"
-    for lib in [$4]; do SHARED_LIBS+=" $lib"; done
+  if test "x$WANT_$1" != "xno"; then
+   if test "x$HAVE_$1" = "xyes"; then
+    if test "x$PKG_$1" = "x"; then
+     SYSTEM_LIBS+=" -l[$2]"
+     for lib in [$4]; do SYSTEM_LIBS+=" $lib"; done
+    else
+     SHARED_$1+=" -l[$2]"
+     for lib in [$4]; do SHARED_LIBS+=" $lib"; done
+    fi
+   elif test "x$PKG_$1" = "x"; then
+    RESULT=no
    fi
-  elif test "x$PKG_$1" = "x"; then RESULT=no; fi
+  fi
  fi
 fi
 ])
@@ -558,6 +584,8 @@ CHECK_LIB([opus], [opus], [opus_multistream_decoder_create])
 CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])
 CHECK_LIB([libaom], [aom], [aom_codec_version])
 CHECK_HEADERS([libaom], [libaom headers], [aom/aom.h])
+CHECK_LIB([dav1d], [dav1d], [dav1d_version])
+CHECK_HEADERS([dav1d], [libdav1d headers], [dav1d/dav1d.h])
 CHECK_LIB([libwebp], [webp], [WebPGetEncoderVersion])
 CHECK_HEADERS([libwebp], [libwebp headers], [webp/encode.h])
 CHECK_LIB([a52dec], [a52], [a52_init])
@@ -567,7 +595,15 @@ CHECK_HEADERS([encore], [encore headers], [encore.h])
 CHECK_LIB([giflib], [gif], [DGifOpen])
 CHECK_HEADERS([giflib], [gif lib headers], [gif_lib.h])
 CHECK_LIB([jbig], [jbig], [jbg_dec_init])
-CHECK_LIB([vdpau], [vdpau], [vdp_device_create_x11])
+CHECK_LIB([VDPAU], [vdpau], [vdp_device_create_x11])
+CHECK_LIB([VAAPI], [va], [vaInitialize])
+if test "x$WANT_VAAPI" != "xno" -a "x$HAVE_VAAPI" = "xyes"; then
+  CHECK_HEADERS([vaapi_x11], [va x11 headers], [va/va_x11.h])
+  CHECK_LIB([vaapi_x11], [va-x11], [vaGetDisplay])
+  CHECK_HEADERS([vaapi_drm], [va drm headers], [va/va_drm.h])
+  CHECK_LIB([vaapi_drm], [va-drm], [vaGetDisplayDRM])
+fi
+#CHECK_LIB([NVENC], [nvidia-encode], [NvEncodeAPICreateInstance])
 
 #if test "x$HAVE_mjpegtools" = "xyes"; then
 #CFG_CFLAGS+=" -I/usr/include/mjpegtools -I/usr/local/include/mjpegtools"
@@ -576,13 +612,15 @@ CHECK_LIB([vdpau], [vdpau], [vdp_device_create_x11])
 AC_DEFUN([CHECK_WANT], [
 RESULT=yes
 # WANT_$1
-if test "x$WANT_$1" != "xyes" -a "x$WANT_$1" != "xno" ; then
+if test "x$WANT_$1" != "xno" ; then
 AC_ARG_WITH(m4_tolower([$1]),
  AC_HELP_STRING([m4_join([-],[--with],m4_tolower([$1]))], [$3] (auto)),
   [WANT_$1=$withval],[WANT_$1=$2])
  m4_quote($4)
  if test "x$RESULT" = "xno" -a "x$PKG_$1" = "x"; then
-  echo "=== want $1 Failed."
+  if test "x$WANT_$1" = "xyes" ; then
+    AC_MSG_ERROR([required for $1 support.])
+  fi
   WANT_$1=no
  elif test "x$WANT_$1" = "xauto" ; then
   WANT_$1=yes
@@ -637,6 +675,15 @@ CHECK_WANT([ESOUND], [no], [use esd], [
  CHECK_LIB([audiofile], [audiofile], [afOpenFile])
  CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])])
 
+CHECK_WANT([SHUTTLE], [yes], [shuttle dev support], [
+ CHECK_HEADERS([keysyms], [x11 keysym defs], [X11/keysymdef.h])])
+if test "x$WANT_SHUTTLE" = "xno"; then
+ WANT_SHUTTLE_USB="no"
+fi
+CHECK_WANT([SHUTTLE_USB], [yes], [use libusb-1.0], [
+ CHECK_LIB([libusbx], [usb-1.0], [libusb_init])
+ CHECK_HEADERS([libusbx], [libusb headers], [libusb-1.0/libusb.h])])
+
 CHECK_WANT([LV2], [auto], [use lv2], [
  saved_CFLAGS="$CFLAGS"
  CHECK_LIB([lilv], [lilv-0], [lilv_world_new])
@@ -650,6 +697,9 @@ CHECK_WANT([LV2], [auto], [use lv2], [
  CHECK_HEADERS([lv2], [suil headers], [suil/suil.h])
  CFLAGS="$saved_CFLAGS"])
 
+CHECK_WANT([CUDA], [auto], [build cuda plugins], [
+  CHECK_HEADERS([CUDA], [cuda sdk], [${CUDA_PATH:-/usr/local/cuda}/include/cuda.h])])
+
 CHECK_WANT([DL], [auto], [system has libdl], [
  CHECK_LIB([DL], [dl], [dlopen])])
 
@@ -784,6 +834,7 @@ PKG_PROVIDE([libuuid])
 PKG_PROVIDE([libvorbis])
 PKG_PROVIDE([mjpegtools])
 PKG_PROVIDE([libaom])
+PKG_PROVIDE([dav1d])
 PKG_PROVIDE([libwebp])
 PKG_PROVIDE([openexr], [$WANT_OPENEXR])
 PKG_PROVIDE([openjpeg])
@@ -799,6 +850,7 @@ PKG_PROVIDE([sratom], [$WANT_LV2])
 PKG_PROVIDE([serd], [$WANT_LV2])
 PKG_PROVIDE([sord], [$WANT_LV2])
 PKG_PROVIDE([suil], [$WANT_LV2])
+PKG_PROVIDE([ffnvcodec], [$WANT_NV])
 
 if test "x$WANT_LV2" = "xyes"; then
   if test "x$HAVE_lv2" = "xyes" -a "x$BUILD_lilv" = "x0"; then
@@ -823,7 +875,8 @@ if test "x$WANT_CIN_3RDPARTY" != "xno"; then
 fi
 for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \
         VIDEO4LINUX2 ESOUND PACTL OPENEXR LV2 \
-        COMMERCIAL LIBZMPEG SHUTTLE; do
+        COMMERCIAL LIBZMPEG SHUTTLE SHUTTLE_USB \
+        VAAPI VDPAU CUDA NV; do
   eval vv="\$WANT_$v"
   if test "x$vv" != "xno"; then
     CFG_CFLAGS+=" -DHAVE_$v"
@@ -849,7 +902,10 @@ echo "  using: with-noelision = $WANT_NOELISION"
 echo "  using: with-booby = $WANT_BOOBY"
 echo "  using: with-libzmpeg = $WANT_LIBZMPEG"
 echo "  using: with-commerical = $WANT_COMMERCIAL"
-echo "  using: with-shuttle = $WANT_SHUTTLE"
+echo "  using: with-vaapi = $WANT_VAAPI"
+echo "  using: with-vdpau = $WANT_VDPAU"
+echo "  using: with-nv = $WANT_NV"
+echo "  using: with-cuda = $WANT_CUDA"
 echo ""
 echo "  using: thirdparty build = $WANT_CIN_3RDPARTY"
 echo "  using: single-user  = $WANT_CINBIN_BUILD"
@@ -866,10 +922,39 @@ fi
 if test "x$HAVE_NUMA" = "xyes"; then
   EXTRA_LIBS+=' -lnuma'
 fi
+
+FFMPEG_EXTRA_LDFLAGS=""
+if test "x$WANT_VAAPI" != "xno" -a "x$HAVE_VAAPI" = "xyes"; then
+  FFMPEG_EXTRA_LDFLAGS+=' -lva'
+  EXTRA_LIBS+=' -lva'
+  WANT_VAPPI="yes"
+  CFG_WANTS+=" VAAPI"
+  if test "x$HAVE_vaapi_x11" = "xyes"; then
+    FFMPEG_EXTRA_LDFLAGS+=' -lva-x11'
+    EXTRA_LIBS+=' -lva-x11'
+  fi
+  if test "x$HAVE_vaapi_drm" = "xyes"; then
+    FFMPEG_EXTRA_LDFLAGS+=' -lva-drm'
+    EXTRA_LIBS+=' -lva-drm'
+  fi
+fi
+if test "x$WANT_VDPAU" != "xno" -a "x$HAVE_VDPAU" = "xyes"; then
+  WANT_VDPAU="yes"
+  CFG_WANTS+=" VDPAU"
+fi
+if test "x$WANT_NV" != "xno"; then
+  WANT_NV="yes"
+  CFG_WANTS+=" NV"
+fi
+
 if test "x$HAVE_DL" = "xyes"; then
   EXTRA_LIBS+=' -ldl'
-  FFMPEG_EXTRA_CFG+=' --extra-ldflags="-ldl"'
+  FFMPEG_EXTRA_LDFLAGS+=' -ldl'
+fi
+if test "x$FFMPEG_EXTRA_LDFLAGS" != "x"; then
+  FFMPEG_EXTRA_CFG+=' --extra-ldflags="'$FFMPEG_EXTRA_LDFLAGS'"'
 fi
+
 if test "x$WANT_BOOBY" != "xno"; then
   CFG_CFLAGS+=" -DBOOBY"
 fi