changeset 18922:d2d9d011203f

Move conditional compilation into the build system.
author diego
date Thu, 06 Jul 2006 13:09:45 +0000
parents f40eeaf450dd
children b88f9a2670b8
files configure libmpdemux/Makefile libmpdemux/ai_alsa.c libmpdemux/ai_alsa1x.c libmpdemux/ai_oss.c libmpdemux/audio_in.c libmpdemux/cache2.c libmpdemux/cdda.c libmpdemux/cddb.c libmpdemux/demux_gif.c libmpdemux/demux_ogg.c libmpdemux/demux_rawdv.c libmpdemux/dvdnav_stream.c libmpdemux/stream_ftp.c libmpdemux/stream_livedotcom.c libmpdemux/stream_netstream.c libmpdemux/stream_smb.c libmpdemux/stream_vcd.c libmpdemux/stream_vstream.c libmpdemux/tv.c libmpdemux/tvi_bsdbt848.c libmpdemux/tvi_dummy.c libmpdemux/tvi_v4l.c libmpdemux/tvi_v4l2.c
diffstat 24 files changed, 89 insertions(+), 114 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Thu Jul 06 13:06:21 2006 +0000
+++ b/configure	Thu Jul 06 13:09:45 2006 +0000
@@ -4973,30 +4973,35 @@
 if test "$_alsaver" ; then
   _alsa=yes
   if test "$_alsaver" = '0.5.x' ; then
+    _alsa5=yes
     _aosrc="$_aosrc ao_alsa5.c"
     _aomodules="alsa5 $_aomodules"
     _def_alsa5='#define HAVE_ALSA5 1'
     _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
     _res_comment="using alsa 0.5.x and sys/asoundlib.h"
   elif test "$_alsaver" = '0.9.x-sys' ; then
+    _alsa9=yes
     _aosrc="$_aosrc ao_alsa.c"
     _aomodules="alsa $_aomodules"
     _def_alsa9='#define HAVE_ALSA9 1'
     _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
     _res_comment="using alsa 0.9.x and sys/asoundlib.h"
   elif test "$_alsaver" = '0.9.x-alsa' ; then
+    _alsa9=yes
     _aosrc="$_aosrc ao_alsa.c"
     _aomodules="alsa $_aomodules"
     _def_alsa9='#define HAVE_ALSA9 1'
     _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
     _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
   elif test "$_alsaver" = '1.0.x-sys' ; then
+    _alsa1x=yes
     _aosrc="$_aosrc ao_alsa.c"
     _aomodules="alsa $_aomodules"
     _def_alsa1x="#define HAVE_ALSA1X 1"
     _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
     _res_comment="using alsa 1.0.x and sys/asoundlib.h"
   elif test "$_alsaver" = '1.0.x-alsa' ; then
+    _alsa1x=yes
     _aosrc="$_aosrc ao_alsa.c"
     _aomodules="alsa $_aomodules"
     _def_alsa1x="#define HAVE_ALSA1X 1"
@@ -5241,6 +5246,7 @@
     done
 fi
 if test "$_cdparanoia" = yes ; then
+    _cdda='yes'
     _def_cdparanoia='#define HAVE_CDDA'
     _inputmodules="cdda $_inputmodules"
     _ld_cdparanoia="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
@@ -5278,6 +5284,7 @@
     fi
 fi
 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
+    _cdda='yes'
     _def_libcdio='#define HAVE_LIBCDIO'
     _def_cdparanoia='#define HAVE_CDDA'
     _def_havelibcdio='yes'
@@ -7358,8 +7365,11 @@
 $_live_libs_def
 
 MPLAYER_NETWORK = $_network
+FTP = $_ftp
 STREAMING_LIVE555 = $_live
+VSTREAM = $_vstream
 MPLAYER_NETWORK_LIB = $_ld_live $_ld_vstream $_ld_network
+STREAM_CACHE = yes
 DVBIN = $_dvbin
 VIDIX = $_vidix_internal
 EXTERNAL_VIDIX = $_vidix_external
@@ -7426,6 +7436,11 @@
 CACA_LIB = $_ld_caca
 
 # audio output
