This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
so back to 'so', from Stephanie Beals <bealzy@us.ibm.com>
[perl5.git] / Policy_sh.SH
CommitLineData
2000072c 1case $CONFIGDOTSH in
85364e4e
MB
2'') . ./config.sh ;;
3esac
4echo "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
693762b4
AD
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.
85364e4e
MB
13#
14# The idea here is to distill in one place the common site-wide
15# "policy" answers (such as installation directories) that are
dc45a647 16# to be "sticky". If you keep the file Policy.sh around in
85364e4e
MB
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.
dc45a647 20#
85364e4e 21
dc45a647
MB
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.
85364e4e 25
dc45a647 26#Site-specific values:
85364e4e 27
dc45a647
MB
28case "\$perladmin" in
29'') perladmin='$perladmin' ;;
30esac
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.
35case "\$prefix" in
36'') prefix='$prefix' ;;
37esac
85364e4e
MB
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.
c4f23d77 42# privlibexp is the same, except any '~' the user gave to Configure
85364e4e 43# is expanded to the user's home directory. This is figured
dc45a647 44# out automatically by Configure, so you don't have to include it here.
85364e4e
MB
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.
dc45a647
MB
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.
693762b4 52#
3a6175e1 53# WARNING: Be especially careful about architecture-dependent and
dc45a647
MB
54# version-dependent names, particularly if you reuse this file for
55# different versions of perl.
693762b4
AD
56
57!GROK!THIS!
58
dc45a647
MB
59for 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.
c4f23d77
AD
68 scriptdir)
69 if $test -d $prefix/script; then
70 dflt=$prefix/script
71 else
72 dflt=$bin
73 fi
74 ;;
dc45a647
MB
75 privlib)
76 case "$prefix" in
3a6175e1
AD
77 *perl*) dflt=$prefix/lib/$version ;;
78 *) dflt=$prefix/lib/$package/$version ;;
bfb7748a
AD
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
3a6175e1
AD
89 *perl*) dflt=$prefix/lib/site_perl/$apiversion ;;
90 *) dflt=$prefix/lib/$package/site_perl/$apiversion ;;
bfb7748a
AD
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 ;;
dc45a647
MB
97 esac
98 ;;
dc45a647
MB
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'` ;;
c4f23d77 104 *) dflt=$privlib/man/man3 ;;
dc45a647
MB
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"
dc45a647
MB
129 echo "$var='$val'"
130 fi
131
132done >> Policy.sh
693762b4
AD
133
134$spitshell <<!GROK!THIS! >>Policy.sh
135
dc45a647 136# Lastly, you may add additional items here. For example, to set the
693762b4
AD
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.
dc45a647
MB
139#
140# pager='$pager'
693762b4
AD
141#
142# A full Glossary of all the config.sh variables is in the file
143# Porting/Glossary.
85364e4e
MB
144
145!GROK!THIS!
3a6175e1
AD
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