This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[ID 19990819.002] File::Find error when pruning top-level directories
[perl5.git] / Policy_sh.SH
1 case $CONFIGDOTSH in
2 '') . ./config.sh ;;
3 esac
4 echo "Extracting Policy.sh (with variable substitutions)"
5 $spitshell <<!GROK!THIS! >Policy.sh
6 $startsh
7 #
8 #  This file was produced by running the Policy_sh.SH script, which
9 #  gets its values from config.sh, which is generally produced by
10 #  running Configure.  The Policy.sh file gets overwritten each time
11 #  Configure is run.  Any variables you add to Policy.sh will be lost
12 #  unless you copy Policy.sh somewhere else before running Configure.
13 #
14 #  The idea here is to distill in one place the common site-wide
15 #  "policy" answers (such as installation directories) that are
16 #  to be "sticky".  If you keep the file Policy.sh around in
17 #  the same directory as you are building Perl, then Configure will
18 #  (by default) load up the Policy.sh file just before the
19 #  platform-specific hints file.
20 #
21
22 #  Allow Configure command-line overrides; usually these won't be
23 #  needed, but something like -Dprefix=/test/location can be quite
24 #  useful for testing out new versions.
25
26 #Site-specific values:
27
28 case "\$perladmin" in
29 '') perladmin='$perladmin' ;;
30 esac
31
32 # Installation prefix.  Allow a Configure -D override.  You
33 # may wish to reinstall perl under a different prefix, perhaps
34 # in order to test a different configuration.
35 case "\$prefix" in
36 '') prefix='$prefix' ;;
37 esac
38
39 # Installation directives.  Note that each one comes in three flavors.
40 # For example, we have privlib, privlibexp, and installprivlib.
41 # privlib is for private (to perl) library files.
42 # privlibexp is the same, except any '~' the user gave to Configure
43 #     is expanded to the user's home directory.  This is figured
44 #     out automatically by Configure, so you don't have to include it here.
45 # installprivlib is for systems (such as those running AFS) that
46 #     need to distinguish between the place where things
47 #     get installed and where they finally will reside.
48
49 # In each case, if your previous value was the default, leave it commented
50 # out.  That way, if you override prefix, all of these will be
51 # automatically adjusted.
52 #
53 # WARNING:  Be especially careful about architecture-dependent and
54 # version-dependent names, particularly if you reuse this file for
55 # different versions of perl.
56
57 !GROK!THIS!
58
59 for var in bin scriptdir privlib archlib \
60         man1dir man3dir sitelib sitearch \
61         installbin installscript installprivlib installarchlib \
62         installman1dir installman3dir installsitelib installsitearch \
63         man1ext man3ext; do
64         
65     case "$var" in
66     bin)        dflt=$prefix/bin ;;
67     # The scriptdir test is more complex, but this is probably usually ok.
68     scriptdir)
69         if $test -d $prefix/script; then
70             dflt=$prefix/script
71         else
72             dflt=$bin
73         fi
74         ;;
75     privlib)
76         case "$prefix" in
77         *perl*) dflt=$prefix/lib/$version ;;
78         *)      dflt=$prefix/lib/$package/$version ;;
79         esac
80         ;;
81     archlib)    
82         case "$prefix" in
83         *perl*) dflt=$prefix/lib/$version/$archname ;;
84         *)      dflt=$prefix/lib/$package/$version/$archname ;;
85         esac
86         ;;
87     sitelib)
88         case "$prefix" in
89         *perl*) dflt=$prefix/lib/site_perl/$apiversion ;;
90         *)      dflt=$prefix/lib/$package/site_perl/$apiversion ;;
91         esac
92         ;;
93     sitearch)   
94         case "$prefix" in
95         *perl*) dflt=$prefix/lib/site_perl/$apiversion/$archname ;;
96         *)      dflt=$prefix/lib/$package/site_perl/$apiversion/$archname ;;
97         esac
98         ;;
99     man1dir)    dflt="$prefix/man/man1" ;;
100     man3dir)
101         case "$prefix" in
102         *perl*) dflt=`echo $man1dir |
103                     sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
104         *)      dflt=$privlib/man/man3 ;;
105         esac
106         ;;
107
108     # Can we assume all sed's have greedy matching?
109     man1ext)    dflt=`echo $man1dir | sed -e 's!.*man!!' -e 's!^\.!!'` ;;
110     man3ext)    dflt=`echo $man3dir | sed -e 's!.*man!!' -e 's!^\.!!'` ;;
111
112     # It might be possible to fool these next tests.  Please let
113     # me know if they don't work right for you.
114     installbin)         dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
115     installscript)      dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
116     installprivlib)     dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
117     installarchlib)     dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
118     installsitelib)     dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
119     installsitearch)    dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
120     installman1dir)     dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
121     installman3dir)     dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
122     esac
123     
124     eval val="\$$var"
125     if test X"$val" = X"$dflt"; then
126         echo "# $var='$dflt'"
127     else
128         echo "# Preserving custom $var"
129         echo "$var='$val'"
130     fi
131
132 done >> Policy.sh
133
134 $spitshell <<!GROK!THIS! >>Policy.sh
135
136 #  Lastly, you may add additional items here.  For example, to set the
137 #  pager to your local favorite value, uncomment the following line in
138 #  the original Policy_sh.SH file and re-run   sh Policy_sh.SH.
139 #
140 #  pager='$pager'
141 #
142 #  A full Glossary of all the config.sh variables is in the file
143 #  Porting/Glossary.
144
145 !GROK!THIS!
146
147 #Credits:
148 #   The original design for this Policy.sh file came from Wayne Davison,
149 #   maintainer of trn.
150 #   This version for Perl5.004_61 originally written by
151 #   Andy Dougherty <doughera@lafcol.lafayette.edu>.
152 #   This file may be distributed under the same terms as Perl itself.
153