[MPlayer-dev-eng] [PATCH] build: drop BeOS support

Diego Biurrun diego at biurrun.de
Wed Jul 27 17:35:08 CEST 2011


BeOS is dead and support has been dropped from FFmpeg/Libav a long time ago.
The support code that was added years ago adds considerable clutter while
not providing any benefit, so it's better to drop it outright.

Support for Haiku, the FOSS replacement of BeOS remains unaffected.
---
 Makefile            |    1 -
 configure           |   49 +++++--------------------------------------------
 cpuinfo.c           |    4 ----
 mpbswap.h           |    4 ----
 osdep/shmem.c       |    2 --
 osdep/swab.c        |   33 ---------------------------------
 osdep/timer-linux.c |    3 ---
 7 files changed, 5 insertions(+), 91 deletions(-)
 delete mode 100644 osdep/swab.c

diff --git a/Makefile b/Makefile
index 581d001..3bc6595 100644
--- a/Makefile
+++ b/Makefile
@@ -182,7 +182,6 @@ SRCS_COMMON-$(NEED_MMAP)             += osdep/mmap-os2.c
 SRCS_COMMON-$(NEED_SETENV)           += osdep/setenv.c
 SRCS_COMMON-$(NEED_SHMEM)            += osdep/shmem.c
 SRCS_COMMON-$(NEED_STRSEP)           += osdep/strsep.c
-SRCS_COMMON-$(NEED_SWAB)             += osdep/swab.c
 SRCS_COMMON-$(NEED_VSSCANF)          += osdep/vsscanf.c
 SRCS_COMMON-$(NETWORKING)            += stream/stream_netstream.c \
                                         stream/asf_mmst_streaming.c \
diff --git a/configure b/configure
index a332996..cdaa83a 100755
--- a/configure
+++ b/configure
@@ -208,7 +208,6 @@ issystem() {
 }
 aix()       { issystem "AIX"; }
 amigaos()   { issystem "AmigaOS"; }
-beos()      { issystem "BEOS"; }
 bsdos()     { issystem "BSD/OS"; }
 cygwin()    { issystem "CYGWIN"; }
 darwin()    { issystem "Darwin"; }
@@ -1436,10 +1435,7 @@ if test -z "$_target" ; then
   # OS name
   system_name=$(uname -s 2>&1)
   case "$system_name" in
-  Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
-    ;;
-  Haiku)
-    system_name=BeOS
+  Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|MorphOS|AIX|AmigaOS|Haiku)
     ;;
   IRIX*)
     system_name=IRIX
@@ -1467,7 +1463,7 @@ if test -z "$_target" ; then
 
   # host's CPU/instruction set
   case "$(uname -m 2>&1)" in
-      x86_64|amd64|i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
+      x86_64|amd64|i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686) host_arch=i386 ;;
       ia64) host_arch=ia64 ;;
       macppc|ppc|Power*) host_arch=ppc ;;
       ppc64) host_arch=ppc64 ;;
@@ -2936,23 +2932,6 @@ fi
 ######################
 
 
-echocheck "-lposix"
-if cflag_check -lposix ; then
-  extra_ldflags="$extra_ldflags -lposix"
-  echores "yes"
-else
-  echores "no"
-fi
-
-echocheck "-lm"
-if cflag_check -lm ; then
-  extra_ldflags="$extra_ldflags -lm"
-  echores "yes"
-else
-  echores "no"
-fi
-
-
 echocheck "langinfo"
 if test "$_langinfo" = auto ; then
   _langinfo=no
@@ -3106,14 +3085,13 @@ echores "$_nanosleep"
 
 echocheck "socklib"
 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
-# for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
 cat > $TMPC << EOF
 #include <netdb.h>
 #include <sys/socket.h>
 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
 EOF
 _socklib=no
-for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
+for _ld_tmp in "" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
   cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
 done
 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
@@ -3813,19 +3791,6 @@ fi
 echores "$_vsscanf"
 
 
-echocheck "swab()"
-_swab=no
-define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
-    statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
-if test "$_swab" = yes ; then
-  def_swab='#define HAVE_SWAB 1'
-  need_swab=no
-else
-  def_swab='#undef HAVE_SWAB'
-  need_swab=yes
-fi
-echores "$_swab"
-
 echocheck "POSIX select()"
 cat > $TMPC << EOF
 #include <stdio.h>