+OSS = $_ossaudio
+ALSA = $_alsa
+ALSA5 = $_alsa5
+ALSA9 = $_alsa9
+ALSA1X = $_alsa1x
 ALSA_LIB = $_ld_alsa
 NAS_LIB = $_ld_nas
 ARTS_LIB = $_ld_arts
@@ -7444,10 +7459,16 @@
 TERMCAP_LIB = $_ld_termcap
 LIRC_LIB = $_ld_lirc
 LIRCC_LIB = $_ld_lircc
+TV = $_tv
+TV_V4L = $_tv_v4l
+TV_V4L2 = $_tv_v4l2
+TV_BSDBT848 = $_tv_bsdbt848
+VCD = $_vcd
 HAVE_DVD = $_have_dvd
 DVDREAD = $_dvdread
 DVDREAD_LIB = $_ld_dvdread
 DVDKIT2 = $_mpdvdkit
+DVDNAV = $_dvdnav
 DVDNAV_LIB = $_ld_dvdnav
 SDL_INC = $_inc_sdl
 WIN32DLL = $_win32
@@ -7488,6 +7509,7 @@
 ENCORE_LIB =  $_ld_encore $_ld_mp3lame
 DIRECTFB_INC = $_inc_directfb
 DIRECTFB_LIB = $_ld_directfb
+CDDA = $_cdda
 CDPARANOIA_INC = $_inc_cdparanoia
 CDPARANOIA_LIB = $_ld_cdparanoia
 FREETYPE = $_freetype
@@ -7509,6 +7531,7 @@
 THEORA_LIB = $_ld_theora
 FAAD_LIB = $_ld_faad
 INTERNAL_FAAD = $_faad_internal
+LIBSMBCLIENT = $_smbsupport
 SMBSUPPORT_LIB = $_ld_smb
 XMMS_PLUGINS = $_xmms
 XMMS_LIB = $_xmms_lib
--- a/libmpdemux/Makefile	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/Makefile	Thu Jul 06 13:09:45 2006 +0000
@@ -11,52 +11,85 @@
         aviprint.c \
 
 # Core
-SRCS += cache2.c \
-        extension.c \
+SRCS += extension.c \
         mf.c \
         open.c \
         url.c \
         video.c \
 
+ifeq ($(STREAM_CACHE),yes)
+SRCS += cache2.c
+endif
+
 # Miscellaneous
-SRCS += cdda.c \
-        cddb.c \
-        cdinfo.c \
+SRCS += cdinfo.c \
         cue_read.c \
-        dvdnav_stream.c \
         parse_es.c \
         parse_mp4.c \
         yuv4mpeg.c \
         yuv4mpeg_ratio.c \
 
+ifeq ($(CDDA),yes)
+SRCS += cdda.c
+  ifeq ($(MPLAYER_NETWORK),yes)
+  SRCS += cddb.c
+  endif
+endif
+
 # Stream readers/writers
 SRCS += stream.c \
         stream_file.c \
-        stream_ftp.c \
-        stream_livedotcom.c \
-        stream_netstream.c \
         stream_null.c \
-        stream_smb.c \
-        stream_vcd.c \
-        stream_vstream.c \
 
 ifeq ($(HAVE_DVD),yes)
 SRCS += stream_dvd.c
 endif
+ifeq ($(DVDNAV),yes)
+SRCS += dvdnav_stream.c
+endif
+ifeq ($(VCD),yes)
+SRCS += stream_vcd.c
+endif
+ifeq ($(FTP),yes)
+SRCS += stream_ftp.c
+endif
+ifeq ($(LIBSMBCLIENT),yes)
+SRCS += stream_smb.c
+endif
+ifeq ($(MPLAYER_NETWORK),yes)
+  SRCS += stream_netstream.c
+  ifeq ($(STREAMING_LIVE555),yes)
+  SRCS += stream_livedotcom.c
+  endif
+endif
+ifeq ($(VSTREAM),yes)
+SRCS += stream_vstream.c
+endif
 
 # TV in
