]> git.sesse.net Git - ffmpeg/blobdiff - configure
disable bktr if required headers not found, enable by default
[ffmpeg] / configure
index 7882106cbee308fe07e6a093ae0893a95c3895a0..1070cbf48a501a1a61ddd757063cf30e54d9558b 100755 (executable)
--- a/configure
+++ b/configure
@@ -519,6 +519,8 @@ HAVE_LIST='
     pthreads
     sdl
     sdl_video_size
+    soundcard_h
+    sys_soundcard_h
     threads
     w32threads
 '
@@ -690,7 +692,7 @@ wince="no"
 # non-library system interfaces
 audio_beos="no"
 audio_oss="yes"
-bktr="no"
+bktr="yes"
 dv1394="yes"
 video4linux2="yes"
 video4linux="yes"
@@ -792,9 +794,6 @@ case $targetos in
     LDCONFIG="echo ignoring ldconfig"
     SHFLAGS=-nostart
     # disable Linux things
-    audio_oss="no"
-    video4linux="no"
-    video4linux2="no"
     dv1394="no"
     # enable BeOS things
     audio_beos="yes"
@@ -808,9 +807,6 @@ case $targetos in
         extralibs="-lnet"
     fi ;;
   SunOS)
-    video4linux="no"
-    video4linux2="no"
-    audio_oss="no"
     dv1394="no"
     make="gmake"
     FFLDFLAGS=""
@@ -819,19 +815,11 @@ case $targetos in
     add_extralibs "-lsocket -lnsl"
     ;;
   NetBSD)
-    video4linux="no"
-    video4linux2="no"
-    bktr="yes"
-    audio_oss="yes"
     dv1394="no"
     make="gmake"
     add_extralibs "-lossaudio"
     ;;
   OpenBSD)
-    video4linux="no"
-    video4linux2="no"
-    bktr="yes"
-    audio_oss="yes"
     dv1394="no"
     need_memalign="no"
     make="gmake"
@@ -844,28 +832,16 @@ case $targetos in
     add_extralibs "-lossaudio"
     ;;
   FreeBSD)
-    video4linux="no"
-    video4linux2="no"
-    bktr="yes"
-    audio_oss="yes"
     dv1394="no"
     make="gmake"
     need_memalign="no"
     add_cflags "-pthread"
     ;;
   GNU/kFreeBSD)
-    video4linux="no"
-    video4linux2="no"
-    bktr="yes"
-    audio_oss="yes"
     dv1394="no"
     add_cflags "-pthread"
     ;;
   BSD/OS)
-    video4linux="no"
-    video4linux2="no"
-    bktr="yes"
-    audio_oss="yes"
     dv1394="no"
     extralibs="-lpoll -lgnugetopt -lm"
     make="gmake"
@@ -873,9 +849,6 @@ case $targetos in
     ;;
   Darwin)
     cc="cc"
-    video4linux="no"
-    video4linux2="no"
-    audio_oss="no"
     dv1394="no"
     need_memalign="no"
     SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION) -Wl,-read_only_relocs,suppress"
@@ -896,9 +869,6 @@ case $targetos in
   CYGWIN*)
     targetos=CYGWIN
     shlibdir="$bindir"
-    video4linux="no"
-    video4linux2="no"
-    audio_oss="yes"
     dv1394="no"
     VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
     VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
@@ -916,9 +886,6 @@ case $targetos in
   IRIX*)
     targetos=IRIX
     ranlib="echo ignoring ranlib"
-    video4linux="no"
-    video4linux2="no"
-    audio_oss="no"
     make="gmake"
     ;;
   OS/2)
@@ -937,9 +904,6 @@ case $targetos in
     EXESUF=".exe"
     extralibs=""
     pkg_requires=""
-    video4linux="no"
-    video4linux2="no"
-    audio_oss="no"
     dv1394="no"
     ffserver="no"
     vhook="no"
@@ -1203,9 +1167,6 @@ you do not need to pass additional options.
 EOF
         exit 1
     fi
-    video4linux="no"
-    video4linux2="no"
-    audio_oss="no"
     dv1394="no"
     dc1394="no"
     ffserver="no"
@@ -1775,28 +1736,25 @@ int main( void ) {
 }
 EOF
 
-# check for video4linux2 --- V4L2_PIX_FMT_YUV420
-enabled video4linux2 && check_cc <<EOF || video4linux2="no"
-#include <sys/time.h>
-#include <asm/types.h>
-#include <linux/videodev2.h>
-int dummy = V4L2_PIX_FMT_YUV420;
-struct v4l2_buffer dummy1;
-EOF
+enabled video4linux  && check_header linux/videodev.h  || disable video4linux
+enabled video4linux2 && check_header linux/videodev2.h || disable video4linux2
 
 # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
 if enabled bktr; then
-    check_header dev/bktr/ioctl_meteor.h
-    check_header dev/bktr/ioctl_bt848.h
-
-    check_header machine/ioctl_meteor.h
-    check_header machine/ioctl_bt848.h
-
-    check_header dev/video/meteor/ioctl_meteor.h
-    check_header dev/video/bktr/ioctl_bt848.h
-
-    check_header dev/ic/bt8xx.h
-fi
+    { check_header dev/bktr/ioctl_meteor.h &&
+      check_header dev/bktr/ioctl_bt848.h; } ||
+    { check_header machine/ioctl_meteor.h &&
+      check_header machine/ioctl_bt848.h; } ||
+    { check_header dev/video/meteor/ioctl_meteor.h &&
+      check_header dev/video/bktr/ioctl_bt848.h; } ||
+    check_header dev/ic/bt8xx.h ||
+    disable bktr
+fi
+
+enabled audio_oss &&
+    check_header sys/soundcard.h ||
+    check_header soundcard.h ||
+    disable audio_oss
 
 # Deal with the x11 frame grabber
 enabled x11grab                         &&