From:	SMTP%"ram@acri.fr" 17-FEB-1995 16:38:26.91
To:	USRC
CC:	
Subj:	v47i058: dist-3.0 - Configure script generator and related tools, Patch49

Resent-Date: 16 Feb 1995 14:05:50 -0600
Path: decwrl!amd!amdahl.com!pacbell.com!att-out!rutgers!news.iag.net!news.mathworks.com!uunet!sparky!not-for-mail
From: ram@acri.fr (Raphael Manfredi)
Newsgroups: comp.sources.misc
Subject: v47i058: dist-3.0 - Configure script generator and related tools, Patch49
Followup-To: comp.sources.d
Date: 16 Feb 1995 14:05:50 -0600
Organization: Advanced Computer Research Institute, Lyon, France
Lines: 1542
Sender: kent@sparky.sterling.com
Approved: kent@sparky.sterling.com
Message-Id: <3i0b6u$h5k@sparky.sterling.com>
Nntp-Posting-Host: sparky.sterling.com
X-Md4-Signature: 67af02aff1b307d09d5babae54ce4924
To: unix-sources@pa.dec.com
Resent-Message-Id: <"7fhD22.0.426.f5HHl"@ftp-gw-1.pa.dec.com>
Resent-From: unix-sources@pa.dec.com
X-Mailing-List: <unix-sources@pa.dec.com> archive/latest/484
X-Loop: unix-sources@pa.dec.com
Precedence: list
Resent-Sender: unix-sources-request@pa.dec.com

Submitted-by: ram@acri.fr (Raphael Manfredi)
Posting-number: Volume 47, Issue 58
Archive-name: dist-3.0/patch49
Environment: UNIX, Perl, RCS
Patch-To: dist-3.0: Volume 39, Issue 5-32

[The latest patch for dist version 3.0 is #51.]

System: dist version 3.0
Patch #: 49
Priority: LOW
Subject: dist now works with perl 5.0
Subject: avoid an empty rmlist: systems might choke on it (WED)
Subject: typo fixes in leading config.h comment (WED)
Subject: unit Options.U now exports file optdef.sh, not a variable
Subject: update code for myuname changed (WED)
Subject: this unit now exports file optdef.sh, not a variable
Subject: archname is now systematically recomputed
Subject: can now handle installation prefix changes (from WED)
Subject: test C program now includes <stdio.h> (WED)
Subject: now looks for POSIX regcomp() routine
Subject: new installmanfmt and AFS-lookup for formatted man pages
Subject: ensure dflt gets initialized in case no pagers are found (WED)
Subject: new prefixexp variable holding a fully expanded prefix
Subject: save off previous prefix value in oldprefix if changed (WED)
Subject: added the INSTALLPREFIX define for C programs to use (WED)
Subject: now only prints a single empty line when outputting something
Subject: documented new special units Prefixit.U and Prefixup.U
Subject: removed old "do name()" routine call constructs
Subject: forgot to localize the spaces variable
Subject: random clean-up in &record_obsolete
Subject: three new files
Date: Mon Jan 30 16:02:56 MET 1995
From: Raphael Manfredi <ram@acri.fr>

Description:
	The dist-3.0 package now works with perl 5.0. I have made perl 5.0
	the default perl on my machine and ran the whole set of pat* tools,
	jmake and metaconfig without any trouble so far. However, you need
	a patched-up version of perl 5.0 PL0, as explained in README.

	This set of patches is mainly an integration of Wayne Davison's
	changes for trn. His changes are flagged as WED.

	Begin.U:
	  Avoid an empty rmlist: systems might choke on it (WED).

	Config_h.U:
	  Typo fixes in leading config.h comment (WED).

	Oldconfig.U:
	  Update code for myuname changed (WED).

	Configure can now handle installation prefix changes. I have
	slightly adapted the changes proposed by Wayne, introducing two
	new special units (Prefixit.U and Prefixup.U) to factorize code.

	d_attribut.U:
	  Test C program now includes <stdio.h> (WED)

	page.U:
	  Ensure dflt gets initialized in case no pagers are found (WED)

	prefix.U:
	  Save off previous prefix value in oldprefix if changed (WED)
	  Added the INSTALLPREFIX define for C programs to use (WED)

	Archname is now systematically recomputed. This avoids problem when
	the user changes his mind about the OS name.

	Now looks for POSIX regcomp() routine, and for <regex.h>, thanks
	to Sidney C. Smith <scsmith@cbda9.apgea.army.mil>.

	New installmanfmt and AFS-lookup for formatted man pages, derived
	from what is done for troffed man pages.

	New prefixexp variable holding a fully expanded prefix, in case
	they use ~name expansion in their prefix.

	Documented new special units Prefixit.U and Prefixup.U.

	Clean-up and workarounds for perl 5.0 PL0 port:
	  Removed old "do name()" routine call constructs.
	  Forgot to localize the spaces variable.
	  Random clean-up in &record_obsolete.

	Three new files.

Repeat-By: 

Fix:	From rn, say "| patch -p -N -d DIR", where DIR is your dist source
	directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
	If you don't have the patch program, apply the following by hand,
	or get patch (version 2.0, latest patchlevel).

	After patching:
		*** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #50 FIRST ***

	If patch indicates that patchlevel is the wrong version, you may need
	to apply one or more previous patches, or the patch may already
	have been applied.  See the patchlevel.h file to find out what has or
	has not been applied.  In any event, don't continue with the patch.

	If you are missing previous patches they can be obtained from me:

		Raphael Manfredi <ram@acri.fr>

	If you send a mail message of the following form it will greatly speed
	processing:

		Subject: Command
		@SH mailpatch PATH dist 3.0 LIST
			   ^ note the c

	where PATH is a return path FROM ME TO YOU either in Internet notation,
	or in bang notation from some well-known host, and LIST is the number
	of one or more patches you need, separated by spaces, commas, and/or
	hyphens.  Saying 35- says everything from 35 to the end.

	To get some more detailed instructions, send me the following mail:

		Subject: Command
		@SH mailhelp PATH


Index: patchlevel.h
Prereq: 48
4c4
< #define PATCHLEVEL 48
---
> #define PATCHLEVEL 49

Index: mcon/pl/eval.pl
Prereq: 3.0
*** mcon/pl/eval.pl.old	Mon Jan 30 15:50:20 1995
--- mcon/pl/eval.pl	Mon Jan 30 15:50:21 1995
***************
*** 1,4 ****
! ;# $Id: eval.pl,v 3.0 1993/08/18 12:10:22 ram Exp $
  ;#
  ;#  Copyright (c) 1991-1993, Raphael Manfredi
  ;#  
--- 1,4 ----
! ;# $Id: eval.pl,v 3.0.1.1 1995/01/30 14:48:37 ram Exp $
  ;#
  ;#  Copyright (c) 1991-1993, Raphael Manfredi
  ;#  
***************
*** 9,14 ****
--- 9,17 ----
  ;#  of the source tree for dist 3.0.
  ;#
  ;# $Log: eval.pl,v $
+ ;# Revision 3.0.1.1  1995/01/30  14:48:37  ram
+ ;# patch49: removed old "do name()" routine call constructs
+ ;#
  ;# Revision 3.0  1993/08/18  12:10:22  ram
  ;# Baseline for dist 3.0 netwide release.
  ;#
***************
*** 49,56 ****
  
  # If some states are still in the stack, warn the user
  sub main'check_state {
! 	do error("one statement pending") if $#state == 1;
! 	do error("$#state statements pending") if $#state > 1;
  }
  
  # Add a value on the stack, modified by all the monadic operators.
