changeset 1517:0e9c29538a86

Use USE_WIN32DLL define instead of ARCH_X86 to decide whether or not to compile Win32 DLL code into mplayer. Default for USE_WIN32DLL is enabled on x86 machines, disabled otherwise. Use of Win32 DLLs can be disabled on x86 using the --disable-win32 configure option.
author jkeil
date Tue, 14 Aug 2001 18:28:56 +0000
parents 0053e6d0cda0
children e0ceb814471d
files Makefile configure dec_audio.c dec_video.c
diffstat 4 files changed, 42 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue Aug 14 17:10:22 2001 +0000
+++ b/Makefile	Tue Aug 14 18:28:56 2001 +0000
@@ -24,15 +24,12 @@
 
 PARTS = mp3lib libac3 libmpeg2 opendivx libavcodec encore libvo libao2 drivers drivers/syncfb
 
-ifeq ($(TARGET_ARCH_X86),yes)
+ifneq ($(W32_LIB),)
 PARTS += loader loader/DirectShow
 SRCS += dll_init.c
-LOADER_DEP = loader/libloader.a $(DS_DEP)
-LIB_LOADER = -Lloader -lloader $(DS_LIB)
-else
-LOADER_DEP =
-LIB_LOADER =
 endif
+LOADER_DEP = $(W32_DEP) $(DS_DEP)
+LIB_LOADER = $(W32_LIB) $(DS_LIB)
 
 
 .SUFFIXES: .c .o
--- a/configure	Tue Aug 14 17:10:22 2001 +0000
+++ b/configure	Tue Aug 14 18:28:56 2001 +0000
@@ -163,6 +163,7 @@
 	--disable-select        disable audio select() support ( for example required this
 	                        option ALSA or Vortex2 driver )
 
+	--disable-win32         disable Win32 DLL support
 	--disable-dshow         disable DirectShow support (if you don't have
                                 C++ compiler&libs, or you've found dshow codecs
                                 slower than old VfW ones)
@@ -456,8 +457,8 @@
 [ "$system_name" = Linux ] && _fbdev=yes
 _lirc=no
 _css=no
-_dshow=yes
-[ "$host_arch" != i386 ] && _dshow=no
+_win32dll=yes _dshow=yes
+[ "$host_arch" != i386 ] && _dshow=no _win32dll=no
 _fastmemcpy=yes
 _streaming=no
 _libavcodec=no
@@ -510,7 +511,7 @@
 
 
 _win32libdirnotify=no
-if [ "$host_arch" = i386 ]; then
+if [ $_win32dll = yes ]; then
     if [ -d /usr/lib/win32 ]; then
 	_win32libdir=/usr/lib/win32
     elif [ -d /usr/local/lib/win32 ]; then
@@ -1169,6 +1170,10 @@
   --disable-select)
         _select='#undef HAVE_AUDIO_SELECT'
 	;;
+  --disable-win32)
+        _win32dll=no
+        _dshow=no # no dshow without win32dlls
+	;;
   --disable-dshow)
         _dshow=no
 	;;
@@ -1408,6 +1413,7 @@
 echo "Checking for Sun Audio ... $_sun_audio"
 echo "Checking for DeCSS support ... $_css"
 echo "Checking for PNG support ... $_png"
+echo "Checking for Win32 DLL support ... $_win32dll"
 echo "Checking for DirectShow ... $_dshow"
 echo "Checking for libavcodec ... $_libavcodec"
 echo "Checking for divx4linux ... $_divx4linux"
@@ -1454,16 +1460,25 @@
    _cssinc=''
 fi
 
-if [ $_dshow = yes ]; then
-   _dshowlib='-Lloader/DirectShow -lDS_Filter -lstdc++'
-   _dshowdep='loader/DirectShow/libDS_Filter.a'
-   _dshow='#define USE_DIRECTSHOW'
+
+
+if [ $_win32dll = yes ]; then
+    _win32dll='#define USE_WIN32DLL 1'
+    _win32lib='-Lloader -lloader'
+    _win32dep='loader/libloader.a'
+    if [ $_dshow = yes ]; then
+	_dshow='#define USE_DIRECTSHOW'
+	_dshowlib='-Lloader/DirectShow -lDS_Filter -lstdc++'
+	_dshowdep='loader/DirectShow/libDS_Filter.a'
+    else
+	_dshow='#undef USE_DIRECTSHOW' _dshowlib='' _dshowdep=''
+    fi
 else
