openpkg/openssl.patch

changeset 744
1a30ac06597d
parent 432
aa0488214e35
equal deleted inserted replaced
2:ad470d9ae840 3:8343a58b83fa
73 + echo "x86_64-apple-darwin${VERSION}" 73 + echo "x86_64-apple-darwin${VERSION}"
74 + ;; 74 + ;;
75 *) 75 *)
76 echo "i686-apple-darwin${VERSION}" 76 echo "i686-apple-darwin${VERSION}"
77 ;; 77 ;;
78 @@ -413,7 +416,7 @@ 78 @@ -411,9 +414,14 @@
79 79 # this is where the translation occurs into SSLeay terms
80 # ---------------------------------------------------------------------------
81
82 +# Assume CC is GNU GCC if 'dumpversion' argument produces valid output
83 +GCCVER=`sh -c "${CC-gcc} -dumpversion" 2>/dev/null`
84 +GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
85 +GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
86 +
80 # Only set CC if not supplied already 87 # Only set CC if not supplied already
81 if [ -z "$CROSS_COMPILE$CC" ]; then 88 if [ -z "$CROSS_COMPILE$CC" ]; then
82 - GCCVER=`sh -c "gcc -dumpversion" 2>/dev/null` 89 - GCCVER=`sh -c "gcc -dumpversion" 2>/dev/null`
83 + GCCVER=`sh -c "${CC-gcc} -dumpversion" 2>/dev/null` 90 + GCCVER=`sh -c "${CC-gcc} -dumpversion" 2>/dev/null`
84 if [ "$GCCVER" != "" ]; then 91 if [ "$GCCVER" != "" ]; then
85 # then strip off whatever prefix egcs prepends the number with... 92 # then strip off whatever prefix egcs prepends the number with...
86 # Hopefully, this will work for any future prefixes as well. 93 # Hopefully, this will work for any future prefixes as well.
87 @@ -424,8 +427,17 @@ 94 @@ -424,8 +432,17 @@
88 # peak single digit before and after first dot, e.g. 2.95.1 gives 29 95 # peak single digit before and after first dot, e.g. 2.95.1 gives 29
89 GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'` 96 GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
90 CC=gcc 97 CC=gcc
91 + SUFFIX=gcc 98 + SUFFIX=gcc
92 + else 99 else
93 + CC=cc 100 CC=cc
94 + SUFFIX=cc 101 + SUFFIX=cc
95 + fi 102 + fi
96 +else 103 +else
97 + if [ "$GCCVER" != "" ]; then 104 + if [ "$GCCVER" != "" ]; then
98 + SUFFIX=gcc 105 + SUFFIX=gcc
99 else 106 + else
100 CC=cc 107 + CC=cc
101 + SUFFIX=cc 108 + SUFFIX=cc
102 fi 109 fi
103 fi 110 fi
104 GCCVER=${GCCVER:-0} 111 GCCVER=${GCCVER:-0}
105 @@ -435,7 +447,7 @@ 112 @@ -435,7 +452,7 @@
106 if [ $GCCVER -ge 30 ]; then 113 if [ $GCCVER -ge 30 ]; then
107 # PA64 support only came in with gcc 3.0.x. 114 # PA64 support only came in with gcc 3.0.x.
108 # We check if the preprocessor symbol __LP64__ is defined... 115 # We check if the preprocessor symbol __LP64__ is defined...
109 - if echo "__LP64__" | gcc -v -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null; then 116 - if echo "__LP64__" | gcc -v -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null; then
110 + if echo "__LP64__" | $CC -v -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null; then 117 + if echo "__LP64__" | $CC -v -E -x c - 2>/dev/null | grep "^__LP64__" 2>&1 > /dev/null; then
111 : # __LP64__ has slipped through, it therefore is not defined 118 : # __LP64__ has slipped through, it therefore is not defined
112 else 119 else
113 GCC_BITS="64" 120 GCC_BITS="64"
114 @@ -446,13 +458,14 @@ 121 @@ -446,13 +463,14 @@
115 if [ $GCCVER -ge 30 ]; then 122 if [ $GCCVER -ge 30 ]; then
116 # 64-bit ABI isn't officially supported in gcc 3.0, but it appears 123 # 64-bit ABI isn't officially supported in gcc 3.0, but it appears
117 # to be working, at the very least 'make test' passes... 124 # to be working, at the very least 'make test' passes...
118 - if gcc -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then 125 - if gcc -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then
119 + if $CC -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then 126 + if $CC -v -E -x c /dev/null 2>&1 | grep __arch64__ > /dev/null; then
125 # check for WorkShop C, expected output is "cc: blah-blah C x.x" 132 # check for WorkShop C, expected output is "cc: blah-blah C x.x"
126 + if [ $GCCVER -eq 0 ]; then 133 + if [ $GCCVER -eq 0 ]; then
127 CCVER=`(cc -V 2>&1) 2>/dev/null | \ 134 CCVER=`(cc -V 2>&1) 2>/dev/null | \
128 egrep -e '^cc: .* C [0-9]\.[0-9]' | \ 135 egrep -e '^cc: .* C [0-9]\.[0-9]' | \
129 sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'` 136 sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'`
130 @@ -465,6 +478,7 @@ 137 @@ -465,6 +483,7 @@
131 sleep 5 138 sleep 5
132 fi 139 fi
133 fi 140 fi
134 + fi 141 + fi
135 fi 142 fi
136 143
137 if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then 144 if [ "${SYSTEM}-${MACHINE}" = "Linux-alpha" ]; then
138 @@ -482,6 +496,7 @@ 145 @@ -482,6 +501,7 @@
139 146
140 if [ "${SYSTEM}" = "AIX" ]; then # favor vendor cc over gcc 147 if [ "${SYSTEM}" = "AIX" ]; then # favor vendor cc over gcc
141 (cc) 2>&1 | grep -iv "not found" > /dev/null && CC=cc 148 (cc) 2>&1 | grep -iv "not found" > /dev/null && CC=cc
142 + (gcc) 2>&1 | grep -iv "not found" > /dev/null && CC=gcc 149 + (gcc) 2>&1 | grep -iv "not found" > /dev/null && CC=gcc
143 fi 150 fi
144 151
145 CCVER=${CCVER:-0} 152 CCVER=${CCVER:-0}
146 @@ -507,7 +522,7 @@ 153 @@ -507,7 +527,7 @@
147 if [ $CPU -ge 4000 ]; then 154 if [ $CPU -ge 4000 ]; then
148 options="$options -mips2" 155 options="$options -mips2"
149 fi 156 fi
150 - OUT="irix-$CC" 157 - OUT="irix-$CC"
151 + OUT="irix-$SUFFIX" 158 + OUT="irix-$SUFFIX"
152 ;; 159 ;;
153 mips3-sgi-irix) 160 mips3-sgi-irix)
154 #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'` 161 #CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
155 @@ -517,11 +532,11 @@ 162 @@ -517,11 +537,11 @@
156 #else 163 #else
157 # options="$options -mips3" 164 # options="$options -mips3"
158 #fi 165 #fi
159 - OUT="irix-mips3-$CC" 166 - OUT="irix-mips3-$CC"
160 + OUT="irix-mips3-$SUFFIX" 167 + OUT="irix-mips3-$SUFFIX"
164 - echo " invoke './Configure irix64-mips4-$CC' *manually*." 171 - echo " invoke './Configure irix64-mips4-$CC' *manually*."
165 + echo " invoke './Configure irix64-mips4-$SUFFIX' *manually*." 172 + echo " invoke './Configure irix64-mips4-$SUFFIX' *manually*."
166 if [ "$TEST" = "false" -a -t 1 ]; then 173 if [ "$TEST" = "false" -a -t 1 ]; then
167 echo " You have about 5 seconds to press Ctrl-C to abort." 174 echo " You have about 5 seconds to press Ctrl-C to abort."
168 (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 175 (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1
169 @@ -533,7 +548,7 @@ 176 @@ -533,7 +553,7 @@
170 #else 177 #else
171 # options="$options -mips3" 178 # options="$options -mips3"
172 #fi 179 #fi
173 - OUT="irix-mips3-$CC" 180 - OUT="irix-mips3-$CC"
174 + OUT="irix-mips3-$SUFFIX" 181 + OUT="irix-mips3-$SUFFIX"
175 ;; 182 ;;
176 ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;; 183 ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;;
177 ppc-apple-darwin*) 184 ppc-apple-darwin*)
178 @@ -566,6 +581,9 @@ 185 @@ -566,6 +586,9 @@
179 else 186 else
180 OUT="darwin-i386-cc" 187 OUT="darwin-i386-cc"
181 fi ;; 188 fi ;;
182 + x86_64-apple-darwin*) 189 + x86_64-apple-darwin*)
183 + OUT="darwin64-x86_64-cc" 190 + OUT="darwin64-x86_64-cc"
184 + ;; 191 + ;;
185 armv6+7-*-iphoneos) 192 armv6+7-*-iphoneos)
186 options="$options -arch%20armv6 -arch%20armv7" 193 options="$options -arch%20armv6 -arch%20armv7"
187 OUT="iphoneos-cross" ;; 194 OUT="iphoneos-cross" ;;
188 @@ -575,10 +593,10 @@ 195 @@ -575,10 +598,10 @@
189 alpha-*-linux2) 196 alpha-*-linux2)
190 ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo` 197 ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo`
191 case ${ISA:-generic} in 198 case ${ISA:-generic} in
192 - *[678]) OUT="linux-alpha+bwx-$CC" ;; 199 - *[678]) OUT="linux-alpha+bwx-$CC" ;;
193 - *) OUT="linux-alpha-$CC" ;; 200 - *) OUT="linux-alpha-$CC" ;;
197 - if [ "$CC" = "gcc" ]; then 204 - if [ "$CC" = "gcc" ]; then
198 + if [ $GCCVER -gt 0 ]; then 205 + if [ $GCCVER -gt 0 ]; then
199 case ${ISA:-generic} in 206 case ${ISA:-generic} in
200 EV5|EV45) options="$options -mcpu=ev5";; 207 EV5|EV45) options="$options -mcpu=ev5";;
201 EV56|PCA56) options="$options -mcpu=ev56";; 208 EV56|PCA56) options="$options -mcpu=ev56";;
202 @@ -662,7 +680,7 @@ 209 @@ -662,7 +685,7 @@
203 ;; 210 ;;
204 x86_64-*-linux?) OUT="linux-x86_64" ;; 211 x86_64-*-linux?) OUT="linux-x86_64" ;;
205 *86-*-linux2) OUT="linux-elf" 212 *86-*-linux2) OUT="linux-elf"
206 - if [ "$GCCVER" -gt 28 ]; then 213 - if [ "$GCCVER" -gt 28 ]; then
207 + if [ $GCCVER -gt 28 ]; then 214 + if [ $GCCVER -gt 28 ]; then
208 if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then 215 if grep '^model.*Pentium' /proc/cpuinfo >/dev/null ; then
209 options="$options -march=pentium" 216 options="$options -march=pentium"
210 fi 217 fi
211 @@ -676,17 +694,17 @@ 218 @@ -676,17 +699,17 @@
212 *-*-linux1) OUT="linux-aout" ;; 219 *-*-linux1) OUT="linux-aout" ;;
213 *-*-linux2) OUT="linux-generic32" ;; 220 *-*-linux2) OUT="linux-generic32" ;;
214 sun4[uv]*-*-solaris2) 221 sun4[uv]*-*-solaris2)
215 - OUT="solaris-sparcv9-$CC" 222 - OUT="solaris-sparcv9-$CC"
216 + OUT="solaris-sparcv9-$SUFFIX" 223 + OUT="solaris-sparcv9-$SUFFIX"
227 - elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then 234 - elif [ "$CC" = "gcc" -a "$GCC_ARCH" = "-m64" ]; then
228 + elif [ $GCCVER -gt 0 -a "$GCC_ARCH" = "-m64" ]; then 235 + elif [ $GCCVER -gt 0 -a "$GCC_ARCH" = "-m64" ]; then
229 # $GCC_ARCH denotes default ABI chosen by compiler driver 236 # $GCC_ARCH denotes default ABI chosen by compiler driver
230 # (first one found on the $PATH). I assume that user 237 # (first one found on the $PATH). I assume that user
231 # expects certain consistency with the rest of his builds 238 # expects certain consistency with the rest of his builds
232 @@ -712,21 +730,21 @@ 239 @@ -712,21 +735,21 @@
233 OUT="solaris64-sparcv9-$CC" 240 OUT="solaris64-sparcv9-$CC"
234 fi 241 fi
235 ;; 242 ;;
236 - sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;; 243 - sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
237 - sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;; 244 - sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;;
255 - *-*-sunos4) OUT="sunos-$CC" ;; 262 - *-*-sunos4) OUT="sunos-$CC" ;;
256 + *-*-sunos4) OUT="sunos-$SUFFIX" ;; 263 + *-*-sunos4) OUT="sunos-$SUFFIX" ;;
257 264
258 *86*-*-bsdi4) OUT="BSD-x86-elf"; options="$options no-sse2 -ldl" ;; 265 *86*-*-bsdi4) OUT="BSD-x86-elf"; options="$options no-sse2 -ldl" ;;
259 alpha*-*-*bsd*) OUT="BSD-generic64"; options="$options -DL_ENDIAN" ;; 266 alpha*-*-*bsd*) OUT="BSD-generic64"; options="$options -DL_ENDIAN" ;;
260 @@ -750,7 +768,7 @@ 267 @@ -750,7 +773,7 @@
261 *-*-osf) OUT="osf1-alpha-cc" ;; 268 *-*-osf) OUT="osf1-alpha-cc" ;;
262 *-*-tru64) OUT="tru64-alpha-cc" ;; 269 *-*-tru64) OUT="tru64-alpha-cc" ;;
263 *-*-[Uu]nix[Ww]are7) 270 *-*-[Uu]nix[Ww]are7)
264 - if [ "$CC" = "gcc" ]; then 271 - if [ "$CC" = "gcc" ]; then
265 + if [ $GCCVER -gt 0 ]; then 272 + if [ $GCCVER -gt 0 ]; then
266 OUT="unixware-7-gcc" ; options="$options no-sse2" 273 OUT="unixware-7-gcc" ; options="$options no-sse2"
267 else 274 else
268 OUT="unixware-7" ; options="$options no-sse2 -D__i386__" 275 OUT="unixware-7" ; options="$options no-sse2 -D__i386__"
269 @@ -761,12 +779,12 @@ 276 @@ -761,12 +784,12 @@
270 *-*-vos) 277 *-*-vos)
271 options="$options no-threads no-shared no-asm no-dso" 278 options="$options no-threads no-shared no-asm no-dso"
272 EXE=".pm" 279 EXE=".pm"
273 - OUT="vos-$CC" ;; 280 - OUT="vos-$CC" ;;
274 + OUT="vos-$SUFFIX" ;; 281 + OUT="vos-$SUFFIX" ;;
279 - if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then 286 - if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then
280 + if [ $GCCVER -gt 0 -a $GCC_BITS = "64" ]; then 287 + if [ $GCCVER -gt 0 -a $GCC_BITS = "64" ]; then
281 OUT="hpux64-parisc2-gcc" 288 OUT="hpux64-parisc2-gcc"
282 fi 289 fi
283 [ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null` 290 [ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null`
284 @@ -781,8 +799,8 @@ 291 @@ -781,8 +804,8 @@
285 OUT="hpux-ia64-cc" 292 OUT="hpux-ia64-cc"
286 fi 293 fi
287 elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU 294 elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU
288 - OUT=${OUT:-"hpux-parisc2-${CC}"} 295 - OUT=${OUT:-"hpux-parisc2-${CC}"}
289 - if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then 296 - if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then
290 + OUT=${OUT:-"hpux-parisc2-${SUFFIX}"} 297 + OUT=${OUT:-"hpux-parisc2-${SUFFIX}"}
291 + if [ $KERNEL_BITS -eq 64 -a $GCCVER -eq 0 ]; then 298 + if [ $KERNEL_BITS -eq 64 -a $GCCVER -eq 0 ]; then
292 echo "WARNING! If you wish to build 64-bit library then you have to" 299 echo "WARNING! If you wish to build 64-bit library then you have to"
293 echo " invoke './Configure hpux64-parisc2-cc' *manually*." 300 echo " invoke './Configure hpux64-parisc2-cc' *manually*."
294 if [ "$TEST" = "false" -a -t 1 ]; then 301 if [ "$TEST" = "false" -a -t 1 ]; then
295 @@ -791,9 +809,9 @@ 302 @@ -791,9 +814,9 @@
296 fi 303 fi
297 fi 304 fi
298 elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU 305 elif [ $CPU_VERSION -ge 528 ]; then # PA-RISC 1.1+ CPU
299 - OUT="hpux-parisc-${CC}" 306 - OUT="hpux-parisc-${CC}"
300 + OUT="hpux-parisc-${SUFFIX}" 307 + OUT="hpux-parisc-${SUFFIX}"
302 - OUT="hpux-parisc-${CC}" 309 - OUT="hpux-parisc-${CC}"
303 + OUT="hpux-parisc-${SUFFIX}" 310 + OUT="hpux-parisc-${SUFFIX}"
304 else # Motorola(?) CPU 311 else # Motorola(?) CPU
305 OUT="hpux-$CC" 312 OUT="hpux-$CC"
306 fi 313 fi
307 @@ -803,7 +821,7 @@ 314 @@ -803,7 +826,7 @@
308 [ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null` 315 [ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
309 KERNEL_BITS=${KERNEL_BITS:-32} 316 KERNEL_BITS=${KERNEL_BITS:-32}
310 OBJECT_MODE=${OBJECT_MODE:-32} 317 OBJECT_MODE=${OBJECT_MODE:-32}
311 - if [ "$CC" = "gcc" ]; then 318 - if [ "$CC" = "gcc" ]; then
312 + if [ $GCCVER -gt 0 ]; then 319 + if [ $GCCVER -gt 0 ]; then
313 OUT="aix-gcc" 320 OUT="aix-gcc"
314 if [ $OBJECT_MODE -eq 64 ]; then 321 if [ $OBJECT_MODE -eq 64 ]; then
315 echo 'Your $OBJECT_MODE was found to be set to 64' 322 echo 'Your $OBJECT_MODE was found to be set to 64'
316 @@ -913,7 +931,7 @@ 323 @@ -913,7 +936,7 @@
317 #fi 324 #fi
318 325
319 if [ -z "$OUT" ]; then 326 if [ -z "$OUT" ]; then
320 - OUT="$CC" 327 - OUT="$CC"
321 + OUT="$SUFFIX" 328 + OUT="$SUFFIX"
322 fi 329 fi
323 330
324 if [ ".$PERL" = . ] ; then 331 if [ ".$PERL" = . ] ; then
325 @@ -945,9 +963,9 @@ 332 @@ -945,9 +968,9 @@
326 # compiler for the platform ... in which case we add it on 333 # compiler for the platform ... in which case we add it on
327 # the end ... otherwise we leave it off 334 # the end ... otherwise we leave it off
328 335
329 -$PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null 336 -$PERL ./Configure LIST | grep "$OUT-$CC" > /dev/null
330 +$PERL ./Configure LIST | grep "$OUT-$SUFFIX" > /dev/null 337 +$PERL ./Configure LIST | grep "$OUT-$SUFFIX" > /dev/null
332 - OUT="$OUT-$CC" 339 - OUT="$OUT-$CC"
333 + OUT="$OUT-$SUFFIX" 340 + OUT="$OUT-$SUFFIX"
334 fi 341 fi
335 342
336 OUT="$PREFIX$OUT" 343 OUT="$PREFIX$OUT"
337 @@ -957,9 +975,9 @@ 344 @@ -957,9 +980,9 @@
338 echo Configuring for $OUT 345 echo Configuring for $OUT
339 346
340 if [ "$TEST" = "true" ]; then 347 if [ "$TEST" = "true" ]; then
341 - echo $PERL ./Configure $OUT $options 348 - echo $PERL ./Configure $OUT $options
342 + echo $PERL ./Configure $OUT --with-cc=$CC $options 349 + echo $PERL ./Configure $OUT --with-cc=$CC $options

mercurial