--- 52,59 ----
  
  # If some states are still in the stack, warn the user
  sub main'check_state {
! 	&error("one statement pending") if $#state == 1;
! 	&error("$#state statements pending") if $#state > 1;
  }
  
  # Add a value on the stack, modified by all the monadic operators.
***************
*** 84,94 ****
  sub update_stack {
  	local($op) = shift(@_);		# Operator
  	if (!$Priority{$op}) {
! 		do error("illegal operator $op");
  		return;
  	} else {
  		if ($#val < 0) {
! 			do error("missing first operand for '$op' (diadic operator)");
  			return;
  		}
  		# Because of the special behaviour of do-SUBR with the while modifier,
--- 87,97 ----
  sub update_stack {
  	local($op) = shift(@_);		# Operator
  	if (!$Priority{$op}) {
! 		&error("illegal operator $op");
  		return;
  	} else {
  		if ($#val < 0) {
! 			&error("missing first operand for '$op' (diadic operator)");
  			return;
  		}
  		# Because of the special behaviour of do-SUBR with the while modifier,
***************
*** 98,104 ****
  			$Priority{$op[$#op]} > $Priority{$op}	# Higher priority op
  			&& $#val > 0							# At least 2 values
  		) {
! 			do execute();	# Execute an higher priority stacked operation
  		}
  		push(@op, $op);		# Everything at higher priority has been executed
  	}
--- 101,107 ----
  			$Priority{$op[$#op]} > $Priority{$op}	# Higher priority op
  			&& $#val > 0							# At least 2 values
  		) {
! 			&execute;		# Execute an higher priority stacked operation
  		}
  		push(@op, $op);		# Everything at higher priority has been executed
  	}
***************
*** 117,160 ****
  		s/^\s+//;				# Remove spaces between words
  		# The '(' construct
  		if (s/^\(//) {
! 			do push_val(do eval_expr(*_));
  			# A final '\' indicates an end of line
! 			do error("missing final parenthesis") if !s/^\\//;
  		}
  		# Found a ')' or end of line
  		elsif (/^\)/ || /^$/) {
  			s/^\)/\\/;						# Signals: left parenthesis found
  			$expr = $_;						# Remove interpreted stuff
! 			do execute() while $#val > 0;	# Executed stacked operations
  			while ($#op >= 0) {
  				$_ = pop(@op);
! 				do error("missing second operand for '$_' (diadic operator)");
  			}
  			return $val[0];
  		}
  		# A perl statement '{{'
  		elsif (s/^\{\{//) {
  			if (s/^(.*)\}\}//) {
! 				do push_val((system
  					('perl','-e', "if ($1) {exit 0;} else {exit 1;}"
  					))? 0 : 1);
  			} else {
! 				do error("incomplete perl statement");
  			}
  		}
  		# A shell statement '{'
  		elsif (s/^\{//) {
  			if (s/^(.*)\}//) {
! 				do push_val((system
  					("if $1 >/dev/null 2>&1; then exit 0; else exit 1; fi"
  					))? 0 : 1);
  			} else {
! 				do error("incomplete shell statement");
  			}
  		}
  		# Operator '||' and '&&'
  		elsif (s/^(\|\||&&)//) {
! 			do update_stack($1);
  		}
  		# Unary operator '!'
  		elsif (s/^!//) {
--- 120,164 ----
  		s/^\s+//;				# Remove spaces between words
  		# The '(' construct
  		if (s/^\(//) {
! 			&push_val(&eval_expr(*_));
  			# A final '\' indicates an end of line
! 			&error("missing final parenthesis") if !s/^\\//;
  		}
  		# Found a ')' or end of line
  		elsif (/^\)/ || /^$/) {
  			s/^\)/\\/;						# Signals: left parenthesis found
  			$expr = $_;						# Remove interpreted stuff
! 			&execute() while $#val > 0;		# Executed stacked operations
  			while ($#op >= 0) {
  				$_ = pop(@op);
! 				&error("missing second operand for '$_' (diadic operator)");
  			}
  			return $val[0];
  		}
  		# A perl statement '{{'
  		elsif (s/^\{\{//) {
  			if (s/^(.*)\}\}//) {
! 				&push_val((system
  					('perl','-e', "if ($1) {exit 0;} else {exit 1;}"
  					))? 0 : 1);
  			} else {
! 				&error("incomplete perl statement");
  			}
  		}
  		# A shell statement '{'
  		elsif (s/^\{//) {
  			if (s/^(.*)\}//) {
! 				&push_val((system
  					("if $1 >/dev/null 2>&1; then exit 0; else exit 1; fi"
  					))? 0 : 1);
  			} else {
! 				&error("incomplete shell statement");
  			}
  		}
  		# Operator '||' and '&&'
  		elsif (s/^(\|\||&&)//) {
! 			$tmp = $1;			# Save for perl5 (Dataloaded update_stack)
! 			&update_stack($tmp);
  		}
  		# Unary operator '!'
  		elsif (s/^!//) {
***************
*** 165,179 ****
  			$tmp = $1;
  			# Test for wanted
  			if ($tmp =~ s/^\?//) {
! 				do push_val(($main'symwanted{$tmp})? 1 : 0);
  			}
  			# Test for conditionally wanted
  			elsif ($tmp =~ s/^%//) {
! 				do push_val(($main'condwanted{$tmp})? 1 : 0);
  			}
  			# Default: test for definition (see op @define)
  			else {
! 				do push_val((
  					$main'symwanted{$tmp} ||
  					$main'cmaster{$tmp} ||
  					$main'userdef{$tmp}) ? 1 : 0);
--- 169,183 ----
  			$tmp = $1;
  			# Test for wanted
  			if ($tmp =~ s/^\?//) {
! 				&push_val(($main'symwanted{$tmp})? 1 : 0);
  			}
  			# Test for conditionally wanted
  			elsif ($tmp =~ s/^%//) {
! 				&push_val(($main'condwanted{$tmp})? 1 : 0);
  			}
  			# Default: test for definition (see op @define)
  			else {
! 				&push_val((
  					$main'symwanted{$tmp} ||
  					$main'cmaster{$tmp} ||
  					$main'userdef{$tmp}) ? 1 : 0);
***************
*** 198,214 ****
  		$expr .= $_;
  		$_ = <UNIT>;		# Fetch next line
  		unless ($_) {
! 			do error("EOF in expression");
  			last;
  		}
  		chop;
  	}
  	$expr .= $_;
  	while ($expr ne '') {
! 		$val = do eval_expr(*expr);		# Expression will be modified
  		# We return from eval_expr either when a closing parenthisis
  		# is found, or when the expression has been fully analysed.
! 		do error("extra closing parenthesis ignored") if $expr ne '';
  	} 
  	$val;
  }
--- 202,218 ----
  		$expr .= $_;
  		$_ = <UNIT>;		# Fetch next line
  		unless ($_) {
! 			&error("EOF in expression");
  			last;
  		}
  		chop;
  	}
  	$expr .= $_;
  	while ($expr ne '') {
! 		$val = &eval_expr(*expr);		# Expression will be modified
  		# We return from eval_expr either when a closing parenthisis
  		# is found, or when the expression has been fully analysed.
! 		&error("extra closing parenthesis ignored") if $expr ne '';
  	} 
  	$val;
  }
***************
*** 232,238 ****
  		# The 'if' command
  		elsif ($cmd eq 'if') {
  			# We always evaluate, in order to find possible errors
! 			$value = do evaluate($_);
  			if (!$Keep[$status]) {
  				# We have to skip until next 'end'
  				push(@state, $SKIP);		# Record structure
--- 236,242 ----
  		# The 'if' command
  		elsif ($cmd eq 'if') {
  			# We always evaluate, in order to find possible errors
! 			$value = &evaluate($_);
  			if (!$Keep[$status]) {
  				# We have to skip until next 'end'
  				push(@state, $SKIP);		# Record structure
***************
*** 248,259 ****
  		}
  		# The 'else' command
  		elsif ($cmd eq 'else') {
! 			do error("expression after 'else' ignored")
! 				if (/\S/);
  			$state[$#state] = $SKIP if $state[$#state] == $IF;
  			return 0 if $state[$#state] == $SKIP;
  			if ($state[$#state] == $OUT) {
! 				do error("unexpected 'else'");
  				return 0;
  			}
  			$state[$#state] = $ELSE;
--- 252,262 ----
  		}
  		# The 'else' command
  		elsif ($cmd eq 'else') {
! 			&error("expression after 'else' ignored") if /\S/;
  			$state[$#state] = $SKIP if $state[$#state] == $IF;
  			return 0 if $state[$#state] == $SKIP;
  			if ($state[$#state] == $OUT) {
! 				&error("unexpected 'else'");
  				return 0;
  			}
  			$state[$#state] = $ELSE;
***************
*** 262,272 ****
  		# The 'elsif' command
  		elsif ($cmd eq 'elsif') {
  			# We always evaluate, in order to find possible errors
! 			$value = do evaluate($_);
  			$state[$#state] = $SKIP if $state[$#state] == $IF;
  			return 0 if $state[$#state] == $SKIP;
  			if ($state[$#state] == $OUT) {
! 				do error("unexpected 'elsif'");
  				return 0;
  			}
  			if ($value) {			# True
--- 265,275 ----
  		# The 'elsif' command
  		elsif ($cmd eq 'elsif') {
  			# We always evaluate, in order to find possible errors
! 			$value = &evaluate($_);
  			$state[$#state] = $SKIP if $state[$#state] == $IF;
  			return 0 if $state[$#state] == $SKIP;
  			if ($state[$#state] == $OUT) {
! 				&error("unexpected 'elsif'");
  				return 0;
  			}
  			if ($value) {			# True
***************
*** 279,293 ****
  		}
  		# The 'end' command
  		elsif ($cmd eq 'end') {
! 			do error("expression after 'end' ignored")
! 				if (/\S/);
  			pop(@state);
! 			do error("unexpected 'end'") if $#state < 0;
  			return 0;
  		}
  		# Unknown command
  		else {
! 			do error("unknown command '$cmd'");
  			return 0;
  		}
  	}
--- 282,295 ----
  		}
  		# The 'end' command
  		elsif ($cmd eq 'end') {
! 			&error("expression after 'end' ignored") if /\S/;
  			pop(@state);
! 			&error("unexpected 'end'") if $#state < 0;
  			return 0;
  		}
  		# Unknown command
  		else {
! 			&error("unknown command '$cmd'");
  			return 0;
  		}
  	}

Index: mcon/U/manfmt.U
Prereq: 3.0.1.2
*** mcon/U/manfmt.U.old	Mon Jan 30 15:50:13 1995
--- mcon/U/manfmt.U	Mon Jan 30 15:50:14 1995
***************
*** 1,4 ****
! ?RCS: $Id: manfmt.U,v 3.0.1.2 1994/08/29 16:30:31 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
--- 1,4 ----
! ?RCS: $Id: manfmt.U,v 3.0.1.3 1995/01/30 14:39:20 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
***************
*** 9,14 ****
--- 9,18 ----
  ?RCS: of the source tree for dist 3.0.
  ?RCS:
  ?RCS: $Log: manfmt.U,v $
+ ?RCS: Revision 3.0.1.3  1995/01/30  14:39:20  ram
+ ?RCS: patch49: new installmanfmt and AFS-lookup for formatted man pages
+ ?RCS: patch49: can now handle installation prefix changes (from WED)
+ ?RCS:
  ?RCS: Revision 3.0.1.2  1994/08/29  16:30:31  ram
  ?RCS: patch32: now uses installation prefix for default setting
  ?RCS:
***************
*** 18,24 ****
  ?RCS: Revision 3.0  1993/08/18  12:09:13  ram
  ?RCS: Baseline for dist 3.0 netwide release.
  ?RCS:
! ?MAKE:manfmt manfmtexp: Getfile Loc Oldconfig cat manext package prefix
  ?MAKE:	-pick add $@ %<
  ?S:manfmt:
  ?S:	This variable contains the name of the directory in which formatted
--- 22,29 ----
  ?RCS: Revision 3.0  1993/08/18  12:09:13  ram
  ?RCS: Baseline for dist 3.0 netwide release.
  ?RCS:
! ?MAKE:manfmt manfmtexp installmanfmt: Getfile Loc Oldconfig cat manext \
! 	spackage Prefixit prefixexp Prefixup afs
  ?MAKE:	-pick add $@ %<
  ?S:manfmt:
  ?S:	This variable contains the name of the directory in which formatted
***************
*** 31,54 ****
  ?S:	at configuration time, for programs not willing to deal with it at
  ?S:	run-time.
  ?S:.
  ?LINT:change manext
  ?T:lookpath
  : determine where manual pages go
  $cat <<EOM
    
! $package has pre-formatted manual pages.  If you don't want these installed,
  answer 'none' to the next question.
  
  EOM
  case "$manfmt" in
  '')
! 	lookpath="$prefix/catman/man1 $prefix/man/cat1"
! 	lookpath="$lookpath $prefix/catman/u_man/man1 $prefix/catman/l_man/man1"
! 	lookpath="$lookpath $prefix/catman/cat1 /usr/catman/local/man1"
  	lookpath="$lookpath /usr/catman/manl /usr/man/cat1"
  	lookpath="$lookpath /usr/catman/mann /usr/catman/l_man/man1"
  	lookpath="$lookpath /usr/catman/u_man/man1 /usr/catman/man1"
  	dflt=`./loc . none $lookpath`
  	;;
  *)  dflt="$manfmt"
  	;;
--- 36,70 ----
  ?S:	at configuration time, for programs not willing to deal with it at
  ?S:	run-time.
  ?S:.
+ ?S:installmanfmt:
+ ?S:	This variable is really the same as manfmtexp, unless you are using
+ ?S:	AFS in which case it points to the read/write location whereas
+ ?S:	mansrcexp only points to the read-only access location. For extra
+ ?S:	portability, you should only use this variable within your makefiles.
+ ?S:.
  ?LINT:change manext
  ?T:lookpath
  : determine where manual pages go
+ set manfmt manfmt
+ eval $prefixit
  $cat <<EOM
    
! $spackage has pre-formatted manual pages.  If you don't want these installed,
  answer 'none' to the next question.
  
  EOM
  case "$manfmt" in
  '')
! 	lookpath="$prefixexp/catman/man1 $prefixexp/man/cat1"
! 	lookpath="$lookpath $prefixexp/catman/u_man/man1"
! 	lookpath="$lookpath $prefixexp/catman/l_man/man1"
! 	lookpath="$lookpath $prefixexp/catman/cat1 /usr/catman/local/man1"
  	lookpath="$lookpath /usr/catman/manl /usr/man/cat1"
  	lookpath="$lookpath /usr/catman/mann /usr/catman/l_man/man1"
  	lookpath="$lookpath /usr/catman/u_man/man1 /usr/catman/man1"
  	dflt=`./loc . none $lookpath`
+ 	set dflt
+ 	eval $prefixup
  	;;
  *)  dflt="$manfmt"
  	;;
***************
*** 56,63 ****
--- 72,101 ----
  fn=dn~
  rp='Where do pre-formatted manual pages go?'
  . ./getfile
+ if test "X$manfmtexp" != "X$ansexp"; then
+ 	installmanfmt=''
+ fi
  manfmt="$ans"
  manfmtexp="$ansexp"
+ if $afs; then
+ 	$cat <<EOM
+ 
+ Since you are running AFS, I need to distinguish the directory in which
+ manual pages reside from the directory in which they are installed (and from
+ which they are presumably copied to the former directory by occult means).
+ 
+ EOM
+ 	case "$installmanfmt" in
+ 	'') dflt=`echo $manfmtexp | sed 's#^/afs/#/afs/.#'`;;
+ 	*) dflt="$installmanfmt";;
+ 	esac
+ 	fn=de~
+ 	rp='Where will pre-formatted man pages be installed?'
+ 	. ./getfile
+ 	installmanfmt="$ans"
+ else
+ 	installmanfmt="$manfmtexp"
+ fi
  
  case "$manfmt" in
  '') manext='0';;

Index: mcon/U/Oldconfig.U
Prereq: 3.0.1.5
*** mcon/U/Oldconfig.U.old	Mon Jan 30 15:50:08 1995
--- mcon/U/Oldconfig.U	Mon Jan 30 15:50:08 1995
***************
*** 1,4 ****
! ?RCS: $Id: Oldconfig.U,v 3.0.1.5 1995/01/11 15:15:36 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
--- 1,4 ----
! ?RCS: $Id: Oldconfig.U,v 3.0.1.6 1995/01/30 14:27:15 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
***************
*** 9,14 ****
--- 9,18 ----
  ?RCS: of the source tree for dist 3.0.
  ?RCS:
  ?RCS: $Log: Oldconfig.U,v $
+ ?RCS: Revision 3.0.1.6  1995/01/30  14:27:15  ram
+ ?RCS: patch49: unit Options.U now exports file optdef.sh, not a variable
+ ?RCS: patch49: update code for myuname changed (WED)
+ ?RCS:
  ?RCS: Revision 3.0.1.5  1995/01/11  15:15:36  ram
  ?RCS: patch45: added quotes around the INITPROG variable (ADO)
  ?RCS: patch45: allows variable overriding after config file loading
***************
*** 66,72 ****
  ?S:	os_4.1, etc., not keeping separate files for each little release.
  ?S:.
  ?F:!config.sh
! ?T:tmp tmp_n tmp_c file xxxxfile xxxfile xxfile xfile hintfile oldmyuname
  ?T:tans _ isesix INITPROG
  ?LINT:change n c
  : Try to determine whether config.sh was made on this system
--- 70,76 ----
  ?S:	os_4.1, etc., not keeping separate files for each little release.
  ?S:.
  ?F:!config.sh
! ?T:tmp tmp_n tmp_c file xxxxfile xxxfile xxfile xfile hintfile newmyuname
  ?T:tans _ isesix INITPROG
  ?LINT:change n c
  : Try to determine whether config.sh was made on this system
***************
*** 85,101 ****
  ?X: new lines to keep the myuname variable sane... --RAM
  myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
  	./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
  dflt=n
  if test "$fastread" = yes; then
  	dflt=y
  elif test -f ../config.sh; then
- ?X: The value from config.sh will superseed the one we've just computed
- ?X: ... but not if we choose to ignore config.sh, so eval oldmyuname here.
- 	oldmyuname=''
  	if $contains myuname= ../config.sh >/dev/null 2>&1; then
! 		eval "old`grep myuname= ../config.sh`"
  	fi
! 	if test "X$myuname" = "X$oldmyuname"; then
  		dflt=y
  	fi
  fi
--- 89,104 ----
  ?X: new lines to keep the myuname variable sane... --RAM
  myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
  	./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
+ ?X: Save the value we just computed to reset myuname after we get done here.
+ newmyuname="$myuname"
  dflt=n
  if test "$fastread" = yes; then
  	dflt=y
  elif test -f ../config.sh; then
  	if $contains myuname= ../config.sh >/dev/null 2>&1; then
! 		eval "`grep myuname= ../config.sh`"
  	fi
! 	if test "X$myuname" = "X$newmyuname"; then
  		dflt=y
  	fi
  fi
***************
*** 115,121 ****
  		tmp_n="$n"
  		tmp_c="$c"
  		. ./config.sh
- 		test "$override" && . UU/$optdef
  		cp config.sh UU
  		n="$tmp_n"
  		c="$tmp_c"
--- 118,123 ----
***************
*** 373,379 ****
  		dflt=`echo $hintfile | $sed 's/\.sh$//'`
  		;;
  	esac
! 			
  	$cat <<EOM
  
  You may give one or more space-separated answers, or "none" if appropriate.
--- 375,381 ----
  		dflt=`echo $hintfile | $sed 's/\.sh$//'`
  		;;
  	esac
! 
  	$cat <<EOM
  
  You may give one or more space-separated answers, or "none" if appropriate.
***************
*** 433,439 ****
  		tmp_n="$n"
  		tmp_c="$c"
  		. ../config.sh
- 		test "$override" && . ./$optdef
  		cp ../config.sh .
  		n="$tmp_n"
  		c="$tmp_c"
--- 435,440 ----
***************
*** 454,466 ****
  	cp $config_sh config.sh 2>/dev/null
  	. ./config.sh
  	cd UU
- 	test "$override" && . ./$optdef
  	cp ../config.sh .
  	n="$tmp_n"
  	c="$tmp_c"
  	hint=previous
  	;;
  esac
  
  : Restore computed paths
  for file in $loclist $trylist; do
--- 455,468 ----
  	cp $config_sh config.sh 2>/dev/null
  	. ./config.sh
  	cd UU
  	cp ../config.sh .
  	n="$tmp_n"
  	c="$tmp_c"
  	hint=previous
  	;;
  esac
+ test "$override" && . ./optdef.sh
+ myuname="$newmyuname"
  
  : Restore computed paths
  for file in $loclist $trylist; do

Index: mcon/U/d_regcmp.U
Prereq: 3.0
*** mcon/U/d_regcmp.U.old	Mon Jan 30 15:50:12 1995
--- mcon/U/d_regcmp.U	Mon Jan 30 15:50:12 1995
***************
*** 1,4 ****
! ?RCS: $Id: d_regcmp.U,v 3.0 1993/08/18 12:06:53 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
--- 1,4 ----
! ?RCS: $Id: d_regcmp.U,v 3.0.1.1 1995/01/30 14:34:45 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
***************
*** 9,19 ****
  ?RCS: of the source tree for dist 3.0.
  ?RCS:
  ?RCS: $Log: d_regcmp.U,v $
  ?RCS: Revision 3.0  1993/08/18  12:06:53  ram
  ?RCS: Baseline for dist 3.0 netwide release.
  ?RCS:
! ?MAKE:d_regcmp d_re_comp: Csym
  ?MAKE:	-pick add $@ %<
  ?S:d_regcmp:
  ?S:	This variable conditionally defines the HAS_REGCMP symbol, which
  ?S:	indicates to the C program that the regcmp() routine is available
--- 9,27 ----
  ?RCS: of the source tree for dist 3.0.
  ?RCS:
  ?RCS: $Log: d_regcmp.U,v $
+ ?RCS: Revision 3.0.1.1  1995/01/30  14:34:45  ram
+ ?RCS: patch49: now looks for POSIX regcomp() routine
+ ?RCS:
  ?RCS: Revision 3.0  1993/08/18  12:06:53  ram
  ?RCS: Baseline for dist 3.0 netwide release.
  ?RCS:
! ?MAKE:d_regcmp d_re_comp d_regcomp: Csym cat
  ?MAKE:	-pick add $@ %<
+ ?S:d_regcomp:
+ ?S:	This variable conditionally defines the HAS_REGCOMP symbol, which
+ ?S:	indicates to the C program that the regcomp() routine is available
+ ?S:	for regular patern matching (usally on POSIX.2 conforming systems).
+ ?S:.
  ?S:d_regcmp:
  ?S:	This variable conditionally defines the HAS_REGCMP symbol, which
  ?S:	indicates to the C program that the regcmp() routine is available
***************
*** 25,30 ****
--- 33,43 ----
  ?S:	for regular patern matching (usally on BSD). If so, it is likely that
  ?S:	re_exec() exists.
  ?S:.
+ ?C:HAS_REGCOMP (REGCOMP):
+ ?C:	This symbol, if defined, indicates that the regcomp() routine is
+ ?C:	available to do some regular patern matching (usually on POSIX.2
+ ?C:	conforming systems).
+ ?C:.
  ?C:HAS_REGCMP (REGCMP):
  ?C:	This symbol, if defined, indicates that the regcmp() routine is
  ?C:	available to do some regular patern matching (usually on System V).
***************
*** 34,56 ****
  ?C:	available to do some regular patern matching (usually on BSD). If so,
  ?C:	it is likely that re_exec() be available.
  ?C:.
  ?H:#$d_regcmp HAS_REGCMP		/* sysV */
  ?H:#$d_re_comp HAS_RECOMP		/* BSD */
  ?H:.
  ?T:val
! : see if regcmp or re_comp exist, for regular pattern matching
  echo " "
! if set regcmp val -f d_regcmp; eval $csym; $val; then
  	echo 'regcmp() found.' >&4
  	d_regcmp="$define"
  	d_re_comp="$undef"
  elif set re_comp val -f d_re_comp; eval $csym; $val; then
  	echo 're_comp() found, assuming re_exec() also exists.' >&4
  	d_re_comp="$define"
  	d_regcmp="$undef"
  else
! 	echo "No regcmp() nor re_comp() found !! No regular pattern matching." >&4
  	d_regcmp="$undef"
  	d_re_comp="$undef"
  fi
  
--- 47,80 ----
  ?C:	available to do some regular patern matching (usually on BSD). If so,
  ?C:	it is likely that re_exec() be available.
  ?C:.
+ ?H:#$d_regcomp HAS_REGCOMP		/* POSIX.2 */
  ?H:#$d_regcmp HAS_REGCMP		/* sysV */
  ?H:#$d_re_comp HAS_RECOMP		/* BSD */
  ?H:.
  ?T:val
! : see if regcomp, regcmp, or re_comp exist, for regular pattern matching
  echo " "
! if set regcomp val -f d_regcomp; eval $csym; $val; then
! 	echo 'regcomp() found.' >&4
! 	d_regcomp="$define"
! 	d_regcmp="$undef"
! 	d_re_comp="$undef"
! elif set regcmp val -f d_regcmp; eval $csym; $val; then
  	echo 'regcmp() found.' >&4
  	d_regcmp="$define"
+ 	d_regcomp="$undef"
  	d_re_comp="$undef"
  elif set re_comp val -f d_re_comp; eval $csym; $val; then
  	echo 're_comp() found, assuming re_exec() also exists.' >&4
  	d_re_comp="$define"
+ 	d_regcomp="$undef"
  	d_regcmp="$undef"
  else
! 	$cat >&4 <<EOM
! No regcomp(), regcmp() nor re_comp() found !! No regular pattern matching.
! EOM
  	d_regcmp="$undef"
  	d_re_comp="$undef"
+ 	d_regcomp="$undef"
  fi
  

Index: ChangeLog
*** ChangeLog.old	Mon Jan 30 16:02:44 1995
--- ChangeLog	Mon Jan 30 16:02:44 1995
***************
*** 1,3 ****
--- 1,107 ----
+ Mon Jan 30 15:59:00 MET 1995   Raphael Manfredi <ram@acri.fr>
+ 
+ . Description:
+ 
+ 	The dist-3.0 package now works with perl 5.0. I have made perl 5.0
+ 	the default perl on my machine and ran the whole set of pat* tools,
+ 	jmake and metaconfig without any trouble so far. However, you need
+ 	a patched-up version of perl 5.0 PL0, as explained in README.
+ 
+ 	This set of patches is mainly an integration of Wayne Davison's
+ 	changes for trn. His changes are flagged as WED.
+ 
+ 	Begin.U:
+ 	  Avoid an empty rmlist: systems might choke on it (WED).
+ 
+ 	Config_h.U:
+ 	  Typo fixes in leading config.h comment (WED).
+ 
+ 	Oldconfig.U:
+ 	  Update code for myuname changed (WED).
+ 
+ 	Configure can now handle installation prefix changes. I have
+ 	slightly adapted the changes proposed by Wayne, introducing two
+ 	new special units (Prefixit.U and Prefixup.U) to factorize code.
+ 
+ 	d_attribut.U:
+ 	  Test C program now includes <stdio.h> (WED)
+ 
+ 	page.U:
+ 	  Ensure dflt gets initialized in case no pagers are found (WED)
+ 
+ 	prefix.U:
+ 	  Save off previous prefix value in oldprefix if changed (WED)
+ 	  Added the INSTALLPREFIX define for C programs to use (WED)
+ 
+ 	Archname is now systematically recomputed. This avoids problem when
+ 	the user changes his mind about the OS name.
+ 
+ 	Now looks for POSIX regcomp() routine, and for <regex.h>, thanks
+ 	to Sidney C. Smith <scsmith@cbda9.apgea.army.mil>.
+ 
+ 	New installmanfmt and AFS-lookup for formatted man pages, derived
+ 	from what is done for troffed man pages.
+ 
+ 	New prefixexp variable holding a fully expanded prefix, in case
+ 	they use ~name expansion in their prefix.
+ 
+ 	Documented new special units Prefixit.U and Prefixup.U.
+ 
+ 	Clean-up and workarounds for perl 5.0 PL0 port:
+ 	  Removed old "do name()" routine call constructs.
+ 	  Forgot to localize the spaces variable.
+ 	  Random clean-up in &record_obsolete.
+ 
+ 	Three new files.
+ 
+ . Files changed:
+ 
+ 	* mcon/U/Begin.U: Avoid an empty rmlist: systems might choke on it
+ 	(WED).
+ 
+ 	* mcon/U/Config_h.U: Typo fixes in leading config.h comment (WED).
+ 
+ 	* mcon/U/Oldconfig.U: Unit Options.U now exports file optdef.sh, not
+ 	a variable.  Update code for myuname changed (WED).
+ 
+ 	* mcon/U/Options.U: This unit now exports file optdef.sh, not a
+ 	variable.
+ 
+ 	* mcon/U/i_regex.U, mcon/U/Prefixit.U, mcon/U/Prefixup.U: Created.
+ 
+ 	* mcon/U/archlib.U: Archname is now systematically recomputed.  Can
+ 	now handle installation prefix changes (from WED).
+ 
+ 	* mcon/U/mansrc.U, mcon/U/scriptdir.U, mcon/U/lib.U, mcon/U/privlib.U,
+ 	, mcon/U/bin.U: Can now handle installation prefix changes (from WED).
+ 
+ 	* mcon/U/d_attribut.U: Test C program now includes <stdio.h> (WED).
+ 
+ 	* mcon/U/d_regcmp.U: Now looks for POSIX regcomp() routine.
+ 
+ 	* mcon/U/manfmt.U: New installmanfmt and AFS-lookup for formatted man
+ 	pages.  Can now handle installation prefix changes (from WED).
+ 
+ 	* mcon/U/pager.U: Ensure dflt gets initialized in case no pagers are
+ 	found (WED).
+ 
+ 	* mcon/U/prefix.U: New prefixexp variable holding a fully expanded
+ 	prefix.  Save off previous prefix value in oldprefix if changed
+ 	(WED).  Added the INSTALLPREFIX define for C programs to use (WED).
+ 
+ 	* mcon/U/rootid.U: Now only prints a single empty line when
+ 	outputting something.
+ 
+ 	* mcon/man/mconfig.SH: Documented new special units Prefixit.U and
+ 	Prefixup.U.
+ 
+ 	* mcon/pl/configure.pl, mcon/pl/eval.pl: Removed old "do name()"
+ 	routine call constructs.
+ 
+ 	* mcon/pl/cosmetic.pl: Forgot to localize the spaces variable.
+ 
+ 	* mcon/pl/obsolete.pl: Random clean-up in &record_obsolete.
+ 
  Wed Jan 11 17:03:22 MET 1995   Raphael Manfredi <ram@acri.fr>
  
  . Description:

Index: mcon/U/archlib.U
Prereq: 3.0.1.1
*** mcon/U/archlib.U.old	Mon Jan 30 15:50:10 1995
--- mcon/U/archlib.U	Mon Jan 30 15:50:10 1995
***************
*** 1,4 ****
! ?RCS: $Id: archlib.U,v 3.0.1.1 1994/10/29 16:02:36 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
--- 1,4 ----
! ?RCS: $Id: archlib.U,v 3.0.1.2 1995/01/30 14:32:22 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
***************
*** 11,21 ****
  ?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
  ?RCS:
  ?RCS: $Log: archlib.U,v $
  ?RCS: Revision 3.0.1.1  1994/10/29  16:02:36  ram
  ?RCS: patch36: created by ADO
  ?RCS:
! ?MAKE:d_archlib archlib archlibexp installarchlib archname: afs package \
! 	cat Getfile Loc Oldconfig prefix privlib osname test
  ?MAKE:	-pick add $@ %<
  ?S:d_archlib:
  ?S:	This variable conditionally defines ARCHLIB to hold the pathname
--- 11,26 ----
  ?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
  ?RCS:
  ?RCS: $Log: archlib.U,v $
+ ?RCS: Revision 3.0.1.2  1995/01/30  14:32:22  ram
+ ?RCS: patch49: archname is now systematically recomputed
+ ?RCS: patch49: can now handle installation prefix changes (from WED)
+ ?RCS:
  ?RCS: Revision 3.0.1.1  1994/10/29  16:02:36  ram
  ?RCS: patch36: created by ADO
  ?RCS:
! ?MAKE:d_archlib archlib archlibexp installarchlib archname: afs spackage \
! 	cat Getfile Loc Oldconfig prefixexp privlib osname test Prefixit rm \
! 	Prefixup
  ?MAKE:	-pick add $@ %<
  ?S:d_archlib:
  ?S:	This variable conditionally defines ARCHLIB to hold the pathname
***************
*** 58,85 ****
  ?H:#$d_archlib ARCHLIB "$archlib"		/**/
  ?H:#$d_archlib ARCHLIB_EXP "$archlibexp"		/**/
  ?H:.
! ?T:tpath xxx tarchname
  : determine where public architecture dependent libraries go
! case "$archname" in
! '')	tpath=`echo $PATH | sed -e 's/:/ /g'`
! 	if xxx=`./loc arch blurfl $tpath`; test -f "$xxx"; then
! 		tarchname=`arch`
  		archname="${tarchname}-$osname"
- 	elif xxx=`./loc uname blurfl $tpath`; test -f "$xxx" ; then
- 		if uname -m > tmparch 2>&1 ; then
- 			tarchname=`cat tmparch`
- 			archname="${tarchname}-$osname"
- 		fi
- 		rm -f tmparch
- 	else
- 		archname="$osname"
  	fi
! 	;;
! esac
  case "$archlib" in
  '')
  	case "$privlib" in
! 	'') dflt=`./loc . "." $prefix/lib /usr/local/lib /usr/lib /lib`;;
  	*)  dflt="$privlib/$archname";;
  	esac
  	;;
--- 63,93 ----
  ?H:#$d_archlib ARCHLIB "$archlib"		/**/
  ?H:#$d_archlib ARCHLIB_EXP "$archlibexp"		/**/
  ?H:.
! ?T:xxx tarchname
  : determine where public architecture dependent libraries go
! ?X: Always recompute archname in case osname changes -- RAM
! if xxx=`./loc arch blurfl $pth`; test -f "$xxx"; then
! 	tarchname=`arch`
! 	archname="${tarchname}-$osname"
! elif xxx=`./loc uname blurfl $pth`; test -f "$xxx" ; then
! 	if uname -m > tmparch 2>&1 ; then
! 		tarchname=`cat tmparch`
  		archname="${tarchname}-$osname"
  	fi
! 	$rm -f tmparch
! else
! 	archname="$osname"
! fi
! set archlib archlib
! eval $prefixit
  case "$archlib" in
  '')
  	case "$privlib" in
! 	'')
! 		dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
! 		set dflt
! 		eval $prefixup
! 		;;
  	*)  dflt="$privlib/$archname";;
  	esac
  	;;
***************
*** 87,93 ****
  esac
  cat <<EOM
  
! $package contains architecture-dependent library files.  If you are
  sharing libraries in a heterogeneous environment, you might store
  these files in a separate location.  Otherwise, you can just include
  them with the rest of the public library files.
--- 95,101 ----
  esac
  cat <<EOM
  
! $spackage contains architecture-dependent library files.  If you are
  sharing libraries in a heterogeneous environment, you might store
  these files in a separate location.  Otherwise, you can just include
  them with the rest of the public library files.

Index: mcon/U/mansrc.U
Prereq: 3.0.1.5
*** mcon/U/mansrc.U.old	Mon Jan 30 15:50:14 1995
--- mcon/U/mansrc.U	Mon Jan 30 15:50:14 1995
***************
*** 1,4 ****
! ?RCS: $Id: mansrc.U,v 3.0.1.5 1995/01/11 15:32:25 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
--- 1,4 ----
! ?RCS: $Id: mansrc.U,v 3.0.1.6 1995/01/30 14:39:34 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
***************
*** 9,14 ****
--- 9,17 ----
  ?RCS: of the source tree for dist 3.0.
  ?RCS:
  ?RCS: $Log: mansrc.U,v $
+ ?RCS: Revision 3.0.1.6  1995/01/30  14:39:34  ram
+ ?RCS: patch49: can now handle installation prefix changes (from WED)
+ ?RCS:
  ?RCS: Revision 3.0.1.5  1995/01/11  15:32:25  ram
  ?RCS: patch45: can now use Loc variables since path stripping is deferred
  ?RCS:
***************
*** 28,34 ****
  ?RCS: Baseline for dist 3.0 netwide release.
  ?RCS:
  ?MAKE:mansrc mansrcexp manext installmansrc: afs cat nroff Loc Oldconfig \
! 	sysman package test Getfile prefix
  ?MAKE:	-pick add $@ %<
  ?S:mansrc:
  ?S:	This variable contains the name of the directory in which manual
--- 31,37 ----
  ?RCS: Baseline for dist 3.0 netwide release.
  ?RCS:
  ?MAKE:mansrc mansrcexp manext installmansrc: afs cat nroff Loc Oldconfig \
! 	sysman spackage test Getfile Prefixit prefixexp Prefixup
  ?MAKE:	-pick add $@ %<
  ?S:mansrc:
  ?S:	This variable contains the name of the directory in which manual
***************
*** 53,61 ****
  ?S:.
  ?T:lookpath
  : determine where manual pages go
  $cat <<EOM
  
! $package has manual pages available in source form.
  EOM
  case "$nroff" in
  nroff)
--- 56,66 ----
  ?S:.
  ?T:lookpath
  : determine where manual pages go
+ set mansrc mansrc none
+ eval $prefixit
  $cat <<EOM
  
! $spackage has manual pages available in source form.
  EOM
  case "$nroff" in
  nroff)
***************
*** 67,84 ****
  echo "If you don't want the manual sources installed, answer 'none'."
  case "$mansrc" in
  '')
! 	lookpath="$prefix/man/man1 $prefix/man/u_man/man1 $prefix/man/l_man/man1"
  	lookpath="$lookpath /usr/local/man/man1 /usr/local/man/man1 /usr/man/manl"
  	lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
  	lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
  	lookpath="$lookpath /usr/man/man.L"
! 	mansrc=`./loc . $prefix/man/man1 $lookpath`
  	if $test -d "$mansrc"; then
  		dflt="$mansrc"
  	else
  		dflt="$sysman"
  	fi
  	;;
  *)  dflt="$mansrc"
  	;;
  esac
--- 72,93 ----
  echo "If you don't want the manual sources installed, answer 'none'."
  case "$mansrc" in
  '')
! 	lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
! 	lookpath="$lookpath $prefixexp/man/l_man/man1"
  	lookpath="$lookpath /usr/local/man/man1 /usr/local/man/man1 /usr/man/manl"
  	lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
  	lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
  	lookpath="$lookpath /usr/man/man.L"
! 	mansrc=`./loc . $prefixexp/man/man1 $lookpath`
  	if $test -d "$mansrc"; then
  		dflt="$mansrc"
  	else
  		dflt="$sysman"
  	fi
+ 	set dflt
+ 	eval $prefixup
  	;;
+ ' ') dflt=none;;
  *)  dflt="$mansrc"
  	;;
  esac
***************
*** 86,93 ****
--- 95,109 ----
  fn=dn~
  rp='Where do the manual pages (source) go?'
  . ./getfile
+ if test "X$mansrcexp" != "X$ansexp"; then
+ 	installmansrc=''
+ fi
  mansrc="$ans"
  mansrcexp="$ansexp"
+ case "$mansrc" in
+ '') mansrc=' '
+ 	installmansrc='';;
+ esac
  if $afs; then
  	$cat <<EOM
  
***************
*** 108,116 ****
  	installmansrc="$mansrcexp"
  fi
  
- 
  case "$mansrc" in
! '') manext='0';;
  *l) manext=l;;
  *n) manext=n;;
  *o) manext=l;;
--- 124,131 ----
  	installmansrc="$mansrcexp"
  fi
  
  case "$mansrc" in
! ' ') manext='0';;
  *l) manext=l;;
  *n) manext=n;;
  *o) manext=l;;

Index: mcon/U/prefix.U
Prereq: 3.0.1.1
*** mcon/U/prefix.U.old	Mon Jan 30 15:50:15 1995
--- mcon/U/prefix.U	Mon Jan 30 15:50:15 1995
***************
*** 1,4 ****
! ?RCS: $Id: prefix.U,v 3.0.1.1 1994/08/29 16:31:34 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
--- 1,4 ----
! ?RCS: $Id: prefix.U,v 3.0.1.2 1995/01/30 14:44:05 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
***************
*** 11,28 ****
  ?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
  ?RCS:
  ?RCS: $Log: prefix.U,v $
  ?RCS: Revision 3.0.1.1  1994/08/29  16:31:34  ram
  ?RCS: patch32: created by ADO
  ?RCS:
! ?MAKE:prefix: Getfile Loc Oldconfig cat package
  ?MAKE:	-pick add $@ %<
  ?S:prefix:
  ?S:	This variable holds the name of the directory below which the
  ?S:	user will install the package.  Usually, this is /usr/local, and
  ?S:	executables go in /usr/local/bin, library stuff in /usr/local/lib,
  ?S:	man pages in /usr/local/man, etc.  It is only used to set defaults
! ?S: for things in bin.U, mansrc.U, privlib.U, or scriptdir.U.
  ?S:.
  : determine root of directory hierarchy where package will be installed.
  case "$prefix" in
  '')
--- 11,46 ----
  ?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
  ?RCS:
  ?RCS: $Log: prefix.U,v $
+ ?RCS: Revision 3.0.1.2  1995/01/30  14:44:05  ram
+ ?RCS: patch49: new prefixexp variable holding a fully expanded prefix
+ ?RCS: patch49: save off previous prefix value in oldprefix if changed (WED)
+ ?RCS: patch49: added the INSTALLPREFIX define for C programs to use (WED)
+ ?RCS:
  ?RCS: Revision 3.0.1.1  1994/08/29  16:31:34  ram
  ?RCS: patch32: created by ADO
  ?RCS:
! ?MAKE:prefix prefixexp +oldprefix: Getfile Loc Oldconfig cat package
  ?MAKE:	-pick add $@ %<
  ?S:prefix:
  ?S:	This variable holds the name of the directory below which the
  ?S:	user will install the package.  Usually, this is /usr/local, and
  ?S:	executables go in /usr/local/bin, library stuff in /usr/local/lib,
  ?S:	man pages in /usr/local/man, etc.  It is only used to set defaults
! ?S:	for things in bin.U, mansrc.U, privlib.U, or scriptdir.U.
! ?S:.
! ?S:prefixexp:
! ?S:	This variable holds the full absolute path of the directory below
! ?S:	which the user will install the package.  Derived from prefix.
  ?S:.
+ ?S:oldprefix:
+ ?S:	This variable is set non-null if the prefix was previously defined
+ ?S:	and gets set to a new value. Used internally by Configure only.
+ ?S:.
+ ?C:INSTALLPREFIX:
+ ?C:	This symbol contains the name of the install prefix for this package.
+ ?C:.
+ ?H:#define INSTALLPREFIX "$prefix"		/**/
+ ?H:.
  : determine root of directory hierarchy where package will be installed.
  case "$prefix" in
  '')