-SRCS += tv.c \
-        frequencies.c \
-        tvi_bsdbt848.c \
-        tvi_dummy.c \
-        tvi_v4l2.c \
-        tvi_v4l.c \
-
-# Audio in
-SRCS += audio_in.c \
-        ai_alsa1x.c \
-        ai_alsa.c \
-        ai_oss.c \
+ifeq ($(TV),yes)
+SRCS += tv.c frequencies.c tvi_dummy.c
+  ifeq ($(TV_BSDBT848),yes)
+  SRCS += tvi_bsdbt848.c
+  endif
+  ifeq ($(TV_V4L2),yes)
+  SRCS += tvi_v4l2.c audio_in.c
+  endif
+  ifeq ($(TV_V4L),yes)
+  SRCS += tvi_v4l.c audio_in.c
+  endif
+  ifeq ($(TV_V4L)$(TV_V4L2),yes)
+    ifeq ($(ALSA1X),yes)
+     SRCS += ai_alsa1x.c
+    endif
+    ifeq ($(ALSA9),yes)
+     SRCS += ai_alsa.c
+    endif
+    ifeq ($(OSS),yes)
+     SRCS += ai_oss.c
+    endif
+  endif
+endif
 
 # Demuxers
 SRCS += demuxer.c \
@@ -67,7 +100,6 @@
         demux_demuxers.c \
         demux_film.c \
         demux_fli.c \
-        demux_gif.c \
         demux_lmlm4.c \
         demux_mf.c \
         demux_mov.c \
@@ -75,10 +107,8 @@
         demux_mpg.c \
         demux_nsv.c \
         demux_nuv.c \
-        demux_ogg.c \
         demux_pva.c \
         demux_rawaudio.c \
-        demux_rawdv.c \
         demux_rawvideo.c \
         demux_realaud.c \
         demux_real.c \
@@ -92,6 +122,15 @@
         demux_y4m.c \
         demux_mkv.c ebml.c \
 
+ifeq ($(LIBVORBIS),yes)
+SRCS += demux_ogg.c
+endif
+ifeq ($(LIBDV),yes)
+SRCS += demux_rawdv.c
+endif
+ifeq ($(GIF),yes)
+SRCS += demux_gif.c
+endif
 ifeq ($(XMMS_PLUGINS),yes)
 SRCS += demux_xmms.c
 endif
--- a/libmpdemux/ai_alsa.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/ai_alsa.c	Thu Jul 06 13:09:45 2006 +0000
@@ -4,8 +4,6 @@
 
 #include "config.h"
 
-#if defined(USE_TV) && (defined(HAVE_TV_V4L) || defined(HAVE_TV_V4L2)) && defined(HAVE_ALSA9)
-
 #include <alsa/asoundlib.h>
 #include "audio_in.h"
 #include "mp_msg.h"
@@ -166,5 +164,3 @@
     mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaReadWriteError);
     return -1;
 }
-
-#endif /* HAVE_ALSA9 */
--- a/libmpdemux/ai_alsa1x.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/ai_alsa1x.c	Thu Jul 06 13:09:45 2006 +0000
@@ -4,8 +4,6 @@
 
 #include "config.h"
 
-#if defined(USE_TV) && (defined(HAVE_TV_V4L) || defined(HAVE_TV_V4L2)) && defined(HAVE_ALSA1X)
-
 #include <alsa/asoundlib.h>
 #include "audio_in.h"
 #include "mp_msg.h"
@@ -185,5 +183,3 @@
     mp_msg(MSGT_TV, MSGL_ERR, MSGTR_MPDEMUX_AIALSA_AlsaReadWriteError);
     return -1;
 }
-
-#endif /* HAVE_ALSA1X */
--- a/libmpdemux/ai_oss.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/ai_oss.c	Thu Jul 06 13:09:45 2006 +0000
@@ -3,8 +3,6 @@
 
 #include "config.h"
 
-#if defined(USE_TV) && (defined(HAVE_TV_V4L) || defined(HAVE_TV_V4L2)) && defined(USE_OSS_AUDIO)
-
 #include <string.h> /* strerror */
 #include <fcntl.h>
 #include <errno.h>
@@ -139,5 +137,3 @@
 
     return 0;
 }
-
-#endif /* USE_OSS_AUDIO */
--- a/libmpdemux/audio_in.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/audio_in.c	Thu Jul 06 13:09:45 2006 +0000
@@ -4,8 +4,6 @@
 
 #include "config.h"
 
-#if defined(USE_TV) && (defined(HAVE_TV_V4L) || defined(HAVE_TV_V4L2))
-
 #include "audio_in.h"
 #include "mp_msg.h"
 #include "help_mp.h"
