| @@ -1,214 +1,224 @@ | | | @@ -1,214 +1,224 @@ |
1 | $NetBSD: patch-Configure,v 1.3 2016/06/08 17:39:30 he Exp $ | | 1 | $NetBSD: patch-Configure,v 1.4 2017/07/07 05:54:24 wiz Exp $ |
2 | | | 2 | |
3 | * Use "uname -r" to get OS version for *BSD. | | 3 | * Use "uname -r" to get OS version for *BSD. |
4 | * Move $loclibpth to the end of $dlist, instead of the beginning. | | 4 | * Move $loclibpth to the end of $dlist, instead of the beginning. |
5 | * Detect systems which have <fenv.h> but where using it fails. | | 5 | * Detect systems which have <fenv.h> but where using it fails. |
| | | 6 | * Honor more ldflags in shared objects. |
6 | * Several other changes. | | 7 | * Several other changes. |
7 | | | 8 | |
8 | --- Configure.orig 2016-04-26 22:11:09.000000000 +0000 | | 9 | --- Configure.orig 2017-05-30 09:57:56.000000000 +0000 |
9 | +++ Configure | | 10 | +++ Configure 2017-07-07 05:44:48.961150149 +0000 |
10 | @@ -3468,13 +3468,14 @@ EOM | | 11 | @@ -3485,13 +3485,14 @@ |
11 | osvers="$3" | | 12 | osvers="$3" |
12 | ;; | | 13 | ;; |
13 | dragonfly) osname=dragonfly | | 14 | dragonfly) osname=dragonfly |
14 | - osvers="$3" | | 15 | - osvers="$3" |
15 | + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` | | 16 | + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` |
16 | ;; | | 17 | ;; |
17 | dynixptx*) osname=dynixptx | | 18 | dynixptx*) osname=dynixptx |
18 | osvers=`echo "$4"|sed 's/^v//'` | | 19 | osvers=`echo "$4"|sed 's/^v//'` |
19 | ;; | | 20 | ;; |
20 | freebsd) osname=freebsd | | 21 | freebsd) osname=freebsd |
21 | - osvers="$3" ;; | | 22 | - osvers="$3" ;; |
22 | + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` | | 23 | + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` |
23 | + ;; | | 24 | + ;; |
24 | genix) osname=genix ;; | | 25 | genix) osname=genix ;; |
25 | gnu) osname=gnu | | 26 | gnu) osname=gnu |
26 | osvers="$3" ;; | | 27 | osvers="$3" ;; |
27 | @@ -3497,7 +3498,7 @@ EOM | | 28 | @@ -3514,7 +3515,7 @@ |
28 | MiNT) osname=mint | | 29 | MiNT) osname=mint |
29 | ;; | | 30 | ;; |
30 | netbsd*) osname=netbsd | | 31 | netbsd*) osname=netbsd |
31 | - osvers="$3" | | 32 | - osvers="$3" |
32 | + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` | | 33 | + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` |
33 | ;; | | 34 | ;; |
34 | news-os) osvers="$3" | | 35 | news-os) osvers="$3" |
35 | case "$3" in | | 36 | case "$3" in |
36 | @@ -3507,7 +3508,7 @@ EOM | | 37 | @@ -3524,7 +3525,7 @@ |
37 | ;; | | 38 | ;; |
38 | nonstop-ux) osname=nonstopux ;; | | 39 | nonstop-ux) osname=nonstopux ;; |
39 | openbsd) osname=openbsd | | 40 | openbsd) osname=openbsd |
40 | - osvers="$3" | | 41 | - osvers="$3" |
41 | + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` | | 42 | + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` |
42 | ;; | | 43 | ;; |
43 | os2) osname=os2 | | 44 | os2) osname=os2 |
44 | osvers="$4" | | 45 | osvers="$4" |
45 | @@ -3522,6 +3523,9 @@ EOM | | 46 | @@ -3539,6 +3540,9 @@ |
46 | qnx) osname=qnx | | 47 | qnx) osname=qnx |
47 | osvers="$4" | | 48 | osvers="$4" |
48 | ;; | | 49 | ;; |
49 | + sco_sv) osname=sco_sv | | 50 | + sco_sv) osname=sco_sv |
50 | + osvers=`$uname -r`v`$uname -v` | | 51 | + osvers=`$uname -r`v`$uname -v` |
51 | + ;; | | 52 | + ;; |
52 | solaris) osname=solaris | | 53 | solaris) osname=solaris |
53 | case "$3" in | | 54 | case "$3" in |
54 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; | | 55 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; |
55 | @@ -4960,7 +4964,7 @@ esac | | 56 | @@ -4977,7 +4981,7 @@ |
56 | # If using gcc or clang, we can get better values for libpth, incpth | | 57 | # If using gcc or clang, we can get better values for libpth, incpth |
57 | # and usrinc directly from the compiler. | | 58 | # and usrinc directly from the compiler. |
58 | # Note that ccname for clang is also gcc. | | 59 | # Note that ccname for clang is also gcc. |
59 | -case "$ccname" in | | 60 | -case "$ccname" in |
60 | +case "xx$ccname" in | | 61 | +case "xx$ccname" in |
61 | gcc) | | 62 | gcc) |
62 | $echo 'extern int foo;' > try.c | | 63 | $echo 'extern int foo;' > try.c |
63 | set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'` | | 64 | set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'` |
64 | @@ -5036,14 +5040,14 @@ case "$plibpth" in | | 65 | @@ -5053,14 +5057,14 @@ |
65 | esac | | 66 | esac |
66 | case "$libpth" in | | 67 | case "$libpth" in |
67 | ' ') dlist='';; | | 68 | ' ') dlist='';; |
68 | -'') dlist="$loclibpth $plibpth $glibpth";; | | 69 | -'') dlist="$loclibpth $plibpth $glibpth";; |
69 | +'') dlist="$plibpth $glibpth $loclibpth";; | | 70 | +'') dlist="$plibpth $glibpth $loclibpth";; |
70 | *) dlist="$libpth";; | | 71 | *) dlist="$libpth";; |
71 | esac | | 72 | esac |
72 | | | 73 | |
73 | : Now check and see which directories actually exist, avoiding duplicates | | 74 | : Now check and see which directories actually exist, avoiding duplicates |
74 | for xxx in $dlist | | 75 | for xxx in $dlist |
75 | do | | 76 | do |
76 | - if $test -d $xxx; then | | 77 | - if $test -d $xxx; then |
77 | + if $test -d $xxx -o "$xxx" = "$prefix/lib"; then | | 78 | + if $test -d $xxx -o "$xxx" = "$prefix/lib"; then |
78 | case " $libpth " in | | 79 | case " $libpth " in |
79 | *" $xxx "*) ;; | | 80 | *" $xxx "*) ;; |
80 | *) libpth="$libpth $xxx";; | | 81 | *) libpth="$libpth $xxx";; |
81 | @@ -5159,7 +5163,7 @@ lib_ext=$_a | | 82 | @@ -5176,7 +5180,7 @@ |
82 | obj_ext=$_o | | 83 | obj_ext=$_o |
83 | path_sep=$p_ | | 84 | path_sep=$p_ |
84 | | | 85 | |
85 | -rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*" | | 86 | -rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*" |
86 | +rm_try="@TOOLS_RM@ -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*" | | 87 | +rm_try="@TOOLS_RM@ -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*" |
87 | | | 88 | |
88 | : Which makefile gets called first. This is used by make depend. | | 89 | : Which makefile gets called first. This is used by make depend. |
89 | case "$firstmakefile" in | | 90 | case "$firstmakefile" in |
90 | @@ -6461,6 +6465,15 @@ case "$nm_so_opt" in | | 91 | @@ -6492,6 +6496,15 @@ |
91 | ;; | | 92 | ;; |
92 | esac | | 93 | esac |
93 | | | 94 | |
94 | +: Mac OS X 10.7 is different | | 95 | +: Mac OS X 10.7 is different |
95 | +case "$osname" in | | 96 | +case "$osname" in |
96 | + darwin) | | 97 | + darwin) |
97 | + case "$osvers" in | | 98 | + case "$osvers" in |
98 | + 11.*) | | 99 | + 11.*) |
99 | + libnames="$libnames /usr/lib/system/libsystem_*.dylib" | | 100 | + libnames="$libnames /usr/lib/system/libsystem_*.dylib" |
100 | + esac | | 101 | + esac |
101 | +esac | | 102 | +esac |
102 | + | | 103 | + |
103 | : Figure out where the libc is located | | 104 | : Figure out where the libc is located |
104 | case "$runnm" in | | 105 | case "$runnm" in |
105 | true) | | 106 | true) |
106 | @@ -7564,7 +7577,9 @@ rp='Pathname for the site-specific libra | | 107 | @@ -7626,7 +7639,9 @@ |
107 | . ./getfile | | 108 | . ./getfile |
108 | prefixvar=sitelib | | 109 | prefixvar=sitelib |
109 | . ./setprefixvar | | 110 | . ./setprefixvar |
110 | -sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` | | 111 | -sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` |
111 | +if $test -z "$sitelib_stem"; then | | 112 | +if $test -z "$sitelib_stem"; then |
112 | + sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` | | 113 | + sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` |
113 | +fi | | 114 | +fi |
114 | | | 115 | |
115 | : Determine list of previous versions to include in @INC | | 116 | : Determine list of previous versions to include in @INC |
116 | $cat > getverlist <<EOPL | | 117 | $cat > getverlist <<EOPL |
117 | @@ -7976,7 +7991,9 @@ case "$vendorprefix" in | | 118 | @@ -8038,7 +8053,9 @@ |
118 | vendorlibexp="$ansexp" | | 119 | vendorlibexp="$ansexp" |
119 | ;; | | 120 | ;; |
120 | esac | | 121 | esac |
121 | -vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"` | | 122 | -vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"` |
122 | +if $test -z "$vendorlib_stem"; then | | 123 | +if $test -z "$vendorlib_stem"; then |
123 | + vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"` | | 124 | + vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"` |
124 | +fi | | 125 | +fi |
125 | prefixvar=vendorlib | | 126 | prefixvar=vendorlib |
126 | . ./installprefix | | 127 | . ./installprefix |
127 | | | 128 | |
128 | @@ -8518,6 +8535,7 @@ EOM | | 129 | @@ -8580,6 +8597,7 @@ |
129 | esac | | 130 | esac |
130 | ;; | | 131 | ;; |
131 | *linux*|irix*|gnu*) dflt="-shared $optimize" ;; | | 132 | *linux*|irix*|gnu*) dflt="-shared $optimize" ;; |
132 | + sco_sv) dflt='-shared' ;; | | 133 | + sco_sv) dflt='-shared' ;; |
133 | solaris) # See [perl #66604]. | | 134 | solaris) # See [perl #66604]. |
134 | # On Solaris 11, gcc -m64 on amd64 | | 135 | # On Solaris 11, gcc -m64 on amd64 |
135 | # appears not to understand -G. gcc versions at | | 136 | # appears not to understand -G. gcc versions at |
136 | @@ -8816,6 +8834,10 @@ if "$useshrplib"; then | | 137 | @@ -8619,7 +8637,7 @@ |
| | | 138 | esac |
| | | 139 | for thisflag in $ldflags; do |
| | | 140 | case "$thisflag" in |
| | | 141 | - -L*|-R*|-Wl,-R*) |
| | | 142 | + -L*|-R*|-Wl,-R*|-Wl,-z*) |
| | | 143 | case " $dflt " in |
| | | 144 | *" $thisflag "*) ;; |
| | | 145 | *) dflt="$dflt $thisflag" ;; |
| | | 146 | @@ -8878,6 +8896,10 @@ |
137 | bsdos|linux|irix*|dec_osf|gnu*|haiku) | | 147 | bsdos|linux|irix*|dec_osf|gnu*|haiku) |
138 | xxx="-Wl,-rpath,$shrpdir" | | 148 | xxx="-Wl,-rpath,$shrpdir" |
139 | ;; | | 149 | ;; |
140 | + haiku) | | 150 | + haiku) |
141 | + # Haiku doesn't like the default, either. | | 151 | + # Haiku doesn't like the default, either. |
142 | + xxx="-Wl,-rpath,$shrpdir" | | 152 | + xxx="-Wl,-rpath,$shrpdir" |
143 | + ;; | | 153 | + ;; |
144 | hpux*) | | 154 | hpux*) |
145 | # hpux doesn't like the default, either. | | 155 | # hpux doesn't like the default, either. |
146 | tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\"" | | 156 | tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\"" |
147 | @@ -8823,6 +8845,9 @@ if "$useshrplib"; then | | 157 | @@ -8885,6 +8907,9 @@ |
148 | cygwin) | | 158 | cygwin) |
149 | # cygwin needs only ldlibpth | | 159 | # cygwin needs only ldlibpth |
150 | ;; | | 160 | ;; |
151 | + sco_sv) | | 161 | + sco_sv) |
152 | + xxx="-Wl,-R$shrpdir" | | 162 | + xxx="-Wl,-R$shrpdir" |
153 | + ;; | | 163 | + ;; |
154 | *) | | 164 | *) |
155 | tmp_shrpenv="env LD_RUN_PATH=$shrpdir" | | 165 | tmp_shrpenv="env LD_RUN_PATH=$shrpdir" |
156 | ;; | | 166 | ;; |
157 | @@ -9901,6 +9926,13 @@ esac | | 167 | @@ -9966,6 +9991,13 @@ |
158 | : Check if we want perlio | | 168 | : Check if we want perlio |
159 | useperlio="$define" | | 169 | useperlio="$define" |
160 | | | 170 | |
161 | +: Look for a hint-file generated 'call-back-unit'. We need | | 171 | +: Look for a hint-file generated 'call-back-unit'. We need |
162 | +: to set some defaults for building perl in pkgsrc. | | 172 | +: to set some defaults for building perl in pkgsrc. |
163 | +if $test -f pkgsrc.cbu; then | | 173 | +if $test -f pkgsrc.cbu; then |
164 | + echo "Setting pkgsrc-specific hints regarding compiler/linker flags..." | | 174 | + echo "Setting pkgsrc-specific hints regarding compiler/linker flags..." |
165 | + . ./pkgsrc.cbu | | 175 | + . ./pkgsrc.cbu |
166 | +fi | | 176 | +fi |
167 | + | | 177 | + |
168 | : Set the vendorbin variables | | 178 | : Set the vendorbin variables |
169 | case "$vendorprefix" in | | 179 | case "$vendorprefix" in |
170 | '') d_vendorbin="$undef" | | 180 | '') d_vendorbin="$undef" |
171 | @@ -20262,7 +20294,15 @@ RCAT(Rei,ser) | | 181 | @@ -20424,7 +20456,15 @@ |
172 | ACAT(Cir,cus) | | 182 | ACAT(Cir,cus) |
173 | EOCP | | 183 | EOCP |
174 | $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1 | | 184 | $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1 |
175 | -if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then | | 185 | -if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then |
176 | +# yuck, what a hack. | | 186 | +# yuck, what a hack. |
177 | +# MIPSPro compiler/preprocessor behaves differently if invoked on | | 187 | +# MIPSPro compiler/preprocessor behaves differently if invoked on |
178 | +# stdin vs file. Here we test for stdin, but lateron we use files. | | 188 | +# stdin vs file. Here we test for stdin, but lateron we use files. |
179 | +# So force it to work the way we know it does: | | 189 | +# So force it to work the way we know it does: |
180 | +if [ x"${OPSYS}" = x"IRIX" ]; then | | 190 | +if [ x"${OPSYS}" = x"IRIX" ]; then |
181 | + echo "Hacking MIPSPro on file vs. stdin..." >&4 | | 191 | + echo "Hacking MIPSPro on file vs. stdin..." >&4 |
182 | + echo "We know we can catify or stringify, separately or together!" | | 192 | + echo "We know we can catify or stringify, separately or together!" |
183 | + cpp_stuff=42 | | 193 | + cpp_stuff=42 |
184 | +elif $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then | | 194 | +elif $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then |
185 | echo "Oh! Smells like ANSI's been here." >&4 | | 195 | echo "Oh! Smells like ANSI's been here." >&4 |
186 | echo "We can catify or stringify, separately or together!" | | 196 | echo "We can catify or stringify, separately or together!" |
187 | cpp_stuff=42 | | 197 | cpp_stuff=42 |
188 | @@ -23049,6 +23089,21 @@ eval $inhdr | | 198 | @@ -23296,6 +23336,21 @@ |
189 | set fenv.h i_fenv | | 199 | set fenv.h i_fenv |
190 | eval $inhdr | | 200 | eval $inhdr |
191 | | | 201 | |
192 | +: And really validate that it is OK to include it | | 202 | +: And really validate that it is OK to include it |
193 | +: On NetBSD 6.x non-amd64 non-i386 and non-sparc this fails | | 203 | +: On NetBSD 6.x non-amd64 non-i386 and non-sparc this fails |
194 | +cat > try.c <<EOCP | | 204 | +cat > try.c <<EOCP |
195 | +#include <fenv.h> | | 205 | +#include <fenv.h> |
196 | +int main() { | | 206 | +int main() { |
197 | + printf("runs ok too\n"); | | 207 | + printf("runs ok too\n"); |
198 | + exit(0); | | 208 | + exit(0); |
199 | +} | | 209 | +} |
200 | +EOCP | | 210 | +EOCP |
201 | +set try | | 211 | +set try |
202 | +if ! eval $compile_ok; then | | 212 | +if ! eval $compile_ok; then |
203 | + echo "<fenv.h> found to be unusable, disabling" >&4 | | 213 | + echo "<fenv.h> found to be unusable, disabling" >&4 |
204 | + i_fenv=$undef | | 214 | + i_fenv=$undef |
205 | +fi | | 215 | +fi |
206 | + | | 216 | + |
207 | : see if this is a fp.h system | | 217 | : see if this is a fp.h system |
208 | set fp.h i_fp | | 218 | set fp.h i_fp |
209 | eval $inhdr | | 219 | eval $inhdr |
210 | @@ -25402,4 +25457,3 @@ $rm -f kit*isdone ark*isdone | | 220 | @@ -25665,4 +25720,3 @@ |
211 | $rm -rf UU | | 221 | $rm -rf UU |
212 | | | 222 | |
213 | : End of Configure | | 223 | : End of Configure |
214 | - | | 224 | - |