***************
*** 41,51 ****
  binaries. If you wish to have binaries under /bin but manual pages
  under /usr/local/man, that's ok: you will be prompted separately
  for each of the installation directories, the prefix being only used
! to set defaults.
  
  EOM
  fn=d~
  rp='Installation prefix to use?'
  . ./getfile
  prefix="$ans"
  
--- 59,80 ----
  binaries. If you wish to have binaries under /bin but manual pages
  under /usr/local/man, that's ok: you will be prompted separately
  for each of the installation directories, the prefix being only used
! to set the defaults.
  
  EOM
  fn=d~
  rp='Installation prefix to use?'
  . ./getfile
+ oldprefix=''
+ case "$prefix" in
+ '') ;;
+ *)
+ 	case "$ans" in
+ 	"$prefix") ;;
+ 	*) oldprefix="$prefix";;
+ 	esac
+ 	;;
+ esac
  prefix="$ans"
+ prefixexp="$ansexp"
  

Index: mcon/U/Options.U
Prereq: 3.0.1.3
*** mcon/U/Options.U.old	Mon Jan 30 15:50:09 1995
--- mcon/U/Options.U	Mon Jan 30 15:50:09 1995
***************
*** 1,4 ****
! ?RCS: $Id: Options.U,v 3.0.1.3 1995/01/11 15:19:00 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
--- 1,4 ----
! ?RCS: $Id: Options.U,v 3.0.1.4 1995/01/30 14:27:52 ram Exp $
  ?RCS:
  ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  ?RCS: 
