develooper Front page | perl.perl5.build | Postings from November 2003

Re: Call back units

Thread Previous
From:
H.Merijn Brand
Date:
November 12, 2003 07:56
Subject:
Re: Call back units
Message ID:
20031112165400.474D.H.M.BRAND@hccnet.nl
On Tue 04 Nov 2003 15:50, H.Merijn Brand <h.m.brand@hccnet.nl> wrote:
> If there are no comments, I will probably commit this wednesday or thursday.
> I'm fairly confident about it.
> 
> On Sat 01 Nov 2003 15:11, "H.Merijn Brand" <h.m.brand@hccnet.nl> wrote:
> > As announced in my plans somewhere back in september 2002, I finally found
> > time to check and change.
> > 
> > The plan was to make the call-back's safe and call them allways, even if the
> > option for which the call-back was cretead is unset.
> > 
> > To do so, two criteria should be met:
> > 
> > 1. All currently created call-back should have code to check that they will
> >    only do what they are supposed to do when the option *is* set.
> > 2. Configure should allways call them, but still be safe in how to deal with
> >    what it currently does.
> > 
> > Both are pure for backward compatibility, and shouldn't alter the current
> > behaviour, but open up for expansions in the call-back units to do things in
> > case the option is *not* set.
> > 
> > I was amazed to find that point 1 is already met. This means that the setting
> > of the variable currently is done twice, once in Configure, and when it's set
> > end the cbu is called, it's checked again. I expected to have a lot of work in
> > this area, but I have no work here at all :)
> > 
> > Below are the proposed patches.
> > 
> > a. The patch to hints/README.hints, explaining that the cbu's should take care
> >    of item 1.
> > b. The complete patch to Configure, This will have to be broken up to the
> >    metaunits

Change 21709 by merijn@merijn-l1 on 2003/11/12 14:35:54

        Callback units are called always from now on, disregarding the
        state of the option it is created for. This will enable us to
        create call-backs in the hints that can act upon a state variable
        *not* being set.

Affected files ...

... //depot/metaconfig/U/perl/uselfs.U#18 edit
... //depot/metaconfig/U/perl/uselongdbl.U#12 edit
... //depot/metaconfig/U/threads/usethreads.U#16 edit

Differences ...

==== //depot/metaconfig/U/perl/uselfs.U#18 (text) ====

94,95d93
< case "$uselargefiles" in
< "$define")
98a97,102
> if $test -f uselargefiles.cbu; then
>       echo "Your platform has some specific hints regarding large file builds, using them..."
>       . ./uselargefiles.cbu
> fi
> case "$uselargefiles" in
> "$define")
100,101d103
<               echo "Your platform has some specific hints for large file builds, using them..."
<               . ./uselargefiles.cbu

==== //depot/metaconfig/U/perl/uselongdbl.U#12 (text) ====

