| @@ -1,25 +1,26 @@ | | | @@ -1,25 +1,26 @@ |
1 | $NetBSD: patch-aa,v 1.34 2016/02/07 13:34:33 leot Exp $ | | 1 | $NetBSD: patch-aa,v 1.35 2018/05/27 15:27:14 tsutsui Exp $ |
2 | | | 2 | |
3 | o Handle properly sh3 and evbarm ports on NetBSD. | | 3 | o Handle properly sh3 and evbarm ports on NetBSD. |
4 | o Fix CPU family detection on NetBSD with /proc mounted with "-o linux" | | 4 | o Fix CPU family detection on NetBSD with /proc mounted with "-o linux" |
5 | (please see also kern/25076). | | 5 | (please see also kern/25076). |
6 | o Delete not needed -Iffmpeg from the CFLAGS. | | 6 | o Delete not needed -Iffmpeg from the CFLAGS. |
7 | o Fix a bug which broke the detection of a lot of X11 libraries. | | 7 | o Fix a bug which broke the detection of a lot of X11 libraries. |
8 | o Add necessary libs for aalib support even if the aa option is turned on with | | 8 | o Add necessary libs for aalib support even if the aa option is turned on with |
9 | --enable-aa. | | 9 | --enable-aa. |
10 | o Add support for dvb capture on NetBSD. | | 10 | o Add support for dvb capture on NetBSD. |
| | | 11 | o Explicitly enable PIE to avoid text relocations on NetBSD/i386 8.x |
11 | | | 12 | |
12 | --- configure.orig 2016-01-08 12:39:01.000000000 +0000 | | 13 | --- configure.orig 2016-02-13 21:05:42.000000000 +0000 |
13 | +++ configure | | 14 | +++ configure |
14 | @@ -1640,7 +1640,7 @@ else | | 15 | @@ -1640,7 +1640,7 @@ else |
15 | cc_name=$cc_name_tmp | | 16 | cc_name=$cc_name_tmp |
16 | echocheck "$_cc version" | | 17 | echocheck "$_cc version" |
17 | cc_vendor=gnu | | 18 | cc_vendor=gnu |
18 | - cc_version=$($_cc -dumpversion 2>&1) | | 19 | - cc_version=$($_cc -dumpversion 2>&1) |
19 | + cc_version=$( ( $_cc -dumpversion | sed -e 's/-nb[0-9]//' ) 2>&1 ) | | 20 | + cc_version=$( ( $_cc -dumpversion | sed -e 's/-nb[0-9]//' ) 2>&1 ) |
20 | case $cc_version in | | 21 | case $cc_version in |
21 | 2.96*) | | 22 | 2.96*) |
22 | cc_fail=yes | | 23 | cc_fail=yes |
23 | @@ -1717,8 +1717,9 @@ if test -z "$_target" ; then | | 24 | @@ -1717,8 +1717,9 @@ if test -z "$_target" ; then |
24 | sun4*|sparc*) host_arch=sparc ;; | | 25 | sun4*|sparc*) host_arch=sparc ;; |
25 | parisc*|hppa*|9000*) host_arch=hppa ;; | | 26 | parisc*|hppa*|9000*) host_arch=hppa ;; |
| @@ -45,27 +46,27 @@ o Add support for dvb capture on NetBSD. | | | @@ -45,27 +46,27 @@ o Add support for dvb capture on NetBSD. |
45 | test $_fast_clz = "auto" && _fast_clz=yes | | 46 | test $_fast_clz = "auto" && _fast_clz=yes |
46 | ;; | | 47 | ;; |
47 | | | 48 | |
48 | - sh|sh4) | | 49 | - sh|sh4) |
49 | + sh) | | 50 | + sh) |
50 | + arch='sh' | | 51 | + arch='sh' |
51 | + iproc='sh' | | 52 | + iproc='sh' |
52 | + ;; | | 53 | + ;; |
53 | + | | 54 | + |
54 | + sh4) | | 55 | + sh4) |
55 | arch='sh4' | | 56 | arch='sh4' |
56 | iproc='sh4' | | 57 | iproc='sh4' |
57 | ;; | | 58 | ;; |
58 | @@ -2783,23 +2789,23 @@ fi # if darwin && test "$cc_vendor" = "g | | 59 | @@ -2806,23 +2812,23 @@ fi # if darwin && test "$cc_vendor" = "g |
59 | _install_strip="-s" | | 60 | _install_strip="-s" |
60 | if test -z "$CFLAGS" || test "$_profile" != "" || test "$_debug" != ""; then | | 61 | if test -z "$CFLAGS" || test "$_profile" != "" || test "$_debug" != ""; then |
61 | if test "$cc_vendor" = "intel" ; then | | 62 | if test "$cc_vendor" = "intel" ; then |
62 | - CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer" | | 63 | - CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer" |
63 | + CFLAGS="$CFLAGS -fomit-frame-pointer" | | 64 | + CFLAGS="$CFLAGS -fomit-frame-pointer" |
64 | WARNFLAGS="-wd167 -wd556 -wd144" | | 65 | WARNFLAGS="-wd167 -wd556 -wd144" |
65 | elif test "$cc_vendor" = "sun" ; then | | 66 | elif test "$cc_vendor" = "sun" ; then |
66 | - CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr" | | 67 | - CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr" |
67 | + CFLAGS="$CFLAGS -xc99 -xregs=frameptr" | | 68 | + CFLAGS="$CFLAGS -xc99 -xregs=frameptr" |
68 | elif test "$cc_vendor" = "clang"; then | | 69 | elif test "$cc_vendor" = "clang"; then |
69 | - CFLAGS="-O2 $_march $_pipe" | | 70 | - CFLAGS="-O2 $_march $_pipe" |
70 | + CFLAGS="$CFLAGS" | | 71 | + CFLAGS="$CFLAGS" |
71 | elif test "$cc_vendor" != "gnu" ; then | | 72 | elif test "$cc_vendor" != "gnu" ; then |
| @@ -75,68 +76,82 @@ o Add support for dvb capture on NetBSD. | | | @@ -75,68 +76,82 @@ o Add support for dvb capture on NetBSD. |
75 | - CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer" | | 76 | - CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer" |
76 | + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer" | | 77 | + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer" |
77 | WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Werror=format-security" | | 78 | WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Werror=format-security" |
78 | WARN_CFLAGS="-Werror-implicit-function-declaration" | | 79 | WARN_CFLAGS="-Werror-implicit-function-declaration" |
79 | extra_ldflags="$extra_ldflags -ffast-math" | | 80 | extra_ldflags="$extra_ldflags -ffast-math" |
80 | fi | | 81 | fi |
81 | | | 82 | |
82 | if test "$_profile" != "" || test "$_debug" != ""; then | | 83 | if test "$_profile" != "" || test "$_debug" != ""; then |
83 | - CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile" | | 84 | - CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile" |
84 | + CFLAGS="$CFLAGS $_debug $_profile" | | 85 | + CFLAGS="$CFLAGS $_debug $_profile" |
85 | WARNFLAGS="-W -Wall $WARNFLAGS" | | 86 | WARNFLAGS="-W -Wall $WARNFLAGS" |
86 | _install_strip= | | 87 | _install_strip= |
87 | fi | | 88 | fi |
88 | @@ -2807,8 +2813,8 @@ else | | 89 | @@ -2830,8 +2836,8 @@ else |
89 | warn_cflags=yes | | 90 | warn_cflags=yes |
90 | fi | | 91 | fi |
91 | | | 92 | |
92 | -CFLAGS="-D_ISOC99_SOURCE -I. -Iffmpeg $CFLAGS" | | 93 | -CFLAGS="-D_ISOC99_SOURCE -I. -Iffmpeg $CFLAGS" |
93 | -HOSTCFLAGS="-D_ISOC99_SOURCE -I. -Iffmpeg -O3" | | 94 | -HOSTCFLAGS="-D_ISOC99_SOURCE -I. -Iffmpeg -O3" |
94 | +CFLAGS="-D_ISOC99_SOURCE -I. $CFLAGS" | | 95 | +CFLAGS="-D_ISOC99_SOURCE -I. $CFLAGS" |
95 | +HOSTCFLAGS="-D_ISOC99_SOURCE -I. -O3" | | 96 | +HOSTCFLAGS="-D_ISOC99_SOURCE -I. -O3" |
96 | | | 97 | |
97 | # On glibc, add some more CPPFLAGS for enabling required functionality. | | 98 | # On glibc, add some more CPPFLAGS for enabling required functionality. |
98 | cpp_condition_check features.h "defined __GLIBC__" && | | 99 | cpp_condition_check features.h "defined __GLIBC__" && |
99 | @@ -4591,7 +4597,11 @@ if test "$_x11" = auto && test "$_x11_he | | 100 | @@ -2878,10 +2884,11 @@ if test $relocatable = "auto" ; then |
| | | 101 | elif win32 && ! wine ; then |
| | | 102 | relocatable=no |
| | | 103 | res_comment="unnecessary and broken on win32" |
| | | 104 | - elif x86_32 && cflag_check -pie ; then |
| | | 105 | + elif x86_32 && cflag_check -fpic -fpie ; then |
| | | 106 | extra_ldflags="$extra_ldflags -pie" |
| | | 107 | + extra_cflags="$extra_cflags -fpic -fpie" |
| | | 108 | relocatable=yes |
| | | 109 | - res_comment="non-PIC" |
| | | 110 | + res_comment="fast PIC" |
| | | 111 | elif x86_64 && cflag_check -fpie -pie ; then |
| | | 112 | extra_ldflags="$extra_ldflags -fpie -pie" |
| | | 113 | extra_cflags="$extra_cflags -fpie" |
| | | 114 | @@ -4615,7 +4622,11 @@ if test "$_x11" = auto && test "$_x11_he |
100 | -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \ | | 115 | -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \ |
101 | -L/usr/lib ; do | | 116 | -L/usr/lib ; do |
102 | if netbsd; then | | 117 | if netbsd; then |
103 | - ld_tmp="$I -lXext -lX11 $ld_pthread -Wl,-R$(echo $I | sed s/^-L//)" | | 118 | - ld_tmp="$I -lXext -lX11 $ld_pthread -Wl,-R$(echo $I | sed s/^-L//)" |
104 | + if test -n "$I" ; then | | 119 | + if test -n "$I" ; then |
105 | + ld_tmp="$I -lXext -lX11 $ld_pthread -Wl,-R$(echo $I | sed s/^-L//)" | | 120 | + ld_tmp="$I -lXext -lX11 $ld_pthread -Wl,-R$(echo $I | sed s/^-L//)" |
106 | + else | | 121 | + else |
107 | + ld_tmp="-lXext -lX11 $ld_pthread" | | 122 | + ld_tmp="-lXext -lX11 $ld_pthread" |
108 | + fi | | 123 | + fi |
109 | else | | 124 | else |
110 | ld_tmp="$I -lXext -lX11 $ld_pthread" | | 125 | ld_tmp="$I -lXext -lX11 $ld_pthread" |
111 | fi | | 126 | fi |
112 | @@ -4994,6 +5004,8 @@ if test "$_aa" = yes ; then | | 127 | @@ -5018,6 +5029,8 @@ if test "$_aa" = yes ; then |
113 | def_aa='#define CONFIG_AA 1' | | 128 | def_aa='#define CONFIG_AA 1' |
114 | if cygwin ; then | | 129 | if cygwin ; then |
115 | libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)" | | 130 | libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)" |
116 | + else | | 131 | + else |
117 | + libs_mplayer="$libs_mplayer $(aalib-config --libs)" | | 132 | + libs_mplayer="$libs_mplayer $(aalib-config --libs)" |
118 | fi | | 133 | fi |
119 | vomodules="aa $vomodules" | | 134 | vomodules="aa $vomodules" |
120 | else | | 135 | else |
121 | @@ -5081,7 +5093,6 @@ EOF | | 136 | @@ -5105,7 +5118,6 @@ EOF |
122 | extra_cflags="$extra_cflags $inc_tmp" && break | | 137 | extra_cflags="$extra_cflags $inc_tmp" && break |
123 | done | | 138 | done |
124 | fi | | 139 | fi |
125 | -echores "$_dvb" | | 140 | -echores "$_dvb" |
126 | if test "$_dvb" = yes ; then | | 141 | if test "$_dvb" = yes ; then |
127 | _dvbin=yes | | 142 | _dvbin=yes |
128 | inputmodules="dvb $inputmodules" | | 143 | inputmodules="dvb $inputmodules" |
129 | @@ -5090,14 +5101,29 @@ if test "$_dvb" = yes ; then | | 144 | @@ -5114,14 +5126,29 @@ if test "$_dvb" = yes ; then |
130 | aomodules="mpegpes(dvb) $aomodules" | | 145 | aomodules="mpegpes(dvb) $aomodules" |
131 | vomodules="mpegpes(dvb) $vomodules" | | 146 | vomodules="mpegpes(dvb) $vomodules" |
132 | else | | 147 | else |
133 | - _dvbin=no | | 148 | - _dvbin=no |
134 | - noinputmodules="dvb $noinputmodules" | | 149 | - noinputmodules="dvb $noinputmodules" |
135 | - def_dvb='#undef CONFIG_DVB' | | 150 | - def_dvb='#undef CONFIG_DVB' |
136 | - def_dvbin='#undef CONFIG_DVBIN ' | | 151 | - def_dvbin='#undef CONFIG_DVBIN ' |
137 | - aomodules="mpegpes(file) $aomodules" | | 152 | - aomodules="mpegpes(file) $aomodules" |
138 | - vomodules="mpegpes(file) $vomodules" | | 153 | - vomodules="mpegpes(file) $vomodules" |
139 | + cat >$TMPC <<EOF | | 154 | + cat >$TMPC <<EOF |
140 | +#include <dev/dtv/dtvio.h> | | 155 | +#include <dev/dtv/dtvio.h> |
141 | +int main(void) {return 0;} | | 156 | +int main(void) {return 0;} |
142 | +EOF | | 157 | +EOF |