This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Configure regen to pick up the new installation 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 prefixes.  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 case "\$siteprefix" in
39 '') siteprefix='$siteprefix' ;;
40 esac
41 case "\$vendorprefix" in
42 '') vendorprefix='$vendorprefix' ;;
43 esac
44
45 # Where installperl puts things.
46 case "\$installprefix" in
47 '') installprefix='$installprefix' ;;
48 esac
49
50 # Installation directives.  Note that each one comes in three flavors.
51 # For example, we have privlib, privlibexp, and installprivlib.
52 # privlib is for private (to perl) library files.
53 # privlibexp is the same, except any '~' the user gave to Configure
54 #     is expanded to the user's home directory.  This is figured
55 #     out automatically by Configure, so you don't have to include it here.
56 # installprivlib is for systems (such as those running AFS) that
57 #     need to distinguish between the place where things
58 #     get installed and where they finally will reside.  As of 5.005_6x,
59 #     this too is handled automatically by Configure based on
60 #     $installprefix, so it isn't included here either.
61 #
62 #  See Porting/Glossary for the definitions of these names, and see the
63 #  INSTALL file for some examples.
64
65 # In each case, if your previous value was the default, leave it commented
66 # out.  That way, if you override prefix, all of these will be
67 # automatically adjusted.
68 #
69 # WARNING:  Be especially careful about architecture-dependent and
70 # version-dependent names, particularly if you reuse this file for
71 # different versions of perl.
72
73 !GROK!THIS!
74
75 for var in \
76         bin scriptdir privlib archlib man1dir man3dir html1dir html3dir \
77         sitebin sitescriptdir sitelib sitearch \
78                 siteman1dir siteman3dir sitehtml1dir sitehtml3dir \
79         vendorbin vendorscript vendorlib vendorarch \
80                 vendorman1 vendorman3 vendorhtml1 vendorhtml3
81 do
82         
83     case "$var" in
84
85     # Directories for the core perl components
86     bin)        dflt=$prefix/bin ;;
87     # The scriptdir test is more complex, but this is probably usually ok.
88     scriptdir)
89         if $test -d $prefix/script; then
90             dflt=$prefix/script
91         else
92             dflt=$bin
93         fi
94         ;;
95     privlib)
96         case "$prefix" in
97         *perl*) dflt=$prefix/lib/$version ;;
98         *)      dflt=$prefix/lib/$package/$version ;;
99         esac
100         ;;
101     archlib)    dflt="$privlib/$archname" ;;
102
103     man1dir)    dflt="$prefix/man/man1" ;;
104     man3dir)    dflt="$prefix/man/man3" ;;
105     # Can we assume all sed's have greedy matching?
106     man1ext)    dflt=`echo $man1dir | sed -e 's!.*man!!' -e 's!^\.!!'` ;;
107     man3ext)    dflt=`echo $man3dir | sed -e 's!.*man!!' -e 's!^\.!!'` ;;
108
109     # We don't know what to do with these yet.
110     html1dir)   dflt='' ;;
111     htm31dir)   dflt='' ;;
112
113     # Site-specific add-ons.
114     sitebin)    dflt=$siteprefix/bin ;;
115     # The scriptdir test is more complex, but this is probably usually ok.
116     sitescriptdir)
117         if $test -d $siteprefix/script; then
118             dflt=$siteprefix/script
119         else
120             dflt=$sitebin
121         fi
122         ;;
123     sitelib)
124         case "$siteprefix" in
125         *perl*) dflt=$prefix/lib/site_perl ;;
126         *)      dflt=$prefix/lib/$package/site_perl ;;
127         esac
128         ;;
129     sitearch)   dflt="$sitelib/$apiversion/$archname" ;;
130
131     siteman1dir)        dflt="$siteprefix/man/man1" ;;
132     siteman3dir)        dflt="$siteprefix/man/man3" ;;
133     # We don't know what to do with these yet.
134     sitehtml1dir)       dflt='' ;;
135     sitehtm31dir)       dflt='' ;;
136     
137     # Vendor-specific add-ons.  These are all usually empty.
138     vendor*)
139         if test X"$vendorprefix" = X""; then
140             dflt=''
141         else
142             case "$var" in
143             vendorbin)  dflt=$vendorprefix/bin ;;
144
145             # The scriptdir test is more complex, 
146             # but this is probably usually ok.
147             vendorscriptdir)
148                 if $test -d $vendorprefix/script; then
149                     dflt=$vendorprefix/script
150                 else
151                     dflt=$vendorbin
152                 fi
153                 ;;
154             vendorlib)
155                 case "$vendorprefix" in
156                 *perl*) dflt=$prefix/lib/vendor_perl ;;
157                 *)      dflt=$prefix/lib/$package/vendor_perl ;;
158                 esac
159                 ;;
160             vendorarch) dflt="$vendorlib/$apiversion/$archname" ;;
161
162             vendorman1dir)      dflt="$vendorprefix/man/man1" ;;
163             vendorman3dir)      dflt="$vendorprefix/man/man3" ;;
164             # We don't know what to do with these yet.
165             vendorhtml1dir)     dflt='' ;;
166             vendorhtm31dir)     dflt='' ;;
167
168             esac  # End of vendorprefix != ''
169         fi
170         ;;
171     esac
172     
173     eval val="\$$var"
174     if test X"$val" = X"$dflt"; then
175         echo "# $var='$dflt'"
176     else
177         echo "# Preserving custom $var"
178         echo "$var='$val'"
179     fi
180
181 done >> Policy.sh
182
183 $spitshell <<!GROK!THIS! >>Policy.sh
184
185 #  Lastly, you may add additional items here.  For example, to set the
186 #  pager to your local favorite value, uncomment the following line in
187 #  the original Policy_sh.SH file and re-run   sh Policy_sh.SH.
188 #
189 #  pager='$pager'
190 #
191 #  A full Glossary of all the config.sh variables is in the file
192 #  Porting/Glossary.
193
194 !GROK!THIS!
195
196 #Credits:
197 #   The original design for this Policy.sh file came from Wayne Davison,
198 #   maintainer of trn.
199 #   This version for Perl5.004_61 originally written by
200 #   Andy Dougherty <doughera@lafcol.lafayette.edu>.
201 #   This file may be distributed under the same terms as Perl itself.