diff options
-rw-r--r-- | m4/audio_out.m4 | 122 | ||||
-rw-r--r-- | m4/input.m4 | 75 | ||||
-rw-r--r-- | m4/video_out.m4 | 155 | ||||
-rw-r--r-- | m4/xine.m4 | 24 |
4 files changed, 156 insertions, 220 deletions
diff --git a/m4/audio_out.m4 b/m4/audio_out.m4 index 569d72cc2..85ea5cd00 100644 --- a/m4/audio_out.m4 +++ b/m4/audio_out.m4 @@ -15,60 +15,59 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ dnl - PulseAudio has been tested on Linux, Solaris, FreeBSD, Windows dnl - SunAudio is NetBSD, OpenBSD, Solaris (anything else?) - default_enable_coreaudio=disable - default_enable_irixal=disable - default_enable_oss=enable - default_enable_sunaudio=disable - - default_with_alsa=without - default_with_esound=with - default_with_fusionsound=without - default_with_jack=without - default_with_pulseaudio=without + default_enable_coreaudio=no + default_enable_irixal=no + default_enable_oss=yes + default_enable_sunaudio=no + default_enable_sndio=no + + default_with_alsa=no + default_with_esound=yes + default_with_fusionsound=no + default_with_jack=no + default_with_pulseaudio=no case "$host_os" in cygwin* | mingw*) - default_enable_oss=disable - default_with_pulseaudio=with + default_enable_oss=no + default_with_pulseaudio=yes ;; darwin*) - default_enable_coreaudio=enable - default_with_jack=with - default_enable_oss=disable + default_enable_coreaudio=yes + default_with_jack=yes + default_enable_oss=no ;; freebsd*) - default_with_pulseaudio=with + default_with_pulseaudio=yes ;; irix*) - default_enable_irixal=enable - default_enable_oss=disable + default_enable_irixal=yes + default_enable_oss=no ;; linux*) - default_with_alsa=with - default_with_jack=with - default_with_pulseaudio=with + default_with_alsa=yes + default_with_jack=yes + default_with_pulseaudio=yes ;; netbsd*) - default_enable_sunaudio=enable + default_enable_sunaudio=yes ;; openbsd*) - default_enable_sunaudio=enable + default_enable_sunaudio=yes + default_enable_sndio=yes ;; solaris*) - default_with_pulseaudio=with - default_enable_sunaudio=enable + default_with_pulseaudio=yes + default_enable_sunaudio=yes ;; esac dnl Alsa support - AC_ARG_WITH([alsa], - [AS_HELP_STRING([--with-alsa], [Build with ALSA audio output support])], - [test x"$withval" != x"no" && with_alsa="yes"], - [test $default_with_alsa = without && with_alsa="no"]) + XINE_ARG_WITH([alsa], [Build with ALSA audio output support]) if test x"$with_alsa" != x"no"; then PKG_CHECK_MODULES([ALSA], [alsa >= 0.9.0], [have_alsa=yes], [have_alsa=no]) - if test x"$with_alsa" = x"yes" && test x"$have_alsa" != x"yes"; then + if test x"$hard_with_alsa" = x"yes" && test x"$have_alsa" != x"yes"; then AC_MSG_ERROR([ALSA support requested but not found.]) elif test x"$have_alsa" = x"yes"; then dnl This is needed by src/input/input_v4l.c @@ -79,17 +78,14 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ dnl CoreAudio for Mac OS X - AC_ARG_ENABLE([coreaudio], - [AS_HELP_STRING([--enable-coreaudio], [Enable support for Mac OS X CoreAudio])], - [test x"$enableval" != x"no" && enable_coreaudio="yes"], - [test $default_enable_coreaudio = disable && enable_coreaudio="no"]) + XINE_ARG_ENABLE([coreaudio], [Enable support for Mac OS X CoreAudio]) if test x"$enable_coreaudio" != x"no"; then AC_MSG_CHECKING([for CoreAudio frameworks]) ac_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreAudio -framework AudioUnit" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0]])], [have_coreaudio=yes], [have_coreaudio=no]) LIBS="$ac_save_LIBS" AC_MSG_RESULT([$have_coreaudio]) - if test x"$enable_coreaudio" = x"yes" && test x"$have_coreaudio" != x"yes"; then + if test x"hard_$enable_coreaudio" = x"yes" && test x"$have_coreaudio" != x"yes"; then AC_MSG_ERROR([CoreAudio support requested, but CoreAudio not found]) fi fi @@ -97,13 +93,10 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ dnl EsounD support - AC_ARG_WITH([esound], - [AS_HELP_STRING([--with-esound], [Build with EsounD audio output support])], - [test x"$withval" != x"no" && with_esound="yes"], - [test $default_with_esound = without && with_esound="no"]) + XINE_ARG_WITH([esound], [Build with EsounD audio output support]) if test x"$with_esound" != x"no"; then PKG_CHECK_MODULES([ESD], [esound], [have_esound=yes], [have_esound=no]) - if test x"$with_esound" = x"yes" && test x"$have_esound" != x"yes"; then + if test x"$hard_with_esound" = x"yes" && test x"$have_esound" != x"yes"; then AC_MSG_ERROR([EsounD support requested, but EsounD not found]) fi fi @@ -111,13 +104,10 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ dnl FusionSound support - AC_ARG_WITH([fusionsound], - [AS_HELP_STRING([--with-fusionsound], [Build with FunsionSound audio output support])], - [test x"$withval" != x"no" && with_fusionsound="yes"], - [test $default_with_fusionsound = without && with_fusionsound="no"]) + XINE_ARG_WITH([fusionsound], [Build with FunsionSound audio output support]) if test x"$with_fusionsound" != x"no"; then PKG_CHECK_MODULES([FUSIONSOUND], [fusionsound >= 0.9.23], [have_fusionsound=yes], [have_fusionsound=no]) - if test x"$with_fusionsound" = x"yes" && test x"$have_fusionsound" != x"yes"; then + if test x"$hard_with_fusionsound" = x"yes" && test x"$have_fusionsound" != x"yes"; then AC_MSG_ERROR([FusionSound support requested, but FusionSound not found]) fi fi @@ -125,10 +115,7 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ dnl IRIX style audio interface - AC_ARG_ENABLE([irixal], - [AS_HELP_STRING([--enable-irixal], [Enable support for IRIX libaudio])], - [test x"$enableval" != x"no" && enable_irixal="yes"], - [test $default_enable_irixal = disable && enable_irixal="no"]) + XINE_ARG_ENABLE([irixal], [Enable support for IRIX libaudio]) if test x"$enable_irixal" != x"no"; then AC_CACHE_CHECK([for IRIX libaudio support], [am_cv_have_irixal], [AC_CHECK_HEADER([dmedia/audio.h], @@ -145,13 +132,10 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ dnl JACK support - AC_ARG_WITH([jack], - [AS_HELP_STRING([--with-jack], [Build with Jack support])], - [test x"$withval" != x"no" && with_jack="yes"], - [test $default_with_jack = without && with_jack="no"]) + XINE_ARG_WITH([jack], [Build with Jack support]) if test x"$with_jack" != x"no"; then PKG_CHECK_MODULES([JACK], [jack >= 0.100], [have_jack=yes], [have_jack=no]) - if test x"$with_jack" = x"yes" && test x"$have_jack" != x"yes"; then + if test x"$hard_with_jack" = x"yes" && test x"$have_jack" != x"yes"; then AC_MSG_ERROR([Jack support requested, but Jack not found]) fi fi @@ -159,10 +143,7 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ dnl OSS (Open Sound System) - AC_ARG_ENABLE([oss], - [AS_HELP_STRING([--enable-oss], [Enable OSS (Open Sound System) support])], - [test x"$enableval" != x"no" && enable_oss="yes"], - [test $default_enable_oss = disable && enable_oss="no"]) + XINE_ARG_ENABLE([oss], [Enable OSS (Open Sound System) support]) if test x"$enable_oss" != x"no"; then AC_CHECK_HEADERS([sys/soundcard.h machine/soundcard.h soundcard.h], [break]) AC_CHECK_DECL([SNDCTL_DSP_SETFRAGMENT], [have_oss=yes], [have_oss=no], @@ -175,7 +156,7 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ #ifdef HAVE_SOUNDCARD_H # include <soundcard.h> #endif]) - if test x"$enable_oss" = x"yes" && test x"$have_oss" != x"yes"; then + if test x"$hard_enable_oss" = x"yes" && test x"$have_oss" != x"yes"; then AC_MSG_ERROR([OSS support requested, but OSS not found]) fi fi @@ -183,13 +164,10 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ dnl PulseAudio - AC_ARG_WITH([pulseaudio], - [AS_HELP_STRING([--with-pulseaudio], [Build with PulseAudio support])], - [test x"$withval" != x"no" && with_pulseaudio="yes"], - [test $default_with_pulseaudio = without && with_pulseaudio="no"]) + XINE_ARG_WITH([pulseaudio], [Build with PulseAudio support]) if test x"$with_pulseaudio" != x"no"; then PKG_CHECK_MODULES([PULSEAUDIO], [libpulse], [have_pulseaudio="yes"], [have_pulseaudio="no"]) - if test x"$with_pulseaudio" = x"yes" && test x"$have_pulseaudio" != x"yes"; then + if test x"$hard_with_pulseaudio" = x"yes" && test x"$have_pulseaudio" != x"yes"; then AC_MSG_ERROR([PulseAudio support requested, but PulseAudio not found]) fi if test x"$have_pulseaudio" = xyes; then @@ -207,10 +185,7 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ dnl SUN style audio interface - AC_ARG_ENABLE([sunaudio], - [AS_HELP_STRING([--enable-sunaudio], [Enable Sun audio support])], - [test x"$enableval" != x"no" && enable_sunaudio="yes"], - [test $default_enable_sunaudio = disable && enable_sunaudio="no"]) + XINE_ARG_ENABLE([sunaudio], [Enable Sun audio support]) if test x"$enable_sunaudio" != x"no"; then AC_MSG_CHECKING([for Sun audio support]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> @@ -218,7 +193,7 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ [[audio_info_t audio_info; AUDIO_INITINFO(&audio_info)]])], [have_sunaudio=yes], [have_sunaudio=no]) AC_MSG_RESULT([$have_sunaudio]) - if test x"$enable_sunaudio" = x"yes" && test x"$have_sunaudio" != x"yes"; then + if test x"$hard_enable_sunaudio" = x"yes" && test x"$have_sunaudio" != x"yes"; then AC_MSG_ERROR([Sun audio support requested, but Sun audio not found]) elif test x"$have_sunaudio" = x"yes"; then dnl NetBSD and OpenBSD don't have this, but check for it @@ -230,14 +205,11 @@ AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [ dnl sndio support - AC_ARG_ENABLE([sndio], - [AS_HELP_STRING([--without-sndio], [Build without sndio support])], - [test x"$enableval" != x"no" && enable_sndio="yes"], - [test x"$default_enable_sndio" = x"disable" && enable_sndio="no"]) - if test "x$enable_sndio" != "xno"; then + XINE_ARG_ENABLE([sndio], [Enable sndio support]) + if test x"$enable_sndio" != "xno"; then AC_CHECK_LIB([sndio], [sio_open], [SNDIO_LIBS=-lsndio; have_sndio=yes], [have_sndio=no]) - if test "x$enable_sndio" = "xyes" && test "x$have_sndio" = "xno"; then + if test "x$hard_enable_sndio" = "xyes" && test "x$have_sndio" = "xno"; then AC_MSG_ERROR([sndio support requested, but sndio not found]) fi fi diff --git a/m4/input.m4 b/m4/input.m4 index 1e2f72113..2e709312b 100644 --- a/m4/input.m4 +++ b/m4/input.m4 @@ -9,46 +9,45 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ dnl - dvb is Linux only dnl - v4l is Linux only - default_enable_dvb=disable - default_enable_gnomevfs=enable - default_enable_samba=enable - default_enable_v4l=disable - default_enable_vcd=enable - default_enable_vcdo=disable + default_enable_dvb=no + default_enable_gnomevfs=yes + default_enable_samba=yes + default_enable_v4l=no + default_enable_vcd=yes + default_enable_vcdo=no + default_enable_vdr=yes + default_with_external_dvdnav=no case "$host_os" in cygwin* | mingw*) - default_enable_gnomevfs=disable - default_enable_samba=disable + default_enable_gnomevfs=no + default_enable_samba=no ;; darwin*) - default_enable_gnomevfs=disable - default_enable_samba=disable + default_enable_gnomevfs=no + default_enable_samba=no ;; freebsd*) - default_enable_vcdo=enable + default_enable_vcdo=yes ;; linux*) - default_enable_dvb=enable - default_enable_v4l=enable - default_enable_vcdo=enable + default_enable_dvb=yes + default_enable_v4l=yes + default_enable_vcdo=yes ;; solaris*) - default_enable_vcdo=enable + default_enable_vcdo=yes ;; esac dnl dvb - AC_ARG_ENABLE([dvb], - [AS_HELP_STRING([--enable-dvb], [Enable support for the DVB plugin (Linux only)])], - [test x"$enableval" != x"no" && enable_dvb="yes"], - [test $default_enable_dvb = disable && enable_dvb="no"]) + XINE_ARG_ENABLE([dvb], [Enable support for the DVB plugin (Linux only)]) if test x"$enable_dvb" != x"no"; then case "$host_os" in linux*) have_dvb=yes ;; *) have_dvb=no ;; esac - if test x"$enable_dvb" = x"yes" && test x"$have_dvb" != x"yes"; then + if test x"$hard_enable_dvb" = x"yes" && test x"$have_dvb" != x"yes"; then AC_MSG_ERROR([DVB support requested, but DVB not found]) fi fi @@ -56,13 +55,10 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ dnl gnome-vfs - AC_ARG_ENABLE([gnomevfs], - [AS_HELP_STRING([--enable-gnomevfs], [Enable support for the Gnome-VFS plugin])], - [test x"$enableval" != x"no" && enable_gnomevfs="yes"], - [test $default_enable_gnomevfs = disable && enable_gnomevfs="no"]) + XINE_ARG_ENABLE([gnomevfs], [Enable support for the Gnome-VFS plugin]) if test x"$enable_gnomevfs" != x"no"; then PKG_CHECK_MODULES([GNOME_VFS], [gnome-vfs-2.0], [have_gnomevfs=yes], [have_gnome_vfs=no]) - if test x"$enable_gnomevfs" = x"yes" && test x"$have_gnomevfs" != x"yes"; then + if test x"$hard_enable_gnomevfs" = x"yes" && test x"$have_gnomevfs" != x"yes"; then AC_MSG_ERROR([Gnome-VFS support requested, but Gnome-VFS not found]) fi fi @@ -70,15 +66,12 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ dnl libsmbclient - AC_ARG_ENABLE([samba], - [AS_HELP_STRING([--enable-samba], [Enable support for the Samba plugin])], - [test x"$enableval" != x"no" && enable_samba="yes"], - [test $default_enable_samba = disable && enable_samba="no"]) + XINE_ARG_ENABLE([samba], [Enable support for the Samba plugin]) if test x"$enable_samba" != x"no"; then AC_CHECK_LIB([smbclient], [smbc_init], [AC_CHECK_HEADERS([libsmbclient.h], [have_samba=yes LIBSMBCLIENT_LIBS="-lsmbclient"])]) AC_SUBST(LIBSMBCLIENT_LIBS) - if test x"$enable_samba" = x"yes" && test x"$have_samba" != x"yes"; then + if test x"$hard_enable_samba" = x"yes" && test x"$have_samba" != x"yes"; then AC_MSG_ERROR([Samba support requested, but Samba not found]) fi fi @@ -86,15 +79,12 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ dnl video-for-linux (v4l) - AC_ARG_ENABLE([v4l], - [AS_HELP_STRING([--enable-v4l], [Enable Video4Linux support])], - [test x"$enableval" != x"no" && enable_v4l="yes"], - [test $default_enable_v4l = disable && enable_v4l="no"]) + XINE_ARG_ENABLE([v4l], [Enable Video4Linux support]) if test x"$enable_v4l" != x"no"; then have_v4l=yes AC_CHECK_HEADERS([linux/videodev.h linux/videodev2.h], , [have_v4l=no]) AC_CHECK_HEADERS([asm/types.h]) - if test x"$enable_v4l" = x"yes" && test x"$have_v4l" != x"yes"; then + if test x"$hard_enable_v4l" = x"yes" && test x"$have_v4l" != x"yes"; then AC_MSG_ERROR([Video4Linux support requested, but prerequisite headers not found.]) fi fi @@ -103,9 +93,7 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ dnl dvdnav dnl XXX: This could be cleaned up so that code does not have to ifdef so much - AC_ARG_WITH([external-dvdnav], - [AS_HELP_STRING([--with-external-dvdnav], [Use external dvdnav library (not recommended)])], - [test x"$withval" != x"no" && with_external_dvdnav="yes"], [with_external_dvdnav="no"]) + XINE_ARG_WITH([external-dvdnav], [Use external dvdnav library (not recommended)]) if test x"$with_external_dvdnav" != x"no"; then ACX_PACKAGE_CHECK([DVDNAV], [0.1.9], [dvdnav-config], [AC_DEFINE([HAVE_DVDNAV], 1, [Define this if you have a suitable version of libdvdnav])], @@ -118,10 +106,7 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ dnl Video CD dnl XXX: This could be cleaned up so that code does not have it ifdef so much - AC_ARG_ENABLE([vcd], - [AS_HELP_STRING([--enable-vcd], [Enable VCD (VideoCD) support])], - [test x"$enableval" != x"no" && enable_vcd="yes"], - [test $default_enable_vcd = disable && enable_vcd="no"]) + XINE_ARG_ENABLE([vcd], [Enable VCD (VideoCD) support]) if test x"$enable_vcd" != x"no"; then PKG_CHECK_MODULES([LIBCDIO], [libcdio >= 0.71]) PKG_CHECK_MODULES([LIBVCDINFO], [libvcdinfo >= 0.7.23]) @@ -129,7 +114,7 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ fi enable_vcdo=no - test $default_enable_vcdo = enable && test x"$enable_vcd" != x"no" && enable_vcdo=yes + test $default_enable_vcdo = no && test x"$enable_vcd" != x"no" && enable_vcdo=yes AC_DEFINE([LIBCDIO_CONFIG_H], 1, [Get of rid system libcdio build configuration]) AC_DEFINE([EXTERNAL_LIBCDIO_CONFIG_H], 1, [Get of rid system libcdio build configuration]) @@ -142,8 +127,6 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ dnl vdr - AC_ARG_ENABLE([vdr], - [AS_HELP_STRING([--enable-vdr], [Enable support for the VDR plugin (default: enabled)])], - [test x"$enableval" != x"no" && enable_vdr="yes"]) + XINE_ARG_ENABLE([vdr], [Enable support for the VDR plugin (default: enabled)]) AM_CONDITIONAL([ENABLE_VDR], [test x"$enable_vdr" != x"no"]) ]) diff --git a/m4/video_out.m4 b/m4/video_out.m4 index 2a0867b5f..1141e5ad2 100644 --- a/m4/video_out.m4 +++ b/m4/video_out.m4 @@ -14,54 +14,53 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl - Vidix is FreeBSD and Linux only dnl - XvMC and xxmc depend on Xv - default_enable_aalib=enable - default_enable_dha_kmod=disable - 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_vidix=disable - default_enable_xinerama=enable - default_enable_xvmc=enable - - default_with_caca=with - default_with_libstk=without - default_with_sdl=with - default_with_xcb=with + default_enable_aalib=yes + default_enable_dha_kmod=no + default_enable_directfb=no + default_enable_directx=no + default_enable_dxr3=no + default_enable_glu=yes + default_enable_fb=no + default_enable_macosx_video=no + default_enable_opengl=yes + default_enable_vidix=no + default_enable_xinerama=yes + default_enable_xvmc=yes + default_enable_vdpau=no + + default_with_caca=yes + default_with_libstk=no + default_with_sdl=yes + default_with_xcb=yes case "$host_os" in cygwin* | mingw*) - default_enable_directx=enable + default_enable_directx=yes ;; darwin*) - default_enable_macosx_video=enable + default_enable_macosx_video=yes ;; freebsd*) - default_enable_vidix=enable + default_enable_vidix=yes ;; linux*) - default_enable_dxr3=enable - default_enable_linuxfb=enable - default_enable_vidix=enable + default_enable_dxr3=yes + default_enable_fb=yes + default_enable_vidix=yes + default_enable_vdpau=yes enable_linux=yes ;; esac dnl Ascii-Art - AC_ARG_ENABLE([aalib], - [AS_HELP_STRING([--enable-aalib], [enable support for AALIB])], - [test x"$enableval" != x"no" && enable_aalib="yes"], - [test $default_enable_aalib = disable && enable_aalib="no"]) + XINE_ARG_ENABLE([aalib], [enable support for AALIB]) if test x"$enable_aalib" != x"no"; then ACX_PACKAGE_CHECK([AALIB], [1.4], [aalib-config], [have_aalib=yes], [have_aalib=no]) - if test x"$enable_aalib" = x"yes" && test x"$have_aalib" != x"yes"; then + if test x"$hard_enable_aalib" = x"yes" && test x"$have_aalib" != x"yes"; then AC_MSG_ERROR([aalib support requested, but aalib not found]) fi fi @@ -69,13 +68,10 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl Color AsCii Art - AC_ARG_WITH([caca], - [AS_HELP_STRING([--with-caca], [enable support for CACA])], - [test x"$withval" != x"no" && with_caca="yes"], - [test $default_with_caca = without && with_caca=no]) + XINE_ARG_WITH([caca], [enable support for CACA]) if test x"$with_caca" != x"no"; then PKG_CHECK_MODULES([CACA], [caca >= 0.99beta14 cucul >= 0.99beta14], [have_caca="yes"], [have_caca="no"]) - if test x"$with_caca" = x"yes" && test x"$have_caca" != x"yes"; then + if test x"$hard_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 @@ -83,10 +79,7 @@ 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 x"$enableval" != x"no" && enable_dha_kmod="yes"], - [test $default_enable_dha_kmod = disable && enable_dha_kmod="no"]) + XINE_ARG_ENABLE([dha-kmod], [build Linux DHA kernel module]) 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])], @@ -101,13 +94,10 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl DirectFB - AC_ARG_ENABLE([directfb], - [AS_HELP_STRING([--enable-directfb], [enable use of DirectFB])], - [test x"$enableval" != x"no" && enable_directfb="yes"], - [test $default_enable_directfb = disable && enable_directfb="no"]) + XINE_ARG_ENABLE([directfb], [enable use of DirectFB]) if test "x$enable_directfb" = "xyes"; then 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 + if test x"$hard_enable_directfb" = x"yes" && test x"$have_directfb" != x"yes"; then AC_MSG_ERROR([DirectFB support requested, but DirectFB not found]) fi fi @@ -119,10 +109,7 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl dxr3 / hollywood plus card - AC_ARG_ENABLE([dxr3], - [AS_HELP_STRING([--enable-dxr3], [enable support for DXR3/HW+])], - [test x"$enableval" != x"no" && enable_dxr3="yes"], - [test $default_enable_dxr3 = disable && enable_dxr3="no"]) + XINE_ARG_ENABLE([dxr3], [enable support for DXR3/HW+]) if test x"$enable_dxr3" != x"no"; then have_dxr3=yes AC_MSG_RESULT([*** checking for a supported mpeg encoder]) @@ -155,13 +142,10 @@ 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 x"$withval" != x"no" && with_libstk="yes"], - [test $default_with_libstk = without && with_libstk="no"]) + XINE_ARG_WITH([libstk], [Build with STK surface video driver]) 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"yes"; then + if test x"$hard_with_libstk" = x"yes" && test x"$have_libstk" != x"yes"; then AC_MSG_ERROR([libstk support requested, but libstk not found]) fi fi @@ -169,13 +153,10 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl Linux framebuffer device - AC_ARG_ENABLE([fb], - [AS_HELP_STRING([--enable-fb], [enable Linux framebuffer support])], - [test x"$enableval" != x"no" && enable_fb="yes"], - [test $default_enable_linuxfb = disable && enable_linuxfb="no"]) - if test x"$enable_linuxfb" != x"no"; then + XINE_ARG_ENABLE([fb], [enable Linux framebuffer support]) + if test x"$enable_fb" != x"no"; then 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 + if test x"$hard_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 @@ -186,17 +167,14 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl Mac OS X OpenGL video output - AC_ARG_ENABLE([macosx-video], - [AS_HELP_STRING([--enable-macosx-video], [enable support for Mac OS X OpenGL video output])], - [test x"$enableval" != x"no" && enable_macosx_video="yes"], - [test $default_enable_macosx_video = disable && enable_macosx_video="no"]) + XINE_ARG_ENABLE([macosx-video], [enable support for Mac OS X OpenGL video output]) 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 + if test x"$hard_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 @@ -204,17 +182,11 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ 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"]) + XINE_ARG_ENABLE([opengl], [enable support for X-based OpenGL video output]) + XINE_ARG_ENABLE([glu], [enable support for GLU in the OpenGL plugin]) if test x"$enable_opengl" != x"no"; then if test x"$no_x" = x"yes"; then - if test x"$enable_opengl" = x"yes"; then + if test x"$hard_enable_opengl" = x"yes"; then AC_MSG_ERROR([OpenGL support requested, but X support is disabled]) fi enable_opengl=no @@ -225,7 +197,7 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ 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 + if test x"$hard_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" @@ -243,7 +215,7 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ 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 + if test x"$hard_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]) @@ -260,13 +232,10 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl SDL - AC_ARG_WITH([sdl], - [AS_HELP_STRING([--with-sdl], [Enable support for SDL video output])], - [test x"$withval" != x"no" && with_sdl="yes"], - [test $default_with_sdl = without && with_sdl="no"]) + XINE_ARG_WITH([sdl], [Enable support for SDL video output]) 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"yes"; then + if test x"$hard_with_sdl" = x"yes" && test x"$have_sdl" != x"yes"; then AC_MSG_ERROR([SDL support requested, but SDL not found]) fi fi @@ -292,13 +261,10 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl xcb - AC_ARG_WITH([xcb], - [AS_HELP_STRING([--with-xcb], [Enable support for XCB video out plugins])], - [test x"$withval" != x"no" && with_xcb="yes"], - [test $default_with_xcb = without && with_xcb="no"]) + XINE_ARG_WITH([xcb], [Enable support for XCB video out plugins]) 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"$enable_xcb" = x"yes" && test x"$have_xcb" != x"yes"; then + if test x"$hard_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]) @@ -312,10 +278,7 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl vidix/libdha dnl Requires X11 or Linux framebuffer - AC_ARG_ENABLE([vidix], - [AS_HELP_STRING([--enable-vidix], [enable support for Vidix])], - [test x"$enableval" != x"no" && enable_vidix="yes"], - [test $default_enable_vidix = disable && enable_vidix="no"]) + XINE_ARG_ENABLE([vidix], [enable support for Vidix]) if test x"$enable_vidix" != x"no"; then have_vidix=yes if test x"$ac_cv_prog_AWK" = x"no"; then @@ -331,7 +294,7 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ esac fi fi - if test x"$enable_vidix" = x"yes" && test x"$have_vidix" != x"yes"; then + if test x"$hard_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 @@ -339,10 +302,7 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl Xinerama - AC_ARG_ENABLE([xinerama], - [AS_HELP_STRING([--enable-xinerama], [enable support for Xinerama])], - [test x"$enableval" != x"no" && enable_xinerama="yes"], - [test $default_enable_xinerama = disable && enable_xinerama="no"]) + XINE_ARG_ENABLE([xinerama], [enable support for Xinerama]) if test x"$enable_xinerama" != x"no"; then if test x"$no_x" != x"yes"; then PKG_CHECK_MODULES([XINERAMA], [xinerama], [have_xinerama=yes], @@ -413,10 +373,7 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl XvMC - AC_ARG_ENABLE([xvmc], - [AS_HELP_STRING([--enable-xvmc], [Disable xxmc and XvMC outplut plugins])], - [test x"$enableval" != x"no" && enable_xvmc="yes"], - [test $default_enable_xvmc = disable && enable_xvmc="no"]) + XINE_ARG_ENABLE([xvmc], [Enable xxmc and XvMC outplut plugins]) AC_ARG_WITH([xvmc-path], [AS_HELP_STRING([--with-xvmc-path=PATH], [where libXvMC for the xvmc plugin are installed])], [], [with_xvmc_path="$x_libraries"]) @@ -477,7 +434,7 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" fi have_xvmc_or_xxmc="$have_xvmc"; test x"$have_xxmc" = x"yes" && have_xvmc_or_xxmc=yes - if test x"$enable_xvmc" = x"yes" && test x"$have_xvmc_or_xxmc" != x"yes"; then + if test x"$hard_enable_xvmc" = x"yes" && test x"$have_xvmc_or_xxmc" != x"yes"; then AC_MSG_ERROR([XvMC support requested, but neither XvMC nor xxmc could be found, or X is disabled]) else if test x"$have_xvmc" = x"yes"; then @@ -502,13 +459,13 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ dnl VDPAU - AC_ARG_ENABLE([vdpau], [AS_HELP_STRING([--disable-vdpau], [Disable VDPAU output plugin])]) + XINE_ARG_ENABLE([vdpau], [Disable VDPAU output plugin]) if test x"$no_x" != x"yes" && test x"$enable_vdpau" != x"no"; then AC_CHECK_HEADERS([vdpau/vdpau_x11.h], [have_vdpau=yes], [have_vdpau=no]) if test x"$have_vdpau" = x"yes"; then AC_CHECK_LIB([vdpau], [vdp_device_create_x11], [], [have_vdpau=no], [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS]) fi - if test x"$enable_vdpau" = x"yes" && test x"$have_vdpau" != x"yes"; then + if test x"$hard_enable_vdpau" = x"yes" && test x"$have_vdpau" != x"yes"; then AC_MSG_ERROR([VDPAU support requested, but not all requirements are met]) fi fi diff --git a/m4/xine.m4 b/m4/xine.m4 index 438a69160..02a5e6d8e 100644 --- a/m4/xine.m4 +++ b/m4/xine.m4 @@ -117,3 +117,27 @@ AC_DEFUN([AM_PATH_XINE], [ AC_SUBST(XINE_LIBS) AC_SUBST(XINE_ACFLAGS) ]) + +dnl XINE_ARG_WITH(VARIABLE, HELP-TEXT) +dnl Like AC_ARG_WITH but strictly sets variables +dnl hard_with_VARIABLE = "yes" or "no" if the option is present, else undefined +dnl with_VARIABLE = "yes" or "no" if the option is enabled or disabled +dnl (falls back on default_with_VARIABLE) +dnl if both = yes, error is permissible if missing requirement(s) +AC_DEFUN([XINE_ARG_WITH], [ + if test "x$default_with_[]m4_translit([[$1]], [-], [_])" = x; then + AC_MSG_ERROR([default_with_[]m4_translit([[$1]], [-], [_]) is not set]) + fi + AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1], [$2])], + [test x"$withval" != xno && with_[]m4_translit([[$1]], [-], [_])=yes || with_[]m4_translit([[$1]], [-], [_])=no; hard_with_$1="$with_[]m4_translit([[$1]], [-], [_])"], + [with_[]m4_translit([[$1]], [-], [_])="$default_with_[]m4_translit([[$1]], [-], [_])"; hard_with_[]m4_translit([[$1]], [-], [_])=''])]) + +dnl XINE_ARG_ENABLE(VARIABLE, HELP-TEXT) +dnl Like AC_ARG_WITH_X but wrapping AC_ARG_ENABLE +AC_DEFUN([XINE_ARG_ENABLE], [ + if test "x$default_enable_[]m4_translit([[$1]], [-], [_])" = x; then + AC_MSG_ERROR([default_enable_[]m4_translit([[$1]], [-], [_]) is not set]) + fi + AC_ARG_ENABLE([$1], [AS_HELP_STRING([--enable-$1], [$2])], + [test x"$enableval" != xno && enable_[]m4_translit([[$1]], [-], [_])=yes || enable_[]m4_translit([[$1]], [-], [_])=no; hard_enable_$1="$enable_[]m4_translit([[$1]], [-], [_])"], + [enable_[]m4_translit([[$1]], [-], [_])="$default_enable_[]m4_translit([[$1]], [-], [_])"; hard_enable_[]m4_translit([[$1]], [-], [_])=''])]) |