@@ -219,5 +217,3 @@
 	return -1;
     }
 }
-
-#endif
--- a/libmpdemux/cache2.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/cache2.c	Thu Jul 06 13:09:45 2006 +0000
@@ -1,7 +1,5 @@
 #include "config.h"
 
-#ifdef USE_STREAM_CACHE
-
 // Initial draft of my new cache system...
 // Note it runs in 2 processes (using fork()), but doesn't requires locking!!
 // TODO: seeking, data consistency checking
@@ -367,5 +365,3 @@
   mp_msg(MSGT_CACHE,MSGL_V,"cache_stream_seek: WARNING! Can't seek to 0x%"PRIX64" !\n",(int64_t)(pos+newpos));
   return 0;
 }
-
-#endif
--- a/libmpdemux/cdda.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/cdda.c	Thu Jul 06 13:09:45 2006 +0000
@@ -1,7 +1,5 @@
 #include "config.h"
 
-#ifdef HAVE_CDDA
-
 #include "stream.h"
 #include "m_option.h"
 #include "m_struct.h"
@@ -391,5 +389,3 @@
   &stream_opts,
   1 // Urls are an option string
 };
-
-#endif
--- a/libmpdemux/cddb.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/cddb.c	Thu Jul 06 13:09:45 2006 +0000
@@ -14,8 +14,6 @@
 
 #include "config.h"
 
-#if defined(HAVE_CDDA) && defined(MPLAYER_NETWORK)
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
@@ -878,5 +876,3 @@
 	
 	return cd_info;
 }
-
-#endif
--- a/libmpdemux/demux_gif.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/demux_gif.c	Thu Jul 06 13:09:45 2006 +0000
@@ -9,8 +9,6 @@
 
 #include "config.h"
 
-#ifdef HAVE_GIF
-
 #include "mp_msg.h"
 #include "help_mp.h"
 
@@ -236,5 +234,3 @@
   NULL,
   NULL
 };
-
-#endif /* HAVE_GIF */
--- a/libmpdemux/demux_ogg.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/demux_ogg.c	Thu Jul 06 13:09:45 2006 +0000
@@ -17,8 +17,6 @@
   return n;
 }
 
-#ifdef HAVE_OGGVORBIS
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -1685,5 +1683,3 @@
   demux_ogg_seek,
   demux_ogg_control
 };
-
-#endif
--- a/libmpdemux/demux_rawdv.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/demux_rawdv.c	Thu Jul 06 13:09:45 2006 +0000
@@ -12,8 +12,6 @@
 
 #include "config.h"
 
-#ifdef HAVE_LIBDV095
-
 #include "mp_msg.h"
 #include "help_mp.h"
 
@@ -262,5 +260,3 @@
   demux_seek_rawdv,
   demux_rawdv_control
 };
-
-#endif
--- a/libmpdemux/dvdnav_stream.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/dvdnav_stream.c	Thu Jul 06 13:09:45 2006 +0000
@@ -1,6 +1,5 @@
 #include "config.h"
 
-#ifdef USE_DVDNAV
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -395,5 +394,3 @@
   &stream_opts,
   1 // Urls are an option string
 };
-
-#endif /* USE_DVDNAV */
--- a/libmpdemux/stream_ftp.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/stream_ftp.c	Thu Jul 06 13:09:45 2006 +0000
@@ -1,8 +1,6 @@
 
 #include "config.h"
 
-#ifdef HAVE_FTP
-
 #include <stdlib.h>
 #include <stdio.h>
 
@@ -469,5 +467,3 @@
   &stream_opts,
   1 // Urls are an option string
 };
-
-#endif
--- a/libmpdemux/stream_livedotcom.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/stream_livedotcom.c	Thu Jul 06 13:09:45 2006 +0000
@@ -1,7 +1,6 @@
 
 #include "config.h"
 
-#ifdef MPLAYER_NETWORK
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -12,8 +11,6 @@
 #include "demuxer.h"
 #include "help_mp.h"
 
-#ifdef STREAMING_LIVE555
-
 extern int network_bandwidth;
 
 static int _rtsp_streaming_seek(int fd, off_t pos, streaming_ctrl_t* streaming_ctrl) {
@@ -120,6 +117,3 @@
   NULL,
   0 // Urls are an option string
 };