***************
*** 9,14 ****
--- 9,17 ----
  ?RCS: of the source tree for dist 3.0.
  ?RCS:
  ?RCS: $Log: Options.U,v $
+ ?RCS: Revision 3.0.1.4  1995/01/30  14:27:52  ram
+ ?RCS: patch49: this unit now exports file optdef.sh, not a variable
+ ?RCS:
  ?RCS: Revision 3.0.1.3  1995/01/11  15:19:00  ram
  ?RCS: patch45: new -O option allowing -D and -U to override config.sh setttings
  ?RCS: patch45: file optdef.sh is no longer removed after sourcing
***************
*** 32,39 ****
  ?X:
  ?MAKE:Options: Extract
  ?MAKE:	-pick wipe $@ %<
! ?V:reuseval config_sh alldone error silent extractsh fastread optdef override:
  ?T:arg config symbol
  : produce awk script to parse command line options
  cat >options.awk <<'EOF'
  BEGIN {
--- 35,43 ----
  ?X:
  ?MAKE:Options: Extract
  ?MAKE:	-pick wipe $@ %<
! ?V:reuseval config_sh alldone error silent extractsh fastread override:
  ?T:arg config symbol
+ ?F:./optdef.sh
  : produce awk script to parse command line options
  cat >options.awk <<'EOF'
  BEGIN {
***************
*** 103,110 ****
  silent=''
  extractsh=''
  override=''
! optdef='optdef.sh'
! rm -f $optdef
  
  : option parsing
  while test $# -gt 0; do
--- 107,113 ----
  silent=''
  extractsh=''
  override=''
! rm -f optdef.sh
  
  : option parsing
  while test $# -gt 0; do
***************
*** 136,155 ****
  			echo "$me: ignoring -D $1" >&2
  			;;
  		*=*) echo "$1" | \
! 				sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> $optdef;;
! 		*) echo "$1='define'" >> $optdef;;
  		esac
  		shift
  		;;
  	-U)
  		shift
  		case "$1" in
