From: Nicholas Clark Date: Mon, 13 Mar 2006 18:01:11 +0000 (+0000) Subject: Refactor most of the cut & paste for setting prefix/prefixexp variables X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=79522dd28c2cdf92c115561db038e46cd34e5073;p=p5sagit%2Fp5-mst-13.2.git Refactor most of the cut & paste for setting prefix/prefixexp variables and the "Change installation prefix, if necessary" into a new "function" setprefixvar (which I assume will become Setprefixvar.U) How many platforms still have Bourne shells that can't do shell functions? Someone's going to say Irix? p4raw-id: //depot/perl@27488 --- diff --git a/Configure b/Configure index 2cebb0c..32ef64a 100755 --- a/Configure +++ b/Configure @@ -5968,6 +5968,23 @@ esac : confusing anyway. installstyle=$dflt + +: Set variables such as privlib and privlibexp from the output of ./getfile +: performing the prefixexp/installprefixexp correction if necessary. +cat <setprefixvar +$startsh +EOS +cat <<'EOSC' >>setprefixvar +eval "${prefixvar}=\"\$ans\"" +eval "${prefixvar}exp=\"\$ansexp\"" +: Change installation prefix, if necessary. +if $test X"$prefix" != X"$installprefix"; then + eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`" +else + eval "install${prefixvar}=\"\$${prefixvar}exp\"" +fi +EOSC + : determine where private library files go : Usual default is /usr/local/lib/perl5/$version. : Also allow things like /opt/perl/lib/$version, since @@ -5987,14 +6004,8 @@ EOM fn=d~+ rp='Pathname where the private library files will reside?' . ./getfile -privlib="$ans" -privlibexp="$ansexp" -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installprivlib=`echo $privlibexp | sed "s#^$prefixexp#$installprefixexp#"` -else - installprivlib="$privlibexp" -fi +prefixvar=privlib +. ./setprefixvar : set the prefixup variable, to restore leading tilda escape prefixup='case "$prefixexp" in @@ -6027,19 +6038,13 @@ EOM fn=d+~ rp='Where do you want to put the public architecture-dependent libraries?' . ./getfile -archlib="$ans" -archlibexp="$ansexp" +prefixvar=archlib +. ./setprefixvar if $test X"$archlib" = X"$privlib"; then d_archlib="$undef" else d_archlib="$define" fi -: Change installation prefix, if necessary. -if $test X"$prefix" != X"$installprefix"; then - installarchlib=`echo $archlibexp | sed "s#^$prefixexp#$installprefixexp#"` -else - installarchlib="$archlibexp" -fi : see if setuid scripts can be secure $cat <