-   _dshowlib=''
-   _dshowdep=''
-   _dshow='#undef USE_DIRECTSHOW'
+    _win32dll='#undef USE_WIN32DLL' _win32lib='' _win32dep=''
+    _dshow='#undef USE_DIRECTSHOW' _dshowlib='' _dshowdep=''
 fi
 
+
 if [ $_libavcodec = yes ]; then
    _lavclib='-Llibavcodec -lavcodec'
    _lavcdep='libavcodec/libavcodec.a'
@@ -1844,6 +1859,8 @@
 CSS_LIB = $_csslib
 CSS_INC = $_cssinc
 SDL_INC = $_sdlcflags
+W32_DEP = $_win32dep
+W32_LIB = $_win32lib
 DS_DEP = $_dshowdep
 DS_LIB = $_dshowlib
 AV_DEP = $_lavcdep
@@ -1949,6 +1966,9 @@
 /* Define this to enable MPEG 1/2 image postprocessing (requires FAST cpu!) */
 #define MPEG12_POSTPROC
 
+/* Win32 DLL support */
+$_win32dll
+
 /* DirectShow support */
 $_dshow
 
--- a/dec_audio.c	Tue Aug 14 17:10:22 2001 +0000
+++ b/dec_audio.c	Tue Aug 14 18:28:56 2001 +0000
@@ -78,8 +78,8 @@
 
 switch(driver){
 case AFM_ACM:
-#ifndef	ARCH_X86
-  printf("Win32/ACM audio codec unavailable on non-x86 CPU -> force nosound :(\n");
+#ifndef	USE_WIN32DLL
+  printf("Win32/ACM audio codec disabled, or unavailable on non-x86 CPU -> force nosound :(\n");
   driver=0;
 #else
   // Win32 ACM audio codec:
@@ -157,7 +157,7 @@
 sh_audio->a_buffer_len=0;
 
 switch(driver){
-#ifdef ARCH_X86
+#ifdef USE_WIN32DLL
 case AFM_ACM: {
     int ret=acm_decode_audio(sh_audio,sh_audio->a_buffer,4096,sh_audio->a_buffer_size);
     if(ret<0){
@@ -332,7 +332,7 @@
         }
         //printf("{3:%d}",avi_header.idx_pos);fflush(stdout);
         break;
-#ifdef ARCH_X86
+#ifdef USE_WIN32DLL
       case AFM_ACM:
 //        len=sh_audio->audio_out_minsize; // optimal decoded fragment size
 //        if(len<minlen) len=minlen; else
--- a/dec_video.c	Tue Aug 14 17:10:22 2001 +0000
+++ b/dec_video.c	Tue Aug 14 18:28:56 2001 +0000
@@ -104,7 +104,6 @@
 
 void set_video_quality(sh_video_t *sh_video,int quality){
  switch(sh_video->codec->driver){
-#ifdef ARCH_X86
 #ifdef USE_DIRECTSHOW
   case VFM_DSHOW: {
    if(quality<0 || quality>4) quality=4;
@@ -112,7 +111,6 @@
   }
   break;
 #endif
-#endif
 #ifdef MPEG12_POSTPROC
   case VFM_MPEG: {
    if(quality<0 || quality>6) quality=6;
@@ -147,7 +145,7 @@
 sh_video->our_out_buffer=NULL;
 
 switch(sh_video->codec->driver){
-#ifdef ARCH_X86
+#ifdef USE_WIN32DLL
  case VFM_VFW: {
    if(!init_video_codec(sh_video,0)) {
 //     GUI_MSG( mplUnknowError )
@@ -213,13 +211,13 @@
    break;
 #endif
  }
-#else	/* !ARCH_X86 */
+#else	/* !USE_WIN32DLL */
  case VFM_VFW:
  case VFM_DSHOW:
  case VFM_VFWEX:
-   fprintf(stderr,"MPlayer does not support win32 codecs on non-x86 platforms!\n");
+   fprintf(stderr,"Support for win32 codecs disabled, or unavailable on non-x86 platforms!\n");
    return 0;
-#endif	/* !ARCH_X86 */
+#endif	/* !USE_WIN32DLL */
  case VFM_ODIVX: {  // OpenDivX
    if(verbose) printf("OpenDivX video codec\n");
    { DEC_PARAM dec_param;
@@ -465,7 +463,7 @@
     break;
   }
 #endif
-#ifdef ARCH_X86
+#ifdef USE_WIN32DLL
   case VFM_VFWEX:
   case VFM_VFW:
   {