! 		*=) echo "$1" >> $optdef;;
  		*=*)
  			echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
  			echo "$me: ignoring -U $1" >&2
  			;;
! 		*) echo "$1='undef'" >> $optdef;;
  		esac
  		shift
  		;;
--- 139,158 ----
  			echo "$me: ignoring -D $1" >&2
  			;;
  		*=*) echo "$1" | \
! 				sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
! 		*) echo "$1='define'" >> optdef.sh;;
  		esac
  		shift
  		;;
  	-U)
  		shift
  		case "$1" in
! 		*=) echo "$1" >> optdef.sh;;
  		*=*)
  			echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
  			echo "$me: ignoring -U $1" >&2
  			;;
! 		*) echo "$1='undef'" >> optdef.sh;;
  		esac
  		shift
  		;;
***************
*** 198,205 ****
  esac
  
  : run the defines and the undefines, if any, but leave the file out there...
! touch $optdef
! . ./$optdef
  
  ?X: If extraction has been requested, load the configuration file, perform
  ?X: the extraction and exit.
--- 201,208 ----
  esac
  
  : run the defines and the undefines, if any, but leave the file out there...
! touch optdef.sh
! . ./optdef.sh
  
  ?X: If extraction has been requested, load the configuration file, perform
  ?X: the extraction and exit.
***************
*** 214,220 ****
  	echo "Fetching answers from $config_sh..."
  	cd ..
  	. $config
! 	test "$override" && . ./$optdef
  	echo " "
  	. ./UU/extract
  	rm -rf UU
--- 217,223 ----
  	echo "Fetching answers from $config_sh..."
  	cd ..
  	. $config
! 	test "$override" && . ./optdef.sh
  	echo " "
  	. ./UU/extract
  	rm -rf UU

*** End of Patch 49 ***

exit 0 # Just in case...

