summaryrefslogtreecommitdiff
path: root/multimedia/mplayer-share/patches/patch-configure
blob: 986bfa438eddf131699dda9c32b4ed9d26ca4fc2 (plain)
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
161
162
163
164
165
166
167
168
169
$NetBSD: patch-configure,v 1.1 2018/11/10 03:48:51 mrg Exp $

o Handle properly sh3, evbarm, and arm64 ports on NetBSD.
o Fix CPU family detection on NetBSD with /proc mounted with "-o linux"
  (please see also kern/25076).
o Delete not needed -Iffmpeg from the CFLAGS.
o Fix a bug which broke the detection of a lot of X11 libraries.
o Add necessary libs for aalib support even if the aa option is turned on with
  --enable-aa.
o Add support for dvb capture on NetBSD.
o Explicitly enable PIE to avoid text relocations on NetBSD/i386 8.x

--- configure.orig	2016-02-13 13:05:42.000000000 -0800
+++ configure	2018-11-09 19:30:35.590280805 -0800
@@ -1640,7 +1640,7 @@
       cc_name=$cc_name_tmp
       echocheck "$_cc version"
       cc_vendor=gnu
-      cc_version=$($_cc -dumpversion 2>&1)
+      cc_version=$( ( $_cc -dumpversion | sed -e 's/-nb[0-9]//' ) 2>&1 )
       case $cc_version in
         2.96*)
           cc_fail=yes
@@ -1717,8 +1717,13 @@
       sun4*|sparc*) host_arch=sparc ;;
       parisc*|hppa*|9000*) host_arch=hppa ;;
       aarch64*) host_arch=aarch64 ;;
-      arm*|zaurus|cats) host_arch=arm ;;
-      sh3|sh4|sh4a) host_arch=sh ;;
+      arm*|zaurus|cats|evbarm)
+        case "$(uname -p 2>&1)" in
+          aarch64*) host_arch=aarch64 ;;
+          *) host_arch=arm ;;
+        esac ;;
+      sh3*) host_arch=sh ;;
+      sh4|sh4a) host_arch=sh4 ;;
       s390) host_arch=s390 ;;
       s390x) host_arch=s390x ;;
       *mips*) host_arch=mips ;;
@@ -1930,7 +1935,7 @@
   # gather more CPU information
   pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
   pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2  | cut -d ' ' -f 2 | head -n 1)
-  pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
+  pfamily=$($_cpuinfo | grep -i 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
   pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
   pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
 
@@ -2446,7 +2451,12 @@
     test $_fast_clz = "auto" && _fast_clz=yes
     ;;
 
-  sh|sh4)
+  sh)
+    arch='sh'
+    iproc='sh'
+    ;;
+
+  sh4)
     arch='sh4'
     iproc='sh4'
     ;;
@@ -2806,23 +2816,23 @@
 _install_strip="-s"
 if test -z "$CFLAGS" || test "$_profile" != "" || test "$_debug" != ""; then
   if test "$cc_vendor" = "intel" ; then
-    CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
+    CFLAGS="$CFLAGS -fomit-frame-pointer"
     WARNFLAGS="-wd167 -wd556 -wd144"
   elif test "$cc_vendor" = "sun" ; then
-    CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
+    CFLAGS="$CFLAGS -xc99 -xregs=frameptr"
   elif test "$cc_vendor" = "clang"; then
-    CFLAGS="-O2 $_march $_pipe"
+    CFLAGS="$CFLAGS"
   elif test "$cc_vendor" != "gnu" ; then
-    CFLAGS="-O2 $_march $_mcpu $_pipe"
+    CFLAGS="$CFLAGS"
   else
-    CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+    CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer"
     WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Werror=format-security"
     WARN_CFLAGS="-Werror-implicit-function-declaration"
     extra_ldflags="$extra_ldflags -ffast-math"
   fi
 
   if test "$_profile" != "" || test "$_debug" != ""; then
-    CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
+    CFLAGS="$CFLAGS $_debug $_profile"
     WARNFLAGS="-W -Wall $WARNFLAGS"
     _install_strip=
   fi
@@ -2830,8 +2840,8 @@
   warn_cflags=yes
 fi
 
-CFLAGS="-D_ISOC99_SOURCE -I. -Iffmpeg $CFLAGS"
-HOSTCFLAGS="-D_ISOC99_SOURCE -I. -Iffmpeg -O3"
+CFLAGS="-D_ISOC99_SOURCE -I. $CFLAGS"
+HOSTCFLAGS="-D_ISOC99_SOURCE -I. -O3"
 
 # On glibc, add some more CPPFLAGS for enabling required functionality.
 cpp_condition_check features.h "defined __GLIBC__" &&
@@ -4615,7 +4625,11 @@
            -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
            -L/usr/lib ; do
     if netbsd; then
-      ld_tmp="$I -lXext -lX11 $ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
+	  if test -n "$I" ; then
+        ld_tmp="$I -lXext -lX11 $ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
+	  else
+        ld_tmp="-lXext -lX11 $ld_pthread"
+	  fi
     else
       ld_tmp="$I -lXext -lX11 $ld_pthread"
     fi
@@ -5018,6 +5032,8 @@
   def_aa='#define CONFIG_AA 1'
   if cygwin ; then
     libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
+  else
+    libs_mplayer="$libs_mplayer $(aalib-config --libs)"
   fi
   vomodules="aa $vomodules"
 else
@@ -5105,7 +5121,6 @@
       extra_cflags="$extra_cflags $inc_tmp" && break
   done
 fi
-echores "$_dvb"
 if test "$_dvb" = yes ; then
   _dvbin=yes
   inputmodules="dvb $inputmodules"
@@ -5114,14 +5129,29 @@
   aomodules="mpegpes(dvb) $aomodules"
   vomodules="mpegpes(dvb) $vomodules"
 else
-  _dvbin=no
-  noinputmodules="dvb $noinputmodules"
-  def_dvb='#undef CONFIG_DVB'
-  def_dvbin='#undef CONFIG_DVBIN '
-  aomodules="mpegpes(file) $aomodules"
-  vomodules="mpegpes(file) $vomodules"
+  cat >$TMPC <<EOF
+#include <dev/dtv/dtvio.h>
+int main(void) {return 0;}
+EOF
+  cc_check && _dvb=yes
+  if test "$_dvb" = yes ; then
+    _dvbin=yes
+    inputmodules="dvb $inputmodules"
+    def_dvb='#undef CONFIG_DVB'
+    def_dvbin='#define CONFIG_DVBIN 1'
+    aomodules="mpegpes(file) $aomodules"
+    vomodules="mpegpes(file) $vomodules"
+  else
+    _dvbin=no
+    noinputmodules="dvb $noinputmodules"
+    def_dvb='#undef CONFIG_DVB'
+    def_dvbin='#undef CONFIG_DVBIN '
+    aomodules="mpegpes(file) $aomodules"
+    vomodules="mpegpes(file) $vomodules"
+  fi
 fi
 
+echores "$_dvb"
 
 if darwin; then