develooper Front page | perl.perl5.changes | Postings from April 2008

Change 33736: Integrate:

From:
Nicholas Clark
Date:
April 23, 2008 15:15
Subject:
Change 33736: Integrate:
Change 33736 by nicholas@mouse-mill on 2008/04/23 22:01:52

	Integrate:
	[ 33730]
	Integrate:
	[ 33318]
	Shell patterns are subject to tilde expansion. So the case statement
	in the filexp script (written out by Configure) for expanding ~ and
	~/*  has never worked. It's always been relying on the /bin/csh glob
	for the ~* case. Few people ever noticed because one has to be
	building to one's home directory on a system with no csh installed.
	This is a bug from Perl 1.0's Configure!
	
	[ 33591]
	Make the nv_preserves... checking on VMS more robust (and more like
	what Configure does).  Problem using long int without long double
	reported by Jeremy Begg.
	
	[ 33735]
	Integrate:
	[ 33551]
	Give the test file for __builtin_expect() the correct name (try.c, not
	builtin.c). Correct the user visible text, which was clearly a cut &
	paste from __builtin_choose_expr. For both, also run the program as
	part of the checks. Add a return value to the test program, and make
	it return something useful (that the if statement worked).

Affected files ...

... //depot/maint-5.8/perl/Configure#95 integrate
... //depot/maint-5.8/perl/configure.com#63 integrate

Differences ...

==== //depot/maint-5.8/perl/Configure#95 (xtext) ====
Index: perl/Configure
--- perl/Configure#94~32528~	2007-11-28 04:54:17.000000000 -0800
+++ perl/Configure	2008-04-23 15:01:52.000000000 -0700
@@ -3590,7 +3590,7 @@
 $startsh
 : expand filename
 case "\$1" in
- ~/*|~)
+ \~/*|\~)
 	echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
 	;;
  ~*)
@@ -10440,7 +10440,7 @@
 
 EOCP
     set try
-    if eval $compile; then
+    if eval $compile && $run ./try; then
 	echo "Your C compiler supports __builtin_choose_expr."
 	val="$define"
     else
@@ -10460,18 +10460,20 @@
 '')
     echo " "
     echo "Checking whether your compiler can handle __builtin_expect ..." >&4
-    $cat >builtin.c <<'EOCP'
+    $cat >try.c <<'EOCP'
 int main(void) {
     int n = 50;
     if ( __builtin_expect(n, 0) ) n = 1;
+    /* Remember shell exit code truth is 0, C truth is non-zero */
+    return !(n == 1);
 }
 EOCP
     set try
-    if eval $compile; then
-	echo "Your C compiler supports __builtin_choose_expr."
+    if eval $compile && $run ./try; then
+	echo "Your C compiler supports __builtin_expect."
 	val="$define"
     else
-	echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
+	echo "Your C compiler doesn't seem to understand __builtin_expect."
 	val="$undef"
     fi
     ;;

==== //depot/maint-5.8/perl/configure.com#63 (text) ====
Index: perl/configure.com
--- perl/configure.com#62~33479~	2008-03-11 11:08:11.000000000 -0700
+++ perl/configure.com	2008-04-23 15:01:52.000000000 -0700
@@ -5476,53 +5476,35 @@
 $ echo "(UV will be ""''uvtype'"", ''uvsize' bytes)"
 $ echo "(NV will be ""''nvtype'"", ''nvsize' bytes)"
 $!
-$ echo4 "Checking whether your NVs can preserve your UVs..."
+$ d_nv_preserves_uv = "undef"
+$ echo4 "Checking how many bits of your UVs your NVs can preserve..."
 $ OS
 $ WS "#if defined(__DECC) || defined(__DECCXX)"
 $ WS "#include <stdlib.h>"
 $ WS "#endif"
 $ WS "#include <stdio.h>"
 $ WS "int main() {"
-$ WS "    ''uvtype' k = (''uvtype')~0, l;"
-$ WS "    ''nvtype' d;"
-$ WS "    l = k;"
-$ WS "    d = (''nvtype')l;"
-$ WS "    l = (''uvtype')d;"
-$ WS "    if (l == k)"
-$ WS "       printf(""preserve\n"");"
+$ WS "    ''uvtype' u = 0;"
+$ WS "    int     n = 8 * ''uvsize';"
+$ WS "    int     i;"
+$ WS "    for (i = 0; i < n; i++) {"
+$ WS "      u = u << 1 | (''uvtype')1;"
+$ WS "      if ((''uvtype')(''nvtype')u != u)"
+$ WS "        break;"
+$ WS "    }"
+$ WS "    printf(""%d\n"", i);"
 $ WS "    exit(0);"
 $ WS "}"
 $ CS
 $ GOSUB compile
-$ IF tmp .EQS. "preserve"
-$ THEN 
+$ nv_preserves_uv_bits = tmp
+$ IF F$INTEGER(nv_preserves_uv_bits) .GE. (F$INTEGER(uvsize) * 8)
+$ THEN
 $   d_nv_preserves_uv = "define"
-$   echo "Yes, they can." 
-$   nv_preserves_uv_bits = F$STRING(F$INTEGER(uvsize) * 8)
+$   echo "Your NVs can preserve all ''nv_preserves_uv_bits' bits of your UVs."
 $ ELSE
-$   d_nv_preserves_uv = "undef"
-$   echo "No, they can't."
-$   echo4 "Checking how many bits of your UVs your NVs can preserve..."
-$   OS
-$   WS "#if defined(__DECC) || defined(__DECCXX)"
-$   WS "#include <stdlib.h>"
-$   WS "#endif"
-$   WS "#include <stdio.h>"
-$   WS "int main() {"
-$   WS "    ''uvtype' u = 0;"
-$   WS "    int     n = 8 * ''uvsize';"
-$   WS "    int     i;"
-$   WS "    for (i = 0; i < n; i++) {"
-$   WS "      u = u << 1 | (''uvtype')1;"
-$   WS "      if ((''uvtype')(''nvtype')u != u)"
-$   WS "        break;"
-$   WS "    }"
-$   WS "    printf(""%d\n"", i);"
-$   WS "    exit(0);"
-$   WS "}"
-$   CS
-$   GOSUB compile
-$   nv_preserves_uv_bits = tmp
+$   d_nv_preserves_uv = "undef""
+$   echo "Your NVs can preserve only ''nv_preserves_uv_bits' bits of your UVs."	
 $ ENDIF
 $!
 $! Check for signbit (must already know nvtype)
End of Patch.



Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About