57,58d56
< case "$uselongdouble" in
< $define)
62,65c60,65
<       if $test -f uselongdouble.cbu; then
<               echo "Your platform has some specific hints for long doubles, using them..."
<               . ./uselongdouble.cbu
<       else
---
> if $test -f uselongdouble.cbu; then
>     echo "Your platform has some specific hints regarding long doubles, using them..."
>     . ./uselongdouble.cbu
> else
>     case "$uselongdouble" in
>       $define)
67c67
< (Your platform doesn't have any specific hints for long doubles.)
---
> (Your platform does not have any specific hints for long doubles.)
69d68
<       fi
71c70,71
< esac
---
>     esac
> fi

==== //depot/metaconfig/U/threads/usethreads.U#16 (text) ====

199,200d198
< case "$usethreads" in
< "$define"|true|[yY]*)
204,207c202,207
<       if $test -f usethreads.cbu; then
<               echo "Your platform has some specific hints for threaded builds, using them..."
<               . ./usethreads.cbu
<       else
---
> if $test -f usethreads.cbu; then
>     echo "Your platform has some specific hints regarding threaded builds, using them..."
>     . ./usethreads.cbu
> else
>     case "$usethreads" in
>       "$define"|true|[yY]*)
209c209
< (Your platform doesn't have any specific hints for threaded builds.
---
> (Your platform does not have any specific hints for threaded builds.
212d211
<       fi
214c213,214
< esac
---
>     esac
> fi

> > c. A small patch to solaris_2.sh, which I think simplifies reading
> > 
> > Remarks most welcome. (Currently unably to *read* mail, because I'm awaiting
> > ADSL, which is to arrive any day now). Monday I read my mail at work
> > 
> > --- hints/README.hints	2002-09-10 18:58:01.000000000 +0200
> > +++ hints/README.hints	2003-11-01 15:57:57.000000000 +0100
> > @@ -303,6 +303,13 @@
> >  hints/solaris_2.sh of checking to see if uselongdouble is defined is a good
> >  idea.
> >  
> > +=item Call status
> > +
> > +Call-backs are only called always, even if the value for the call-back is
> > +uset: UU/usethreads.cbu is called when Configure is about to deal with
> > +threads. All created call-backs from hints should thus check the status
> > +of the variable, and act upon it.
> > +
> >  =item Future status
> >  
> >  I hope this "call-back" scheme is simple enough to use but powerful
> > --- Configure	2003-09-18 08:13:46.000000000 +0200
> > +++ Configure	2003-11-01 15:39:42.000000000 +0100
> > @@ -3673,22 +3673,22 @@
> >  eval $setvar
> >  
> >  
> > -case "$usethreads" in
> > -"$define"|true|[yY]*)
> >  : Look for a hint-file generated 'call-back-unit'.  If the
> >  : user has specified that a threading perl is to be built,
> >  : we may need to set or change some other defaults.
> >  	if $test -f usethreads.cbu; then
> > -		echo "Your platform has some specific hints for threaded builds, using them..."
> > +    echo "Your platform has some specific hints regarding threaded builds, using them..."
> >  		. ./usethreads.cbu
> >  	else
> > +    case "$usethreads" in
> > +	"$define"|true|[yY]*)
> >  		$cat <<EOM
> > -(Your platform doesn't have any specific hints for threaded builds.
> > +    (Your platform does not have any specific hints for threaded builds.
> >   Assuming POSIX threads, then.)
> >  EOM
> > -	fi
> >  	;;
> >  esac
> > +    fi
> >  
> >  cat <<EOM
> >  
> > @@ -4546,21 +4546,21 @@
> >  true|[yY]*) uselongdouble="$define" ;;
> >  esac
> >  
> > -case "$uselongdouble" in
> > -$define)
> >  : Look for a hint-file generated 'call-back-unit'.  If the
> >  : user has specified that long doubles should be used,
> >  : we may need to set or change some other defaults.
> >  	if $test -f uselongdouble.cbu; then
> > -		echo "Your platform has some specific hints for long doubles, using them..."
> > +    echo "Your platform has some specific hints regarding long doubles, using them..."
> >  		. ./uselongdouble.cbu
> >  	else
> > +    case "$uselongdouble" in
> > +	$define)
> >  		$cat <<EOM
> > -(Your platform doesn't have any specific hints for long doubles.)
> > +    (Your platform does not have any specific hints for long doubles.)
> >  EOM
> > -	fi
> >  	;;
> >  esac
> > +    fi
> >  
> >  : Looking for optional libraries
> >  echo " "
> > @@ -5447,8 +5447,6 @@
> >  	;;
> >  esac
> >  
> > -case "$use64bitint" in
> > -"$define"|true|[yY]*)
> >  : Look for a hint-file generated 'call-back-unit'.  If the
> >  : user has specified that a 64-bit perl is to be built,
> >  : we may need to set or change some other defaults.
> > @@ -5456,6 +5454,8 @@
> >  		echo "Your platform has some specific hints for 64-bit integers, using them..."
> >  		. ./use64bitint.cbu
> >  	fi
> > +case "$use64bitint" in
> > +    "$define"|true|[yY]*)
> >  	case "$longsize" in
> >  	4) case "$archname64" in
> >  	   '') archname64=64int ;;
> > @@ -5465,15 +5465,15 @@
> >  	;;
> >  esac
> >  
> > -case "$use64bitall" in
> > -"$define"|true|[yY]*)
> >  : Look for a hint-file generated 'call-back-unit'.  If the
> >  : user has specified that a maximally 64-bit perl is to be built,
> >  : we may need to set or change some other defaults.
> >  	if $test -f use64bitall.cbu; then
> > -		echo "Your platform has some specific hints for 64-bit builds, using them..."
> > +    echo "Your platform has some specific hints regarding 64-bit builds, using them..."
> >  		. ./use64bitall.cbu
> >  	fi
> > +case "$use64bitall" in
> > +    "$define"|true|[yY]*)
> >  	case "$longsize" in
> >  	4) case "$archname64" in
> >  	   ''|64int) archname64=64all ;;
> > @@ -8852,14 +8852,16 @@
> >  esac
> >  set uselargefiles
> >  eval $setvar
> > -case "$uselargefiles" in
> > -"$define")
> >  : Look for a hint-file generated 'call-back-unit'.  If the
> >  : user has specified that a large files perl is to be built,
> >  : we may need to set or change some other defaults.
> >  	if $test -f uselargefiles.cbu; then
> > -		echo "Your platform has some specific hints for large file builds, using them..."
> > +    echo "Your platform has some specific hints regarding large file builds, using them..."
> >  		. ./uselargefiles.cbu
> > +    fi
> > +case "$uselargefiles" in
> > +    "$define")
> > +	if $test -f uselargefiles.cbu; then
> >  		echo " "
> >  		echo "Rechecking to see how big your file offsets are..." >&4
> >  		$cat >try.c <<EOCP
> > --- hints/solaris_2.sh	2003-10-27 18:28:33.000000000 +0100
> > +++ hints/solaris_2.sh	2003-11-01 15:21:43.000000000 +0100
> > @@ -448,15 +448,12 @@
> >  		exit 1
> >  		;;
> >  	    esac
> > -	    ;;
> > -esac
> > +
> >  # gcc-2.8.1 on Solaris 8 with -Duse64bitint fails op/pat.t test 822
> >  # if we compile regexec.c with -O.  Turn off optimization for that one
> >  # file.  See hints/README.hints , especially 
> >  # =head2 Propagating variables to config.sh, method 3.
> >  #  A. Dougherty  May 24, 2002
> > -case "$use64bitint" in
> > -"$define")
> >      case "${gccversion}-${optimize}" in
> >      2.8*-O*)
> >  	# Honor a command-line override (rather unlikely)
> > End-of-patch
> > 
> > -- 
> > H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
> > using perl-5.6.1, 5.8.0 & 633 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
> >   WinNT 4, Win2K pro & WinCE 2.11.  Smoking perl CORE: smokers@perl.org
> > http://archives.develooper.com/daily-build@perl.org/   perl-qa@perl.org
> > send smoke reports to: smokers-reports@perl.org, QA: http://qa.perl.org
> 
> -- 
> H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
> using perl-5.6.1, 5.8.0, & 5.9.x, and 806 on  HP-UX 10.20 & 11.00, 11i,
>    AIX 4.3, SuSE 8.2, and Win2k.           http://www.cmve.net/~merijn/
> http://archives.develooper.com/daily-build@perl.org/   perl-qa@perl.org
> send smoke reports to: smokers-reports@perl.org, QA: http://qa.perl.org

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.0, & 5.9.x, and 806 on  HP-UX 10.20 & 11.00, 11i,
   AIX 4.3, SuSE 8.2, and Win2k.           http://www.cmve.net/~merijn/
http://archives.develooper.com/daily-build@perl.org/   perl-qa@perl.org
send smoke reports to: smokers-reports@perl.org, QA: http://qa.perl.org


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About