summaryrefslogtreecommitdiff
path: root/lang/perl5/patches/patch-ca
blob: e648a411de2acea64db9cf000521677d494cd481 (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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
$NetBSD: patch-ca,v 1.25 2016/03/07 21:27:58 kamil Exp $

* Use "uname -r" to get OS version for *BSD.
* Move $loclibpth to the end of $dlist, instead of the beginning.
* Detect systems which have <fenv.h> but where using it fails.
* Several other changes.

--- Configure.orig	2015-10-17 12:38:37.000000000 +0000
+++ Configure
@@ -3439,13 +3439,14 @@ EOM
 			osvers="$3"
 			;;
 		dragonfly) osname=dragonfly
-			osvers="$3"
+			osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'`
 			;;
 		dynixptx*) osname=dynixptx
 			osvers=`echo "$4"|sed 's/^v//'`
 			;;
 		freebsd) osname=freebsd
-			osvers="$3" ;;
+			osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'`
+			;;
 		genix)	osname=genix ;;
 		gnu)	osname=gnu
 			osvers="$3" ;;
@@ -3468,7 +3469,7 @@ EOM
 		MiNT)	osname=mint
 			;;
 		netbsd*) osname=netbsd
-			osvers="$3"
+			osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'`
 			;;
 		news-os) osvers="$3"
 			case "$3" in
@@ -3478,7 +3479,7 @@ EOM
 			;;
 		nonstop-ux) osname=nonstopux ;;
 		openbsd) osname=openbsd
-                	osvers="$3"
+                	osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'`
                 	;;
 		os2)	osname=os2
 			osvers="$4"
@@ -3493,6 +3494,9 @@ EOM
 		qnx) osname=qnx
 			osvers="$4"
 			;;
+		sco_sv) osname=sco_sv
+			osvers=`$uname -r`v`$uname -v`
+			;;
 		solaris) osname=solaris
 			case "$3" in
 			5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
@@ -4931,7 +4935,7 @@ esac
 # If using gcc or clang, we can get better values for libpth, incpth
 # and usrinc directly from the compiler.
 # Note that ccname for clang is also gcc.
-case "$ccname" in
+case "xx$ccname" in
     gcc)
 	$echo 'extern int foo;' > try.c
 	set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
@@ -5007,14 +5011,14 @@ case "$plibpth" in
 esac
 case "$libpth" in
 ' ') dlist='';;
-'') dlist="$loclibpth $plibpth $glibpth";;
+'') dlist="$plibpth $glibpth $loclibpth";;
 *) dlist="$libpth";;
 esac
 
 : Now check and see which directories actually exist, avoiding duplicates
 for xxx in $dlist
 do
-    if $test -d $xxx; then
+    if $test -d $xxx -o "$xxx" = "$prefix/lib"; then
 		case " $libpth " in
 		*" $xxx "*) ;;
 		*) libpth="$libpth $xxx";;
@@ -5130,7 +5134,7 @@ lib_ext=$_a
 obj_ext=$_o
 path_sep=$p_
 
-rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
+rm_try="@TOOLS_RM@ -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
 
 : Which makefile gets called first.  This is used by make depend.
 case "$firstmakefile" in
@@ -6416,6 +6420,15 @@ case "$nm_so_opt" in
 	;;
 esac
 
+: Mac OS X 10.7 is different
+case "$osname" in
+    darwin)
+	case "$osvers" in
+	    11.*)
+		libnames="$libnames /usr/lib/system/libsystem_*.dylib"
+	esac
+esac
+
 : Figure out where the libc is located
 case "$runnm" in
 true)
@@ -7490,7 +7503,9 @@ rp='Pathname for the site-specific libra
 . ./getfile
 prefixvar=sitelib
 . ./setprefixvar
-sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
+if $test -z "$sitelib_stem"; then
+	sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
+fi
 
 : Determine list of previous versions to include in @INC
 $cat > getverlist <<EOPL
@@ -7631,7 +7646,7 @@ echo " "
 case "$ptrsize" in
 '')
 	echo "Checking to see how big your pointers are..." >&4
-	$cat >>try.c <<EOCP
+	$cat >try.c <<EOCP
 #include <stdio.h>
 #$i_stdlib I_STDLIB
 #ifdef I_STDLIB
@@ -7902,7 +7917,9 @@ case "$vendorprefix" in
 	vendorlibexp="$ansexp"
 	;;
 esac
-vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
+if $test -z "$vendorlib_stem"; then
+	vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
+fi
 prefixvar=vendorlib
 . ./installprefix
 
@@ -8443,6 +8460,7 @@ EOM
 			  esac
 			  ;;
 		    *linux*|irix*|gnu*)  dflt="-shared $optimize" ;;
+		    sco_sv) dflt='-shared' ;;
 		    solaris) # See [perl #66604].
 			    # On Solaris 11, gcc -m64 on amd64
 			    # appears not to understand -G.  gcc versions at
@@ -8741,6 +8759,10 @@ if "$useshrplib"; then
 	bsdos|linux|irix*|dec_osf|gnu*|haiku)
 		xxx="-Wl,-rpath,$shrpdir"
 		;;
+	haiku)
+		# Haiku doesn't like the default, either.
+		xxx="-Wl,-rpath,$shrpdir"
+		;;
 	hpux*)
 		# hpux doesn't like the default, either.
 		tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
@@ -8748,6 +8770,9 @@ if "$useshrplib"; then
 	cygwin)
 		# cygwin needs only ldlibpth
 		;;
+	sco_sv)
+		xxx="-Wl,-R$shrpdir"
+		;;
 	*)
 		tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
 		;;
@@ -9826,6 +9851,13 @@ esac
 : Check if we want perlio
 useperlio="$define"
 
+: Look for a hint-file generated 'call-back-unit'.  We need
+: to set some defaults for building perl in pkgsrc.
+if $test -f pkgsrc.cbu; then
+	echo "Setting pkgsrc-specific hints regarding compiler/linker flags..."
+	. ./pkgsrc.cbu
+fi
+
 : Set the vendorbin variables
 case "$vendorprefix" in
 '')	d_vendorbin="$undef"
@@ -20129,7 +20161,15 @@ RCAT(Rei,ser)
 ACAT(Cir,cus)
 EOCP
 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
-if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
+# yuck, what a hack.
+# MIPSPro compiler/preprocessor behaves differently if invoked on
+# stdin vs file.  Here we test for stdin, but lateron we use files.
+# So force it to work the way we know it does:
+if [ x"${OPSYS}" = x"IRIX" ]; then
+	echo "Hacking MIPSPro on file vs. stdin..." >&4
+	echo "We know we can catify or stringify, separately or together!"
+	cpp_stuff=42
+elif $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
 	echo "Oh!  Smells like ANSI's been here." >&4
 	echo "We can catify or stringify, separately or together!"
 	cpp_stuff=42
@@ -22645,6 +22685,21 @@ eval $inhdr
 set fenv.h i_fenv
 eval $inhdr
 
+: And really validate that it is OK to include it
+: On NetBSD 6.x non-amd64 non-i386 and non-sparc this fails
+cat > try.c <<EOCP
+#include <fenv.h>
+int main() {
+	printf("runs ok too\n");
+	exit(0);
+}
+EOCP
+set try
+if ! eval $compile_ok; then
+	echo "<fenv.h> found to be unusable, disabling" >&4
+	i_fenv=$undef
+fi
+
 : see if this is a fp.h system
 set fp.h i_fp
 eval $inhdr
@@ -24966,4 +25021,3 @@ $rm -f kit*isdone ark*isdone
 $rm -rf UU
 
 : End of Configure
-