summaryrefslogtreecommitdiff
path: root/multimedia/mplayer/files/patch-ad
blob: ad4871aecd2af52b9b2ab0c6cb5afebf66cc5651 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
--- configure.orig	2007-10-08 03:49:33.000000000 +0800
+++ configure	2007-11-11 13:09:59.000000000 +0800
@@ -62,9 +62,9 @@
   echo >> "$TMPLOG"
   cat "$1" >> "$TMPLOG"
   echo >> "$TMPLOG"
-  echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
+  echo "$_cc $CFLAGS -fno-fast-math $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
   rm -f "$TMPEXE"
-  $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
+  $_cc $CFLAGS -fno-fast-math $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
   TMP="$?"
   echo >> "$TMPLOG"
   echo >> "$TMPLOG"
@@ -484,7 +484,7 @@
 _iwmmxt=auto
 _mtrr=auto
 _altivec=auto
-_install=install
+_install=@${BSD_INSTALL_PROGRAM}
 _ranlib=ranlib
 _ldconfig=ldconfig
 _cc=cc
@@ -1188,8 +1188,7 @@
         _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
 
   *)
-    echo "Unknown parameter: $ac_option"
-    exit 1
+    echo "Unknown parameter: $ac_option (ignoring)"
     ;;
 
   esac
@@ -1248,14 +1247,7 @@
       case "`uname -m 2>&1`" in
       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 ;;
       ia64) host_arch=ia64 ;;
-      x86_64|amd64)
-        if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
-             -z "`echo $CFLAGS | grep -- -m32`"  ]; then
-          host_arch=x86_64
-        else
-          host_arch=i386
-        fi
-      ;;
+      x86_64|amd64) host_arch=x86_64 ;;
       macppc|ppc|ppc64) host_arch=ppc ;;
       alpha) host_arch=alpha ;;
       sparc) host_arch=sparc ;;
@@ -1524,25 +1516,10 @@
 
 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
 # FIXME: Remove the cygwin check once AMD CPUs are supported
-if test -r /proc/cpuinfo && not cygwin; then
-  # Linux with /proc mounted, extract CPU information from it
-  _cpuinfo="cat /proc/cpuinfo"
-elif test -r /compat/linux/proc/cpuinfo && not x86_32 ; then
-  # FreeBSD with Linux emulation /proc mounted,
-  # extract CPU information from it
-  _cpuinfo="cat /compat/linux/proc/cpuinfo"
-elif darwin && not x86_32 ; then
-  # use hostinfo on Darwin
-  _cpuinfo="hostinfo"
-elif aix; then
-  # use 'lsattr' on AIX
-  _cpuinfo="lsattr -E -l proc0 -a type"
-elif x86; then
   # all other OSes try to extract CPU information from a small helper
   # program cpuinfo instead
   $_cc -o cpuinfo$_exesuf cpuinfo.c
   _cpuinfo="./cpuinfo$_exesuf"
-fi
 
 if x86 ; then
   # gather more CPU information
@@ -2331,7 +2308,7 @@
   elif test "$cc_vendor" != "gnu" ; then
     CFLAGS="-O2 $_march $_mcpu $_pipe"
   else
-    CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+    CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O $_pipe"
   fi
 else
   _warn_CFLAGS=yes
@@ -2965,13 +2942,7 @@
 
 
 echocheck "memalign()"
-# XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
-cat > $TMPC << EOF
-#include <malloc.h>
-int main (void) { (void) memalign(64, sizeof(char)); return 0; }
-EOF
 _memalign=no
-cc_check && _memalign=yes
 if test "$_memalign" = yes ; then
  _def_memalign='#define HAVE_MEMALIGN 1'
 else
@@ -3057,20 +3028,8 @@
 _def_threads='#undef HAVE_THREADS'
 
 echocheck "pthread"
-if test "$_pthreads" = auto ; then
-cat > $TMPC << EOF
-#include <pthread.h>
-void* func(void *arg) { return arg; }
-int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
-EOF
-_pthreads=no
-if not hpux ; then
-  for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
-    # for crosscompilation, we cannot execute the program, be happy if we can link statically
-    cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
-  done
-fi
-fi
+_pthreads=yes
+_ld_pthread="${PTHREAD_LIBS}"
 if test "$_pthreads" = yes ; then
   _res_comment="using $_ld_pthread"
   _def_pthreads='#define HAVE_PTHREADS 1'
@@ -6722,12 +6681,12 @@
 if bsd; then
   echocheck "*BSD BT848 bt8xx header"
   _ioctl_bt848_h=no
-  for file in "machine/ioctl_bt848.h" \
-            "dev/bktr/ioctl_bt848.h" \
-            "dev/video/bktr/ioctl_bt848.h" \
-            "dev/ic/bt8xx.h" ; do
+  for file in "dev/bktr/ioctl_bt848.h" \
+              "machine/ioctl_bt848.h" ; do
     cat > $TMPC <<EOF
 #include <sys/types.h>
+#include <sys/param.h>
+#include <sys/ioctl.h>
 #include <$file>
 int main(void) {
  ioctl(0, TVTUNER_GETFREQ, 0);
@@ -7343,12 +7302,8 @@
 echocheck "joystick"
 _def_joystick='#undef HAVE_JOYSTICK'
 if test "$_joystick" = yes ; then
-  if linux ; then
     # TODO add some check
     _def_joystick='#define HAVE_JOYSTICK 1'
-  else
-    _joystick="no (unsupported under $system_name)"
-  fi
 fi
 echores "$_joystick"
 
@@ -7448,7 +7403,7 @@
   CFLAGS="$CFLAGS -D_REENTRANT"
 elif bsd ; then
   # FIXME bsd needs this so maybe other OS'es
-  CFLAGS="$CFLAGS -D_THREAD_SAFE"
+  CFLAGS="$CFLAGS ${PTHREAD_CFLAGS}"
 fi
 if cygwin ; then
   CFLAGS="$CFLAGS -D__CYGWIN__"