-
-#endif
-#endif
--- a/libmpdemux/stream_netstream.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/stream_netstream.c	Thu Jul 06 13:09:45 2006 +0000
@@ -36,8 +36,6 @@
 
 #include "config.h"
 
-#ifdef MPLAYER_NETWORK
-
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -308,5 +306,3 @@
   &stream_opts,
   1 // Url is an option string
 };
-
-#endif
--- a/libmpdemux/stream_smb.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/stream_smb.c	Thu Jul 06 13:09:45 2006 +0000
@@ -1,8 +1,6 @@
 
 #include "config.h"
 
-#ifdef LIBSMBCLIENT
-
 #include <libsmbclient.h>
 #include <unistd.h>
 
@@ -148,5 +146,3 @@
   &stream_opts,
   0 //Url is an option string
 };
-
-#endif
--- a/libmpdemux/stream_vcd.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/stream_vcd.c	Thu Jul 06 13:09:45 2006 +0000
@@ -1,7 +1,6 @@
 
 #include "config.h"
 
-#ifdef HAVE_VCD
 #include "mp_msg.h"
 #include "stream.h"
 #include "help_mp.h"
@@ -151,5 +150,3 @@
   &stream_opts,
   1 // Urls are an option string
 };
-
-#endif
--- a/libmpdemux/stream_vstream.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/stream_vstream.c	Thu Jul 06 13:09:45 2006 +0000
@@ -35,8 +35,6 @@
 
 #include "config.h"
 
-#ifdef HAVE_VSTREAM
-
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -180,5 +178,3 @@
   &stream_opts,
   1 // Url is an option string
 };
-
-#endif
--- a/libmpdemux/tv.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/tv.c	Thu Jul 06 13:09:45 2006 +0000
@@ -21,7 +21,6 @@
 
 int tv_param_on = 0;
 
-#ifdef USE_TV
 #include "mp_msg.h"
 #include "help_mp.h"
 
@@ -918,5 +917,3 @@
   NULL,
   NULL
 };
-
-#endif /* USE_TV */
--- a/libmpdemux/tvi_bsdbt848.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/tvi_bsdbt848.c	Thu Jul 06 13:09:45 2006 +0000
@@ -12,8 +12,6 @@
 
 #include "config.h"
 
-#if defined(USE_TV) && defined(HAVE_TV_BSDBT848)
-
 #define RINGSIZE 8
 #define FRAGSIZE 4096 /* (2^12 see SETFRAGSIZE below) */
 
@@ -846,5 +844,3 @@
 
 return 0;
 }
-
-#endif /* USE_TV */
--- a/libmpdemux/tvi_dummy.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/tvi_dummy.c	Thu Jul 06 13:09:45 2006 +0000
@@ -4,8 +4,6 @@
 
 #include "config.h"
 
-#ifdef USE_TV
-
 #include <stdio.h>
 #include "libvo/img_format.h"
 #include "tv.h"
@@ -120,5 +118,3 @@
 {
     return(1);
 }
-
-#endif /* USE_TV */
--- a/libmpdemux/tvi_v4l.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/tvi_v4l.c	Thu Jul 06 13:09:45 2006 +0000
@@ -17,8 +17,6 @@
 
 #include "config.h"
 
-#if defined(USE_TV) && defined(HAVE_TV_V4L)
-
 #include <stdio.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -1759,5 +1757,3 @@
 {
     return(priv->audio_in.blocksize);
 }
-
-#endif /* USE_TV */
--- a/libmpdemux/tvi_v4l2.c	Thu Jul 06 13:06:21 2006 +0000
+++ b/libmpdemux/tvi_v4l2.c	Thu Jul 06 13:09:45 2006 +0000
@@ -25,8 +25,6 @@
 
 #include "config.h"
 
-#if defined(USE_TV) && defined(HAVE_TV_V4L2)
-
 #include <errno.h>
 #include <fcntl.h>
 #include <pthread.h>
@@ -1747,5 +1745,3 @@
 {
     return(priv->audio_in.blocksize);
 }
-
-#endif /* USE_TV && HAVE_TV_V4L2 */