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