@@ -5014,7 +4979,7 @@ EOF
     if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
           _sdl=yes
     elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
-          # HACK for BeOS/Haiku SDL
+          # HACK for Haiku SDL
           _ld_tmp="$_ld_tmp -lstdc++"
           _sdl=yes
      fi
@@ -5816,8 +5781,6 @@ if test "$_libdvdcss_internal" = yes ; then
     extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
   elif cygwin ; then
     cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
-  elif beos ; then
-    cflags_libdvdcss="-DSYS_BEOS"
   elif os2 ; then
     cflags_libdvdcss="-DSYS_OS2"
   fi
@@ -7390,7 +7353,7 @@ echores "$_pvr"
 
 
 echocheck "ftp"
-if test "$_ftp" = "auto" && test "$networking" = "yes" && ! beos ; then
+if test "$_ftp" = "auto" && test "$networking" = "yes" ; then
     _ftp=yes
 fi
 if test "$_ftp" = yes ; then
@@ -7858,7 +7821,6 @@ NEED_MMAP         = $need_mmap
 NEED_SETENV       = $need_setenv
 NEED_SHMEM        = $need_shmem
 NEED_STRSEP       = $need_strsep
-NEED_SWAB         = $need_swab
 NEED_VSSCANF      = $need_vsscanf
 
 # features
@@ -8215,7 +8177,6 @@ $def_setenv
 $def_setmode
 $def_shm
 $def_strsep
-$def_swab
 $def_sysi86
 $def_sysi86_iv
 $def_termcap
diff --git a/cpuinfo.c b/cpuinfo.c
index 5a39ddb..5da585d 100644
--- a/cpuinfo.c
+++ b/cpuinfo.c
@@ -32,10 +32,6 @@
 #define sleep(t) Sleep(1000*t);
 #endif
 
-#ifdef __BEOS__
-#define usleep(t) snooze(t)
-#endif
-
 #ifdef M_UNIX
 typedef long long int64_t;
 #define MISSING_USLEEP
diff --git a/mpbswap.h b/mpbswap.h
index 7ec7946..28f7337 100644
--- a/mpbswap.h
+++ b/mpbswap.h
@@ -31,8 +31,4 @@
 #define be2me_16(v) av_be2ne16(v)
 #define be2me_32(v) av_be2ne32(v)
 
-#ifndef HAVE_SWAB
-void swab(const void *from, void *to, ssize_t n);
-#endif
-
 #endif /* MPLAYER_MPBSWAP_H */
diff --git a/osdep/shmem.c b/osdep/shmem.c
index 712bc9f..395235d 100644
--- a/osdep/shmem.c
+++ b/osdep/shmem.c
@@ -33,8 +33,6 @@
 #include <sys/uio.h>
 #if HAVE_SYS_MMAN_H
 #include <sys/mman.h>
-#elif defined(__BEOS__)
-#include <mman.h>
 #endif
 #include <sys/socket.h>
 #include <fcntl.h>
diff --git a/osdep/swab.c b/osdep/swab.c
deleted file mode 100644
index f0bb796..0000000
--- a/osdep/swab.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "config.h"
-
-/* system has no swab.  emulate via bswap */
-#include "mpbswap.h"
-#include <unistd.h>
-
-void swab(const void *from, void *to, ssize_t n) {
-  const int16_t *in = (int16_t*)from;
-  int16_t *out = (int16_t*)to;
-  int i;
-  n /= 2;
-  for (i = 0 ; i < n; i++) {
-    out[i] = bswap_16(in[i]);
-  }
-}
diff --git a/osdep/timer-linux.c b/osdep/timer-linux.c
index 4f61c0d..7d3a999 100644
--- a/osdep/timer-linux.c
+++ b/osdep/timer-linux.c
@@ -20,9 +20,6 @@
  */
 
 #include <unistd.h>
-#ifdef __BEOS__
-#define usleep(t) snooze(t)
-#endif
 #include <stdlib.h>
 #include <time.h>
 #include <sys/time.h>
-- 
1.7.2.5



More information about the MPlayer-dev-eng mailing list