diff options
author | Matt Messier <mmessier@grapetv.org> | 2007-05-12 23:02:00 -0400 |
---|---|---|
committer | Matt Messier <mmessier@grapetv.org> | 2007-05-12 23:02:00 -0400 |
commit | cf7fe6007ee6008037e63c8d9fc7ad9af8bc8d23 (patch) | |
tree | 80afe4c0d76ef0eb341208a2390de1cfa9df56d0 | |
parent | 88e4fa03427252304dbbae078ce394269bfc71e9 (diff) | |
download | xine-lib-cf7fe6007ee6008037e63c8d9fc7ad9af8bc8d23.tar.gz xine-lib-cf7fe6007ee6008037e63c8d9fc7ad9af8bc8d23.tar.bz2 |
X11 and video output plugin configuration check cleanups
-- Move x11.m4 back into configure.ac, because AC_PATH_XTRA was behaving oddly
inside a macro. That code is now cleaned up enough so that it's not too
painful having it there.
-- Move opengl.m4 inline into video_out.m4
-- Fix x11 checks to work on Darwin, including XShm checks, Xv checks, OpenGL,
and GLU checks.
-rw-r--r-- | configure.ac | 49 | ||||
-rw-r--r-- | m4/Makefile.am | 2 | ||||
-rw-r--r-- | m4/opengl.m4 | 74 | ||||
-rw-r--r-- | m4/summary.m4 | 15 | ||||
-rw-r--r-- | m4/video_out.m4 | 223 | ||||
-rw-r--r-- | m4/x11.m4 | 64 | ||||
-rw-r--r-- | m4/xv.m4 | 167 | ||||
-rw-r--r-- | src/video_out/Makefile.am | 2 |
8 files changed, 261 insertions, 335 deletions
diff --git a/configure.ac b/configure.ac index 2a518aa81..78f857581 100644 --- a/configure.ac +++ b/configure.ac @@ -833,7 +833,54 @@ dnl -------------------------- dnl checks for system services dnl -------------------------- -XINE_X11_SUPPORT +if test x"$with_x" != x"no"; then + dnl Do a package check first, falling back to autoconf's built in checks if + dnl no package is found. + PKG_CHECK_MODULES([X], [x11 xext], [have_x=yes; no_x=no], [ + dnl Even as of 2.61, autoconf is not smart enough to find the X include + dnl and library paths on Mac OS X, so seed them automatically if they're + dnl not specified on the configure command-line. + case "$host_os" in + darwin*) + test x"$x_includes" = x"NONE" && x_includes="/usr/X11R6/include" + test x"$x_libraries" = x"NONE" && x_libraries="/usr/X11R6/lib" + ;; + esac + + dnl Check for Xwindows using the autoconf AC_PATH_XTRA macro, which is an + dnl extension of AC_PATH_X that sets X_CFLAGS and X_LIBS. It will also set + dnl X_EXTRA_LIBS and X_PRE_LIBS. + AC_PATH_XTRA + if test x"$no_x" != x"yes"; then + X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" + fi + ]) +fi + +dnl Check for XShm support (required for xine X support) +if test x"$no_x" != x"yes"; then + AC_DEFINE([HAVE_X11], 1, [Define this if you have X11R6 installed]) + ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" + AC_CHECK_HEADERS([X11/extensions/XShm.h], [], + [AC_MSG_ERROR([XShm extension is required])], + [#include <X11/Xlib.h>]) + CPPFLAGS="$ac_save_CPPFLAGS" + AC_CHECK_LIB([Xext], [main], + [X_LIBS="$X_LIBS -lXext"], [AC_MSG_ERROR([libXext is required])], + [$X_LIBS]) +fi +AM_CONDITIONAL([HAVE_X11], [test x"$no_x" != x"yes"]) + +dnl Locate libraries needed for X health check +soname_script="/[[0-9]]$/! d; s%^.*/%% +t q +b +:q +q" +x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.$acl_cv_shlibext"* "${x_libraries:-/usr/lib}/libX11.$acl_cv_shlibext"* 2>/dev/null | sed -e \"${soname_script}\"`" +AC_DEFINE_UNQUOTED([LIBX11_SO], "${x_lib_location:-libX11.$acl_cv_shlibext}", [The soname of libX11, needed for dlopen()]) +x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.$acl_cv_shlibext"* "${x_libraries:-/usr/lib}/libXv.$acl_cv_shlibext"* 2>/dev/null | sed -e \"${soname_script}\"`" +AC_DEFINE_UNQUOTED([LIBXV_SO], "${x_lib_location:-libXv.$acl_cv_shlibext}", [The soname of libXv, needed for dlopen()]) dnl _FILE_OFFSET_BITS (AC_SYS_LARGEFILE; ac_cv_sys_file_offset_bits) dnl _LARGE_FILES (AC_SYS_LARGEFILE; ac_cv_sys_large_files) diff --git a/m4/Makefile.am b/m4/Makefile.am index dc73fee64..1d10b94e4 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -25,7 +25,6 @@ EXTRA_DIST = \ libfame.m4 \ macosx.m4 \ objc.m4 \ - opengl.m4 \ pkg.m4 \ programs.m4 \ pthreads.m4 \ @@ -34,5 +33,4 @@ EXTRA_DIST = \ types.m4 \ video_out.m4 \ xine.m4 \ - x11.m4 \ xv.m4 diff --git a/m4/opengl.m4 b/m4/opengl.m4 deleted file mode 100644 index 2c12949d9..000000000 --- a/m4/opengl.m4 +++ /dev/null @@ -1,74 +0,0 @@ -dnl -dnl Check for OpenGL & GLU -dnl -dnl AM_PATH_OPENGL([ACTION IF FOUND [, ACTION IF NOT FOUND]]) -dnl - -AC_DEFUN([AM_PATH_OPENGL], [ - - AC_ARG_ENABLE(opengl, AS_HELP_STRING([--disable-opengl], [do not build OpenGL plugin]), - [enableopengl=$enableval], - [enableopengl="yes"] - ) - AC_ARG_ENABLE(glu, AS_HELP_STRING([--disable-glu], [build OpenGL plugin without GLU (no verbose errors)]), - [enableglu=$enableval], - [enableglu="yes"] - ) - - if test x$enableopengl = "xyes"; then - AC_CHECK_LIB(GL, glBegin, - [AC_CHECK_LIB(m, tan, - [AC_CHECK_HEADER(GL/gl.h, - [ac_have_opengl="yes" - OPENGL_LIBS="-lGL -lm" - AC_DEFINE(HAVE_OPENGL,1,[Define this if you have OpenGL support available]) - dnl - dnl need to check with some test if this linking with -lGLU actually works... - dnl check for GLU - dnl - if test x$enableglu = "xyes"; then - AC_CHECK_LIB(GLU, gluPerspective, - [AC_CHECK_HEADER(GL/glu.h, - [AC_MSG_CHECKING([if GLU is sane]) - ac_save_LIBS="$LIBS" - LIBS="$X_LIBS $XPRE_LIBS $OPENGL_LIBS -lGLU $X_EXTRA_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <GL/gl.h> -#include <GL/glu.h>]], [[ gluPerspective(45.0f,1.33f,1.0f,1000.0f); glBegin(GL_POINTS); glEnd(); return 0 ]])], - [ ac_have_glu="yes" - GLU_LIBS="-lGLU" - AC_DEFINE(HAVE_GLU,1,[Define this if you have GLU support available]) - AC_MSG_RESULT(yes)], - [ AC_MSG_RESULT(no) - echo "*** GLU doesn't link with GL; GLU is disabled ***"]) - LIBS="$ac_save_LIBS"] - )], - [], - [$X_LIBS $X_PRE_LIBS $OPENGL_LIBS -lGLU $X_EXTRA_LIBS] - ) - fi - ] - )], - [], - [$X_LIBS $X_PRE_LIBS -lGL -lm $X_EXTRA_LIBS] - )], - [], - [$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS] - ) - if test x$ac_have_opengl = "xyes"; then - ac_use_opengl=yes - fi - fi - - AC_SUBST(OPENGL_CFLAGS) - AC_SUBST(OPENGL_LIBS) - AC_SUBST(GLU_LIBS) - AM_CONDITIONAL(HAVE_OPENGL, [test x$ac_use_opengl = "xyes"]) - - dnl result - if test x$ac_use_opengl = "xyes"; then - ifelse([$1], , :, [$1]) - else - ifelse([$2], , :, [$2]) - fi - -]) diff --git a/m4/summary.m4 b/m4/summary.m4 index 67a1522f4..66cc1c322 100644 --- a/m4/summary.m4 +++ b/m4/summary.m4 @@ -219,8 +219,8 @@ AC_DEFUN([XINE_LIB_SUMMARY], [ echo " * video driver plugins:" if test "x$no_x" != "xyes"; then echo " - XShm (X11 shared memory)" - dnl synfb - if test "x$enable_syncfb" != "xno"; then + dnl syncfb + if test "x$have_syncfb" = "xyes"; then echo " - SyncFB (for Matrox G200/G400 cards)" fi dnl Xv @@ -243,9 +243,12 @@ AC_DEFUN([XINE_LIB_SUMMARY], [ if test "x$ac_have_xvmc" = "xyes"; then echo " - XvMC (XVideo motion compensation)" fi - if test "x$ac_have_opengl" = "xyes" -a "x$ac_have_glut" = "xyes" -o \ - x$"ac_have_opengl" = "xyes" -a "x$ac_have_glu" = "xyes"; then - echo " - OpenGL" + if test x"$have_opengl" = "xyes"; then + if test x"$have_glu" = x"yes"; then + echo " - OpenGL (with GLU support)" + else + echo " - OpenGL" + fi fi if test "x$ac_have_sunfb" = "xyes"; then if test "x$ac_have_sundga" = "xyes"; then @@ -289,7 +292,7 @@ AC_DEFUN([XINE_LIB_SUMMARY], [ echo " - dxr3 (Hollywood+ and Creative dxr3, mpeg video only)" fi fi - if test "x$enable_vidix" = "xyes"; then + if test "x$have_vidix" = "xyes"; then echo $ECHO_N " - vidix (" if test "x$no_x" != "xyes"; then diff --git a/m4/video_out.m4 b/m4/video_out.m4 index 2e89d3588..c767c9d39 100644 --- a/m4/video_out.m4 +++ b/m4/video_out.m4 @@ -18,8 +18,10 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ default_enable_directfb=disable default_enable_directx=disable default_enable_dxr3=disable + default_enable_glu=enable default_enable_linuxfb=disable default_enable_macosx_video=disable + default_enable_opengl=enable default_enable_syncfb=disable default_enable_xinerama=enable default_enable_vidix=disable @@ -51,42 +53,14 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ esac - dnl Video output plugins that depend on X11 support - if test x$"no_x" != x"yes"; then - dnl Xinerama - AC_ARG_ENABLE([xinerama], - [AS_HELP_STRING([--enable-xinerama], [enable support for Xinerama])], - [], [test $default_enable_xinerama = disable && enable_xinerama=no]) - if test "x$enable_xinerama" != "xno"; then - PKG_CHECK_MODULES([XINERAMA], [xinerama], [ac_have_xinerama=yes], - [AC_CHECK_LIB([Xinerama], [XineramaQueryExtension], - [XINERAMA_LIBS="-lXinerama" ac_have_xinerama="yes"], [], - [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])]) - if test "x$ac_have_xinerama" = "xyes"; then - AC_DEFINE([HAVE_XINERAMA], 1, [Define this if you have libXinerama installed]) - X_LIBS="${X_LIBS} ${XINERAMA_LIBS}" - fi - else - ac_have_xinerama=no - fi - AM_CONDITIONAL([ENABLE_XINERAMA], [test x"$ac_have_xinerama" = x"yes"]) - - dnl OpenGL, including GLut and/or GLU - AM_PATH_OPENGL - - dnl xv - XINE_XV_SUPPORT - fi - - dnl Ascii-Art + dnl REVISIT: FIX AM_PATH_AALIB AC_ARG_ENABLE([aalib], [AS_HELP_STRING([--enable-aalib], [enable support for AALIB])], - [], [test $default_enable_aalib = disable && enable_aalib=no]) + [test x"$enableval" != x"no" && enable_aalib="yes"], + [test $default_enable_aalib = disable && enable_aalib="no"]) if test x"$enable_aalib" != x"no"; then AM_PATH_AALIB([1.4], [], [AC_MSG_RESULT([*** All of AALIB dependent parts will be disabled ***])]) - else - no_aalib=yes fi AM_CONDITIONAL([ENABLE_AA], [test x"$no_aalib" != x"yes"]) @@ -94,10 +68,11 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl Color AsCii Art AC_ARG_WITH([caca], [AS_HELP_STRING([--without-caca], [Do not build CACA support])], - [], [test $default_with_caca = without && with_caca=no]) + [test x"$withval" != x"no" && with_caca="yes"], + [test $default_with_caca = without && with_caca=no]) if test x"$with_caca" != x"no"; then PKG_CHECK_MODULES([CACA], [caca cucul], [have_caca="yes"], [have_caca="no"]) - if test x"$with_caca" = x"yes" && test x"$have_caca" = x"no"; then + if test x"$with_caca" = x"yes" && test x"$have_caca" != x"yes"; then AC_MSG_ERROR([CACA support requested, but libcaca 0.99 not found]) fi fi @@ -107,7 +82,8 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl dha (Linux only) AC_ARG_ENABLE([dha-kmod], [AS_HELP_STRING([--enable-dha-kmod], [build Linux DHA kernel module])], - [], [test $default_enable_dha_kmod = disable && enable_dha_kmod=no]) + [test x"$enableval" != x"no" && enable_dha_kmod="yes"], + [test $default_enable_dha_kmod = disable && enable_dha_kmod="no"]) if test x"$enable_dha_kmod" != x"no"; then AC_ARG_WITH([linux-path], [AS_HELP_STRING([--with-linux-path=PATH], [where the linux sources are located])], @@ -124,21 +100,26 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl DirectFB AC_ARG_ENABLE([directfb], [AS_HELP_STRING([--enable-directfb], [enable use of DirectFB])], - [], [test $default_enable_directfb = disable && enable_directfb=no]) + [test x"$enableval" != x"no" && enable_directfb="yes"], + [test $default_enable_directfb = disable && enable_directfb="no"]) if test "x$enable_directfb" = "xyes"; then - PKG_CHECK_MODULES([DIRECTFB], [directfb >= 0.9.22], [have_directfb="yes"], [have_directfb="no"]) + PKG_CHECK_MODULES([DIRECTFB], [directfb >= 0.9.22], [have_directfb=yes], [have_directfb=no]) + if test x"$enable_directfb" = x"yes" && test x"$have_directfb" != x"yes"; then + AC_MSG_ERROR([DirectFB support requested, but DirectFB not found]) + fi fi AM_CONDITIONAL([ENABLE_DIRECTFB], [test x"$have_directfb" = x"yes"]) - dnl DirectX + dnl DirectX (see directx.m4) AM_PATH_DIRECTX dnl dxr3 / hollywood plus card AC_ARG_ENABLE([dxr3], [AS_HELP_STRING([--enable-dxr3], [enable support for DXR3/HW+])], - [], [test $default_enable_dxr3 = disable && enable_dxr3=no]) + [test x"$enableval" != x"no" && enable_dxr3="yes"], + [test $default_enable_dxr3 = disable && enable_dxr3="no"]) if test x"$enable_dxr3" != x"no"; then have_dxr3=yes AC_MSG_RESULT([*** checking for a supported mpeg encoder]) @@ -173,10 +154,11 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl LibSTK - http://www.libstk.net (project appears to be dead) AC_ARG_WITH([libstk], [AS_HELP_STRING([--with-libstk], [Build with STK surface video driver])], - [], [test $default_with_libstk = without && with_libstk=no]) + [test x"$withval" != x"no" && with_libstk="yes"], + [test $default_with_libstk = without && with_libstk="no"]) if test x"$with_libstk" != x"no"; then PKG_CHECK_MODULES([LIBSTK], [libstk >= 0.2.0], [have_libstk=yes], [have_libstk=no]) - if test x"$with_libstk" = x"yes" && test x"$have_libstk" = x"no"; then + if test x"$with_libstk" = x"yes" && test x"$have_libstk" != x"yes"; then AC_MSG_ERROR([libstk support requested, but libstk not found]) fi fi @@ -186,34 +168,103 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl Linux framebuffer device AC_ARG_ENABLE([fb], [AS_HELP_STRING([--enable-fb], [enable Linux framebuffer support])], - [], [test $default_enable_linuxfb = disable && enable_linuxfb=no]) + [test x"$enableval" != x"no" && enable_fb="yes"], + [test $default_enable_linuxfb = disable && enable_linuxfb="no"]) if test x"$enable_linuxfb" != x"no"; then - AC_CHECK_HEADERS([linux/fb.h], - [AC_DEFINE([HAVE_FB], 1, [Define this if you have linux framebuffer support]) - have_fb=yes]) + AC_CHECK_HEADERS([linux/fb.h], [have_fb=yes], [have_fb=no]) + if test x"$enable_fb" = x"yes" && test x"$have_fb" != x"yes"; then + AC_MSG_ERROR([Linux framebuffer support requested, but required header file(s) not found]) + elif test x"$have_fb" = x"yes"; then + dnl This define is needed by src/video_out/video_out_vidix.c + AC_DEFINE([HAVE_FB], 1, [Define this if you have linux framebuffer support]) + fi fi AM_CONDITIONAL([ENABLE_FB], [test x"$have_fb" = x"yes"]) dnl Mac OS X OpenGL video output - dnl TODO: test could be much better, but there's not really much need AC_ARG_ENABLE([macosx-video], [AS_HELP_STRING([--enable-macosx-video], [enable support for Mac OS X OpenGL video output])], - [have_macosx_video="$enableval"], - [test $default_enable_macosx_video = disable && have_macosx_video=no]) - AM_CONDITIONAL([ENABLE_MACOSX_VIDEO], [test x"$have_macosx_video" != x"no"]) + [test x"$enableval" != x"no" && enable_macosx_video="yes"], + [test $default_enable_macosx_video = disable && enable_macosx_video="no"]) + if test x"$enable_macosx_video" != x"no"; then + AC_MSG_CHECKING([for Mac OS X video output frameworks]) + ac_save_LIBS="$LIBS" LIBS="$LIBS -framework Cocoa -framework OpenGL" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0]])], [have_macosx_video=yes], [have_macosx_video=no]) + LIBS="$ac_save_LIBS" + AC_MSG_RESULT([$have_macosx_video]) + if test x"$enable_macosx_video" = x"yes" && test x"$have_macosx_video" != x"yes"; then + AC_MSG_ERROR([Mac OS X OpenGL video output support requested, but required frameworks not found]) + fi + fi + AM_CONDITIONAL([ENABLE_MACOSX_VIDEO], [test x"$have_macosx_video" = x"yes"]) + + + dnl OpenGL, including GLut and/or GLU + AC_ARG_ENABLE([opengl], + [AS_HELP_STRING([--enable-opengl], [enable support for X-based OpenGL video output])], + [test x"$enableval" != x"no" && enable_opengl="yes"], + [test $default_enable_opengl = disable && enable_opengl="no"]) + AC_ARG_ENABLE([glu], + [AS_HELP_STRING([--enable-glu], [enable support for GLU in the OpenGL plugin])], + [test x"$enableval" != x"no" && enable_glu="yes"], + [test $default_enable_glu = disable && enable_glu="no"]) + if test x"$enable_opengl" != x"no"; then + if test x"$no_x" = x"yes"; then + if test x"$enable_opengl" = x"yes"; then + AC_MSG_ERROR([OpenGL support requested, but X support is disabled]) + fi + enable_opengl=no + fi + fi + if test x"$enable_opengl" != x"no"; then + ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" + AC_CHECK_LIB([GL], [glBegin], + [AC_CHECK_HEADERS([GL/gl.h], [have_opengl=yes], [have_opengl=no])], [have_opengl=no], + [$X_LIBS -lm]) + if test x"$enable_opengl" = x"yes" && test x"$have_opengl" != x"yes"; then + AC_MSG_ERROR([OpenGL support requested, but OpenGL not found]) + elif test x"$have_opengl" = x"yes"; then + OPENGL_LIBS="-lGL -lm" + if test x"$enable_glu" != x"no"; then + have_glu=no + AC_CHECK_LIB([GLU], [gluPerspective], + [AC_CHECK_HEADERS([GL/glu.h], + [AC_MSG_CHECKING([if GLU is sane]) + ac_save_LIBS="$LIBS" LIBS="-lGLU $X_LIBS $OPENGL_LIBS $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <GL/gl.h> + #include <GL/glu.h>]], + [[gluPerspective(45.0f, 1.33f, 1.0f, 1000.0f); + glBegin(GL_POINTS); glEnd()]])], + [have_glu=yes], [have_glu=no]) + LIBS="$ac_save_LIBS" + AC_MSG_RESULT([$have_glu])], [have_glu=no])], [have_glu=no], + [$X_LIBS $OPENGL_LIBS]) + if test x"$enable_glu" = x"yes" && test x"$have_glu" != x"yes"; then + AC_MSG_ERROR([OpenGL GLU support requested, but GLU not found]) + elif test x"$have_glu" = x"yes"; then + AC_DEFINE([HAVE_GLU], 1, [Define this if you have GLU support available]) + GLU_LIBS="-lGLU" + fi + fi + fi + CPPFLAGS="$ac_save_CPPFLAGS" + AC_SUBST(OPENGL_CFLAGS) + AC_SUBST(OPENGL_LIBS) + AC_SUBST(GLU_LIBS) + fi + AM_CONDITIONAL([ENABLE_OPENGL], [test x"$have_opengl" = x"yes"]) dnl SDL AC_ARG_WITH([sdl], [AS_HELP_STRING([--without-sdl], [Build without SDL video output])], - [], [test $default_with_sdl = without && with_sdl=no]) - if test "x$with_sdl" != "xno"; then + [test x"$withval" != x"no" && withval="yes"], + [test $default_with_sdl = without && with_sdl="no"]) + if test x"$with_sdl" != x"no"; then PKG_CHECK_MODULES([SDL], [sdl], [have_sdl=yes], [have_sdl=no]) - if test x"$with_sdl" = x"yes" && test x"$have_sdl" = x"no"; then + if test x"$with_sdl" = x"yes" && test x"$have_sdl" != x"yes"; then AC_MSG_ERROR([SDL support requested, but SDL not found]) - elif test x"$have_sdl" = x"yes"; then - AC_DEFINE([HAVE_SDL], 1, [Define this if you have SDL installed]) fi fi AM_CONDITIONAL([ENABLE_SDL], [test x"$have_sdl" = x"yes"]) @@ -240,19 +291,30 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl syncfb (Linux only) AC_ARG_ENABLE([syncfb], [AS_HELP_STRING([--enable-syncfb], [enable support for syncfb (Linux only)])], - [], [test $default_enable_syncfb = disable && enable_syncfb=no]) - AM_CONDITIONAL([ENABLE_SYNCFB], [test x"$enable_syncfb" != x"no"]) + [test x"$enableval" != x"no" && enable_syncfb="yes"], + [test $default_enable_syncfb = disable && enable_syncfb="no"]) + dnl There's no good test for this. If the user says so, then do it + if test x"$enable_syncfb" != x"no" && test x"$no_x" != x"yes"; then + have_syncfb=yes + fi + if test x"$enable_syncfb" = x"yes" && test x"$have_syncfb" != x"yes"; then + AC_MSG_ERROR([Linux syncfb support requested, but required X support is disabled]) + fi + AM_CONDITIONAL([ENABLE_SYNCFB], [test x"$have_syncfb" = x"yes"]) dnl xcb AC_ARG_WITH([xcb], [AS_HELP_STRING([--without-xcb], [Doesn't build XCB video out plugins])], - [], [test $default_with_xcb = without && with_xcb=no]) + [test x"$withval" != x"no" && with_xcb="yes"], + [test $default_with_xcb = without && with_xcb="no"]) if test x"$with_xcb" != x"no"; then - PKG_CHECK_MODULES([XCB], [xcb-shape >= 1.0], [have_xcb="yes"], [have_xcb="no"]) - if test x$"have_xcb" = x"yes"; then - PKG_CHECK_MODULES([XCBSHM], [xcb-shm], [have_xcbshm="yes"], [have_xcbshm="no"]) - PKG_CHECK_MODULES([XCBXV], [xcb-xv], [have_xcbxv="yes"], [have_xcbxv="no"]) + PKG_CHECK_MODULES([XCB], [xcb-shape >= 1.0], [have_xcb=yes], [have_xcb=no]) + if test x"$enable_xcb" = x"yes" && test x"$have_xcb" != x"yes"; then + AC_MSG_ERROR([XCB support requested, but XCB not found]) + elif test x"$have_xcb" = x"yes"; then + PKG_CHECK_MODULES([XCBSHM], [xcb-shm], [have_xcbshm=yes], [have_xcbshm=no]) + PKG_CHECK_MODULES([XCBXV], [xcb-xv], [have_xcbxv=yes], [have_xcbxv=no]) fi fi AM_CONDITIONAL([ENABLE_XCB], [test x"$have_xcb" = x"yes"]) @@ -264,21 +326,52 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl Requires X11 or Linux framebuffer AC_ARG_ENABLE([vidix], [AS_HELP_STRING([--enable-vidix], [enable support for Vidix])], - [], [test $default_enable_vidix = disable && enable_vidix=no]) + [test x"$enableval" != x"no" && enable_vidix="yes"], + [test $default_enable_vidix = disable && enable_vidix="no"]) if test x"$enable_vidix" != x"no"; then + have_vidix=yes if test x"$ac_cv_prog_AWK" = x"no"; then - enable_vidix=no + have_vidix=no else if test x"$no_x" = x"yes" -o x"$have_fb" != x"yes"; then - enable_vidix=no + have_vidix=no else case "$host_or_hostalias" in i?86-*-linux* | k?-*-linux* | athlon-*-linux*) ;; i?86-*-freebsd* | k?-*-freebsd* | athlon-*-freebsd*) ;; - *) enable_vidix="no" ;; + *) have_vidix="no" ;; esac fi fi + if test x"$enable_vidix" = x"yes" && test x"$have_vidix" != x"yes"; then + AC_MSG_ERROR([Vidix support requested, but not all requirements are met]) + fi fi - AM_CONDITIONAL([ENABLE_VIDIX], test x"$enable_vidix" != x"no") + AM_CONDITIONAL([ENABLE_VIDIX], test x"$have_vidix" = x"yes") + + + dnl Xinerama + AC_ARG_ENABLE([xinerama], + [AS_HELP_STRING([--enable-xinerama], [enable support for Xinerama])], + [test x"$enableval" != x"no" && enableval="yes"], + [test $default_enable_xinerama = disable && enable_xinerama="no"]) + if test x"$enable_xinerama" != x"no"; then + if test x"$no_x" != x"yes"; then + PKG_CHECK_MODULES([XINERAMA], [xinerama], [have_xinerama=yes], + [AC_CHECK_LIB([Xinerama], [XineramaQueryExtension], + [XINERAMA_LIBS="-lXinerama" have_xinerama="yes"], [], + [$X_LIBS])]) + fi + if test x"$enable_xinerama" = x"yes" && test x"$have_xinerama" != x"yes"; then + AC_MSG_ERROR([Xinerama support requested, but Xinerama not found or X disabled]) + elif test x"$have_xinerama" = x"yes"; then + AC_DEFINE([HAVE_XINERAMA], 1, [Define this if you have libXinerama installed]) + X_LIBS="$X_LIBS $XINERAMA_LIBS" + fi + fi + AM_CONDITIONAL([ENABLE_XINERAMA], [test x"$have_xinerama" = x"yes"]) + + + dnl xv + XINE_XV_SUPPORT ])dnl XINE_VIDEO_OUT_PLUGINS diff --git a/m4/x11.m4 b/m4/x11.m4 deleted file mode 100644 index 700624450..000000000 --- a/m4/x11.m4 +++ /dev/null @@ -1,64 +0,0 @@ -dnl --------------------------------------------- -dnl Checks for X11 -dnl --------------------------------------------- - -AC_DEFUN([XINE_X11_SUPPORT], [ - dnl This is more than a little bit weird, but ... AC_PATH_EXTRA has an - dnl AC_ARG_WITH in it for x, so it'll be processed by the time that we - dnl get here. Check the result of that to see if X support is enabled - dnl or disabled from the command-line. If it's enabled, do a package - dnl check for X libraries first. If that fails, do the normal autoconf - dnl AC_PATH_XTRA check and other stuff. - if test "x$with_x" != "xno"; then - PKG_CHECK_MODULES([X], [x11 xext], [], [ - AC_PATH_XTRA - - dnl Set xv_path if its not done already - dnl we do it here before rewriting X_LIBS - if test x"$xv_path" = x""; then - xv_path="`echo $X_LIBS | sed -e 's/\-L\(.*\)/\1/'`" - fi - - dnl ---------------------------------------------- - dnl Check for XShm support (required with X) - dnl ---------------------------------------------- - - if test "x$no_x" != "xyes"; then - ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - AC_CHECK_HEADERS([X11/extensions/XShm.h], [], - [AC_MSG_ERROR([XShm extension is required])]) - AC_CHECK_LIB([Xext], [main], [], - [AC_MSG_ERROR([libXext is required])], [$X_LIBS]) - CPPFLAGS="$ac_save_CPPFLAGS" - X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 -lXext" - fi - ]) - else - no_x="yes" - fi - - if test "x$no_x" != "xyes"; then - AC_DEFINE([HAVE_X11], 1, [Define this if you have X11R6 installed]) - fi - AM_CONDITIONAL([HAVE_X11], [test x"$no_x" != x"yes"]) - - dnl TODO: Take X_CFLAGS and split it into X_CFLAGS and X_CPPFLAGS - dnl -D, -I, and -U should all be in X_CPPFLAGS. Anything else should - dnl be in X_CFLAGS. For now, just leave X_CFLAGS alone and treat it - dnl as CFLAGS. - - dnl --------------------------------------------- - dnl Locate libraries needed for X health check - dnl --------------------------------------------- - -soname_script="/[[0-9]]$/! d; s%^.*/%% -t q -b -:q -q" - x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.so"* "${x_libraries:-/usr/lib}/libX11.so"* 2>/dev/null | sed -e \"${soname_script}\"`" - AC_DEFINE_UNQUOTED([LIBX11_SO], "${x_lib_location:-libX11.so}", [The soname of libX11, needed for dlopen()]) - x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.so"* "${x_libraries:-/usr/lib}/libXv.so"* 2>/dev/null | sed -e \"${soname_script}\"`" - AC_DEFINE_UNQUOTED([LIBXV_SO], "${x_lib_location:-libXv.so}", [The soname of libXv, needed for dlopen()]) -]) @@ -1,135 +1,58 @@ -# AC_FIND_LIBXV_IMPL (LIB) -# ------------------------- -# -AC_DEFUN([AC_PATH_LIBXV_IMPL], -[ - AC_MSG_CHECKING([for $1]) - if test -f "$xv_path/$1"; then - AC_MSG_RESULT([found $1 in $xv_path]) - XV_LIBS="$1" - else - if test -f "/usr/lib/$1"; then - AC_MSG_RESULT([found $1 in /usr/lib]) - XV_LIBS="$1" - else - AC_MSG_RESULT([$1 not found in $xv_path]) - fi - fi -]) - -AC_DEFUN([AC_TEST_LIBXV], -[ - dnl ----------------------------------------------- - dnl Testing installed Xv library - dnl ----------------------------------------------- - AC_CHECK_LIB(Xv, XvShmCreateImage, - [ - AC_DEFINE(HAVE_XV, - 1, - [Define this if you have libXv installed]) - - ac_have_xv="yes" - case x$XV_LIBS in - x*.a) - AC_DEFINE(HAVE_XV_STATIC, - 1, - [Define this if you have libXv.a]) - ac_have_xv_static="yes" - XV_LIBS="$xv_path/$XV_LIBS" - ;; - x*.so) - XV_LIBS=`echo $XV_LIBS | sed 's/^lib/-l/; s/\.so$//'` - ;; - *) - AC_MSG_ERROR([sorry, I don't know about $XV_LIBS]) - ;; - esac - ], - , - [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS]) - - dnl ----------------------------------------------- - dnl xine_check use Xv functions API. - dnl ----------------------------------------------- - if test x$ac_have_xv = "xyes"; then - EXTRA_X_LIBS="-L$xv_path $XV_LIBS -lXext" - EXTRA_X_CFLAGS="" - fi - AC_SUBST(XV_LIBS) - AC_SUBST(EXTRA_X_LIBS) - AC_SUBST(EXTRA_X_CFLAGS) -]) - -# AC_PATH_LIBXV -# ------------------------- -# -AC_DEFUN([AC_FIND_LIBXV], -[ - # Ensure that AC_PATH_XTRA is executed before this - AC_REQUIRE([AC_PATH_XTRA]) - - if test x$xv_path = x; then - xv_path=/usr/X11R6/lib - fi - - if test "x$xv_prefer_shared" = "xyes"; then - AC_PATH_LIBXV_IMPL([libXv.so]) - else - AC_PATH_LIBXV_IMPL([libXv.a]) - fi - - # Try the other lib if prefered failed - if test x$XV_LIBS = x; then - if ! test "x$xv_prefer_shared" = "xyes"; then - AC_PATH_LIBXV_IMPL([libXv.so]) - else - AC_PATH_LIBXV_IMPL([libXv.a]) - fi - fi - - if ! test x$XV_LIBS = x; then - AC_TEST_LIBXV - fi -]) - -dnl ---------------------------------------------- -dnl Check for Xv and XvMC support -dnl ---------------------------------------------- - AC_DEFUN([XINE_XV_SUPPORT], [ dnl With recent XFree86 or Xorg, dynamic linking is preferred! dnl Only dynamic linking is possible when using libtool < 1.4.0 - - AC_ARG_WITH(xv-path, AS_HELP_STRING([--with-xv-path=path], [where libXv is installed]), - xv_path="$withval",) + AC_ARG_WITH([xv-path], + [AS_HELP_STRING([--with-xv-path=path], [where libXv is installed])]) AC_ARG_ENABLE([static-xv], - AS_HELP_STRING([--enable-static-xv],[Enable this to force linking against libXv.a])) - - if test "x$enable_static_xv" = "xyes"; then - xv_prefer_shared="no" - else - xv_prefer_shared="yes" - fi - - if test "x$no_x" != "xyes"; then - PKG_CHECK_MODULES([XV], [xv], [ - ac_have_xv="yes" - AC_DEFINE([HAVE_XV], [1], [Define this if you have libXv installed]) - ], [AC_FIND_LIBXV]) - fi - AM_CONDITIONAL(HAVE_XV, test "x$ac_have_xv" = "xyes") - - + [AS_HELP_STRING([--enable-static-xv], [Enable this to force linking against libXv.a])], + [test x"$enableval" != x"no" && xv_prefer_static="yes"], [xv_prefer_static="no"]) case "$host_or_hostalias" in - hppa*) - if test "x$ac_have_xv_static" = "xyes"; then - echo "warning: hppa linker - disabling static libXv" - XV_LIBS="libXv.so" + hppa*) xv_libexts="$acl_cv_shlibext" ;; + *) + if test x"$xv_prefer_static" = x"yes"; then + xv_libexts="$acl_cv_libext $acl_cv_shlibext" + else + xv_libexts="$acl_cv_shlibext $acl_cv_libext" fi ;; esac + if test x"$no_x" != x"yes"; then + PKG_CHECK_MODULES([XV], [xv], [have_xv=yes], [have_xv=no]) + if test x"$have_xv" = x"no"; then + dnl No Xv package -- search for it + for xv_libext in $xv_libexts; do + xv_lib="libXv.$xv_libext" + AC_MSG_CHECKING([for $xv_lib]) + for xv_try_path in "$with_xv_path" "$x_libraries" /usr/X11R6/lib /usr/lib; do + if test x"$xv_try_path" != x"" && test -f "$xv_try_path/$xv_lib"; then + case $xv_lib in + *.$acl_cv_libext) xv_try_libs="$xv_try_path/$xv_lib" ;; + *.$acl_cv_shlibext) xv_try_libs="-L$xv_try_path -lXv" ;; + esac + ac_save_LIBS="$LIBS" LIBS="$xv_try_libs $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvShmCreateImage()]])], [have_xv=yes], []) + LIBS="$ac_save_LIBS" + if test x"$have_xv" = x"yes"; then + AC_MSG_RESULT([$xv_try_path]) + XV_LIBS="$xv_try_libs" + break + fi + fi + done + test x"$have_xv" = x"yes" && break + AC_MSG_RESULT([no]) + done + fi + + if test x"$have_xv" = x"yes"; then + AC_DEFINE([HAVE_XV], 1, [Define this if you have libXv installed]) + fi + fi + AM_CONDITIONAL([HAVE_XV], [test x"$have_xv" = x"yes"]) + + dnl dnl Check if we can enable the xxmc plugin. dnl diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am index a37eae3eb..bb3552039 100644 --- a/src/video_out/Makefile.am +++ b/src/video_out/Makefile.am @@ -38,7 +38,7 @@ endif if HAVE_XXMC xxmc_module = xineplug_vo_out_xxmc.la endif -if HAVE_OPENGL +if ENABLE_OPENGL opengl_module = xineplug_vo_out_opengl.la endif if ENABLE_SYNCFB |