home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / Policy_sh.SH < prev    next >
Text File  |  2000-02-25  |  6KB  |  211 lines

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