home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / perl5 / perl5_003.pat-gz / perl5_003.pat
Text File  |  1996-06-24  |  341KB  |  11,149 lines

  1. #!/bin/sh
  2. #
  3. #    This is patch 5.003 for Perl.
  4. #
  5. #    Apply over Perl 5.002_01 using patch -p1 -N.
  6. #    (If you're using a version of Perl prior to 5.002_01, it's
  7. #    probably easier for you to start with a fresh copy of Perl
  8. #    5.003, which can be obtained from any CPAN site.  A list of
  9. #    CPAN sites is available from http://perl.com/CPAN.)
  10. #
  11. #    This patch makes the following changes to Perl 5.002_01:
  12. #      1. Fixes a security bug in the handling of setuid
  13. #         programs on some systems.
  14. #      2. Updates MakeMaker to version 5.34.
  15. #      3. Fixes a bug which caused real numbers between
  16. #         0 and -1 to be incorrectly optimized to ints
  17. #         in comparisons.
  18. #      4. Updates Makefile.PLs for standard extensions to
  19. #         conform to the current version of MakeMaker.
  20. #      5. Updates hints files for BSD/OS, HP-UX, Linux,
  21. #         MachTen, and Solaris.
  22. #      6. Updates VMS-specific to handling of file
  23. #         specification strings.
  24. #      7. Fixes a bug in installperl which left installed
  25. #         C header files with the wrong permissions.
  26. #    Information on changes to each file is at the head of the diff
  27. #    for that file.  You can extract them using grep '^#:'.
  28.  
  29. exit 0  # in case this file is fed to /bin/sh
  30.  
  31.  
  32. #: INSTALL:
  33. #:   Include $shrpdir in the list of installation directories.
  34. #:   Update comments on using GNU as/ld under SunOS and Solaris
  35. diff -crN perl5.002_01/INSTALL perl5.003/INSTALL
  36. *** perl5.002_01/INSTALL    Mon Mar 25 01:04:10 1996
  37. --- perl5.003/INSTALL    Mon Jun 24 16:07:53 1996
  38. ***************
  39. *** 312,317 ****
  40. --- 312,318 ----
  41.       installscript=`echo $installscript | sed "s!$prefix!$installprefix!"`
  42.       installsitelib=`echo $installsitelib | sed "s!$prefix!$installprefix!"`
  43.       installsitearch=`echo $installsitearch | sed "s!$prefix!$installprefix!"`
  44. +     shrpdir=`echo $shrpdir | sed "s!$prefix!$installprefix!"`
  45.   
  46.   Then, you can Configure and install in the usual way:
  47.   
  48. ***************
  49. *** 536,544 ****
  50.   and i_varags='undef' in config.sh.  The problem is usually solved
  51.   by running fixincludes correctly.
  52.   
  53. ! If you wish to use dynamic loading on SunOS or Solaris, and you
  54. ! have GNU as and GNU ld installed, you may need to add B<-B/bin/> to
  55. ! your $ccflags and $ldflags so that the system's versions of as
  56.   and ld are used.
  57.   
  58.   If you run into dynamic loading problems, check your setting of
  59. --- 537,546 ----
  60.   and i_varags='undef' in config.sh.  The problem is usually solved
  61.   by running fixincludes correctly.
  62.   
  63. ! If you have problems with dynamic loading using gcc on SunOS or
  64. ! Solaris, and you are using GNU as and GNU ld, you may need to add
  65. ! B<-B/bin/> (for SunOS) or B<-B/usr/ccs/bin> (for Solaris) to your
  66. ! $ccflags, $ldflags, and $lddlflags so that the system's versions of as
  67.   and ld are used.
  68.   
  69.   If you run into dynamic loading problems, check your setting of
  70.  
  71.  
  72. #: ext/DynaLoader/Makefile.PL:
  73. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  74. diff -crN perl5.002_01/ext/DynaLoader/Makefile.PL perl5.003/ext/DynaLoader/Makefile.PL
  75. *** perl5.002_01/ext/DynaLoader/Makefile.PL    Wed Jan 31 13:26:40 1996
  76. --- perl5.003/ext/DynaLoader/Makefile.PL    Sun Jun 23 22:07:51 1996
  77. ***************
  78. *** 1,6 ****
  79. --- 1,7 ----
  80.   use ExtUtils::MakeMaker;
  81.   
  82.   WriteMakefile(
  83. +     NAME    => 'DynaLoader',
  84.       LINKTYPE    => 'static',
  85.       DEFINE    => '-DLIBC="$(LIBC)"',
  86.       MAN3PODS     => ' ',     # Pods will be built by installman.
  87.  
  88.  
  89. #: ext/Fcntl/Makefile.PL:
  90. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  91. diff -crN perl5.002_01/ext/Fcntl/Makefile.PL perl5.003/ext/Fcntl/Makefile.PL
  92. *** perl5.002_01/ext/Fcntl/Makefile.PL    Wed Jan 31 13:27:05 1996
  93. --- perl5.003/ext/Fcntl/Makefile.PL    Sun Jun 23 22:08:33 1996
  94. ***************
  95. *** 1,5 ****
  96. --- 1,6 ----
  97.   use ExtUtils::MakeMaker;
  98.   WriteMakefile(
  99. +     NAME     => 'Fcntl',
  100.       MAN3PODS     => ' ',     # Pods will be built by installman.
  101.       XSPROTOARG => '-noprototypes',         # XXX remove later?
  102.       VERSION_FROM => 'Fcntl.pm',
  103.  
  104.  
  105. #: ext/FileHandle/Makefile.PL:
  106. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  107. diff -crN perl5.002_01/ext/FileHandle/Makefile.PL perl5.003/ext/FileHandle/Makefile.PL
  108. *** perl5.002_01/ext/FileHandle/Makefile.PL    Mon Feb 12 14:50:53 1996
  109. --- perl5.003/ext/FileHandle/Makefile.PL    Sun Jun 23 22:08:59 1996
  110. ***************
  111. *** 1,5 ****
  112. --- 1,6 ----
  113.   use ExtUtils::MakeMaker;
  114.   WriteMakefile(
  115. +     NAME    => 'FileHandle',
  116.       MAN3PODS   => ' ',            # Pods will be built by installman.
  117.       XSPROTOARG => '-noprototypes',     # XXX remove later?
  118.       VERSION_FROM => 'FileHandle.pm',
  119. diff -crN perl5.002_01/ext/GDBM_File/Makefile.PL perl5.003/ext/GDBM_File/Makefile.PL
  120.  
  121.  
  122. #: ext/GDBM_File/Makefile.PL:
  123. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  124. *** perl5.002_01/ext/GDBM_File/Makefile.PL    Wed Jan 31 13:27:27 1996
  125. --- perl5.003/ext/GDBM_File/Makefile.PL    Sun Jun 23 22:09:34 1996
  126. ***************
  127. *** 1,5 ****
  128. --- 1,6 ----
  129.   use ExtUtils::MakeMaker;
  130.   WriteMakefile(
  131. +     NAME => 'GDBM_File',
  132.       LIBS => ["-L/usr/local/lib -lgdbm", "-ldbm"],
  133.       MAN3PODS     => ' ',     # Pods will be built by installman.
  134.       XSPROTOARG => '-noprototypes',         # XXX remove later?
  135.  
  136.  
  137. #: ext/NDBM_File/Makefile.PL:
  138. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  139. diff -crN perl5.002_01/ext/NDBM_File/Makefile.PL perl5.003/ext/NDBM_File/Makefile.PL
  140. *** perl5.002_01/ext/NDBM_File/Makefile.PL    Wed Jan 31 13:27:46 1996
  141. --- perl5.003/ext/NDBM_File/Makefile.PL    Sun Jun 23 22:10:04 1996
  142. ***************
  143. *** 1,5 ****
  144. --- 1,6 ----
  145.   use ExtUtils::MakeMaker;
  146.   WriteMakefile(
  147. +     NAME    => 'NDBM_File',
  148.       LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb"],
  149.       MAN3PODS     => ' ',     # Pods will be built by installman.
  150.       XSPROTOARG => '-noprototypes',         # XXX remove later?
  151.  
  152.  
  153. #: ext/NDBM_File/NDBM_File.pm:
  154. #:   C<use strict> with Perl 5.002 or later to avoid confusing warnings
  155. #:   if installed in a library also used by Perl 5.001m.  (It still won't
  156. #:   work with 5,001m, but the error message now states this more clearly.)
  157. diff -crN perl5.002_01/ext/NDBM_File/NDBM_File.pm perl5.003/ext/NDBM_File/NDBM_File.pm
  158. *** perl5.002_01/ext/NDBM_File/NDBM_File.pm    Wed Feb 14 21:14:26 1996
  159. --- perl5.003/ext/NDBM_File/NDBM_File.pm    Mon Jun 24 16:07:53 1996
  160. ***************
  161. *** 1,6 ****
  162.   package NDBM_File;
  163.   
  164. ! use strict;
  165.   use vars qw($VERSION @ISA); 
  166.   
  167.   require Tie::Hash;
  168. --- 1,10 ----
  169.   package NDBM_File;
  170.   
  171. ! BEGIN {
  172. !     if ($] >= 5.002) {
  173. !     use strict;
  174. !     }
  175. ! }
  176.   use vars qw($VERSION @ISA); 
  177.   
  178.   require Tie::Hash;
  179.  
  180.  
  181. #: ext/ODBM_File/Makefile.PL:
  182. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  183. diff -crN perl5.002_01/ext/ODBM_File/Makefile.PL perl5.003/ext/ODBM_File/Makefile.PL
  184. *** perl5.002_01/ext/ODBM_File/Makefile.PL    Wed Jan 31 13:28:05 1996
  185. --- perl5.003/ext/ODBM_File/Makefile.PL    Sun Jun 23 22:10:27 1996
  186. ***************
  187. *** 1,5 ****
  188. --- 1,6 ----
  189.   use ExtUtils::MakeMaker;
  190.   WriteMakefile(
  191. +     NAME    => 'ODBM_File',
  192.       LIBS => ["-ldbm -lucb"],
  193.       MAN3PODS     => ' ',     # Pods will be built by installman.
  194.       XSPROTOARG => '-noprototypes',         # XXX remove later?
  195.  
  196.  
  197. #: ext/POSIX/Makefile.PL:
  198. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  199. diff -crN perl5.002_01/ext/POSIX/Makefile.PL perl5.003/ext/POSIX/Makefile.PL
  200. *** perl5.002_01/ext/POSIX/Makefile.PL    Wed Jan 31 13:28:25 1996
  201. --- perl5.003/ext/POSIX/Makefile.PL    Sun Jun 23 23:47:59 1996
  202. ***************
  203. *** 1,6 ****
  204.   use ExtUtils::MakeMaker;
  205.   WriteMakefile(
  206. !     LIBS => ["-lm -lposix -lcposix"],
  207.       MAN3PODS     => ' ',     # Pods will be built by installman.
  208.       XSPROTOARG => '-noprototypes',         # XXX remove later?
  209.       VERSION_FROM => 'POSIX.pm', 
  210. --- 1,7 ----
  211.   use ExtUtils::MakeMaker;
  212.   WriteMakefile(
  213. !     NAME    => 'POSIX',
  214. !     LIBS    => ["-lm -lposix -lcposix"],
  215.       MAN3PODS     => ' ',     # Pods will be built by installman.
  216.       XSPROTOARG => '-noprototypes',         # XXX remove later?
  217.       VERSION_FROM => 'POSIX.pm', 
  218.  
  219.  
  220. #: ext/SDBM_File/Makefile.PL:
  221. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  222. diff -crN perl5.002_01/ext/SDBM_File/Makefile.PL perl5.003/ext/SDBM_File/Makefile.PL
  223. *** perl5.002_01/ext/SDBM_File/Makefile.PL    Wed Jan 31 13:28:45 1996
  224. --- perl5.003/ext/SDBM_File/Makefile.PL    Sun Jun 23 22:11:07 1996
  225. ***************
  226. *** 6,11 ****
  227. --- 6,12 ----
  228.   # which perform the corresponding actions in the subdirectory.
  229.   
  230.   WriteMakefile(
  231. +     NAME    => 'SDBM_File',
  232.       MYEXTLIB => 'sdbm/libsdbm$(LIB_EXT)',
  233.       MAN3PODS     => ' ',     # Pods will be built by installman.
  234.       XSPROTOARG => '-noprototypes',         # XXX remove later?
  235.  
  236.  
  237. #: ext/SDBM_File/sdbm/Makefile.PL:
  238. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  239. diff -crN perl5.002_01/ext/SDBM_File/sdbm/Makefile.PL perl5.003/ext/SDBM_File/sdbm/Makefile.PL
  240. *** perl5.002_01/ext/SDBM_File/sdbm/Makefile.PL    Sat Jan 20 00:56:27 1996
  241. --- perl5.003/ext/SDBM_File/sdbm/Makefile.PL    Sun Jun 23 22:11:45 1996
  242. ***************
  243. *** 1,5 ****
  244. --- 1,6 ----
  245.   use ExtUtils::MakeMaker;
  246.   WriteMakefile(
  247. +     'NAME'    => 'SDBM_File',
  248.       'LINKTYPE'  => 'static',
  249.       'DEFINE'    => '-DSDBM -DDUFF',
  250.       'SKIP'    => [qw(static static_lib dynamic dynamic_lib)],
  251.  
  252.  
  253. #: ext/Safe/Makefile.PL:
  254. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  255. diff -crN perl5.002_01/ext/Safe/Makefile.PL perl5.003/ext/Safe/Makefile.PL
  256. *** perl5.002_01/ext/Safe/Makefile.PL    Wed Jan 31 13:29:04 1996
  257. --- perl5.003/ext/Safe/Makefile.PL    Sun Jun 23 22:12:21 1996
  258. ***************
  259. *** 1,5 ****
  260. --- 1,6 ----
  261.   use ExtUtils::MakeMaker;
  262.   WriteMakefile(
  263. +     NAME    => 'Safe',
  264.       MAN3PODS     => ' ',     # Pods will be built by installman.
  265.       XSPROTOARG => '-noprototypes',         # XXX remove later?
  266.       VERSION_FROM => 'Safe.pm',
  267.  
  268.  
  269. #: ext/Socket/Makefile.PL:
  270. #:   Add NAME attribute to suppress MakeMaker "guess" warning
  271. diff -crN perl5.002_01/ext/Socket/Makefile.PL perl5.003/ext/Socket/Makefile.PL
  272. *** perl5.002_01/ext/Socket/Makefile.PL    Wed Jan 31 13:29:20 1996
  273. --- perl5.003/ext/Socket/Makefile.PL    Sun Jun 23 22:12:44 1996
  274. ***************
  275. *** 1,5 ****
  276. --- 1,6 ----
  277.   use ExtUtils::MakeMaker;
  278.   WriteMakefile(
  279. +     NAME    => 'Socket',
  280.       VERSION_FROM => 'Socket.pm',
  281.       MAN3PODS     => ' ',     # Pods will be built by installman.
  282.       XSPROTOARG => '-noprototypes',         # XXX remove later?
  283.  
  284.  
  285. #: hints/bsdos.sh
  286. #:   Distinguish between 2.0.x and 2.1.x, and use dynamic linking
  287. #:   in the latter
  288. diff -crN perl5.002_01/hints/bsdos.sh perl5.003/hints/bsdos.sh
  289. *** perl5.002_01/hints/bsdos.sh    Mon Mar 25 01:04:08 1996
  290. --- perl5.003/hints/bsdos.sh    Mon Jun 24 16:49:28 1996
  291. ***************
  292. *** 49,75 ****
  293.       '')    cc='gcc2' ;;
  294.       esac
  295.       ;;
  296. ! 2.*)
  297. !     case "$osvers" in
  298. !     2.1*)    # dlopen() is supported in 2.1
  299. !         usedl='true'
  300. !         d_dlopen='define'
  301. !         cccdlflags='none'
  302. !         # pre-link against the shared C library
  303. !         lddlflags='-r -lc_s.2.1.0'
  304. !         # BSD/OS 2.1 doesn't (yet) support `true' dynamic linking
  305. !         # so we `preload' the shared libraries by linking
  306. !         # against them; even though we don't pull in any symbols.
  307. !         libswanted="Xpm Xaw Xmu Xt SM ICE Xext X11 $libswanted"
  308. !         libswanted="rpc curses termcap $libswanted"
  309. !         # Use the system malloc or else you'll have dualing mallocs!
  310. !         d_mymalloc='undef'
  311. !         usemymalloc='n'
  312. !         ;;
  313. !     esac
  314.       # default to GCC 2.X w/shared libraries
  315.       case "$cc" in
  316.       '')    cc='shlicc2' ;;
  317. --- 49,55 ----
  318.       '')    cc='gcc2' ;;
  319.       esac
  320.       ;;
  321. ! 2.0*)
  322.       # default to GCC 2.X w/shared libraries
  323.       case "$cc" in
  324.       '')    cc='shlicc2' ;;
  325. ***************
  326. *** 83,88 ****
  327. --- 63,96 ----
  328.       # setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS stuff
  329.       # in 4.4BSD-based systems (including BSD/OS 2.0 and later).
  330.       # See http://www.bsdi.com/bsdi-man?setuid(2)
  331. +     d_setregid='undef'
  332. +     d_setreuid='undef'
  333. +     d_setrgid='undef'
  334. +     d_setruid='undef'
  335. +     ;;
  336. + 2.1*)
  337. +     # Use 2.1's shlicc2 for dynamic linking
  338. +     # Since cc -o is linking, use it for compiling too.
  339. +     # I'm not sure whether Configure is careful about
  340. +     # distinguishing between the two.
  341. +     case "$cc" in
  342. +     '')    cc='shlicc2'
  343. +         cccdlflags=' ' ;; # Avoid the dreaded -fpic
  344. +     esac
  345. +     # Link with shared libraries in 2.1
  346. +     # Turns out that shlicc2 will automatically use the
  347. +     # shared libs, so don't explicitly specify -lc_s.2.1.*
  348. +     case "$ld" in
  349. +     '')    ld='shlicc2'
  350. +         lddlflags='-r' ;; # this one is necessary
  351. +     esac
  352. +     # setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS  stuff
  353. +     # in 4.4BSD-based systems (including BSD/OS 2.0 and later).
  354. +     # See http://www.bsdi.com/bsdi-man?setuid(2)
  355. +     # This stuff may or may not be right, but it works.
  356.       d_setregid='undef'
  357.       d_setreuid='undef'
  358.       d_setrgid='undef'
  359.  
  360.  
  361. #: hints/hpux.sh:
  362. #:   Make deferred loading of shared libraries the default
  363. diff -crN perl5.002_01/hints/hpux.sh perl5.003/hints/hpux.sh
  364. *** perl5.002_01/hints/hpux.sh    Tue Feb 27 18:46:35 1996
  365. --- perl5.003/hints/hpux.sh    Mon Jun 24 16:49:34 1996
  366. ***************
  367. *** 94,104 ****
  368.   set `echo " $libswanted " | sed  -e 's@ ld @ @' -e 's@ dbm @ @' -e 's@ BSD @ @' -e 's@ PW @ @'`
  369.   libswanted="$*"
  370.   
  371. ! # If you copy the perl binaries to other systems and the dynamic loader
  372. ! # complains about missing libraries, you can either copy the shared libraries
  373. ! # or switch the comments to recompile perl to use archive libraries
  374. ! # ccdlflags="-Wl,-E -Wl,-a,archive $ccdlflags"
  375. ! ccdlflags="-Wl,-E $ccdlflags"
  376.   
  377.   usemymalloc='y'
  378.   alignbytes=8
  379. --- 94,107 ----
  380.   set `echo " $libswanted " | sed  -e 's@ ld @ @' -e 's@ dbm @ @' -e 's@ BSD @ @' -e 's@ PW @ @'`
  381.   libswanted="$*"
  382.   
  383. ! # By setting the deferred flag below, this means that if you run perl on a
  384. ! # system that does not have the required shared library that you linked it
  385. ! # with, it will die when you try to access a symbol in the (missing) shared
  386. ! # library.  If you would rather know at perl startup time that you are
  387. ! # missing an important shared library, switch the comments so that immediate,
  388. ! # rather than deferred loading is performed.
  389. ! # ccdlflags="-Wl,-E $ccdlflags"
  390. ! ccdlflags="-Wl,-E -Wl,-B,deferred $ccdlflags"
  391.   
  392.   usemymalloc='y'
  393.   alignbytes=8
  394.  
  395.  
  396. #: hints/linux.sh:
  397. #:   Allow Configure to determine malloctype
  398. #:   Don't mess with $nm_so_opt
  399. #:   Make sure messages get to the right places
  400. #:   Disable NDBM, since some systems have problems with the libraries
  401. #:   Don't use gcvt() to print floats; it's buggy in some versions of libc
  402. diff -crN perl5.002_01/hints/linux.sh perl5.003/hints/linux.sh
  403. *** perl5.002_01/hints/linux.sh    Mon Mar 25 01:04:09 1996
  404. --- perl5.003/hints/linux.sh    Mon Jun 24 16:07:53 1996
  405. ***************
  406. *** 9,15 ****
  407.   # Consolidated by Andy Dougherty <doughera@lafcol.lafayette.edu>
  408.   #
  409.   # Updated Thu Feb  8 11:56:10 EST 1996
  410. ! # Add ability to use command-line overrides for optinal settings.
  411.   
  412.   # perl goes into the /usr tree.  See the Filesystem Standard
  413.   # available via anonymous FTP at tsx-11.mit.edu in
  414. --- 9,19 ----
  415.   # Consolidated by Andy Dougherty <doughera@lafcol.lafayette.edu>
  416.   #
  417.   # Updated Thu Feb  8 11:56:10 EST 1996
  418. ! # Updated Thu May 30 10:50:22 EDT 1996 by <doughera@lafcol.lafayette.edu>
  419. ! # Updated Fri Jun 21 11:07:54 EDT 1996
  420. ! # NDBM support for ELF renabled by <kjahds@kjahds.com>
  421.   
  422.   # perl goes into the /usr tree.  See the Filesystem Standard
  423.   # available via anonymous FTP at tsx-11.mit.edu in
  424. ***************
  425. *** 19,25 ****
  426.   '') prefix='/usr' ;;
  427.   esac
  428.   
  429. - # This may not be needed in 5.002 since sigaction is used.
  430.   # gcc-2.6.3 defines _G_HAVE_BOOL to 1, but doesn't actually supply bool.
  431.   ccflags="-Dbool=char -DHAS_BOOL $ccflags"
  432.   
  433. --- 23,28 ----
  434. ***************
  435. *** 32,40 ****
  436.   # function in <sys/stat.h>.
  437.   d_lstat=define
  438.   
  439. - # I think Configure gets this right now, but I'd appreciate reports.
  440. - malloctype='void *'
  441.   # Explanation?
  442.   case "$usemymalloc" in
  443.   '') usemymalloc='n' ;;
  444. --- 35,40 ----
  445. ***************
  446. *** 64,76 ****
  447.   }
  448.   EOM
  449.   if ${cc:-gcc} try.c >/dev/null 2>&1 && ./a.out; then
  450. !     cat <<'EOM'
  451.   
  452.   You appear to have ELF support.  I'll try to use it for dynamic loading.
  453.   EOM
  454. !     nm_so_opt='-dynamic'
  455.   else
  456. !     cat <<'EOM'
  457.   
  458.   You don't have an ELF gcc.  I will use dld if possible.  If you are
  459.   using a version of DLD earlier than 3.2.6, or don't have it at all, you
  460. --- 64,81 ----
  461.   }
  462.   EOM
  463.   if ${cc:-gcc} try.c >/dev/null 2>&1 && ./a.out; then
  464. !     cat <<'EOM' >&4
  465.   
  466.   You appear to have ELF support.  I'll try to use it for dynamic loading.
  467. + If dynamic loading doesn't work, read hints/linux.sh for further information.
  468.   EOM
  469. ! #For RedHat Linux 3.0.3, you may need to fetch
  470. ! # ftp://ftp.redhat.com/pub/redhat-3.0.3/i386/updates/RPMS/ld.so-1.7.14-3.i386.rpm
  471. ! #
  472.   else
  473. !     cat <<'EOM' >&4
  474.   
  475.   You don't have an ELF gcc.  I will use dld if possible.  If you are
  476.   using a version of DLD earlier than 3.2.6, or don't have it at all, you
  477. ***************
  478. *** 92,136 ****
  479.       ## uncomment the next two lines:
  480.       #ldflags="-static"
  481.       #so='none'
  482.   fi
  483.   
  484.   rm -f try.c a.out
  485.   
  486.   if /bin/bash -c exit; then
  487.     echo You appear to have a working bash. Good.
  488.   else
  489. !   cat << 'EOM'
  490. ! Warning: it would appear you have a defective bash shell installed. This is
  491. ! likely to give you a failure of op/exec test #5 during the test phase of the
  492. ! build, Upgrading to a recent version (1.14.4 or later) should fix the
  493. ! problem.
  494.   
  495.   EOM
  496.   
  497.   fi
  498.   
  499. ! # In addition, on some systems there is a problem with perl and NDBM, which
  500. ! # causes AnyDBM and NDBM_File to lock up. This is evidenced in the tests as
  501. ! # AnyDBM just freezing.  Currently we disable NDBM for all linux systems.
  502. ! # If someone can suggest a more robust test, that would be appreciated.
  503.   #
  504. ! # More info:
  505. ! # Date: Wed, 7 Feb 1996 03:21:04 +0900
  506. ! # From: Jeffrey Friedl <jfriedl@nff.ncl.omron.co.jp>
  507. ! #
  508. ! # I tried compiling with DBM support and sure enough things locked up
  509. ! # just as advertised. Checking into it, I found that the lockup was
  510. ! # during the call to dbm_open. Not *in* dbm_open -- but between the call
  511. ! # to and the jump into.
  512.   # 
  513. ! # To make a long story short, making sure that the *.a and *.sa pairs of
  514. ! #   /usr/lib/lib{m,db,gdbm}.{a,sa}
  515. ! # were perfectly in sync took care of it.
  516. ! #
  517. ! # This will generate a harmless message:
  518. ! # Hmm...You had some extra variables I don't know about...I'll try to keep 'em.
  519. ! #    Propagating recommended variable d_dbm_open
  520. ! case "$d_dbm_open" in
  521. ! '') d_dbm_open=undef ;;
  522. ! esac
  523.   
  524. --- 97,163 ----
  525.       ## uncomment the next two lines:
  526.       #ldflags="-static"
  527.       #so='none'
  528. +     # In addition, on some systems there is a problem with perl and NDBM
  529. +     # which causes AnyDBM and NDBM_File to lock up. This is evidenced 
  530. +     # in the tests as AnyDBM just freezing.  Apparently, this only 
  531. +     # happens on a.out systems, so we disable NDBM for all a.out linux
  532. +     # systems.  If someone can suggest a more robust test
  533. +     #  that would be appreciated.
  534. +     #
  535. +     # More info:
  536. +     # Date: Wed, 7 Feb 1996 03:21:04 +0900
  537. +     # From: Jeffrey Friedl <jfriedl@nff.ncl.omron.co.jp>
  538. +     #
  539. +     # I tried compiling with DBM support and sure enough things locked up
  540. +     # just as advertised. Checking into it, I found that the lockup was
  541. +     # during the call to dbm_open. Not *in* dbm_open -- but between the call
  542. +     # to and the jump into.
  543. +     # 
  544. +     # To make a long story short, making sure that the *.a and *.sa pairs of
  545. +     #   /usr/lib/lib{m,db,gdbm}.{a,sa}
  546. +     # were perfectly in sync took care of it.
  547. +     #
  548. +     # This will generate a harmless Whoa There! message
  549. +     case "$d_dbm_open" in
  550. +     '')    cat <<'EOM' >&4
  551. + Disabling ndbm.  This will generate a Whoa There message in Configure.
  552. + Read hints/linux.sh for further information.
  553. + EOM
  554. +         # You can override this with Configure -Dd_dbm_open
  555. +         d_dbm_open=undef
  556. +         ;;
  557. +     esac
  558.   fi
  559.   
  560.   rm -f try.c a.out
  561.   
  562.   if /bin/bash -c exit; then
  563. +   echo
  564.     echo You appear to have a working bash. Good.
  565.   else
  566. !   cat << 'EOM' >&4
  567.   
  568. + *********************** Warning! *********************
  569. + It would appear you have a defective bash shell installed. This is likely to
  570. + give you a failure of op/exec test #5 during the test phase of the build,
  571. + Upgrading to a recent version (1.14.4 or later) should fix the problem.
  572. + ******************************************************
  573.   EOM
  574.   
  575.   fi
  576.   
  577. ! # Avoid some troublesome gcvt() functions.  With some libc versions, 
  578. ! # perl -e '$x=1e5; print "$x\n";' prints 1e+5.  We'd like it
  579. ! # to print 100000 instead, consistent with the integer value given
  580. ! # on other platforms.  This isn't a bug in gcvt, really; more in our
  581. ! # expectations for it.  We'd like it to behave exactly as
  582. ! # sprintf %.16g, but it isn't documented to do that.
  583.   #
  584. ! # We'll use sprintf() instead, since we can control the output more
  585. ! # precisely.
  586.   # 
  587. ! # The next version of Configure will check for this automatically.
  588. ! d_Gconvert='sprintf((b),"%.*g",(n),(x))'
  589.   
  590.  
  591.  
  592. #: hints/machten.sh:
  593. #:   Don't use buggy sigsetjmp
  594. #:   Don't use nlinks returned by stat to count subdirectories
  595. diff -crN perl5.002_01/hints/machten.sh perl5.003/hints/machten.sh
  596. *** perl5.002_01/hints/machten.sh    Mon Feb 12 14:53:13 1996
  597. --- perl5.003/hints/machten.sh    Mon Jun 24 16:07:54 1996
  598. ***************
  599. *** 12,26 ****
  600.   #     Mark Pease <peasem@primenet.com>
  601.   #    Martijn Koster <m.koster@webcrawler.com>
  602.   #    Richard Yeh <rcyeh@cco.caltech.edu>
  603.   #
  604.   # Comments, questions, and improvements welcome!
  605.   #
  606.   # MachTen 4.X does support dynamic loading, but perl doesn't
  607.   # know how to use it yet.
  608.   #
  609. ! #  Last modified by Andy Dougherty   <doughera@lafcol.lafayette.edu>
  610. ! #  Thu Feb  8 15:07:52 EST 1996
  611.   
  612.   # Configure doesn't know how to parse the nm output.
  613.   usenm=undef
  614. --- 12,28 ----
  615.   #     Mark Pease <peasem@primenet.com>
  616.   #    Martijn Koster <m.koster@webcrawler.com>
  617.   #    Richard Yeh <rcyeh@cco.caltech.edu>
  618. ! #
  619. ! # File::Find's use of link count disabled by Dominic Dunlop 950528
  620. ! # Perl's use of sigsetjmp etc. disabled by Dominic Dunlop 950521
  621.   #
  622.   # Comments, questions, and improvements welcome!
  623.   #
  624.   # MachTen 4.X does support dynamic loading, but perl doesn't
  625.   # know how to use it yet.
  626.   #
  627. ! #  Updated by Dominic Dunlop <domo@tcp.ip.lu>
  628. ! #  Tue May 28 11:20:08 WET DST 1996
  629.   
  630.   # Configure doesn't know how to parse the nm output.
  631.   usenm=undef
  632. ***************
  633. *** 29,31 ****
  634. --- 31,62 ----
  635.   # I don't know if this is true for all MachTen systems, or how to
  636.   # determine this automatically.
  637.   alignbytes=8
  638. + # There appears to be a problem with perl's use of sigsetjmp and
  639. + # friends.  Use setjmp and friends instead.
  640. + d_sigsetjmp='undef' 
  641. + # MachTen always reports ony two links to directories, even if they
  642. + # contain subdirectories.  Consequently, we use this variable to stop
  643. + # File::Find using the link count to determine whether there are
  644. + # subdirectories to be searched.  This will generate a harmless message:
  645. + # Hmm...You had some extra variables I don't know about...I'll try to keep 'em.
  646. + #    Propagating recommended variable dont_use_nlink
  647. + dont_use_nlink=define
  648. + cat <<'EOM' >&4
  649. + Tests
  650. +     io/fs test 4  and
  651. +     op/stat test 3
  652. + may fail since MachTen does not return a useful nlinks field to stat
  653. + on directories.
  654. + At the end of Configure, you will see a harmless message
  655. + Hmm...You had some extra variables I don't know about...I'll try to keep 'em.
  656. +     Propagating recommended variable dont_use_nlink
  657. + Read the File::Find documentation for more information.
  658. + EOM
  659.  
  660.  
  661. #: hints/solaris_2.sh:
  662. #:   Remove outdated fixincludes test
  663. #:   Update message about workarounds for GNU as/ld
  664. diff -crN perl5.002_01/hints/solaris_2.sh perl5.003/hints/solaris_2.sh
  665. *** perl5.002_01/hints/solaris_2.sh    Mon Feb 12 14:53:38 1996
  666. --- perl5.003/hints/solaris_2.sh    Mon Jun 24 16:07:54 1996
  667. ***************
  668. *** 3,9 ****
  669.   # Andy Dougherty  <doughera@lafcol.lafayette.edu>
  670.   # Based on input from lots of folks, especially
  671.   # Dean Roehrich <roehrich@ironwood-fddi.cray.com>
  672. !  
  673.   # See man vfork.
  674.   usevfork=false
  675.   
  676. --- 3,9 ----
  677.   # Andy Dougherty  <doughera@lafcol.lafayette.edu>
  678.   # Based on input from lots of folks, especially
  679.   # Dean Roehrich <roehrich@ironwood-fddi.cray.com>
  680.   # See man vfork.
  681.   usevfork=false
  682.   
  683. ***************
  684. *** 142,160 ****
  685.           awk '{print $NF}'  | sed 's/specs$/include/'`
  686.   
  687.       # Determine if the fixed-includes look like they'll work.
  688. !     sed 1q $tmp/stdarg.h 2>&1 | grep 'stdarg.h for GNU' 2>&1 >/dev/null
  689. !     case $? in
  690. !     0) ;;
  691. !     *)
  692. !         cat <<END
  693. ! NOTE: The fixincludes or just-fixinc script for gcc was not run
  694. ! properly.  Your gcc may not be able to compile Perl.  Inform your system
  695. ! administrator that ${cc:-cc} is not properly installed.
  696. ! END
  697. !         ;;
  698. !     esac
  699.   
  700.       # See if as(1) is GNU as(1).  GNU as(1) won't work for this job.
  701.       case $verbose in
  702. --- 142,148 ----
  703.           awk '{print $NF}'  | sed 's/specs$/include/'`
  704.   
  705.       # Determine if the fixed-includes look like they'll work.
  706. !     # Doesn't work anymore for gcc-2.7.2.
  707.   
  708.       # See if as(1) is GNU as(1).  GNU as(1) won't work for this job.
  709.       case $verbose in
  710. ***************
  711. *** 164,170 ****
  712.   
  713.   NOTE: You are using GNU as(1).  GNU as(1) will not build Perl.
  714.   You must arrange to use /usr/ccs/bin/as, perhaps by setting
  715. ! GCC_EXEC_PREFIX.
  716.   
  717.   END
  718.       ;;
  719. --- 152,158 ----
  720.   
  721.   NOTE: You are using GNU as(1).  GNU as(1) will not build Perl.
  722.   You must arrange to use /usr/ccs/bin/as, perhaps by setting
  723. ! GCC_EXEC_PREFIX or by including -B/usr/ccs/bin in your cc command.
  724.   
  725.   END
  726.       ;;
  727. ***************
  728. *** 178,184 ****
  729.   
  730.   NOTE: You are using GNU ld(1).  GNU ld(1) will not build Perl.
  731.   You must arrange to use /usr/ccs/bin/ld, perhaps by setting
  732. ! GCC_EXEC_PREFIX.
  733.   
  734.   END
  735.       ;;
  736. --- 166,172 ----
  737.   
  738.   NOTE: You are using GNU ld(1).  GNU ld(1) will not build Perl.
  739.   You must arrange to use /usr/ccs/bin/ld, perhaps by setting
  740. ! GCC_EXEC_PREFIX or by including -B/usr/ccs/bin in your cc command.
  741.   
  742.   END
  743.       ;;
  744.  
  745.  
  746. #: installperl
  747. #:   Insure that installed C header files are world-readable
  748. diff -crN perl5.002_01/installperl perl5.003/installperl
  749. *** perl5.002_01/installperl    Mon Mar 25 01:04:10 1996
  750. --- perl5.003/installperl    Mon Jun 24 16:08:25 1996
  751. ***************
  752. *** 177,182 ****
  753. --- 177,183 ----
  754.   mkpath("$installarchlib/CORE", 1, 0777);
  755.   foreach $file (<*.h libperl*.*>) {
  756.       cp_if_diff($file,"$installarchlib/CORE/$file");
  757. +     &chmod(0444,"$installarchlib/CORE/$file");
  758.   }
  759.   # AIX needs perl.exp installed as well.
  760.   cp_if_diff("perl.exp" ,"$installarchlib/CORE/perl.exp") if ($^O eq 'aix');
  761.  
  762.  
  763. #: lib/ExtUtils/Install.pm
  764. #:   Update to MakeMaker 5.34
  765. diff -crN perl5.002_01/lib/ExtUtils/Install.pm perl5.003/lib/ExtUtils/Install.pm
  766. *** perl5.002_01/lib/ExtUtils/Install.pm    Mon Mar 25 01:04:13 1996
  767. --- perl5.003/lib/ExtUtils/Install.pm    Sun Jun 23 20:52:28 1996
  768. ***************
  769. *** 1,27 ****
  770.   package ExtUtils::Install;
  771.   
  772.   use Exporter;
  773. - use SelfLoader;
  774.   use Carp ();
  775.   @ISA = ('Exporter');
  776.   @EXPORT = ('install','uninstall','pm_to_blib');
  777.   $Is_VMS = $^O eq 'VMS';
  778.   
  779.   #use vars qw( @EXPORT @ISA $Is_VMS );
  780.   #use strict;
  781.   
  782. ! 1;
  783. ! sub ExtUtils::Install::install;
  784. ! sub ExtUtils::Install::uninstall;
  785. ! sub ExtUtils::Install::pm_to_blib;
  786. ! sub ExtUtils::Install::my_cmp;
  787. ! __DATA__
  788.   
  789.   sub install {
  790. !     my($hash,$verbose,$nonono) = @_;
  791.       $verbose ||= 0;
  792.       $nonono  ||= 0;
  793.   
  794. --- 1,30 ----
  795.   package ExtUtils::Install;
  796.   
  797. + $VERSION = substr q$Revision: 1.12 $, 10;
  798. + # $Id: Install.pm,v 1.12 1996/06/23 20:46:07 k Exp $
  799.   use Exporter;
  800.   use Carp ();
  801. ! use Config ();
  802. ! use vars qw(@ISA @EXPORT $VERSION);
  803.   @ISA = ('Exporter');
  804.   @EXPORT = ('install','uninstall','pm_to_blib');
  805.   $Is_VMS = $^O eq 'VMS';
  806.   
  807. + my $splitchar = $^O eq 'VMS' ? '|' : $^O eq 'os2' ? ';' : ':';
  808. + my @PERL_ENV_LIB = split $splitchar, defined $ENV{'PERL5LIB'} ? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'};
  809. + my $Inc_uninstall_warn_handler;
  810.   #use vars qw( @EXPORT @ISA $Is_VMS );
  811.   #use strict;
  812.   
  813. ! sub forceunlink {
  814. !     chmod 0666, $_[0];
  815. !     unlink $_[0] or Carp::croak("Cannot forceunlink $_[0]: $!")
  816. ! }
  817.   
  818.   sub install {
  819. !     my($hash,$verbose,$nonono,$inc_uninstall) = @_;
  820.       $verbose ||= 0;
  821.       $nonono  ||= 0;
  822.   
  823. ***************
  824. *** 31,37 ****
  825.       use File::Copy qw(copy);
  826.       use File::Find qw(find);
  827.       use File::Path qw(mkpath);
  828. !     # require "auto/ExtUtils/Install/my_cmp.al"; # Hairy, but for the first
  829.       # time use we are in a different directory when autoload happens, so
  830.       # the relativ path to ./blib is ill.
  831.   
  832. --- 34,44 ----
  833.       use File::Copy qw(copy);
  834.       use File::Find qw(find);
  835.       use File::Path qw(mkpath);
  836. !     # The following lines were needed with AutoLoader (left for the record)
  837. !     # my $my_req = $self->catfile(qw(auto ExtUtils Install my_cmp.al));
  838. !     # require $my_req;
  839. !     # $my_req = $self->catfile(qw(auto ExtUtils Install forceunlink.al));
  840. !     # require $my_req; # Hairy, but for the first
  841.       # time use we are in a different directory when autoload happens, so
  842.       # the relativ path to ./blib is ill.
  843.   
  844. ***************
  845. *** 47,53 ****
  846.       #Check if there are files, and if yes, look if the corresponding
  847.       #target directory is writable for us
  848.       opendir DIR, $source_dir_or_file or next;
  849. !     while ($_ = readdir DIR) {
  850.           next if $_ eq "." || $_ eq ".." || $_ eq ".exists";
  851.           if (-w $hash{$source_dir_or_file} || mkpath($hash{$source_dir_or_file})) {
  852.           last;
  853. --- 54,60 ----
  854.       #Check if there are files, and if yes, look if the corresponding
  855.       #target directory is writable for us
  856.       opendir DIR, $source_dir_or_file or next;
  857. !     for (readdir DIR) {
  858.           next if $_ eq "." || $_ eq ".." || $_ eq ".exists";
  859.           if (-w $hash{$source_dir_or_file} || mkpath($hash{$source_dir_or_file})) {
  860.           last;
  861. ***************
  862. *** 89,96 ****
  863.           return if $_ eq ".exists";
  864.           my $targetdir = $MY->catdir($hash{$source},$File::Find::dir);
  865.           my $targetfile = $MY->catfile($targetdir,$_);
  866. -         my $diff = 0;
  867.   
  868.           if ( -f $targetfile && -s _ == $size) {
  869.           # We have a good chance, we can skip this one
  870.           $diff = my_cmp($_,$targetfile);
  871. --- 96,103 ----
  872.           return if $_ eq ".exists";
  873.           my $targetdir = $MY->catdir($hash{$source},$File::Find::dir);
  874.           my $targetfile = $MY->catfile($targetdir,$_);
  875.   
  876. +         my $diff = 0;
  877.           if ( -f $targetfile && -s _ == $size) {
  878.           # We have a good chance, we can skip this one
  879.           $diff = my_cmp($_,$targetfile);
  880. ***************
  881. *** 101,121 ****
  882.   
  883.           if ($diff){
  884.           if (-f $targetfile){
  885. !             unlink $targetfile or Carp::croak("Couldn't unlink $targetfile");
  886.           } else {
  887.               mkpath($targetdir,0,0755) unless $nonono;
  888.               print "mkpath($targetdir,0,0755)\n" if $verbose>1;
  889.           }
  890.           copy($_,$targetfile) unless $nonono;
  891. !         print "Installing $targetfile\n" if $verbose;
  892.           utime($atime,$mtime + $Is_VMS,$targetfile) unless $nonono>1;
  893.           print "utime($atime,$mtime,$targetfile)\n" if $verbose>1;
  894.           chmod $mode, $targetfile;
  895.           print "chmod($mode, $targetfile)\n" if $verbose>1;
  896.           } else {
  897. !         print "Skipping $targetfile (unchanged)\n";
  898.           }
  899.           $write{$targetfile}++;
  900.   
  901.       }, ".");
  902. --- 108,135 ----
  903.   
  904.           if ($diff){
  905.           if (-f $targetfile){
  906. !             forceunlink($targetfile) unless $nonono;
  907.           } else {
  908.               mkpath($targetdir,0,0755) unless $nonono;
  909.               print "mkpath($targetdir,0,0755)\n" if $verbose>1;
  910.           }
  911.           copy($_,$targetfile) unless $nonono;
  912. !         print "Installing $targetfile\n";
  913.           utime($atime,$mtime + $Is_VMS,$targetfile) unless $nonono>1;
  914.           print "utime($atime,$mtime,$targetfile)\n" if $verbose>1;
  915. +         $mode = 0444 | ( $mode & 0111 ? 0111 : 0 );
  916.           chmod $mode, $targetfile;
  917.           print "chmod($mode, $targetfile)\n" if $verbose>1;
  918.           } else {
  919. !         print "Skipping $targetfile (unchanged)\n" if $verbose;
  920. !         }
  921. !         
  922. !         if (! defined $inc_uninstall) { # it's called 
  923. !         } elsif ($inc_uninstall == 0){
  924. !         inc_uninstall($_,$File::Find::dir,$verbose,1); # nonono set to 1
  925. !         } else {
  926. !         inc_uninstall($_,$File::Find::dir,$verbose,0); # nonono set to 0
  927.           }
  928.           $write{$targetfile}++;
  929.   
  930.       }, ".");
  931. ***************
  932. *** 163,177 ****
  933.   sub uninstall {
  934.       my($fil,$verbose,$nonono) = @_;
  935.       die "no packlist file found: $fil" unless -f $fil;
  936.       local *P;
  937.       open P, $fil or Carp::croak("uninstall: Could not read packlist file $fil: $!");
  938.       while (<P>) {
  939.       chomp;
  940.       print "unlink $_\n" if $verbose;
  941. !     unlink($_) || Carp::carp("Couldn't unlink $_") unless $nonono;
  942.       }
  943.       print "unlink $fil\n" if $verbose;
  944. !     unlink($fil) || Carp::carp("Couldn't unlink $fil") unless $nonono;
  945.   }
  946.   
  947.   sub pm_to_blib {
  948. --- 177,232 ----
  949.   sub uninstall {
  950.       my($fil,$verbose,$nonono) = @_;
  951.       die "no packlist file found: $fil" unless -f $fil;
  952. +     # my $my_req = $self->catfile(qw(auto ExtUtils Install forceunlink.al));
  953. +     # require $my_req; # Hairy, but for the first
  954.       local *P;
  955.       open P, $fil or Carp::croak("uninstall: Could not read packlist file $fil: $!");
  956.       while (<P>) {
  957.       chomp;
  958.       print "unlink $_\n" if $verbose;
  959. !     forceunlink($_) unless $nonono;
  960.       }
  961.       print "unlink $fil\n" if $verbose;
  962. !     forceunlink($fil) unless $nonono;
  963. ! }
  964. ! sub inc_uninstall {
  965. !     my($file,$libdir,$verbose,$nonono) = @_;
  966. !     my($dir);
  967. !     my $MY = {};
  968. !     bless $MY, 'MY';
  969. !     my %seen_dir = ();
  970. !     foreach $dir (@INC, @PERL_ENV_LIB, @Config::Config{qw/archlibexp privlibexp sitearchexp sitelibexp/}) {
  971. !     next if $dir eq ".";
  972. !     next if $seen_dir{$dir}++;
  973. !     my($targetfile) = $MY->catfile($dir,$libdir,$file);
  974. !     next unless -f $targetfile;
  975. !     # The reason why we compare file's contents is, that we cannot
  976. !     # know, which is the file we just installed (AFS). So we leave
  977. !     # an identical file in place
  978. !     my $diff = 0;
  979. !     if ( -f $targetfile && -s _ == -s $file) {
  980. !         # We have a good chance, we can skip this one
  981. !         $diff = my_cmp($file,$targetfile);
  982. !     } else {
  983. !         print "#$file and $targetfile differ\n" if $verbose>1;
  984. !         $diff++;
  985. !     }
  986. !     next unless $diff;
  987. !     if ($nonono) {
  988. !         if ($verbose) {
  989. !         $Inc_uninstall_warn_handler ||= new ExtUtils::Install::Warn;
  990. !         $libdir =~ s|^\./|| ; # That's just cosmetics, no need to port. It looks prettier.
  991. !         $Inc_uninstall_warn_handler->add("$libdir/$file",$targetfile);
  992. !         }
  993. !         # if not verbose, we just say nothing
  994. !     } else {
  995. !         print "Unlinking $targetfile (shadowing?)\n";
  996. !         forceunlink($targetfile);
  997. !     }
  998. !     }
  999.   }
  1000.   
  1001.   sub pm_to_blib {
  1002. ***************
  1003. *** 181,186 ****
  1004. --- 236,243 ----
  1005.       use File::Copy qw(copy);
  1006.       use File::Path qw(mkpath);
  1007.       use AutoSplit;
  1008. +     # my $my_req = $self->catfile(qw(auto ExtUtils Install forceunlink.al));
  1009. +     # require $my_req; # Hairy, but for the first
  1010.   
  1011.       my $umask = umask 0022 unless $Is_VMS;
  1012.       mkpath($autodir,0,0755);
  1013. ***************
  1014. *** 191,207 ****
  1015.           next;
  1016.       }
  1017.       if (-f $fromto->{$_}){
  1018. !         unlink $fromto->{$_} or Carp::carp("Couldn't unlink $fromto->{$_}");
  1019.       } else {
  1020.           mkpath(dirname($fromto->{$_}),0,0755);
  1021.       }
  1022.       copy($_,$fromto->{$_});
  1023. !     chmod((stat)[2],$fromto->{$_});
  1024.       print "cp $_ $fromto->{$_}\n";
  1025.       next unless /\.pm$/;
  1026.       autosplit($fromto->{$_},$autodir);
  1027.       }
  1028.       umask $umask unless $Is_VMS;
  1029.   }
  1030.   
  1031.   1;
  1032. --- 248,288 ----
  1033.           next;
  1034.       }
  1035.       if (-f $fromto->{$_}){
  1036. !         forceunlink($fromto->{$_});
  1037.       } else {
  1038.           mkpath(dirname($fromto->{$_}),0,0755);
  1039.       }
  1040.       copy($_,$fromto->{$_});
  1041. !     chmod(0444 | ( (stat)[2] & 0111 ? 0111 : 0 ),$fromto->{$_});
  1042.       print "cp $_ $fromto->{$_}\n";
  1043.       next unless /\.pm$/;
  1044.       autosplit($fromto->{$_},$autodir);
  1045.       }
  1046.       umask $umask unless $Is_VMS;
  1047. + }
  1048. + package ExtUtils::Install::Warn;
  1049. + sub new { bless {}, shift }
  1050. + sub add {
  1051. +     my($self,$file,$targetfile) = @_;
  1052. +     push @{$self->{$file}}, $targetfile;
  1053. + }
  1054. + sub DESTROY {
  1055. +     my $self = shift;
  1056. +     my($file,$i,$plural);
  1057. +     foreach $file (sort keys %$self) {
  1058. +     $plural = @{$self->{$file}} > 1 ? "s" : "";
  1059. +     print "## Differing version$plural of $file found. You might like to\n";
  1060. +     for (0..$#{$self->{$file}}) {
  1061. +         print "rm ", $self->{$file}[$_], "\n";
  1062. +         $i++;
  1063. +     }
  1064. +     }
  1065. +     $plural = $i>1 ? "all those files" : "this file";
  1066. +     print "## Running 'make install UNINST=1' will unlink $plural for you.\n";
  1067.   }
  1068.   
  1069.   1;
  1070.  
  1071.  
  1072. #: lib/ExtUtils/Liblist.pm
  1073. #:   Update to MakeMaker 5.34
  1074. diff -crN perl5.002_01/lib/ExtUtils/Liblist.pm perl5.003/lib/ExtUtils/Liblist.pm
  1075. *** perl5.002_01/lib/ExtUtils/Liblist.pm    Mon Mar 25 01:04:15 1996
  1076. --- perl5.003/lib/ExtUtils/Liblist.pm    Sun Jun 23 20:52:37 1996
  1077. ***************
  1078. *** 2,7 ****
  1079. --- 2,9 ----
  1080.   
  1081.   # Broken out of MakeMaker from version 4.11
  1082.   
  1083. + $ExtUtils::Liblist::VERSION = substr q$Revision: 1.19 $, 10;
  1084.   use Config;
  1085.   use Cwd 'cwd';
  1086.   use File::Basename;
  1087. ***************
  1088. *** 10,16 ****
  1089.   
  1090.   sub ext {
  1091.       my($self,$potential_libs, $Verbose) = @_;
  1092. !     if ($^O eq 'os2' and $Config{libs}) { 
  1093.       # Dynamic libraries are not transitive, so we may need including
  1094.       # the libraries linked against perl.dll again.
  1095.   
  1096. --- 12,18 ----
  1097.   
  1098.   sub ext {
  1099.       my($self,$potential_libs, $Verbose) = @_;
  1100. !     if ($^O =~ 'os2' and $Config{libs}) { 
  1101.       # Dynamic libraries are not transitive, so we may need including
  1102.       # the libraries linked against perl.dll again.
  1103.   
  1104. ***************
  1105. *** 45,53 ****
  1106.               if $Verbose;
  1107.           next;
  1108.           }
  1109. !         if ($thislib !~ m|^/|) {
  1110.             print STDOUT "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n";
  1111. !           $thislib = "$pwd/$thislib";
  1112.           }
  1113.           push(@searchpath, $thislib);
  1114.           push(@extralibs,  "$ptype$thislib");
  1115. --- 47,55 ----
  1116.               if $Verbose;
  1117.           next;
  1118.           }
  1119. !         unless ($self->file_name_is_absolute($thislib)) {
  1120.             print STDOUT "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n";
  1121. !           $thislib = $self->catdir($pwd,$thislib);
  1122.           }
  1123.           push(@searchpath, $thislib);
  1124.           push(@extralibs,  "$ptype$thislib");
  1125.  
  1126.  
  1127. #: lib/ExtUtils/MM_Unix.pm
  1128. #:   Update to MakeMaker 5.34
  1129. diff -crN perl5.002_01/lib/ExtUtils/MM_Unix.pm perl5.003/lib/ExtUtils/MM_Unix.pm
  1130. *** perl5.002_01/lib/ExtUtils/MM_Unix.pm    Mon Mar 25 01:04:28 1996
  1131. --- perl5.003/lib/ExtUtils/MM_Unix.pm    Mon Jun 24 16:14:28 1996
  1132. ***************
  1133. *** 1,32 ****
  1134.   package ExtUtils::MM_Unix;
  1135.   
  1136. ! # $Id: MM_Unix.pm,v 1.14 1996/02/29 07:59:10 k Exp $
  1137. !                             # Loading Time cumulated
  1138. ! require Exporter;                                               # 0.28          0.28
  1139. ! use Config;                        # 0.37          0.38
  1140. ! use File::Basename qw(basename dirname fileparse);  # 0.47          0.48
  1141. ! use DirHandle;                        # 0.37          0.58
  1142. ! # use FileHandle ();                    # 1.28   !!!!   1.46
  1143. ! # And another benchmark. I have deleted MakeMaker completely from the perl installation
  1144. ! # and deleted blib and pm_to_blib, the timestamp file.
  1145. ! # MM_Unix with Selfloader:
  1146. ! # perl Makefile.PL  4.34s user 0.57s system 84% cpu 5.844 total
  1147. ! # make  14.77s user 3.16s system 78% cpu 22.698 total
  1148. ! # MM_Unix with my own autoloader
  1149. ! # perl Makefile.PL  3.82s user 0.55s system 73% cpu 5.920 total
  1150. ! # make  14.70s user 3.27s system 82% cpu 21.714 total
  1151.   
  1152.   
  1153.   Exporter::import('ExtUtils::MakeMaker',
  1154.       qw( $Verbose &neatvalue));
  1155.   
  1156. ! $Is_OS2 = $^O eq 'os2';
  1157. ! $Is_VMS = $^O eq 'VMS';
  1158.   
  1159.   =head1 NAME
  1160.   
  1161. --- 1,23 ----
  1162.   package ExtUtils::MM_Unix;
  1163.   
  1164. ! $VERSION = substr q$Revision: 1.101 $, 10;
  1165. ! # $Id: MM_Unix.pm,v 1.101 1996/06/23 20:51:18 k Exp k $
  1166.   
  1167. + require Exporter;
  1168. + use Config;
  1169. + use File::Basename qw(basename dirname fileparse);
  1170. + use DirHandle;
  1171.   
  1172.   Exporter::import('ExtUtils::MakeMaker',
  1173.       qw( $Verbose &neatvalue));
  1174.   
  1175. ! $Is_OS2 = $^O =~ m|^os/?2$|i;
  1176. ! $Is_Mac = $^O eq "MacOS";
  1177. ! if ($Is_VMS = $^O eq 'VMS') {
  1178. !     require VMS::Filespec;
  1179. !     import VMS::Filespec qw( &vmsify );
  1180. ! }
  1181.   
  1182.   =head1 NAME
  1183.   
  1184. ***************
  1185. *** 64,70 ****
  1186.   development. Please refer to the code for not suitably documented
  1187.   sections and complain loudly to the makemaker mailing list.
  1188.   
  1189. ! Not all of the methos below are overridable in a
  1190.   Makefile.PL. Overridable methods are marked as (o). All methods are
  1191.   overridable by a platform specific MM_*.pm file (See
  1192.   L<ExtUtils::MM_VMS>) and L<ExtUtils::MM_OS2>).
  1193. --- 55,61 ----
  1194.   development. Please refer to the code for not suitably documented
  1195.   sections and complain loudly to the makemaker mailing list.
  1196.   
  1197. ! Not all of the methods below are overridable in a
  1198.   Makefile.PL. Overridable methods are marked as (o). All methods are
  1199.   overridable by a platform specific MM_*.pm file (See
  1200.   L<ExtUtils::MM_VMS>) and L<ExtUtils::MM_OS2>).
  1201. ***************
  1202. *** 73,1936 ****
  1203.   
  1204.   =over 2
  1205.   
  1206.   =item catdir
  1207.   
  1208.   Concatenate two or more directory names to form a complete path ending
  1209. ! with a directory
  1210.   
  1211.   =cut
  1212.   
  1213.   # ';
  1214.   
  1215. ! sub catdir  {
  1216.       shift;
  1217. !     my $result = join('/',@_);
  1218. !     $result =~ s:/(\./)+:/:g;
  1219. !     $result =~ s:/+:/:g;
  1220. !     $result =~ s:/$::;
  1221.       $result;
  1222.   }
  1223.   
  1224.   =item catfile
  1225.   
  1226. ! Concatenate two or more directory names and a filename to form a
  1227.   complete path ending with a filename
  1228.   
  1229.   =cut
  1230.   
  1231.   sub catfile {
  1232. !     shift;
  1233. !     my $result = join('/',@_);
  1234. !     $result =~ s:/(\./)+:/:g;
  1235. !     $result =~ s:/+:/:g;
  1236. !     $result;
  1237.   }
  1238.   
  1239. ! sub ExtUtils::MM_Unix::guess_name ;
  1240. ! sub ExtUtils::MM_Unix::init_main ;
  1241. ! sub ExtUtils::MM_Unix::init_dirscan ;
  1242. ! sub ExtUtils::MM_Unix::init_others ;
  1243. ! sub ExtUtils::MM_Unix::find_perl ;
  1244. ! sub ExtUtils::MM_Unix::post_initialize ;
  1245.   sub ExtUtils::MM_Unix::const_config ;
  1246. - sub ExtUtils::MM_Unix::constants ;
  1247.   sub ExtUtils::MM_Unix::const_loadlibs ;
  1248. ! sub ExtUtils::MM_Unix::const_cccmd ;
  1249. ! sub ExtUtils::MM_Unix::tool_autosplit ;
  1250. ! sub ExtUtils::MM_Unix::tool_xsubpp ;
  1251. ! sub ExtUtils::MM_Unix::xsubpp_version ;
  1252. ! sub ExtUtils::MM_Unix::tools_other ;
  1253. ! sub ExtUtils::MM_Unix::dist ;
  1254. ! sub ExtUtils::MM_Unix::macro ;
  1255.   sub ExtUtils::MM_Unix::depend ;
  1256. ! sub ExtUtils::MM_Unix::post_constants ;
  1257. ! sub ExtUtils::MM_Unix::pasthru ;
  1258. ! sub ExtUtils::MM_Unix::c_o ;
  1259. ! sub ExtUtils::MM_Unix::xs_c ;
  1260. ! sub ExtUtils::MM_Unix::xs_o ;
  1261. ! sub ExtUtils::MM_Unix::top_targets ;
  1262. ! sub ExtUtils::MM_Unix::linkext ;
  1263.   sub ExtUtils::MM_Unix::dlsyms ;
  1264.   sub ExtUtils::MM_Unix::dynamic ;
  1265.   sub ExtUtils::MM_Unix::dynamic_bs ;
  1266.   sub ExtUtils::MM_Unix::dynamic_lib ;
  1267. ! sub ExtUtils::MM_Unix::static ;
  1268. ! sub ExtUtils::MM_Unix::static_lib ;
  1269. ! #sub ExtUtils::MM_Unix::installpm ;
  1270. ! #sub ExtUtils::MM_Unix::installpm_x ;
  1271. ! sub ExtUtils::MM_Unix::pm_to_blib ;
  1272.   sub ExtUtils::MM_Unix::manifypods ;
  1273.   sub ExtUtils::MM_Unix::processPL ;
  1274. - sub ExtUtils::MM_Unix::installbin ;
  1275. - sub ExtUtils::MM_Unix::subdirs ;
  1276. - sub ExtUtils::MM_Unix::subdir_x ;
  1277. - sub ExtUtils::MM_Unix::clean ;
  1278.   sub ExtUtils::MM_Unix::realclean ;
  1279. ! sub ExtUtils::MM_Unix::dist_basics ;
  1280. ! sub ExtUtils::MM_Unix::dist_core ;
  1281. ! sub ExtUtils::MM_Unix::dist_dir ;
  1282. ! sub ExtUtils::MM_Unix::dist_test ;
  1283. ! sub ExtUtils::MM_Unix::dist_ci ;
  1284. ! sub ExtUtils::MM_Unix::install ;
  1285. ! sub ExtUtils::MM_Unix::force ;
  1286. ! sub ExtUtils::MM_Unix::perldepend ;
  1287. ! sub ExtUtils::MM_Unix::makefile ;
  1288.   sub ExtUtils::MM_Unix::staticmake ;
  1289.   sub ExtUtils::MM_Unix::test ;
  1290.   sub ExtUtils::MM_Unix::test_via_harness ;
  1291.   sub ExtUtils::MM_Unix::test_via_script ;
  1292. ! sub ExtUtils::MM_Unix::postamble ;
  1293. ! sub ExtUtils::MM_Unix::makeaperl ;
  1294. ! sub ExtUtils::MM_Unix::extliblist ;
  1295. ! sub ExtUtils::MM_Unix::dir_target ;
  1296. ! sub ExtUtils::MM_Unix::needs_linking ;
  1297. ! sub ExtUtils::MM_Unix::has_link_code ;
  1298.   sub ExtUtils::MM_Unix::writedoc ;
  1299. ! sub ExtUtils::MM_Unix::perl_script ;
  1300. ! sub ExtUtils::MM_Unix::maybe_command ;
  1301. ! sub ExtUtils::MM_Unix::maybe_command_in_dirs ;
  1302. ! sub ExtUtils::MM_Unix::prefixify ;
  1303. ! sub ExtUtils::MM_Unix::file_name_is_absolute ;
  1304. ! sub ExtUtils::MM_Unix::replace_manpage_separator ;
  1305. ! sub ExtUtils::MM_Unix::path ;
  1306. ! sub ExtUtils::MM_Unix::lsdir ;
  1307. ! sub ExtUtils::MM_Unix::exescan ;
  1308. ! sub ExtUtils::MM_Unix::libscan ;
  1309. ! sub ExtUtils::MM_Unix::nicetext ;
  1310.   
  1311.   package ExtUtils::MM_Unix;
  1312.   
  1313. ! use SelfLoader;
  1314. ! #sub AUTOLOAD {
  1315. ! #    my $code;
  1316. ! #    if (defined fileno(DATA)) {
  1317. ! #    while (<DATA>) {
  1318. ! #        last if /^__END__/;
  1319. ! #        $code .= $_;
  1320. ! #    }
  1321. ! #    close DATA;
  1322. ! #    eval $code;
  1323. ! #    if ($@) {
  1324. ! #        $@ =~ s/ at .*\n//;
  1325. ! #        Carp::croak $@;
  1326. ! #    }
  1327. ! #    } else {
  1328. ! #    warn "AUTOLOAD called unexpectedly for $AUTOLOAD"; 
  1329. ! #    }
  1330. ! #    defined(&$AUTOLOAD) or die "Myloader inconsistency error";
  1331. ! #    goto &$AUTOLOAD;
  1332. ! #}
  1333.   
  1334.   1;
  1335. ! __DATA__
  1336.   
  1337.   =head2 SelfLoaded methods
  1338.   
  1339. ! =item nicetext
  1340. ! misnamed method (will have to be changed). The MM_Unix method just
  1341. ! returns the argument without further processing.
  1342.   
  1343. ! On VMS used to insure that colons marking targets are preceded by
  1344. ! space - most Unix Makes don't need this, but it's necessary under VMS
  1345. ! to distinguish the target delimiter from a colon appearing as part of
  1346. ! a filespec.
  1347.   
  1348.   =cut
  1349.   
  1350. ! sub nicetext {
  1351. !     my($self,$text) = @_;
  1352. !     unless (ref $self){
  1353. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  1354. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  1355. !     }
  1356. !     $text;
  1357. ! }
  1358.   
  1359. ! =item libscan (o)
  1360.   
  1361. ! Takes a path to a file that is found by init_dirscan and returns false
  1362. ! if we don't want to include this file in the library. Mainly used to
  1363. ! exclude RCS, CVS, and SCCS directories from installation.
  1364.   
  1365. ! =cut
  1366.   
  1367. ! # ';
  1368.   
  1369. ! sub libscan {
  1370. !     my($self,$path) = @_;
  1371. !     return '' if $path =~ m:/(RCS|CVS|SCCS)/: ;
  1372. !     $path;
  1373.   }
  1374.   
  1375. ! =item exescan
  1376.   
  1377. ! Deprecated method. Use libscan instead.
  1378.   
  1379.   =cut
  1380.   
  1381. ! sub exescan {
  1382. !     my($self,$path) = @_;
  1383. !     $path;
  1384. ! }
  1385. ! =item lsdir
  1386. ! Takes as arguments a directory name and a regular expression. Returns
  1387. ! all entries in the directory that match the regular expression.
  1388.   
  1389. ! =cut
  1390.   
  1391. ! sub lsdir {
  1392. !     my($self) = shift;
  1393. !     my($dir, $regex) = @_;
  1394. !     my(@ls);
  1395. !     my $dh = new DirHandle;
  1396. !     $dh->open($dir || ".") or return ();
  1397. !     @ls = $dh->read;
  1398. !     $dh->close;
  1399. !     @ls = grep(/$regex/, @ls) if $regex;
  1400. !     @ls;
  1401. ! }
  1402.   
  1403. ! =item path
  1404.   
  1405. ! Takes no argument, returns the environment variable PATH as an array.
  1406.   
  1407. ! =cut
  1408.   
  1409. ! sub path {
  1410. !     my($self) = @_;
  1411. !     my $path_sep = $Is_OS2 ? ";" : ":";
  1412. !     my $path = $ENV{PATH};
  1413. !     $path =~ s:\\:/:g if $Is_OS2;
  1414. !     my @path = split $path_sep, $path;
  1415. ! }
  1416.   
  1417. ! =item replace_manpage_separator
  1418.   
  1419. - Takes the name of a package, which may be a nested package, in the
  1420. - form Foo/Bar and replaces the slash with C<::>. Returns the replacement.
  1421.   
  1422. ! =cut
  1423. ! sub replace_manpage_separator {
  1424. !     my($self,$man) = @_;
  1425. !     $man =~ s,/+,::,g;
  1426. !     $man;
  1427. ! }
  1428.   
  1429. ! =item file_name_is_absolute
  1430.   
  1431. ! Takes as argument a path and returns true, it it is an absolute path.
  1432.   
  1433. ! =cut
  1434.   
  1435. - sub file_name_is_absolute {
  1436. -     my($self,$file) = @_;
  1437. -     $file =~ m:^/: ;
  1438.   }
  1439.   
  1440. ! =item prefixify
  1441. ! Check a path variable in $self from %Config, if it contains a prefix,
  1442. ! and replace it with another one.
  1443.   
  1444. ! Takes as arguments an attribute name, a search prefix and a
  1445. ! replacement prefix. Changes the attribute in the object.
  1446.   
  1447.   =cut
  1448.   
  1449. ! sub prefixify {
  1450. !     my($self,$var,$sprefix,$rprefix) = @_;
  1451. !     $self->{uc $var} ||= $Config{lc $var};
  1452. !     $self->{uc $var} = VMS::Filespec::unixpath($self->{uc $var}) if $Is_VMS;
  1453. !     $self->{uc $var} =~ s/\Q$sprefix\E/$rprefix/;
  1454. ! }
  1455. ! =item maybe_command_in_dirs
  1456. ! method under development. Not yet used. Ask Ilya :-)
  1457.   
  1458. ! =cut
  1459.   
  1460. ! sub maybe_command_in_dirs {    # $ver is optional argument if looking for perl
  1461. ! # Ilya's suggestion. Not yet used, want to understand it first, but at least the code is here
  1462. !     my($self, $names, $dirs, $trace, $ver) = @_;
  1463. !     my($name, $dir);
  1464. !     foreach $dir (@$dirs){
  1465. !     next unless defined $dir; # $self->{PERL_SRC} may be undefined
  1466. !     foreach $name (@$names){
  1467. !         my($abs,$tryabs);
  1468. !         if ($self->file_name_is_absolute($name)) {
  1469. !         $abs = $name;
  1470. !         } elsif ($name =~ m|/|) {
  1471. !         $abs = $self->catfile(".", $name); # not absolute
  1472. !         } else {
  1473. !         $abs = $self->catfile($dir, $name);
  1474. !         }
  1475. !         print "Checking $abs for $name\n" if ($trace >= 2);
  1476. !         next unless $tryabs = $self->maybe_command($abs);
  1477. !         print "Substituting $tryabs instead of $abs\n"
  1478. !         if ($trace >= 2 and $tryabs ne $abs);
  1479. !         $abs = $tryabs;
  1480. !         if (defined $ver) {
  1481. !         print "Executing $abs\n" if ($trace >= 2);
  1482. !         if (`$abs -e 'require $ver; print "VER_OK\n" ' 2>&1` =~ /VER_OK/) {
  1483. !             print "Using PERL=$abs\n" if $trace;
  1484. !             return $abs;
  1485. !         }
  1486. !         } else { # Do not look for perl
  1487. !         return $abs;
  1488. !         }
  1489. !     }
  1490.       }
  1491.   }
  1492.   
  1493. ! =item maybe_command
  1494.   
  1495. ! Returns true, if the argument is likely to be a command.
  1496.   
  1497.   =cut
  1498.   
  1499. ! sub maybe_command {
  1500. !     my($self,$file) = @_;
  1501. !     return $file if -x $file && ! -d $file;
  1502. !     return;
  1503.   }
  1504.   
  1505. ! =item perl_script
  1506.   
  1507. ! Returns true, if the argument is likely to be a perl script. On
  1508. ! MM_Unix this is true for any ordinary, readable file.
  1509.   
  1510.   =cut
  1511.   
  1512. ! sub perl_script {
  1513. !     my($self,$file) = @_;
  1514. !     return 1 if -r $file && ! -d $file;
  1515. !     return;
  1516.   }
  1517.   
  1518. ! =item guess_name
  1519.   
  1520. ! Guess the name of this package by examining the working directory's
  1521. ! name. MakeMaker calls this only if the developer has not supplied a
  1522. ! NAME attribute.
  1523.   
  1524.   =cut
  1525.   
  1526. ! # ';
  1527. ! sub guess_name {
  1528. !     my($self) = @_;
  1529. !     use Cwd 'cwd';
  1530. !     my $name = cwd();
  1531. !     $name =~ s:.*/:: unless ($name =~ s:^.*/ext/::);
  1532. !     $name =~ s#/#::#g;
  1533. !     $name =~  s#[\-_][\d.\-]+$##;  # this is new with MM 5.00
  1534. !     $name;
  1535.   }
  1536.   
  1537. ! =item init_main
  1538.   
  1539. ! Initializes NAME, FULLEXT, BASEEXT, ROOTEXT, DLBASE, PERL_SRC,
  1540. ! PERL_LIB, PERL_ARCHLIB, PERL_INC, INSTALLDIRS, INST_*, INSTALL*,
  1541. ! PREFIX, CONFIG, AR, AR_STATIC_ARGS, LD, OBJ_EXT, LIB_EXT, MAP_TARGET,
  1542. ! LIBPERL_A, VERSION_FROM, VERSION, DISTNAME, VERSION_SYM.
  1543.   
  1544.   =cut
  1545.   
  1546. ! sub init_main {
  1547.       my($self) = @_;
  1548. !     unless (ref $self){
  1549. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  1550. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  1551. !     }
  1552. !     # --- Initialize Module Name and Paths
  1553. !     # NAME    = The perl module name for this extension (eg DBD::Oracle).
  1554. !     # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
  1555. !     # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
  1556. !     # ROOTEXT = Directory part of FULLEXT with leading /.
  1557. !     ($self->{FULLEXT} =
  1558. !      $self->{NAME}) =~ s!::!/!g ;                     #eg. BSD/Foo/Socket
  1559.   
  1560. !     # Copied from DynaLoader:
  1561.   
  1562. !     my(@modparts) = split(/::/,$self->{NAME});
  1563. !     my($modfname) = $modparts[-1];
  1564.   
  1565. !     # Some systems have restrictions on files names for DLL's etc.
  1566. !     # mod2fname returns appropriate file base name (typically truncated)
  1567. !     # It may also edit @modparts if required.
  1568. !     if (defined &DynaLoader::mod2fname) {
  1569. !         $modfname = &DynaLoader::mod2fname(\@modparts);
  1570. !     } elsif ($Is_OS2) {                # Need manual correction if run with miniperl:-(
  1571. !         $modfname = substr($modfname, 0, 7) . '_';
  1572.       }
  1573.   
  1574.   
  1575. !     ($self->{BASEEXT} =
  1576. !      $self->{NAME}) =~ s!.*::!! ;                     #eg. Socket
  1577. !     if (defined &DynaLoader::mod2fname or $Is_OS2) {
  1578. !     # As of 5.001m, dl_os2 appends '_'
  1579. !     $self->{DLBASE} = $modfname;                    #eg. Socket_
  1580. !     } else {
  1581. !     $self->{DLBASE} = '$(BASEEXT)';
  1582. !     }
  1583. !     ($self->{ROOTEXT} =
  1584. !      $self->{FULLEXT}) =~ s#/?\Q$self->{BASEEXT}\E$## ;      #eg. /BSD/Foo
  1585.   
  1586. !     $self->{ROOTEXT} = ($Is_VMS ? '' : '/') . $self->{ROOTEXT} if $self->{ROOTEXT};
  1587.   
  1588.   
  1589. !     # --- Initialize PERL_LIB, INST_LIB, PERL_SRC
  1590.   
  1591. !     # *Real* information: where did we get these two from? ...
  1592. !     my $inc_config_dir = dirname($INC{'Config.pm'});
  1593. !     my $inc_carp_dir   = dirname($INC{'Carp.pm'});
  1594. !     unless ($self->{PERL_SRC}){
  1595. !     my($dir);
  1596. !     foreach $dir (qw(.. ../.. ../../..)){
  1597. !         if ( -f "$dir/config.sh"
  1598. !         && -f "$dir/perl.h"
  1599. !         && -f "$dir/lib/Exporter.pm") {
  1600. !         $self->{PERL_SRC}=$dir ;
  1601. !         last;
  1602. !         }
  1603. !     }
  1604.       }
  1605. -     if ($self->{PERL_SRC}){
  1606. -     $self->{PERL_LIB}     ||= $self->catdir("$self->{PERL_SRC}","lib");
  1607. -     $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
  1608. -     $self->{PERL_INC}     = $self->{PERL_SRC};
  1609. -     # catch a situation that has occurred a few times in the past:
  1610. -     warn <<EOM unless (-s $self->catfile($self->{PERL_SRC},'cflags') or $Is_VMS && -s $self->catfile($self->{PERL_SRC},'perlshr_attr.opt'));
  1611. - You cannot build extensions below the perl source tree after executing
  1612. - a 'make clean' in the perl source tree.
  1613. - To rebuild extensions distributed with the perl source you should
  1614. - simply Configure (to include those extensions) and then build perl as
  1615. - normal. After installing perl the source tree can be deleted. It is
  1616. - not needed for building extensions by running 'perl Makefile.PL'
  1617. - usually without extra arguments.
  1618.   
  1619. ! It is recommended that you unpack and build additional extensions away
  1620. ! from the perl source tree.
  1621. ! EOM
  1622. !     } else {
  1623. !     # we should also consider $ENV{PERL5LIB} here
  1624. !     $self->{PERL_LIB}     ||= $Config::Config{privlibexp};
  1625. !     $self->{PERL_ARCHLIB} ||= $Config::Config{archlibexp};
  1626. !     $self->{PERL_INC}     = $self->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now
  1627. !     my $perl_h;
  1628. !     die <<EOM unless (-f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h")));
  1629. ! Error: Unable to locate installed Perl libraries or Perl source code.
  1630.   
  1631. ! It is recommended that you install perl in a standard location before
  1632. ! building extensions. You can say:
  1633.   
  1634. !     $^X Makefile.PL PERL_SRC=/path/to/perl/source/directory
  1635.   
  1636. ! if you have not yet installed perl but still want to build this
  1637. ! extension now.
  1638. ! (You get this message, because MakeMaker could not find "$perl_h")
  1639. ! EOM
  1640.   
  1641. ! #     print STDOUT "Using header files found in $self->{PERL_INC}\n"
  1642. ! #         if $Verbose && $self->needs_linking();
  1643.   
  1644. !     }
  1645.   
  1646. !     # We get SITELIBEXP and SITEARCHEXP directly via
  1647. !     # Get_from_Config. When we are running standard modules, these
  1648. !     # won't matter, we will set INSTALLDIRS to "perl". Otherwise we
  1649. !     # set it to "site". I prefer that INSTALLDIRS be set from outside
  1650. !     # MakeMaker.
  1651. !     $self->{INSTALLDIRS} ||= "site";
  1652.   
  1653. !     # INST_LIB typically pre-set if building an extension after
  1654. !     # perl has been built and installed. Setting INST_LIB allows
  1655. !     # you to build directly into, say $Config::Config{privlibexp}.
  1656. !     unless ($self->{INST_LIB}){
  1657.   
  1658.   
  1659. !     ##### XXXXX We have to change this nonsense
  1660.   
  1661. !     if (defined $self->{PERL_SRC} and $self->{INSTALLDIRS} eq "perl") {
  1662. !         $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB};
  1663. !     } else {
  1664. !         $self->{INST_LIB} = $self->catdir(".","blib","lib");
  1665. !     }
  1666.       }
  1667. !     $self->{INST_ARCHLIB} ||= $self->catdir(".","blib","arch");
  1668. !     $self->{INST_EXE} ||= $self->catdir('.','blib','bin');
  1669.   
  1670. !     # The user who requests an installation directory explicitly
  1671. !     # should not have to tell us a architecture installation directory
  1672. !     # as well We look if a directory exists that is named after the
  1673. !     # architecture. If not we take it as a sign that it should be the
  1674. !     # same as the requested installation directory. Otherwise we take
  1675. !     # the found one.
  1676. !     # We do the same thing twice: for privlib/archlib and for sitelib/sitearch
  1677. !     my($libpair);
  1678. !     for $libpair ({l=>"privlib", a=>"archlib"}, {l=>"sitelib", a=>"sitearch"}) {
  1679. !     my $lib = "install$libpair->{l}";
  1680. !     my $Lib = uc $lib;
  1681. !     my $Arch = uc "install$libpair->{a}";
  1682. !     if( $self->{$Lib} && ! $self->{$Arch} ){
  1683. !         my($ilib) = $Config{$lib};
  1684. !         $ilib = VMS::Filespec::unixify($ilib) if $Is_VMS;
  1685.   
  1686. !         $self->prefixify($Arch,$ilib,$self->{$Lib});
  1687.   
  1688. !         unless (-d $self->{$Arch}) {
  1689. !         print STDOUT "Directory $self->{$Arch} not found, thusly\n" if $Verbose;
  1690. !         $self->{$Arch} = $self->{$Lib};
  1691. !         }
  1692. !         print STDOUT "Defaulting $Arch to $self->{$Arch}\n" if $Verbose;
  1693. !     }
  1694. !     }
  1695.   
  1696. !     # we have to look at the relation between $Config{prefix} and the
  1697. !     # requested values. We're going to set the $Config{prefix} part of
  1698. !     # all the installation path variables to literally $(PREFIX), so
  1699. !     # the user can still say make PREFIX=foo
  1700. !     my($prefix) = $Config{'prefix'};
  1701. !     $prefix = VMS::Filespec::unixify($prefix) if $Is_VMS;
  1702. !     unless ($self->{PREFIX}){
  1703. !     $self->{PREFIX} = $prefix;
  1704. !     }
  1705. !     my($install_variable);
  1706. !     for $install_variable (qw/INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN INSTALLMAN1DIR
  1707. !                INSTALLMAN3DIR INSTALLSITELIB INSTALLSITEARCH/) {
  1708. !     $self->prefixify($install_variable,$prefix,q[$(PREFIX)]);
  1709. !     }
  1710.   
  1711.   
  1712. !     # Now we head at the manpages. Maybe they DO NOT want manpages
  1713. !     # installed
  1714. !     $self->{INSTALLMAN1DIR} = $Config::Config{installman1dir}
  1715. !     unless defined $self->{INSTALLMAN1DIR};
  1716. !     unless (defined $self->{INST_MAN1DIR}){
  1717. !     if ($self->{INSTALLMAN1DIR} =~ /^(none|\s*)$/){
  1718. !         $self->{INST_MAN1DIR} = $self->{INSTALLMAN1DIR};
  1719. !     } else {
  1720. !         $self->{INST_MAN1DIR} = $self->catdir('.','blib','man1');
  1721. !     }
  1722. !     }
  1723. !     $self->{MAN1EXT} ||= $Config::Config{man1ext};
  1724.   
  1725. !     $self->{INSTALLMAN3DIR} = $Config::Config{installman3dir}
  1726. !     unless defined $self->{INSTALLMAN3DIR};
  1727. !     unless (defined $self->{INST_MAN3DIR}){
  1728. !     if ($self->{INSTALLMAN3DIR} =~ /^(none|\s*)$/){
  1729. !         $self->{INST_MAN3DIR} = $self->{INSTALLMAN3DIR};
  1730. !     } else {
  1731. !         $self->{INST_MAN3DIR} = $self->catdir('.','blib','man3');
  1732. !     }
  1733.       }
  1734. !     $self->{MAN3EXT} ||= $Config::Config{man3ext};
  1735.   
  1736.   
  1737. !     # Get some stuff out of %Config if we haven't yet done so
  1738. !     print STDOUT "CONFIG must be an array ref\n"
  1739. !     if ($self->{CONFIG} and ref $self->{CONFIG} ne 'ARRAY');
  1740. !     $self->{CONFIG} = [] unless (ref $self->{CONFIG});
  1741. !     push(@{$self->{CONFIG}}, @ExtUtils::MakeMaker::Get_from_Config);
  1742. !     push(@{$self->{CONFIG}}, 'shellflags') if $Config::Config{shellflags};
  1743. !     my(%once_only,$m);
  1744. !     foreach $m (@{$self->{CONFIG}}){
  1745. !     next if $once_only{$m};
  1746. !     print STDOUT "CONFIG key '$m' does not exist in Config.pm\n"
  1747. !         unless exists $Config::Config{$m};
  1748. !     $self->{uc $m} ||= $Config::Config{$m};
  1749. !     $once_only{$m} = 1;
  1750. !     }
  1751.   
  1752. ! # This is too dangerous:
  1753. ! #    if ($^O eq "next") {
  1754. ! #    $self->{AR} = "libtool";
  1755. ! #    $self->{AR_STATIC_ARGS} = "-o";
  1756. ! #    }
  1757. ! # But I leave it as a placeholder
  1758.   
  1759. !     $self->{AR_STATIC_ARGS} ||= "cr";
  1760.   
  1761. !     # These should never be needed
  1762. !     $self->{LD} ||= 'ld';
  1763. !     $self->{OBJ_EXT} ||= '.o';
  1764. !     $self->{LIB_EXT} ||= '.a';
  1765.   
  1766. !     $self->{MAP_TARGET} ||= "perl";
  1767.   
  1768. !     $self->{LIBPERL_A} ||= "libperl$self->{LIB_EXT}";
  1769.   
  1770. !     # make a simple check if we find Exporter
  1771. !     warn "Warning: PERL_LIB ($self->{PERL_LIB}) seems not to be a perl library directory
  1772. !         (Exporter.pm not found)"
  1773. !     unless -f $self->catfile("$self->{PERL_LIB}","Exporter.pm") ||
  1774. !         $self->{NAME} eq "ExtUtils::MakeMaker";
  1775. !     # Determine VERSION and VERSION_FROM
  1776. !     ($self->{DISTNAME}=$self->{NAME}) =~ s#(::)#-#g unless $self->{DISTNAME};
  1777. !     if ($self->{VERSION_FROM}){
  1778. ! #    use FileHandle ();
  1779. ! #    my $fh = new FileHandle;
  1780. !     local *FH;
  1781. ! #    $fh->open($self->{VERSION_FROM}) or die "Could not open '$self->{VERSION_FROM}' (attribute VERSION_FROM): $!";
  1782. !     open(FH,$self->{VERSION_FROM}) or
  1783. !         die "Could not open '$self->{VERSION_FROM}' (attribute VERSION_FROM): $!";
  1784. ! #    while (<$fh>) {
  1785. !     while (<FH>) {
  1786. !         chop;
  1787. !         next unless /\$([\w:]*\bVERSION)\b.*=/;
  1788. !         local $ExtUtils::MakeMaker::module_version_variable = $1;
  1789. !         my($eval) = "$_;";
  1790. !         eval $eval;
  1791. !         die "Could not eval '$eval': $@" if $@;
  1792. !         if ($self->{VERSION} = $ {$ExtUtils::MakeMaker::module_version_variable}){
  1793. !         print "$self->{NAME} VERSION is $self->{VERSION} (from $self->{VERSION_FROM})\n" if $Verbose;
  1794. !         } else {
  1795. !         # XXX this should probably croak
  1796. !         print "WARNING: Setting VERSION via file '$self->{VERSION_FROM}' failed\n";
  1797. !         }
  1798. !         last;
  1799. !     }
  1800. ! #    close $fh;
  1801. !     close FH;
  1802. !     }
  1803. !     # if your FOO.pm says
  1804. !     #    $VERSION = substr(q$Revision: 1.14 $, 10);
  1805. !     # then MM says something like
  1806. !     #    -DXS_VERSION=\"n.nn \"
  1807. !     if ($self->{VERSION}) {
  1808. !     $self->{VERSION} =~ s/^\s+//;
  1809. !     $self->{VERSION} =~ s/\s+$//;
  1810. !     }
  1811. !     $self->{VERSION} = "0.10" unless $self->{VERSION};
  1812. !     ($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g;
  1813.   
  1814.   
  1815. !     # Graham Barr and Paul Marquess had some ideas how to ensure
  1816. !     # version compatibility between the *.pm file and the
  1817. !     # corresponding *.xs file. The bottomline was, that we need an
  1818. !     # XS_VERSION macro that defaults to VERSION:
  1819. !     $self->{XS_VERSION} ||= $self->{VERSION};
  1820.   
  1821. !     # --- Initialize Perl Binary Locations
  1822.   
  1823. !     # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
  1824. !     # will be working versions of perl 5. miniperl has priority over perl
  1825. !     # for PERL to ensure that $(PERL) is usable while building ./ext/*
  1826. !     my ($component,@defpath);
  1827. !     foreach $component ($self->{PERL_SRC}, $self->path(), $Config::Config{binexp}) {
  1828. !     push @defpath, $component if defined $component;
  1829. !     }
  1830. !     $self->{PERL} =
  1831. !         $self->find_perl(5.0, [ $^X, 'miniperl','perl','perl5',"perl$]" ],
  1832. !         \@defpath, $Verbose ) unless ($self->{PERL});
  1833. !     # don't check if perl is executable, maybe they have decided to
  1834. !     # supply switches with perl
  1835.   
  1836. !     # Define 'FULLPERL' to be a non-miniperl (used in test: target)
  1837. !     ($self->{FULLPERL} = $self->{PERL}) =~ s/miniperl/perl/i
  1838. !     unless ($self->{FULLPERL});
  1839.   }
  1840.   
  1841. ! =item init_dirscan
  1842.   
  1843. ! Initializes DIR, XS, PM, C, O_FILES, H, PL_FILES, MAN*PODS, EXE_FILES.
  1844.   
  1845.   =cut
  1846.   
  1847. ! sub init_dirscan {    # --- File and Directory Lists (.xs .pm .pod etc)
  1848. !     my($self) = @_;
  1849. !     unless (ref $self){
  1850. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  1851. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  1852. !     }
  1853. !     my($name, %dir, %xs, %c, %h, %ignore, %pl_files, %manifypods);
  1854. !     local(%pm); #the sub in find() has to see this hash
  1855. !     $ignore{'test.pl'} = 1;
  1856. !     $ignore{'makefile.pl'} = 1 if $Is_VMS;
  1857. !     foreach $name ($self->lsdir(".")){
  1858. !     next if ($name =~ /^\./ or $ignore{$name});
  1859. !     next unless $self->libscan($name);
  1860. !     if (-d $name){
  1861. !         $dir{$name} = $name if (-f "$name/Makefile.PL");
  1862. !     } elsif ($name =~ /\.xs$/){
  1863. !         my($c); ($c = $name) =~ s/\.xs$/.c/;
  1864. !         $xs{$name} = $c;
  1865. !         $c{$c} = 1;
  1866. !     } elsif ($name =~ /\.c(pp|xx|c)?$/i){  # .c .C .cpp .cxx .cc
  1867. !         $c{$name} = 1
  1868. !         unless $name =~ m/perlmain\.c/; # See MAP_TARGET
  1869. !     } elsif ($name =~ /\.h$/i){
  1870. !         $h{$name} = 1;
  1871. !     } elsif ($name =~ /\.(p[ml]|pod)$/){
  1872. !         $pm{$name} = $self->catfile('$(INST_LIBDIR)',$name);
  1873. !     } elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") {
  1874. !         ($pl_files{$name} = $name) =~ s/\.PL$// ;
  1875. !     } elsif ($Is_VMS && $name =~ /\.pl$/ && $name ne 'makefile.pl' &&
  1876. !              $name ne 'test.pl') {  # case-insensitive filesystem
  1877. !         ($pl_files{$name} = $name) =~ s/\.pl$// ;
  1878. !     }
  1879. !     }
  1880. !     # Some larger extensions often wish to install a number of *.pm/pl
  1881. !     # files into the library in various locations.
  1882. !     # The attribute PMLIBDIRS holds an array reference which lists
  1883. !     # subdirectories which we should search for library files to
  1884. !     # install. PMLIBDIRS defaults to [ 'lib', $self->{BASEEXT} ].  We
  1885. !     # recursively search through the named directories (skipping any
  1886. !     # which don't exist or contain Makefile.PL files).
  1887. !     # For each *.pm or *.pl file found $self->libscan() is called with
  1888. !     # the default installation path in $_[1]. The return value of
  1889. !     # libscan defines the actual installation location.  The default
  1890. !     # libscan function simply returns the path.  The file is skipped
  1891. !     # if libscan returns false.
  1892. !     # The default installation location passed to libscan in $_[1] is:
  1893. !     #
  1894. !     #  ./*.pm        => $(INST_LIBDIR)/*.pm
  1895. !     #  ./xyz/...    => $(INST_LIBDIR)/xyz/...
  1896. !     #  ./lib/...    => $(INST_LIB)/...
  1897. !     #
  1898. !     # In this way the 'lib' directory is seen as the root of the actual
  1899. !     # perl library whereas the others are relative to INST_LIBDIR
  1900. !     # (which includes ROOTEXT). This is a subtle distinction but one
  1901. !     # that's important for nested modules.
  1902. !     $self->{PMLIBDIRS} = ['lib', $self->{BASEEXT}]
  1903. !     unless $self->{PMLIBDIRS};
  1904. !     #only existing directories that aren't in $dir are allowed
  1905. !     # Avoid $_ wherever possible:
  1906. !     # @{$self->{PMLIBDIRS}} = grep -d && !$dir{$_}, @{$self->{PMLIBDIRS}};
  1907. !     my (@pmlibdirs) = @{$self->{PMLIBDIRS}};
  1908. !     my ($pmlibdir);
  1909. !     @{$self->{PMLIBDIRS}} = ();
  1910. !     foreach $pmlibdir (@pmlibdirs) {
  1911. !     -d $pmlibdir && !$dir{$pmlibdir} && push @{$self->{PMLIBDIRS}}, $pmlibdir;
  1912. !     }
  1913. !     if (@{$self->{PMLIBDIRS}}){
  1914. !     print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n"
  1915. !         if ($Verbose >= 2);
  1916. !     require File::Find;
  1917. !     File::Find::find(sub {
  1918. !         if (-d $_){
  1919. !         if ($_ eq "CVS" || $_ eq "RCS"){
  1920. !             $File::Find::prune = 1;
  1921. !         }
  1922. !         return;
  1923. !         }
  1924. !         my($path, $prefix) = ($File::Find::name, '$(INST_LIBDIR)');
  1925. !         my($striplibpath,$striplibname);
  1926. !         $prefix =  '$(INST_LIB)' if (($striplibpath = $path) =~ s:^(\W*)lib\W:$1:);
  1927. !         ($striplibname,$striplibpath) = fileparse($striplibpath);
  1928. !         my($inst) = $self->catfile($prefix,$striplibpath,$striplibname);
  1929. !         local($_) = $inst; # for backwards compatibility
  1930. !         $inst = $self->libscan($inst);
  1931. !         print "libscan($path) => '$inst'\n" if ($Verbose >= 2);
  1932. !         return unless $inst;
  1933. !         $pm{$path} = $inst;
  1934. !     }, @{$self->{PMLIBDIRS}});
  1935. !     }
  1936. !     $self->{DIR} = [sort keys %dir] unless $self->{DIR};
  1937. !     $self->{XS}  = \%xs             unless $self->{XS};
  1938. !     $self->{PM}  = \%pm             unless $self->{PM};
  1939. !     $self->{C}   = [sort keys %c]   unless $self->{C};
  1940. !     my(@o_files) = @{$self->{C}};
  1941. !     $self->{O_FILES} = [grep s/\.c(pp|xx|c)?$/$self->{OBJ_EXT}/i, @o_files] ;
  1942. !     $self->{H}   = [sort keys %h]   unless $self->{H};
  1943. !     $self->{PL_FILES} = \%pl_files unless $self->{PL_FILES};
  1944.   
  1945. !     # Set up names of manual pages to generate from pods
  1946. !     if ($self->{MAN1PODS}) {
  1947. !     } elsif ( $self->{INST_MAN1DIR} =~ /^(none|\s*)$/ ) {
  1948. !         $self->{MAN1PODS} = {};
  1949. !     } else {
  1950. !     my %manifypods = ();
  1951. !     if ( exists $self->{EXE_FILES} ) {
  1952. !         foreach $name (@{$self->{EXE_FILES}}) {
  1953. ! #        use FileHandle ();
  1954. ! #        my $fh = new FileHandle;
  1955. !         local *FH;
  1956. !         my($ispod)=0;
  1957. !         # one day test, if $/ can be set to '' safely (is the bug fixed that was in 5.001m?)
  1958. ! #        if ($fh->open("<$name")) {
  1959. !         if (open(FH,"<$name")) {
  1960. !             my $testpodline;
  1961. ! #            while ($testpodline = <$fh>) {
  1962. !             while ($testpodline = <FH>) {
  1963. !             if($testpodline =~ /^=head1\s+\w+/) {
  1964. !                 $ispod=1;
  1965. !                 last;
  1966. !             }
  1967. !             }
  1968. ! #            $fh->close;
  1969. !             close FH;
  1970. !         } else {
  1971. !             # If it doesn't exist yet, we assume, it has pods in it
  1972. !             $ispod = 1;
  1973. !         }
  1974. !         if( $ispod ) {
  1975. !             $manifypods{$name} = $self->catfile('$(INST_MAN1DIR)',basename($name).'.$(MAN1EXT)');
  1976. !         }
  1977. !         }
  1978. !     }
  1979. !     $self->{MAN1PODS} = \%manifypods;
  1980. !     }
  1981. !     if ($self->{MAN3PODS}) {
  1982. !     } elsif ( $self->{INST_MAN3DIR} =~ /^(none|\s*)$/ ) {
  1983. !         $self->{MAN3PODS} = {};
  1984. !     } else {
  1985. !     my %manifypods = (); # we collect the keys first, i.e. the files
  1986. !                  # we have to convert to pod
  1987. !     foreach $name (keys %{$self->{PM}}) {
  1988. !         if ($name =~ /\.pod$/ ) {
  1989. !         $manifypods{$name} = $self->{PM}{$name};
  1990. !         } elsif ($name =~ /\.p[ml]$/ ) {
  1991. ! #        use FileHandle ();
  1992. ! #        my $fh = new FileHandle;
  1993. !         local *FH;
  1994. !         my($ispod)=0;
  1995. ! #        $fh->open("<$name");
  1996. !         open(FH,"<$name");
  1997. !         my $testpodline;
  1998. ! #        while ($testpodline = <$fh>) {
  1999. !         while ($testpodline = <FH>) {
  2000. !             if($testpodline =~ /^=head1\s+\w+/) {
  2001. !             $ispod=1;
  2002. !             last;
  2003. !             }
  2004. !             #Speculation on the future (K.A., not A.K. :)
  2005. !             #if(/^=don't\S+install/) { $ispod=0; last}
  2006. !         }
  2007. ! #        $fh->close;
  2008. !         close FH;
  2009.   
  2010. !         if( $ispod ) {
  2011. !             $manifypods{$name} = $self->{PM}{$name};
  2012. !         }
  2013. !         }
  2014. !     }
  2015.   
  2016. !     # Remove "Configure.pm" and similar, if it's not the only pod listed
  2017. !     # To force inclusion, just name it "Configure.pod", or override MAN3PODS
  2018. !     foreach $name (keys %manifypods) {
  2019. !         if ($name =~ /(config|setup).*\.pm/i) {
  2020. !         delete $manifypods{$name};
  2021. !         next;
  2022. !         }
  2023. !         my($manpagename) = $name;
  2024. !         unless ($manpagename =~ s!^(\W*)lib\W!$1!) {
  2025. !         $manpagename = $self->catfile($self->{ROOTEXT},$manpagename);
  2026. !         }
  2027. !         $manpagename =~ s/\.p(od|m|l)$//;
  2028. !         # Strip leading slashes
  2029. !         $manpagename =~ s!^/+!!;
  2030. !         # Turn other slashes into colons
  2031. ! #        $manpagename =~ s,/+,::,g;
  2032. !         $manpagename = $self->replace_manpage_separator($manpagename);
  2033. !         $manifypods{$name} = $self->catfile("\$(INST_MAN3DIR)","$manpagename.\$(MAN3EXT)");
  2034. !     }
  2035. !     $self->{MAN3PODS} = \%manifypods;
  2036. !     }
  2037.   }
  2038.   
  2039. ! =item init_others
  2040.   
  2041. ! Initializes EXTRALIBS, BSLOADLIBS, LDLOADLIBS, LIBS, LD_RUN_PATH,
  2042. ! OBJECT, BOOTDEP, PERLMAINCC, LDFROM, LINKTYPE, NOOP, FIRST_MAKEFILE,
  2043. ! MAKEFILE, NOECHO, RM_F, RM_RF, TOUCH, CP, MV, CHMOD, UMASK_NULL
  2044.   
  2045.   =cut
  2046.   
  2047. ! sub init_others {    # --- Initialize Other Attributes
  2048.       my($self) = shift;
  2049. !     unless (ref $self){
  2050. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2051. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2052. !     }
  2053.   
  2054. !     # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS}
  2055. !     # Lets look at $self->{LIBS} carefully: It may be an anon array, a string or
  2056. !     # undefined. In any case we turn it into an anon array:
  2057.   
  2058. !     # May check $Config{libs} too, thus not empty.
  2059. !     $self->{LIBS}=[''] unless $self->{LIBS};
  2060.   
  2061. !     $self->{LIBS}=[$self->{LIBS}] if ref \$self->{LIBS} eq SCALAR;
  2062. !     $self->{LD_RUN_PATH} = "";
  2063. !     my($libs);
  2064. !     foreach $libs ( @{$self->{LIBS}} ){
  2065. !     $libs =~ s/^\s*(.*\S)\s*$/$1/; # remove leading and trailing whitespace
  2066. !     my(@libs) = $self->extliblist($libs);
  2067. !     if ($libs[0] or $libs[1] or $libs[2]){
  2068. !         # LD_RUN_PATH now computed by ExtUtils::Liblist
  2069. !         ($self->{EXTRALIBS}, $self->{BSLOADLIBS}, $self->{LDLOADLIBS}, $self->{LD_RUN_PATH}) = @libs;
  2070. !         last;
  2071. !     }
  2072. !     }
  2073.   
  2074. !     if ( $self->{OBJECT} ) {
  2075. !     $self->{OBJECT} =~ s!\.o(bj)?\b!\$(OBJ_EXT)!g;
  2076. !     }
  2077. !     else {
  2078. !     # init_dirscan should have found out, if we have C files
  2079. !     $self->{OBJECT} = "";
  2080. !     $self->{OBJECT} = '$(BASEEXT)$(OBJ_EXT)' if @{$self->{C}||[]};
  2081. !     }
  2082. !     $self->{OBJECT} =~ s/\n+/ \\\n\t/g;
  2083. !     $self->{BOOTDEP}  = (-f "$self->{BASEEXT}_BS") ? "$self->{BASEEXT}_BS" : "";
  2084. !     $self->{PERLMAINCC} ||= '$(CC)';
  2085. !     $self->{LDFROM} = '$(OBJECT)' unless $self->{LDFROM};
  2086.   
  2087. !     # Sanity check: don't define LINKTYPE = dynamic if we're skipping
  2088. !     # the 'dynamic' section of MM.  We don't have this problem with
  2089. !     # 'static', since we either must use it (%Config says we can't
  2090. !     # use dynamic loading) or the caller asked for it explicitly.
  2091. !     if (!$self->{LINKTYPE}) {
  2092. !        $self->{LINKTYPE} = $self->{SKIPHASH}{'dynamic'}
  2093. !                         ? 'static'
  2094. !                         : ($Config::Config{usedl} ? 'dynamic' : 'static');
  2095. !     };
  2096.   
  2097. !     # These get overridden for VMS and maybe some other systems
  2098. !     $self->{NOOP}  ||= "sh -c true";
  2099. !     $self->{FIRST_MAKEFILE} ||= "Makefile";
  2100. !     $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE};
  2101. !     $self->{MAKE_APERL_FILE} ||= "Makefile.aperl";
  2102. !     $self->{NOECHO} = '@' unless defined $self->{NOECHO};
  2103. !     $self->{RM_F}  ||= "rm -f";
  2104. !     $self->{RM_RF} ||= "rm -rf";
  2105. !     $self->{TOUCH} ||= "touch";
  2106. !     $self->{CP} ||= "cp";
  2107. !     $self->{MV} ||= "mv";
  2108. !     $self->{CHMOD} ||= "chmod";
  2109. !     $self->{UMASK_NULL} ||= "umask 0";
  2110. ! }
  2111.   
  2112. ! =item extliblist
  2113.   
  2114. ! Called by init_others, and calls ext ExtUtils::Liblist. See
  2115. ! L<ExtUtils::Liblist> for details.
  2116.   
  2117. ! =cut
  2118.   
  2119. ! sub extliblist {
  2120. !     my($self,$libs) = @_;
  2121. !     unless (ref $self){
  2122. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2123. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2124. !     }
  2125. !     require ExtUtils::Liblist;
  2126. !     $self->ext($libs, $Verbose);
  2127.   }
  2128.   
  2129. ! =item find_perl
  2130.   
  2131. ! Finds the executables PERL and FULLPERL
  2132.   
  2133.   =cut
  2134.   
  2135. ! sub find_perl {
  2136. !     my($self, $ver, $names, $dirs, $trace) = @_;
  2137. !     unless (ref $self){
  2138. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2139. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2140. !     }
  2141. !     my($name, $dir);
  2142. !     if ($trace >= 2){
  2143. !     print "Looking for perl $ver by these names:
  2144. ! @$names
  2145. ! in these dirs:
  2146. ! @$dirs
  2147. ! ";
  2148. !     }
  2149. !     foreach $dir (@$dirs){
  2150. !     next unless defined $dir; # $self->{PERL_SRC} may be undefined
  2151. !     foreach $name (@$names){
  2152. !         my $abs;
  2153. !         if ($self->file_name_is_absolute($name)) {
  2154. !         $abs = $name;
  2155. !         } elsif (($name =~ m|/|) && ($name !~ m|^\.{1,2}/|)) {
  2156. !         # name is a path that does not begin with dot or dotdot
  2157. !         $abs = $self->catfile(".", $name);
  2158. !         } else {
  2159. !         $abs = $self->catfile($dir, $name);
  2160. !         }
  2161. !         print "Checking $abs\n" if ($trace >= 2);
  2162. !         next unless $self->maybe_command($abs);
  2163. !         print "Executing $abs\n" if ($trace >= 2);
  2164. !         if (`$abs -e 'require $ver; print "VER_OK\n" ' 2>&1` =~ /VER_OK/) {
  2165. !             print "Using PERL=$abs\n" if $trace;
  2166. !             return $abs;
  2167. !         }
  2168. !     }
  2169. !     }
  2170. !     print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
  2171. !     0; # false and not empty
  2172.   }
  2173.   
  2174. ! =head2 Methods to actually produce chunks of text for the Makefile
  2175. ! The methods here are called in the order specified by
  2176. ! @ExtUtils::MakeMaker::MM_Sections. This manpage reflects the order as
  2177. ! well as possible. Some methods call each other, so in doubt refer to
  2178. ! the code.
  2179. ! =item post_initialize (o)
  2180.   
  2181. ! Returns an ampty string per default. Used in Makefile.PLs to add some
  2182. ! chunk of text to the Makefile after the object is initialized.
  2183.   
  2184.   =cut
  2185.   
  2186. ! sub post_initialize {
  2187.       my($self) = shift;
  2188. !     unless (ref $self){
  2189. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2190. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2191. !     }
  2192. !     "";
  2193.   }
  2194.   
  2195. ! =item const_config (o)
  2196.   
  2197. ! Defines a couple of constants in the Makefile that are inported from
  2198. ! %Config.
  2199.   
  2200.   =cut
  2201.   
  2202. ! sub const_config {
  2203. ! # --- Constants Sections ---
  2204.   
  2205. !     my($self) = shift;
  2206. !     unless (ref $self){
  2207. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2208. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2209. !     }
  2210. !     my(@m,$m);
  2211. !     push(@m,"\n# These definitions are from config.sh (via $INC{'Config.pm'})\n");
  2212. !     push(@m,"\n# They may have been overridden via Makefile.PL or on the command line\n");
  2213. !     my(%once_only);
  2214. !     foreach $m (@{$self->{CONFIG}}){
  2215. !     # SITE*EXP macros are defined in &constants; avoid duplicates here
  2216. !     next if $once_only{$m} or $m eq 'sitelibexp' or $m eq 'sitearchexp';
  2217. !     push @m, "\U$m\E = ".$self->{uc $m}."\n";
  2218. !     $once_only{$m} = 1;
  2219. !     }
  2220. !     join('', @m);
  2221. ! }
  2222.   
  2223. ! =item constants (o)
  2224.   
  2225. ! Initializes lots of constants and .SUFFIXES and .PHONY
  2226.   
  2227. ! =cut
  2228.   
  2229. ! sub constants {
  2230. !     my($self) = @_;
  2231. !     unless (ref $self){
  2232. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2233. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2234. !     }
  2235. !     my(@m,$tmp);
  2236.   
  2237. !     for $tmp (qw/
  2238. !           AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION VERSION_SYM XS_VERSION
  2239. !           INST_LIB INST_ARCHLIB INST_EXE PREFIX INSTALLDIRS INSTALLPRIVLIB
  2240. !           INSTALLARCHLIB INSTALLSITELIB INSTALLSITEARCH INSTALLBIN PERL_LIB
  2241. !           PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
  2242. !           FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC PERL_INC PERL FULLPERL
  2243. !           / ) {
  2244. !     next unless defined $self->{$tmp};
  2245. !     push @m, "$tmp = $self->{$tmp}\n";
  2246. !     }
  2247.   
  2248. !     push @m, qq{
  2249. ! VERSION_MACRO = VERSION
  2250. ! DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
  2251. ! XS_VERSION_MACRO = XS_VERSION
  2252. ! XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
  2253. ! };
  2254.   
  2255. !     push @m, qq{
  2256. ! MAKEMAKER = \$(PERL_LIB)/ExtUtils/MakeMaker.pm
  2257. ! MM_VERSION = $ExtUtils::MakeMaker::VERSION
  2258. ! };
  2259.   
  2260. !     push @m, q{
  2261. ! # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
  2262. ! # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
  2263. ! # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)
  2264. ! # DLBASE  = Basename part of dynamic library. May be just equal BASEEXT.
  2265. ! };
  2266.   
  2267. !     for $tmp (qw/
  2268. !           FULLEXT BASEEXT ROOTEXT DLBASE VERSION_FROM INC DEFINE OBJECT
  2269. !           LDFROM LINKTYPE
  2270. !           /    ) {
  2271. !     next unless defined $self->{$tmp};
  2272. !     push @m, "$tmp = $self->{$tmp}\n";
  2273. !     }
  2274.   
  2275. !     push @m, "
  2276. ! # Handy lists of source code files:
  2277. ! XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
  2278. ! C_FILES = ".join(" \\\n\t", @{$self->{C}})."
  2279. ! O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."
  2280. ! H_FILES = ".join(" \\\n\t", @{$self->{H}})."
  2281. ! MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."
  2282. ! MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."
  2283. ! ";
  2284.   
  2285. !     for $tmp (qw/
  2286. !           INST_MAN1DIR INSTALLMAN1DIR MAN1EXT INST_MAN3DIR INSTALLMAN3DIR MAN3EXT
  2287. !           /) {
  2288. !     next unless defined $self->{$tmp};
  2289. !     push @m, "$tmp = $self->{$tmp}\n";
  2290. !     }
  2291.   
  2292. !     push @m, "
  2293. ! # work around a famous dec-osf make(1) feature(?):
  2294. ! makemakerdflt: all
  2295.   
  2296. ! .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
  2297.   
  2298. ! # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
  2299. ! # some make implementations will delete the Makefile when we rebuild it. Because
  2300. ! # we call false(1) when we rebuild it. So make(1) is not completely wrong when it
  2301. ! # does so. Our milage may vary.
  2302. ! # .PRECIOUS: Makefile    # seems to be not necessary anymore
  2303.   
  2304. ! .PHONY: all config static dynamic test linkext manifest
  2305.   
  2306. ! # Where is the Config information that we are using/depend on
  2307. ! CONFIGDEP = \$(PERL_ARCHLIB)/Config.pm \$(PERL_INC)/config.h
  2308. ! ";
  2309.   
  2310. !     push @m, '
  2311. ! # Where to put things:
  2312. ! INST_LIBDIR     = $(INST_LIB)$(ROOTEXT)
  2313. ! INST_ARCHLIBDIR = $(INST_ARCHLIB)$(ROOTEXT)
  2314.   
  2315. ! INST_AUTODIR      = $(INST_LIB)/auto/$(FULLEXT)
  2316. ! INST_ARCHAUTODIR  = $(INST_ARCHLIB)/auto/$(FULLEXT)
  2317. ! ';
  2318.   
  2319. !     if ($self->has_link_code()) {
  2320. !     push @m, '
  2321. ! INST_STATIC  = $(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT)
  2322. ! INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(DLBASE).$(DLEXT)
  2323. ! INST_BOOT    = $(INST_ARCHAUTODIR)/$(BASEEXT).bs
  2324. ! ';
  2325. !     } else {
  2326. !     push @m, '
  2327. ! INST_STATIC  =
  2328. ! INST_DYNAMIC =
  2329. ! INST_BOOT    =
  2330.   ';
  2331. !     }
  2332.   
  2333. !     if ($Is_OS2) {
  2334. !     $tmp = "$self->{BASEEXT}.def";
  2335. !     } else {
  2336. !     $tmp = "";
  2337. !     }
  2338. !     push @m, "
  2339. ! EXPORT_LIST = $tmp
  2340. ! ";
  2341.   
  2342. !     if ($Is_OS2) {
  2343. !     $tmp = "\$(PERL_INC)/libperl.lib";
  2344. !     } else {
  2345. !     $tmp = "";
  2346. !     }
  2347. !     push @m, "
  2348. ! PERL_ARCHIVE = $tmp
  2349. ! ";
  2350.   
  2351. ! #    push @m, q{
  2352. ! #INST_PM = }.join(" \\\n\t", sort values %{$self->{PM}}).q{
  2353. ! #
  2354. ! #PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
  2355. ! #};
  2356.   
  2357. !     push @m, q{
  2358. ! TO_INST_PM = }.join(" \\\n\t", sort keys %{$self->{PM}}).q{
  2359.   
  2360. ! PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
  2361. ! };
  2362.   
  2363.       join('',@m);
  2364.   }
  2365.   
  2366. ! =item const_loadlibs
  2367.   
  2368. ! Defines EXTRALIBS, LDLOADLIBS, BSLOADLIBS, LD_RUN_PATH. See
  2369. ! L<ExtUtils::Liblist> for details.
  2370.   
  2371.   =cut
  2372.   
  2373. ! sub const_loadlibs {
  2374. !     my($self) = shift;
  2375. !     unless (ref $self){
  2376. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2377. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2378. !     }
  2379. !     return "" unless $self->needs_linking;
  2380. !     my @m;
  2381. !     push @m, qq{
  2382. ! # $self->{NAME} might depend on some other libraries:
  2383. ! # See ExtUtils::Liblist for details
  2384. ! #
  2385. ! };
  2386. !     my($tmp);
  2387. !     for $tmp (qw/
  2388. !      EXTRALIBS LDLOADLIBS BSLOADLIBS LD_RUN_PATH
  2389. !      /) {
  2390. !     next unless defined $self->{$tmp};
  2391. !     push @m, "$tmp = $self->{$tmp}\n";
  2392. !     }
  2393. !     return join "", @m;
  2394.   }
  2395.   
  2396. ! =item cflags
  2397.   
  2398. ! Does very much the same as the cflags script in the perl
  2399. ! distribution. It doesn't return the whole compiler command line, but
  2400. ! initializes all of its parts. The const_cccmd method then actually
  2401. ! returns the definition of the CCCMD macro which uses these parts.
  2402.   
  2403.   =cut
  2404.   
  2405. ! #'
  2406. ! sub cflags {
  2407. !     my($self,$libperl)=@_;
  2408. !     return $self->{CFLAGS} if $self->{CFLAGS};
  2409. !     return '' unless $self->needs_linking();
  2410.   
  2411. !     my($prog, $uc, $perltype, %cflags);
  2412. !     $libperl ||= $self->{LIBPERL_A} || "libperl$self->{LIB_EXT}" ;
  2413. !     $libperl =~ s/\.\$\(A\)$/$self->{LIB_EXT}/;
  2414.   
  2415. !     @cflags{qw(cc ccflags optimize large split shellflags)}
  2416. !     = @Config{qw(cc ccflags optimize large split shellflags)};
  2417. !     my($optdebug) = "";
  2418.   
  2419. !     $cflags{shellflags} ||= '';
  2420.   
  2421. !     my(%map) =  (
  2422. !         D =>   '-DDEBUGGING',
  2423. !         E =>   '-DEMBED',
  2424. !         DE =>  '-DDEBUGGING -DEMBED',
  2425. !         M =>   '-DEMBED -DMULTIPLICITY',
  2426. !         DM =>  '-DDEBUGGING -DEMBED -DMULTIPLICITY',
  2427. !         );
  2428.   
  2429. !     if ($libperl =~ /libperl(\w*)\Q$self->{LIB_EXT}/){
  2430. !     $uc = uc($1);
  2431. !     } else {
  2432. !     $uc = ""; # avoid warning
  2433. !     }
  2434. !     $perltype = $map{$uc} ? $map{$uc} : "";
  2435.   
  2436. !     if ($uc =~ /^D/) {
  2437. !     $optdebug = "-g";
  2438. !     }
  2439.   
  2440.   
  2441. !     my($name);
  2442. !     ( $name = $self->{NAME} . "_cflags" ) =~ s/:/_/g ;
  2443. !     if ($prog = $Config::Config{$name}) {
  2444. !     # Expand hints for this extension via the shell
  2445. !     print STDOUT "Processing $name hint:\n" if $Verbose;
  2446. !     my(@o)=`cc=\"$cflags{cc}\"
  2447. !       ccflags=\"$cflags{ccflags}\"
  2448. !       optimize=\"$cflags{optimize}\"
  2449. !       perltype=\"$cflags{perltype}\"
  2450. !       optdebug=\"$cflags{optdebug}\"
  2451. !       large=\"$cflags{large}\"
  2452. !       split=\"$cflags{'split'}\"
  2453. !       eval '$cflags{prog}'
  2454. !       echo cc=\$cflags{cc}
  2455. !       echo ccflags=\$cflags{ccflags}
  2456. !       echo optimize=\$cflags{optimize}
  2457. !       echo perltype=\$cflags{perltype}
  2458. !       echo optdebug=\$cflags{optdebug}
  2459. !       echo large=\$cflags{large}
  2460. !       echo split=\$cflags{'split'}
  2461. !       `;
  2462. !     my($line);
  2463. !     foreach $line (@o){
  2464. !         chomp $line;
  2465. !         if ($line =~ /(.*?)=\s*(.*)\s*$/){
  2466. !         $cflags{$1} = $2;
  2467. !         print STDOUT "    $1 = $2\n" if $Verbose;
  2468. !         } else {
  2469. !         print STDOUT "Unrecognised result from hint: '$line'\n";
  2470.           }
  2471.       }
  2472.       }
  2473.   
  2474. !     if ($optdebug) {
  2475. !     $cflags{optimize} = $optdebug;
  2476. !     }
  2477.   
  2478. !     for (qw(ccflags optimize perltype large split)) {
  2479. !     $cflags{$_} =~ s/^\s+//;
  2480. !     $cflags{$_} =~ s/\s+/ /g;
  2481. !     $cflags{$_} =~ s/\s+$//;
  2482. !     $self->{uc $_} ||= $cflags{$_}
  2483. !     }
  2484.   
  2485. !     return $self->{CFLAGS} = qq{
  2486. ! CCFLAGS = $self->{CCFLAGS}
  2487. ! OPTIMIZE = $self->{OPTIMIZE}
  2488. ! PERLTYPE = $self->{PERLTYPE}
  2489. ! LARGE = $self->{LARGE}
  2490. ! SPLIT = $self->{SPLIT}
  2491. ! };
  2492.   
  2493.   }
  2494.   
  2495.   
  2496.   
  2497. ! =item const_cccmd
  2498.   
  2499. ! Returns the full compiler call for C programs and stores the
  2500. ! definition in CONST_CCCMD.
  2501.   
  2502.   =cut
  2503.   
  2504. ! sub const_cccmd {
  2505. !     my($self,$libperl)=@_;
  2506. !     unless (ref $self){
  2507. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2508. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2509.       }
  2510. !     return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
  2511. !     return '' unless $self->needs_linking();
  2512. !     return $self->{CONST_CCCMD} =
  2513. !     q{CCCMD = $(CC) -c $(INC) $(CCFLAGS) $(OPTIMIZE) \\
  2514. !     $(PERLTYPE) $(LARGE) $(SPLIT) $(DEFINE_VERSION) \\
  2515. !     $(XS_DEFINE_VERSION)};
  2516.   }
  2517.   
  2518. ! =item pm_to_blib
  2519.   
  2520. ! Defines target that copies all files in the hash PM to their
  2521. ! destination and autosplits them. See L<ExtUtils::Install/pm_to_blib>
  2522.   
  2523. ! =cut
  2524.   
  2525. ! sub pm_to_blib {
  2526. !     my $self = shift;
  2527. !     my($autodir) = $self->catdir('$(INST_LIB)','auto');
  2528. !     return q{
  2529. ! pm_to_blib: $(TO_INST_PM)
  2530. !     }.$self->{NOECHO}.q{$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
  2531. !     "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
  2532. !     -e 'pm_to_blib({@ARGV},"}.$autodir.q{")' $(PM_TO_BLIB)
  2533. !     }.$self->{NOECHO}.q{$(TOUCH) $@
  2534. ! };
  2535. ! }
  2536.   
  2537. ! =item tool_autosplit (o)
  2538.   
  2539. ! Defines a simple perl call that runs autosplit. May be deprecated by
  2540. ! pm_to_blib soon.
  2541.   
  2542. ! =cut
  2543.   
  2544. ! sub tool_autosplit {
  2545. ! # --- Tool Sections ---
  2546.   
  2547. !     my($self, %attribs) = @_;
  2548. !     unless (ref $self){
  2549. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2550. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2551.       }
  2552. -     my($asl) = "";
  2553. -     $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
  2554. -     q{
  2555. - # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
  2556. - AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e 'use AutoSplit;}.$asl.q{autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
  2557. - };
  2558. - }
  2559. - =item tool_xsubpp (o)
  2560.   
  2561. ! Determines typemaps, xsubpp version, prototype behaviour.
  2562.   
  2563. ! =cut
  2564.   
  2565. ! sub tool_xsubpp {
  2566. !     my($self) = shift;
  2567. !     unless (ref $self){
  2568. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2569. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2570. !     }
  2571. !     my($xsdir)  = $self->catdir($self->{PERL_LIB},"ExtUtils");
  2572. !     my(@tmdeps) = $self->catdir('$(XSUBPPDIR)','typemap');
  2573. !     if( $self->{TYPEMAPS} ){
  2574. !     my $typemap;
  2575. !     foreach $typemap (@{$self->{TYPEMAPS}}){
  2576. !         if( ! -f  $typemap ){
  2577. !             warn "Typemap $typemap not found.\n";
  2578.           }
  2579. !         else{
  2580. !             push(@tmdeps,  $typemap);
  2581.           }
  2582.       }
  2583.       }
  2584. !     push(@tmdeps, "typemap") if -f "typemap";
  2585. !     my(@tmargs) = map("-typemap $_", @tmdeps);
  2586. !     if( exists $self->{XSOPT} ){
  2587. !      unshift( @tmargs, $self->{XSOPT} );
  2588. !     }
  2589. !     my $xsubpp_version = $self->xsubpp_version("$xsdir/xsubpp");
  2590. !     # What are the correct thresholds for version 1 && 2 Paul?
  2591. !     if ( $xsubpp_version > 1.923 ){
  2592. !     $self->{XSPROTOARG} = "" unless defined $self->{XSPROTOARG};
  2593.       } else {
  2594. !     if (defined $self->{XSPROTOARG} && $self->{XSPROTOARG} =~ /\-prototypes/) {
  2595. !         print STDOUT qq{Warning: This extension wants to pass the switch "-prototypes" to xsubpp.
  2596. !     Your version of xsubpp is $xsubpp_version and cannot handle this.
  2597. !     Please upgrade to a more recent version of xsubpp.
  2598. ! };
  2599. !     } else {
  2600. !         $self->{XSPROTOARG} = "";
  2601.       }
  2602. -     }
  2603. -     return qq{
  2604. - XSUBPPDIR = $xsdir
  2605. - XSUBPP = \$(XSUBPPDIR)/xsubpp
  2606. - XSPROTOARG = $self->{XSPROTOARG}
  2607. - XSUBPPDEPS = @tmdeps
  2608. - XSUBPPARGS = @tmargs
  2609. - };
  2610. - };
  2611. - sub xsubpp_version
  2612. - {
  2613. -     my($self,$xsubpp) = @_;
  2614. -     return $Xsubpp_Version if defined $Xsubpp_Version; # global variable
  2615.   
  2616. !     my ($version) ;
  2617.   
  2618. !     # try to figure out the version number of the xsubpp on the system
  2619.   
  2620. !     # first try the -v flag, introduced in 1.921 & 2.000a2
  2621.   
  2622. !     my $command = "$self->{PERL} -I$self->{PERL_LIB} $xsubpp -v 2>&1";
  2623. !     print "Running $command\n" if $Verbose >= 2;
  2624. !     $version = `$command` ;
  2625. !     warn "Running '$command' exits with status " . ($?>>8) if $?;
  2626. !     chop $version ;
  2627.   
  2628. !     return $Xsubpp_Version = $1 if $version =~ /^xsubpp version (.*)/ ;
  2629.   
  2630. !     # nope, then try something else
  2631.   
  2632. !     my $counter = '000';
  2633. !     my ($file) = 'temp' ;
  2634. !     $counter++ while -e "$file$counter"; # don't overwrite anything
  2635. !     $file .= $counter;
  2636.   
  2637. -     open(F, ">$file") or die "Cannot open file '$file': $!\n" ;
  2638. -     print F <<EOM ;
  2639. - MODULE = fred PACKAGE = fred
  2640.   
  2641. ! int
  2642. ! fred(a)
  2643. !         int     a;
  2644. ! EOM
  2645.   
  2646. !     close F ;
  2647.   
  2648. !     $command = "$self->{PERL} $xsubpp $file 2>&1";
  2649. !     print "Running $command\n" if $Verbose >= 2;
  2650. !     my $text = `$command` ;
  2651. !     warn "Running '$command' exits with status " . ($?>>8) if $?;
  2652. !     unlink $file ;
  2653.   
  2654. -     # gets 1.2 -> 1.92 and 2.000a1
  2655. -     return $Xsubpp_Version = $1 if $text =~ /automatically by xsubpp version ([\S]+)\s*/  ;
  2656.   
  2657. !     # it is either 1.0 or 1.1
  2658. !     return $Xsubpp_Version = 1.1 if $text =~ /^Warning: ignored semicolon/ ;
  2659.   
  2660. !     # none of the above, so 1.0
  2661. !     return $Xsubpp_Version = "1.0" ;
  2662. ! }
  2663.   
  2664. - =item tools_other (o)
  2665.   
  2666. ! Defines SHELL, LD, TOUCH, CP, MV, RM_F, RM_RF, CHMOD, UMASK_NULL in
  2667. ! the Makefile. Also defines the perl programs MKPATH,
  2668. ! WARN_IF_OLD_PACKLIST, MOD_INSTALL. DOC_INSTALL, and UNINSTALL.
  2669.   
  2670. - =cut
  2671.   
  2672. ! sub tools_other {
  2673. !     my($self) = shift;
  2674. !     unless (ref $self){
  2675. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2676. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2677. !     }
  2678. !     my @m;
  2679. !     push @m, qq{
  2680. ! SHELL = /bin/sh
  2681. ! LD = $self->{LD}
  2682. ! TOUCH = $self->{TOUCH}
  2683. ! CP = $self->{CP}
  2684. ! MV = $self->{MV}
  2685. ! RM_F  = $self->{RM_F}
  2686. ! RM_RF = $self->{RM_RF}
  2687. ! CHMOD = $self->{CHMOD}
  2688. ! UMASK_NULL = $self->{UMASK_NULL}
  2689. ! };
  2690.   
  2691. !     push @m, q{
  2692. ! # The following is a portable way to say mkdir -p
  2693. ! # To see which directories are created, change the if 0 to if 1
  2694. ! MKPATH = $(PERL) -wle '$$"="/"; foreach $$p (@ARGV){' \\
  2695. ! -e 'next if -d $$p; my(@p); foreach(split(/\//,$$p)){' \\
  2696. ! -e 'push(@p,$$_); next if -d "@p/"; print "mkdir @p" if 0;' \\
  2697. ! -e 'mkdir("@p",0777)||die $$! } } exit 0;'
  2698.   
  2699. ! # This helps us to minimize the effect of the .exists files A yet
  2700. ! # better solution would be to have a stable file in the perl
  2701. ! # distribution with a timestamp of zero. But this solution doesn't
  2702. ! # need any changes to the core distribution and works with older perls
  2703. ! EQUALIZE_TIMESTAMP = $(PERL) -we 'open F, ">$$ARGV[1]"; close F;' \\
  2704. ! -e 'utime ((stat("$$ARGV[0]"))[8,9], $$ARGV[1])'
  2705. ! };
  2706.   
  2707. !     return join "", @m if $self->{PARENT};
  2708.   
  2709. !     push @m, q{
  2710. ! # Here we warn users that an old packlist file was found somewhere,
  2711. ! # and that they should call some uninstall routine
  2712. ! WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \\
  2713. ! -e 'print "WARNING: I have found an old package in\n";' \\
  2714. ! -e 'print "\t$$ARGV[0].\n";' \\
  2715. ! -e 'print "Please make sure the two installations are not conflicting\n";'
  2716.   
  2717. ! MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
  2718. ! -e 'install({@ARGV},1);'
  2719.   
  2720. ! DOC_INSTALL = $(PERL) -e '$$\="\n\n";print "=head3 ", scalar(localtime), ": C<", shift, ">";' \
  2721. ! -e 'print "=over 4";' \
  2722. ! -e 'while ($$key = shift and $$val = shift){print "=item *";print "C<$$key: $$val>";}' \
  2723. ! -e 'print "=back";'
  2724.   
  2725. ! UNINSTALL =   $(PERL) -MExtUtils::Install \
  2726. ! -e 'uninstall($$ARGV[0],1);'
  2727.   
  2728. ! };
  2729.   
  2730. !     return join "", @m;
  2731. ! }
  2732.   
  2733. ! =item dist (o)
  2734.   
  2735. ! Defines a lot of macros for distribution support.
  2736.   
  2737. ! =cut
  2738.   
  2739. - sub dist {
  2740. -     my($self, %attribs) = @_;
  2741. -     unless (ref $self){
  2742. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2743. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  2744. -     }
  2745.   
  2746. !     my(@m);
  2747. !     # VERSION should be sanitised before use as a file name
  2748. !     my($name)     = $attribs{NAME}     || '$(DISTVNAME)';
  2749. !     my($tar)      = $attribs{TAR}      || 'tar';        # eg /usr/bin/gnutar
  2750. !     my($tarflags) = $attribs{TARFLAGS} || 'cvf';
  2751. !     my($zip)      = $attribs{ZIP}      || 'zip';        # eg pkzip Yuck!
  2752. !     my($zipflags) = $attribs{ZIPFLAGS} || '-r';
  2753. !     my($compress) = $attribs{COMPRESS} || 'compress';   # eg gzip
  2754. !     my($suffix)   = $attribs{SUFFIX}   || '.Z';          # eg .gz
  2755. !     my($shar)     = $attribs{SHAR}     || 'shar';       # eg "shar --gzip"
  2756. !     my($preop)    = $attribs{PREOP}    || "$self->{NOECHO}\$(NOOP)"; # eg update MANIFEST
  2757. !     my($postop)   = $attribs{POSTOP}   || "$self->{NOECHO}\$(NOOP)"; # eg remove the distdir
  2758. !     my($ci)       = $attribs{CI}       || 'ci -u';
  2759. !     my($rcs_label)= $attribs{RCS_LABEL}|| 'rcs -Nv$(VERSION_SYM): -q';
  2760. !     my($dist_cp)  = $attribs{DIST_CP}  || 'best';
  2761. !     my($dist_default) = $attribs{DIST_DEFAULT} || 'tardist';
  2762.   
  2763. !     push @m, "
  2764. ! DISTVNAME = \$(DISTNAME)-\$(VERSION_SYM)
  2765. ! TAR  = $tar
  2766. ! TARFLAGS = $tarflags
  2767. ! ZIP  = $zip
  2768. ! ZIPFLAGS = $zipflags
  2769. ! COMPRESS = $compress
  2770. ! SUFFIX = $suffix
  2771. ! SHAR = $shar
  2772. ! PREOP = $preop
  2773. ! POSTOP = $postop
  2774. ! CI = $ci
  2775. ! RCS_LABEL = $rcs_label
  2776. ! DIST_CP = $dist_cp
  2777. ! DIST_DEFAULT = $dist_default
  2778. ! ";
  2779. !     join "", @m;
  2780. ! }
  2781.   
  2782. ! =item macro (o)
  2783.   
  2784. ! Simple subroutine to insert the macros defined by the macro attribute
  2785. ! into the Makefile.
  2786.   
  2787. ! =cut
  2788.   
  2789. ! sub macro {
  2790. !     my($self,%attribs) = @_;
  2791. !     unless (ref $self){
  2792. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2793. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2794.       }
  2795. !     my(@m,$key,$val);
  2796. !     while (($key,$val) = each %attribs){
  2797. !     last unless defined $key;
  2798. !     push @m, "$key = $val\n";
  2799.       }
  2800. !     join "", @m;
  2801. ! }
  2802.   
  2803. ! =item depend (o)
  2804.   
  2805. ! Same as macro for the depend attribute.
  2806.   
  2807. - =cut
  2808.   
  2809. ! sub depend {
  2810. !     my($self,%attribs) = @_;
  2811. !     unless (ref $self){
  2812. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2813. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2814.       }
  2815. !     my(@m,$key,$val);
  2816. !     while (($key,$val) = each %attribs){
  2817. !     last unless defined $key;
  2818. !     push @m, "$key : $val\n\t$self->{NOECHO}\$(NOOP)\n\n";
  2819.       }
  2820. !     join "", @m;
  2821. ! }
  2822.   
  2823. - =item post_constants (o)
  2824.   
  2825. ! Returns an empty string per default. Dedicated to overrides from
  2826. ! within Makefile.PL after all constants have been defined.
  2827.   
  2828. ! =cut
  2829.   
  2830. ! sub post_constants{
  2831. !     my($self) = shift;
  2832. !     unless (ref $self){
  2833. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2834. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2835. !     }
  2836. !     "";
  2837. ! }
  2838.   
  2839. ! =item pasthru (o)
  2840.   
  2841. ! Defines the string that is passed to recursive make calls in
  2842. ! subdirectories.
  2843.   
  2844. ! =cut
  2845.   
  2846. ! sub pasthru {
  2847. !     my($self) = shift;
  2848. !     unless (ref $self){
  2849. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2850. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2851.       }
  2852. -     my(@m,$key);
  2853.   
  2854. !     my(@pasthru);
  2855.   
  2856. - # We don't have to pass thru the install thingies anymore: make
  2857. - # install is run in base directory only:
  2858.   
  2859. ! #    foreach $key (qw(INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN
  2860. ! #             INSTALLMAN1DIR INSTALLMAN3DIR LIBPERL_A
  2861. ! #             LINKTYPE PREFIX INSTALLSITELIB
  2862. ! #             INSTALLSITEARCH INSTALLDIRS)){
  2863.   
  2864. !     foreach $key (qw(LIBPERL_A LINKTYPE PREFIX OPTIMIZE)){
  2865. !     push @pasthru, "$key=\"\$($key)\"";
  2866.       }
  2867.   
  2868. !     push @m, "\nPASTHRU = ", join ("\\\n\t", @pasthru), "\n";
  2869. !     join "", @m;
  2870.   }
  2871.   
  2872. ! =item c_o (o)
  2873.   
  2874. ! Defines the suffix rules to compile different flavors of C files to
  2875. ! object files.
  2876.   
  2877.   =cut
  2878.   
  2879. ! sub c_o {
  2880. ! # --- Translation Sections ---
  2881.       my($self) = shift;
  2882. -     unless (ref $self){
  2883. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2884. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  2885. -     }
  2886. -     return '' unless $self->needs_linking();
  2887. -     my(@m);
  2888. -     push @m, '
  2889. - .c$(OBJ_EXT):
  2890. -     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
  2891.   
  2892. ! .C$(OBJ_EXT):
  2893. !     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.C
  2894.   
  2895. ! .cpp$(OBJ_EXT):
  2896. !     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cpp
  2897.   
  2898. ! .cxx$(OBJ_EXT):
  2899. !     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cxx
  2900.   
  2901. ! .cc$(OBJ_EXT):
  2902. !     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cc
  2903. ! ';
  2904. !     join "", @m;
  2905.   }
  2906.   
  2907. ! =item xs_c (o)
  2908.   
  2909. ! Defines the suffix rules to compile XS files to C.
  2910.   
  2911.   =cut
  2912.   
  2913. ! sub xs_c {
  2914. !     my($self) = shift;
  2915. !     unless (ref $self){
  2916. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2917. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2918. !     }
  2919. !     return '' unless $self->needs_linking();
  2920. !     '
  2921. ! .xs.c:
  2922. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >$*.tc && mv $*.tc $@
  2923. ! ';
  2924. ! }
  2925.   
  2926. ! =item xs_o (o)
  2927.   
  2928. ! Defines suffix rules to go from XS to object files directly. This is
  2929. ! only intended for broken make implementations.
  2930.   
  2931. ! =cut
  2932.   
  2933. ! sub xs_o {    # many makes are too dumb to use xs_c then c_o
  2934. !     my($self) = shift;
  2935. !     unless (ref $self){
  2936. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2937. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2938. !     }
  2939. !     return '' unless $self->needs_linking();
  2940. !     '
  2941. ! .xs$(OBJ_EXT):
  2942. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >xstmp.c && mv xstmp.c $*.c
  2943. !     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
  2944. ! ';
  2945. ! }
  2946.   
  2947. ! =item top_targets (o)
  2948.   
  2949. ! Defines the targets all, subdirs, config, and O_FILES
  2950.   
  2951. ! =cut
  2952.   
  2953. ! sub top_targets {
  2954. ! # --- Target Sections ---
  2955.   
  2956. !     my($self) = shift;
  2957. !     unless (ref $self){
  2958. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  2959. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  2960. !     }
  2961. !     my(@m);
  2962. !     push @m, '
  2963. ! #all ::    config $(INST_PM) subdirs linkext manifypods
  2964.   
  2965. - all :: pure_all manifypods
  2966. -     '.$self->{NOECHO}.'$(NOOP)
  2967.   
  2968. ! pure_all :: config pm_to_blib subdirs linkext
  2969. !     '.$self->{NOECHO}.'$(NOOP)
  2970.   
  2971. ! subdirs :: $(MYEXTLIB)
  2972. !     '.$self->{NOECHO}.'$(NOOP)
  2973.   
  2974. ! config :: '.$self->{MAKEFILE}.' $(INST_LIBDIR)/.exists
  2975. !     '.$self->{NOECHO}.'$(NOOP)
  2976.   
  2977. ! config :: $(INST_ARCHAUTODIR)/.exists
  2978. !     '.$self->{NOECHO}.'$(NOOP)
  2979.   
  2980. ! config :: $(INST_AUTODIR)/.exists
  2981. !     '.$self->{NOECHO}.'$(NOOP)
  2982. ! ';
  2983.   
  2984. !     push @m, qq{
  2985. ! config :: Version_check
  2986. !     $self->{NOECHO}\$(NOOP)
  2987.   
  2988. ! } unless $self->{PARENT} or ($self->{PERL_SRC} && $self->{INSTALLDIRS} eq "perl") or $self->{NO_VC};
  2989.   
  2990. !     push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
  2991.   
  2992. !     if (%{$self->{MAN1PODS}}) {
  2993. !     push @m, qq[
  2994. ! config :: \$(INST_MAN1DIR)/.exists
  2995. !     $self->{NOECHO}\$(NOOP)
  2996.   
  2997. ! ];
  2998. !     push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
  2999.       }
  3000. !     if (%{$self->{MAN3PODS}}) {
  3001. !     push @m, qq[
  3002. ! config :: \$(INST_MAN3DIR)/.exists
  3003. !     $self->{NOECHO}\$(NOOP)
  3004.   
  3005. ! ];
  3006. !     push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
  3007.       }
  3008.   
  3009. !     push @m, '
  3010. ! $(O_FILES): $(H_FILES)
  3011. ! ' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
  3012.   
  3013. !     push @m, q{
  3014. ! help:
  3015. !     perldoc ExtUtils::MakeMaker
  3016. ! };
  3017.   
  3018. !     push @m, q{
  3019. ! Version_check:
  3020. !     }.$self->{NOECHO}.q{$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
  3021. !         -MExtUtils::MakeMaker=Version_check \
  3022. !         -e 'Version_check("$(MM_VERSION)")'
  3023. ! };
  3024.   
  3025. !     join('',@m);
  3026.   }
  3027.   
  3028.   =item linkext (o)
  3029. --- 64,1855 ----
  3030.   
  3031.   =over 2
  3032.   
  3033. + =item canonpath
  3034. + No physical check on the filesystem, but a logical cleanup of a
  3035. + path. On UNIX eliminated successive slashes and successive "/.".
  3036. + =cut
  3037. + sub canonpath {
  3038. +     my($self,$path) = @_;
  3039. +     $path =~ s|/+|/|g ;                            # xx////xx  -> xx/xx
  3040. +     $path =~ s|(/\.)+/|/|g ;                       # xx/././xx -> xx/xx
  3041. +     $path =~ s|^(\./)+|| unless $path eq "./";     # ./xx      -> xx
  3042. +     $path =~ s|/$|| unless $path eq "/";           # xx/       -> xx
  3043. +     $path;
  3044. + }
  3045.   =item catdir
  3046.   
  3047.   Concatenate two or more directory names to form a complete path ending
  3048. ! with a directory. But remove the trailing slash from the resulting
  3049. ! string, because it doesn't look good, isn't necessary and confuses
  3050. ! OS2. Of course, if this is the root directory, don't cut off the
  3051. ! trailing slash :-)
  3052.   
  3053.   =cut
  3054.   
  3055.   # ';
  3056.   
  3057. ! sub catdir {
  3058.       shift;
  3059. !     my @args = @_;
  3060. !     for (@args) {
  3061. !     # append a slash to each argument unless it has one there
  3062. !     $_ .= "/" unless substr($_,length($_)-1,1) eq "/";
  3063. !     }
  3064. !     my $result = join('', @args);
  3065. !     # remove a trailing slash unless we are root
  3066. !     substr($result,length($result)-1,1) = ""
  3067. !     if length($result) > 1 && substr($result,length($result)-1,1) eq "/";
  3068.       $result;
  3069.   }
  3070.   
  3071.   =item catfile
  3072.   
  3073. ! Concatenate one or more directory names and a filename to form a
  3074.   complete path ending with a filename
  3075.   
  3076.   =cut
  3077.   
  3078.   sub catfile {
  3079. !     my $self = shift @_;
  3080. !     my $file = pop @_;
  3081. !     return $file unless @_;
  3082. !     my $dir = $self->catdir(@_);
  3083. !     for ($dir) {
  3084. !     $_ .= "/" unless substr($_,length($_)-1,1) eq "/";
  3085. !     }
  3086. !     return $dir.$file;
  3087.   }
  3088.   
  3089. ! =item curdir
  3090. ! Returns a string representing of the current directory.  "." on UNIX.
  3091. ! =cut
  3092. ! sub curdir {
  3093. !     return "." ;
  3094. ! }
  3095. ! =item rootdir
  3096. ! Returns a string representing of the root directory.  "/" on UNIX.
  3097. ! =cut
  3098. ! sub rootdir {
  3099. !     return "/";
  3100. ! }
  3101. ! =item updir
  3102. ! Returns a string representing of the parent directory.  ".." on UNIX.
  3103. ! =cut
  3104. ! sub updir {
  3105. !     return "..";
  3106. ! }
  3107. ! sub ExtUtils::MM_Unix::c_o ;
  3108. ! sub ExtUtils::MM_Unix::clean ;
  3109. ! sub ExtUtils::MM_Unix::const_cccmd ;
  3110.   sub ExtUtils::MM_Unix::const_config ;
  3111.   sub ExtUtils::MM_Unix::const_loadlibs ;
  3112. ! sub ExtUtils::MM_Unix::constants ;
  3113.   sub ExtUtils::MM_Unix::depend ;
  3114. ! sub ExtUtils::MM_Unix::dir_target ;
  3115. ! sub ExtUtils::MM_Unix::dist ;
  3116. ! sub ExtUtils::MM_Unix::dist_basics ;
  3117. ! sub ExtUtils::MM_Unix::dist_ci ;
  3118. ! sub ExtUtils::MM_Unix::dist_core ;
  3119. ! sub ExtUtils::MM_Unix::dist_dir ;
  3120. ! sub ExtUtils::MM_Unix::dist_test ;
  3121.   sub ExtUtils::MM_Unix::dlsyms ;
  3122.   sub ExtUtils::MM_Unix::dynamic ;
  3123.   sub ExtUtils::MM_Unix::dynamic_bs ;
  3124.   sub ExtUtils::MM_Unix::dynamic_lib ;
  3125. ! sub ExtUtils::MM_Unix::exescan ;
  3126. ! sub ExtUtils::MM_Unix::extliblist ;
  3127. ! sub ExtUtils::MM_Unix::file_name_is_absolute ;
  3128. ! sub ExtUtils::MM_Unix::find_perl ;
  3129. ! sub ExtUtils::MM_Unix::force ;
  3130. ! sub ExtUtils::MM_Unix::guess_name ;
  3131. ! sub ExtUtils::MM_Unix::has_link_code ;
  3132. ! sub ExtUtils::MM_Unix::init_dirscan ;
  3133. ! sub ExtUtils::MM_Unix::init_main ;
  3134. ! sub ExtUtils::MM_Unix::init_others ;
  3135. ! sub ExtUtils::MM_Unix::install ;
  3136. ! sub ExtUtils::MM_Unix::installbin ;
  3137. ! sub ExtUtils::MM_Unix::libscan ;
  3138. ! sub ExtUtils::MM_Unix::linkext ;
  3139. ! sub ExtUtils::MM_Unix::lsdir ;
  3140. ! sub ExtUtils::MM_Unix::macro ;
  3141. ! sub ExtUtils::MM_Unix::makeaperl ;
  3142. ! sub ExtUtils::MM_Unix::makefile ;
  3143.   sub ExtUtils::MM_Unix::manifypods ;
  3144. + sub ExtUtils::MM_Unix::maybe_command ;
  3145. + sub ExtUtils::MM_Unix::maybe_command_in_dirs ;
  3146. + sub ExtUtils::MM_Unix::needs_linking ;
  3147. + sub ExtUtils::MM_Unix::nicetext ;
  3148. + sub ExtUtils::MM_Unix::parse_version ;
  3149. + sub ExtUtils::MM_Unix::pasthru ;
  3150. + sub ExtUtils::MM_Unix::path ;
  3151. + sub ExtUtils::MM_Unix::perl_script ;
  3152. + sub ExtUtils::MM_Unix::perldepend ;
  3153. + sub ExtUtils::MM_Unix::pm_to_blib ;
  3154. + sub ExtUtils::MM_Unix::post_constants ;
  3155. + sub ExtUtils::MM_Unix::post_initialize ;
  3156. + sub ExtUtils::MM_Unix::postamble ;
  3157. + sub ExtUtils::MM_Unix::prefixify ;
  3158.   sub ExtUtils::MM_Unix::processPL ;
  3159.   sub ExtUtils::MM_Unix::realclean ;
  3160. ! sub ExtUtils::MM_Unix::replace_manpage_separator ;
  3161. ! sub ExtUtils::MM_Unix::static ;
  3162. ! sub ExtUtils::MM_Unix::static_lib ;
  3163.   sub ExtUtils::MM_Unix::staticmake ;
  3164. + sub ExtUtils::MM_Unix::subdir_x ;
  3165. + sub ExtUtils::MM_Unix::subdirs ;
  3166.   sub ExtUtils::MM_Unix::test ;
  3167.   sub ExtUtils::MM_Unix::test_via_harness ;
  3168.   sub ExtUtils::MM_Unix::test_via_script ;
  3169. ! sub ExtUtils::MM_Unix::tool_autosplit ;
  3170. ! sub ExtUtils::MM_Unix::tool_xsubpp ;
  3171. ! sub ExtUtils::MM_Unix::tools_other ;
  3172. ! sub ExtUtils::MM_Unix::top_targets ;
  3173.   sub ExtUtils::MM_Unix::writedoc ;
  3174. ! sub ExtUtils::MM_Unix::xs_c ;
  3175. ! sub ExtUtils::MM_Unix::xs_o ;
  3176. ! sub ExtUtils::MM_Unix::xsubpp_version ;
  3177.   
  3178.   package ExtUtils::MM_Unix;
  3179.   
  3180. ! #use SelfLoader;
  3181.   
  3182.   1;
  3183. ! #__DATA__
  3184.   
  3185.   =head2 SelfLoaded methods
  3186.   
  3187. ! =item c_o (o)
  3188.   
  3189. ! Defines the suffix rules to compile different flavors of C files to
  3190. ! object files.
  3191.   
  3192.   =cut
  3193.   
  3194. ! sub c_o {
  3195. ! # --- Translation Sections ---
  3196.   
  3197. !     my($self) = shift;
  3198. !     return '' unless $self->needs_linking();
  3199. !     my(@m);
  3200. !     push @m, '
  3201. ! .c$(OBJ_EXT):
  3202. !     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
  3203.   
  3204. ! .C$(OBJ_EXT):
  3205. !     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.C
  3206.   
  3207. ! .cpp$(OBJ_EXT):
  3208. !     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cpp
  3209.   
  3210. ! .cxx$(OBJ_EXT):
  3211. !     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cxx
  3212.   
  3213. ! .cc$(OBJ_EXT):
  3214. !     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cc
  3215. ! ';
  3216. !     join "", @m;
  3217.   }
  3218.   
  3219. ! =item cflags (o)
  3220.   
  3221. ! Does very much the same as the cflags script in the perl
  3222. ! distribution. It doesn't return the whole compiler command line, but
  3223. ! initializes all of its parts. The const_cccmd method then actually
  3224. ! returns the definition of the CCCMD macro which uses these parts.
  3225.   
  3226.   =cut
  3227.   
  3228. ! #'
  3229.   
  3230. ! sub cflags {
  3231. !     my($self,$libperl)=@_;
  3232. !     return $self->{CFLAGS} if $self->{CFLAGS};
  3233. !     return '' unless $self->needs_linking();
  3234.   
  3235. !     my($prog, $uc, $perltype, %cflags);
  3236. !     $libperl ||= $self->{LIBPERL_A} || "libperl$self->{LIB_EXT}" ;
  3237. !     $libperl =~ s/\.\$\(A\)$/$self->{LIB_EXT}/;
  3238.   
  3239. !     @cflags{qw(cc ccflags optimize large split shellflags)}
  3240. !     = @Config{qw(cc ccflags optimize large split shellflags)};
  3241. !     my($optdebug) = "";
  3242.   
  3243. !     $cflags{shellflags} ||= '';
  3244.   
  3245. !     my(%map) =  (
  3246. !         D =>   '-DDEBUGGING',
  3247. !         E =>   '-DEMBED',
  3248. !         DE =>  '-DDEBUGGING -DEMBED',
  3249. !         M =>   '-DEMBED -DMULTIPLICITY',
  3250. !         DM =>  '-DDEBUGGING -DEMBED -DMULTIPLICITY',
  3251. !         );
  3252.   
  3253. !     if ($libperl =~ /libperl(\w*)\Q$self->{LIB_EXT}/){
  3254. !     $uc = uc($1);
  3255. !     } else {
  3256. !     $uc = ""; # avoid warning
  3257. !     }
  3258. !     $perltype = $map{$uc} ? $map{$uc} : "";
  3259.   
  3260. !     if ($uc =~ /^D/) {
  3261. !     $optdebug = "-g";
  3262. !     }
  3263.   
  3264.   
  3265. !     my($name);
  3266. !     ( $name = $self->{NAME} . "_cflags" ) =~ s/:/_/g ;
  3267. !     if ($prog = $Config::Config{$name}) {
  3268. !     # Expand hints for this extension via the shell
  3269. !     print STDOUT "Processing $name hint:\n" if $Verbose;
  3270. !     my(@o)=`cc=\"$cflags{cc}\"
  3271. !       ccflags=\"$cflags{ccflags}\"
  3272. !       optimize=\"$cflags{optimize}\"
  3273. !       perltype=\"$cflags{perltype}\"
  3274. !       optdebug=\"$cflags{optdebug}\"
  3275. !       large=\"$cflags{large}\"
  3276. !       split=\"$cflags{'split'}\"
  3277. !       eval '$prog'
  3278. !       echo cc=\$cc
  3279. !       echo ccflags=\$ccflags
  3280. !       echo optimize=\$optimize
  3281. !       echo perltype=\$perltype
  3282. !       echo optdebug=\$optdebug
  3283. !       echo large=\$large
  3284. !       echo split=\$split
  3285. !       `;
  3286. !     my($line);
  3287. !     foreach $line (@o){
  3288. !         chomp $line;
  3289. !         if ($line =~ /(.*?)=\s*(.*)\s*$/){
  3290. !         $cflags{$1} = $2;
  3291. !         print STDOUT "    $1 = $2\n" if $Verbose;
  3292. !         } else {
  3293. !         print STDOUT "Unrecognised result from hint: '$line'\n";
  3294. !         }
  3295. !     }
  3296. !     }
  3297.   
  3298. !     if ($optdebug) {
  3299. !     $cflags{optimize} = $optdebug;
  3300. !     }
  3301.   
  3302. !     for (qw(ccflags optimize perltype large split)) {
  3303. !     $cflags{$_} =~ s/^\s+//;
  3304. !     $cflags{$_} =~ s/\s+/ /g;
  3305. !     $cflags{$_} =~ s/\s+$//;
  3306. !     $self->{uc $_} ||= $cflags{$_}
  3307. !     }
  3308.   
  3309. !     return $self->{CFLAGS} = qq{
  3310. ! CCFLAGS = $self->{CCFLAGS}
  3311. ! OPTIMIZE = $self->{OPTIMIZE}
  3312. ! PERLTYPE = $self->{PERLTYPE}
  3313. ! LARGE = $self->{LARGE}
  3314. ! SPLIT = $self->{SPLIT}
  3315. ! };
  3316.   
  3317.   }
  3318.   
  3319. ! =item clean (o)
  3320.   
  3321. ! Defines the clean target.
  3322.   
  3323.   =cut
  3324.   
  3325. ! sub clean {
  3326. ! # --- Cleanup and Distribution Sections ---
  3327.   
  3328. !     my($self, %attribs) = @_;
  3329. !     my(@m,$dir);
  3330. !     push(@m, '
  3331. ! # Delete temporary files but do not touch installed files. We don\'t delete
  3332. ! # the Makefile here so a later make realclean still has a makefile to use.
  3333.   
  3334. ! clean ::
  3335. ! ');
  3336. !     # clean subdirectories first
  3337. !     for $dir (@{$self->{DIR}}) {
  3338. !     push @m, "\t-cd $dir && test -f $self->{MAKEFILE} && \$(MAKE) clean\n";
  3339.       }
  3340. +     my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files
  3341. +     push(@otherfiles, $attribs{FILES}) if $attribs{FILES};
  3342. +     push(@otherfiles, qw[./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all
  3343. +              perlmain.c mon.out core so_locations pm_to_blib
  3344. +              *~ */*~ */*/*~ *$(OBJ_EXT) *$(LIB_EXT) perl.exe
  3345. +              $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def
  3346. +              $(BASEEXT).exp
  3347. +             ]);
  3348. +     push @m, "\t-$self->{RM_RF} @otherfiles\n";
  3349. +     # See realclean and ext/utils/make_ext for usage of Makefile.old
  3350. +     push(@m,
  3351. +      "\t-$self->{MV} $self->{MAKEFILE} $self->{MAKEFILE}.old 2>/dev/null\n");
  3352. +     push(@m,
  3353. +      "\t$attribs{POSTOP}\n")   if $attribs{POSTOP};
  3354. +     join("", @m);
  3355.   }
  3356.   
  3357. ! =item const_cccmd (o)
  3358.   
  3359. ! Returns the full compiler call for C programs and stores the
  3360. ! definition in CONST_CCCMD.
  3361.   
  3362.   =cut
  3363.   
  3364. ! sub const_cccmd {
  3365. !     my($self,$libperl)=@_;
  3366. !     return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
  3367. !     return '' unless $self->needs_linking();
  3368. !     return $self->{CONST_CCCMD} =
  3369. !     q{CCCMD = $(CC) -c $(INC) $(CCFLAGS) $(OPTIMIZE) \\
  3370. !     $(PERLTYPE) $(LARGE) $(SPLIT) $(DEFINE_VERSION) \\
  3371. !     $(XS_DEFINE_VERSION)};
  3372.   }
  3373.   
  3374. ! =item const_config (o)
  3375.   
  3376. ! Defines a couple of constants in the Makefile that are imported from
  3377. ! %Config.
  3378.   
  3379.   =cut
  3380.   
  3381. ! sub const_config {
  3382. ! # --- Constants Sections ---
  3383. !     my($self) = shift;
  3384. !     my(@m,$m);
  3385. !     push(@m,"\n# These definitions are from config.sh (via $INC{'Config.pm'})\n");
  3386. !     push(@m,"\n# They may have been overridden via Makefile.PL or on the command line\n");
  3387. !     my(%once_only);
  3388. !     foreach $m (@{$self->{CONFIG}}){
  3389. !     # SITE*EXP macros are defined in &constants; avoid duplicates here
  3390. !     next if $once_only{$m} or $m eq 'sitelibexp' or $m eq 'sitearchexp';
  3391. !     push @m, "\U$m\E = ".$self->{uc $m}."\n";
  3392. !     $once_only{$m} = 1;
  3393. !     }
  3394. !     join('', @m);
  3395.   }
  3396.   
  3397. ! =item const_loadlibs (o)
  3398.   
  3399. ! Defines EXTRALIBS, LDLOADLIBS, BSLOADLIBS, LD_RUN_PATH. See
  3400. ! L<ExtUtils::Liblist> for details.
  3401.   
  3402.   =cut
  3403.   
  3404. ! sub const_loadlibs {
  3405. !     my($self) = shift;
  3406. !     return "" unless $self->needs_linking;
  3407. !     my @m;
  3408. !     push @m, qq{
  3409. ! # $self->{NAME} might depend on some other libraries:
  3410. ! # See ExtUtils::Liblist for details
  3411. ! #
  3412. ! };
  3413. !     my($tmp);
  3414. !     for $tmp (qw/
  3415. !      EXTRALIBS LDLOADLIBS BSLOADLIBS LD_RUN_PATH
  3416. !      /) {
  3417. !     next unless defined $self->{$tmp};
  3418. !     push @m, "$tmp = $self->{$tmp}\n";
  3419. !     }
  3420. !     return join "", @m;
  3421.   }
  3422.   
  3423. ! =item constants (o)
  3424.   
  3425. ! Initializes lots of constants and .SUFFIXES and .PHONY
  3426.   
  3427.   =cut
  3428.   
  3429. ! sub constants {
  3430.       my($self) = @_;
  3431. !     my(@m,$tmp);
  3432.   
  3433. !     for $tmp (qw/
  3434.   
  3435. !           AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION
  3436. !           VERSION_SYM XS_VERSION INST_BIN INST_EXE INST_LIB
  3437. !           INST_ARCHLIB INST_SCRIPT PREFIX INSTALLDIRS
  3438. !           INSTALLPRIVLIB INSTALLARCHLIB INSTALLSITELIB
  3439. !           INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB
  3440. !           PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
  3441. !           FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC
  3442. !           PERL_INC PERL FULLPERL
  3443.   
  3444. !           / ) {
  3445. !     next unless defined $self->{$tmp};
  3446. !     push @m, "$tmp = $self->{$tmp}\n";
  3447.       }
  3448.   
  3449. +     push @m, qq{
  3450. + VERSION_MACRO = VERSION
  3451. + DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
  3452. + XS_VERSION_MACRO = XS_VERSION
  3453. + XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
  3454. + };
  3455.   
  3456. !     push @m, qq{
  3457. ! MAKEMAKER = $INC{'ExtUtils/MakeMaker.pm'}
  3458. ! MM_VERSION = $ExtUtils::MakeMaker::VERSION
  3459. ! };
  3460.   
  3461. !     push @m, q{
  3462. ! # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
  3463. ! # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
  3464. ! # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)  !!! Deprecated from MM 5.32  !!!
  3465. ! # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
  3466. ! # DLBASE  = Basename part of dynamic library. May be just equal BASEEXT.
  3467. ! };
  3468.   
  3469. +     for $tmp (qw/
  3470. +           FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT
  3471. +           LDFROM LINKTYPE
  3472. +           /    ) {
  3473. +     next unless defined $self->{$tmp};
  3474. +     push @m, "$tmp = $self->{$tmp}\n";
  3475. +     }
  3476.   
  3477. !     push @m, "
  3478. ! # Handy lists of source code files:
  3479. ! XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
  3480. ! C_FILES = ".join(" \\\n\t", @{$self->{C}})."
  3481. ! O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."
  3482. ! H_FILES = ".join(" \\\n\t", @{$self->{H}})."
  3483. ! MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."
  3484. ! MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."
  3485. ! ";
  3486.   
  3487. !     for $tmp (qw/
  3488. !           INST_MAN1DIR INSTALLMAN1DIR MAN1EXT INST_MAN3DIR INSTALLMAN3DIR MAN3EXT
  3489. !           /) {
  3490. !     next unless defined $self->{$tmp};
  3491. !     push @m, "$tmp = $self->{$tmp}\n";
  3492.       }
  3493.   
  3494. !     push @m, q{
  3495. ! .NO_CONFIG_REC: Makefile
  3496. ! } if $ENV{CLEARCASE_ROOT};
  3497.   
  3498. !     # why not q{} ? -- emacs
  3499. !     push @m, qq{
  3500. ! # work around a famous dec-osf make(1) feature(?):
  3501. ! makemakerdflt: all
  3502.   
  3503. ! .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
  3504.   
  3505. ! # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
  3506. ! # some make implementations will delete the Makefile when we rebuild it. Because
  3507. ! # we call false(1) when we rebuild it. So make(1) is not completely wrong when it
  3508. ! # does so. Our milage may vary.
  3509. ! # .PRECIOUS: Makefile    # seems to be not necessary anymore
  3510.   
  3511. ! .PHONY: all config static dynamic test linkext manifest
  3512.   
  3513. ! # Where is the Config information that we are using/depend on
  3514. ! CONFIGDEP = \$(PERL_ARCHLIB)/Config.pm \$(PERL_INC)/config.h
  3515. ! };
  3516.   
  3517. !     my @parentdir = split(/::/, $self->{PARENT_NAME});
  3518. !     push @m, q{
  3519. ! # Where to put things:
  3520. ! INST_LIBDIR      = }. $self->catdir('$(INST_LIB)',@parentdir)        .q{
  3521. ! INST_ARCHLIBDIR  = }. $self->catdir('$(INST_ARCHLIB)',@parentdir)    .q{
  3522.   
  3523. ! INST_AUTODIR     = }. $self->catdir('$(INST_LIB)','auto','$(FULLEXT)')       .q{
  3524. ! INST_ARCHAUTODIR = }. $self->catdir('$(INST_ARCHLIB)','auto','$(FULLEXT)')   .q{
  3525. ! };
  3526.   
  3527. +     if ($self->has_link_code()) {
  3528. +     push @m, '
  3529. + INST_STATIC  = $(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT)
  3530. + INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(DLBASE).$(DLEXT)
  3531. + INST_BOOT    = $(INST_ARCHAUTODIR)/$(BASEEXT).bs
  3532. + ';
  3533. +     } else {
  3534. +     push @m, '
  3535. + INST_STATIC  =
  3536. + INST_DYNAMIC =
  3537. + INST_BOOT    =
  3538. + ';
  3539. +     }
  3540.   
  3541. !     if ($Is_OS2) {
  3542. !     $tmp = "$self->{BASEEXT}.def";
  3543. !     } else {
  3544. !     $tmp = "";
  3545. !     }
  3546. !     push @m, "
  3547. ! EXPORT_LIST = $tmp
  3548. ! ";
  3549.   
  3550. !     if ($Is_OS2) {
  3551. !     $tmp = "\$(PERL_INC)/libperl\$(LIB_EXT)";
  3552. !     } else {
  3553. !     $tmp = "";
  3554.       }
  3555. !     push @m, "
  3556. ! PERL_ARCHIVE = $tmp
  3557. ! ";
  3558.   
  3559. ! #    push @m, q{
  3560. ! #INST_PM = }.join(" \\\n\t", sort values %{$self->{PM}}).q{
  3561. ! #
  3562. ! #PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
  3563. ! #};
  3564.   
  3565. !     push @m, q{
  3566. ! TO_INST_PM = }.join(" \\\n\t", sort keys %{$self->{PM}}).q{
  3567.   
  3568. ! PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
  3569. ! };
  3570.   
  3571. !     join('',@m);
  3572. ! }
  3573.   
  3574. + =item depend (o)
  3575.   
  3576. ! Same as macro for the depend attribute.
  3577.   
  3578. ! =cut
  3579. ! sub depend {
  3580. !     my($self,%attribs) = @_;
  3581. !     my(@m,$key,$val);
  3582. !     while (($key,$val) = each %attribs){
  3583. !     last unless defined $key;
  3584. !     push @m, "$key: $val\n";
  3585.       }
  3586. !     join "", @m;
  3587. ! }
  3588.   
  3589. + =item dir_target (o)
  3590.   
  3591. ! Takes an array of directories that need to exist and returns a
  3592. ! Makefile entry for a .exists file in these directories. Returns
  3593. ! nothing, if the entry has already been processed. We're helpless
  3594. ! though, if the same directory comes as $(FOO) _and_ as "bar". Both of
  3595. ! them get an entry, that's why we use "::".
  3596.   
  3597. ! =cut
  3598.   
  3599. ! sub dir_target {
  3600. ! # --- Make-Directories section (internal method) ---
  3601. ! # dir_target(@array) returns a Makefile entry for the file .exists in each
  3602. ! # named directory. Returns nothing, if the entry has already been processed.
  3603. ! # We're helpless though, if the same directory comes as $(FOO) _and_ as "bar".
  3604. ! # Both of them get an entry, that's why we use "::". I chose '$(PERL)' as the
  3605. ! # prerequisite, because there has to be one, something that doesn't change
  3606. ! # too often :)
  3607.   
  3608. !     my($self,@dirs) = @_;
  3609. !     my(@m,$dir);
  3610. !     foreach $dir (@dirs) {
  3611. !     my($src) = $self->catfile($self->{PERL_INC},'perl.h');
  3612. !     my($targ) = $self->catfile($dir,'.exists');
  3613. !     my($targdir) = $targ;       # Necessary because catfile may have
  3614. !     $targdir =~ s:/?.exists$::; # adapted syntax of $dir to target OS
  3615. !     next if $self->{DIR_TARGET}{$self}{$targdir}++;
  3616. !     push @m, qq{
  3617. ! $targ :: $src
  3618. !     $self->{NOECHO}\$(MKPATH) $targdir
  3619. !     $self->{NOECHO}\$(EQUALIZE_TIMESTAMP) $src $targ
  3620. ! };
  3621. !     push(@m,qq{
  3622. !     -$self->{NOECHO}\$(CHMOD) 755 $targdir
  3623. ! }) unless $Is_VMS;
  3624. !     }
  3625. !     join "", @m;
  3626. ! }
  3627.   
  3628. ! =item dist (o)
  3629.   
  3630. ! Defines a lot of macros for distribution support.
  3631.   
  3632. ! =cut
  3633.   
  3634. + sub dist {
  3635. +     my($self, %attribs) = @_;
  3636.   
  3637. !     my(@m);
  3638. !     # VERSION should be sanitised before use as a file name
  3639. !     my($version)  = $attribs{VERSION}  || '$(VERSION)';
  3640. !     my($name)     = $attribs{NAME}     || '$(DISTNAME)';
  3641. !     my($tar)      = $attribs{TAR}      || 'tar';        # eg /usr/bin/gnutar
  3642. !     my($tarflags) = $attribs{TARFLAGS} || 'cvf';
  3643. !     my($zip)      = $attribs{ZIP}      || 'zip';        # eg pkzip Yuck!
  3644. !     my($zipflags) = $attribs{ZIPFLAGS} || '-r';
  3645. !     my($compress) = $attribs{COMPRESS} || 'compress';   # eg gzip
  3646. !     my($suffix)   = $attribs{SUFFIX}   || '.Z';          # eg .gz
  3647. !     my($shar)     = $attribs{SHAR}     || 'shar';       # eg "shar --gzip"
  3648. !     my($preop)    = $attribs{PREOP}    || "$self->{NOECHO}\$(NOOP)"; # eg update MANIFEST
  3649. !     my($postop)   = $attribs{POSTOP}   || "$self->{NOECHO}\$(NOOP)"; # eg remove the distdir
  3650.   
  3651. !     my($to_unix)  = $attribs{TO_UNIX} || ($Is_OS2
  3652. !                       ? "$self->{NOECHO}"
  3653. !                       . 'test -f tmp.zip && $(RM) tmp.zip;'
  3654. !                       . ' $(ZIP) -ll -mr tmp.zip $(DISTVNAME) && unzip -o tmp.zip && $(RM) tmp.zip'
  3655. !                       : "$self->{NOECHO}\$(NOOP)");
  3656.   
  3657. !     my($ci)       = $attribs{CI}       || 'ci -u';
  3658. !     my($rcs_label)= $attribs{RCS_LABEL}|| 'rcs -Nv$(VERSION_SYM): -q';
  3659. !     my($dist_cp)  = $attribs{DIST_CP}  || 'best';
  3660. !     my($dist_default) = $attribs{DIST_DEFAULT} || 'tardist';
  3661.   
  3662. !     push @m, "
  3663. ! DISTVNAME = ${name}-$version
  3664. ! TAR  = $tar
  3665. ! TARFLAGS = $tarflags
  3666. ! ZIP  = $zip
  3667. ! ZIPFLAGS = $zipflags
  3668. ! COMPRESS = $compress
  3669. ! SUFFIX = $suffix
  3670. ! SHAR = $shar
  3671. ! PREOP = $preop
  3672. ! POSTOP = $postop
  3673. ! TO_UNIX = $to_unix
  3674. ! CI = $ci
  3675. ! RCS_LABEL = $rcs_label
  3676. ! DIST_CP = $dist_cp
  3677. ! DIST_DEFAULT = $dist_default
  3678. ! ";
  3679. !     join "", @m;
  3680.   }
  3681.   
  3682. ! =item dist_basics (o)
  3683.   
  3684. ! Defines the targets distclean, distcheck, skipcheck, manifest.
  3685.   
  3686.   =cut
  3687.   
  3688. ! sub dist_basics {
  3689. !     my($self) = shift;
  3690. !     my @m;
  3691. !     push @m, q{
  3692. ! distclean :: realclean distcheck
  3693. ! };
  3694.   
  3695. !     push @m, q{
  3696. ! distcheck :
  3697. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&fullcheck";' \\
  3698. !         -e 'fullcheck();'
  3699. ! };
  3700.   
  3701. !     push @m, q{
  3702. ! skipcheck :
  3703. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&skipcheck";' \\
  3704. !         -e 'skipcheck();'
  3705. ! };
  3706.   
  3707. !     push @m, q{
  3708. ! manifest :
  3709. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&mkmanifest";' \\
  3710. !         -e 'mkmanifest();'
  3711. ! };
  3712. !     join "", @m;
  3713.   }
  3714.   
  3715. ! =item dist_ci (o)
  3716.   
  3717. ! Defines a check in target for RCS.
  3718.   
  3719.   =cut
  3720.   
  3721. ! sub dist_ci {
  3722.       my($self) = shift;
  3723. !     my @m;
  3724. !     push @m, q{
  3725. ! ci :
  3726. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&maniread";' \\
  3727. !         -e '@all = keys %{ maniread() };' \\
  3728. !         -e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \\
  3729. !         -e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");'
  3730. ! };
  3731. !     join "", @m;
  3732. ! }
  3733.   
  3734. ! =item dist_core (o)
  3735.   
  3736. ! Defeines the targets dist, tardist, zipdist, uutardist, shdist
  3737.   
  3738. ! =cut
  3739.   
  3740. ! sub dist_core {
  3741. !     my($self) = shift;
  3742. !     my @m;
  3743. !     push @m, q{
  3744. ! dist : $(DIST_DEFAULT)
  3745. !     }.$self->{NOECHO}.q{$(PERL) -le 'print "Warning: Makefile possibly out of date with $$vf" if ' \
  3746. !         -e '-e ($$vf="$(VERSION_FROM)") and -M $$vf < -M "}.$self->{MAKEFILE}.q{";'
  3747.   
  3748. ! tardist : $(DISTVNAME).tar$(SUFFIX)
  3749.   
  3750. ! zipdist : $(DISTVNAME).zip
  3751.   
  3752. ! $(DISTVNAME).tar$(SUFFIX) : distdir
  3753. !     $(PREOP)
  3754. !     $(TO_UNIX)
  3755. !     $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
  3756. !     $(RM_RF) $(DISTVNAME)
  3757. !     $(COMPRESS) $(DISTVNAME).tar
  3758. !     $(POSTOP)
  3759.   
  3760. ! $(DISTVNAME).zip : distdir
  3761. !     $(PREOP)
  3762. !     $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
  3763. !     $(RM_RF) $(DISTVNAME)
  3764. !     $(POSTOP)
  3765.   
  3766. ! uutardist : $(DISTVNAME).tar$(SUFFIX)
  3767. !     uuencode $(DISTVNAME).tar$(SUFFIX) \\
  3768. !         $(DISTVNAME).tar$(SUFFIX) > \\
  3769. !         $(DISTVNAME).tar$(SUFFIX)_uu
  3770.   
  3771. ! shdist : distdir
  3772. !     $(PREOP)
  3773. !     $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
  3774. !     $(RM_RF) $(DISTVNAME)
  3775. !     $(POSTOP)
  3776. ! };
  3777. !     join "", @m;
  3778.   }
  3779.   
  3780. ! =item dist_dir (o)
  3781.   
  3782. ! Defines the scratch directory target that will hold the distribution
  3783. ! before tar-ing (or shar-ing).
  3784.   
  3785.   =cut
  3786.   
  3787. ! sub dist_dir {
  3788. !     my($self) = shift;
  3789. !     my @m;
  3790. !     push @m, q{
  3791. ! distdir :
  3792. !     $(RM_RF) $(DISTVNAME)
  3793. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=manicopy,maniread \\
  3794. !         -e 'manicopy(maniread(),"$(DISTVNAME)", "$(DIST_CP)");'
  3795. ! };
  3796. !     join "", @m;
  3797.   }
  3798.   
  3799. ! =item dist_test (o)
  3800.   
  3801. ! Defines a target that produces the distribution in the
  3802. ! scratchdirectory, and runs 'perl Makefile.PL; make ;make test' in that
  3803. ! subdirectory.
  3804.   
  3805.   =cut
  3806.   
  3807. ! sub dist_test {
  3808.       my($self) = shift;
  3809. !     my @m;
  3810. !     push @m, q{
  3811. ! disttest : distdir
  3812. !     cd $(DISTVNAME) && $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) Makefile.PL
  3813. !     cd $(DISTVNAME) && $(MAKE)
  3814. !     cd $(DISTVNAME) && $(MAKE) test
  3815. ! };
  3816. !     join "", @m;
  3817.   }
  3818.   
  3819. ! =item dlsyms (o)
  3820.   
  3821. ! Used by AIX and VMS to define DL_FUNCS and DL_VARS and write the *.exp
  3822. ! files.
  3823.   
  3824.   =cut
  3825.   
  3826. ! sub dlsyms {
  3827. !     my($self,%attribs) = @_;
  3828.   
  3829. !     return '' unless ($^O eq 'aix' && $self->needs_linking() );
  3830.   
  3831. !     my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
  3832. !     my($vars)  = $attribs{DL_VARS} || $self->{DL_VARS} || [];
  3833. !     my(@m);
  3834.   
  3835. !     push(@m,"
  3836. ! dynamic :: $self->{BASEEXT}.exp
  3837.   
  3838. ! ") unless $self->{SKIPHASH}{'dynamic'}; # dynamic and static are subs, so...
  3839.   
  3840. !     push(@m,"
  3841. ! static :: $self->{BASEEXT}.exp
  3842.   
  3843. ! ") unless $self->{SKIPHASH}{'static'};  # we avoid a warning if we tick them
  3844.   
  3845. !     push(@m,"
  3846. ! $self->{BASEEXT}.exp: Makefile.PL
  3847. ! ",'    $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::Mksymlists; \\
  3848. !     Mksymlists("NAME" => "',$self->{NAME},'", "DL_FUNCS" => ',
  3849. !     neatvalue($funcs),', "DL_VARS" => ', neatvalue($vars), ');\'
  3850. ! ');
  3851.   
  3852. !     join('',@m);
  3853. ! }
  3854.   
  3855. ! =item dynamic (o)
  3856.   
  3857. ! Defines the dynamic target.
  3858.   
  3859. ! =cut
  3860.   
  3861. ! sub dynamic {
  3862. ! # --- Dynamic Loading Sections ---
  3863.   
  3864. !     my($self) = shift;
  3865. !     '
  3866. ! ## $(INST_PM) has been moved to the all: target.
  3867. ! ## It remains here for awhile to allow for old usage: "make dynamic"
  3868. ! #dynamic :: '.$self->{MAKEFILE}.' $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM)
  3869. ! dynamic :: '.$self->{MAKEFILE}.' $(INST_DYNAMIC) $(INST_BOOT)
  3870. !     '.$self->{NOECHO}.'$(NOOP)
  3871. ! ';
  3872. ! }
  3873.   
  3874. ! =item dynamic_bs (o)
  3875.   
  3876. ! Defines targets for bootstrap files.
  3877.   
  3878. ! =cut
  3879.   
  3880. ! sub dynamic_bs {
  3881. !     my($self, %attribs) = @_;
  3882. !     return '
  3883. ! BOOTSTRAP =
  3884. ! ' unless $self->has_link_code();
  3885.   
  3886. !     return '
  3887. ! BOOTSTRAP = '."$self->{BASEEXT}.bs".'
  3888.   
  3889. ! # As Mkbootstrap might not write a file (if none is required)
  3890. ! # we use touch to prevent make continually trying to remake it.
  3891. ! # The DynaLoader only reads a non-empty file.
  3892. ! $(BOOTSTRAP): '."$self->{MAKEFILE} $self->{BOOTDEP}".' $(INST_ARCHAUTODIR)/.exists
  3893. !     '.$self->{NOECHO}.'echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
  3894. !     '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
  3895. !         -e \'use ExtUtils::Mkbootstrap;\' \
  3896. !         -e \'Mkbootstrap("$(BASEEXT)","$(BSLOADLIBS)");\'
  3897. !     '.$self->{NOECHO}.'$(TOUCH) $(BOOTSTRAP)
  3898. !     $(CHMOD) 644 $@
  3899.   
  3900. ! $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists
  3901. !     '."$self->{NOECHO}$self->{RM_RF}".' $(INST_BOOT)
  3902. !     -'.$self->{CP}.' $(BOOTSTRAP) $(INST_BOOT)
  3903. !     $(CHMOD) 644 $@
  3904.   ';
  3905. ! }
  3906.   
  3907. ! =item dynamic_lib (o)
  3908.   
  3909. ! Defines how to produce the *.so (or equivalent) files.
  3910. ! =cut
  3911. ! sub dynamic_lib {
  3912. !     my($self, %attribs) = @_;
  3913. !     return '' unless $self->needs_linking(); #might be because of a subdir
  3914.   
  3915. !     return '' unless $self->has_link_code;
  3916.   
  3917. !     my($otherldflags) = $attribs{OTHERLDFLAGS} || "";
  3918. !     my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
  3919. !     my($armaybe) = $attribs{ARMAYBE} || $self->{ARMAYBE} || ":";
  3920. !     my($ldfrom) = '$(LDFROM)';
  3921. !     $armaybe = 'ar' if ($^O eq 'dec_osf' and $armaybe eq ':');
  3922. !     my(@m);
  3923. !     push(@m,'
  3924. ! # This section creates the dynamically loadable $(INST_DYNAMIC)
  3925. ! # from $(OBJECT) and possibly $(MYEXTLIB).
  3926. ! ARMAYBE = '.$armaybe.'
  3927. ! OTHERLDFLAGS = '.$otherldflags.'
  3928. ! INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
  3929.   
  3930. ! $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
  3931. ! ');
  3932. !     if ($armaybe ne ':'){
  3933. !     $ldfrom = 'tmp$(LIB_EXT)';
  3934. !     push(@m,'    $(ARMAYBE) cr '.$ldfrom.' $(OBJECT)'."\n");
  3935. !     push(@m,'    $(RANLIB) '."$ldfrom\n");
  3936. !     }
  3937. !     $ldfrom = "-all $ldfrom -none" if ($^O eq 'dec_osf');
  3938. !     push(@m,'    LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) -o $@ $(LDDLFLAGS) '.$ldfrom.
  3939. !         ' $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) $(EXPORT_LIST)');
  3940. !     push @m, '
  3941. !     $(CHMOD) 755 $@
  3942. ! ';
  3943.   
  3944. +     push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
  3945.       join('',@m);
  3946.   }
  3947.   
  3948. ! =item exescan
  3949.   
  3950. ! Deprecated method. Use libscan instead.
  3951.   
  3952.   =cut
  3953.   
  3954. ! sub exescan {
  3955. !     my($self,$path) = @_;
  3956. !     $path;
  3957.   }
  3958.   
  3959. ! =item extliblist
  3960.   
  3961. ! Called by init_others, and calls ext ExtUtils::Liblist. See
  3962. ! L<ExtUtils::Liblist> for details.
  3963.   
  3964.   =cut
  3965.   
  3966. ! sub extliblist {
  3967. !     my($self,$libs) = @_;
  3968. !     require ExtUtils::Liblist;
  3969. !     $self->ext($libs, $Verbose);
  3970. ! }
  3971.   
  3972. ! =item file_name_is_absolute
  3973.   
  3974. ! Takes as argument a path and returns true, it it is an absolute path.
  3975.   
  3976. ! =cut
  3977.   
  3978. ! sub file_name_is_absolute {
  3979. !     my($self,$file) = @_;
  3980. !     $file =~ m:^/: ;
  3981. ! }
  3982.   
  3983. ! =item find_perl
  3984.   
  3985. ! Finds the executables PERL and FULLPERL
  3986.   
  3987. + =cut
  3988.   
  3989. ! sub find_perl {
  3990. !     my($self, $ver, $names, $dirs, $trace) = @_;
  3991. !     my($name, $dir);
  3992. !     if ($trace >= 2){
  3993. !     print "Looking for perl $ver by these names:
  3994. ! @$names
  3995. ! in these dirs:
  3996. ! @$dirs
  3997. ! ";
  3998. !     }
  3999. !     foreach $dir (@$dirs){
  4000. !     next unless defined $dir; # $self->{PERL_SRC} may be undefined
  4001. !     foreach $name (@$names){
  4002. !         my $abs;
  4003. !         if ($self->file_name_is_absolute($name)) { # /foo/bar
  4004. !         $abs = $name;
  4005. !         } elsif ($self->canonpath($name) eq $self->canonpath(basename($name))) { # foo
  4006. !         $abs = $self->catfile($dir, $name);
  4007. !         } else { # foo/bar
  4008. !         $abs = $self->canonpath($self->catfile($self->curdir, $name));
  4009. !         }
  4010. !         print "Checking $abs\n" if ($trace >= 2);
  4011. !         next unless $self->maybe_command($abs);
  4012. !         print "Executing $abs\n" if ($trace >= 2);
  4013. !         if (`$abs -e 'require $ver; print "VER_OK\n" ' 2>&1` =~ /VER_OK/) {
  4014. !             print "Using PERL=$abs\n" if $trace;
  4015. !             return $abs;
  4016.           }
  4017.       }
  4018.       }
  4019. +     print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
  4020. +     0; # false and not empty
  4021. + }
  4022.   
  4023. ! =head2 Methods to actually produce chunks of text for the Makefile
  4024.   
  4025. ! The methods here are called in the order specified by
  4026. ! @ExtUtils::MakeMaker::MM_Sections. This manpage reflects the order as
  4027. ! well as possible. Some methods call each other, so in doubt refer to
  4028. ! the code.
  4029.   
  4030. ! =item force (o)
  4031. ! Just writes FORCE:
  4032. ! =cut
  4033.   
  4034. + sub force {
  4035. +     my($self) = shift;
  4036. +     '# Phony target to force checking subdirectories.
  4037. + FORCE:
  4038. + ';
  4039.   }
  4040.   
  4041. + =item guess_name
  4042.   
  4043. + Guess the name of this package by examining the working directory's
  4044. + name. MakeMaker calls this only if the developer has not supplied a
  4045. + NAME attribute.
  4046.   
  4047. ! =cut
  4048.   
  4049. ! # ';
  4050. ! sub guess_name {
  4051. !     my($self) = @_;
  4052. !     use Cwd 'cwd';
  4053. !     my $name = basename(cwd());
  4054. !     $name =~ s|[\-_][\d\.\-]+$||;   # this is new with MM 5.00, we
  4055. !                                     # strip minus or underline
  4056. !                                     # followed by a float or some such
  4057. !     print "Warning: Guessing NAME [$name] from current directory name.\n";
  4058. !     $name;
  4059. ! }
  4060. ! =item has_link_code
  4061. ! Returns true if C, XS, MYEXTLIB or similar objects exist within this
  4062. ! object that need a compiler. Does not descend into subdirectories as
  4063. ! needs_linking() does.
  4064.   
  4065.   =cut
  4066.   
  4067. ! sub has_link_code {
  4068. !     my($self) = shift;
  4069. !     return $self->{HAS_LINK_CODE} if defined $self->{HAS_LINK_CODE};
  4070. !     if ($self->{OBJECT} or @{$self->{C} || []} or $self->{MYEXTLIB}){
  4071. !     $self->{HAS_LINK_CODE} = 1;
  4072. !     return 1;
  4073.       }
  4074. !     return $self->{HAS_LINK_CODE} = 0;
  4075.   }
  4076.   
  4077. ! =item init_dirscan
  4078.   
  4079. ! Initializes DIR, XS, PM, C, O_FILES, H, PL_FILES, MAN*PODS, EXE_FILES.
  4080. ! =cut
  4081. ! sub init_dirscan {    # --- File and Directory Lists (.xs .pm .pod etc)
  4082. !     my($self) = @_;
  4083. !     my($name, %dir, %xs, %c, %h, %ignore, %pl_files, %manifypods);
  4084. !     local(%pm); #the sub in find() has to see this hash
  4085. !     $ignore{'test.pl'} = 1;
  4086. !     $ignore{'makefile.pl'} = 1 if $Is_VMS;
  4087. !     foreach $name ($self->lsdir($self->curdir)){
  4088. !     next if $name eq $self->curdir or $name eq $self->updir or $ignore{$name};
  4089. !     next unless $self->libscan($name);
  4090. !     if (-d $name){
  4091. !         next if -l $name; # We do not support symlinks at all
  4092. !         $dir{$name} = $name if (-f $self->catfile($name,"Makefile.PL"));
  4093. !     } elsif ($name =~ /\.xs$/){
  4094. !         my($c); ($c = $name) =~ s/\.xs$/.c/;
  4095. !         $xs{$name} = $c;
  4096. !         $c{$c} = 1;
  4097. !     } elsif ($name =~ /\.c(pp|xx|c)?$/i){  # .c .C .cpp .cxx .cc
  4098. !         $c{$name} = 1
  4099. !         unless $name =~ m/perlmain\.c/; # See MAP_TARGET
  4100. !     } elsif ($name =~ /\.h$/i){
  4101. !         $h{$name} = 1;
  4102. !     } elsif ($name =~ /\.(p[ml]|pod)$/){
  4103. !         $pm{$name} = $self->catfile('$(INST_LIBDIR)',$name);
  4104. !     } elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") {
  4105. !         ($pl_files{$name} = $name) =~ s/\.PL$// ;
  4106. !     } elsif ($Is_VMS && $name =~ /\.pl$/ && $name ne 'makefile.pl' &&
  4107. !              $name ne 'test.pl') {  # case-insensitive filesystem
  4108. !         ($pl_files{$name} = $name) =~ s/\.pl$// ;
  4109. !     }
  4110. !     }
  4111.   
  4112. !     # Some larger extensions often wish to install a number of *.pm/pl
  4113. !     # files into the library in various locations.
  4114.   
  4115. !     # The attribute PMLIBDIRS holds an array reference which lists
  4116. !     # subdirectories which we should search for library files to
  4117. !     # install. PMLIBDIRS defaults to [ 'lib', $self->{BASEEXT} ].  We
  4118. !     # recursively search through the named directories (skipping any
  4119. !     # which don't exist or contain Makefile.PL files).
  4120.   
  4121. !     # For each *.pm or *.pl file found $self->libscan() is called with
  4122. !     # the default installation path in $_[1]. The return value of
  4123. !     # libscan defines the actual installation location.  The default
  4124. !     # libscan function simply returns the path.  The file is skipped
  4125. !     # if libscan returns false.
  4126.   
  4127. !     # The default installation location passed to libscan in $_[1] is:
  4128. !     #
  4129. !     #  ./*.pm        => $(INST_LIBDIR)/*.pm
  4130. !     #  ./xyz/...    => $(INST_LIBDIR)/xyz/...
  4131. !     #  ./lib/...    => $(INST_LIB)/...
  4132. !     #
  4133. !     # In this way the 'lib' directory is seen as the root of the actual
  4134. !     # perl library whereas the others are relative to INST_LIBDIR
  4135. !     # (which includes PARENT_NAME). This is a subtle distinction but one
  4136. !     # that's important for nested modules.
  4137.   
  4138. !     $self->{PMLIBDIRS} = ['lib', $self->{BASEEXT}]
  4139. !     unless $self->{PMLIBDIRS};
  4140.   
  4141. !     #only existing directories that aren't in $dir are allowed
  4142.   
  4143. !     # Avoid $_ wherever possible:
  4144. !     # @{$self->{PMLIBDIRS}} = grep -d && !$dir{$_}, @{$self->{PMLIBDIRS}};
  4145. !     my (@pmlibdirs) = @{$self->{PMLIBDIRS}};
  4146. !     my ($pmlibdir);
  4147. !     @{$self->{PMLIBDIRS}} = ();
  4148. !     foreach $pmlibdir (@pmlibdirs) {
  4149. !     -d $pmlibdir && !$dir{$pmlibdir} && push @{$self->{PMLIBDIRS}}, $pmlibdir;
  4150.       }
  4151.   
  4152. !     if (@{$self->{PMLIBDIRS}}){
  4153. !     print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n"
  4154. !         if ($Verbose >= 2);
  4155. !     require File::Find;
  4156. !     File::Find::find(sub {
  4157. !         if (-d $_){
  4158. !         if ($_ eq "CVS" || $_ eq "RCS"){
  4159. !             $File::Find::prune = 1;
  4160. !         }
  4161. !         return;
  4162. !         }
  4163. !         my($path, $prefix) = ($File::Find::name, '$(INST_LIBDIR)');
  4164. !         my($striplibpath,$striplibname);
  4165. !         $prefix =  '$(INST_LIB)' if (($striplibpath = $path) =~ s:^(\W*)lib\W:$1:);
  4166. !         ($striplibname,$striplibpath) = fileparse($striplibpath);
  4167. !         my($inst) = $self->catfile($prefix,$striplibpath,$striplibname);
  4168. !         local($_) = $inst; # for backwards compatibility
  4169. !         $inst = $self->libscan($inst);
  4170. !         print "libscan($path) => '$inst'\n" if ($Verbose >= 2);
  4171. !         return unless $inst;
  4172. !         $pm{$path} = $inst;
  4173. !     }, @{$self->{PMLIBDIRS}});
  4174. !     }
  4175.   
  4176. !     $self->{DIR} = [sort keys %dir] unless $self->{DIR};
  4177. !     $self->{XS}  = \%xs             unless $self->{XS};
  4178. !     $self->{PM}  = \%pm             unless $self->{PM};
  4179. !     $self->{C}   = [sort keys %c]   unless $self->{C};
  4180. !     my(@o_files) = @{$self->{C}};
  4181. !     $self->{O_FILES} = [grep s/\.c(pp|xx|c)?$/$self->{OBJ_EXT}/i, @o_files] ;
  4182. !     $self->{H}   = [sort keys %h]   unless $self->{H};
  4183. !     $self->{PL_FILES} = \%pl_files unless $self->{PL_FILES};
  4184.   
  4185. !     # Set up names of manual pages to generate from pods
  4186. !     if ($self->{MAN1PODS}) {
  4187. !     } elsif ( $self->{INST_MAN1DIR} =~ /^(none|\s*)$/ ) {
  4188. !         $self->{MAN1PODS} = {};
  4189. !     } else {
  4190. !     my %manifypods = ();
  4191. !     if ( exists $self->{EXE_FILES} ) {
  4192. !         foreach $name (@{$self->{EXE_FILES}}) {
  4193. ! #        use FileHandle ();
  4194. ! #        my $fh = new FileHandle;
  4195. !         local *FH;
  4196. !         my($ispod)=0;
  4197. !         # one day test, if $/ can be set to '' safely (is the bug fixed that was in 5.001m?)
  4198. ! #        if ($fh->open("<$name")) {
  4199. !         if (open(FH,"<$name")) {
  4200. ! #            while (<$fh>) {
  4201. !             while (<FH>) {
  4202. !             if (/^=head1\s+\w+/) {
  4203. !                 $ispod=1;
  4204. !                 last;
  4205. !             }
  4206. !             }
  4207. ! #            $fh->close;
  4208. !             close FH;
  4209. !         } else {
  4210. !             # If it doesn't exist yet, we assume, it has pods in it
  4211. !             $ispod = 1;
  4212.           }
  4213. !         if( $ispod ) {
  4214. !             $manifypods{$name} = $self->catfile('$(INST_MAN1DIR)',basename($name).'.$(MAN1EXT)');
  4215.           }
  4216. +         }
  4217.       }
  4218. +     $self->{MAN1PODS} = \%manifypods;
  4219.       }
  4220. !     if ($self->{MAN3PODS}) {
  4221. !     } elsif ( $self->{INST_MAN3DIR} =~ /^(none|\s*)$/ ) {
  4222. !         $self->{MAN3PODS} = {};
  4223.       } else {
  4224. !     my %manifypods = (); # we collect the keys first, i.e. the files
  4225. !                  # we have to convert to pod
  4226. !     foreach $name (keys %{$self->{PM}}) {
  4227. !         if ($name =~ /\.pod$/ ) {
  4228. !         $manifypods{$name} = $self->{PM}{$name};
  4229. !         } elsif ($name =~ /\.p[ml]$/ ) {
  4230. ! #        use FileHandle ();
  4231. ! #        my $fh = new FileHandle;
  4232. !         local *FH;
  4233. !         my($ispod)=0;
  4234. ! #        $fh->open("<$name");
  4235. !         if (open(FH,"<$name")) {
  4236. !             #        while (<$fh>) {
  4237. !             while (<FH>) {
  4238. !             if (/^=head1\s+\w+/) {
  4239. !                 $ispod=1;
  4240. !                 last;
  4241. !             }
  4242. !             }
  4243. !             #        $fh->close;
  4244. !             close FH;
  4245. !         } else {
  4246. !             $ispod = 1;
  4247. !         }
  4248. !         if( $ispod ) {
  4249. !             $manifypods{$name} = $self->{PM}{$name};
  4250. !         }
  4251. !         }
  4252.       }
  4253.   
  4254. !     # Remove "Configure.pm" and similar, if it's not the only pod listed
  4255. !     # To force inclusion, just name it "Configure.pod", or override MAN3PODS
  4256. !     foreach $name (keys %manifypods) {
  4257. !         if ($name =~ /(config|setup).*\.pm/i) {
  4258. !         delete $manifypods{$name};
  4259. !         next;
  4260. !         }
  4261. !         my($manpagename) = $name;
  4262. !         unless ($manpagename =~ s!^\W*lib\W+!!) { # everything below lib is ok
  4263. !         $manpagename = $self->catfile(split(/::/,$self->{PARENT_NAME}),$manpagename);
  4264. !         }
  4265. !         $manpagename =~ s/\.p(od|m|l)$//;
  4266. !         $manpagename = $self->replace_manpage_separator($manpagename);
  4267. !         $manifypods{$name} = $self->catfile("\$(INST_MAN3DIR)","$manpagename.\$(MAN3EXT)");
  4268. !     }
  4269. !     $self->{MAN3PODS} = \%manifypods;
  4270. !     }
  4271. ! }
  4272.   
  4273. ! =item init_main
  4274.   
  4275. ! Initializes NAME, FULLEXT, BASEEXT, PARENT_NAME, DLBASE, PERL_SRC,
  4276. ! PERL_LIB, PERL_ARCHLIB, PERL_INC, INSTALLDIRS, INST_*, INSTALL*,
  4277. ! PREFIX, CONFIG, AR, AR_STATIC_ARGS, LD, OBJ_EXT, LIB_EXT, MAP_TARGET,
  4278. ! LIBPERL_A, VERSION_FROM, VERSION, DISTNAME, VERSION_SYM.
  4279.   
  4280. ! =cut
  4281.   
  4282. ! sub init_main {
  4283. !     my($self) = @_;
  4284.   
  4285. !     # --- Initialize Module Name and Paths
  4286.   
  4287. !     # NAME    = Foo::Bar::Oracle
  4288. !     # FULLEXT = Foo/Bar/Oracle
  4289. !     # BASEEXT = Oracle
  4290. !     # ROOTEXT = Directory part of FULLEXT with leading /. !!! Deprecated from MM 5.32 !!!
  4291. !     # PARENT_NAME = Foo::Bar
  4292. ! ### Only UNIX:
  4293. ! ###    ($self->{FULLEXT} =
  4294. ! ###     $self->{NAME}) =~ s!::!/!g ; #eg. BSD/Foo/Socket
  4295. !     $self->{FULLEXT} = $self->catdir(split /::/, $self->{NAME});
  4296.   
  4297.   
  4298. !     # Copied from DynaLoader:
  4299.   
  4300. !     my(@modparts) = split(/::/,$self->{NAME});
  4301. !     my($modfname) = $modparts[-1];
  4302.   
  4303. !     # Some systems have restrictions on files names for DLL's etc.
  4304. !     # mod2fname returns appropriate file base name (typically truncated)
  4305. !     # It may also edit @modparts if required.
  4306. !     if (defined &DynaLoader::mod2fname) {
  4307. !         $modfname = &DynaLoader::mod2fname(\@modparts);
  4308. !     } elsif ($Is_OS2) {                # Need manual correction if run with miniperl:-(
  4309. !         $modfname = substr($modfname, 0, 7) . '_';
  4310. !     }
  4311.   
  4312.   
  4313. !     ($self->{PARENT_NAME}, $self->{BASEEXT}) = $self->{NAME} =~ m!([\w:]+::)?(\w+)$! ;
  4314.   
  4315. !     if (defined &DynaLoader::mod2fname or $Is_OS2) {
  4316. !     # As of 5.001m, dl_os2 appends '_'
  4317. !     $self->{DLBASE} = $modfname;
  4318. !     } else {
  4319. !     $self->{DLBASE} = '$(BASEEXT)';
  4320. !     }
  4321.   
  4322.   
  4323. !     ### ROOTEXT deprecated from MM 5.32
  4324. ! ###    ($self->{ROOTEXT} =
  4325. ! ###     $self->{FULLEXT}) =~ s#/?\Q$self->{BASEEXT}\E$## ;      #eg. /BSD/Foo
  4326. ! ###    $self->{ROOTEXT} = ($Is_VMS ? '' : '/') . $self->{ROOTEXT} if $self->{ROOTEXT};
  4327.   
  4328.   
  4329. !     # --- Initialize PERL_LIB, INST_LIB, PERL_SRC
  4330.   
  4331. !     # *Real* information: where did we get these two from? ...
  4332. !     my $inc_config_dir = dirname($INC{'Config.pm'});
  4333. !     my $inc_carp_dir   = dirname($INC{'Carp.pm'});
  4334.   
  4335. !     unless ($self->{PERL_SRC}){
  4336. !     my($dir);
  4337. !     foreach $dir ($self->updir(),$self->catdir($self->updir(),$self->updir()),$self->catdir($self->updir(),$self->updir(),$self->updir())){
  4338. !         if (
  4339. !         -f $self->catfile($dir,"config.sh")
  4340. !         &&
  4341. !         -f $self->catfile($dir,"perl.h")
  4342. !         &&
  4343. !         -f $self->catfile($dir,"lib","Exporter.pm")
  4344. !            ) {
  4345. !         $self->{PERL_SRC}=$dir ;
  4346. !         last;
  4347. !         }
  4348. !     }
  4349. !     }
  4350. !     if ($self->{PERL_SRC}){
  4351. !     $self->{PERL_LIB}     ||= $self->catdir("$self->{PERL_SRC}","lib");
  4352. !     $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
  4353. !     $self->{PERL_INC}     = $self->{PERL_SRC};
  4354. !     # catch a situation that has occurred a few times in the past:
  4355.   
  4356. !     warn <<EOM unless (-s $self->catfile($self->{PERL_SRC},'cflags') or $Is_VMS && -s $self->catfile($self->{PERL_SRC},'perlshr_attr.opt') or $Is_Mac);
  4357. ! You cannot build extensions below the perl source tree after executing
  4358. ! a 'make clean' in the perl source tree.
  4359.   
  4360. ! To rebuild extensions distributed with the perl source you should
  4361. ! simply Configure (to include those extensions) and then build perl as
  4362. ! normal. After installing perl the source tree can be deleted. It is
  4363. ! not needed for building extensions by running 'perl Makefile.PL'
  4364. ! usually without extra arguments.
  4365.   
  4366. ! It is recommended that you unpack and build additional extensions away
  4367. ! from the perl source tree.
  4368. ! EOM
  4369. !     } else {
  4370. !     # we should also consider $ENV{PERL5LIB} here
  4371. !     $self->{PERL_LIB}     ||= $Config::Config{privlibexp};
  4372. !     $self->{PERL_ARCHLIB} ||= $Config::Config{archlibexp};
  4373. !     $self->{PERL_INC}     = $self->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now
  4374. !     my $perl_h;
  4375. !     die <<EOM unless (-f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h")));
  4376. ! Error: Unable to locate installed Perl libraries or Perl source code.
  4377.   
  4378. ! It is recommended that you install perl in a standard location before
  4379. ! building extensions. You can say:
  4380.   
  4381. !     $^X Makefile.PL PERL_SRC=/path/to/perl/source/directory
  4382.   
  4383. ! if you have not yet installed perl but still want to build this
  4384. ! extension now.
  4385. ! (You get this message, because MakeMaker could not find "$perl_h")
  4386. ! EOM
  4387.   
  4388. ! #     print STDOUT "Using header files found in $self->{PERL_INC}\n"
  4389. ! #         if $Verbose && $self->needs_linking();
  4390.   
  4391. !     }
  4392.   
  4393. !     # We get SITELIBEXP and SITEARCHEXP directly via
  4394. !     # Get_from_Config. When we are running standard modules, these
  4395. !     # won't matter, we will set INSTALLDIRS to "perl". Otherwise we
  4396. !     # set it to "site". I prefer that INSTALLDIRS be set from outside
  4397. !     # MakeMaker.
  4398. !     $self->{INSTALLDIRS} ||= "site";
  4399.   
  4400. !     # INST_LIB typically pre-set if building an extension after
  4401. !     # perl has been built and installed. Setting INST_LIB allows
  4402. !     # you to build directly into, say $Config::Config{privlibexp}.
  4403. !     unless ($self->{INST_LIB}){
  4404.   
  4405.   
  4406. !     ##### XXXXX We have to change this nonsense
  4407.   
  4408. !     if (defined $self->{PERL_SRC} and $self->{INSTALLDIRS} eq "perl") {
  4409. !         $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB};
  4410. !     } else {
  4411. !         $self->{INST_LIB} = $self->catdir($self->curdir,"blib","lib");
  4412. !     }
  4413. !     }
  4414. !     $self->{INST_ARCHLIB} ||= $self->catdir($self->curdir,"blib","arch");
  4415. !     $self->{INST_BIN} ||= $self->catdir($self->curdir,'blib','bin');
  4416.   
  4417. !     # INST_EXE is deprecated, should go away March '97
  4418. !     $self->{INST_EXE} ||= $self->catdir($self->curdir,'blib','script');
  4419. !     $self->{INST_SCRIPT} ||= $self->catdir($self->curdir,'blib','script');
  4420.   
  4421. !     # The user who requests an installation directory explicitly
  4422. !     # should not have to tell us a architecture installation directory
  4423. !     # as well We look if a directory exists that is named after the
  4424. !     # architecture. If not we take it as a sign that it should be the
  4425. !     # same as the requested installation directory. Otherwise we take
  4426. !     # the found one.
  4427. !     # We do the same thing twice: for privlib/archlib and for sitelib/sitearch
  4428. !     my($libpair);
  4429. !     for $libpair ({l=>"privlib", a=>"archlib"}, {l=>"sitelib", a=>"sitearch"}) {
  4430. !     my $lib = "install$libpair->{l}";
  4431. !     my $Lib = uc $lib;
  4432. !     my $Arch = uc "install$libpair->{a}";
  4433. !     if( $self->{$Lib} && ! $self->{$Arch} ){
  4434. !         my($ilib) = $Config{$lib};
  4435. !         $ilib = VMS::Filespec::unixify($ilib) if $Is_VMS;
  4436.   
  4437. !         $self->prefixify($Arch,$ilib,$self->{$Lib});
  4438.   
  4439. !         unless (-d $self->{$Arch}) {
  4440. !         print STDOUT "Directory $self->{$Arch} not found, thusly\n" if $Verbose;
  4441. !         $self->{$Arch} = $self->{$Lib};
  4442. !         }
  4443. !         print STDOUT "Defaulting $Arch to $self->{$Arch}\n" if $Verbose;
  4444. !     }
  4445.       }
  4446. !     # we have to look at the relation between $Config{prefix} and the
  4447. !     # requested values. We're going to set the $Config{prefix} part of
  4448. !     # all the installation path variables to literally $(PREFIX), so
  4449. !     # the user can still say make PREFIX=foo
  4450. !     my($prefix) = $Config{'prefix'};
  4451. !     $prefix = VMS::Filespec::unixify($prefix) if $Is_VMS;
  4452. !     unless ($self->{PREFIX}){
  4453. !     $self->{PREFIX} = $prefix;
  4454.       }
  4455. !     my($install_variable);
  4456. !     for $install_variable (qw/
  4457.   
  4458. !                INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN
  4459. !                INSTALLMAN1DIR INSTALLMAN3DIR INSTALLSCRIPT
  4460. !                INSTALLSITELIB INSTALLSITEARCH
  4461.   
  4462. !                /) {
  4463. !     $self->prefixify($install_variable,$prefix,q[$(PREFIX)]);
  4464. !     }
  4465.   
  4466.   
  4467. !     # Now we head at the manpages. Maybe they DO NOT want manpages
  4468. !     # installed
  4469. !     $self->{INSTALLMAN1DIR} = $Config::Config{installman1dir}
  4470. !     unless defined $self->{INSTALLMAN1DIR};
  4471. !     unless (defined $self->{INST_MAN1DIR}){
  4472. !     if ($self->{INSTALLMAN1DIR} =~ /^(none|\s*)$/){
  4473. !         $self->{INST_MAN1DIR} = $self->{INSTALLMAN1DIR};
  4474. !     } else {
  4475. !         $self->{INST_MAN1DIR} = $self->catdir($self->curdir,'blib','man1');
  4476. !     }
  4477.       }
  4478. !     $self->{MAN1EXT} ||= $Config::Config{man1ext};
  4479. !     $self->{INSTALLMAN3DIR} = $Config::Config{installman3dir}
  4480. !     unless defined $self->{INSTALLMAN3DIR};
  4481. !     unless (defined $self->{INST_MAN3DIR}){
  4482. !     if ($self->{INSTALLMAN3DIR} =~ /^(none|\s*)$/){
  4483. !         $self->{INST_MAN3DIR} = $self->{INSTALLMAN3DIR};
  4484. !     } else {
  4485. !         $self->{INST_MAN3DIR} = $self->catdir($self->curdir,'blib','man3');
  4486. !     }
  4487.       }
  4488. !     $self->{MAN3EXT} ||= $Config::Config{man3ext};
  4489.   
  4490.   
  4491. !     # Get some stuff out of %Config if we haven't yet done so
  4492. !     print STDOUT "CONFIG must be an array ref\n"
  4493. !     if ($self->{CONFIG} and ref $self->{CONFIG} ne 'ARRAY');
  4494. !     $self->{CONFIG} = [] unless (ref $self->{CONFIG});
  4495. !     push(@{$self->{CONFIG}}, @ExtUtils::MakeMaker::Get_from_Config);
  4496. !     push(@{$self->{CONFIG}}, 'shellflags') if $Config::Config{shellflags};
  4497. !     my(%once_only,$m);
  4498. !     foreach $m (@{$self->{CONFIG}}){
  4499. !     next if $once_only{$m};
  4500. !     print STDOUT "CONFIG key '$m' does not exist in Config.pm\n"
  4501. !         unless exists $Config::Config{$m};
  4502. !     $self->{uc $m} ||= $Config::Config{$m};
  4503. !     $once_only{$m} = 1;
  4504. !     }
  4505.   
  4506. ! # This is too dangerous:
  4507. ! #    if ($^O eq "next") {
  4508. ! #    $self->{AR} = "libtool";
  4509. ! #    $self->{AR_STATIC_ARGS} = "-o";
  4510. ! #    }
  4511. ! # But I leave it as a placeholder
  4512. !     $self->{AR_STATIC_ARGS} ||= "cr";
  4513. !     # These should never be needed
  4514. !     $self->{LD} ||= 'ld';
  4515. !     $self->{OBJ_EXT} ||= '.o';
  4516. !     $self->{LIB_EXT} ||= '.a';
  4517.   
  4518. !     $self->{MAP_TARGET} ||= "perl";
  4519.   
  4520. !     $self->{LIBPERL_A} ||= "libperl$self->{LIB_EXT}";
  4521.   
  4522. !     # make a simple check if we find Exporter
  4523. !     warn "Warning: PERL_LIB ($self->{PERL_LIB}) seems not to be a perl library directory
  4524. !         (Exporter.pm not found)"
  4525. !     unless -f $self->catfile("$self->{PERL_LIB}","Exporter.pm") ||
  4526. !         $self->{NAME} eq "ExtUtils::MakeMaker";
  4527.   
  4528. !     # Determine VERSION and VERSION_FROM
  4529. !     ($self->{DISTNAME}=$self->{NAME}) =~ s#(::)#-#g unless $self->{DISTNAME};
  4530. !     if ($self->{VERSION_FROM}){
  4531. !     $self->{VERSION} = $self->parse_version($self->{VERSION_FROM}) or
  4532. !         Carp::carp "WARNING: Setting VERSION via file '$self->{VERSION_FROM}' failed\n"
  4533. !     }
  4534.   
  4535. !     # strip blanks
  4536. !     if ($self->{VERSION}) {
  4537. !     $self->{VERSION} =~ s/^\s+//;
  4538. !     $self->{VERSION} =~ s/\s+$//;
  4539.       }
  4540.   
  4541. !     $self->{VERSION} ||= "0.10";
  4542. !     ($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g;
  4543.   
  4544.   
  4545. !     # Graham Barr and Paul Marquess had some ideas how to ensure
  4546. !     # version compatibility between the *.pm file and the
  4547. !     # corresponding *.xs file. The bottomline was, that we need an
  4548. !     # XS_VERSION macro that defaults to VERSION:
  4549. !     $self->{XS_VERSION} ||= $self->{VERSION};
  4550.   
  4551. !     # --- Initialize Perl Binary Locations
  4552. !     # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
  4553. !     # will be working versions of perl 5. miniperl has priority over perl
  4554. !     # for PERL to ensure that $(PERL) is usable while building ./ext/*
  4555. !     my ($component,@defpath);
  4556. !     foreach $component ($self->{PERL_SRC}, $self->path(), $Config::Config{binexp}) {
  4557. !     push @defpath, $component if defined $component;
  4558.       }
  4559. +     $self->{PERL} =
  4560. +         $self->find_perl(5.0, [ $^X, 'miniperl','perl','perl5',"perl$]" ],
  4561. +         \@defpath, $Verbose ) unless ($self->{PERL});
  4562. +     # don't check if perl is executable, maybe they have decided to
  4563. +     # supply switches with perl
  4564.   
  4565. !     # Define 'FULLPERL' to be a non-miniperl (used in test: target)
  4566. !     ($self->{FULLPERL} = $self->{PERL}) =~ s/miniperl/perl/i
  4567. !     unless ($self->{FULLPERL});
  4568.   }
  4569.   
  4570. ! =item init_others
  4571.   
  4572. ! Initializes EXTRALIBS, BSLOADLIBS, LDLOADLIBS, LIBS, LD_RUN_PATH,
  4573. ! OBJECT, BOOTDEP, PERLMAINCC, LDFROM, LINKTYPE, NOOP, FIRST_MAKEFILE,
  4574. ! MAKEFILE, NOECHO, RM_F, RM_RF, TOUCH, CP, MV, CHMOD, UMASK_NULL
  4575.   
  4576.   =cut
  4577.   
  4578. ! sub init_others {    # --- Initialize Other Attributes
  4579.       my($self) = shift;
  4580.   
  4581. !     # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS}
  4582. !     # Lets look at $self->{LIBS} carefully: It may be an anon array, a string or
  4583. !     # undefined. In any case we turn it into an anon array:
  4584.   
  4585. !     # May check $Config{libs} too, thus not empty.
  4586. !     $self->{LIBS}=[''] unless $self->{LIBS};
  4587.   
  4588. !     $self->{LIBS}=[$self->{LIBS}] if ref \$self->{LIBS} eq SCALAR;
  4589. !     $self->{LD_RUN_PATH} = "";
  4590. !     my($libs);
  4591. !     foreach $libs ( @{$self->{LIBS}} ){
  4592. !     $libs =~ s/^\s*(.*\S)\s*$/$1/; # remove leading and trailing whitespace
  4593. !     my(@libs) = $self->extliblist($libs);
  4594. !     if ($libs[0] or $libs[1] or $libs[2]){
  4595. !         # LD_RUN_PATH now computed by ExtUtils::Liblist
  4596. !         ($self->{EXTRALIBS}, $self->{BSLOADLIBS}, $self->{LDLOADLIBS}, $self->{LD_RUN_PATH}) = @libs;
  4597. !         last;
  4598. !     }
  4599. !     }
  4600.   
  4601. !     if ( $self->{OBJECT} ) {
  4602. !     $self->{OBJECT} =~ s!\.o(bj)?\b!\$(OBJ_EXT)!g;
  4603. !     } else {
  4604. !     # init_dirscan should have found out, if we have C files
  4605. !     $self->{OBJECT} = "";
  4606. !     $self->{OBJECT} = '$(BASEEXT)$(OBJ_EXT)' if @{$self->{C}||[]};
  4607. !     }
  4608. !     $self->{OBJECT} =~ s/\n+/ \\\n\t/g;
  4609. !     $self->{BOOTDEP}  = (-f "$self->{BASEEXT}_BS") ? "$self->{BASEEXT}_BS" : "";
  4610. !     $self->{PERLMAINCC} ||= '$(CC)';
  4611. !     $self->{LDFROM} = '$(OBJECT)' unless $self->{LDFROM};
  4612. !     # Sanity check: don't define LINKTYPE = dynamic if we're skipping
  4613. !     # the 'dynamic' section of MM.  We don't have this problem with
  4614. !     # 'static', since we either must use it (%Config says we can't
  4615. !     # use dynamic loading) or the caller asked for it explicitly.
  4616. !     if (!$self->{LINKTYPE}) {
  4617. !        $self->{LINKTYPE} = $self->{SKIPHASH}{'dynamic'}
  4618. !                         ? 'static'
  4619. !                         : ($Config::Config{usedl} ? 'dynamic' : 'static');
  4620. !     };
  4621. !     # These get overridden for VMS and maybe some other systems
  4622. !     $self->{NOOP}  ||= "sh -c true";
  4623. !     $self->{FIRST_MAKEFILE} ||= "Makefile";
  4624. !     $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE};
  4625. !     $self->{MAKE_APERL_FILE} ||= "Makefile.aperl";
  4626. !     $self->{NOECHO} = '@' unless defined $self->{NOECHO};
  4627. !     $self->{RM_F}  ||= "rm -f";
  4628. !     $self->{RM_RF} ||= "rm -rf";
  4629. !     $self->{TOUCH} ||= "touch";
  4630. !     $self->{CP} ||= "cp";
  4631. !     $self->{MV} ||= "mv";
  4632. !     $self->{CHMOD} ||= "chmod";
  4633. !     $self->{UMASK_NULL} ||= "umask 0";
  4634.   }
  4635.   
  4636. ! =item install (o)
  4637.   
  4638. ! Defines the install target.
  4639.   
  4640.   =cut
  4641.   
  4642. ! sub install {
  4643. !     my($self, %attribs) = @_;
  4644. !     my(@m);
  4645.   
  4646. !     push @m, q{
  4647. ! install :: all pure_install doc_install
  4648.   
  4649. ! install_perl :: all pure_perl_install doc_perl_install
  4650.   
  4651. ! install_site :: all pure_site_install doc_site_install
  4652.   
  4653. ! install_ :: install_site
  4654. !     @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
  4655.   
  4656. ! pure_install :: pure_$(INSTALLDIRS)_install
  4657.   
  4658. ! doc_install :: doc_$(INSTALLDIRS)_install
  4659. !     }.$self->{NOECHO}.q{echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
  4660.   
  4661. ! pure__install : pure_site_install
  4662. !     @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
  4663.   
  4664. ! doc__install : doc_site_install
  4665. !     @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
  4666.   
  4667. ! pure_perl_install ::
  4668. !     }.$self->{NOECHO}.q{$(MOD_INSTALL) \
  4669. !         read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
  4670. !         write }.$self->catfile('$(INSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
  4671. !         $(INST_LIB) $(INSTALLPRIVLIB) \
  4672. !         $(INST_ARCHLIB) $(INSTALLARCHLIB) \
  4673. !         $(INST_BIN) $(INSTALLBIN) \
  4674. !         $(INST_SCRIPT) $(INSTALLSCRIPT) \
  4675. !         $(INST_MAN1DIR) $(INSTALLMAN1DIR) \
  4676. !         $(INST_MAN3DIR) $(INSTALLMAN3DIR)
  4677. !     }.$self->{NOECHO}.q{$(WARN_IF_OLD_PACKLIST) \
  4678. !         }.$self->catdir('$(SITEARCHEXP)','auto','$(FULLEXT)').q{
  4679.   
  4680.   
  4681. ! pure_site_install ::
  4682. !     }.$self->{NOECHO}.q{$(MOD_INSTALL) \
  4683. !         read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
  4684. !         write }.$self->catfile('$(INSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \
  4685. !         $(INST_LIB) $(INSTALLSITELIB) \
  4686. !         $(INST_ARCHLIB) $(INSTALLSITEARCH) \
  4687. !         $(INST_BIN) $(INSTALLBIN) \
  4688. !         $(INST_SCRIPT) $(INSTALLSCRIPT) \
  4689. !         $(INST_MAN1DIR) $(INSTALLMAN1DIR) \
  4690. !         $(INST_MAN3DIR) $(INSTALLMAN3DIR)
  4691. !     }.$self->{NOECHO}.q{$(WARN_IF_OLD_PACKLIST) \
  4692. !         }.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{
  4693.   
  4694. ! doc_perl_install ::
  4695. !     }.$self->{NOECHO}.q{$(DOC_INSTALL) \
  4696. !         "$(NAME)" \
  4697. !         "installed into" "$(INSTALLPRIVLIB)" \
  4698. !         LINKTYPE "$(LINKTYPE)" \
  4699. !         VERSION "$(VERSION)" \
  4700. !         EXE_FILES "$(EXE_FILES)" \
  4701. !         >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
  4702.   
  4703. ! doc_site_install ::
  4704. !     }.$self->{NOECHO}.q{$(DOC_INSTALL) \
  4705. !         "Module $(NAME)" \
  4706. !         "installed into" "$(INSTALLSITELIB)" \
  4707. !         LINKTYPE "$(LINKTYPE)" \
  4708. !         VERSION "$(VERSION)" \
  4709. !         EXE_FILES "$(EXE_FILES)" \
  4710. !         >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
  4711.   
  4712. ! };
  4713.   
  4714. !     push @m, q{
  4715. ! uninstall :: uninstall_from_$(INSTALLDIRS)dirs
  4716.   
  4717. ! uninstall_from_perldirs ::
  4718. !     }.$self->{NOECHO}.
  4719. !     q{$(UNINSTALL) }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{
  4720.   
  4721. ! uninstall_from_sitedirs ::
  4722. !     }.$self->{NOECHO}.
  4723. !     q{$(UNINSTALL) }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{
  4724. ! };
  4725. !     join("",@m);
  4726. ! }
  4727. ! =item installbin (o)
  4728.   
  4729. ! Defines targets to install EXE_FILES.
  4730.   
  4731. ! =cut
  4732.   
  4733. ! sub installbin {
  4734. !     my($self) = shift;
  4735. !     return "" unless $self->{EXE_FILES} && ref $self->{EXE_FILES} eq "ARRAY";
  4736. !     return "" unless @{$self->{EXE_FILES}};
  4737. !     my(@m, $from, $to, %fromto, @to);
  4738. !     push @m, $self->dir_target(qw[$(INST_SCRIPT)]);
  4739. !     for $from (@{$self->{EXE_FILES}}) {
  4740. !     my($path)= $self->catfile('$(INST_SCRIPT)', basename($from));
  4741. !     local($_) = $path; # for backwards compatibility
  4742. !     $to = $self->libscan($path);
  4743. !     print "libscan($from) => '$to'\n" if ($Verbose >=2);
  4744. !     $fromto{$from}=$to;
  4745.       }
  4746. !     @to   = values %fromto;
  4747. !     push(@m, "
  4748. ! EXE_FILES = @{$self->{EXE_FILES}}
  4749.   
  4750. ! all :: @to
  4751. ! realclean ::
  4752. !     $self->{RM_F} @to
  4753. ! ");
  4754. !     while (($from,$to) = each %fromto) {
  4755. !     last unless defined $from;
  4756. !     my $todir = dirname($to);
  4757. !     push @m, "
  4758. ! $to: $from $self->{MAKEFILE} $todir/.exists
  4759. !     $self->{NOECHO}$self->{RM_F} $to
  4760. !     $self->{CP} $from $to
  4761. ! ";
  4762.       }
  4763. +     join "", @m;
  4764. + }
  4765.   
  4766. ! =item libscan (o)
  4767.   
  4768. ! Takes a path to a file that is found by init_dirscan and returns false
  4769. ! if we don't want to include this file in the library. Mainly used to
  4770. ! exclude RCS, CVS, and SCCS directories from installation.
  4771.   
  4772. ! =cut
  4773.   
  4774. ! # ';
  4775. ! sub libscan {
  4776. !     my($self,$path) = @_;
  4777. !     return '' if $path =~ m:\b(RCS|CVS|SCCS)\b: ;
  4778. !     $path;
  4779.   }
  4780.   
  4781.   =item linkext (o)
  4782. ***************
  4783. *** 1941,1950 ****
  4784.   
  4785.   sub linkext {
  4786.       my($self, %attribs) = @_;
  4787. -     unless (ref $self){
  4788. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  4789. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  4790. -     }
  4791.       # LINKTYPE => static or dynamic or ''
  4792.       my($linktype) = defined $attribs{LINKTYPE} ?
  4793.         $attribs{LINKTYPE} : '$(LINKTYPE)';
  4794. --- 1860,1865 ----
  4795. ***************
  4796. *** 1954,2231 ****
  4797.   ";
  4798.   }
  4799.   
  4800. ! =item dlsyms (o)
  4801.   
  4802. ! Used by AIX and VMS to define DL_FUNCS and DL_VARS and write the *.exp
  4803. ! files.
  4804.   
  4805.   =cut
  4806.   
  4807. ! sub dlsyms {
  4808.       my($self,%attribs) = @_;
  4809. !     unless (ref $self){
  4810. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  4811. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  4812.       }
  4813.   
  4814. !     return '' unless ($^O eq 'aix' && $self->needs_linking() );
  4815.   
  4816. !     my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
  4817. !     my($vars)  = $attribs{DL_VARS} || $self->{DL_VARS} || [];
  4818.       my(@m);
  4819.   
  4820. !     push(@m,"
  4821. ! dynamic :: $self->{BASEEXT}.exp
  4822.   
  4823. ! ") unless $self->{SKIPHASH}{'dynamic'}; # dynamic and static are subs, so...
  4824.   
  4825. !     push(@m,"
  4826. ! static :: $self->{BASEEXT}.exp
  4827.   
  4828. ! ") unless $self->{SKIPHASH}{'static'};  # we avoid a warning if we tick them
  4829.   
  4830. !     push(@m,"
  4831. ! $self->{BASEEXT}.exp: Makefile.PL
  4832. ! ",'    $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::Mksymlists; \\
  4833. !     Mksymlists("NAME" => "',$self->{NAME},'", "DL_FUNCS" => ',
  4834. !     neatvalue($funcs),', "DL_VARS" => ', neatvalue($vars), ');\'
  4835. ! ');
  4836.   
  4837. -     join('',@m);
  4838. - }
  4839.   
  4840. - =item dynamic (o)
  4841.   
  4842. ! Defines the dynamic target.
  4843.   
  4844. - =cut
  4845.   
  4846. ! sub dynamic {
  4847. ! # --- Dynamic Loading Sections ---
  4848.   
  4849. !     my($self) = shift;
  4850. !     unless (ref $self){
  4851. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  4852. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  4853. !     }
  4854. !     '
  4855. ! ## $(INST_PM) has been moved to the all: target.
  4856. ! ## It remains here for awhile to allow for old usage: "make dynamic"
  4857. ! #dynamic :: '.$self->{MAKEFILE}.' $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM)
  4858. ! dynamic :: '.$self->{MAKEFILE}.' $(INST_DYNAMIC) $(INST_BOOT)
  4859. !     '.$self->{NOECHO}.'$(NOOP)
  4860. ! ';
  4861. ! }
  4862.   
  4863. ! =item dynamic_bs (o)
  4864.   
  4865. ! Defines targets for bootstrap files.
  4866.   
  4867. ! =cut
  4868.   
  4869. ! sub dynamic_bs {
  4870. !     my($self, %attribs) = @_;
  4871. !     unless (ref $self){
  4872. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  4873. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  4874.       }
  4875. -     return '
  4876. - BOOTSTRAP =
  4877. - ' unless $self->has_link_code();
  4878.   
  4879. !     return '
  4880. ! BOOTSTRAP = '."$self->{BASEEXT}.bs".'
  4881.   
  4882. ! # As Mkbootstrap might not write a file (if none is required)
  4883. ! # we use touch to prevent make continually trying to remake it.
  4884. ! # The DynaLoader only reads a non-empty file.
  4885. ! $(BOOTSTRAP): '."$self->{MAKEFILE} $self->{BOOTDEP}".' $(INST_ARCHAUTODIR)/.exists
  4886. !     '.$self->{NOECHO}.'echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
  4887. !     '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
  4888. !         -e \'use ExtUtils::Mkbootstrap;\' \
  4889. !         -e \'Mkbootstrap("$(BASEEXT)","$(BSLOADLIBS)");\'
  4890. !     '.$self->{NOECHO}.'$(TOUCH) $(BOOTSTRAP)
  4891. !     $(CHMOD) 644 $@
  4892.   
  4893. ! $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists
  4894. !     '."$self->{NOECHO}$self->{RM_RF}".' $(INST_BOOT)
  4895. !     -'.$self->{CP}.' $(BOOTSTRAP) $(INST_BOOT)
  4896. !     $(CHMOD) 644 $@
  4897. ! ';
  4898. ! }
  4899.   
  4900. ! =item dynamic_lib (o)
  4901.   
  4902. ! Defines how to produce the *.so (or equivalent) files.
  4903.   
  4904. ! =cut
  4905.   
  4906. ! sub dynamic_lib {
  4907. !     my($self, %attribs) = @_;
  4908. !     unless (ref $self){
  4909. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  4910. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  4911.       }
  4912. -     return '' unless $self->needs_linking(); #might be because of a subdir
  4913.   
  4914. !     return '' unless $self->has_link_code;
  4915.   
  4916. !     my($otherldflags) = $attribs{OTHERLDFLAGS} || "";
  4917. !     my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
  4918. !     my($armaybe) = $attribs{ARMAYBE} || $self->{ARMAYBE} || ":";
  4919. !     my($ldfrom) = '$(LDFROM)';
  4920. !     $armaybe = 'ar' if ($^O eq 'dec_osf' and $armaybe eq ':');
  4921. !     my(@m);
  4922. !     push(@m,'
  4923. ! # This section creates the dynamically loadable $(INST_DYNAMIC)
  4924. ! # from $(OBJECT) and possibly $(MYEXTLIB).
  4925. ! ARMAYBE = '.$armaybe.'
  4926. ! OTHERLDFLAGS = '.$otherldflags.'
  4927. ! INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
  4928.   
  4929. ! $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
  4930. ! ');
  4931. !     if ($armaybe ne ':'){
  4932. !     $ldfrom = 'tmp$(LIB_EXT)';
  4933. !     push(@m,'    $(ARMAYBE) cr '.$ldfrom.' $(OBJECT)'."\n");
  4934. !     push(@m,'    $(RANLIB) '."$ldfrom\n");
  4935. !     }
  4936. !     $ldfrom = "-all $ldfrom -none" if ($^O eq 'dec_osf');
  4937. !     push(@m,'    LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) -o $@ $(LDDLFLAGS) '.$ldfrom.
  4938. !         ' $(OTHERLDFLAGS) $(MYEXTLIB) $(LDLOADLIBS) $(EXPORT_LIST) $(PERL_ARCHIVE)');
  4939. !     push @m, '
  4940. !     $(CHMOD) 755 $@
  4941. ! ';
  4942.   
  4943. !     push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
  4944. !     join('',@m);
  4945. ! }
  4946.   
  4947. ! =item static (o)
  4948.   
  4949. ! Defines the static target.
  4950.   
  4951. ! =cut
  4952.   
  4953. ! sub static {
  4954. ! # --- Static Loading Sections ---
  4955.   
  4956. !     my($self) = shift;
  4957. !     unless (ref $self){
  4958. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  4959. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  4960. !     }
  4961. !     '
  4962. ! ## $(INST_PM) has been moved to the all: target.
  4963. ! ## It remains here for awhile to allow for old usage: "make static"
  4964. ! #static :: '.$self->{MAKEFILE}.' $(INST_STATIC) $(INST_PM)
  4965. ! static :: '.$self->{MAKEFILE}.' $(INST_STATIC)
  4966. !     '.$self->{NOECHO}.'$(NOOP)
  4967. ! ';
  4968.   }
  4969.   
  4970. ! =item static_lib (o)
  4971.   
  4972. ! Defines how to produce the *.a (or equivalent) files.
  4973.   
  4974.   =cut
  4975.   
  4976. ! sub static_lib {
  4977. !     my($self) = @_;
  4978. !     unless (ref $self){
  4979. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  4980. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  4981. !     }
  4982. ! # Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC
  4983. ! #    return '' unless $self->needs_linking(); #might be because of a subdir
  4984. !     return '' unless $self->has_link_code;
  4985.   
  4986. !     my(@m);
  4987. !     push(@m, <<'END');
  4988. ! $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)/.exists
  4989. ! END
  4990. !     # If this extension has it's own library (eg SDBM_File)
  4991. !     # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
  4992. !     push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
  4993.   
  4994. !     push @m,
  4995. ! q{    $(AR) $(AR_STATIC_ARGS) $@ $(OBJECT) && $(RANLIB) $@
  4996. !     }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
  4997. !     $(CHMOD) 755 $@
  4998.   };
  4999.   
  5000. ! # Old mechanism - still available:
  5001. !     push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)/ext.libs}."\n\n"
  5002. !     if $self->{PERL_SRC};
  5003. !     push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
  5004. !     join('', "\n",@m);
  5005.   }
  5006.   
  5007. - # =item installpm
  5008. - #
  5009. - # Cares for copying and autosplitting the files in PM (which may be more
  5010. - # than just *.pm files) into the INST_* directories.
  5011. - #
  5012. - # =cut
  5013. - #
  5014. - # sub installpm {
  5015. - #     my($self, %attribs) = @_;
  5016. - #     unless (ref $self){
  5017. - #       ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5018. - #       $self = $ExtUtils::MakeMaker::Parent[-1];
  5019. - #     }
  5020. - #     # By default .pm files are split into the architecture independent
  5021. - #     # library. This is a good thing. If a specific module requires that
  5022. - #     # its .pm files are split into the architecture specific library
  5023. - #     # then it should use: installpm => {SPLITLIB=>'$(INST_ARCHLIB)'}
  5024. - #     # Note that installperl currently interferes with this (Config.pm)
  5025. - #     # User can disable split by saying: installpm => {SPLITLIB=>''}
  5026. - #     my($splitlib) = '$(INST_LIB)'; # NOT arch specific by default
  5027. - #     $splitlib = $attribs{SPLITLIB} if exists $attribs{SPLITLIB};
  5028. - #     my(@m, $dist);
  5029. - #     push @m, "inst_pm :: \$(INST_PM)\n\n";
  5030. - #     foreach $dist (sort keys %{$self->{PM}}){
  5031. - #       my($inst) = $self->{PM}->{$dist};
  5032. - #       push(@m, "\n# installpm: $dist => $inst, splitlib=$splitlib\n");
  5033. - #       push(@m, $self->installpm_x($dist, $inst, $splitlib));
  5034. - #       push(@m, "\n");
  5035. - #     }
  5036. - #     join('', @m);
  5037. - # }
  5038. - #
  5039. - # =item installpm_x
  5040. - #
  5041. - # Helper subroutine to installpm.
  5042. - #
  5043. - # =cut
  5044. - #
  5045. - # sub installpm_x { # called by installpm per file
  5046. - #     my($self, $dist, $inst, $splitlib) = @_;
  5047. - #     unless (ref $self){
  5048. - #       ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5049. - #       $self = $ExtUtils::MakeMaker::Parent[-1];
  5050. - #     }
  5051. - #     if ($inst =~ m,[:\#],){
  5052. - #       warn "Warning: 'make' would have problems processing this file: '$inst', SKIPPED\n";
  5053. - #       return '';
  5054. - #     }
  5055. - #     my($instdir) = $inst =~ m|(.*)/|;
  5056. - #     my(@m);
  5057. - #     push(@m,"
  5058. - # $inst: $dist $self->{FIRST_MAKEFILE} $instdir/.exists \$(INST_ARCHAUTODIR)/.exists
  5059. - #       $self->{NOECHO}$self->{RM_F}".' $@
  5060. - #       $(UMASK_NULL) && '."$self->{CP} $dist".' $@
  5061. - # ');
  5062. - #     push(@m, "\t$self->{NOECHO}\$(AUTOSPLITFILE) \$@ $splitlib/auto\n")
  5063. - #       if ($splitlib and $inst =~ m/\.pm$/);
  5064. - #
  5065. - #     push @m, $self->dir_target($instdir);
  5066. - #     join('', @m);
  5067. - # }
  5068.   =item manifypods (o)
  5069.   
  5070.   Defines targets and routines to translate the pods into manpages and
  5071. --- 1869,2165 ----
  5072.   ";
  5073.   }
  5074.   
  5075. ! =item lsdir
  5076.   
  5077. ! Takes as arguments a directory name and a regular expression. Returns
  5078. ! all entries in the directory that match the regular expression.
  5079.   
  5080.   =cut
  5081.   
  5082. ! sub lsdir {
  5083. !     my($self) = shift;
  5084. !     my($dir, $regex) = @_;
  5085. !     my(@ls);
  5086. !     my $dh = new DirHandle;
  5087. !     $dh->open($dir || ".") or return ();
  5088. !     @ls = $dh->read;
  5089. !     $dh->close;
  5090. !     @ls = grep(/$regex/, @ls) if $regex;
  5091. !     @ls;
  5092. ! }
  5093. ! =item macro (o)
  5094. ! Simple subroutine to insert the macros defined by the macro attribute
  5095. ! into the Makefile.
  5096. ! =cut
  5097. ! sub macro {
  5098.       my($self,%attribs) = @_;
  5099. !     my(@m,$key,$val);
  5100. !     while (($key,$val) = each %attribs){
  5101. !     last unless defined $key;
  5102. !     push @m, "$key = $val\n";
  5103.       }
  5104. +     join "", @m;
  5105. + }
  5106.   
  5107. ! =item makeaperl (o)
  5108.   
  5109. ! Called by staticmake. Defines how to write the Makefile to produce a
  5110. ! static new perl.
  5111. ! =cut
  5112. ! sub makeaperl {
  5113. !     my($self, %attribs) = @_;
  5114. !     my($makefilename, $searchdirs, $static, $extra, $perlinc, $target, $tmp, $libperl) =
  5115. !     @attribs{qw(MAKE DIRS STAT EXTRA INCL TARGET TMP LIBPERL)};
  5116.       my(@m);
  5117. +     push @m, "
  5118. + # --- MakeMaker makeaperl section ---
  5119. + MAP_TARGET    = $target
  5120. + FULLPERL      = $self->{FULLPERL}
  5121. + ";
  5122. +     return join '', @m if $self->{PARENT};
  5123.   
  5124. !     my($dir) = join ":", @{$self->{DIR}};
  5125.   
  5126. !     unless ($self->{MAKEAPERL}) {
  5127. !     push @m, q{
  5128. ! $(MAP_TARGET) :: static $(MAKE_APERL_FILE)
  5129. !     $(MAKE) -f $(MAKE_APERL_FILE) $@
  5130.   
  5131. ! $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
  5132. !     }.$self->{NOECHO}.q{echo Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
  5133. !     }.$self->{NOECHO}.q{$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
  5134. !         Makefile.PL DIR=}, $dir, q{ \
  5135. !         MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
  5136. !         MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=};
  5137.   
  5138. !     foreach (@ARGV){
  5139. !         if( /\s/ ){
  5140. !             s/=(.*)/='$1'/;
  5141. !         }
  5142. !         push @m, " \\\n\t\t$_";
  5143. !     }
  5144. ! #    push @m, map( " \\\n\t\t$_", @ARGV );
  5145. !     push @m, "\n";
  5146.   
  5147. !     return join '', @m;
  5148. !     }
  5149.   
  5150.   
  5151.   
  5152. !     my($cccmd, $linkcmd, $lperl);
  5153.   
  5154.   
  5155. !     $cccmd = $self->const_cccmd($libperl);
  5156. !     $cccmd =~ s/^CCCMD\s*=\s*//;
  5157. !     $cccmd =~ s/\$\(INC\)/ -I$self->{PERL_INC} /;
  5158. !     $cccmd .= " $Config::Config{cccdlflags}" if ($Config::Config{d_shrplib});
  5159. !     $cccmd =~ s/\(CC\)/\(PERLMAINCC\)/;
  5160.   
  5161. !     # The front matter of the linkcommand...
  5162. !     $linkcmd = join ' ', "\$(CC)",
  5163. !         grep($_, @Config{qw(large split ldflags ccdlflags)});
  5164. !     $linkcmd =~ s/\s+/ /g;
  5165.   
  5166. !     # Which *.a files could we make use of...
  5167. !     local(%static);
  5168. !     require File::Find;
  5169. !     File::Find::find(sub {
  5170. !     return unless m/\Q$self->{LIB_EXT}\E$/;
  5171. !     return if m/^libperl/;
  5172.   
  5173. !     if( exists $self->{INCLUDE_EXT} ){
  5174. !         my $found = 0;
  5175. !         my $incl;
  5176. !         my $xx;
  5177. !         ($xx = $File::Find::name) =~ s,.*?/auto/,,;
  5178. !         $xx =~ s,/?$_,,;
  5179. !         $xx =~ s,/,::,g;
  5180. !         # Throw away anything not explicitly marked for inclusion.
  5181. !         # DynaLoader is implied.
  5182. !         foreach $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){
  5183. !             if( $xx eq $incl ){
  5184. !                 $found++;
  5185. !                 last;
  5186. !             }
  5187. !         }
  5188. !         return unless $found;
  5189. !     }
  5190. !     elsif( exists $self->{EXCLUDE_EXT} ){
  5191. !         my $excl;
  5192. !         my $xx;
  5193. !         ($xx = $File::Find::name) =~ s,.*?/auto/,,;
  5194. !         $xx =~ s,/?$_,,;
  5195. !         $xx =~ s,/,::,g;
  5196. !         # Throw away anything explicitly marked for exclusion
  5197. !         foreach $excl (@{$self->{EXCLUDE_EXT}}){
  5198. !             return if( $xx eq $excl );
  5199. !         }
  5200. !     }
  5201.   
  5202. !     # don't include the installed version of this extension. I
  5203. !     # leave this line here, although it is not necessary anymore:
  5204. !     # I patched minimod.PL instead, so that Miniperl.pm won't
  5205. !     # enclude duplicates
  5206.   
  5207. !     # Once the patch to minimod.PL is in the distribution, I can
  5208. !     # drop it
  5209. !     return if $File::Find::name =~ m:auto/$self->{FULLEXT}/$self->{BASEEXT}$self->{LIB_EXT}$:;
  5210. !     use Cwd 'cwd';
  5211. !     $static{cwd() . "/" . $_}++;
  5212. !     }, grep( -d $_, @{$searchdirs || []}) );
  5213. !     # We trust that what has been handed in as argument, will be buildable
  5214. !     $static = [] unless $static;
  5215. !     @static{@{$static}} = (1) x @{$static};
  5216. !     $extra = [] unless $extra && ref $extra eq 'ARRAY';
  5217. !     for (sort keys %static) {
  5218. !     next unless /\Q$self->{LIB_EXT}\E$/;
  5219. !     $_ = dirname($_) . "/extralibs.ld";
  5220. !     push @$extra, $_;
  5221.       }
  5222.   
  5223. !     grep(s/^/-I/, @{$perlinc || []});
  5224.   
  5225. !     $target = "perl" unless $target;
  5226. !     $tmp = "." unless $tmp;
  5227.   
  5228. ! # MAP_STATIC doesn't look into subdirs yet. Once "all" is made and we
  5229. ! # regenerate the Makefiles, MAP_STATIC and the dependencies for
  5230. ! # extralibs.all are computed correctly
  5231. !     push @m, "
  5232. ! MAP_LINKCMD   = $linkcmd
  5233. ! MAP_PERLINC   = @{$perlinc || []}
  5234. ! MAP_STATIC    = ",
  5235. ! join(" \\\n\t", reverse sort keys %static), "
  5236.   
  5237. ! MAP_PRELIBS   = $Config::Config{libs} $Config::Config{cryptlib}
  5238. ! ";
  5239. !     if (defined $libperl) {
  5240. !     ($lperl = $libperl) =~ s/\$\(A\)/$self->{LIB_EXT}/;
  5241. !     }
  5242. !     unless ($libperl && -f $lperl) { # Ilya's code...
  5243. !     my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/CORE";
  5244. !     $libperl ||= "libperl$self->{LIB_EXT}";
  5245. !     $libperl   = "$dir/$libperl";
  5246. !     $lperl   ||= "libperl$self->{LIB_EXT}";
  5247. !     $lperl     = "$dir/$lperl";
  5248. !     print STDOUT "Warning: $libperl not found
  5249. !     If you're going to build a static perl binary, make sure perl is installed
  5250. !     otherwise ignore this warning\n"
  5251. !         unless (-f $lperl || defined($self->{PERL_SRC}));
  5252. !     }
  5253.   
  5254. !     push @m, "
  5255. ! MAP_LIBPERL = $libperl
  5256. ! ";
  5257.   
  5258. !     push @m, "
  5259. ! \$(INST_ARCHAUTODIR)/extralibs.all: \$(INST_ARCHAUTODIR)/.exists ".join(" \\\n\t", @$extra)."
  5260. !     $self->{NOECHO}$self->{RM_F} \$\@
  5261. !     $self->{NOECHO}\$(TOUCH) \$\@
  5262. ! ";
  5263.   
  5264. !     my $catfile;
  5265. !     foreach $catfile (@$extra){
  5266. !     push @m, "\tcat $catfile >> \$\@\n";
  5267.       }
  5268.   
  5269. !     push @m, "
  5270. ! \$(MAP_TARGET) :: $tmp/perlmain\$(OBJ_EXT) \$(MAP_LIBPERL) \$(MAP_STATIC) \$(INST_ARCHAUTODIR)/extralibs.all
  5271. !     \$(MAP_LINKCMD) -o \$\@ \$(OPTIMIZE) $tmp/perlmain\$(OBJ_EXT) \$(MAP_LIBPERL) \$(MAP_STATIC) `cat \$(INST_ARCHAUTODIR)/extralibs.all` \$(MAP_PRELIBS)
  5272. !     $self->{NOECHO}echo 'To install the new \"\$(MAP_TARGET)\" binary, call'
  5273. !     $self->{NOECHO}echo '    make -f $makefilename inst_perl MAP_TARGET=\$(MAP_TARGET)'
  5274. !     $self->{NOECHO}echo 'To remove the intermediate files say'
  5275. !     $self->{NOECHO}echo '    make -f $makefilename map_clean'
  5276.   
  5277. ! $tmp/perlmain\$(OBJ_EXT): $tmp/perlmain.c
  5278. ! ";
  5279. !     push @m, "\tcd $tmp && $cccmd -I\$(PERL_INC) perlmain.c\n";
  5280.   
  5281. !     push @m, qq{
  5282. ! $tmp/perlmain.c: $makefilename}, q{
  5283. !     }.$self->{NOECHO}.q{echo Writing $@
  5284. !     }.$self->{NOECHO}.q{$(PERL) $(MAP_PERLINC) -e 'use ExtUtils::Miniperl; \\
  5285. !         writemain(grep s#.*/auto/##, qw|$(MAP_STATIC)|)' > $@.tmp && mv $@.tmp $@
  5286.   
  5287. ! };
  5288.   
  5289. !     push @m, q{
  5290. ! doc_inst_perl:
  5291. !     }.$self->{NOECHO}.q{echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
  5292. !     }.$self->{NOECHO}.q{$(DOC_INSTALL) \
  5293. !         "Perl binary $(MAP_TARGET)" \
  5294. !         MAP_STATIC "$(MAP_STATIC)" \
  5295. !         MAP_EXTRA "`cat $(INST_ARCHAUTODIR)/extralibs.all`" \
  5296. !         MAP_LIBPERL "$(MAP_LIBPERL)" \
  5297. !         >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
  5298.   
  5299. ! };
  5300.   
  5301. !     push @m, q{
  5302. ! inst_perl: pure_inst_perl doc_inst_perl
  5303.   
  5304. ! pure_inst_perl: $(MAP_TARGET)
  5305. !     }.$self->{CP}.q{ $(MAP_TARGET) }.$self->catfile('$(INSTALLBIN)','$(MAP_TARGET)').q{
  5306.   
  5307. ! clean :: map_clean
  5308. ! map_clean :
  5309. !     }.$self->{RM_F}.qq{ $tmp/perlmain\$(OBJ_EXT) $tmp/perlmain.c \$(MAP_TARGET) $makefilename \$(INST_ARCHAUTODIR)/extralibs.all
  5310. ! };
  5311. !     join '', @m;
  5312.   }
  5313.   
  5314. ! =item makefile (o)
  5315.   
  5316. ! Defines how to rewrite the Makefile.
  5317.   
  5318.   =cut
  5319.   
  5320. ! sub makefile {
  5321. !     my($self) = shift;
  5322. !     my @m;
  5323. !     # We do not know what target was originally specified so we
  5324. !     # must force a manual rerun to be sure. But as it should only
  5325. !     # happen very rarely it is not a significant problem.
  5326. !     push @m, '
  5327. ! $(OBJECT) : $(FIRST_MAKEFILE)
  5328. ! ' if $self->{OBJECT};
  5329.   
  5330. !     push @m, q{
  5331. ! # We take a very conservative approach here, but it\'s worth it.
  5332. ! # We move Makefile to Makefile.old here to avoid gnu make looping.
  5333. ! }.$self->{MAKEFILE}.q{ : Makefile.PL $(CONFIGDEP)
  5334. !     }.$self->{NOECHO}.q{echo "Makefile out-of-date with respect to $?"
  5335. !     }.$self->{NOECHO}.q{echo "Cleaning current config before rebuilding Makefile..."
  5336. !     -}.$self->{NOECHO}.q{mv }."$self->{MAKEFILE} $self->{MAKEFILE}.old".q{
  5337. !     -$(MAKE) -f }.$self->{MAKEFILE}.q{.old clean >/dev/null 2>&1 || true
  5338. !     $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL }.join(" ",map(qq["$_"],@ARGV)).q{
  5339. !     }.$self->{NOECHO}.q{echo ">>> Your Makefile has been rebuilt. <<<"
  5340. !     }.$self->{NOECHO}.q{echo ">>> Please rerun the make command.  <<<"; false
  5341.   
  5342. ! # To change behavior to :: would be nice, but would break Tk b9.02
  5343. ! # so you find such a warning below the dist target.
  5344. ! #}.$self->{MAKEFILE}.q{ :: $(VERSION_FROM)
  5345. ! #    }.$self->{NOECHO}.q{echo "Warning: Makefile possibly out of date with $(VERSION_FROM)"
  5346.   };
  5347.   
  5348. !     join "", @m;
  5349.   }
  5350.   
  5351.   =item manifypods (o)
  5352.   
  5353.   Defines targets and routines to translate the pods into manpages and
  5354. ***************
  5355. *** 2235,2251 ****
  5356.   
  5357.   sub manifypods {
  5358.       my($self, %attribs) = @_;
  5359. !     unless (ref $self){
  5360. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5361. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5362. !     }
  5363. !     return "\nmanifypods :\n" unless %{$self->{MAN3PODS}};
  5364.       my($dist);
  5365.       my($pod2man_exe);
  5366.       if (defined $self->{PERL_SRC}) {
  5367.       $pod2man_exe = $self->catfile($self->{PERL_SRC},'pod','pod2man');
  5368.       } else {
  5369. !     $pod2man_exe = $self->catfile($Config{bin},'pod2man');
  5370.       }
  5371.       unless ($self->perl_script($pod2man_exe)) {
  5372.       # No pod2man but some MAN3PODS to be installed
  5373. --- 2169,2181 ----
  5374.   
  5375.   sub manifypods {
  5376.       my($self, %attribs) = @_;
  5377. !     return "\nmanifypods :\n\t$self->{NOECHO}\$(NOOP)\n" unless %{$self->{MAN3PODS}} or %{$self->{MAN1PODS}};
  5378.       my($dist);
  5379.       my($pod2man_exe);
  5380.       if (defined $self->{PERL_SRC}) {
  5381.       $pod2man_exe = $self->catfile($self->{PERL_SRC},'pod','pod2man');
  5382.       } else {
  5383. !     $pod2man_exe = $self->catfile($Config{scriptdirexp},'pod2man');
  5384.       }
  5385.       unless ($self->perl_script($pod2man_exe)) {
  5386.       # No pod2man but some MAN3PODS to be installed
  5387. ***************
  5388. *** 2263,2835 ****
  5389.   q[POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \\
  5390.   -e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "].$self->{MAKEFILE}.q[";' \\
  5391.   -e 'print "Manifying $$m{$$_}\n";' \\
  5392. ! -e 'system("$$^X \\"-I$(PERL_ARCHLIB)\\" \\"-I$(PERL_LIB)\\" $(POD2MAN_EXE) $$_>$$m{$$_}")==0 or warn "Couldn\\047t install $$m{$$_}\n";' \\
  5393.   -e 'chmod 0644, $$m{$$_} or warn "chmod 644 $$m{$$_}: $$!\n";}'
  5394.   ];
  5395.       push @m, "\nmanifypods : ";
  5396.       push @m, join " \\\n\t", keys %{$self->{MAN1PODS}}, keys %{$self->{MAN3PODS}};
  5397. !     push(@m,"\n");
  5398. !     if (%{$self->{MAN1PODS}} || %{$self->{MAN3PODS}}) {
  5399. !     push @m, "\t$self->{NOECHO}\$(POD2MAN) \\\n\t";
  5400. !     push @m, join " \\\n\t", %{$self->{MAN1PODS}}, %{$self->{MAN3PODS}};
  5401. !     }
  5402. !     join('', @m);
  5403. ! }
  5404. ! =item processPL (o)
  5405. ! Defines targets to run *.PL files.
  5406. ! =cut
  5407. ! sub processPL {
  5408. !     my($self) = shift;
  5409. !     unless (ref $self){
  5410. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5411. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5412. !     }
  5413. !     return "" unless $self->{PL_FILES};
  5414. !     my(@m, $plfile);
  5415. !     foreach $plfile (sort keys %{$self->{PL_FILES}}) {
  5416. !     push @m, "
  5417. ! all :: $self->{PL_FILES}->{$plfile}
  5418. ! $self->{PL_FILES}->{$plfile} :: $plfile
  5419. !     \$(PERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) $plfile
  5420. ! ";
  5421. !     }
  5422. !     join "", @m;
  5423. ! }
  5424. ! =item installbin (o)
  5425. ! Defines targets to install EXE_FILES.
  5426. ! =cut
  5427. ! sub installbin {
  5428. !     my($self) = shift;
  5429. !     return "" unless $self->{EXE_FILES} && ref $self->{EXE_FILES} eq "ARRAY";
  5430. !     return "" unless @{$self->{EXE_FILES}};
  5431. !     my(@m, $from, $to, %fromto, @to);
  5432. !     push @m, $self->dir_target(qw[$(INST_EXE)]);
  5433. !     for $from (@{$self->{EXE_FILES}}) {
  5434. !     my($path)= '$(INST_EXE)/' . basename($from);
  5435. !     local($_) = $path; # for backwards compatibility
  5436. !     $to = $self->libscan($path);
  5437. !     print "libscan($from) => '$to'\n" if ($Verbose >=2);
  5438. !     $fromto{$from}=$to;
  5439. !     }
  5440. !     @to   = values %fromto;
  5441. !     push(@m, "
  5442. ! EXE_FILES = @{$self->{EXE_FILES}}
  5443. ! all :: @to
  5444. ! realclean ::
  5445. !     $self->{RM_F} @to
  5446. ! ");
  5447. !     while (($from,$to) = each %fromto) {
  5448. !     last unless defined $from;
  5449. !     my $todir = dirname($to);
  5450. !     push @m, "
  5451. ! $to: $from $self->{MAKEFILE} $todir/.exists
  5452. !     $self->{NOECHO}$self->{RM_F} $to
  5453. !     $self->{CP} $from $to
  5454. ! ";
  5455. !     }
  5456. !     join "", @m;
  5457. ! }
  5458. ! =item subdirs (o)
  5459. ! Defines targets to process subdirectories.
  5460. ! =cut
  5461. ! sub subdirs {
  5462. ! # --- Sub-directory Sections ---
  5463. !     my($self) = shift;
  5464. !     unless (ref $self){
  5465. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5466. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5467. !     }
  5468. !     my(@m,$dir);
  5469. !     # This method provides a mechanism to automatically deal with
  5470. !     # subdirectories containing further Makefile.PL scripts.
  5471. !     # It calls the subdir_x() method for each subdirectory.
  5472. !     foreach $dir (@{$self->{DIR}}){
  5473. !     push(@m, $self->subdir_x($dir));
  5474. ! ####    print "Including $dir subdirectory\n";
  5475. !     }
  5476. !     if (@m){
  5477. !     unshift(@m, "
  5478. ! # The default clean, realclean and test targets in this Makefile
  5479. ! # have automatically been given entries for each subdir.
  5480. ! ");
  5481. !     } else {
  5482. !     push(@m, "\n# none")
  5483.       }
  5484. !     join('',@m);
  5485.   }
  5486.   
  5487. ! =item subdir_x (o)
  5488.   
  5489. ! Helper subroutine for subdirs
  5490.   
  5491.   =cut
  5492.   
  5493. ! sub subdir_x {
  5494. !     my($self, $subdir) = @_;
  5495. !     unless (ref $self){
  5496. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5497. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5498. !     }
  5499. !     my(@m);
  5500. !     qq{
  5501. ! subdirs ::
  5502. !     $self->{NOECHO}-cd $subdir && \$(MAKE) all \$(PASTHRU)
  5503. ! };
  5504.   }
  5505.   
  5506. ! =item clean (o)
  5507.   
  5508. ! Defines the clean target.
  5509.   
  5510.   =cut
  5511.   
  5512. ! sub clean {
  5513. ! # --- Cleanup and Distribution Sections ---
  5514. !     my($self, %attribs) = @_;
  5515. !     unless (ref $self){
  5516. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5517. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5518. !     }
  5519. !     my(@m,$dir);
  5520. !     push(@m, '
  5521. ! # Delete temporary files but do not touch installed files. We don\'t delete
  5522. ! # the Makefile here so a later make realclean still has a makefile to use.
  5523. ! clean ::
  5524. ! ');
  5525. !     # clean subdirectories first
  5526. !     for $dir (@{$self->{DIR}}) {
  5527. !     push @m, "\t-cd $dir && test -f $self->{MAKEFILE} && \$(MAKE) clean\n";
  5528.       }
  5529. -     my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files
  5530. -     push(@otherfiles, $attribs{FILES}) if $attribs{FILES};
  5531. -     push(@otherfiles, qw[./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all
  5532. -              perlmain.c mon.out core so_locations pm_to_blib
  5533. -              *~ */*~ */*/*~ *$(OBJ_EXT) *$(LIB_EXT) perl.exe
  5534. -              $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def
  5535. -              $(BASEEXT).exp
  5536. -             ]);
  5537. -     push @m, "\t-$self->{RM_RF} @otherfiles\n";
  5538. -     # See realclean and ext/utils/make_ext for usage of Makefile.old
  5539. -     push(@m,
  5540. -      "\t-$self->{MV} $self->{MAKEFILE} $self->{MAKEFILE}.old 2>/dev/null\n");
  5541. -     push(@m,
  5542. -      "\t$attribs{POSTOP}\n")   if $attribs{POSTOP};
  5543. -     join("", @m);
  5544.   }
  5545.   
  5546. ! =item realclean (o)
  5547.   
  5548. ! Defines the realclean target.
  5549.   
  5550.   =cut
  5551.   
  5552. ! sub realclean {
  5553. !     my($self, %attribs) = @_;
  5554. !     unless (ref $self){
  5555. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5556. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5557.       }
  5558. !     my(@m);
  5559. !     push(@m,'
  5560. ! # Delete temporary files (via clean) and also delete installed files
  5561. ! realclean purge ::  clean
  5562. ! ');
  5563. !     # realclean subdirectories first (already cleaned)
  5564. !     my $sub = "\t-cd %s && test -f %s && \$(MAKE) %s realclean\n";
  5565. !     foreach(@{$self->{DIR}}){
  5566. !     push(@m, sprintf($sub,$_,"$self->{MAKEFILE}.old","-f $self->{MAKEFILE}.old"));
  5567. !     push(@m, sprintf($sub,$_,"$self->{MAKEFILE}",''));
  5568.       }
  5569. !     push(@m, "    $self->{RM_RF} \$(INST_AUTODIR) \$(INST_ARCHAUTODIR)\n");
  5570. !     push(@m, "    $self->{RM_F} \$(INST_DYNAMIC) \$(INST_BOOT)\n");
  5571. ! #    push(@m, "    $self->{RM_F} \$(INST_STATIC) \$(INST_PM)\n");
  5572. !     push(@m, "    $self->{RM_F} \$(INST_STATIC)\n");
  5573. !     my(@otherfiles) = ($self->{MAKEFILE},
  5574. !                "$self->{MAKEFILE}.old"); # Makefiles last
  5575. !     push(@otherfiles, $attribs{FILES}) if $attribs{FILES};
  5576. !     push(@m, "    $self->{RM_RF} @otherfiles\n") if @otherfiles;
  5577. !     push(@m, "    $attribs{POSTOP}\n")       if $attribs{POSTOP};
  5578. !     join("", @m);
  5579.   }
  5580.   
  5581. ! =item dist_basics (o)
  5582.   
  5583. ! Defines the targets distclean, distcheck, skipcheck, manifest.
  5584.   
  5585.   =cut
  5586.   
  5587. ! sub dist_basics {
  5588. !     my($self) = shift;
  5589. !     unless (ref $self){
  5590. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5591. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5592. !     }
  5593. !     my @m;
  5594. !     push @m, q{
  5595. ! distclean :: realclean distcheck
  5596. ! };
  5597.   
  5598. !     push @m, q{
  5599. ! distcheck :
  5600. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&fullcheck";' \\
  5601. !         -e 'fullcheck();'
  5602. ! };
  5603.   
  5604. !     push @m, q{
  5605. ! skipcheck :
  5606. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&skipcheck";' \\
  5607. !         -e 'skipcheck();'
  5608. ! };
  5609.   
  5610. !     push @m, q{
  5611. ! manifest :
  5612. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&mkmanifest";' \\
  5613. !         -e 'mkmanifest();'
  5614. ! };
  5615. !     join "", @m;
  5616.   }
  5617.   
  5618. - =item dist_core (o)
  5619.   
  5620. ! Defeines the targets dist, tardist, zipdist, uutardist, shdist
  5621.   
  5622.   =cut
  5623.   
  5624. ! sub dist_core {
  5625.       my($self) = shift;
  5626. !     unless (ref $self){
  5627. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5628. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5629. !     }
  5630. !     my @m;
  5631. !     push @m, q{
  5632. ! dist : $(DIST_DEFAULT)
  5633. !     }.$self->{NOECHO}.q{$(PERL) -le 'print "Warning: Makefile possibly out of date with $$vf" if ' \
  5634. !         -e '-e ($$vf="$(VERSION_FROM)") and -M $$vf < -M "}.$self->{MAKEFILE}.q{";'
  5635.   
  5636. ! tardist : $(DISTVNAME).tar$(SUFFIX)
  5637.   
  5638. ! zipdist : $(DISTVNAME).zip
  5639.   
  5640. ! $(DISTVNAME).tar$(SUFFIX) : distdir
  5641. !     $(PREOP)
  5642. !     $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
  5643. !     $(RM_RF) $(DISTVNAME)
  5644. !     $(COMPRESS) $(DISTVNAME).tar
  5645. !     $(POSTOP)
  5646.   
  5647. ! $(DISTVNAME).zip : distdir
  5648. !     $(PREOP)
  5649. !     $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
  5650. !     $(POSTOP)
  5651.   
  5652. ! uutardist : $(DISTVNAME).tar$(SUFFIX)
  5653. !     uuencode $(DISTVNAME).tar$(SUFFIX) \\
  5654. !         $(DISTVNAME).tar$(SUFFIX) > \\
  5655. !         $(DISTVNAME).tar$(SUFFIX)_uu
  5656.   
  5657. ! shdist : distdir
  5658. !     $(PREOP)
  5659. !     $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
  5660. !     $(RM_RF) $(DISTVNAME)
  5661. !     $(POSTOP)
  5662. ! };
  5663. !     join "", @m;
  5664.   }
  5665.   
  5666. ! =item dist_dir (o)
  5667.   
  5668. ! Defines the scratch directory target that will hold the distribution
  5669. ! before tar-ing (or shar-ing).
  5670.   
  5671.   =cut
  5672.   
  5673. ! sub dist_dir {
  5674. !     my($self) = shift;
  5675. !     unless (ref $self){
  5676. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5677. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5678. !     }
  5679. !     my @m;
  5680. !     push @m, q{
  5681. ! distdir :
  5682. !     $(RM_RF) $(DISTVNAME)
  5683. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "/mani/";' \\
  5684. !         -e 'manicopy(maniread(),"$(DISTVNAME)", "$(DIST_CP)");'
  5685. ! };
  5686. !     join "", @m;
  5687.   }
  5688.   
  5689. ! =item dist_test (o)
  5690.   
  5691. ! Defines a target that produces the distribution in the
  5692. ! scratchdirectory, and runs 'perl Makefile.PL; make ;make test' in that
  5693. ! subdirectory.
  5694.   
  5695.   =cut
  5696.   
  5697. ! sub dist_test {
  5698.       my($self) = shift;
  5699. !     unless (ref $self){
  5700. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5701. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5702. !     }
  5703. !     my @m;
  5704.       push @m, q{
  5705. ! disttest : distdir
  5706. !     cd $(DISTVNAME) && $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) Makefile.PL
  5707. !     cd $(DISTVNAME) && $(MAKE)
  5708. !     cd $(DISTVNAME) && $(MAKE) test
  5709. ! };
  5710. !     join "", @m;
  5711.   }
  5712.   
  5713. ! =item dist_ci (o)
  5714.   
  5715. ! Defines a check in target for RCS.
  5716.   
  5717.   =cut
  5718.   
  5719. ! sub dist_ci {
  5720. !     my($self) = shift;
  5721. !     unless (ref $self){
  5722. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5723. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5724. !     }
  5725. !     my @m;
  5726. !     push @m, q{
  5727. ! ci :
  5728. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&maniread";' \\
  5729. !         -e '@all = keys %{ maniread() };' \\
  5730. !         -e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \\
  5731. !         -e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");'
  5732.   };
  5733. -     join "", @m;
  5734.   }
  5735.   
  5736. ! =item install (o)
  5737.   
  5738. ! Defines the install target.
  5739.   
  5740.   =cut
  5741.   
  5742. ! sub install {
  5743. !     my($self, %attribs) = @_;
  5744. !     unless (ref $self){
  5745. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5746. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5747. !     }
  5748. !     my(@m);
  5749.   
  5750. !     push @m, q{
  5751. ! install :: all pure_install doc_install
  5752.   
  5753. ! install_perl :: all pure_perl_install doc_perl_install
  5754.   
  5755. ! install_site :: all pure_site_install doc_site_install
  5756.   
  5757. ! install_ :: install_site
  5758. !     @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
  5759.   
  5760. ! pure_install :: pure_$(INSTALLDIRS)_install
  5761.   
  5762. ! doc_install :: doc_$(INSTALLDIRS)_install
  5763. !     }.$self->{NOECHO}.q{echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
  5764.   
  5765. ! pure__install : pure_site_install
  5766. !     @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
  5767.   
  5768. ! doc__install : doc_site_install
  5769. !     @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
  5770.   
  5771. ! pure_perl_install ::
  5772. !     }.$self->{NOECHO}.q{$(MOD_INSTALL) \
  5773. !         read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
  5774. !         write }.$self->catfile('$(INSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
  5775. !         $(INST_LIB) $(INSTALLPRIVLIB) \
  5776. !         $(INST_ARCHLIB) $(INSTALLARCHLIB) \
  5777. !         $(INST_EXE) $(INSTALLBIN) \
  5778. !         $(INST_MAN1DIR) $(INSTALLMAN1DIR) \
  5779. !         $(INST_MAN3DIR) $(INSTALLMAN3DIR)
  5780. !     }.$self->{NOECHO}.q{$(WARN_IF_OLD_PACKLIST) \
  5781. !         }.$self->catdir('$(SITEARCHEXP)','auto','$(FULLEXT)').q{
  5782.   
  5783.   
  5784. ! pure_site_install ::
  5785. !     }.$self->{NOECHO}.q{$(MOD_INSTALL) \
  5786. !         read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
  5787. !         write }.$self->catfile('$(INSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \
  5788. !         $(INST_LIB) $(INSTALLSITELIB) \
  5789. !         $(INST_ARCHLIB) $(INSTALLSITEARCH) \
  5790. !         $(INST_EXE) $(INSTALLBIN) \
  5791. !         $(INST_MAN1DIR) $(INSTALLMAN1DIR) \
  5792. !         $(INST_MAN3DIR) $(INSTALLMAN3DIR)
  5793. !     }.$self->{NOECHO}.q{$(WARN_IF_OLD_PACKLIST) \
  5794. !         }.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{
  5795.   
  5796. ! doc_perl_install ::
  5797. !     }.$self->{NOECHO}.q{$(DOC_INSTALL) \
  5798. !         "$(NAME)" \
  5799. !         "installed into" "$(INSTALLPRIVLIB)" \
  5800. !         LINKTYPE "$(LINKTYPE)" \
  5801. !         VERSION "$(VERSION)" \
  5802. !         EXE_FILES "$(EXE_FILES)" \
  5803. !         >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
  5804.   
  5805. ! doc_site_install ::
  5806. !     }.$self->{NOECHO}.q{$(DOC_INSTALL) \
  5807. !         "Module $(NAME)" \
  5808. !         "installed into" "$(INSTALLSITELIB)" \
  5809. !         LINKTYPE "$(LINKTYPE)" \
  5810. !         VERSION "$(VERSION)" \
  5811. !         EXE_FILES "$(EXE_FILES)" \
  5812. !         >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
  5813.   
  5814. ! };
  5815.   
  5816. !     push @m, q{
  5817. ! uninstall :: uninstall_from_$(INSTALLDIRS)dirs
  5818.   
  5819. ! uninstall_from_perldirs ::
  5820. !     }.$self->{NOECHO}.
  5821. !     q{$(UNINSTALL) }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{
  5822.   
  5823. ! uninstall_from_sitedirs ::
  5824. !     }.$self->{NOECHO}.
  5825. !     q{$(UNINSTALL) }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{
  5826. ! };
  5827.   
  5828. !     join("",@m);
  5829.   }
  5830.   
  5831. ! =item force (o)
  5832.   
  5833. ! Just writes FORCE:
  5834.   
  5835.   =cut
  5836.   
  5837. ! sub force {
  5838. !     my($self) = shift;
  5839. !     unless (ref $self){
  5840. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5841. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5842.       }
  5843. !     '# Phony target to force checking subdirectories.
  5844. ! FORCE:
  5845. ! ';
  5846.   }
  5847.   
  5848. ! =item perldepend (o)
  5849.   
  5850. ! Defines the dependency from all *.h files that come with the perl
  5851. ! distribution.
  5852.   
  5853.   =cut
  5854.   
  5855. ! sub perldepend {
  5856. !     my($self) = shift;
  5857. !     unless (ref $self){
  5858. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5859. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5860. !     }
  5861. !     my(@m);
  5862. !     push(@m,'
  5863. ! PERL_HDRS = $(PERL_INC)/EXTERN.h $(PERL_INC)/INTERN.h \
  5864. !     $(PERL_INC)/XSUB.h    $(PERL_INC)/av.h    $(PERL_INC)/cop.h \
  5865. !     $(PERL_INC)/cv.h    $(PERL_INC)/dosish.h    $(PERL_INC)/embed.h \
  5866. !     $(PERL_INC)/form.h    $(PERL_INC)/gv.h    $(PERL_INC)/handy.h \
  5867. !     $(PERL_INC)/hv.h    $(PERL_INC)/keywords.h    $(PERL_INC)/mg.h \
  5868. !     $(PERL_INC)/op.h    $(PERL_INC)/opcode.h    $(PERL_INC)/patchlevel.h \
  5869. !     $(PERL_INC)/perl.h    $(PERL_INC)/perly.h    $(PERL_INC)/pp.h \
  5870. !     $(PERL_INC)/proto.h    $(PERL_INC)/regcomp.h    $(PERL_INC)/regexp.h \
  5871. !     $(PERL_INC)/scope.h    $(PERL_INC)/sv.h    $(PERL_INC)/unixish.h \
  5872. !     $(PERL_INC)/util.h    $(PERL_INC)/config.h
  5873.   
  5874. ! ');
  5875.   
  5876. !     push @m, '
  5877. ! $(OBJECT) : $(PERL_HDRS)
  5878. ! ' if $self->{OBJECT};
  5879.   
  5880. !     push(@m,'
  5881. ! # Check for unpropogated config.sh changes. Should never happen.
  5882. ! # We do NOT just update config.h because that is not sufficient.
  5883. ! # An out of date config.h is not fatal but complains loudly!
  5884. ! $(PERL_INC)/config.h: $(PERL_SRC)/config.sh
  5885. !     -'.$self->{NOECHO}.'echo "Warning: $(PERL_INC)/config.h out of date with $(PERL_SRC)/config.sh"; false
  5886.   
  5887. ! $(PERL_ARCHLIB)/Config.pm: $(PERL_SRC)/config.sh
  5888. !     '.$self->{NOECHO}.'echo "Warning: $(PERL_ARCHLIB)/Config.pm may be out of date with $(PERL_SRC)/config.sh"
  5889. !     cd $(PERL_SRC) && $(MAKE) lib/Config.pm
  5890. ! ') if $self->{PERL_SRC};
  5891.   
  5892. !     push(@m, join(" ", values %{$self->{XS}})." : \$(XSUBPPDEPS)\n")
  5893. !     if %{$self->{XS}};
  5894. !     join("\n",@m);
  5895.   }
  5896.   
  5897. ! =item makefile (o)
  5898.   
  5899. ! Defines how to rewrite the Makefile.
  5900.   
  5901.   =cut
  5902.   
  5903. ! sub makefile {
  5904. !     my($self) = shift;
  5905. !     unless (ref $self){
  5906. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  5907. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  5908. !     }
  5909. !     my @m;
  5910. !     # We do not know what target was originally specified so we
  5911. !     # must force a manual rerun to be sure. But as it should only
  5912. !     # happen very rarely it is not a significant problem.
  5913. !     push @m, '
  5914. ! $(OBJECT) : $(FIRST_MAKEFILE)
  5915. ! ' if $self->{OBJECT};
  5916.   
  5917. !     push @m, q{
  5918. ! # We take a very conservative approach here, but it\'s worth it.
  5919. ! # We move Makefile to Makefile.old here to avoid gnu make looping.
  5920. ! }.$self->{MAKEFILE}.q{ : Makefile.PL $(CONFIGDEP)
  5921. !     }.$self->{NOECHO}.q{echo "Makefile out-of-date with respect to $?"
  5922. !     }.$self->{NOECHO}.q{echo "Cleaning current config before rebuilding Makefile..."
  5923. !     -}.$self->{NOECHO}.q{mv }."$self->{MAKEFILE} $self->{MAKEFILE}.old".q{
  5924. !     -$(MAKE) -f }.$self->{MAKEFILE}.q{.old clean >/dev/null 2>&1 || true
  5925. !     $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL }.join(" ",map(qq["$_"],@ARGV)).q{
  5926. !     }.$self->{NOECHO}.q{echo ">>> Your Makefile has been rebuilt. <<<"
  5927. !     }.$self->{NOECHO}.q{echo ">>> Please rerun the make command.  <<<"; false
  5928.   
  5929. ! # To change behavior to :: would be nice, but would break Tk b9.02
  5930. ! # so you find such a warning below the dist target.
  5931. ! #}.$self->{MAKEFILE}.q{ :: $(VERSION_FROM)
  5932. ! #    }.$self->{NOECHO}.q{echo "Warning: Makefile possibly out of date with $(VERSION_FROM)"
  5933.   };
  5934.   
  5935. !     join "", @m;
  5936.   }
  5937.   
  5938.   =item staticmake (o)
  5939. --- 2193,2625 ----
  5940.   q[POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \\
  5941.   -e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "].$self->{MAKEFILE}.q[";' \\
  5942.   -e 'print "Manifying $$m{$$_}\n";' \\
  5943. ! -e 'system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\\047t install $$m{$$_}\n";' \\
  5944.   -e 'chmod 0644, $$m{$$_} or warn "chmod 644 $$m{$$_}: $$!\n";}'
  5945.   ];
  5946.       push @m, "\nmanifypods : ";
  5947.       push @m, join " \\\n\t", keys %{$self->{MAN1PODS}}, keys %{$self->{MAN3PODS}};
  5948. !     push(@m,"\n");
  5949. !     if (%{$self->{MAN1PODS}} || %{$self->{MAN3PODS}}) {
  5950. !     push @m, "\t$self->{NOECHO}\$(POD2MAN) \\\n\t";
  5951. !     push @m, join " \\\n\t", %{$self->{MAN1PODS}}, %{$self->{MAN3PODS}};
  5952.       }
  5953. !     join('', @m);
  5954.   }
  5955.   
  5956. ! =item maybe_command
  5957.   
  5958. ! Returns true, if the argument is likely to be a command.
  5959.   
  5960.   =cut
  5961.   
  5962. ! sub maybe_command {
  5963. !     my($self,$file) = @_;
  5964. !     return $file if -x $file && ! -d $file;
  5965. !     return;
  5966.   }
  5967.   
  5968. ! =item maybe_command_in_dirs
  5969.   
  5970. ! method under development. Not yet used. Ask Ilya :-)
  5971.   
  5972.   =cut
  5973.   
  5974. ! sub maybe_command_in_dirs {    # $ver is optional argument if looking for perl
  5975. ! # Ilya's suggestion. Not yet used, want to understand it first, but at least the code is here
  5976. !     my($self, $names, $dirs, $trace, $ver) = @_;
  5977. !     my($name, $dir);
  5978. !     foreach $dir (@$dirs){
  5979. !     next unless defined $dir; # $self->{PERL_SRC} may be undefined
  5980. !     foreach $name (@$names){
  5981. !         my($abs,$tryabs);
  5982. !         if ($self->file_name_is_absolute($name)) { # /foo/bar
  5983. !         $abs = $name;
  5984. !         } elsif ($self->canonpath($name) eq $self->canonpath(basename($name))) { # bar
  5985. !         $abs = $self->catfile($dir, $name);
  5986. !         } else { # foo/bar
  5987. !         $abs = $self->catfile($self->curdir, $name);
  5988. !         }
  5989. !         print "Checking $abs for $name\n" if ($trace >= 2);
  5990. !         next unless $tryabs = $self->maybe_command($abs);
  5991. !         print "Substituting $tryabs instead of $abs\n"
  5992. !         if ($trace >= 2 and $tryabs ne $abs);
  5993. !         $abs = $tryabs;
  5994. !         if (defined $ver) {
  5995. !         print "Executing $abs\n" if ($trace >= 2);
  5996. !         if (`$abs -e 'require $ver; print "VER_OK\n" ' 2>&1` =~ /VER_OK/) {
  5997. !             print "Using PERL=$abs\n" if $trace;
  5998. !             return $abs;
  5999. !         }
  6000. !         } else { # Do not look for perl
  6001. !         return $abs;
  6002. !         }
  6003. !     }
  6004.       }
  6005.   }
  6006.   
  6007. ! =item needs_linking (o)
  6008.   
  6009. ! Does this module need linking? Looks into subdirectory objects (see
  6010. ! also has_link_code())
  6011.   
  6012.   =cut
  6013.   
  6014. ! sub needs_linking {
  6015. !     my($self) = shift;
  6016. !     my($child,$caller);
  6017. !     $caller = (caller(0))[3];
  6018. !     Carp::confess("Needs_linking called too early") if $caller =~ /^ExtUtils::MakeMaker::/;
  6019. !     return $self->{NEEDS_LINKING} if defined $self->{NEEDS_LINKING};
  6020. !     if ($self->has_link_code or $self->{MAKEAPERL}){
  6021. !     $self->{NEEDS_LINKING} = 1;
  6022. !     return 1;
  6023.       }
  6024. !     foreach $child (keys %{$self->{CHILDREN}}) {
  6025. !     if ($self->{CHILDREN}->{$child}->needs_linking) {
  6026. !         $self->{NEEDS_LINKING} = 1;
  6027. !         return 1;
  6028. !     }
  6029.       }
  6030. !     return $self->{NEEDS_LINKING} = 0;
  6031.   }
  6032.   
  6033. ! =item nicetext
  6034.   
  6035. ! misnamed method (will have to be changed). The MM_Unix method just
  6036. ! returns the argument without further processing.
  6037. ! On VMS used to insure that colons marking targets are preceded by
  6038. ! space - most Unix Makes don't need this, but it's necessary under VMS
  6039. ! to distinguish the target delimiter from a colon appearing as part of
  6040. ! a filespec.
  6041.   
  6042.   =cut
  6043.   
  6044. ! sub nicetext {
  6045. !     my($self,$text) = @_;
  6046. !     $text;
  6047. ! }
  6048.   
  6049. ! =item parse_version
  6050.   
  6051. ! parse a file and return what you think is $VERSION in this file set to
  6052.   
  6053. ! =cut
  6054. ! sub parse_version {
  6055. !     my($self,$parsefile) = @_;
  6056. !     my $result;
  6057. !     local *FH;
  6058. !     local $/ = "\n";
  6059. !     open(FH,$parsefile) or die "Could not open '$parsefile': $!";
  6060. !     my $inpod = 0;
  6061. !     while (<FH>) {
  6062. !     $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod;
  6063. !     next if $inpod;
  6064. !     chop;
  6065. !     next unless /\$(([\w\:\']*)\bVERSION)\b.*\=/;
  6066. !     local $ExtUtils::MakeMaker::module_version_variable = $1;
  6067. !     my($thispackage) = $2 || $current_package;
  6068. !     $thispackage =~ s/:+$//;
  6069. !     my($eval) = "$_;";
  6070. !     eval $eval;
  6071. !     die "Could not eval '$eval' in $parsefile: $@" if $@;
  6072. !     $result = $ {$ExtUtils::MakeMaker::module_version_variable} || 0;
  6073. !     last;
  6074. !     }
  6075. !     close FH;
  6076. !     return $result;
  6077.   }
  6078.   
  6079.   
  6080. ! =item pasthru (o)
  6081. ! Defines the string that is passed to recursive make calls in
  6082. ! subdirectories.
  6083.   
  6084.   =cut
  6085.   
  6086. ! sub pasthru {
  6087.       my($self) = shift;
  6088. !     my(@m,$key);
  6089.   
  6090. !     my(@pasthru);
  6091.   
  6092. !     foreach $key (qw(LIBPERL_A LINKTYPE PREFIX OPTIMIZE)){
  6093. !     push @pasthru, "$key=\"\$($key)\"";
  6094. !     }
  6095.   
  6096. !     push @m, "\nPASTHRU = ", join ("\\\n\t", @pasthru), "\n";
  6097. !     join "", @m;
  6098. ! }
  6099.   
  6100. ! =item path
  6101.   
  6102. ! Takes no argument, returns the environment variable PATH as an array.
  6103.   
  6104. ! =cut
  6105. ! sub path {
  6106. !     my($self) = @_;
  6107. !     my $path_sep = $Is_OS2 ? ";" : ":";
  6108. !     my $path = $ENV{PATH};
  6109. !     $path =~ s:\\:/:g if $Is_OS2;
  6110. !     my @path = split $path_sep, $path;
  6111.   }
  6112.   
  6113. ! =item perl_script
  6114.   
  6115. ! Takes one argument, a file name, and returns the file name, if the
  6116. ! argument is likely to be a perl script. On MM_Unix this is true for
  6117. ! any ordinary, readable file.
  6118.   
  6119.   =cut
  6120.   
  6121. ! sub perl_script {
  6122. !     my($self,$file) = @_;
  6123. !     return $file if -r $file && -f _;
  6124. !     return;
  6125.   }
  6126.   
  6127. ! =item perldepend (o)
  6128.   
  6129. ! Defines the dependency from all *.h files that come with the perl
  6130. ! distribution.
  6131.   
  6132.   =cut
  6133.   
  6134. ! sub perldepend {
  6135.       my($self) = shift;
  6136. !     my(@m);
  6137. !     push @m, q{
  6138. ! # Check for unpropogated config.sh changes. Should never happen.
  6139. ! # We do NOT just update config.h because that is not sufficient.
  6140. ! # An out of date config.h is not fatal but complains loudly!
  6141. ! $(PERL_INC)/config.h: $(PERL_SRC)/config.sh
  6142. !     -}.$self->{NOECHO}.q{echo "Warning: $(PERL_INC)/config.h out of date with $(PERL_SRC)/config.sh"; false
  6143. ! $(PERL_ARCHLIB)/Config.pm: $(PERL_SRC)/config.sh
  6144. !     }.$self->{NOECHO}.q{echo "Warning: $(PERL_ARCHLIB)/Config.pm may be out of date with $(PERL_SRC)/config.sh"
  6145. !     cd $(PERL_SRC) && $(MAKE) lib/Config.pm
  6146. ! } if $self->{PERL_SRC};
  6147. !     return join "", @m unless $self->needs_linking;
  6148.       push @m, q{
  6149. ! PERL_HDRS = \
  6150. ! $(PERL_INC)/EXTERN.h       $(PERL_INC)/gv.h           $(PERL_INC)/pp.h       \
  6151. ! $(PERL_INC)/INTERN.h       $(PERL_INC)/handy.h        $(PERL_INC)/proto.h    \
  6152. ! $(PERL_INC)/XSUB.h         $(PERL_INC)/hv.h           $(PERL_INC)/regcomp.h  \
  6153. ! $(PERL_INC)/av.h           $(PERL_INC)/keywords.h     $(PERL_INC)/regexp.h   \
  6154. ! $(PERL_INC)/config.h       $(PERL_INC)/mg.h           $(PERL_INC)/scope.h    \
  6155. ! $(PERL_INC)/cop.h          $(PERL_INC)/op.h           $(PERL_INC)/sv.h         \
  6156. ! $(PERL_INC)/cv.h           $(PERL_INC)/opcode.h       $(PERL_INC)/unixish.h  \
  6157. ! $(PERL_INC)/dosish.h       $(PERL_INC)/patchlevel.h   $(PERL_INC)/util.h     \
  6158. ! $(PERL_INC)/embed.h        $(PERL_INC)/perl.h                     \
  6159. ! $(PERL_INC)/form.h         $(PERL_INC)/perly.h
  6160. ! $(OBJECT) : $(PERL_HDRS)
  6161. ! } if $self->{OBJECT};
  6162. !     push @m, join(" ", values %{$self->{XS}})." : \$(XSUBPPDEPS)\n"  if %{$self->{XS}};
  6163. !     join "\n", @m;
  6164.   }
  6165.   
  6166. ! =item pm_to_blib
  6167.   
  6168. ! Defines target that copies all files in the hash PM to their
  6169. ! destination and autosplits them. See L<ExtUtils::Install/pm_to_blib>
  6170.   
  6171.   =cut
  6172.   
  6173. ! sub pm_to_blib {
  6174. !     my $self = shift;
  6175. !     my($autodir) = $self->catdir('$(INST_LIB)','auto');
  6176. !     return q{
  6177. ! pm_to_blib: $(TO_INST_PM)
  6178. !     }.$self->{NOECHO}.q{$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
  6179. !     "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
  6180. !         -e 'pm_to_blib({qw{$(PM_TO_BLIB)}},"}.$autodir.q{")'
  6181. !     }.$self->{NOECHO}.q{$(TOUCH) $@
  6182.   };
  6183.   }
  6184.   
  6185. ! =item post_constants (o)
  6186.   
  6187. ! Returns an empty string per default. Dedicated to overrides from
  6188. ! within Makefile.PL after all constants have been defined.
  6189.   
  6190.   =cut
  6191.   
  6192. ! sub post_constants{
  6193. !     my($self) = shift;
  6194. !     "";
  6195. ! }
  6196.   
  6197. ! =item post_initialize (o)
  6198.   
  6199. ! Returns an ampty string per default. Used in Makefile.PLs to add some
  6200. ! chunk of text to the Makefile after the object is initialized.
  6201.   
  6202. ! =cut
  6203.   
  6204. ! sub post_initialize {
  6205. !     my($self) = shift;
  6206. !     "";
  6207. ! }
  6208.   
  6209. ! =item postamble (o)
  6210.   
  6211. ! Returns an empty string. Can be used in Makefile.PLs to write some
  6212. ! text to the Makefile at the end.
  6213.   
  6214. ! =cut
  6215.   
  6216. ! sub postamble {
  6217. !     my($self) = shift;
  6218. !     "";
  6219. ! }
  6220.   
  6221. ! =item prefixify
  6222.   
  6223. + Check a path variable in $self from %Config, if it contains a prefix,
  6224. + and replace it with another one.
  6225.   
  6226. ! Takes as arguments an attribute name, a search prefix and a
  6227. ! replacement prefix. Changes the attribute in the object.
  6228.   
  6229. ! =cut
  6230.   
  6231. ! sub prefixify {
  6232. !     my($self,$var,$sprefix,$rprefix) = @_;
  6233. !     $self->{uc $var} ||= $Config{lc $var};
  6234. !     $self->{uc $var} = VMS::Filespec::unixpath($self->{uc $var}) if $Is_VMS;
  6235. !     $self->{uc $var} =~ s/\Q$sprefix\E/$rprefix/;
  6236. ! }
  6237.   
  6238. ! =item processPL (o)
  6239.   
  6240. ! Defines targets to run *.PL files.
  6241.   
  6242. ! =cut
  6243.   
  6244. ! sub processPL {
  6245. !     my($self) = shift;
  6246. !     return "" unless $self->{PL_FILES};
  6247. !     my(@m, $plfile);
  6248. !     foreach $plfile (sort keys %{$self->{PL_FILES}}) {
  6249. !     push @m, "
  6250. ! all :: $self->{PL_FILES}->{$plfile}
  6251.   
  6252. ! $self->{PL_FILES}->{$plfile} :: $plfile
  6253. !     \$(PERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) $plfile
  6254. ! ";
  6255. !     }
  6256. !     join "", @m;
  6257.   }
  6258.   
  6259. ! =item realclean (o)
  6260.   
  6261. ! Defines the realclean target.
  6262.   
  6263.   =cut
  6264.   
  6265. ! sub realclean {
  6266. !     my($self, %attribs) = @_;
  6267. !     my(@m);
  6268. !     push(@m,'
  6269. ! # Delete temporary files (via clean) and also delete installed files
  6270. ! realclean purge ::  clean
  6271. ! ');
  6272. !     # realclean subdirectories first (already cleaned)
  6273. !     my $sub = "\t-cd %s && test -f %s && \$(MAKE) %s realclean\n";
  6274. !     foreach(@{$self->{DIR}}){
  6275. !     push(@m, sprintf($sub,$_,"$self->{MAKEFILE}.old","-f $self->{MAKEFILE}.old"));
  6276. !     push(@m, sprintf($sub,$_,"$self->{MAKEFILE}",''));
  6277.       }
  6278. !     push(@m, "    $self->{RM_RF} \$(INST_AUTODIR) \$(INST_ARCHAUTODIR)\n");
  6279. !     if( $self->has_link_code ){
  6280. !         push(@m, "    $self->{RM_F} \$(INST_DYNAMIC) \$(INST_BOOT)\n");
  6281. !         push(@m, "    $self->{RM_F} \$(INST_STATIC)\n");
  6282. !     }
  6283. !     push(@m, "    $self->{RM_F} " . join(" ", values %{$self->{PM}}) . "\n");
  6284. !     my(@otherfiles) = ($self->{MAKEFILE},
  6285. !                "$self->{MAKEFILE}.old"); # Makefiles last
  6286. !     push(@otherfiles, $attribs{FILES}) if $attribs{FILES};
  6287. !     push(@m, "    $self->{RM_RF} @otherfiles\n") if @otherfiles;
  6288. !     push(@m, "    $attribs{POSTOP}\n")       if $attribs{POSTOP};
  6289. !     join("", @m);
  6290.   }
  6291.   
  6292. ! =item replace_manpage_separator
  6293.   
  6294. ! Takes the name of a package, which may be a nested package, in the
  6295. ! form Foo/Bar and replaces the slash with C<::>. Returns the replacement.
  6296.   
  6297.   =cut
  6298.   
  6299. ! sub replace_manpage_separator {
  6300. !     my($self,$man) = @_;
  6301. !     $man =~ s,/+,::,g;
  6302. !     $man;
  6303. ! }
  6304.   
  6305. ! =item static (o)
  6306.   
  6307. ! Defines the static target.
  6308.   
  6309. ! =cut
  6310.   
  6311. ! sub static {
  6312. ! # --- Static Loading Sections ---
  6313.   
  6314. !     my($self) = shift;
  6315. !     '
  6316. ! ## $(INST_PM) has been moved to the all: target.
  6317. ! ## It remains here for awhile to allow for old usage: "make static"
  6318. ! #static :: '.$self->{MAKEFILE}.' $(INST_STATIC) $(INST_PM)
  6319. ! static :: '.$self->{MAKEFILE}.' $(INST_STATIC)
  6320. !     '.$self->{NOECHO}.'$(NOOP)
  6321. ! ';
  6322.   }
  6323.   
  6324. ! =item static_lib (o)
  6325.   
  6326. ! Defines how to produce the *.a (or equivalent) files.
  6327.   
  6328.   =cut
  6329.   
  6330. ! sub static_lib {
  6331. !     my($self) = @_;
  6332. ! # Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC
  6333. ! #    return '' unless $self->needs_linking(); #might be because of a subdir
  6334.   
  6335. !     return '' unless $self->has_link_code;
  6336. !     my(@m);
  6337. !     push(@m, <<'END');
  6338. ! $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)/.exists
  6339. !     $(RM_RF) $@
  6340. ! END
  6341. !     # If this extension has it's own library (eg SDBM_File)
  6342. !     # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
  6343. !     push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
  6344.   
  6345. !     push @m,
  6346. ! q{    $(AR) $(AR_STATIC_ARGS) $@ $(OBJECT) && $(RANLIB) $@
  6347. !     }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
  6348. !     $(CHMOD) 755 $@
  6349.   };
  6350.   
  6351. ! # Old mechanism - still available:
  6352. !     push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)/ext.libs}."\n\n"
  6353. !     if $self->{PERL_SRC};
  6354. !     push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
  6355. !     join('', "\n",@m);
  6356.   }
  6357.   
  6358.   =item staticmake (o)
  6359. ***************
  6360. *** 2840,2849 ****
  6361.   
  6362.   sub staticmake {
  6363.       my($self, %attribs) = @_;
  6364. -     unless (ref $self){
  6365. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  6366. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  6367. -     }
  6368.       my(@static);
  6369.   
  6370.       my(@searchdirs)=($self->{PERL_ARCHLIB}, $self->{SITEARCHEXP},  $self->{INST_ARCHLIB});
  6371. --- 2630,2635 ----
  6372. ***************
  6373. *** 2878,2883 ****
  6374. --- 2664,2715 ----
  6375.               );
  6376.   }
  6377.   
  6378. + =item subdir_x (o)
  6379. + Helper subroutine for subdirs
  6380. + =cut
  6381. + sub subdir_x {
  6382. +     my($self, $subdir) = @_;
  6383. +     my(@m);
  6384. +     qq{
  6385. + subdirs ::
  6386. +     $self->{NOECHO}cd $subdir && \$(MAKE) all \$(PASTHRU)
  6387. + };
  6388. + }
  6389. + =item subdirs (o)
  6390. + Defines targets to process subdirectories.
  6391. + =cut
  6392. + sub subdirs {
  6393. + # --- Sub-directory Sections ---
  6394. +     my($self) = shift;
  6395. +     my(@m,$dir);
  6396. +     # This method provides a mechanism to automatically deal with
  6397. +     # subdirectories containing further Makefile.PL scripts.
  6398. +     # It calls the subdir_x() method for each subdirectory.
  6399. +     foreach $dir (@{$self->{DIR}}){
  6400. +     push(@m, $self->subdir_x($dir));
  6401. + ####    print "Including $dir subdirectory\n";
  6402. +     }
  6403. +     if (@m){
  6404. +     unshift(@m, "
  6405. + # The default clean, realclean and test targets in this Makefile
  6406. + # have automatically been given entries for each subdir.
  6407. + ");
  6408. +     } else {
  6409. +     push(@m, "\n# none")
  6410. +     }
  6411. +     join('',@m);
  6412. + }
  6413.   =item test (o)
  6414.   
  6415.   Defines the test targets.
  6416. ***************
  6417. *** 2888,2905 ****
  6418.   # --- Test and Installation Sections ---
  6419.   
  6420.       my($self, %attribs) = @_;
  6421. -     unless (ref $self){
  6422. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  6423. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  6424. -     }
  6425.       my($tests) = $attribs{TESTS} || (-d "t" ? "t/*.t" : "");
  6426.       my(@m);
  6427.       push(@m,"
  6428.   TEST_VERBOSE=0
  6429.   TEST_TYPE=test_\$(LINKTYPE)
  6430.   
  6431. - test :: \$(TEST_TYPE)
  6432.   testdb :: testdb_\$(LINKTYPE)
  6433.   ");
  6434.       push(@m, map("\t$self->{NOECHO}cd $_ && test -f $self->{MAKEFILE} && \$(MAKE) test \$(PASTHRU)\n",
  6435.            @{$self->{DIR}}));
  6436. --- 2720,2736 ----
  6437.   # --- Test and Installation Sections ---
  6438.   
  6439.       my($self, %attribs) = @_;
  6440.       my($tests) = $attribs{TESTS} || (-d "t" ? "t/*.t" : "");
  6441.       my(@m);
  6442.       push(@m,"
  6443.   TEST_VERBOSE=0
  6444.   TEST_TYPE=test_\$(LINKTYPE)
  6445. + TEST_FILE = test.pl
  6446. + TESTDB_SW = -d
  6447.   
  6448.   testdb :: testdb_\$(LINKTYPE)
  6449. + test :: \$(TEST_TYPE)
  6450.   ");
  6451.       push(@m, map("\t$self->{NOECHO}cd $_ && test -f $self->{MAKEFILE} && \$(MAKE) test \$(PASTHRU)\n",
  6452.            @{$self->{DIR}}));
  6453. ***************
  6454. *** 2912,2922 ****
  6455.       push(@m, $self->test_via_script('$(FULLPERL)', 'test.pl')) if -f "test.pl";
  6456.       push(@m, "\n");
  6457.   
  6458. !     if (-f "test.pl") {
  6459. !     push(@m, "testdb_dynamic :: pure_all\n");
  6460. !     push(@m, $self->test_via_script('$(FULLPERL) -d', 'test.pl'));
  6461. !     push(@m, "\n");
  6462. !     }
  6463.   
  6464.       # Occasionally we may face this degenerate target:
  6465.       push @m, "test_ : test_dynamic\n\n";
  6466. --- 2743,2751 ----
  6467.       push(@m, $self->test_via_script('$(FULLPERL)', 'test.pl')) if -f "test.pl";
  6468.       push(@m, "\n");
  6469.   
  6470. !     push(@m, "testdb_dynamic :: pure_all\n");
  6471. !     push(@m, $self->test_via_script('$(FULLPERL) $(TESTDB_SW)', '$(TEST_FILE)'));
  6472. !     push(@m, "\n");
  6473.   
  6474.       # Occasionally we may face this degenerate target:
  6475.       push @m, "test_ : test_dynamic\n\n";
  6476. ***************
  6477. *** 2926,2936 ****
  6478.       push(@m, $self->test_via_harness('./$(MAP_TARGET)', $tests)) if $tests;
  6479.       push(@m, $self->test_via_script('./$(MAP_TARGET)', 'test.pl')) if -f "test.pl";
  6480.       push(@m, "\n");
  6481. !     if (-f "test.pl") {
  6482. !         push(@m, "testdb_static :: pure_all \$(MAP_TARGET)\n");
  6483. !         push(@m, $self->test_via_script('./$(MAP_TARGET) -d', 'test.pl'));
  6484. !         push(@m, "\n");
  6485. !     }
  6486.       } else {
  6487.       push @m, "test_static :: test_dynamic\n";
  6488.       push @m, "testdb_static :: testdb_dynamic\n";
  6489. --- 2755,2763 ----
  6490.       push(@m, $self->test_via_harness('./$(MAP_TARGET)', $tests)) if $tests;
  6491.       push(@m, $self->test_via_script('./$(MAP_TARGET)', 'test.pl')) if -f "test.pl";
  6492.       push(@m, "\n");
  6493. !     push(@m, "testdb_static :: pure_all \$(MAP_TARGET)\n");
  6494. !     push(@m, $self->test_via_script('./$(MAP_TARGET) $(TESTDB_SW)', '$(TEST_FILE)'));
  6495. !     push(@m, "\n");
  6496.       } else {
  6497.       push @m, "test_static :: test_dynamic\n";
  6498.       push @m, "testdb_static :: testdb_dynamic\n";
  6499. ***************
  6500. *** 2946,2955 ****
  6501.   
  6502.   sub test_via_harness {
  6503.       my($self, $perl, $tests) = @_;
  6504. -     unless (ref $self){
  6505. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  6506. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  6507. -     }
  6508.       "\tPERL_DL_NONLAZY=1 $perl".q! -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;' !."$tests\n";
  6509.   }
  6510.   
  6511. --- 2773,2778 ----
  6512. ***************
  6513. *** 2961,3261 ****
  6514.   
  6515.   sub test_via_script {
  6516.       my($self, $perl, $script) = @_;
  6517. -     unless (ref $self){
  6518. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  6519. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  6520. -     }
  6521.       qq{\tPERL_DL_NONLAZY=1 $perl}.q{ -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) }.qq{$script
  6522.   };
  6523.   }
  6524.   
  6525. ! =item postamble (o)
  6526.   
  6527. ! Returns an empty string. Can be used in Makefile.PLs to write some
  6528. ! text to the Makefile at the end.
  6529.   
  6530.   =cut
  6531.   
  6532. ! sub postamble {
  6533. !     my($self) = shift;
  6534. !     unless (ref $self){
  6535. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  6536. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  6537. !     }
  6538. !     "";
  6539.   }
  6540.   
  6541. ! =item makeaperl (o)
  6542.   
  6543. ! Called by staticmake. Defines how to write the Makefile to produce a
  6544. ! static new perl.
  6545.   
  6546.   =cut
  6547.   
  6548. ! sub makeaperl {
  6549. !     my($self, %attribs) = @_;
  6550. !     unless (ref $self){
  6551. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  6552. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  6553.       }
  6554. -     my($makefilename, $searchdirs, $static, $extra, $perlinc, $target, $tmp, $libperl) =
  6555. -     @attribs{qw(MAKE DIRS STAT EXTRA INCL TARGET TMP LIBPERL)};
  6556. -     my(@m);
  6557. -     push @m, "
  6558. - # --- MakeMaker makeaperl section ---
  6559. - MAP_TARGET    = $target
  6560. - FULLPERL      = $self->{FULLPERL}
  6561. - ";
  6562. -     return join '', @m if $self->{PARENT};
  6563.   
  6564. -     my($dir) = join ":", @{$self->{DIR}};
  6565.   
  6566. !     unless ($self->{MAKEAPERL}) {
  6567. !     push @m, q{
  6568. ! $(MAP_TARGET) :: $(MAKE_APERL_FILE)
  6569. !     $(MAKE) -f $(MAKE_APERL_FILE) static $@
  6570.   
  6571. ! $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
  6572. !     }.$self->{NOECHO}.q{echo Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
  6573. !     }.$self->{NOECHO}.q{$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
  6574. !         Makefile.PL DIR=}, $dir, q{ \
  6575. !         MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
  6576. !         MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=};
  6577.   
  6578. !     push @m, map( " \\\n\t\t$_", @ARGV );
  6579. !     push @m, "\n";
  6580.   
  6581. !     return join '', @m;
  6582. !     }
  6583.   
  6584.   
  6585.   
  6586. !     my($cccmd, $linkcmd, $lperl);
  6587.   
  6588.   
  6589. !     $cccmd = $self->const_cccmd($libperl);
  6590. !     $cccmd =~ s/^CCCMD\s*=\s*//;
  6591. !     $cccmd =~ s/\$\(INC\)/ -I$self->{PERL_INC} /;
  6592. !     $cccmd .= " $Config::Config{cccdlflags}" if ($Config::Config{d_shrplib});
  6593. !     $cccmd =~ s/\(CC\)/\(PERLMAINCC\)/;
  6594.   
  6595. !     # The front matter of the linkcommand...
  6596. !     $linkcmd = join ' ', "\$(CC)",
  6597. !         grep($_, @Config{qw(large split ldflags ccdlflags)});
  6598. !     $linkcmd =~ s/\s+/ /g;
  6599.   
  6600. !     # Which *.a files could we make use of...
  6601. !     local(%static);
  6602. !     require File::Find;
  6603. !     File::Find::find(sub {
  6604. !     return unless m/\Q$self->{LIB_EXT}\E$/;
  6605. !     return if m/^libperl/;
  6606. !     # don't include the installed version of this extension. I
  6607. !     # leave this line here, although it is not necessary anymore:
  6608. !     # I patched minimod.PL instead, so that Miniperl.pm won't
  6609. !     # enclude duplicates
  6610.   
  6611. !     # Once the patch to minimod.PL is in the distribution, I can
  6612. !     # drop it
  6613. !     return if $File::Find::name =~ m:auto/$self->{FULLEXT}/$self->{BASEEXT}$self->{LIB_EXT}$:;
  6614. !     use Cwd 'cwd';
  6615. !     $static{cwd() . "/" . $_}++;
  6616. !     }, grep( -d $_, @{$searchdirs || []}) );
  6617.   
  6618. !     # We trust that what has been handed in as argument, will be buildable
  6619. !     $static = [] unless $static;
  6620. !     @static{@{$static}} = (1) x @{$static};
  6621.   
  6622. !     $extra = [] unless $extra && ref $extra eq 'ARRAY';
  6623. !     for (sort keys %static) {
  6624. !     next unless /\Q$self->{LIB_EXT}\E$/;
  6625. !     $_ = dirname($_) . "/extralibs.ld";
  6626. !     push @$extra, $_;
  6627.       }
  6628.   
  6629. -     grep(s/^/-I/, @{$perlinc || []});
  6630. -     $target = "perl" unless $target;
  6631. -     $tmp = "." unless $tmp;
  6632. - # MAP_STATIC doesn't look into subdirs yet. Once "all" is made and we
  6633. - # regenerate the Makefiles, MAP_STATIC and the dependencies for
  6634. - # extralibs.all are computed correctly
  6635. -     push @m, "
  6636. - MAP_LINKCMD   = $linkcmd
  6637. - MAP_PERLINC   = @{$perlinc || []}
  6638. - MAP_STATIC    = ",
  6639. - join(" \\\n\t", reverse sort keys %static), "
  6640.   
  6641. ! MAP_PRELIBS   = $Config::Config{libs} $Config::Config{cryptlib}
  6642. ! ";
  6643.   
  6644. !     if (defined $libperl) {
  6645. !     ($lperl = $libperl) =~ s/\$\(A\)/$self->{LIB_EXT}/;
  6646. !     }
  6647. !     unless ($libperl && -f $lperl) { # Ilya's code...
  6648. !     my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/CORE";
  6649. !     $libperl ||= "libperl$self->{LIB_EXT}";
  6650. !     $libperl   = "$dir/$libperl";
  6651. !     $lperl   ||= "libperl$self->{LIB_EXT}";
  6652. !     $lperl     = "$dir/$lperl";
  6653. !     print STDOUT "Warning: $libperl not found
  6654. !     If you're going to build a static perl binary, make sure perl is installed
  6655. !     otherwise ignore this warning\n"
  6656. !         unless (-f $lperl || defined($self->{PERL_SRC}));
  6657.       }
  6658.   
  6659. !     push @m, "
  6660. ! MAP_LIBPERL = $libperl
  6661. ! ";
  6662.   
  6663. !     push @m, "
  6664. ! \$(INST_ARCHAUTODIR)/extralibs.all: \$(INST_ARCHAUTODIR)/.exists ".join(" \\\n\t", @$extra)."
  6665. !     $self->{NOECHO}$self->{RM_F} \$\@
  6666. !     $self->{NOECHO}\$(TOUCH) \$\@
  6667. ! ";
  6668.   
  6669. !     my $catfile;
  6670. !     foreach $catfile (@$extra){
  6671. !     push @m, "\tcat $catfile >> \$\@\n";
  6672. !     }
  6673.   
  6674. !     push @m, "
  6675. ! \$(MAP_TARGET) :: $tmp/perlmain\$(OBJ_EXT) \$(MAP_LIBPERL) \$(MAP_STATIC) \$(INST_ARCHAUTODIR)/extralibs.all
  6676. !     \$(MAP_LINKCMD) -o \$\@ $tmp/perlmain\$(OBJ_EXT) \$(MAP_LIBPERL) \$(MAP_STATIC) `cat \$(INST_ARCHAUTODIR)/extralibs.all` \$(MAP_PRELIBS)
  6677. !     $self->{NOECHO}echo 'To install the new \"\$(MAP_TARGET)\" binary, call'
  6678. !     $self->{NOECHO}echo '    make -f $makefilename inst_perl MAP_TARGET=\$(MAP_TARGET)'
  6679. !     $self->{NOECHO}echo 'To remove the intermediate files say'
  6680. !     $self->{NOECHO}echo '    make -f $makefilename map_clean'
  6681.   
  6682. ! $tmp/perlmain\$(OBJ_EXT): $tmp/perlmain.c
  6683. ! ";
  6684. !     push @m, "\tcd $tmp && $cccmd -I\$(PERL_INC) perlmain.c\n";
  6685.   
  6686. !     push @m, qq{
  6687. ! $tmp/perlmain.c: $makefilename}, q{
  6688. !     }.$self->{NOECHO}.q{echo Writing $@
  6689. !     }.$self->{NOECHO}.q{$(PERL) $(MAP_PERLINC) -e 'use ExtUtils::Miniperl; \\
  6690. !         writemain(grep s#.*/auto/##, qw|$(MAP_STATIC)|)' > $@.tmp && mv $@.tmp $@
  6691.   
  6692. ! };
  6693.   
  6694. !     push @m, q{
  6695. ! doc_inst_perl:
  6696. !     }.$self->{NOECHO}.q{echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
  6697. !     }.$self->{NOECHO}.q{$(DOC_INSTALL) \
  6698. !         "Perl binary $(MAP_TARGET)" \
  6699. !         MAP_STATIC "$(MAP_STATIC)" \
  6700. !         MAP_EXTRA "`cat $(INST_ARCHAUTODIR)/extralibs.all`" \
  6701. !         MAP_LIBPERL "$(MAP_LIBPERL)" \
  6702. !         >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
  6703.   
  6704. ! };
  6705.   
  6706. !     push @m, qq{
  6707. ! inst_perl: pure_inst_perl doc_inst_perl
  6708.   
  6709. ! pure_inst_perl: \$(MAP_TARGET)
  6710. !     $self->{CP} \$(MAP_TARGET) \$(INSTALLBIN)/\$(MAP_TARGET)
  6711.   
  6712. ! clean :: map_clean
  6713.   
  6714. ! map_clean :
  6715. !     $self->{RM_F} $tmp/perlmain\$(OBJ_EXT) $tmp/perlmain.c \$(MAP_TARGET) $makefilename \$(INST_ARCHAUTODIR)/extralibs.all
  6716. ! };
  6717.   
  6718. !     join '', @m;
  6719.   }
  6720.   
  6721. ! =item dir_target (o)
  6722.   
  6723. ! Takes an array of directories that need to exist and returns a
  6724. ! Makefile entry for a .exists file in these directories. Returns
  6725. ! nothing, if the entry has already been processed. We're helpless
  6726. ! though, if the same directory comes as $(FOO) _and_ as "bar". Both of
  6727. ! them get an entry, that's why we use "::".
  6728.   
  6729.   =cut
  6730.   
  6731. ! sub dir_target {
  6732. ! # --- Make-Directories section (internal method) ---
  6733. ! # dir_target(@array) returns a Makefile entry for the file .exists in each
  6734. ! # named directory. Returns nothing, if the entry has already been processed.
  6735. ! # We're helpless though, if the same directory comes as $(FOO) _and_ as "bar".
  6736. ! # Both of them get an entry, that's why we use "::". I chose '$(PERL)' as the
  6737. ! # prerequisite, because there has to be one, something that doesn't change
  6738. ! # too often :)
  6739.   
  6740. !     my($self,@dirs) = @_;
  6741. !     unless (ref $self){
  6742. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  6743. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  6744. !     }
  6745. !     my(@m,$dir);
  6746. !     foreach $dir (@dirs) {
  6747. !     my($src) = $self->catfile($self->{PERL_INC},'perl.h');
  6748. !     my($targ) = $self->catfile($dir,'.exists');
  6749. !     my($targdir) = $targ;       # Necessary because catfile may have
  6750. !     $targdir =~ s:/?.exists$::; # adapted syntax of $dir to target OS
  6751. !     next if $self->{DIR_TARGET}{$self}{$targdir}++;
  6752. !     push @m, qq{
  6753. ! $targ :: $src
  6754. !     $self->{NOECHO}\$(MKPATH) $targdir
  6755. !     $self->{NOECHO}\$(EQUALIZE_TIMESTAMP) $src $targ
  6756. ! };
  6757. !     push(@m,qq{
  6758. !     -$self->{NOECHO}\$(CHMOD) 755 $targdir
  6759. ! }) unless $Is_VMS;
  6760. !     }
  6761. !     join "", @m;
  6762. ! }
  6763.   
  6764. ! =item needs_linking (o)
  6765.   
  6766. ! Does this module need linking? Looks into subdirectory objects (see
  6767. ! also has_link_code())
  6768.   
  6769. ! =cut
  6770.   
  6771. ! sub needs_linking {
  6772. !     my($self) = shift;
  6773. !     my($child,$caller);
  6774. !     $caller = (caller(0))[3];
  6775. !     unless (ref $self){
  6776. !     ExtUtils::MakeMaker::TieAtt::warndirectuse($caller);
  6777. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  6778. !     }
  6779. !     Carp::confess("Needs_linking called too early") if $caller =~ /^ExtUtils::MakeMaker::/;
  6780. !     return $self->{NEEDS_LINKING} if defined $self->{NEEDS_LINKING};
  6781. !     if ($self->has_link_code or $self->{MAKEAPERL}){
  6782. !     $self->{NEEDS_LINKING} = 1;
  6783. !     return 1;
  6784.       }
  6785. !     foreach $child (keys %{$self->{CHILDREN}}) {
  6786. !     if ($self->{CHILDREN}->{$child}->needs_linking) {
  6787. !         $self->{NEEDS_LINKING} = 1;
  6788. !         return 1;
  6789. !     }
  6790.       }
  6791. -     return $self->{NEEDS_LINKING} = 0;
  6792. - }
  6793.   
  6794. ! =item has_link_code
  6795.   
  6796. ! Returns true if C, XS, MYEXTLIB or similar objects exist within this
  6797. ! object that need a compiler. Does not descend into subdirectories as
  6798. ! needs_linking() does.
  6799.   
  6800. ! =cut
  6801.   
  6802. ! sub has_link_code {
  6803. !     my($self) = shift;
  6804. !     return $self->{HAS_LINK_CODE} if defined $self->{HAS_LINK_CODE};
  6805. !     if ($self->{OBJECT} or @{$self->{C} || []} or $self->{MYEXTLIB}){
  6806. !     $self->{HAS_LINK_CODE} = 1;
  6807. !     return 1;
  6808. !     }
  6809. !     return $self->{HAS_LINK_CODE} = 0;
  6810.   }
  6811.   
  6812.   =item writedoc
  6813. --- 2784,3062 ----
  6814.   
  6815.   sub test_via_script {
  6816.       my($self, $perl, $script) = @_;
  6817.       qq{\tPERL_DL_NONLAZY=1 $perl}.q{ -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) }.qq{$script
  6818.   };
  6819.   }
  6820.   
  6821. ! =item tool_autosplit (o)
  6822.   
  6823. ! Defines a simple perl call that runs autosplit. May be deprecated by
  6824. ! pm_to_blib soon.
  6825.   
  6826.   =cut
  6827.   
  6828. ! sub tool_autosplit {
  6829. ! # --- Tool Sections ---
  6830. !     my($self, %attribs) = @_;
  6831. !     my($asl) = "";
  6832. !     $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
  6833. !     q{
  6834. ! # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
  6835. ! AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e 'use AutoSplit;}.$asl.q{autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
  6836. ! };
  6837.   }
  6838.   
  6839. ! =item tools_other (o)
  6840.   
  6841. ! Defines SHELL, LD, TOUCH, CP, MV, RM_F, RM_RF, CHMOD, UMASK_NULL in
  6842. ! the Makefile. Also defines the perl programs MKPATH,
  6843. ! WARN_IF_OLD_PACKLIST, MOD_INSTALL. DOC_INSTALL, and UNINSTALL.
  6844.   
  6845.   =cut
  6846.   
  6847. ! sub tools_other {
  6848. !     my($self) = shift;
  6849. !     my @m;
  6850. !     my $bin_sh = $Config{sh} || '/bin/sh';
  6851. !     push @m, qq{
  6852. ! SHELL = $bin_sh
  6853. ! };
  6854. !     for (qw/ CHMOD CP LD MV NOOP RM_F RM_RF TOUCH UMASK_NULL / ) {
  6855. !     push @m, "$_ = $self->{$_}\n";
  6856.       }
  6857.   
  6858.   
  6859. !     push @m, q{
  6860. ! # The following is a portable way to say mkdir -p
  6861. ! # To see which directories are created, change the if 0 to if 1
  6862. ! MKPATH = $(PERL) -wle '$$"="/"; foreach $$p (@ARGV){' \\
  6863. ! -e 'next if -d $$p; my(@p); foreach(split(/\//,$$p)){' \\
  6864. ! -e 'push(@p,$$_); next if -d "@p/"; print "mkdir @p" if 0;' \\
  6865. ! -e 'mkdir("@p",0777)||die $$! } } exit 0;'
  6866.   
  6867. ! # This helps us to minimize the effect of the .exists files A yet
  6868. ! # better solution would be to have a stable file in the perl
  6869. ! # distribution with a timestamp of zero. But this solution doesn't
  6870. ! # need any changes to the core distribution and works with older perls
  6871. ! EQUALIZE_TIMESTAMP = $(PERL) -we 'open F, ">$$ARGV[1]"; close F;' \\
  6872. ! -e 'utime ((stat("$$ARGV[0]"))[8,9], $$ARGV[1])'
  6873. ! };
  6874.   
  6875. !     return join "", @m if $self->{PARENT};
  6876.   
  6877. !     push @m, q{
  6878. ! # Here we warn users that an old packlist file was found somewhere,
  6879. ! # and that they should call some uninstall routine
  6880. ! WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \\
  6881. ! -e 'print "WARNING: I have found an old package in\n";' \\
  6882. ! -e 'print "\t$$ARGV[0].\n";' \\
  6883. ! -e 'print "Please make sure the two installations are not conflicting\n";'
  6884.   
  6885. + UNINST=0
  6886. + VERBINST=1
  6887.   
  6888. + MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
  6889. + -e 'install({@ARGV},"$(VERBINST)",0,"$(UNINST)");'
  6890.   
  6891. ! DOC_INSTALL = $(PERL) -e '$$\="\n\n";print "=head3 ", scalar(localtime), ": C<", shift, ">";' \
  6892. ! -e 'print "=over 4";' \
  6893. ! -e 'while (defined($$key = shift) and defined($$val = shift)){print "=item *";print "C<$$key: $$val>";}' \
  6894. ! -e 'print "=back";'
  6895.   
  6896. + UNINSTALL =   $(PERL) -MExtUtils::Install \
  6897. + -e 'uninstall($$ARGV[0],1);'
  6898.   
  6899. ! };
  6900.   
  6901. !     return join "", @m;
  6902. ! }
  6903.   
  6904. ! =item tool_xsubpp (o)
  6905.   
  6906. ! Determines typemaps, xsubpp version, prototype behaviour.
  6907.   
  6908. ! =cut
  6909.   
  6910. ! sub tool_xsubpp {
  6911. !     my($self) = shift;
  6912. !     return "" unless $self->needs_linking;
  6913. !     my($xsdir)  = $self->catdir($self->{PERL_LIB},"ExtUtils");
  6914. !     my(@tmdeps) = $self->catdir('$(XSUBPPDIR)','typemap');
  6915. !     if( $self->{TYPEMAPS} ){
  6916. !     my $typemap;
  6917. !     foreach $typemap (@{$self->{TYPEMAPS}}){
  6918. !         if( ! -f  $typemap ){
  6919. !             warn "Typemap $typemap not found.\n";
  6920. !         }
  6921. !         else{
  6922. !             push(@tmdeps,  $typemap);
  6923. !         }
  6924. !     }
  6925. !     }
  6926. !     push(@tmdeps, "typemap") if -f "typemap";
  6927. !     my(@tmargs) = map("-typemap $_", @tmdeps);
  6928. !     if( exists $self->{XSOPT} ){
  6929. !      unshift( @tmargs, $self->{XSOPT} );
  6930.       }
  6931.   
  6932.   
  6933. !     my $xsubpp_version = $self->xsubpp_version($self->catfile($xsdir,"xsubpp"));
  6934.   
  6935. !     # What are the correct thresholds for version 1 && 2 Paul?
  6936. !     if ( $xsubpp_version > 1.923 ){
  6937. !     $self->{XSPROTOARG} = "" unless defined $self->{XSPROTOARG};
  6938. !     } else {
  6939. !     if (defined $self->{XSPROTOARG} && $self->{XSPROTOARG} =~ /\-prototypes/) {
  6940. !         print STDOUT qq{Warning: This extension wants to pass the switch "-prototypes" to xsubpp.
  6941. !     Your version of xsubpp is $xsubpp_version and cannot handle this.
  6942. !     Please upgrade to a more recent version of xsubpp.
  6943. ! };
  6944. !     } else {
  6945. !         $self->{XSPROTOARG} = "";
  6946. !     }
  6947.       }
  6948.   
  6949. !     return qq{
  6950. ! XSUBPPDIR = $xsdir
  6951. ! XSUBPP = \$(XSUBPPDIR)/xsubpp
  6952. ! XSPROTOARG = $self->{XSPROTOARG}
  6953. ! XSUBPPDEPS = @tmdeps
  6954. ! XSUBPPARGS = @tmargs
  6955. ! };
  6956. ! };
  6957.   
  6958. ! sub xsubpp_version
  6959. ! {
  6960. !     my($self,$xsubpp) = @_;
  6961. !     return $Xsubpp_Version if defined $Xsubpp_Version; # global variable
  6962.   
  6963. !     my ($version) ;
  6964.   
  6965. !     # try to figure out the version number of the xsubpp on the system
  6966.   
  6967. !     # first try the -v flag, introduced in 1.921 & 2.000a2
  6968.   
  6969. !     return "" unless $self->needs_linking;
  6970.   
  6971. !     my $command = "$self->{PERL} -I$self->{PERL_LIB} $xsubpp -v 2>&1";
  6972. !     print "Running $command\n" if $Verbose >= 2;
  6973. !     $version = `$command` ;
  6974. !     warn "Running '$command' exits with status " . ($?>>8) if $?;
  6975. !     chop $version ;
  6976.   
  6977. !     return $Xsubpp_Version = $1 if $version =~ /^xsubpp version (.*)/ ;
  6978.   
  6979. !     # nope, then try something else
  6980.   
  6981. !     my $counter = '000';
  6982. !     my ($file) = 'temp' ;
  6983. !     $counter++ while -e "$file$counter"; # don't overwrite anything
  6984. !     $file .= $counter;
  6985.   
  6986. !     open(F, ">$file") or die "Cannot open file '$file': $!\n" ;
  6987. !     print F <<EOM ;
  6988. ! MODULE = fred PACKAGE = fred
  6989.   
  6990. ! int
  6991. ! fred(a)
  6992. !         int     a;
  6993. ! EOM
  6994.   
  6995. !     close F ;
  6996.   
  6997. !     $command = "$self->{PERL} $xsubpp $file 2>&1";
  6998. !     print "Running $command\n" if $Verbose >= 2;
  6999. !     my $text = `$command` ;
  7000. !     warn "Running '$command' exits with status " . ($?>>8) if $?;
  7001. !     unlink $file ;
  7002. !     # gets 1.2 -> 1.92 and 2.000a1
  7003. !     return $Xsubpp_Version = $1 if $text =~ /automatically by xsubpp version ([\S]+)\s*/  ;
  7004. !     # it is either 1.0 or 1.1
  7005. !     return $Xsubpp_Version = 1.1 if $text =~ /^Warning: ignored semicolon/ ;
  7006. !     # none of the above, so 1.0
  7007. !     return $Xsubpp_Version = "1.0" ;
  7008.   }
  7009.   
  7010. ! =item top_targets (o)
  7011.   
  7012. ! Defines the targets all, subdirs, config, and O_FILES
  7013.   
  7014.   =cut
  7015.   
  7016. ! sub top_targets {
  7017. ! # --- Target Sections ---
  7018.   
  7019. !     my($self) = shift;
  7020. !     my(@m);
  7021. !     push @m, '
  7022. ! #all ::    config $(INST_PM) subdirs linkext manifypods
  7023.   
  7024. ! all :: pure_all manifypods
  7025. !     '.$self->{NOECHO}.'$(NOOP)
  7026.   
  7027. ! pure_all :: config pm_to_blib subdirs linkext
  7028. !     '.$self->{NOECHO}.'$(NOOP)
  7029.   
  7030. ! subdirs :: $(MYEXTLIB)
  7031. !     '.$self->{NOECHO}.'$(NOOP)
  7032.   
  7033. ! config :: '.$self->{MAKEFILE}.' $(INST_LIBDIR)/.exists
  7034. !     '.$self->{NOECHO}.'$(NOOP)
  7035. ! config :: $(INST_ARCHAUTODIR)/.exists
  7036. !     '.$self->{NOECHO}.'$(NOOP)
  7037. ! config :: $(INST_AUTODIR)/.exists
  7038. !     '.$self->{NOECHO}.'$(NOOP)
  7039. ! ';
  7040. !     push @m, qq{
  7041. ! config :: Version_check
  7042. !     $self->{NOECHO}\$(NOOP)
  7043. ! } unless $self->{PARENT} or ($self->{PERL_SRC} && $self->{INSTALLDIRS} eq "perl") or $self->{NO_VC};
  7044. !     push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
  7045. !     if (%{$self->{MAN1PODS}}) {
  7046. !     push @m, qq[
  7047. ! config :: \$(INST_MAN1DIR)/.exists
  7048. !     $self->{NOECHO}\$(NOOP)
  7049. ! ];
  7050. !     push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
  7051.       }
  7052. !     if (%{$self->{MAN3PODS}}) {
  7053. !     push @m, qq[
  7054. ! config :: \$(INST_MAN3DIR)/.exists
  7055. !     $self->{NOECHO}\$(NOOP)
  7056. ! ];
  7057. !     push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
  7058.       }
  7059.   
  7060. !     push @m, '
  7061. ! $(O_FILES): $(H_FILES)
  7062. ! ' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
  7063.   
  7064. !     push @m, q{
  7065. ! help:
  7066. !     perldoc ExtUtils::MakeMaker
  7067. ! };
  7068.   
  7069. !     push @m, q{
  7070. ! Version_check:
  7071. !     }.$self->{NOECHO}.q{$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
  7072. !         -MExtUtils::MakeMaker=Version_check \
  7073. !         -e 'Version_check("$(MM_VERSION)")'
  7074. ! };
  7075.   
  7076. !     join('',@m);
  7077.   }
  7078.   
  7079.   =item writedoc
  7080. ***************
  7081. *** 3267,3280 ****
  7082.   sub writedoc {
  7083.   # --- perllocal.pod section ---
  7084.       my($self,$what,$name,@attribs)=@_;
  7085. -     unless (ref $self){
  7086. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7087. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7088. -     }
  7089.       my $time = localtime;
  7090.       print "=head2 $time: $what C<$name>\n\n=over 4\n\n=item *\n\n";
  7091.       print join "\n\n=item *\n\n", map("C<$_>",@attribs);
  7092.       print "\n\n=back\n\n";
  7093.   }
  7094.   
  7095.   1;
  7096. --- 3068,3109 ----
  7097.   sub writedoc {
  7098.   # --- perllocal.pod section ---
  7099.       my($self,$what,$name,@attribs)=@_;
  7100.       my $time = localtime;
  7101.       print "=head2 $time: $what C<$name>\n\n=over 4\n\n=item *\n\n";
  7102.       print join "\n\n=item *\n\n", map("C<$_>",@attribs);
  7103.       print "\n\n=back\n\n";
  7104. + }
  7105. + =item xs_c (o)
  7106. + Defines the suffix rules to compile XS files to C.
  7107. + =cut
  7108. + sub xs_c {
  7109. +     my($self) = shift;
  7110. +     return '' unless $self->needs_linking();
  7111. +     '
  7112. + .xs.c:
  7113. +     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >$*.tc && mv $*.tc $@
  7114. + ';
  7115. + }
  7116. + =item xs_o (o)
  7117. + Defines suffix rules to go from XS to object files directly. This is
  7118. + only intended for broken make implementations.
  7119. + =cut
  7120. + sub xs_o {    # many makes are too dumb to use xs_c then c_o
  7121. +     my($self) = shift;
  7122. +     return '' unless $self->needs_linking();
  7123. +     '
  7124. + .xs$(OBJ_EXT):
  7125. +     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >xstmp.c && mv xstmp.c $*.c
  7126. +     $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
  7127. + ';
  7128.   }
  7129.   
  7130.   1;
  7131.  
  7132.  
  7133. #: lib/ExtUtils/MM_VMS.pm
  7134. #:   Update to MakeMaker 5.34
  7135. diff -crN perl5.002_01/lib/ExtUtils/MM_VMS.pm perl5.003/lib/ExtUtils/MM_VMS.pm
  7136. *** perl5.002_01/lib/ExtUtils/MM_VMS.pm    Mon Mar 25 01:04:31 1996
  7137. --- perl5.003/lib/ExtUtils/MM_VMS.pm    Mon Jun 24 17:56:22 1996
  7138. ***************
  7139. *** 6,12 ****
  7140.   #   Author:  Charles Bailey  bailey@genetics.upenn.edu
  7141.   
  7142.   package ExtUtils::MM_VMS;
  7143. ! $ExtUtils::MM_VMS::Revision=$ExtUtils::MM_VMS::Revision = '5.26 (17-Mar-1996)';
  7144.   unshift @MM::ISA, 'ExtUtils::MM_VMS';
  7145.   
  7146.   use Config;
  7147. --- 6,12 ----
  7148.   #   Author:  Charles Bailey  bailey@genetics.upenn.edu
  7149.   
  7150.   package ExtUtils::MM_VMS;
  7151. ! $ExtUtils::MM_VMS::Revision=$ExtUtils::MM_VMS::Revision = '5.35 (23-Jun-1996)';
  7152.   unshift @MM::ISA, 'ExtUtils::MM_VMS';
  7153.   
  7154.   use Config;
  7155. ***************
  7156. *** 42,51 ****
  7157.   
  7158.   sub eliminate_macros {
  7159.       my($self,$path) = @_;
  7160. -     unless (ref $self){
  7161. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7162. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7163. -     }
  7164.       unless ($path) {
  7165.       print "eliminate_macros('') = ||\n" if $Verbose >= 3;
  7166.       return '';
  7167. --- 42,47 ----
  7168. ***************
  7169. *** 81,90 ****
  7170.   
  7171.   sub fixpath {
  7172.       my($self,$path,$force_path) = @_;
  7173. -     unless (ref $self){
  7174. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7175. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7176. -     }
  7177.       unless ($path) {
  7178.       print "eliminate_macros('') = ||\n" if $Verbose >= 3;
  7179.       return '';
  7180. --- 77,82 ----
  7181. ***************
  7182. *** 123,132 ****
  7183.   
  7184.   sub catdir {
  7185.       my($self,@dirs) = @_;
  7186. -     unless (ref $self){
  7187. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7188. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7189. -     }
  7190.       my($dir) = pop @dirs;
  7191.       @dirs = grep($_,@dirs);
  7192.       my($rslt);
  7193. --- 115,120 ----
  7194. ***************
  7195. *** 151,160 ****
  7196.   
  7197.   sub catfile {
  7198.       my($self,@files) = @_;
  7199. -     unless (ref $self){
  7200. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7201. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7202. -     }
  7203.       my($file) = pop @files;
  7204.       @files = grep($_,@files);
  7205.       my($rslt);
  7206. --- 139,144 ----
  7207. ***************
  7208. *** 173,178 ****
  7209. --- 157,192 ----
  7210.       $rslt;
  7211.   }
  7212.   
  7213. + =item curdir (override)
  7214. + Returns a string representing of the current directory.
  7215. + =cut
  7216. + sub curdir {
  7217. +     return '[]';
  7218. + }
  7219. + =item rootdir (override)
  7220. + Returns a string representing of the root directory.
  7221. + =cut
  7222. + sub rootdir {
  7223. +     return '';
  7224. + }
  7225. + =item updir (override)
  7226. + Returns a string representing of the parent directory.
  7227. + =cut
  7228. + sub updir {
  7229. +     return '[-]';
  7230. + }
  7231.   package ExtUtils::MM_VMS;
  7232.   
  7233.   sub ExtUtils::MM_VMS::guess_name;
  7234. ***************
  7235. *** 226,235 ****
  7236.   sub AUTOLOAD {
  7237.       my $code;
  7238.       if (defined fileno(DATA)) {
  7239. !     while (<DATA>) {
  7240. !         last if /^__END__/;
  7241. !         $code .= $_;
  7242. !     }
  7243.       close DATA;
  7244.       eval $code;
  7245.       if ($@) {
  7246. --- 240,251 ----
  7247.   sub AUTOLOAD {
  7248.       my $code;
  7249.       if (defined fileno(DATA)) {
  7250. !     my $fh = select DATA;
  7251. !     my $o = $/;            # For future reads from the file.
  7252. !     $/ = "\n__END__\n";
  7253. !     $code = <DATA>;
  7254. !     $/ = $o;
  7255. !     select $fh;
  7256.       close DATA;
  7257.       eval $code;
  7258.       if ($@) {
  7259. ***************
  7260. *** 245,251 ****
  7261.   
  7262.   1;
  7263.   
  7264. ! __DATA__
  7265.   
  7266.   =head2 SelfLoaded methods
  7267.   
  7268. --- 261,267 ----
  7269.   
  7270.   1;
  7271.   
  7272. ! #__DATA__
  7273.   
  7274.   =head2 SelfLoaded methods
  7275.   
  7276. ***************
  7277. *** 268,285 ****
  7278.   
  7279.   sub guess_name {
  7280.       my($self) = @_;
  7281. -     unless (ref $self){
  7282. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7283. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7284. -     }
  7285.       my($defname,$defpm);
  7286.       local *PM;
  7287.   
  7288. !     $defname = $ENV{'DEFAULT'};
  7289. !     $defname =~ s:.*?([^.\]]+)\]:$1:
  7290. !         unless ($defname =~ s:.*[.\[]ext\.(.*)\]:$1:i);
  7291. !     $defname =~ s#[.\]]#::#g;
  7292. !     ($defpm = $defname) =~ s/.*:://;
  7293.       if (open(PM,"${defpm}.pm")){
  7294.           while (<PM>) {
  7295.               if (/^\s*package\s+([^;]+)/i) {
  7296. --- 284,295 ----
  7297.   
  7298.   sub guess_name {
  7299.       my($self) = @_;
  7300.       my($defname,$defpm);
  7301.       local *PM;
  7302.   
  7303. !     $defname = basename(fileify($ENV{'DEFAULT'}));
  7304. !     $defname =~ s![\d\-_]*\.dir.*$!!;  # Clip off .dir;1 suffix, and package version
  7305. !     $defpm = $defname;
  7306.       if (open(PM,"${defpm}.pm")){
  7307.           while (<PM>) {
  7308.               if (/^\s*package\s+([^;]+)/i) {
  7309. ***************
  7310. *** 296,302 ****
  7311.           print STDOUT "Warning (non-fatal): Couldn't find ${defpm}.pm;\n\t",
  7312.                        "defaulting package name to $defname\n";
  7313.       }
  7314. !     $defname =~ s#[\-_][\d.\-]+$##;
  7315.       $defname;
  7316.   }
  7317.   
  7318. --- 306,312 ----
  7319.           print STDOUT "Warning (non-fatal): Couldn't find ${defpm}.pm;\n\t",
  7320.                        "defaulting package name to $defname\n";
  7321.       }
  7322. !     $defname =~ s#[\d.\-_]+$##;
  7323.       $defname;
  7324.   }
  7325.   
  7326. ***************
  7327. *** 309,318 ****
  7328.   
  7329.   sub find_perl{
  7330.       my($self, $ver, $names, $dirs, $trace) = @_;
  7331. -     unless (ref $self){
  7332. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7333. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7334. -     }
  7335.       my($name,$dir,$vmsfile,@sdirs,@snames,@cand);
  7336.       # Check in relative directories first, so we pick up the current
  7337.       # version of Perl if we're running MakeMaker as part of the main build.
  7338. --- 319,324 ----
  7339. ***************
  7340. *** 344,349 ****
  7341. --- 350,356 ----
  7342.       foreach $name (@cand) {
  7343.       print "Checking $name\n" if ($trace >= 2);
  7344.       next unless $vmsfile = $self->maybe_command($name);
  7345. +     $vmsfile =~ s/;[\d\-]*$//;  # Clip off version number; we can use a newer version as well
  7346.       print "Executing $vmsfile\n" if ($trace >= 2);
  7347.       if (`MCR $vmsfile -e "require $ver; print ""VER_OK\n"""` =~ /VER_OK/) {
  7348.           print "Using PERL=MCR $vmsfile\n" if $trace;
  7349. ***************
  7350. *** 475,484 ****
  7351.   
  7352.   sub init_others {
  7353.       my($self) = @_;
  7354. -     unless (ref $self){
  7355. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7356. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7357. -     }
  7358.   
  7359.       $self->{NOOP} = "\t@ Continue";
  7360.       $self->{FIRST_MAKEFILE} ||= 'Descrip.MMS';
  7361. --- 482,487 ----
  7362. ***************
  7363. *** 505,514 ****
  7364.   
  7365.   sub constants {
  7366.       my($self) = @_;
  7367. -     unless (ref $self){
  7368. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7369. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7370. -     }
  7371.       my(@m,$def,$macro);
  7372.   
  7373.       if ($self->{DEFINE} ne '') {
  7374. --- 508,513 ----
  7375. ***************
  7376. *** 543,552 ****
  7377.       $self->{ROOTEXT} = $self->{ROOTEXT} ? $self->fixpath($self->{ROOTEXT},1)
  7378.                                           : '[]';
  7379.       foreach $macro ( qw [
  7380. !             INST_LIB INST_ARCHLIB INST_EXE INSTALLPRIVLIB INSTALLARCHLIB
  7381. !             INSTALLBIN PERL_LIB PERL_ARCHLIB PERL_INC PERL_SRC FULLEXT
  7382. !             INST_MAN1DIR INSTALLMAN1DIR INST_MAN3DIR INSTALLMAN3DIR
  7383. !             INSTALLSITELIB INSTALLSITEARCH SITELIBEXP SITEARCHEXP ] ) {
  7384.       next unless defined $self->{$macro};
  7385.       $self->{$macro} = $self->fixpath($self->{$macro},1);
  7386.       }
  7387. --- 542,552 ----
  7388.       $self->{ROOTEXT} = $self->{ROOTEXT} ? $self->fixpath($self->{ROOTEXT},1)
  7389.                                           : '[]';
  7390.       foreach $macro ( qw [
  7391. !             INST_BIN INST_SCRIPT INST_LIB INST_ARCHLIB INST_EXE INSTALLPRIVLIB
  7392. !             INSTALLARCHLIB INSTALLSCRIPT INSTALLBIN PERL_LIB PERL_ARCHLIB
  7393. !             PERL_INC PERL_SRC FULLEXT INST_MAN1DIR INSTALLMAN1DIR
  7394. !             INST_MAN3DIR INSTALLMAN3DIR INSTALLSITELIB INSTALLSITEARCH
  7395. !             SITELIBEXP SITEARCHEXP ] ) {
  7396.       next unless defined $self->{$macro};
  7397.       $self->{$macro} = $self->fixpath($self->{$macro},1);
  7398.       }
  7399. ***************
  7400. *** 561,576 ****
  7401.       $self->{$macro} = $self->fixpath($self->{$macro});
  7402.       }
  7403.   
  7404. !     for $tmp (qw/
  7405.             AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION VERSION_SYM XS_VERSION
  7406. !           INST_LIB INST_ARCHLIB INST_EXE PREFIX INSTALLDIRS INSTALLPRIVLIB
  7407. !           INSTALLARCHLIB INSTALLSITELIB INSTALLSITEARCH INSTALLBIN PERL_LIB
  7408.             PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
  7409.             FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC PERL_VMS
  7410.             PERL_INC PERL FULLPERL
  7411.             / ) {
  7412. !     next unless defined $self->{$tmp};
  7413. !     push @m, "$tmp = $self->{$tmp}\n";
  7414.       }
  7415.   
  7416.   
  7417. --- 561,577 ----
  7418.       $self->{$macro} = $self->fixpath($self->{$macro});
  7419.       }
  7420.   
  7421. !     foreach $macro (qw/
  7422.             AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION VERSION_SYM XS_VERSION
  7423. !           INST_BIN INST_EXE INST_LIB INST_ARCHLIB INST_SCRIPT PREFIX
  7424. !           INSTALLDIRS INSTALLPRIVLIB  INSTALLARCHLIB INSTALLSITELIB
  7425. !           INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB
  7426.             PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
  7427.             FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC PERL_VMS
  7428.             PERL_INC PERL FULLPERL
  7429.             / ) {
  7430. !     next unless defined $self->{$macro};
  7431. !     push @m, "$macro = $self->{$macro}\n";
  7432.       }
  7433.   
  7434.   
  7435. ***************
  7436. *** 587,604 ****
  7437.   
  7438.   # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
  7439.   # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
  7440. ! # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)
  7441.   # DLBASE  = Basename part of dynamic library. May be just equal BASEEXT.
  7442.   ];
  7443.   
  7444.       for $tmp (qw/
  7445. !           FULLEXT BASEEXT ROOTEXT DLBASE VERSION_FROM INC DEFINE OBJECT
  7446.             LDFROM LINKTYPE
  7447.             /    ) {
  7448.       next unless defined $self->{$tmp};
  7449.       push @m, "$tmp = $self->{$tmp}\n";
  7450.       }
  7451.   
  7452.       push @m,'
  7453.   
  7454.   # Handy lists of source code files:
  7455. --- 588,623 ----
  7456.   
  7457.   # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
  7458.   # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
  7459. ! # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
  7460.   # DLBASE  = Basename part of dynamic library. May be just equal BASEEXT.
  7461.   ];
  7462.   
  7463.       for $tmp (qw/
  7464. !           FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT
  7465.             LDFROM LINKTYPE
  7466.             /    ) {
  7467.       next unless defined $self->{$tmp};
  7468.       push @m, "$tmp = $self->{$tmp}\n";
  7469.       }
  7470.   
  7471. +     for $tmp (qw/ XS MAN1PODS MAN3PODS PM /) {
  7472. +     next unless defined $self->{$tmp};
  7473. +     my(%tmp,$key);
  7474. +     for $key (keys %{$self->{$tmp}}) {
  7475. +         $tmp{$self->fixpath($key)} = $self->fixpath($self->{$tmp}{$key});
  7476. +     }
  7477. +     $self->{$tmp} = \%tmp;
  7478. +     }
  7479. +     for $tmp (qw/ C O_FILES H /) {
  7480. +     next unless defined $self->{$tmp};
  7481. +     my(@tmp,$val);
  7482. +     for $val (@{$self->{$tmp}}) {
  7483. +         push(@tmp,$self->fixpath($val));
  7484. +     }
  7485. +     $self->{$tmp} = \@tmp;
  7486. +     }
  7487.       push @m,'
  7488.   
  7489.   # Handy lists of source code files:
  7490. ***************
  7491. *** 619,625 ****
  7492.       }
  7493.   
  7494.   push @m,"
  7495. ! .SUFFIXES : .xs .c .cpp .cxx \$(OBJ_EXT)
  7496.   
  7497.   # Here is the Config.pm that we are using/depend on
  7498.   CONFIGDEP = \$(PERL_ARCHLIB)Config.pm, \$(PERL_INC)config.h \$(VERSION_FROM)
  7499. --- 638,644 ----
  7500.       }
  7501.   
  7502.   push @m,"
  7503. ! .SUFFIXES : \$(OBJ_EXT) .c .cpp .cxx .xs
  7504.   
  7505.   # Here is the Config.pm that we are using/depend on
  7506.   CONFIGDEP = \$(PERL_ARCHLIB)Config.pm, \$(PERL_INC)config.h \$(VERSION_FROM)
  7507. ***************
  7508. *** 648,655 ****
  7509.   ';
  7510.       }
  7511.   
  7512. !     $self->{TO_INST_PM} = [ map($self->fixpath($_),sort keys %{$self->{PM}}) ];
  7513. !     $self->{PM_TO_BLIB} = [ map($self->fixpath($_),%{$self->{PM}}) ];
  7514.       push @m,'
  7515.   TO_INST_PM = ',join(', ',@{$self->{TO_INST_PM}}),'
  7516.   
  7517. --- 667,674 ----
  7518.   ';
  7519.       }
  7520.   
  7521. !     $self->{TO_INST_PM} = [ sort keys %{$self->{PM}} ];
  7522. !     $self->{PM_TO_BLIB} = [ %{$self->{PM}} ];
  7523.       push @m,'
  7524.   TO_INST_PM = ',join(', ',@{$self->{TO_INST_PM}}),'
  7525.   
  7526. ***************
  7527. *** 669,678 ****
  7528.   
  7529.   sub const_loadlibs{
  7530.       my($self) = @_;
  7531. -     unless (ref $self){
  7532. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7533. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7534. -     }
  7535.       my (@m);
  7536.       push @m, "
  7537.   # $self->{NAME} might depend on some other libraries.
  7538. --- 688,693 ----
  7539. ***************
  7540. *** 726,735 ****
  7541.   
  7542.   sub cflags {
  7543.       my($self,$libperl) = @_;
  7544. -     unless (ref $self){
  7545. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7546. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7547. -     }
  7548.       my($quals) = $Config{'ccflags'};
  7549.       my($name,$sys,@m);
  7550.       my($optimize) = '/Optimize';
  7551. --- 741,746 ----
  7552. ***************
  7553. *** 796,805 ****
  7554.   
  7555.   sub const_cccmd {
  7556.       my($self,$libperl) = @_;
  7557. -     unless (ref $self){
  7558. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7559. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7560. -     }
  7561.       my(@m);
  7562.   
  7563.       return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
  7564. --- 807,812 ----
  7565. ***************
  7566. *** 839,848 ****
  7567.   
  7568.   sub pm_to_blib {
  7569.       my($self) = @_;
  7570. -     unless (ref $self){
  7571. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7572. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7573. -     }
  7574.       my($line,$from,$to,@m);
  7575.       my($autodir) = $self->catdir('$(INST_LIB)','auto');
  7576.       my(@files) = @{$self->{PM_TO_BLIB}};
  7577. --- 846,851 ----
  7578. ***************
  7579. *** 861,866 ****
  7580. --- 864,870 ----
  7581.           $line = '';
  7582.       }
  7583.       }
  7584. +     push(@m,"\t$self->{NOECHO}\$(PERL) -e \"print '$line'\" >>.MM_tmp\n") if $line;
  7585.   
  7586.       push(@m,q[    $(PERL) "-I$(PERL_LIB)" "-MExtUtils::Install" -e "pm_to_blib({split(' ',<STDIN>)},'].$autodir.q[')" <.MM_tmp]);
  7587.       push(@m,qq[
  7588. ***************
  7589. *** 879,888 ****
  7590.   
  7591.   sub tool_autosplit{
  7592.       my($self, %attribs) = @_;
  7593. -     unless (ref $self){
  7594. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7595. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7596. -     }
  7597.       my($asl) = "";
  7598.       $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
  7599.       q{
  7600. --- 883,888 ----
  7601. ***************
  7602. *** 897,908 ****
  7603.   
  7604.   =cut
  7605.   
  7606. ! sub tool_xsubpp{
  7607.       my($self) = @_;
  7608. !     unless (ref $self){
  7609. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7610. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  7611. !     }
  7612.       my($xsdir) = $self->catdir($self->{PERL_LIB},'ExtUtils');
  7613.       # drop back to old location if xsubpp is not in new location yet
  7614.       $xsdir = $self->catdir($self->{PERL_SRC},'ext') unless (-f $self->catfile($xsdir,'xsubpp'));
  7615. --- 897,905 ----
  7616.   
  7617.   =cut
  7618.   
  7619. ! sub tool_xsubpp {
  7620.       my($self) = @_;
  7621. !     return '' unless $self->needs_linking;
  7622.       my($xsdir) = $self->catdir($self->{PERL_LIB},'ExtUtils');
  7623.       # drop back to old location if xsubpp is not in new location yet
  7624.       $xsdir = $self->catdir($self->{PERL_SRC},'ext') unless (-f $self->catfile($xsdir,'xsubpp'));
  7625. ***************
  7626. *** 960,965 ****
  7627. --- 957,963 ----
  7628.   {
  7629.       my($self,$xsubpp) = @_;
  7630.       my ($version) ;
  7631. +     return '' unless $self->needs_linking;
  7632.   
  7633.       # try to figure out the version number of the xsubpp on the system
  7634.   
  7635. ***************
  7636. *** 1021,1030 ****
  7637.   
  7638.   sub tools_other {
  7639.       my($self) = @_;
  7640. -     unless (ref $self){
  7641. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7642. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7643. -     }
  7644.       qq!
  7645.   # Assumes \$(MMS) invokes MMS or MMK
  7646.   # (It is assumed in some cases later that the default makefile name
  7647. --- 1019,1024 ----
  7648. ***************
  7649. *** 1041,1052 ****
  7650.   RM_F  = $self->{RM_F}
  7651.   RM_RF = $self->{RM_RF}
  7652.   UMASK_NULL = $self->{UMASK_NULL}
  7653.   MKPATH = Create/Directory
  7654.   EQUALIZE_TIMESTAMP = \$(PERL) -we "open F,qq{>\$ARGV[1]};close F;utime(0,(stat(\$ARGV[0]))[9]+1,\$ARGV[1])"
  7655.   !. ($self->{PARENT} ? '' : 
  7656. ! q!WARN_IF_OLD_PACKLIST = \$(PERL) -e "if (-f \$ARGV[0]){print qq[WARNING: Old package found (\$ARGV[0]); please check for collisions\\n]}"
  7657.   MOD_INSTALL = \$(PERL) "-I\$(PERL_LIB)" "-MExtUtils::Install" -e "install({split(' ',<STDIN>)},1);"
  7658. ! DOC_INSTALL = \$(PERL) -e "@ARGV=split('|',<STDIN>);print '=head3 ',scalar(localtime),': C<',shift,qq[>\\n\\n=over 4\\n\\n];while(\$key=shift && \$val=shift){print qq[=item *\\n\\nC<\$key: \$val>\\n\\n];}print qq[=back\\n\\n]"
  7659.   UNINSTALL = \$(PERL) "-I\$(PERL_LIB)" "-MExtUtils::Install" -e "uninstall(\$ARGV[0],1);"
  7660.   !);
  7661.   }
  7662. --- 1035,1047 ----
  7663.   RM_F  = $self->{RM_F}
  7664.   RM_RF = $self->{RM_RF}
  7665.   UMASK_NULL = $self->{UMASK_NULL}
  7666. + NOOP = $self->{NOOP}
  7667.   MKPATH = Create/Directory
  7668.   EQUALIZE_TIMESTAMP = \$(PERL) -we "open F,qq{>\$ARGV[1]};close F;utime(0,(stat(\$ARGV[0]))[9]+1,\$ARGV[1])"
  7669.   !. ($self->{PARENT} ? '' : 
  7670. ! qq!WARN_IF_OLD_PACKLIST = \$(PERL) -e "if (-f \$ARGV[0]){print qq[WARNING: Old package found (\$ARGV[0]); please check for collisions\\n]}"
  7671.   MOD_INSTALL = \$(PERL) "-I\$(PERL_LIB)" "-MExtUtils::Install" -e "install({split(' ',<STDIN>)},1);"
  7672. ! DOC_INSTALL = \$(PERL) -e "\@ARGV=split('|',<STDIN>);print '=head3 ',scalar(localtime),': C<',shift,qq[>\\n\\n=over 4\\n\\n];while(\$key=shift && \$val=shift){print qq[=item *\\n\\nC<\$key: \$val>\\n\\n];}print qq[=back\\n\\n]"
  7673.   UNINSTALL = \$(PERL) "-I\$(PERL_LIB)" "-MExtUtils::Install" -e "uninstall(\$ARGV[0],1);"
  7674.   !);
  7675.   }
  7676. ***************
  7677. *** 1060,1069 ****
  7678.   
  7679.   sub dist {
  7680.       my($self, %attribs) = @_;
  7681. !     unless (ref $self){
  7682. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7683. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  7684. !     }
  7685.       $attribs{ZIPFLAGS}     ||= '-Vu';
  7686.       $attribs{COMPRESS}     ||= 'gzip';
  7687.       $attribs{SUFFIX}       ||= '-gz';
  7688. --- 1055,1061 ----
  7689.   
  7690.   sub dist {
  7691.       my($self, %attribs) = @_;
  7692. !     $attribs{VERSION}      ||= $self->{VERSION_SYM};
  7693.       $attribs{ZIPFLAGS}     ||= '-Vu';
  7694.       $attribs{COMPRESS}     ||= 'gzip';
  7695.       $attribs{SUFFIX}       ||= '-gz';
  7696. ***************
  7697. *** 1082,1091 ****
  7698.   
  7699.   sub c_o {
  7700.       my($self) = @_;
  7701. -     unless (ref $self){
  7702. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7703. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7704. -     }
  7705.       return '' unless $self->needs_linking();
  7706.       '
  7707.   .c$(OBJ_EXT) :
  7708. --- 1074,1079 ----
  7709. ***************
  7710. *** 1108,1117 ****
  7711.   
  7712.   sub xs_c {
  7713.       my($self) = @_;
  7714. -     unless (ref $self){
  7715. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7716. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7717. -     }
  7718.       return '' unless $self->needs_linking();
  7719.       '
  7720.   .xs.c :
  7721. --- 1096,1101 ----
  7722. ***************
  7723. *** 1127,1136 ****
  7724.   
  7725.   sub xs_o {    # many makes are too dumb to use xs_c then c_o
  7726.       my($self) = @_;
  7727. -     unless (ref $self){
  7728. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7729. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7730. -     }
  7731.       return '' unless $self->needs_linking();
  7732.       '
  7733.   .xs$(OBJ_EXT) :
  7734. --- 1111,1116 ----
  7735. ***************
  7736. *** 1147,1156 ****
  7737.   
  7738.   sub top_targets {
  7739.       my($self) = shift;
  7740. -     unless (ref $self){
  7741. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7742. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7743. -     }
  7744.       my(@m);
  7745.       push @m, '
  7746.   all :: pure_all manifypods
  7747. --- 1127,1132 ----
  7748. ***************
  7749. *** 1223,1232 ****
  7750.   
  7751.   sub dlsyms {
  7752.       my($self,%attribs) = @_;
  7753. -     unless (ref $self){
  7754. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7755. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7756. -     }
  7757.   
  7758.       return '' unless $self->needs_linking();
  7759.   
  7760. --- 1199,1204 ----
  7761. ***************
  7762. *** 1285,1294 ****
  7763.   
  7764.   sub dynamic_lib {
  7765.       my($self, %attribs) = @_;
  7766. -     unless (ref $self){
  7767. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7768. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7769. -     }
  7770.       return '' unless $self->needs_linking(); #might be because of a subdir
  7771.   
  7772.       return '' unless $self->has_link_code();
  7773. --- 1257,1262 ----
  7774. ***************
  7775. *** 1320,1329 ****
  7776.   
  7777.   sub dynamic_bs {
  7778.       my($self, %attribs) = @_;
  7779. -     unless (ref $self){
  7780. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7781. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7782. -     }
  7783.       return '
  7784.   BOOTSTRAP =
  7785.   ' unless $self->has_link_code();
  7786. --- 1288,1293 ----
  7787. ***************
  7788. *** 1353,1362 ****
  7789.   
  7790.   sub static_lib {
  7791.       my($self) = @_;
  7792. -     unless (ref $self){
  7793. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7794. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7795. -     }
  7796.       return '' unless $self->needs_linking();
  7797.   
  7798.       return '
  7799. --- 1317,1322 ----
  7800. ***************
  7801. *** 1387,1396 ****
  7802.   
  7803.   # sub installpm_x { # called by installpm perl file
  7804.   #     my($self, $dist, $inst, $splitlib) = @_;
  7805. - #     unless (ref $self){
  7806. - #     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7807. - #     $self = $ExtUtils::MakeMaker::Parent[-1];
  7808. - #     }
  7809.   #     if ($inst =~ m!#!) {
  7810.   #     warn "Warning: MM[SK] would have problems processing this file: $inst, SKIPPED\n";
  7811.   #     return '';
  7812. --- 1347,1352 ----
  7813. ***************
  7814. *** 1421,1439 ****
  7815.   
  7816.   =cut
  7817.   
  7818.   sub manifypods {
  7819.       my($self, %attribs) = @_;
  7820. !     unless (ref $self){
  7821. !     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7822. !     $self = $ExtUtils::MakeMaker::Parent[-1];
  7823. !     }
  7824. !     return "\nmanifypods :\n\t\$(NOOP)\n" unless %{$self->{MAN3PODS}};
  7825.       my($dist);
  7826. !     my($pod2man_exe,$found_pod2man);
  7827.       if (defined $self->{PERL_SRC}) {
  7828.       $pod2man_exe = $self->catfile($self->{PERL_SRC},'pod','pod2man');
  7829.       } else {
  7830. !     $pod2man_exe = $self->catfile($Config{bin},'pod2man');
  7831.       }
  7832.       if ($pod2man_exe = $self->perl_script($pod2man_exe)) { $found_pod2man = 1; }
  7833.       else {
  7834. --- 1377,1392 ----
  7835.   
  7836.   =cut
  7837.   
  7838.   sub manifypods {
  7839.       my($self, %attribs) = @_;
  7840. !     return "\nmanifypods :\n\t\$(NOOP)\n" unless %{$self->{MAN3PODS}} or %{$self->{MAN1PODS}};
  7841.       my($dist);
  7842. !     my($pod2man_exe);
  7843.       if (defined $self->{PERL_SRC}) {
  7844.       $pod2man_exe = $self->catfile($self->{PERL_SRC},'pod','pod2man');
  7845.       } else {
  7846. !     $pod2man_exe = $self->catfile($Config{scriptdirexp},'pod2man');
  7847.       }
  7848.       if ($pod2man_exe = $self->perl_script($pod2man_exe)) { $found_pod2man = 1; }
  7849.       else {
  7850. ***************
  7851. *** 1478,1487 ****
  7852.   
  7853.   sub processPL {
  7854.       my($self) = @_;
  7855. -     unless (ref $self){
  7856. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7857. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7858. -     }
  7859.       return "" unless $self->{PL_FILES};
  7860.       my(@m, $plfile);
  7861.       foreach $plfile (sort keys %{$self->{PL_FILES}}) {
  7862. --- 1431,1436 ----
  7863. ***************
  7864. *** 1506,1520 ****
  7865.   
  7866.   sub installbin {
  7867.       my($self) = @_;
  7868. -     unless (ref $self){
  7869. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7870. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7871. -     }
  7872.       return '' unless $self->{EXE_FILES} && ref $self->{EXE_FILES} eq "ARRAY";
  7873.       return '' unless @{$self->{EXE_FILES}};
  7874.       my(@m, $from, $to, %fromto, @to, $line);
  7875.       for $from (@{$self->{EXE_FILES}}) {
  7876. !     my($path) = '$(INST_EXE)' . basename($from);
  7877.       local($_) = $path;  # backward compatibility
  7878.       $to = $self->libscan($path);
  7879.       print "libscan($from) => '$to'\n" if ($Verbose >=2);
  7880. --- 1455,1465 ----
  7881.   
  7882.   sub installbin {
  7883.       my($self) = @_;
  7884.       return '' unless $self->{EXE_FILES} && ref $self->{EXE_FILES} eq "ARRAY";
  7885.       return '' unless @{$self->{EXE_FILES}};
  7886.       my(@m, $from, $to, %fromto, @to, $line);
  7887.       for $from (@{$self->{EXE_FILES}}) {
  7888. !     my($path) = '$(INST_SCRIPT)' . basename($from);
  7889.       local($_) = $path;  # backward compatibility
  7890.       $to = $self->libscan($path);
  7891.       print "libscan($from) => '$to'\n" if ($Verbose >=2);
  7892. ***************
  7893. *** 1537,1543 ****
  7894.       }
  7895.       else { $line .= " $to"; }
  7896.       }
  7897. !     push @m, "\t\$(RM_F) $line\n\n";
  7898.   
  7899.       while (($from,$to) = each %fromto) {
  7900.       last unless defined $from;
  7901. --- 1482,1488 ----
  7902.       }
  7903.       else { $line .= " $to"; }
  7904.       }
  7905. !     push @m, "\t\$(RM_F) $line\n\n" if $line;
  7906.   
  7907.       while (($from,$to) = each %fromto) {
  7908.       last unless defined $from;
  7909. ***************
  7910. *** 1562,1571 ****
  7911.   
  7912.   sub subdir_x {
  7913.       my($self, $subdir) = @_;
  7914. -     unless (ref $self){
  7915. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7916. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7917. -     }
  7918.       my(@m,$key);
  7919.       $subdir = $self->fixpath($subdir,1);
  7920.       push @m, '
  7921. --- 1507,1512 ----
  7922. ***************
  7923. *** 1589,1598 ****
  7924.   
  7925.   sub clean {
  7926.       my($self, %attribs) = @_;
  7927. -     unless (ref $self){
  7928. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7929. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7930. -     }
  7931.       my(@m,$dir);
  7932.       push @m, '
  7933.   # Delete temporary files but do not touch installed files. We don\'t delete
  7934. --- 1530,1535 ----
  7935. ***************
  7936. *** 1621,1627 ****
  7937.       }
  7938.       else { $line .= " $file"; }
  7939.       }
  7940. !     push @m, "\t\$(RM_RF) $line\n\n";
  7941.       push(@m, "    $attribs{POSTOP}\n") if $attribs{POSTOP};
  7942.       join('', @m);
  7943.   }
  7944. --- 1558,1564 ----
  7945.       }
  7946.       else { $line .= " $file"; }
  7947.       }
  7948. !     push @m, "\t\$(RM_RF) $line\n" if line;
  7949.       push(@m, "    $attribs{POSTOP}\n") if $attribs{POSTOP};
  7950.       join('', @m);
  7951.   }
  7952. ***************
  7953. *** 1634,1643 ****
  7954.   
  7955.   sub realclean {
  7956.       my($self, %attribs) = @_;
  7957. -     unless (ref $self){
  7958. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  7959. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  7960. -     }
  7961.       my(@m);
  7962.       push(@m,'
  7963.   # Delete temporary files (via clean) and also delete installed files
  7964. --- 1571,1576 ----
  7965. ***************
  7966. *** 1655,1661 ****
  7967.       # combination of macros).  In order to stay below DCL's 255 char limit,
  7968.       # we put only 2 on a line.
  7969.       my($file,$line,$fcnt);
  7970. !     my(@files) = qw{ $(INST_DYNAMIC) $(INST_STATIC) $(INST_BOOT) $(OBJECT) $(MAKEFILE) $(MAKEFILE)_old };
  7971.       push(@files, values %{$self->{PM}});
  7972.       $line = '';  #avoid unitialized var warning
  7973.       foreach $file (@files) {
  7974. --- 1588,1597 ----
  7975.       # combination of macros).  In order to stay below DCL's 255 char limit,
  7976.       # we put only 2 on a line.
  7977.       my($file,$line,$fcnt);
  7978. !     my(@files) = qw{ $(MAKEFILE) $(MAKEFILE)_old };
  7979. !     if ($self->has_link_code) {
  7980. !     push(@files,qw{ $(INST_DYNAMIC) $(INST_STATIC) $(INST_BOOT) $(OBJECT) });
  7981. !     }
  7982.       push(@files, values %{$self->{PM}});
  7983.       $line = '';  #avoid unitialized var warning
  7984.       foreach $file (@files) {
  7985. ***************
  7986. *** 1667,1673 ****
  7987.       }
  7988.       else { $line .= " $file"; }
  7989.       }
  7990. !     push @m, "\t\$(RM_F) $line\n";
  7991.       if ($attribs{FILES} && ref $attribs{FILES} eq 'ARRAY') {
  7992.       $line = '';
  7993.       foreach $file (@{$attribs{'FILES'}}) {
  7994. --- 1603,1609 ----
  7995.       }
  7996.       else { $line .= " $file"; }
  7997.       }
  7998. !     push @m, "\t\$(RM_F) $line\n" if $line;
  7999.       if ($attribs{FILES} && ref $attribs{FILES} eq 'ARRAY') {
  8000.       $line = '';
  8001.       foreach $file (@{$attribs{'FILES'}}) {
  8002. ***************
  8003. *** 1678,1684 ****
  8004.           }
  8005.           else { $line .= " $file"; }
  8006.       }
  8007. !     push @m, "\t\$(RM_RF) $line\n";
  8008.       }
  8009.       push(@m, "    $attribs{POSTOP}\n")                     if $attribs{POSTOP};
  8010.       join('', @m);
  8011. --- 1614,1620 ----
  8012.           }
  8013.           else { $line .= " $file"; }
  8014.       }
  8015. !     push @m, "\t\$(RM_RF) $line\n" if $line;
  8016.       }
  8017.       push(@m, "    $attribs{POSTOP}\n")                     if $attribs{POSTOP};
  8018.       join('', @m);
  8019. ***************
  8020. *** 1692,1701 ****
  8021.   
  8022.   sub dist_basics {
  8023.       my($self) = @_;
  8024. -     unless (ref $self){
  8025. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8026. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8027. -     }
  8028.   '
  8029.   distclean :: realclean distcheck
  8030.       $(NOOP)
  8031. --- 1628,1633 ----
  8032. ***************
  8033. *** 1711,1717 ****
  8034.   ';
  8035.   }
  8036.   
  8037. ! =sub dist_core (override)
  8038.   
  8039.   Syntax for invoking F<VMS_Share> differs from that for Unix F<shar>,
  8040.   so C<shdist> target actions are VMS-specific.
  8041. --- 1643,1649 ----
  8042.   ';
  8043.   }
  8044.   
  8045. ! =item dist_core (override)
  8046.   
  8047.   Syntax for invoking F<VMS_Share> differs from that for Unix F<shar>,
  8048.   so C<shdist> target actions are VMS-specific.
  8049. ***************
  8050. *** 1720,1729 ****
  8051.   
  8052.   sub dist_core {
  8053.       my($self) = @_;
  8054. -     unless (ref $self){
  8055. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8056. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8057. -     }
  8058.   q[
  8059.   dist : $(DIST_DEFAULT)
  8060.       ].$self->{NOECHO}.q[$(PERL) -le "print 'Warning: $m older than $vf' if -e ($vf = '$(VERSION_FROM)') && -M $vf < -M ($m = '$(MAKEFILE)'"
  8061. --- 1652,1657 ----
  8062. ***************
  8063. *** 1737,1742 ****
  8064. --- 1665,1678 ----
  8065.       $(RM_RF) $(DISTVNAME)
  8066.       $(POSTOP)
  8067.   
  8068. + $(DISTVNAME).tar$(SUFFIX) : distdir
  8069. +     $(PREOP)
  8070. +     $(TO_UNIX)
  8071. +     $(TAR) "$(TARFLAGS)" $(DISTVNAME).tar $(SRC)
  8072. +     $(RM_RF) $(DISTVNAME)
  8073. +     $(COMPRESS) $(DISTVNAME).tar
  8074. +     $(POSTOP)
  8075.   shdist : distdir
  8076.       $(PREOP)
  8077.       $(SHARE) $(SRC) $(DISTVNAME).share
  8078. ***************
  8079. *** 1753,1762 ****
  8080.   
  8081.   sub dist_dir {
  8082.       my($self) = @_;
  8083. -     unless (ref $self){
  8084. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8085. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8086. -     }
  8087.   q{
  8088.   distdir :
  8089.       $(RM_RF) $(DISTVNAME)
  8090. --- 1689,1694 ----
  8091. ***************
  8092. *** 1774,1783 ****
  8093.   
  8094.   sub dist_test {
  8095.       my($self) = @_;
  8096. -     unless (ref $self){
  8097. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8098. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8099. -     }
  8100.   q{
  8101.   disttest : distdir
  8102.       startdir = F$Environment("Default")
  8103. --- 1706,1711 ----
  8104. ***************
  8105. *** 1800,1809 ****
  8106.   
  8107.   sub install {
  8108.       my($self, %attribs) = @_;
  8109. -     unless (ref $self){
  8110. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8111. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8112. -     }
  8113.       my(@m,@docfiles);
  8114.   
  8115.       if ($self->{EXE_FILES}) {
  8116. --- 1728,1733 ----
  8117. ***************
  8118. *** 1849,1855 ****
  8119.       ].$self->{NOECHO}.q[$(PERL) -e "print 'write ].$self->catfile('$(INSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q[ '" >>.MM_tmp
  8120.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_LIB) $(INSTALLPRIVLIB) '" >>.MM_tmp
  8121.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_ARCHLIB) $(INSTALLARCHLIB) '" >>.MM_tmp
  8122. !     ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_EXE) $(INSTALLBIN) '" >>.MM_tmp
  8123.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_MAN1DIR) $(INSTALLMAN1DIR) '" >>.MM_tmp
  8124.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_MAN3DIR) $(INSTALLMAN3DIR) '" >>.MM_tmp
  8125.       $(MOD_INSTALL) <.MM_tmp
  8126. --- 1773,1780 ----
  8127.       ].$self->{NOECHO}.q[$(PERL) -e "print 'write ].$self->catfile('$(INSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q[ '" >>.MM_tmp
  8128.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_LIB) $(INSTALLPRIVLIB) '" >>.MM_tmp
  8129.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_ARCHLIB) $(INSTALLARCHLIB) '" >>.MM_tmp
  8130. !     ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_BIN) $(INSTALLBIN) '" >>.MM_tmp
  8131. !     ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_SCRIPT) $(INSTALLSCRIPT) '" >>.MM_tmp
  8132.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_MAN1DIR) $(INSTALLMAN1DIR) '" >>.MM_tmp
  8133.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_MAN3DIR) $(INSTALLMAN3DIR) '" >>.MM_tmp
  8134.       $(MOD_INSTALL) <.MM_tmp
  8135. ***************
  8136. *** 1862,1868 ****
  8137.       ].$self->{NOECHO}.q[$(PERL) -e "print 'write ].$self->catfile('$(INSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q[ '" >>.MM_tmp
  8138.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_LIB) $(INSTALLSITELIB) '" >>.MM_tmp
  8139.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_ARCHLIB) $(INSTALLSITEARCH) '" >>.MM_tmp
  8140. !     ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_EXE) $(INSTALLBIN) '" >>.MM_tmp
  8141.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_MAN1DIR) $(INSTALLMAN1DIR) '" >>.MM_tmp
  8142.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_MAN3DIR) $(INSTALLMAN3DIR) '" >>.MM_tmp
  8143.       $(MOD_INSTALL) <.MM_tmp
  8144. --- 1787,1794 ----
  8145.       ].$self->{NOECHO}.q[$(PERL) -e "print 'write ].$self->catfile('$(INSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q[ '" >>.MM_tmp
  8146.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_LIB) $(INSTALLSITELIB) '" >>.MM_tmp
  8147.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_ARCHLIB) $(INSTALLSITEARCH) '" >>.MM_tmp
  8148. !     ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_BIN) $(INSTALLBIN) '" >>.MM_tmp
  8149. !     ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_SCRIPT) $(INSTALLSCRIPT) '" >>.MM_tmp
  8150.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_MAN1DIR) $(INSTALLMAN1DIR) '" >>.MM_tmp
  8151.       ].$self->{NOECHO}.q[$(PERL) -e "print '$(INST_MAN3DIR) $(INSTALLMAN3DIR) '" >>.MM_tmp
  8152.       $(MOD_INSTALL) <.MM_tmp
  8153. ***************
  8154. *** 1912,1921 ****
  8155.   
  8156.   sub perldepend {
  8157.       my($self) = @_;
  8158. -     unless (ref $self){
  8159. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8160. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8161. -     }
  8162.       my(@m);
  8163.   
  8164.       push @m, '
  8165. --- 1838,1843 ----
  8166. ***************
  8167. *** 1970,1979 ****
  8168.   
  8169.   sub makefile {
  8170.       my($self) = @_;
  8171. -     unless (ref $self){
  8172. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8173. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8174. -     }
  8175.       my(@m,@cmd);
  8176.       # We do not know what target was originally specified so we
  8177.       # must force a manual rerun to be sure. But as it should only
  8178. --- 1892,1897 ----
  8179. ***************
  8180. *** 2006,2020 ****
  8181.   
  8182.   sub test {
  8183.       my($self, %attribs) = @_;
  8184. -     unless (ref $self){
  8185. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8186. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8187. -     }
  8188.       my($tests) = $attribs{TESTS} || ( -d 't' ? 't/*.t' : '');
  8189.       my(@m);
  8190.       push @m,"
  8191.   TEST_VERBOSE = 0
  8192.   TEST_TYPE = test_\$(LINKTYPE)
  8193.   
  8194.   test :: \$(TEST_TYPE)
  8195.       \$(NOOP)
  8196. --- 1924,1936 ----
  8197.   
  8198.   sub test {
  8199.       my($self, %attribs) = @_;
  8200.       my($tests) = $attribs{TESTS} || ( -d 't' ? 't/*.t' : '');
  8201.       my(@m);
  8202.       push @m,"
  8203.   TEST_VERBOSE = 0
  8204.   TEST_TYPE = test_\$(LINKTYPE)
  8205. + TEST_FILE = test.pl
  8206. + TESTDB_SW = -d
  8207.   
  8208.   test :: \$(TEST_TYPE)
  8209.       \$(NOOP)
  8210. ***************
  8211. *** 2038,2048 ****
  8212.       push(@m, "    \$(NOOP)\n") if (!$tests && ! -f "test.pl");
  8213.       push(@m, "\n");
  8214.   
  8215. !     if (-f 'test.pl') {
  8216. !     push(@m, "testdb_dynamic :: pure_all\n");
  8217. !     push(@m, $self->test_via_script('$(FULLPERL) -d', 'test.pl'));
  8218. !     push(@m, "\n");
  8219. !     }
  8220.   
  8221.       # Occasionally we may face this degenerate target:
  8222.       push @m, "test_ : test_dynamic\n\n";
  8223. --- 1954,1962 ----
  8224.       push(@m, "    \$(NOOP)\n") if (!$tests && ! -f "test.pl");
  8225.       push(@m, "\n");
  8226.   
  8227. !     push(@m, "testdb_dynamic :: pure_all\n");
  8228. !     push(@m, $self->test_via_script('$(FULLPERL) "$(TESTDB_SW)"', '$(TEST_FILE)'));
  8229. !     push(@m, "\n");
  8230.   
  8231.       # Occasionally we may face this degenerate target:
  8232.       push @m, "test_ : test_dynamic\n\n";
  8233. ***************
  8234. *** 2050,2062 ****
  8235.       if ($self->needs_linking()) {
  8236.       push(@m, "test_static :: pure_all \$(MAP_TARGET)\n");
  8237.       push(@m, $self->test_via_harness('$(MAP_TARGET)', $tests)) if $tests;
  8238. !     if (-f 'test.pl') {
  8239. !         push(@m, $self->test_via_script('$(MAP_TARGET)', 'test.pl'));
  8240. !         push(@m, "testdb_static :: pure_all \$(MAP_TARGET)\n");
  8241. !         push(@m, $self->test_via_script('$(MAP_TARGET) -d', 'test.pl'));
  8242. !         push(@m, "\n");
  8243. !     }
  8244. !     push(@m, "\t$self->{NOECHO}\$(NOOP)\n") if (!$tests && ! -f "test.pl");
  8245.       push(@m, "\n");
  8246.       }
  8247.       else {
  8248. --- 1964,1973 ----
  8249.       if ($self->needs_linking()) {
  8250.       push(@m, "test_static :: pure_all \$(MAP_TARGET)\n");
  8251.       push(@m, $self->test_via_harness('$(MAP_TARGET)', $tests)) if $tests;
  8252. !     push(@m, $self->test_via_script('$(MAP_TARGET)', 'test.pl')) if -f 'test.pl';
  8253. !     push(@m, "\n");
  8254. !     push(@m, "testdb_static :: pure_all \$(MAP_TARGET)\n");
  8255. !     push(@m, $self->test_via_script('$(MAP_TARGET) $(TESTDB_SW)', '$(TEST_FILE)'));
  8256.       push(@m, "\n");
  8257.       }
  8258.       else {
  8259. ***************
  8260. *** 2075,2084 ****
  8261.   
  8262.   sub test_via_harness {
  8263.       my($self,$perl,$tests) = @_;
  8264. -     unless (ref $self){
  8265. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8266. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8267. -     }
  8268.       "    $perl".' "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" "-I$(PERL_LIB)" "-I$(PERL_ARCHLIB)" \\'."\n\t".
  8269.       '-e "use Test::Harness qw(&runtests $verbose); $verbose=$(TEST_VERBOSE); runtests @ARGV;" \\'."\n\t$tests\n";
  8270.   }
  8271. --- 1986,1991 ----
  8272. ***************
  8273. *** 2091,2100 ****
  8274.   
  8275.   sub test_via_script {
  8276.       my($self,$perl,$script) = @_;
  8277. -     unless (ref $self){
  8278. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8279. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8280. -     }
  8281.       "    $perl".' "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" '.$script.'
  8282.   ';
  8283.   }
  8284. --- 1998,2003 ----
  8285. ***************
  8286. *** 2110,2119 ****
  8287.   
  8288.   sub makeaperl {
  8289.       my($self, %attribs) = @_;
  8290. -     unless (ref $self){
  8291. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8292. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8293. -     }
  8294.       my($makefilename, $searchdirs, $static, $extra, $perlinc, $target, $tmp, $libperl) = 
  8295.         @attribs{qw(MAKE DIRS STAT EXTRA INCL TARGET TMP LIBPERL)};
  8296.       my(@m);
  8297. --- 2013,2018 ----
  8298. ***************
  8299. *** 2158,2163 ****
  8300. --- 2057,2096 ----
  8301.       File::Find::find(sub {
  8302.       return unless m/\Q$self->{LIB_EXT}\E$/;
  8303.       return if m/^libperl/;
  8304. +     if( exists $self->{INCLUDE_EXT} ){
  8305. +         my $found = 0;
  8306. +         my $incl;
  8307. +         my $xx;
  8308. +         ($xx = $File::Find::name) =~ s,.*?/auto/,,;
  8309. +         $xx =~ s,/?$_,,;
  8310. +         $xx =~ s,/,::,g;
  8311. +         # Throw away anything not explicitly marked for inclusion.
  8312. +         # DynaLoader is implied.
  8313. +         foreach $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){
  8314. +             if( $xx eq $incl ){
  8315. +                 $found++;
  8316. +                 last;
  8317. +             }
  8318. +         }
  8319. +         return unless $found;
  8320. +     }
  8321. +     elsif( exists $self->{EXCLUDE_EXT} ){
  8322. +         my $excl;
  8323. +         my $xx;
  8324. +         ($xx = $File::Find::name) =~ s,.*?/auto/,,;
  8325. +         $xx =~ s,/?$_,,;
  8326. +         $xx =~ s,/,::,g;
  8327. +         # Throw away anything explicitly marked for exclusion
  8328. +         foreach $excl (@{$self->{EXCLUDE_EXT}}){
  8329. +             return if( $xx eq $excl );
  8330. +         }
  8331. +     }
  8332.       $olbs{$ENV{DEFAULT}} = $_;
  8333.       }, grep( -d $_, @{$searchdirs || []}));
  8334.   
  8335. ***************
  8336. *** 2295,2304 ****
  8337.   
  8338.   sub ext {
  8339.       my($self) = @_;
  8340. -     unless (ref $self){
  8341. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8342. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8343. -     }
  8344.       '','','';
  8345.   }
  8346.   
  8347. --- 2228,2233 ----
  8348. ***************
  8349. *** 2315,2324 ****
  8350.   sub nicetext {
  8351.   
  8352.       my($self,$text) = @_;
  8353. -     unless (ref $self){
  8354. -     ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
  8355. -     $self = $ExtUtils::MakeMaker::Parent[-1];
  8356. -     }
  8357.       $text =~ s/([^\s:])(:+\s)/$1 $2/gs;
  8358.       $text;
  8359.   }
  8360. --- 2244,2249 ----
  8361. ***************
  8362. *** 2326,2328 ****
  8363. --- 2251,2254 ----
  8364.   1;
  8365.   
  8366.   __END__
  8367.  
  8368.  
  8369. #: lib/ExtUtils/MakeMaker.pm
  8370. #:   Update to MakeMaker 5.34
  8371. diff -crN perl5.002_01/lib/ExtUtils/MakeMaker.pm perl5.003/lib/ExtUtils/MakeMaker.pm
  8372. *** perl5.002_01/lib/ExtUtils/MakeMaker.pm    Mon Mar 25 01:04:16 1996
  8373. --- perl5.003/lib/ExtUtils/MakeMaker.pm    Sun Jun 23 20:52:43 1996
  8374. ***************
  8375. *** 1,25 ****
  8376. ! require 5.002; # MakeMaker 5.17 was the last MakeMaker that was compatible with perl5.001m
  8377. ! package main;
  8378. ! use vars qw(%att);
  8379. ! package ExtUtils::MakeMaker::TieAtt;
  8380. ! # this package will go away again, when we don't have modules around
  8381. ! # anymore that import %att It ties an empty %att and records in which
  8382. ! # object this %att was tied. FETCH and STORE return/store-to the
  8383. ! # appropriate value from %$self
  8384. ! # the warndirectuse method warns if somebody calls MM->something. It
  8385. ! # has nothing to do with the tie'd %att.
  8386. ! $Enough_limit = 5;
  8387.   
  8388.   package ExtUtils::MakeMaker;
  8389.   
  8390. ! $Version = $VERSION = "5.26";
  8391. ! $Version_OK = "5.05";    # Makefiles older than $Version_OK will die
  8392.               # (Will be checked from MakeMaker version 4.13 onwards)
  8393. ! ($Revision = substr(q$Revision: 1.187 $, 10)) =~ s/\s+$//;
  8394.   
  8395.   
  8396.   
  8397. --- 1,11 ----
  8398. ! BEGIN {require 5.002;} # MakeMaker 5.17 was the last MakeMaker that was compatible with perl5.001m
  8399.   
  8400.   package ExtUtils::MakeMaker;
  8401.   
  8402. ! $Version = $VERSION = "5.34";
  8403. ! $Version_OK = "5.17";    # Makefiles older than $Version_OK will die
  8404.               # (Will be checked from MakeMaker version 4.13 onwards)
  8405. ! ($Revision = substr(q$Revision: 1.202 $, 10)) =~ s/\s+$//;
  8406.   
  8407.   
  8408.   
  8409. ***************
  8410. *** 29,42 ****
  8411.   #use FileHandle ();
  8412.   
  8413.   use vars qw(
  8414. !         $VERSION $Version_OK $Revision
  8415. !         $Verbose %MM_Sections $ISA_TTY
  8416. !         @MM_Sections %Recognized_Att_Keys @Get_from_Config
  8417. !         %Prepend_dot_dot %Config @Parent %NORMAL_INC
  8418. !         $Setup_done %Keep_after_flush
  8419. !         @Overridable
  8420.          );
  8421. ! #use strict qw(refs);
  8422.   
  8423.   eval {require DynaLoader;};    # Get mod2fname, if defined. Will fail
  8424.                                   # with miniperl.
  8425. --- 15,29 ----
  8426.   #use FileHandle ();
  8427.   
  8428.   use vars qw(
  8429. !         @ISA @EXPORT @EXPORT_OK $AUTOLOAD
  8430. !         $ISA_TTY $Is_Mac $Is_OS2 $Is_VMS $Revision $Setup_done
  8431. !         $VERSION $Verbose $Version_OK %Config %Keep_after_flush
  8432. !         %MM_Sections %Prepend_dot_dot %Recognized_Att_Keys
  8433. !         @Get_from_Config @MM_Sections @Overridable @Parent
  8434.          );
  8435. ! # use strict;
  8436.   
  8437.   eval {require DynaLoader;};    # Get mod2fname, if defined. Will fail
  8438.                                   # with miniperl.
  8439. ***************
  8440. *** 48,54 ****
  8441.   @ISA = qw(Exporter);
  8442.   @EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
  8443.   @EXPORT_OK = qw($VERSION &Version_check &neatvalue &mkbootstrap &mksymlists
  8444. !         $Version %att);  ## Import of %att is deprecated, please use OO features!
  8445.           # $Version in mixed case will go away!
  8446.   
  8447.   #
  8448. --- 35,41 ----
  8449.   @ISA = qw(Exporter);
  8450.   @EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
  8451.   @EXPORT_OK = qw($VERSION &Version_check &neatvalue &mkbootstrap &mksymlists
  8452. !         $Version);
  8453.           # $Version in mixed case will go away!
  8454.   
  8455.   #
  8456. ***************
  8457. *** 66,72 ****
  8458.   #
  8459.   {
  8460.       package MY;
  8461. !     @ISA = qw(MM);
  8462.       package MM;
  8463.       sub DESTROY {}
  8464.   }
  8465. --- 53,60 ----
  8466.   #
  8467.   {
  8468.       package MY;
  8469. !     @MY::ISA = qw(MM);
  8470. ! ###    sub AUTOLOAD { use Devel::Symdump; print Devel::Symdump->rnew->as_string; Carp::confess "hey why? $AUTOLOAD" }
  8471.       package MM;
  8472.       sub DESTROY {}
  8473.   }
  8474. ***************
  8475. *** 80,107 ****
  8476.   # Now we can can pull in the friends
  8477.   #
  8478.   $Is_VMS = $^O eq 'VMS';
  8479. ! $Is_OS2 = $^O eq 'os2';
  8480.   
  8481.   require ExtUtils::MM_Unix;
  8482.   
  8483.   if ($Is_VMS) {
  8484.       require ExtUtils::MM_VMS;
  8485.   }
  8486.   if ($Is_OS2) {
  8487.       require ExtUtils::MM_OS2;
  8488.   }
  8489. ! %NORMAL_INC = %INC;
  8490. ! @NORMAL_INC{qw|File/Find.pm Cwd.pm ExtUtils/Manifest.pm ExtUtils/Liblist.pm|} = (1) x 4;
  8491. ! # This has to go one day...
  8492. ! $SIG{__WARN__} = sub {
  8493. !     $_[0] =~ /^Use of uninitialized value/ && return;
  8494. !     $_[0] =~ /used only once/ && return;
  8495. !     $_[0] =~ /^Subroutine\s+[\w:]+\s+redefined/ && return;
  8496. !     warn @_;
  8497. ! };
  8498.   
  8499.   # The SelfLoader would bring a lot of overhead for MakeMaker, because
  8500.   # we know for sure we will use most of the autoloaded functions once
  8501. --- 68,88 ----
  8502.   # Now we can can pull in the friends
  8503.   #
  8504.   $Is_VMS = $^O eq 'VMS';
  8505. ! $Is_OS2 = $^O =~ m|^os/?2$|i;
  8506. ! $Is_Mac = $^O eq 'MacOS';
  8507.   
  8508.   require ExtUtils::MM_Unix;
  8509.   
  8510.   if ($Is_VMS) {
  8511.       require ExtUtils::MM_VMS;
  8512. +     require VMS::Filespec; # is a noop as long as we require it within MM_VMS
  8513.   }
  8514.   if ($Is_OS2) {
  8515.       require ExtUtils::MM_OS2;
  8516.   }
  8517. ! if ($Is_Mac) {
  8518. !     require ExtUtils::MM_Mac;
  8519. ! }
  8520.   
  8521.   # The SelfLoader would bring a lot of overhead for MakeMaker, because
  8522.   # we know for sure we will use most of the autoloaded functions once
  8523. ***************
  8524. *** 110,119 ****
  8525.   sub AUTOLOAD {
  8526.       my $code;
  8527.       if (defined fileno(DATA)) {
  8528. !     while (<DATA>) {
  8529. !         last if /^__END__/;
  8530. !         $code .= $_;
  8531. !     }
  8532.       close DATA;
  8533.       eval $code;
  8534.       if ($@) {
  8535. --- 91,102 ----
  8536.   sub AUTOLOAD {
  8537.       my $code;
  8538.       if (defined fileno(DATA)) {
  8539. !     my $fh = select DATA;
  8540. !     my $o = $/;            # For future reads from the file.
  8541. !     $/ = "\n__END__\n";
  8542. !     $code = <DATA>;
  8543. !     $/ = $o;
  8544. !     select $fh;
  8545.       close DATA;
  8546.       eval $code;
  8547.       if ($@) {
  8548. ***************
  8549. *** 143,148 ****
  8550. --- 126,138 ----
  8551.       unless $checkversion == $VERSION;
  8552.   }
  8553.   
  8554. + sub warnhandler {
  8555. +     $_[0] =~ /^Use of uninitialized value/ && return;
  8556. +     $_[0] =~ /used only once/ && return;
  8557. +     $_[0] =~ /^Subroutine\s+[\w:]+\s+redefined/ && return;
  8558. +     warn @_;
  8559. + }
  8560.   sub ExtUtils::MakeMaker::eval_in_subdirs ;
  8561.   sub ExtUtils::MakeMaker::eval_in_x ;
  8562.   sub ExtUtils::MakeMaker::full_setup ;
  8563. ***************
  8564. *** 160,178 ****
  8565.   sub ExtUtils::MakeMaker::selfdocument ;
  8566.   sub ExtUtils::MakeMaker::WriteMakefile ;
  8567.   sub ExtUtils::MakeMaker::prompt ;
  8568. - sub ExtUtils::MakeMaker::TieAtt::TIEHASH ;
  8569. - sub ExtUtils::MakeMaker::TieAtt::FETCH ;
  8570. - sub ExtUtils::MakeMaker::TieAtt::STORE ;
  8571. - sub ExtUtils::MakeMaker::TieAtt::FIRSTKEY ;
  8572. - sub ExtUtils::MakeMaker::TieAtt::NEXTKEY ;
  8573. - sub ExtUtils::MakeMaker::TieAtt::DESTROY ;
  8574. - sub ExtUtils::MakeMaker::TieAtt::warndirectuse ;
  8575.   
  8576. ! __DATA__
  8577.   package ExtUtils::MakeMaker;
  8578.   
  8579.   sub WriteMakefile {
  8580.       Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
  8581.       unless ($Setup_done++){
  8582.       full_setup();
  8583.       undef &ExtUtils::MakeMaker::full_setup; #safe memory
  8584. --- 150,164 ----
  8585.   sub ExtUtils::MakeMaker::selfdocument ;
  8586.   sub ExtUtils::MakeMaker::WriteMakefile ;
  8587.   sub ExtUtils::MakeMaker::prompt ;
  8588.   
  8589. ! 1;
  8590. ! #__DATA__
  8591.   package ExtUtils::MakeMaker;
  8592.   
  8593.   sub WriteMakefile {
  8594.       Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
  8595. +     local $SIG{__WARN__} = \&warnhandler;
  8596.       unless ($Setup_done++){
  8597.       full_setup();
  8598.       undef &ExtUtils::MakeMaker::full_setup; #safe memory
  8599. ***************
  8600. *** 181,200 ****
  8601.       MM->new(\%att)->flush;
  8602.   }
  8603.   
  8604. ! sub prompt {
  8605.       my($mess,$def)=@_;
  8606.       $ISA_TTY = -t STDIN && -t STDOUT ;
  8607.       Carp::confess("prompt function called without an argument") unless defined $mess;
  8608. !     $def = "" unless defined $def;
  8609. !     my $dispdef = "[$def] ";
  8610.       my $ans;
  8611.       if ($ISA_TTY) {
  8612.       local $|=1;
  8613.       print "$mess $dispdef";
  8614. !     chop($ans = <STDIN>);
  8615.       }
  8616. !     return $ans if defined $ans;
  8617. !     return $def;
  8618.   }
  8619.   
  8620.   sub eval_in_subdirs {
  8621. --- 167,185 ----
  8622.       MM->new(\%att)->flush;
  8623.   }
  8624.   
  8625. ! sub prompt ($;$) {
  8626.       my($mess,$def)=@_;
  8627.       $ISA_TTY = -t STDIN && -t STDOUT ;
  8628.       Carp::confess("prompt function called without an argument") unless defined $mess;
  8629. !     my $dispdef = defined $def ? "[$def] " : " ";
  8630. !     $def = defined $def ? $def : "";
  8631.       my $ans;
  8632.       if ($ISA_TTY) {
  8633.       local $|=1;
  8634.       print "$mess $dispdef";
  8635. !     chomp($ans = <STDIN>);
  8636.       }
  8637. !     return $ans || $def;
  8638.   }
  8639.   
  8640.   sub eval_in_subdirs {
  8641. ***************
  8642. *** 224,285 ****
  8643.   #    $fh->close;
  8644.       close FH;
  8645.       eval $eval;
  8646. !     warn "WARNING from evaluation of $dir/Makefile.PL: $@" if $@;
  8647.   }
  8648.   
  8649.   sub full_setup {
  8650.       $Verbose ||= 0;
  8651.       $^W=1;
  8652.   
  8653. ! # package name for the classes into which the first object will be blessed
  8654.       $PACKNAME = "PACK000";
  8655.   
  8656.       @Attrib_help = qw/
  8657.   
  8658.       C CONFIG CONFIGURE DEFINE DIR DISTNAME DL_FUNCS DL_VARS EXE_FILES
  8659. !     NO_VC FIRST_MAKEFILE FULLPERL H INC INSTALLARCHLIB INSTALLBIN
  8660. !     INSTALLDIRS INSTALLMAN1DIR INSTALLMAN3DIR INSTALLPRIVLIB
  8661. !     INSTALLSITEARCH INSTALLSITELIB INST_ARCHLIB INST_EXE INST_LIB
  8662. !     INST_MAN1DIR INST_MAN3DIR LDFROM LIBPERL_A LIBS LINKTYPE MAKEAPERL
  8663. !     MAKEFILE MAN1PODS MAN3PODS MAP_TARGET MYEXTLIB NAME NEEDS_LINKING
  8664. !     NOECHO NORECURS OBJECT OPTIMIZE PERL PERLMAINCC PERL_ARCHLIB
  8665. !     PERL_LIB PERL_SRC PL_FILES PM PMLIBDIRS PREFIX PREREQ SKIP
  8666. !     TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG XS_VERSION clean
  8667. !     depend dist dynamic_lib linkext macro realclean tool_autosplit
  8668.   
  8669.       installpm
  8670.   
  8671.       /;
  8672.   
  8673.   
  8674. -     # @Overridable is close to MM_Sections
  8675.   
  8676.       @MM_Sections = 
  8677.       qw(
  8678.   
  8679. !     post_initialize const_config constants tool_autosplit
  8680. !     tool_xsubpp tools_other dist macro depend post_constants
  8681. !     pasthru c_o xs_c xs_o top_targets linkext dlsyms dynamic
  8682. !     dynamic_bs dynamic_lib static static_lib manifypods processPL
  8683. !     installbin subdirs clean realclean dist_basics dist_core
  8684. !     dist_dir dist_test dist_ci install force perldepend makefile
  8685. !     staticmake test postamble
  8686.   
  8687.         ); # loses section ordering
  8688.   
  8689.       @Overridable = @MM_Sections;
  8690. !     push @Overridable, qw[ dir_target
  8691. !                libscan makeaperl
  8692. !                needs_linking subdir_x test_via_harness
  8693. !                test_via_script ];
  8694. !     push @MM_Sections, qw[
  8695. !               pm_to_blib selfdocument cflags const_loadlibs
  8696. !               const_cccmd
  8697.                ];
  8698.   
  8699.   
  8700. !     #### Can we drop this?
  8701. !     #### @MM_Sections{@MM_Sections} = {} x @MM_Sections;
  8702.   
  8703.       # All sections are valid keys.
  8704.       @Recognized_Att_Keys{@MM_Sections} = (1) x @MM_Sections;
  8705. --- 209,294 ----
  8706.   #    $fh->close;
  8707.       close FH;
  8708.       eval $eval;
  8709. !     if ($@) {
  8710. ! #       if ($@ =~ /prerequisites/) {
  8711. ! #           die "MakeMaker WARNING: $@";
  8712. ! #       } else {
  8713. ! #           warn "WARNING from evaluation of $dir/Makefile.PL: $@";
  8714. ! #       }
  8715. !     warn "WARNING from evaluation of $dir/Makefile.PL: $@";
  8716. !     }
  8717.   }
  8718.   
  8719.   sub full_setup {
  8720.       $Verbose ||= 0;
  8721.       $^W=1;
  8722.   
  8723. !     # package name for the classes into which the first object will be blessed
  8724.       $PACKNAME = "PACK000";
  8725.   
  8726.       @Attrib_help = qw/
  8727.   
  8728.       C CONFIG CONFIGURE DEFINE DIR DISTNAME DL_FUNCS DL_VARS EXE_FILES
  8729. !     EXCLUDE_EXT INCLUDE_EXT NO_VC FIRST_MAKEFILE FULLPERL H INC
  8730. !     INSTALLARCHLIB INSTALLBIN INSTALLDIRS INSTALLMAN1DIR
  8731. !     INSTALLMAN3DIR INSTALLPRIVLIB INSTALLSCRIPT INSTALLSITEARCH
  8732. !     INSTALLSITELIB INST_ARCHLIB INST_BIN INST_EXE INST_LIB
  8733. !     INST_MAN1DIR INST_MAN3DIR INST_SCRIPT LDFROM LIBPERL_A LIBS
  8734. !     LINKTYPE MAKEAPERL MAKEFILE MAN1PODS MAN3PODS MAP_TARGET MYEXTLIB
  8735. !     NAME NEEDS_LINKING NOECHO NORECURS OBJECT OPTIMIZE PERL PERLMAINCC
  8736. !     PERL_ARCHLIB PERL_LIB PERL_SRC PL_FILES PM PMLIBDIRS PREFIX
  8737. !     PREREQ_PM SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
  8738. !     XS_VERSION clean depend dist dynamic_lib linkext macro realclean
  8739. !     tool_autosplit
  8740.   
  8741.       installpm
  8742.   
  8743.       /;
  8744.   
  8745. +     # ^^^ installpm is deprecated, will go about Summer 96
  8746. +     # @Overridable is close to @MM_Sections but not identical.  The
  8747. +     # order is important. Many subroutines declare macros. These
  8748. +     # depend on each other. Let's try to collect the macros up front,
  8749. +     # then pasthru, then the rules.
  8750. +     # MM_Sections are the sections we have to call explicitly
  8751. +     # in Overridable we have subroutines that are used indirectly
  8752.   
  8753.   
  8754.       @MM_Sections = 
  8755.       qw(
  8756.   
  8757. !  post_initialize const_config constants tool_autosplit tool_xsubpp
  8758. !  tools_other dist macro depend cflags const_loadlibs const_cccmd
  8759. !  post_constants
  8760. !  pasthru
  8761. !  c_o xs_c xs_o top_targets linkext dlsyms dynamic dynamic_bs
  8762. !  dynamic_lib static static_lib manifypods processPL installbin subdirs
  8763. !  clean realclean dist_basics dist_core dist_dir dist_test dist_ci
  8764. !  install force perldepend makefile staticmake test
  8765.   
  8766.         ); # loses section ordering
  8767.   
  8768.       @Overridable = @MM_Sections;
  8769. !     push @Overridable, qw[
  8770. !  dir_target libscan makeaperl needs_linking subdir_x test_via_harness
  8771. !  test_via_script
  8772.                ];
  8773.   
  8774. +     push @MM_Sections, qw[
  8775. +  pm_to_blib selfdocument
  8776.   
  8777. !              ];
  8778. !     # Postamble needs to be the last that was always the case
  8779. !     push @MM_Sections, "postamble";
  8780. !     push @Overridable, "postamble";
  8781.   
  8782.       # All sections are valid keys.
  8783.       @Recognized_Att_Keys{@MM_Sections} = (1) x @MM_Sections;
  8784. ***************
  8785. *** 308,315 ****
  8786.       #
  8787.       %Prepend_dot_dot = 
  8788.       qw(
  8789. !        INST_LIB 1 INST_ARCHLIB 1 INST_EXE 1 MAP_TARGET 1 INST_MAN1DIR 1 INST_MAN3DIR 1
  8790. !        PERL_SRC 1 PERL 1 FULLPERL 1
  8791.         );
  8792.   
  8793.       my @keep = qw/
  8794. --- 317,327 ----
  8795.       #
  8796.       %Prepend_dot_dot = 
  8797.       qw(
  8798. !        INST_BIN 1 INST_EXE 1 INST_LIB 1 INST_ARCHLIB 1 INST_SCRIPT
  8799. !        1 MAP_TARGET 1 INST_MAN1DIR 1 INST_MAN3DIR 1 PERL_SRC 1
  8800. !        PERL 1 FULLPERL 1
  8801.         );
  8802.   
  8803.       my @keep = qw/
  8804. ***************
  8805. *** 353,358 ****
  8806. --- 365,400 ----
  8807.   
  8808.       my(%initial_att) = %$self; # record initial attributes
  8809.   
  8810. +     my($prereq);
  8811. +     foreach $prereq (sort keys %{$self->{PREREQ_PM}}) {
  8812. +     my $eval = "use $prereq $self->{PREREQ_PM}->{$prereq}";
  8813. +     eval $eval;
  8814. +     if ($@){
  8815. +         warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found";
  8816. +     } else {
  8817. +         delete $self->{PREREQ_PM}{$prereq};
  8818. +     }
  8819. +     }
  8820. + #    if (@unsatisfied){
  8821. + #       unless (defined $ExtUtils::MakeMaker::useCPAN) {
  8822. + #           print qq{MakeMaker WARNING: prerequisites not found (@unsatisfied)
  8823. + # Please install these modules first and rerun 'perl Makefile.PL'.\n};
  8824. + #           if ($ExtUtils::MakeMaker::hasCPAN) {
  8825. + #           $ExtUtils::MakeMaker::useCPAN = prompt(qq{Should I try to use the CPAN module to fetch them for you?},"yes");
  8826. + #           } else {
  8827. + #           print qq{Hint: You may want to install the CPAN module to autofetch the needed modules\n};
  8828. + #           $ExtUtils::MakeMaker::useCPAN=0;
  8829. + #           }
  8830. + #       }
  8831. + #       if ($ExtUtils::MakeMaker::useCPAN) {
  8832. + #           require CPAN;
  8833. + #           CPAN->import(@unsatisfied);
  8834. + #       } else {
  8835. + #           die qq{prerequisites not found (@unsatisfied)};
  8836. + #       }
  8837. + #    warn qq{WARNING: prerequisites not found (@unsatisfied)};
  8838. + #    }
  8839.       if (defined $self->{CONFIGURE}) {
  8840.       if (ref $self->{CONFIGURE} eq 'CODE') {
  8841.           $self = { %$self, %{&{$self->{CONFIGURE}}}};
  8842. ***************
  8843. *** 457,463 ****
  8844.       $self->eval_in_subdirs if @{$self->{DIR}};
  8845.       }
  8846.   
  8847. -     tie %::att, ExtUtils::MakeMaker::TieAtt, $self;
  8848.       my $section;
  8849.       foreach $section ( @MM_Sections ){
  8850.       print "Processing Makefile '$section' section\n" if ($Verbose >= 2);
  8851. --- 499,504 ----
  8852. ***************
  8853. *** 551,562 ****
  8854. --- 592,612 ----
  8855.       # have to build a list with the shell
  8856.       $self->{DIR} = [grep $_, split ":", $self->{DIR}];
  8857.       }
  8858. +     # Turn a INCLUDE_EXT argument on the command line into an array
  8859. +     if (defined $self->{INCLUDE_EXT} && ref \$self->{INCLUDE_EXT} eq 'SCALAR') {
  8860. +     $self->{INCLUDE_EXT} = [grep $_, split '\s+', $self->{INCLUDE_EXT}];
  8861. +     }
  8862. +     # Turn a EXCLUDE_EXT argument on the command line into an array
  8863. +     if (defined $self->{EXCLUDE_EXT} && ref \$self->{EXCLUDE_EXT} eq 'SCALAR') {
  8864. +     $self->{EXCLUDE_EXT} = [grep $_, split '\s+', $self->{EXCLUDE_EXT}];
  8865. +     }
  8866.       my $mmkey;
  8867.       foreach $mmkey (sort keys %$self){
  8868.       print STDOUT "    $mmkey => ", neatvalue($self->{$mmkey}), "\n" if $Verbose;
  8869.       print STDOUT "'$mmkey' is not a known MakeMaker parameter name.\n"
  8870.           unless exists $Recognized_Att_Keys{$mmkey};
  8871.       }
  8872. +     $| = 1 if $Verbose;
  8873.   }
  8874.   
  8875.   sub check_hints {
  8876. ***************
  8877. *** 567,573 ****
  8878.   
  8879.       # First we look for the best hintsfile we have
  8880.       my(@goodhints);
  8881. !     my($hint)="$Config{osname}_$Config{osvers}";
  8882.       $hint =~ s/\./_/g;
  8883.       $hint =~ s/_$//;
  8884.       return unless $hint;
  8885. --- 617,623 ----
  8886.   
  8887.       # First we look for the best hintsfile we have
  8888.       my(@goodhints);
  8889. !     my($hint)="${^O}_$Config{osvers}";
  8890.       $hint =~ s/\./_/g;
  8891.       $hint =~ s/_$//;
  8892.       return unless $hint;
  8893. ***************
  8894. *** 630,636 ****
  8895.       # %MY:: being intact, we have to fill the hole with an
  8896.       # inheriting method:
  8897.   
  8898. !     eval "package MY; sub $method {local *$method; shift->MY::$method(\@_); }";
  8899.       }
  8900.   
  8901.       # We have to clean out %INC also, because the current directory is
  8902. --- 680,686 ----
  8903.       # %MY:: being intact, we have to fill the hole with an
  8904.       # inheriting method:
  8905.   
  8906. !     eval "package MY; sub $method { shift->SUPER::$method(\@_); }";
  8907.       }
  8908.   
  8909.       # We have to clean out %INC also, because the current directory is
  8910. ***************
  8911. *** 638,650 ****
  8912.       # out of a History.pl file which is "required" so woudn't get
  8913.       # loaded again in another extension requiring a History.pl
  8914.   
  8915. !     my $inc;
  8916. !     foreach $inc (keys %INC) {
  8917. !     next if $NORMAL_INC{$inc};
  8918. !     #warn "***$inc*** deleted";
  8919. !     delete $INC{$inc};
  8920. !     }
  8921.   }
  8922.   
  8923.   sub skipcheck {
  8924. --- 688,705 ----
  8925.       # out of a History.pl file which is "required" so woudn't get
  8926.       # loaded again in another extension requiring a History.pl
  8927.   
  8928. !     # With perl5.002_01 the deletion of entries in %INC caused Tk-b11
  8929. !     # to core dump in the middle of a require statement. The required
  8930. !     # file was Tk/MMutil.pm.  The consequence is, we have to be
  8931. !     # extremely careful when we try to give perl a reason to reload a
  8932. !     # library with same name.  The workaround prefers to drop nothing
  8933. !     # from %INC and teach the writers not to use such libraries.
  8934. ! #    my $inc;
  8935. ! #    foreach $inc (keys %INC) {
  8936. ! #    #warn "***$inc*** deleted";
  8937. ! #    delete $INC{$inc};
  8938. ! #    }
  8939.   }
  8940.   
  8941.   sub skipcheck {
  8942. ***************
  8943. *** 764,816 ****
  8944.       join "\n", @m;
  8945.   }
  8946.   
  8947. - package ExtUtils::MakeMaker::TieAtt;
  8948. - sub TIEHASH {
  8949. -     bless { SECRETHASH => $_[1]};
  8950. - }
  8951. - sub FETCH {
  8952. -     print "Warning (non-fatal): Importing of %att is deprecated [$_[1]]
  8953. -     use \$self instead\n" unless ++$Enough>$Enough_limit;
  8954. -     print "Further ExtUtils::MakeMaker::TieAtt warnings suppressed\n" if $Enough==$Enough_limit;
  8955. -     $_[0]->{SECRETHASH}->{$_[1]};
  8956. - }
  8957. - sub STORE {
  8958. -     print "Warning (non-fatal): Importing of %att is deprecated [$_[1]][$_[2]]
  8959. -     use \$self instead\n" unless ++$Enough>$Enough_limit;
  8960. -     print "Further ExtUtils::MakeMaker::TieAtt warnings suppressed\n" if $Enough==$Enough_limit;
  8961. -     $_[0]->{SECRETHASH}->{$_[1]} = $_[2];
  8962. - }
  8963. - sub FIRSTKEY {
  8964. -     print "Warning (non-fatal): Importing of %att is deprecated [FIRSTKEY]
  8965. -     use \$self instead\n" unless ++$Enough>$Enough_limit;
  8966. -     print "Further ExtUtils::MakeMaker::TieAtt warnings suppressed\n" if $Enough==$Enough_limit;
  8967. -     each %{$_[0]->{SECRETHASH}};
  8968. - }
  8969. - sub NEXTKEY {
  8970. -     each %{$_[0]->{SECRETHASH}};
  8971. - }
  8972. - sub DESTROY {
  8973. - }
  8974. - sub warndirectuse {
  8975. -     my($caller) = @_;
  8976. -     return if $Enough>$Enough_limit;
  8977. -     print STDOUT "Warning (non-fatal): Direct use of class methods deprecated; use\n";
  8978. -     my($method) = $caller =~ /.*:(\w+)$/;
  8979. -     print STDOUT
  8980. - '        my $self = shift;
  8981. -         $self->MM::', $method, "();
  8982. -     instead\n";
  8983. -     print "Further ExtUtils::MakeMaker::TieAtt warnings suppressed\n"
  8984. -     if ++$Enough==$Enough_limit;
  8985. - }
  8986.   package ExtUtils::MakeMaker;
  8987.   1;
  8988.   
  8989. --- 819,824 ----
  8990. ***************
  8991. *** 840,929 ****
  8992.   that can be individually overridden.  Each subroutine returns the text
  8993.   it wishes to have written to the Makefile.
  8994.   
  8995. ! =head2 Hintsfile support
  8996. ! MakeMaker.pm uses the architecture specific information from
  8997. ! Config.pm. In addition it evaluates architecture specific hints files
  8998. ! in a C<hints/> directory. The hints files are expected to be named
  8999. ! like their counterparts in C<PERL_SRC/hints>, but with an C<.pl> file
  9000. ! name extension (eg. C<next_3_2.pl>). They are simply C<eval>ed by
  9001. ! MakeMaker within the WriteMakefile() subroutine, and can be used to
  9002. ! execute commands as well as to include special variables. The rules
  9003. ! which hintsfile is chosen are the same as in Configure.
  9004. ! The hintsfile is eval()ed immediately after the arguments given to
  9005. ! WriteMakefile are stuffed into a hash reference $self but before this
  9006. ! reference becomes blessed. So if you want to do the equivalent to
  9007. ! override or create an attribute you would say something like
  9008. !     $self->{LIBS} = ['-ldbm -lucb -lc'];
  9009. ! =head2 What's new in version 5 of MakeMaker
  9010.   
  9011. ! MakeMaker 5 is pure object oriented. This allows us to write an
  9012. ! unlimited number of Makefiles with a single perl process. 'perl
  9013. ! Makefile.PL' with MakeMaker 5 goes through all subdirectories
  9014. ! immediately and evaluates any Makefile.PL found in the next level
  9015. ! subdirectories. The benefit of this approach comes in useful for both
  9016. ! single and multi directories extensions.
  9017.   
  9018. ! Multi directory extensions have an immediately visible speed
  9019. ! advantage, because there's no startup penalty for any single
  9020. ! subdirectory Makefile.
  9021.   
  9022. ! Single directory packages benefit from the much improved
  9023. ! needs_linking() method. As the main Makefile knows everything about
  9024. ! the subdirectories, a needs_linking() method can now query all
  9025. ! subdirectories if there is any linking involved down in the tree. The
  9026. ! speedup for PM-only Makefiles seems to be around 1 second on my
  9027. ! Indy 100 MHz.
  9028.   
  9029. ! =head2 Incompatibilities between MakeMaker 5.00 and 4.23
  9030. ! There are no incompatibilities in the short term, as all changes are
  9031. ! accompanied by short-term workarounds that guarantee full backwards
  9032. ! compatibility.
  9033. ! You are likely to face a few warnings that expose deprecations which
  9034. ! will result in incompatibilities in the long run:
  9035. ! You should not use %att directly anymore. Instead any subroutine you
  9036. ! override in the MY package will be called by the object method, so you
  9037. ! can access all object attributes directly via the object in $_[0].
  9038. ! You should not call the class methos MM->something anymore. Instead
  9039. ! you should call the superclass. Something like
  9040. !     sub MY::constants {
  9041. !         my $self = shift;
  9042. !         $self->MM::constants();
  9043. !     }
  9044. ! Especially the libscan() and exescan() methods should be altered
  9045. ! towards OO programming, that means do not expect that $_ to contain
  9046. ! the path but rather $_[1].
  9047. ! Try to build several extensions simultanously to debug your
  9048. ! Makefile.PL. You can unpack a bunch of distributed packages within one
  9049. ! directory and run
  9050. !     perl -MExtUtils::MakeMaker -e 'WriteMakefile()'
  9051. ! That's actually fun to watch :)
  9052. ! Do not use exit() in your Makefile.PL. MakeMaker tries hard to enable
  9053. ! multi-module builds in one go.
  9054. ! Final suggestion: Try to delete all of your MY:: subroutines and
  9055. ! watch, if you really still need them. MakeMaker might already do what
  9056. ! you want without them. If you see no way to avoid your own subroutine
  9057. ! solution, please let us know about the problem.
  9058.   
  9059.   
  9060.   =head2 Default Makefile Behaviour
  9061.   
  9062. ! The automatically generated Makefile enables the user of the extension
  9063. ! to invoke
  9064.   
  9065.     perl Makefile.PL # optionally "perl Makefile.PL verbose"
  9066.     make
  9067. --- 848,876 ----
  9068.   that can be individually overridden.  Each subroutine returns the text
  9069.   it wishes to have written to the Makefile.
  9070.   
  9071. ! MakeMaker is object oriented. Each directory below the current
  9072. ! directory that contains a Makefile.PL. Is treated as a separate
  9073. ! object. This makes it possible to write an unlimited number of
  9074. ! Makefiles with a single invocation of WriteMakefile().
  9075.   
  9076. ! =head2 How To Write A Makefile.PL
  9077.   
  9078. ! The short answer is: Don't. Run h2xs(1) before you start thinking
  9079. ! about writing a module. For so called pm-only modules that consist of
  9080. ! C<*.pm> files only, h2xs has the very useful C<-X> switch. This will
  9081. ! generate dummy files of all kinds that are useful for the module
  9082. ! developer.
  9083.   
  9084. ! The medium answer is:
  9085.   
  9086. !     use ExtUtils::MakeMaker;
  9087. !     WriteMakefile( NAME => "Foo::Bar" );
  9088.   
  9089. + The long answer is below.
  9090.   
  9091.   =head2 Default Makefile Behaviour
  9092.   
  9093. ! The generated Makefile enables the user of the extension to invoke
  9094.   
  9095.     perl Makefile.PL # optionally "perl Makefile.PL verbose"
  9096.     make
  9097. ***************
  9098. *** 958,968 ****
  9099.   =head2 make install
  9100.   
  9101.   make alone puts all relevant files into directories that are named by
  9102. ! the macros INST_LIB, INST_ARCHLIB, INST_EXE, INST_MAN1DIR, and
  9103. ! INST_MAN3DIR. All these default to something below ./blib if
  9104. ! you are I<not> building below the perl source directory. If you I<are>
  9105.   building below the perl source, INST_LIB and INST_ARCHLIB default to
  9106. !  ../../lib, and INST_EXE is not defined.
  9107.   
  9108.   The I<install> target of the generated Makefile copies the files found
  9109.   below each of the INST_* directories to their INSTALL*
  9110. --- 905,915 ----
  9111.   =head2 make install
  9112.   
  9113.   make alone puts all relevant files into directories that are named by
  9114. ! the macros INST_LIB, INST_ARCHLIB, INST_SCRIPT, INST_MAN1DIR, and
  9115. ! INST_MAN3DIR. All these default to something below ./blib if you are
  9116. ! I<not> building below the perl source directory. If you I<are>
  9117.   building below the perl source, INST_LIB and INST_ARCHLIB default to
  9118. ! ../../lib, and INST_SCRIPT is not defined.
  9119.   
  9120.   The I<install> target of the generated Makefile copies the files found
  9121.   below each of the INST_* directories to their INSTALL*
  9122. ***************
  9123. *** 974,980 ****
  9124.   
  9125.       INST_ARCHLIB    INSTALLARCHLIB    INSTALLSITEARCH
  9126.       INST_LIB        INSTALLPRIVLIB    INSTALLSITELIB
  9127. !     INST_EXE                   INSTALLBIN
  9128.       INST_MAN1DIR             INSTALLMAN1DIR
  9129.       INST_MAN3DIR             INSTALLMAN3DIR
  9130.   
  9131. --- 921,928 ----
  9132.   
  9133.       INST_ARCHLIB    INSTALLARCHLIB    INSTALLSITEARCH
  9134.       INST_LIB        INSTALLPRIVLIB    INSTALLSITELIB
  9135. !     INST_BIN                  INSTALLBIN
  9136. !     INST_SCRIPT              INSTALLSCRIPT
  9137.       INST_MAN1DIR             INSTALLMAN1DIR
  9138.       INST_MAN3DIR             INSTALLMAN3DIR
  9139.   
  9140. ***************
  9141. *** 987,1012 ****
  9142.           sprintf("%20s: %s", $_, $Config{$_}),
  9143.           grep /^install/, keys %Config'
  9144.   
  9145. ! If you don't want to keep the defaults, MakeMaker helps you to
  9146. ! minimize the typing needed: the usual relationship between
  9147. ! INSTALLPRIVLIB and INSTALLARCHLIB is determined by Configure at perl
  9148. ! compilation time. MakeMaker supports the user who sets
  9149. ! INSTALLPRIVLIB. If INSTALLPRIVLIB is set, but INSTALLARCHLIB not, then
  9150. ! MakeMaker defaults the latter to be the same subdirectory of
  9151. ! INSTALLPRIVLIB as Configure decided for the counterparts in %Config ,
  9152. ! otherwise it defaults to INSTALLPRIVLIB. The same relationship holds
  9153. ! for INSTALLSITELIB and INSTALLSITEARCH.
  9154.   
  9155. ! MakeMaker gives you much more freedom than needed to configure
  9156. ! internal variables and get different results. It is worth to mention,
  9157. ! that make(1) also lets you configure most of the variables that are
  9158. ! used in the Makefile. But in the majority of situations this will not
  9159. ! be necessary, and should only be done, if the author of a package
  9160. ! recommends it (or you know what you're doing).
  9161.   
  9162. - =cut
  9163. - #'
  9164.   
  9165.   =head2 PREFIX attribute
  9166.   
  9167. --- 935,945 ----
  9168.           sprintf("%20s: %s", $_, $Config{$_}),
  9169.           grep /^install/, keys %Config'
  9170.   
  9171. ! And to check the sequence in which the library directories are
  9172. ! searched by perl, run
  9173.   
  9174. !     perl -le 'print join $/, @INC'
  9175.   
  9176.   
  9177.   =head2 PREFIX attribute
  9178.   
  9179. ***************
  9180. *** 1023,1029 ****
  9181.   
  9182.   If the user has superuser privileges, and is not working on AFS
  9183.   (Andrew File System) or relatives, then the defaults for
  9184. ! INSTALLPRIVLIB, INSTALLARCHLIB, INSTALLBIN, etc. will be appropriate,
  9185.   and this incantation will be the best:
  9186.   
  9187.       perl Makefile.PL; make; make test
  9188. --- 956,962 ----
  9189.   
  9190.   If the user has superuser privileges, and is not working on AFS
  9191.   (Andrew File System) or relatives, then the defaults for
  9192. ! INSTALLPRIVLIB, INSTALLARCHLIB, INSTALLSCRIPT, etc. will be appropriate,
  9193.   and this incantation will be the best:
  9194.   
  9195.       perl Makefile.PL; make; make test
  9196. ***************
  9197. *** 1040,1046 ****
  9198.   have to do this by calling
  9199.   
  9200.       perl Makefile.PL INSTALLSITELIB=/afs/here/today \
  9201. !     INSTALLBIN=/afs/there/now INSTALLMAN3DIR=/afs/for/manpages
  9202.       make
  9203.   
  9204.   Be careful to repeat this procedure every time you recompile an
  9205. --- 973,979 ----
  9206.   have to do this by calling
  9207.   
  9208.       perl Makefile.PL INSTALLSITELIB=/afs/here/today \
  9209. !     INSTALLSCRIPT=/afs/there/now INSTALLMAN3DIR=/afs/for/manpages
  9210.       make
  9211.   
  9212.   Be careful to repeat this procedure every time you recompile an
  9213. ***************
  9214. *** 1142,1160 ****
  9215.   If perl has not yet been installed then PERL_SRC can be defined on the
  9216.   command line as shown in the previous section.
  9217.   
  9218. - =head2 Useful Default Makefile Macros
  9219. - FULLEXT = Pathname for extension directory (eg DBD/Oracle).
  9220.   
  9221. ! BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
  9222.   
  9223. ! ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)
  9224. ! INST_LIBDIR = C<$(INST_LIB)$(ROOTEXT)>
  9225. ! INST_AUTODIR = C<$(INST_LIB)/auto/$(FULLEXT)>
  9226.   
  9227. ! INST_ARCHAUTODIR = C<$(INST_ARCHLIB)/auto/$(FULLEXT)>
  9228.   
  9229.   =head2 Using Attributes and Parameters
  9230.   
  9231. --- 1075,1099 ----
  9232.   If perl has not yet been installed then PERL_SRC can be defined on the
  9233.   command line as shown in the previous section.
  9234.   
  9235.   
  9236. ! =head2 Which architecture dependent directory?
  9237.   
  9238. ! If you don't want to keep the defaults for the INSTALL* macros,
  9239. ! MakeMaker helps you to minimize the typing needed: the usual
  9240. ! relationship between INSTALLPRIVLIB and INSTALLARCHLIB is determined
  9241. ! by Configure at perl compilation time. MakeMaker supports the user who
  9242. ! sets INSTALLPRIVLIB. If INSTALLPRIVLIB is set, but INSTALLARCHLIB not,
  9243. ! then MakeMaker defaults the latter to be the same subdirectory of
  9244. ! INSTALLPRIVLIB as Configure decided for the counterparts in %Config ,
  9245. ! otherwise it defaults to INSTALLPRIVLIB. The same relationship holds
  9246. ! for INSTALLSITELIB and INSTALLSITEARCH.
  9247.   
  9248. ! MakeMaker gives you much more freedom than needed to configure
  9249. ! internal variables and get different results. It is worth to mention,
  9250. ! that make(1) also lets you configure most of the variables that are
  9251. ! used in the Makefile. But in the majority of situations this will not
  9252. ! be necessary, and should only be done, if the author of a package
  9253. ! recommends it (or you know what you're doing).
  9254.   
  9255.   =head2 Using Attributes and Parameters
  9256.   
  9257. ***************
  9258. *** 1238,1247 ****
  9259.   (linker options) at present.  Defaults to [].  (e.g. [ qw(
  9260.   Foo_version Foo_numstreams Foo_tree ) ])
  9261.   
  9262.   =item EXE_FILES
  9263.   
  9264.   Ref to array of executable files. The files will be copied to the
  9265. ! INST_EXE directory. Make realclean will delete them from there
  9266.   again.
  9267.   
  9268.   =item NO_VC
  9269. --- 1177,1195 ----
  9270.   (linker options) at present.  Defaults to [].  (e.g. [ qw(
  9271.   Foo_version Foo_numstreams Foo_tree ) ])
  9272.   
  9273. + =item EXCLUDE_EXT
  9274. + Array of extension names to exclude when doing a static build.  This
  9275. + is ignored if INCLUDE_EXT is present.  Consult INCLUDE_EXT for more
  9276. + details.  (e.g.  [ qw( Socket POSIX ) ] )
  9277. + This attribute may be most useful when specified as a string on the
  9278. + commandline:  perl Makefile.PL EXCLUDE_EXT='Socket Safe'
  9279.   =item EXE_FILES
  9280.   
  9281.   Ref to array of executable files. The files will be copied to the
  9282. ! INST_SCRIPT directory. Make realclean will delete them from there
  9283.   again.
  9284.   
  9285.   =item NO_VC
  9286. ***************
  9287. *** 1269,1274 ****
  9288. --- 1217,1237 ----
  9289.   
  9290.   Include file dirs eg: C<"-I/usr/5include -I/path/to/inc">
  9291.   
  9292. + =item INCLUDE_EXT
  9293. + Array of extension names to be included when doing a static build.
  9294. + MakeMaker will normally build with all of the installed extensions when
  9295. + doing a static build, and that is usually the desired behavior.  If
  9296. + INCLUDE_EXT is present then MakeMaker will build only with those extensions
  9297. + which are explicitly mentioned. (e.g.  [ qw( Socket POSIX ) ])
  9298. + It is not necessary to mention DynaLoader or the current extension when
  9299. + filling in INCLUDE_EXT.  If the INCLUDE_EXT is mentioned but is empty then
  9300. + only DynaLoader and the current extension will be included in the build.
  9301. + This attribute may be most useful when specified as a string on the
  9302. + commandline:  perl Makefile.PL INCLUDE_EXT='POSIX Socket Devel::Peek'
  9303.   =item INSTALLARCHLIB
  9304.   
  9305.   Used by 'make install', which copies files from INST_ARCHLIB to this
  9306. ***************
  9307. *** 1276,1283 ****
  9308.   
  9309.   =item INSTALLBIN
  9310.   
  9311. ! Used by 'make install' which copies files from INST_EXE to this
  9312. ! directory.
  9313.   
  9314.   =item INSTALLDIRS
  9315.   
  9316. --- 1239,1245 ----
  9317.   
  9318.   =item INSTALLBIN
  9319.   
  9320. ! Directory to install binary files (e.g. tkperl) into.
  9321.   
  9322.   =item INSTALLDIRS
  9323.   
  9324. ***************
  9325. *** 1301,1306 ****
  9326. --- 1263,1273 ----
  9327.   Used by 'make install', which copies files from INST_LIB to this
  9328.   directory if INSTALLDIRS is set to perl.
  9329.   
  9330. + =item INSTALLSCRIPT
  9331. + Used by 'make install' which copies files from INST_SCRIPT to this
  9332. + directory.
  9333.   =item INSTALLSITELIB
  9334.   
  9335.   Used by 'make install', which copies files from INST_LIB to this
  9336. ***************
  9337. *** 1315,1325 ****
  9338.   
  9339.   Same as INST_LIB for architecture dependent files.
  9340.   
  9341.   =item INST_EXE
  9342.   
  9343. ! Directory, where executable scripts should be installed during
  9344. ! 'make'. Defaults to "./blib/bin", just to have a dummy location during
  9345. ! testing. make install will copy the files in INST_EXE to INSTALLBIN.
  9346.   
  9347.   =item INST_LIB
  9348.   
  9349. --- 1282,1296 ----
  9350.   
  9351.   Same as INST_LIB for architecture dependent files.
  9352.   
  9353. + =item INST_BIN
  9354. + Directory to put real binary files during 'make'. These will be copied
  9355. + to INSTALLBIN during 'make install'
  9356.   =item INST_EXE
  9357.   
  9358. ! Old name for INST_SCRIPT. Deprecated. Please use INST_SCRIPT if you
  9359. ! need to use it.
  9360.   
  9361.   =item INST_LIB
  9362.   
  9363. ***************
  9364. *** 1334,1339 ****
  9365. --- 1305,1317 ----
  9366.   
  9367.   Directory to hold the man pages at 'make' time
  9368.   
  9369. + =item INST_SCRIPT
  9370. + Directory, where executable files should be installed during
  9371. + 'make'. Defaults to "./blib/bin", just to have a dummy location during
  9372. + testing. make install will copy the files in INST_SCRIPT to
  9373. + INSTALLSCRIPT.
  9374.   =item LDFROM
  9375.   
  9376.   defaults to "$(OBJECT)" and is used in the ld command to specify
  9377. ***************
  9378. *** 1421,1427 ****
  9379.   
  9380.   =item NOECHO
  9381.   
  9382. ! Defaults the C<@>. By setting it to an empty string you can generate a
  9383.   Makefile that echos all commands. Mainly used in debugging MakeMaker
  9384.   itself.
  9385.   
  9386. --- 1399,1405 ----
  9387.   
  9388.   =item NOECHO
  9389.   
  9390. ! Defaults to C<@>. By setting it to an empty string you can generate a
  9391.   Makefile that echos all commands. Mainly used in debugging MakeMaker
  9392.   itself.
  9393.   
  9394. ***************
  9395. *** 1501,1518 ****
  9396.   decided at the build time of your perl (unless you override one of
  9397.   them, of course).
  9398.   
  9399. ! =item PREREQ
  9400.   
  9401. ! Placeholder, not yet implemented. Will eventually be a hashref: Names
  9402. ! of modules that need to be available to run this extension (e.g. Fcntl
  9403. ! for SDBM_File) are the keys of the hash and the desired version is the
  9404. ! value. Needs further evaluation, should probably allow to define
  9405. ! prerequisites among header files, libraries, perl version, etc.
  9406.   
  9407.   =item SKIP
  9408.   
  9409.   Arryref. E.g. [qw(name1 name2)] skip (do not write) sections of the
  9410. ! Makefile
  9411.   
  9412.   =item TYPEMAPS
  9413.   
  9414. --- 1479,1497 ----
  9415.   decided at the build time of your perl (unless you override one of
  9416.   them, of course).
  9417.   
  9418. ! =item PREREQ_PM
  9419.   
  9420. ! Hashref: Names of modules that need to be available to run this
  9421. ! extension (e.g. Fcntl for SDBM_File) are the keys of the hash and the
  9422. ! desired version is the value. If the required version number is 0, we
  9423. ! only check if any version is installed already.
  9424.   
  9425.   =item SKIP
  9426.   
  9427.   Arryref. E.g. [qw(name1 name2)] skip (do not write) sections of the
  9428. ! Makefile. Caution! Do not use the SKIP attribute for the neglectible
  9429. ! speedup. It may seriously damage the resulting Makefile. Only use it,
  9430. ! if you really need it.
  9431.   
  9432.   =item TYPEMAPS
  9433.   
  9434. ***************
  9435. *** 1543,1549 ****
  9436.   MakeMaker object. The following lines will be parsed o.k.:
  9437.   
  9438.       $VERSION = '1.00';
  9439. !     ( $VERSION ) = '$Revision: 1.187 $ ' =~ /\$Revision:\s+([^\s]+)/;
  9440.       $FOO::VERSION = '1.10';
  9441.   
  9442.   but these will fail:
  9443. --- 1522,1528 ----
  9444.   MakeMaker object. The following lines will be parsed o.k.:
  9445.   
  9446.       $VERSION = '1.00';
  9447. !     ( $VERSION ) = '$Revision: 1.201 $ ' =~ /\$Revision:\s+([^\s]+)/;
  9448.       $FOO::VERSION = '1.10';
  9449.   
  9450.   but these will fail:
  9451. ***************
  9452. *** 1587,1593 ****
  9453.   =head2 Additional lowercase attributes
  9454.   
  9455.   can be used to pass parameters to the methods which implement that
  9456. ! part of the Makefile. These are not normally required:
  9457.   
  9458.   =over 2
  9459.   
  9460. --- 1566,1572 ----
  9461.   =head2 Additional lowercase attributes
  9462.   
  9463.   can be used to pass parameters to the methods which implement that
  9464. ! part of the Makefile.
  9465.   
  9466.   =over 2
  9467.   
  9468. ***************
  9469. *** 1603,1609 ****
  9470.   
  9471.     {TARFLAGS => 'cvfF', COMPRESS => 'gzip', SUFFIX => 'gz',
  9472.     SHAR => 'shar -m', DIST_CP => 'ln', ZIP => '/bin/zip',
  9473. !   ZIPFLAGS => '-rl'}
  9474.   
  9475.   If you specify COMPRESS, then SUFFIX should also be altered, as it is
  9476.   needed to tell make the target file of the compression. Setting
  9477. --- 1582,1588 ----
  9478.   
  9479.     {TARFLAGS => 'cvfF', COMPRESS => 'gzip', SUFFIX => 'gz',
  9480.     SHAR => 'shar -m', DIST_CP => 'ln', ZIP => '/bin/zip',
  9481. !   ZIPFLAGS => '-rl', DIST_DEFAULT => 'private tardist' }
  9482.   
  9483.   If you specify COMPRESS, then SUFFIX should also be altered, as it is
  9484.   needed to tell make the target file of the compression. Setting
  9485. ***************
  9486. *** 1665,1679 ****
  9487.   or you can edit the default by saying something like:
  9488.   
  9489.       sub MY::c_o {
  9490. !         my $self = shift;
  9491. !         local *c_o;
  9492. !             $_=$self->MM::c_o;
  9493. !         s/old text/new text/;
  9494. !         $_;
  9495.       }
  9496.   
  9497. ! Both methods above are available for backwards compatibility with
  9498. ! older Makefile.PLs.
  9499.   
  9500.   If you still need a different solution, try to develop another
  9501.   subroutine, that fits your needs and submit the diffs to
  9502. --- 1644,1658 ----
  9503.   or you can edit the default by saying something like:
  9504.   
  9505.       sub MY::c_o {
  9506. !             my($inherited) = shift->SUPER::c_o(@_);
  9507. !         $inherited =~ s/old text/new text/;
  9508. !         $inherited;
  9509.       }
  9510.   
  9511. ! If you running experiments with embedding perl as a library into other
  9512. ! applications, you might find MakeMaker not sufficient. You'd better
  9513. ! have a look at ExtUtils::embed which is a collection of utilities for
  9514. ! embedding.
  9515.   
  9516.   If you still need a different solution, try to develop another
  9517.   subroutine, that fits your needs and submit the diffs to
  9518. ***************
  9519. *** 1692,1697 ****
  9520. --- 1671,1694 ----
  9521.       }
  9522.   
  9523.   
  9524. + =head2 Hintsfile support
  9525. + MakeMaker.pm uses the architecture specific information from
  9526. + Config.pm. In addition it evaluates architecture specific hints files
  9527. + in a C<hints/> directory. The hints files are expected to be named
  9528. + like their counterparts in C<PERL_SRC/hints>, but with an C<.pl> file
  9529. + name extension (eg. C<next_3_2.pl>). They are simply C<eval>ed by
  9530. + MakeMaker within the WriteMakefile() subroutine, and can be used to
  9531. + execute commands as well as to include special variables. The rules
  9532. + which hintsfile is chosen are the same as in Configure.
  9533. + The hintsfile is eval()ed immediately after the arguments given to
  9534. + WriteMakefile are stuffed into a hash reference $self but before this
  9535. + reference becomes blessed. So if you want to do the equivalent to
  9536. + override or create an attribute you would say something like
  9537. +     $self->{LIBS} = ['-ldbm -lucb -lc'];
  9538.   =head2 Distribution Support
  9539.   
  9540.   For authors of extensions MakeMaker provides several Makefile
  9541. ***************
  9542. *** 1737,1743 ****
  9543.   =item    make tardist
  9544.   
  9545.   First does a distdir. Then a command $(PREOP) which defaults to a null
  9546. ! command. Next it runs C<tar> on that directory into a tarfile and
  9547.   deletes the directory. Finishes with a command $(POSTOP) which
  9548.   defaults to a null command.
  9549.   
  9550. --- 1734,1742 ----
  9551.   =item    make tardist
  9552.   
  9553.   First does a distdir. Then a command $(PREOP) which defaults to a null
  9554. ! command, followed by $(TOUNIX), which defaults to a null command under
  9555. ! UNIX, and will convert files in distribution directory to UNIX format
  9556. ! otherwise. Next it runs C<tar> on that directory into a tarfile and
  9557.   deletes the directory. Finishes with a command $(POSTOP) which
  9558.   defaults to a null command.
  9559.   
  9560. ***************
  9561. *** 1778,1783 ****
  9562. --- 1777,1783 ----
  9563.       COMPRESS     ('compress')
  9564.       POSTOP       ('@ :')
  9565.       PREOP        ('@ :')
  9566. +     TO_UNIX      (depends on the system)
  9567.       RCS_LABEL    ('rcs -q -Nv$(VERSION_SYM):')
  9568.       SHAR         ('shar')
  9569.       SUFFIX       ('Z')
  9570. ***************
  9571. *** 1790,1795 ****
  9572. --- 1790,1799 ----
  9573.   
  9574.       WriteMakefile( 'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" })
  9575.   
  9576. + =head1 SEE ALSO
  9577. + ExtUtils::MM_Unix, ExtUtils::Manifest, ExtUtils::testlib,
  9578. + ExtUtils::Install, ExtUtils::embed
  9579.   
  9580.   =head1 AUTHORS
  9581.   
  9582. ***************
  9583. *** 1800,1813 ****
  9584.   Zakharevich F<E<lt>ilya@math.ohio-state.eduE<gt>>. Contact the
  9585.   makemaker mailing list C<mailto:makemaker@franz.ww.tu-berlin.de>, if
  9586.   you have any questions.
  9587. - =head1 MODIFICATION HISTORY
  9588. - For a more complete documentation see the file Changes in the
  9589. - MakeMaker distribution package.
  9590. - =head1 TODO
  9591. - See the file Todo in the MakeMaker distribution package.
  9592.   
  9593.   =cut
  9594. --- 1804,1808 ----
  9595.  
  9596.  
  9597. #: lib/ExtUtils/Manifest.pm
  9598. #:   Update to MakeMaker 5.34
  9599. diff -crN perl5.002_01/lib/ExtUtils/Manifest.pm perl5.003/lib/ExtUtils/Manifest.pm
  9600. *** perl5.002_01/lib/ExtUtils/Manifest.pm    Mon Mar 25 01:04:20 1996
  9601. --- perl5.003/lib/ExtUtils/Manifest.pm    Sun Jun 23 20:52:52 1996
  9602. ***************
  9603. *** 15,21 ****
  9604.   $Verbose = 1;
  9605.   $Is_VMS = $^O eq 'VMS';
  9606.   
  9607. ! $VERSION = $VERSION = substr(q$Revision: 1.23 $,10,4);
  9608.   
  9609.   $Quiet = 0;
  9610.   
  9611. --- 15,21 ----
  9612.   $Verbose = 1;
  9613.   $Is_VMS = $^O eq 'VMS';
  9614.   
  9615. ! $VERSION = $VERSION = substr(q$Revision: 1.24 $,10,4);
  9616.   
  9617.   $Quiet = 0;
  9618.   
  9619. ***************
  9620. *** 36,42 ****
  9621.       my $matches = _maniskip();
  9622.       my $found = manifind();
  9623.       my($key,$val,$file,%all);
  9624. !     my %all = (%$found, %$read);
  9625.       $all{$MANIFEST} = ($Is_VMS ? "$MANIFEST\t\t" : '') . 'This list of files'
  9626.           if $manimiss; # add new MANIFEST to known file list
  9627.       foreach $file (sort keys %all) {
  9628. --- 36,42 ----
  9629.       my $matches = _maniskip();
  9630.       my $found = manifind();
  9631.       my($key,$val,$file,%all);
  9632. !     %all = (%$found, %$read);
  9633.       $all{$MANIFEST} = ($Is_VMS ? "$MANIFEST\t\t" : '') . 'This list of files'
  9634.           if $manimiss; # add new MANIFEST to known file list
  9635.       foreach $file (sort keys %all) {
  9636. ***************
  9637. *** 138,144 ****
  9638.       my ($mfile) = @_;
  9639.       my $matches = sub {0};
  9640.       my @skip ;
  9641. !     my $mfile = "$MANIFEST.SKIP" unless defined $mfile;
  9642.       local *M;
  9643.       return $matches unless -f $mfile;
  9644.       open M, $mfile or return $matches;
  9645. --- 138,144 ----
  9646.       my ($mfile) = @_;
  9647.       my $matches = sub {0};
  9648.       my @skip ;
  9649. !     $mfile = "$MANIFEST.SKIP" unless defined $mfile;
  9650.       local *M;
  9651.       return $matches unless -f $mfile;
  9652.       open M, $mfile or return $matches;
  9653. ***************
  9654. *** 290,297 ****
  9655.   output. All files that match any regular expression in a file
  9656.   C<MANIFEST.SKIP> (if such a file exists) are ignored.
  9657.   
  9658. ! Manicheck() checks if all the files within a C<MANIFEST> in the current
  9659. ! directory really do exist.
  9660.   
  9661.   Filecheck() finds files below the current directory that are not
  9662.   mentioned in the C<MANIFEST> file. An optional file C<MANIFEST.SKIP>
  9663. --- 290,299 ----
  9664.   output. All files that match any regular expression in a file
  9665.   C<MANIFEST.SKIP> (if such a file exists) are ignored.
  9666.   
  9667. ! Manicheck() checks if all the files within a C<MANIFEST> in the
  9668. ! current directory really do exist. It only reports discrepancies and
  9669. ! exits silently if MANIFEST and the tree below the current directory
  9670. ! are in sync.
  9671.   
  9672.   Filecheck() finds files below the current directory that are not
  9673.   mentioned in the C<MANIFEST> file. An optional file C<MANIFEST.SKIP>
  9674.  
  9675.  
  9676. #: lib/ExtUtils/Mksymlists.pm
  9677. #:   Update to MakeMaker 5.34
  9678. diff -crN perl5.002_01/lib/ExtUtils/Mksymlists.pm perl5.003/lib/ExtUtils/Mksymlists.pm
  9679. *** perl5.002_01/lib/ExtUtils/Mksymlists.pm    Mon Mar 25 01:04:20 1996
  9680. --- perl5.003/lib/ExtUtils/Mksymlists.pm    Sun Jun 23 20:52:59 1996
  9681. ***************
  9682. *** 4,16 ****
  9683.   
  9684.   use Carp;
  9685.   use Exporter;
  9686. ! # mention vars twice to prevent single-use warnings
  9687. ! @ExtUtils::Mksymlists::ISA = @ExtUtils::Mksymlists::ISA = 'Exporter';
  9688. ! @ExtUtils::Mksymlists::EXPORT = @ExtUtils::Mksymlists::EXPORT = '&Mksymlists';
  9689. ! $ExtUtils::Mksymlists::VERSION = $ExtUtils::Mksymlists::VERSION = '1.00';
  9690.   
  9691.   sub Mksymlists {
  9692.       my(%spec) = @_;
  9693.   
  9694.       croak("Insufficient information specified to Mksymlists")
  9695.           unless ( $spec{NAME} or
  9696. --- 4,17 ----
  9697.   
  9698.   use Carp;
  9699.   use Exporter;
  9700. ! use vars qw( @ISA @EXPORT $VERSION );
  9701. ! @ISA = 'Exporter';
  9702. ! @EXPORT = '&Mksymlists';
  9703. ! $VERSION = '1.03';
  9704.   
  9705.   sub Mksymlists {
  9706.       my(%spec) = @_;
  9707. +     my($osname) = $^O;
  9708.   
  9709.       croak("Insufficient information specified to Mksymlists")
  9710.           unless ( $spec{NAME} or
  9711. ***************
  9712. *** 44,53 ****
  9713.           $spec{DLBASE} = DynaLoader::mod2fname([ split(/::/,$spec{NAME}) ]);
  9714.       }
  9715.   
  9716. !     if    ($^O eq 'aix') { _write_aix(\%spec); }
  9717. !     elsif ($^O eq 'VMS') { _write_vms(\%spec) }
  9718. !     elsif ($^O eq 'os2') { _write_os2(\%spec) }
  9719. !     else { croak("Don't know how to create linker option file for $^O\n"); }
  9720.   }
  9721.   
  9722.   
  9723. --- 45,54 ----
  9724.           $spec{DLBASE} = DynaLoader::mod2fname([ split(/::/,$spec{NAME}) ]);
  9725.       }
  9726.   
  9727. !     if    ($osname eq 'aix') { _write_aix(\%spec); }
  9728. !     elsif ($osname eq 'VMS') { _write_vms(\%spec) }
  9729. !     elsif ($osname =~ m|^os/?2$|i) { _write_os2(\%spec) }
  9730. !     else { croak("Don't know how to create linker option file for $osname\n"); }
  9731.   }
  9732.   
  9733.   
  9734. ***************
  9735. *** 95,101 ****
  9736.   sub _write_vms {
  9737.       my($data) = @_;
  9738.   
  9739. !     require Config;
  9740.   
  9741.       my($isvax) = $Config::Config{'arch'} =~ /VAX/i;
  9742.       my($sym);
  9743. --- 96,102 ----
  9744.   sub _write_vms {
  9745.       my($data) = @_;
  9746.   
  9747. !     require Config; # a reminder for once we do $^O
  9748.   
  9749.       my($isvax) = $Config::Config{'arch'} =~ /VAX/i;
  9750.       my($sym);
  9751.  
  9752.  
  9753. #: lib/Symbol.pm
  9754. #:   Do Perl version check at compile time, so that user gets a
  9755. #:   clear error message instead of syntax errors during compilation
  9756. diff -crN perl5.002_01/lib/Symbol.pm perl5.003/lib/Symbol.pm
  9757. *** perl5.002_01/lib/Symbol.pm    Mon Mar 25 01:04:47 1996
  9758. --- perl5.003/lib/Symbol.pm    Mon Jun 24 16:07:54 1996
  9759. ***************
  9760. *** 46,52 ****
  9761.   
  9762.   =cut
  9763.   
  9764. ! require 5.002;
  9765.   
  9766.   require Exporter;
  9767.   @ISA = qw(Exporter);
  9768. --- 46,52 ----
  9769.   
  9770.   =cut
  9771.   
  9772. ! BEGIN { require 5.002; }
  9773.   
  9774.   require Exporter;
  9775.   @ISA = qw(Exporter);
  9776.  
  9777. #: op.c
  9778. #:   Fix overeager integer optimization
  9779. diff -crN perl5.002_01/op.c perl5.003/op.c
  9780. *** perl5.002_01/op.c    Mon Mar 25 01:05:00 1996
  9781. --- perl5.003/op.c    Sun Jun 23 20:35:03 1996
  9782. ***************
  9783. *** 1413,1419 ****
  9784.       for (curop = ((UNOP*)o)->op_first; curop; curop = curop->op_sibling) {
  9785.           if (curop->op_type == OP_CONST) {
  9786.           if (SvIOK(((SVOP*)curop)->op_sv)) {
  9787. !             if (SvIVX(((SVOP*)curop)->op_sv) < 0 && vars++)
  9788.               return o;    /* negatives truncate wrong way, alas */
  9789.               continue;
  9790.           }
  9791. --- 1413,1419 ----
  9792.       for (curop = ((UNOP*)o)->op_first; curop; curop = curop->op_sibling) {
  9793.           if (curop->op_type == OP_CONST) {
  9794.           if (SvIOK(((SVOP*)curop)->op_sv)) {
  9795. !             if (SvIVX(((SVOP*)curop)->op_sv) <= 0 && vars++)
  9796.               return o;    /* negatives truncate wrong way, alas */
  9797.               continue;
  9798.           }
  9799.  
  9800.  
  9801. #: patchlevel.h
  9802. #:   Update to reflect new version
  9803. diff -crN perl5.002_01/patchlevel.h perl5.003/patchlevel.h
  9804. *** perl5.002_01/patchlevel.h    Mon Mar 25 01:05:05 1996
  9805. --- perl5.003/patchlevel.h    Sun Jun 23 13:57:18 1996
  9806. ***************
  9807. *** 1,5 ****
  9808. ! #define PATCHLEVEL 2
  9809. ! #define SUBVERSION 1
  9810.   
  9811.   /*
  9812.       local_patches -- list of locally applied less-than-subversion patches.
  9813. --- 1,5 ----
  9814. ! #define PATCHLEVEL 3
  9815. ! #define SUBVERSION 0
  9816.   
  9817.   /*
  9818.       local_patches -- list of locally applied less-than-subversion patches.
  9819.  
  9820.  
  9821. #: perl.c
  9822. #:   suidperl security patch
  9823. diff -crN perl5.002_01/perl.c perl5.003/perl.c
  9824. *** perl5.002_01/perl.c    Mon Mar 25 01:05:05 1996
  9825. --- perl5.003/perl.c    Mon Jun 24 17:06:37 1996
  9826. ***************
  9827. *** 47,53 ****
  9828.   static void init_stacks _((void));
  9829.   static void open_script _((char *, bool, SV *));
  9830.   static void usage _((char *));
  9831. ! static void validate_suid _((char *));
  9832.   
  9833.   PerlInterpreter *
  9834.   perl_alloc()
  9835. --- 47,55 ----
  9836.   static void init_stacks _((void));
  9837.   static void open_script _((char *, bool, SV *));
  9838.   static void usage _((char *));
  9839. ! static void validate_suid _((char *, char*));
  9840. ! static int fdscript = -1;
  9841.   
  9842.   PerlInterpreter *
  9843.   perl_alloc()
  9844. ***************
  9845. *** 427,433 ****
  9846.   
  9847.       open_script(scriptname,dosearch,sv);
  9848.   
  9849. !     validate_suid(validarg);
  9850.   
  9851.       if (doextract)
  9852.       find_beginning();
  9853. --- 429,435 ----
  9854.   
  9855.       open_script(scriptname,dosearch,sv);
  9856.   
  9857. !     validate_suid(validarg, scriptname);
  9858.   
  9859.       if (doextract)
  9860.       find_beginning();
  9861. ***************
  9862. *** 1209,1214 ****
  9863. --- 1211,1217 ----
  9864.       printf(" on %s",__DATE__);
  9865.   #  endif
  9866.   #endif
  9867. +     fputs("\n\t+ suidperl security patch", stdout);
  9868.       fputs("\n\nCopyright 1987-1996, Larry Wall\n",stdout);
  9869.   #ifdef MSDOS
  9870.       fputs("MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis\n",
  9871. ***************
  9872. *** 1399,1409 ****
  9873.       scriptname = xfound;
  9874.       }
  9875.   
  9876.       origfilename = savepv(e_tmpname ? "-e" : scriptname);
  9877.       curcop->cop_filegv = gv_fetchfile(origfilename);
  9878.       if (strEQ(origfilename,"-"))
  9879.       scriptname = "";
  9880. !     if (preprocess) {
  9881.       char *cpp = CPPSTDIN;
  9882.   
  9883.       if (strEQ(cpp,"cppstdin"))
  9884. --- 1402,1428 ----
  9885.       scriptname = xfound;
  9886.       }
  9887.   
  9888. +     if (strnEQ(scriptname, "/dev/fd/", 8) && isDIGIT(scriptname[8]) ) {
  9889. +     char *s = scriptname + 8;
  9890. +     fdscript = atoi(s);
  9891. +     while (isDIGIT(*s))
  9892. +         s++;
  9893. +     if (*s)
  9894. +         scriptname = s + 1;
  9895. +     }
  9896. +     else
  9897. +     fdscript = -1;
  9898.       origfilename = savepv(e_tmpname ? "-e" : scriptname);
  9899.       curcop->cop_filegv = gv_fetchfile(origfilename);
  9900.       if (strEQ(origfilename,"-"))
  9901.       scriptname = "";
  9902. !     if (fdscript >= 0) {
  9903. !     rsfp = fdopen(fdscript,"r");
  9904. ! #if defined(HAS_FCNTL) && defined(F_SETFD)
  9905. !     fcntl(fileno(rsfp),F_SETFD,1);    /* ensure close-on-exec */
  9906. ! #endif
  9907. !     }
  9908. !     else if (preprocess) {
  9909.       char *cpp = CPPSTDIN;
  9910.   
  9911.       if (strEQ(cpp,"cppstdin"))
  9912. ***************
  9913. *** 1475,1482 ****
  9914.       taint_not("program input from stdin");
  9915.       rsfp = stdin;
  9916.       }
  9917. !     else
  9918.       rsfp = fopen(scriptname,"r");
  9919.       if ((FILE*)rsfp == Nullfp) {
  9920.   #ifdef DOSUID
  9921.   #ifndef IAMSUID        /* in case script is not readable before setuid */
  9922. --- 1494,1505 ----
  9923.       taint_not("program input from stdin");
  9924.       rsfp = stdin;
  9925.       }
  9926. !     else {
  9927.       rsfp = fopen(scriptname,"r");
  9928. + #if defined(HAS_FCNTL) && defined(F_SETFD)
  9929. +     fcntl(fileno(rsfp),F_SETFD,1);    /* ensure close-on-exec */
  9930. + #endif
  9931. +     }
  9932.       if ((FILE*)rsfp == Nullfp) {
  9933.   #ifdef DOSUID
  9934.   #ifndef IAMSUID        /* in case script is not readable before setuid */
  9935. ***************
  9936. *** 1494,1502 ****
  9937.   }
  9938.   
  9939.   static void
  9940. ! validate_suid(validarg)
  9941.   char *validarg;
  9942.   {
  9943.       /* do we need to emulate setuid on scripts? */
  9944.   
  9945.       /* This code is for those BSD systems that have setuid #! scripts disabled
  9946. --- 1517,1528 ----
  9947.   }
  9948.   
  9949.   static void
  9950. ! validate_suid(validarg, scriptname)
  9951.   char *validarg;
  9952. + char *scriptname;
  9953.   {
  9954. +     int which;
  9955.       /* do we need to emulate setuid on scripts? */
  9956.   
  9957.       /* This code is for those BSD systems that have setuid #! scripts disabled
  9958. ***************
  9959. *** 1522,1528 ****
  9960.   
  9961.       if (Fstat(fileno(rsfp),&statbuf) < 0)    /* normal stat is insecure */
  9962.       croak("Can't stat script \"%s\"",origfilename);
  9963. !     if (statbuf.st_mode & (S_ISUID|S_ISGID)) {
  9964.       I32 len;
  9965.   
  9966.   #ifdef IAMSUID
  9967. --- 1548,1554 ----
  9968.   
  9969.       if (Fstat(fileno(rsfp),&statbuf) < 0)    /* normal stat is insecure */
  9970.       croak("Can't stat script \"%s\"",origfilename);
  9971. !     if (fdscript < 0 && statbuf.st_mode & (S_ISUID|S_ISGID)) {
  9972.       I32 len;
  9973.   
  9974.   #ifdef IAMSUID
  9975. ***************
  9976. *** 1690,1697 ****
  9977. --- 1716,1743 ----
  9978.   #ifdef IAMSUID
  9979.       else if (preprocess)
  9980.       croak("-P not allowed for setuid/setgid script\n");
  9981. +     else if (fdscript >= 0)
  9982. +     croak("fd script not allowed in suidperl\n");
  9983.       else
  9984.       croak("Script is not setuid/setgid in suidperl\n");
  9985. +     /* We absolutely must clear out any saved ids here, so we */
  9986. +     /* exec the real perl, substituting fd script for scriptname. */
  9987. +     /* (We pass script name as "subdir" of fd, which perl will grok.) */
  9988. +     rewind(rsfp);
  9989. +     for (which = 1; origargv[which] && origargv[which] != scriptname; which++) ;
  9990. +     if (!origargv[which])
  9991. +     croak("Permission denied");
  9992. +     (void)sprintf(buf, "/dev/fd/%d/%.127s", fileno(rsfp), origargv[which]);
  9993. +     origargv[which] = buf;
  9994. + #if defined(HAS_FCNTL) && defined(F_SETFD)
  9995. +     fcntl(fileno(rsfp),F_SETFD,0);    /* ensure no close-on-exec */
  9996. + #endif
  9997. +     (void)sprintf(tokenbuf, "%s/perl%s", BIN, patchlevel);
  9998. +     execv(tokenbuf, origargv);    /* try again */
  9999. +     croak("Can't do setuid\n");
  10000.   #endif /* IAMSUID */
  10001.   #else /* !DOSUID */
  10002.       if (euid != uid || egid != gid) {    /* (suidperl doesn't exist, in fact) */
  10003.  
  10004.  
  10005. #: t/op/stat.t
  10006. #:   MachTen considers /dev/null to be a terminal, so don't
  10007. #:   count this as a Perl test failure
  10008. diff -crN perl5.002_01/t/op/stat.t perl5.003/t/op/stat.t
  10009. *** perl5.002_01/t/op/stat.t    Mon Feb 12 15:01:45 1996
  10010. --- perl5.003/t/op/stat.t    Mon Jun 24 16:07:55 1996
  10011. ***************
  10012. *** 1,7 ****
  10013.   #!./perl
  10014.   
  10015.   # $RCSfile: stat.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:28 $
  10016.   print "1..56\n";
  10017.   
  10018.   chop($cwd = `pwd`);
  10019. --- 1,8 ----
  10020.   #!./perl
  10021.   
  10022.   # $RCSfile: stat.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:28 $
  10023. ! # 950521 DFD    This version hacked to make test 39 succeed on MachTen
  10024. ! #               though the O.S. wrongly thinks /dev/null is a terminal
  10025.   print "1..56\n";
  10026.   
  10027.   chop($cwd = `pwd`);
  10028. ***************
  10029. *** 140,146 ****
  10030.   close(tty);
  10031.   if (! -t tty) {print "ok 38\n";} else {print "not ok 38\n";}
  10032.   open(null,"/dev/null");
  10033. ! if (! -t null || -e '/xenix') {print "ok 39\n";} else {print "not ok 39\n";}
  10034.   close(null);
  10035.   if (-t) {print "ok 40\n";} else {print "not ok 40\n";}
  10036.   
  10037. --- 141,148 ----
  10038.   close(tty);
  10039.   if (! -t tty) {print "ok 38\n";} else {print "not ok 38\n";}
  10040.   open(null,"/dev/null");
  10041. ! if (! -t null || -e '/xenix' || -e '/MachTen')
  10042. !     {print "ok 39\n";} else {print "not ok 39\n";}
  10043.   close(null);
  10044.   if (-t) {print "ok 40\n";} else {print "not ok 40\n";}
  10045.   
  10046.  
  10047.  
  10048. #: vms/Makefile
  10049. #:   Update to reflect new Perl version
  10050. diff -crN perl5.002_01/vms/Makefile perl5.003/vms/Makefile
  10051. *** perl5.002_01/vms/Makefile    Mon Mar 25 01:06:02 1996
  10052. --- perl5.003/vms/Makefile    Sun Jun 23 22:54:44 1996
  10053. ***************
  10054. *** 35,41 ****
  10055.       @ $$@[.vms]fndvers.com "" "" "[.vms]Makefile"
  10056.   
  10057.   # Updated by fndvers.com -- do not edit by hand
  10058. ! PERL_VERSION = 5_00201#
  10059.   
  10060.   
  10061.   ARCHDIR =  [.lib.$(ARCH).$(PERL_VERSION)]
  10062. --- 35,41 ----
  10063.       @ $$@[.vms]fndvers.com "" "" "[.vms]Makefile"
  10064.   
  10065.   # Updated by fndvers.com -- do not edit by hand
  10066. ! PERL_VERSION = 5_003  #
  10067.   
  10068.   
  10069.   ARCHDIR =  [.lib.$(ARCH).$(PERL_VERSION)]
  10070.  
  10071.  
  10072. #: vms/config.vms
  10073. #:   Remove string concatenation on which VAXC chokes
  10074. #:   Update to reflect new version
  10075. diff -crN perl5.002_01/vms/config.vms perl5.003/vms/config.vms
  10076. *** perl5.002_01/vms/config.vms    Mon Mar 25 01:05:51 1996
  10077. --- perl5.003/vms/config.vms    Sun Jun 23 22:54:20 1996
  10078. ***************
  10079. *** 44,56 ****
  10080.   #define STRINGIFY(a)"a"
  10081.   #endif
  10082.   
  10083. - /* Default value for version token in ARCHLIB_EXP;
  10084. -  * updated during build by FndVers.Com -- do not edit
  10085. -  */
  10086. - #ifndef _PVERS
  10087. - #  define _PVERS "5_00201"  /**/
  10088. - #endif
  10089.   /* config-start */
  10090.   
  10091.   /* MEM_ALIGNBYTES:
  10092. --- 44,49 ----
  10093. ***************
  10094. *** 74,84 ****
  10095.    *    same as PRIVLIB_EXP, it is not defined, since presumably the
  10096.    *    program already searches PRIVLIB_EXP.
  10097.    */
  10098. ! #ifdef __ALPHA
  10099. ! #define ARCHLIB_EXP CAT2("/perl_root/lib/VMS_AXP/",_PVERS)  /* config-skip */
  10100. ! #else
  10101. ! #define ARCHLIB_EXP CAT2("/perl_root/lib/VMS_VAX/",_PVERS)  /* config-skip */
  10102. ! #endif
  10103.   
  10104.   /* CPPSTDIN:
  10105.    *    This symbol contains the first part of the string which will invoke
  10106. --- 67,78 ----
  10107.    *    same as PRIVLIB_EXP, it is not defined, since presumably the
  10108.    *    program already searches PRIVLIB_EXP.
  10109.    */
  10110. ! /*     ==> NOTE <==
  10111. !  * This value is automatically updated by FndVers.Com
  10112. !  * when Perl is built.  Please do not change it by hand; make
  10113. !  * any changes to FndVers.Com instead.
  10114. !  */
  10115. ! #define ARCHLIB_EXP "/perl_root/lib/VMS_VAX/5_003"    /**/
  10116.   
  10117.   /* CPPSTDIN:
  10118.    *    This symbol contains the first part of the string which will invoke
  10119. ***************
  10120. *** 1318,1328 ****
  10121.    *    used in programs that are not prepared to deal with ~ expansion at 
  10122.    *    run-time.
  10123.    */
  10124. ! #ifdef __ALPHA
  10125. ! #define OLDARCHLIB_EXP "/perl_root/lib/VMS_AXP"  /* config-skip */
  10126. ! #else
  10127. ! #define OLDARCHLIB_EXP "/perl_root/lib/VMS_VAX" /* config-skip */
  10128. ! #endif
  10129.   
  10130.   /* PRIVLIB_EXP:
  10131.    *    This symbol contains the name of the private library for this package.
  10132. --- 1312,1323 ----
  10133.    *    used in programs that are not prepared to deal with ~ expansion at 
  10134.    *    run-time.
  10135.    */
  10136. ! /*     ==> NOTE <==
  10137. !  * This value is automatically updated by FndVers.Com
  10138. !  * when Perl is built.  Please do not change it by hand; make
  10139. !  * any changes to FndVers.Com instead.
  10140. !  */
  10141. ! #define OLDARCHLIB_EXP "/perl_root/lib/VMS_VAX"  /**/
  10142.   
  10143.   /* PRIVLIB_EXP:
  10144.    *    This symbol contains the name of the private library for this package.
  10145. ***************
  10146. *** 1342,1352 ****
  10147.    *    This symbol contains the ~name expanded version of SITEARCH, to be used
  10148.    *    in programs that are not prepared to deal with ~ expansion at run-time.
  10149.    */
  10150. ! #ifdef __ALPHA
  10151. ! #define SITEARCH_EXP "/perl_root/lib/site_perl/VMS_AXP"  /* config-skip */
  10152. ! #else
  10153. ! #define SITEARCH_EXP "/perl_root/lib/site_perl/VMS_VAX" /* config-skip */
  10154. ! #endif
  10155.   
  10156.   /* SCRIPTDIR:
  10157.    *    This symbol holds the name of the directory in which the user wants
  10158. --- 1337,1348 ----
  10159.    *    This symbol contains the ~name expanded version of SITEARCH, to be used
  10160.    *    in programs that are not prepared to deal with ~ expansion at run-time.
  10161.    */
  10162. ! /*     ==> NOTE <==
  10163. !  * This value is automatically updated by FndVers.Com
  10164. !  * when Perl is built.  Please do not change it by hand; make
  10165. !  * any changes to FndVers.Com instead.
  10166. !  */
  10167. ! #define SITEARCH_EXP "/perl_root/lib/site_perl/VMS_VAX"  /**/
  10168.   
  10169.   /* SCRIPTDIR:
  10170.    *    This symbol holds the name of the directory in which the user wants
  10171.  
  10172.  
  10173. #: vms/descrip.mms
  10174. #:   Update to reflect new Perl version
  10175. diff -crN perl5.002_01/vms/descrip.mms perl5.003/vms/descrip.mms
  10176. *** perl5.002_01/vms/descrip.mms    Mon Mar 25 01:05:52 1996
  10177. --- perl5.003/vms/descrip.mms    Sun Jun 23 22:53:30 1996
  10178. ***************
  10179. *** 68,74 ****
  10180.       @ @[.vms]fndvers.com "" "" "[.vms]descrip.mms"
  10181.   
  10182.   # Updated by fndvers.com -- do not edit by hand
  10183. ! PERL_VERSION = 5_00201#
  10184.   
  10185.   
  10186.   ARCHDIR =  [.lib.$(ARCH).$(PERL_VERSION)]
  10187. --- 68,74 ----
  10188.       @ @[.vms]fndvers.com "" "" "[.vms]descrip.mms"
  10189.   
  10190.   # Updated by fndvers.com -- do not edit by hand
  10191. ! PERL_VERSION = 5_003  #
  10192.   
  10193.   
  10194.   ARCHDIR =  [.lib.$(ARCH).$(PERL_VERSION)]
  10195.  
  10196.  
  10197. #: vms/fndvers.com
  10198. #:   Update generation of ARCHLIB_EXP in config.h to use a
  10199. #:   method which keeps VAXC happy
  10200. diff -crN perl5.002_01/vms/fndvers.com perl5.003/vms/fndvers.com
  10201. *** perl5.002_01/vms/fndvers.com    Mon Mar 25 01:05:59 1996
  10202. --- perl5.003/vms/fndvers.com    Sun Jun 23 13:58:49 1996
  10203. ***************
  10204. *** 37,53 ****
  10205.   $!
  10206.   $ If sublevel.eq.0 Then sublevel = ""
  10207.   $ perl_version = "5_" + plevel + sublevel
  10208.   $ If p2.eqs."#NOFILE#"
  10209.   $ Then
  10210.   $   Write Sys$Output "Perl version directory name is ""''perl_version'"""
  10211.   $   Exit
  10212.   $ EndIf
  10213.   $!
  10214. ! $ token = """""""""''perl_version'"""""""""
  10215.   $ If sublevel.eqs."" Then token = token + "  "
  10216.   $ token = token + "  /**/"
  10217. ! $ Call update_file "''p2'" "#  define _PVERS" "''token'"
  10218. ! $ If .not.$Status Then Exit $Status
  10219.   $!
  10220.   $ token = "''perl_version'"
  10221.   $ If sublevel.eqs."" Then token = token + "  "
  10222. --- 37,71 ----
  10223.   $!
  10224.   $ If sublevel.eq.0 Then sublevel = ""
  10225.   $ perl_version = "5_" + plevel + sublevel
  10226. + $ If F$GetSyi("HW_MODEL").gt.1024
  10227. + $ Then
  10228. + $   arch = "AXP"
  10229. + $ Else
  10230. + $   arch = "VAX"
  10231. + $ EndIf
  10232.   $ If p2.eqs."#NOFILE#"
  10233.   $ Then
  10234.   $   Write Sys$Output "Perl version directory name is ""''perl_version'"""
  10235.   $   Exit
  10236.   $ EndIf
  10237.   $!
  10238. ! $ token = """""""""/perl_root/lib/VMS_''arch'/''perl_version'"""""""""
  10239.   $ If sublevel.eqs."" Then token = token + "  "
  10240.   $ token = token + "  /**/"
  10241. ! $ Call update_file "''p2'" "#define ARCHLIB_EXP" "''token'"
  10242. ! $ teststs = $Status
  10243. ! $ If .not.teststs Then Exit teststs
  10244. ! $!
  10245. ! $ If teststs.ne.1 ! current values in config.vms are appropriate
  10246. ! $ Then
  10247. ! $   token = """""""""/perl_root/lib/VMS_''arch'""""""""  /**/"
  10248. ! $   Call update_file "''p2'" "#define OLDARCHLIB_EXP" "''token'"
  10249. ! $   If .not.$Status Then Exit $Status
  10250. ! $!
  10251. ! $   token = """""""""/perl_root/lib/site_perl/VMS_''arch'""""""""  /**/"
  10252. ! $   Call update_file "''p2'" "#define SITEARCH_EXP" "''token'"
  10253. ! $   If .not.$Status Then Exit $Status
  10254. ! $EndIf
  10255.   $!
  10256.   $ token = "''perl_version'"
  10257.   $ If sublevel.eqs."" Then token = token + "  "
  10258.  
  10259.  
  10260. #: vms/vms.c
  10261. #:    Fix bugs in VMS <--> Unix filespec translation
  10262. #:    Clarify copyright notices
  10263. #:    Downcase VMS filespecs translated from Unix paths with
  10264. #:    lowercase characters
  10265. #:    Add rmsexpand routine to expand filespecs
  10266. diff -crN perl5.002_01/vms/vms.c perl5.003/vms/vms.c
  10267. *** perl5.002_01/vms/vms.c    Mon Mar 25 01:06:07 1996
  10268. --- perl5.003/vms/vms.c    Mon Jun 24 15:46:32 1996
  10269. ***************
  10270. *** 2,9 ****
  10271.    *
  10272.    * VMS-specific routines for perl5
  10273.    *
  10274. !  * Last revised: 20-Mar-1996 by Charles Bailey  bailey@genetics.upenn.edu
  10275. !  * Version: 5.2.1
  10276.    */
  10277.   
  10278.   #include <acedef.h>
  10279. --- 2,9 ----
  10280.    *
  10281.    * VMS-specific routines for perl5
  10282.    *
  10283. !  * Last revised: 24-Jun-1996 by Charles Bailey  bailey@genetics.upenn.edu
  10284. !  * Version: 5.3.0
  10285.    */
  10286.   
  10287.   #include <acedef.h>
  10288. ***************
  10289. *** 57,62 ****
  10290. --- 57,68 ----
  10291.     unsigned short int *retlen;
  10292.   };
  10293.   
  10294. + static char *__mystrtolower(char *str)
  10295. + {
  10296. +   if (str) for (; *str; ++str) *str= tolower(*str);
  10297. +   return str;
  10298. + }
  10299.   int
  10300.   my_trnlnm(char *lnm, char *eqv, unsigned long int idx)
  10301.   {
  10302. ***************
  10303. *** 768,778 ****
  10304.   **   tovmsspec() - convert any file spec into a VMS-style spec.
  10305.   **
  10306.   ** Copyright 1996 by Charles Bailey  <bailey@genetics.upenn.edu>
  10307. ! ** Permission is given for non-commercial use of this code according
  10308. ! ** to the terms of the GNU General Public License or the Perl
  10309. ! ** Artistic License.  Copies of each may be found in the Perl
  10310. ! ** standard distribution.  This software is supplied without any
  10311. ! ** warranty whatsoever.
  10312.    */
  10313.   
  10314.   static char *do_tounixspec(char *, char *, int);
  10315. --- 774,783 ----
  10316.   **   tovmsspec() - convert any file spec into a VMS-style spec.
  10317.   **
  10318.   ** Copyright 1996 by Charles Bailey  <bailey@genetics.upenn.edu>
  10319. ! ** Permission is given to distribute this code as part of the Perl
  10320. ! ** standard distribution under the terms of the GNU General Public
  10321. ! ** License or the Perl Artistic License.  Copies of each may be
  10322. ! ** found in the Perl standard distribution.
  10323.    */
  10324.   
  10325.   static char *do_tounixspec(char *, char *, int);
  10326. ***************
  10327. *** 789,795 ****
  10328.         set_errno(EINVAL); set_vaxc_errno(SS$_BADPARAM); return NULL;
  10329.       }
  10330.       dirlen = strlen(dir);
  10331. !     if (dir[dirlen-1] == '/') dir[--dirlen] = '\0';
  10332.       if (!dirlen) {
  10333.         set_errno(ENOTDIR);
  10334.         set_vaxc_errno(RMS$_DIR);
  10335. --- 794,800 ----
  10336.         set_errno(EINVAL); set_vaxc_errno(SS$_BADPARAM); return NULL;
  10337.       }
  10338.       dirlen = strlen(dir);
  10339. !     if (dir[dirlen-1] == '/') --dirlen;
  10340.       if (!dirlen) {
  10341.         set_errno(ENOTDIR);
  10342.         set_vaxc_errno(RMS$_DIR);
  10343. ***************
  10344. *** 801,806 ****
  10345. --- 806,816 ----
  10346.         dir = trndir;
  10347.         dirlen = strlen(dir);
  10348.       }
  10349. +     else {
  10350. +       strncpy(trndir,dir,dirlen);
  10351. +       trndir[dirlen] = '\0';
  10352. +       dir = trndir;
  10353. +     }
  10354.       /* If we were handed a rooted logical name or spec, treat it like a
  10355.        * simple directory, so that
  10356.        *    $ Define myroot dev:[dir.]
  10357. ***************
  10358. *** 824,845 ****
  10359.           dirlen -= 1;                 /* to last element */
  10360.           lastdir = strrchr(dir,'/');
  10361.         }
  10362. !       else if ((cp1 = strstr(trndir,"/.")) != NULL) {
  10363.           do {
  10364.             if (*(cp1+2) == '.') cp1++;
  10365.             if (*(cp1+2) == '/' || *(cp1+2) == '\0') {
  10366. !             addmfd = 1;
  10367. !             break;
  10368.             }
  10369.             cp1++;
  10370.           } while ((cp1 = strstr(cp1,"/.")) != NULL);
  10371. -         /* If we have a relative path, VMSify it and let the VMS code
  10372. -          * below expand it, rather than repeating the code here */
  10373. -         if (addmfd) {
  10374. -           if (do_tovmsspec(trndir,vmsdir,0) == NULL) return NULL;
  10375. -           if (do_fileify_dirspec(vmsdir,trndir,0) == NULL) return NULL;
  10376. -           return do_tounixspec(trndir,buf,ts);
  10377. -         }
  10378.         }
  10379.         else {
  10380.           if (!(lastdir = cp1 = strrchr(dir,'/'))) cp1 = dir;
  10381. --- 834,852 ----
  10382.           dirlen -= 1;                 /* to last element */
  10383.           lastdir = strrchr(dir,'/');
  10384.         }
  10385. !       else if ((cp1 = strstr(dir,"/.")) != NULL) {
  10386. !         /* If we have "/." or "/..", VMSify it and let the VMS code
  10387. !          * below expand it, rather than repeating the code to handle
  10388. !          * relative components of a filespec here */
  10389.           do {
  10390.             if (*(cp1+2) == '.') cp1++;
  10391.             if (*(cp1+2) == '/' || *(cp1+2) == '\0') {
  10392. !             if (do_tovmsspec(dir,vmsdir,0) == NULL) return NULL;
  10393. !             if (do_fileify_dirspec(vmsdir,trndir,0) == NULL) return NULL;
  10394. !             return do_tounixspec(trndir,buf,ts);
  10395.             }
  10396.             cp1++;
  10397.           } while ((cp1 = strstr(cp1,"/.")) != NULL);
  10398.         }
  10399.         else {
  10400.           if (!(lastdir = cp1 = strrchr(dir,'/'))) cp1 = dir;
  10401. ***************
  10402. *** 856,863 ****
  10403.               }
  10404.               dirlen = cp2 - dir;
  10405.             }
  10406. !           else {  /* There's a type, and it's not .dir.  Bzzt. */
  10407. !             set_errno(ENOTDIR);
  10408.               set_vaxc_errno(RMS$_DIR);
  10409.               return NULL;
  10410.             }
  10411. --- 863,870 ----
  10412.               }
  10413.               dirlen = cp2 - dir;
  10414.             }
  10415. !           else {   /* There's a type, and it's not .dir.  Bzzt. */
  10416. !             set_errno(ENOTDIR); 
  10417.               set_vaxc_errno(RMS$_DIR);
  10418.               return NULL;
  10419.             }
  10420. ***************
  10421. *** 894,901 ****
  10422.         return retspec;
  10423.       }
  10424.       else {  /* VMS-style directory spec */
  10425. !       char esa[NAM$C_MAXRSS+1], term;
  10426. !       unsigned long int sts, cmplen, hasdev, hasdir, hastype, hasver;
  10427.         struct FAB dirfab = cc$rms_fab;
  10428.         struct NAM savnam, dirnam = cc$rms_nam;
  10429.   
  10430. --- 901,908 ----
  10431.         return retspec;
  10432.       }
  10433.       else {  /* VMS-style directory spec */
  10434. !       char esa[NAM$C_MAXRSS+1], term, *cp;
  10435. !       unsigned long int sts, cmplen, haslower = 0;
  10436.         struct FAB dirfab = cc$rms_fab;
  10437.         struct NAM savnam, dirnam = cc$rms_nam;
  10438.   
  10439. ***************
  10440. *** 906,911 ****
  10441. --- 913,921 ----
  10442.         dirfab.fab$b_dns = 6;
  10443.         dirnam.nam$b_ess = NAM$C_MAXRSS;
  10444.         dirnam.nam$l_esa = esa;
  10445. +       for (cp = dir; *cp; cp++)
  10446. +         if (islower(*cp)) { haslower = 1; break; }
  10447.         if (!((sts = sys$parse(&dirfab))&1)) {
  10448.           if (dirfab.fab$l_sts == RMS$_DIR) {
  10449.             dirnam.nam$b_nop |= NAM$M_SYNCHK;
  10450. ***************
  10451. *** 1029,1034 ****
  10452. --- 1039,1048 ----
  10453.         /* We've set up the string up through the filename.  Add the
  10454.            type and version, and we're done. */
  10455.         strcat(retspec,".DIR;1");
  10456. +       /* $PARSE may have upcased filespec, so convert output to lower
  10457. +        * case if input contained any lowercase characters. */
  10458. +       if (haslower) __mystrtolower(retspec);
  10459.         return retspec;
  10460.       }
  10461.   }  /* end of do_fileify_dirspec() */
  10462. ***************
  10463. *** 1074,1080 ****
  10464.           retlen = 2 + (*(dir+1) != '\0');
  10465.         else {
  10466.           if (!(cp1 = strrchr(dir,'/'))) cp1 = dir;
  10467. !         if ((cp2 = strchr(cp1,'.')) && *(cp2+1) != '.') {
  10468.             if (toupper(*(cp2+1)) == 'D' &&  /* They specified .dir. */
  10469.                 toupper(*(cp2+2)) == 'I' &&  /* Trim it off. */
  10470.                 toupper(*(cp2+3)) == 'R') {
  10471. --- 1088,1094 ----
  10472.           retlen = 2 + (*(dir+1) != '\0');
  10473.         else {
  10474.           if (!(cp1 = strrchr(dir,'/'))) cp1 = dir;
  10475. !         if ((cp2 = strchr(cp1,'.')) && (*(cp2+1) != '.' && *(cp2+1) != '\0')) {
  10476.             if (toupper(*(cp2+1)) == 'D' &&  /* They specified .dir. */
  10477.                 toupper(*(cp2+2)) == 'I' &&  /* Trim it off. */
  10478.                 toupper(*(cp2+3)) == 'R') {
  10479. ***************
  10480. *** 1101,1108 ****
  10481.         else retpath[retlen-1] = '\0';
  10482.       }
  10483.       else {  /* VMS-style directory spec */
  10484. !       char esa[NAM$C_MAXRSS+1];
  10485. !       unsigned long int sts, cmplen;
  10486.         struct FAB dirfab = cc$rms_fab;
  10487.         struct NAM savnam, dirnam = cc$rms_nam;
  10488.   
  10489. --- 1115,1122 ----
  10490.         else retpath[retlen-1] = '\0';
  10491.       }
  10492.       else {  /* VMS-style directory spec */
  10493. !       char esa[NAM$C_MAXRSS+1], *cp;
  10494. !       unsigned long int sts, cmplen, haslower;
  10495.         struct FAB dirfab = cc$rms_fab;
  10496.         struct NAM savnam, dirnam = cc$rms_nam;
  10497.   
  10498. ***************
  10499. *** 1122,1128 ****
  10500.         dirfab.fab$l_nam = &dirnam;
  10501.         dirnam.nam$b_ess = (unsigned char) sizeof esa - 1;
  10502.         dirnam.nam$l_esa = esa;
  10503. !       if (!((sts = sys$parse(&dirfab))&1)) {
  10504.           if (dirfab.fab$l_sts == RMS$_DIR) {
  10505.             dirnam.nam$b_nop |= NAM$M_SYNCHK;
  10506.             sts = sys$parse(&dirfab) & 1;
  10507. --- 1136,1146 ----
  10508.         dirfab.fab$l_nam = &dirnam;
  10509.         dirnam.nam$b_ess = (unsigned char) sizeof esa - 1;
  10510.         dirnam.nam$l_esa = esa;
  10511. !       for (cp = dir; *cp; cp++)
  10512. !         if (islower(*cp)) { haslower = 1; break; }
  10513. !       if (!(sts = (sys$parse(&dirfab)&1))) {
  10514.           if (dirfab.fab$l_sts == RMS$_DIR) {
  10515.             dirnam.nam$b_nop |= NAM$M_SYNCHK;
  10516.             sts = sys$parse(&dirfab) & 1;
  10517. ***************
  10518. *** 1168,1173 ****
  10519. --- 1186,1194 ----
  10520.         else if (ts) New(7014,retpath,retlen,char);
  10521.         else retpath = __pathify_retbuf;
  10522.         strcpy(retpath,esa);
  10523. +       /* $PARSE may have upcased filespec, so convert output to lower
  10524. +        * case if input contained any lowercase characters. */
  10525. +       if (haslower) __mystrtolower(retpath);
  10526.       }
  10527.   
  10528.       return retpath;
  10529. ***************
  10530. *** 1222,1241 ****
  10531.         strcpy(rslt,"./");
  10532.         return rslt;
  10533.       }
  10534. !     else if (*cp2 == '-') {
  10535. !       while (*cp2 == '-') {
  10536. !         *(cp1++) = '.'; *(cp1++) = '.'; *(cp1++) = '/';
  10537. !         cp2++;
  10538. !       }
  10539. !       if (*cp2 != '.' && *cp2 != ']' && *cp2 != '>') { /* we don't allow */
  10540. !         if (ts) Safefree(rslt);                        /* filespecs like */
  10541. !         set_errno(EINVAL); set_vaxc_errno(RMS$_SYN);   /* [--foo.bar] */
  10542. !         return NULL;
  10543. !       }
  10544. !       cp2++;
  10545. !     }
  10546. !     else if ( *(cp2) != '.') { /* add the implied device into the Unix spec */
  10547. !       *(cp1++) = '/';
  10548.         if (getcwd(tmp,sizeof tmp,1) == NULL) {
  10549.           if (ts) Safefree(rslt);
  10550.           return NULL;
  10551. --- 1243,1250 ----
  10552.         strcpy(rslt,"./");
  10553.         return rslt;
  10554.       }
  10555. !     else if ( *cp2 != '.' && *cp2 != '-') {
  10556. !       *(cp1++) = '/';           /* add the implied device into the Unix spec */
  10557.         if (getcwd(tmp,sizeof tmp,1) == NULL) {
  10558.           if (ts) Safefree(rslt);
  10559.           return NULL;
  10560. ***************
  10561. *** 1258,1264 ****
  10562.           cp1 = rslt + offset;
  10563.         }
  10564.       }
  10565. !     else cp2++;
  10566.     }
  10567.     for (; cp2 <= dirend; cp2++) {
  10568.       if (*cp2 == ':') {
  10569. --- 1267,1273 ----
  10570.           cp1 = rslt + offset;
  10571.         }
  10572.       }
  10573. !     else if (*cp2 == '.') cp2++;
  10574.     }
  10575.     for (; cp2 <= dirend; cp2++) {
  10576.       if (*cp2 == ':') {
  10577. ***************
  10578. *** 1283,1292 ****
  10579.           }
  10580.           if (*cp2 != '.' && *cp2 != ']' && *cp2 != '>') { /* we don't allow */
  10581.             if (ts) Safefree(rslt);                        /* filespecs like */
  10582. !           set_errno(EINVAL); set_vaxc_errno(RMS$_SYN);   /* [--foo.bar] */
  10583.             return NULL;
  10584.           }
  10585. -         cp2++;
  10586.         }
  10587.         else *(cp1++) = *cp2;
  10588.       }
  10589. --- 1292,1300 ----
  10590.           }
  10591.           if (*cp2 != '.' && *cp2 != ']' && *cp2 != '>') { /* we don't allow */
  10592.             if (ts) Safefree(rslt);                        /* filespecs like */
  10593. !           set_errno(EINVAL); set_vaxc_errno(RMS$_SYN);   /* [fred.--foo.bar] */
  10594.             return NULL;
  10595.           }
  10596.         }
  10597.         else *(cp1++) = *cp2;
  10598.       }
  10599. ***************
  10600. *** 1335,1340 ****
  10601. --- 1343,1349 ----
  10602.       int islnm, rooted;
  10603.       STRLEN trnend;
  10604.   
  10605. +     while (*(++cp2) == '/') ;  /* Skip multiple /s */
  10606.       while (*(++cp2) != '/' && *cp2) *(cp1++) = *cp2;
  10607.       *cp1 = '\0';
  10608.       islnm =  my_trnlnm(rslt,trndev,0);
  10609. ***************
  10610. *** 1380,1391 ****
  10611.     }
  10612.     for (; cp2 < dirend; cp2++) {
  10613.       if (*cp2 == '/') {
  10614.         if (*(cp1-1) != '.') *(cp1++) = '.';
  10615.         infront = 0;
  10616.       }
  10617.       else if (!infront && *cp2 == '.') {
  10618. !       if (*(cp2+1) == '/') cp2++;   /* skip over "./" - it's redundant */
  10619. !       else if (*(cp2+1) == '\0') { cp2++; break; }
  10620.         else if (*(cp2+1) == '.' && (*(cp2+2) == '/' || *(cp2+2) == '\0')) {
  10621.           if (*(cp1-1) == '-' || *(cp1-1) == '[') *(cp1++) = '-'; /* handle "../" */
  10622.           else if (*(cp1-2) == '[') *(cp1-1) = '-';
  10623. --- 1389,1401 ----
  10624.     }
  10625.     for (; cp2 < dirend; cp2++) {
  10626.       if (*cp2 == '/') {
  10627. +       if (*(cp2-1) == '/') continue;
  10628.         if (*(cp1-1) != '.') *(cp1++) = '.';
  10629.         infront = 0;
  10630.       }
  10631.       else if (!infront && *cp2 == '.') {
  10632. !       if (cp2+1 == dirend || *(cp2+1) == '\0') { cp2++; break; }
  10633. !       else if (*(cp2+1) == '/') cp2++;   /* skip over "./" - it's redundant */
  10634.         else if (*(cp2+1) == '.' && (*(cp2+2) == '/' || *(cp2+2) == '\0')) {
  10635.           if (*(cp1-1) == '-' || *(cp1-1) == '[') *(cp1++) = '-'; /* handle "../" */
  10636.           else if (*(cp1-2) == '[') *(cp1-1) = '-';
  10637. ***************
  10638. *** 1398,1414 ****
  10639.             }
  10640.           }
  10641.           cp2 += 2;
  10642. !         if (cp2 == dirend) {
  10643. !           if (*(cp1-1) == '.') cp1--;
  10644. !           break;
  10645. !         }
  10646.         }
  10647.         else *(cp1++) = '_';  /* fix up syntax - '.' in name not allowed */
  10648.       }
  10649.       else {
  10650.         if (!infront && *(cp1-1) == '-')  *(cp1++) = '.';
  10651. !       if (*cp2 == '/')      *(cp1++) = '.';
  10652. !       else if (*cp2 == '.') *(cp1++) = '_';
  10653.         else                  *(cp1++) =  *cp2;
  10654.         infront = 1;
  10655.       }
  10656. --- 1408,1420 ----
  10657.             }
  10658.           }
  10659.           cp2 += 2;
  10660. !         if (cp2 == dirend) break;
  10661.         }
  10662.         else *(cp1++) = '_';  /* fix up syntax - '.' in name not allowed */
  10663.       }
  10664.       else {
  10665.         if (!infront && *(cp1-1) == '-')  *(cp1++) = '.';
  10666. !       if (*cp2 == '.')      *(cp1++) = '_';
  10667.         else                  *(cp1++) =  *cp2;
  10668.         infront = 1;
  10669.       }
  10670. ***************
  10671. *** 2655,2666 ****
  10672.   static struct passwd __pwdcache;
  10673.   static char __pw_namecache[UAI$S_IDENT+1];
  10674.   
  10675. - static char *_mystrtolower(char *str)
  10676. - {
  10677. -   if (str) for (; *str; ++str) *str= tolower(*str);
  10678. -   return str;
  10679. - }
  10680.   /*
  10681.    * This routine does most of the work extracting the user information.
  10682.    */
  10683. --- 2661,2666 ----
  10684. ***************
  10685. *** 2737,2743 ****
  10686.       }
  10687.       else
  10688.           strcpy(pwd->pw_unixdir, pwd->pw_dir);
  10689. !     _mystrtolower(pwd->pw_unixdir);
  10690.       return 1;
  10691.   }
  10692.   
  10693. --- 2737,2743 ----
  10694.       }
  10695.       else
  10696.           strcpy(pwd->pw_unixdir, pwd->pw_dir);
  10697. !     __mystrtolower(pwd->pw_unixdir);
  10698.       return 1;
  10699.   }
  10700.   
  10701. ***************
  10702. *** 2817,2823 ****
  10703.         else { _ckvmssts(status); }
  10704.       }
  10705.       __pw_namecache[lname]= '\0';
  10706. !     _mystrtolower(__pw_namecache);
  10707.   
  10708.       __pwdcache = __passwd_empty;
  10709.       __pwdcache.pw_name = __pw_namecache;
  10710. --- 2817,2823 ----
  10711.         else { _ckvmssts(status); }
  10712.       }
  10713.       __pw_namecache[lname]= '\0';
  10714. !     __mystrtolower(__pw_namecache);
  10715.   
  10716.       __pwdcache = __passwd_empty;
  10717.       __pwdcache.pw_name = __pw_namecache;
  10718. ***************
  10719. *** 3067,3072 ****
  10720. --- 3067,3078 ----
  10721.            {0,0,0,0}};
  10722.   
  10723.     if (!fname || !*fname) return FALSE;
  10724. +   /* Make sure we expand logical names, since sys$check_access doesn't */
  10725. +   if (!strpbrk(fname,"/]>:")) {
  10726. +     strcpy(fileified,fname);
  10727. +     while (!strpbrk(fileified,"/]>:>") && my_trnlnm(fileified,fileified,0)) ;
  10728. +     fname = fileified;
  10729. +   }
  10730.     if (!do_tovmsspec(fname,vmsname,1)) return FALSE;
  10731.     retlen = namdsc.dsc$w_length = strlen(vmsname);
  10732.     namdsc.dsc$a_pointer = vmsname;
  10733. ***************
  10734. *** 3231,3240 ****
  10735.    *
  10736.    *  Copyright 1996 by Charles Bailey <bailey@genetics.upenn.edu>.
  10737.    *  Incorporates, with permission, some code from EZCOPY by Tim Adye
  10738. !  *  <T.J.Adye@rl.ac.uk>.  Permission is given to use and distribute this
  10739. !  *  code under the same terms as Perl itself.  (See the GNU General Public
  10740. !  *  License or the Perl Artistic License supplied as part of the Perl
  10741. !  *  distribution.)
  10742.    */
  10743.   /*{{{int rmscopy(char *src, char *dst, int preserve_dates)*/
  10744.   int
  10745. --- 3237,3246 ----
  10746.    *
  10747.    *  Copyright 1996 by Charles Bailey <bailey@genetics.upenn.edu>.
  10748.    *  Incorporates, with permission, some code from EZCOPY by Tim Adye
  10749. !  *  <T.J.Adye@rl.ac.uk>.  Permission is given to distribute this code
  10750. !  * as part of the Perl standard distribution under the terms of the
  10751. !  * GNU General Public License or the Perl Artistic License.  Copies
  10752. !  * of each may be found in the Perl standard distribution.
  10753.    */
  10754.   /*{{{int rmscopy(char *src, char *dst, int preserve_dates)*/
  10755.   int
  10756. ***************
  10757. *** 3403,3408 ****
  10758. --- 3409,3463 ----
  10759.    */
  10760.   
  10761.   void
  10762. + rmsexpand_fromperl(CV *cv)
  10763. + {
  10764. +   dXSARGS;
  10765. +   char esa[NAM$C_MAXRSS], rsa[NAM$C_MAXRSS], *cp, *out;
  10766. +   struct FAB myfab = cc$rms_fab;
  10767. +   struct NAM mynam = cc$rms_nam;
  10768. +   STRLEN speclen;
  10769. +   unsigned long int retsts, haslower = 0;
  10770. +   myfab.fab$l_fna = SvPV(ST(0),speclen);
  10771. +   myfab.fab$b_fns = speclen;
  10772. +   myfab.fab$l_nam = &mynam;
  10773. +   mynam.nam$l_esa = esa;
  10774. +   mynam.nam$b_ess = sizeof esa;
  10775. +   mynam.nam$l_rsa = rsa;
  10776. +   mynam.nam$b_rss = sizeof rsa;
  10777. +   retsts = sys$parse(&myfab,0,0);
  10778. +   if (!(retsts & 1)) {
  10779. +     set_vaxc_errno(retsts);
  10780. +     if      (retsts == RMS$_PRV) set_errno(EACCES);
  10781. +     else if (retsts == RMS$_DEV) set_errno(ENODEV);
  10782. +     else if (retsts == RMS$_DIR) set_errno(ENOTDIR);
  10783. +     else                         set_errno(EVMSERR);
  10784. +     XSRETURN_UNDEF;
  10785. +   }
  10786. +   retsts = sys$search(&myfab,0,0);
  10787. +   if (!(retsts & 1) && retsts != RMS$_FNF) {
  10788. +     set_vaxc_errno(retsts);
  10789. +     if      (retsts == RMS$_PRV) set_errno(EACCES);
  10790. +     else                         set_errno(EVMSERR);
  10791. +     XSRETURN_UNDEF;
  10792. +   }
  10793. +   /* If the input filespec contained any lowercase characters,
  10794. +    * downcase the result for compatibility with Unix-minded code. */
  10795. +   for (out = myfab.fab$l_fna; *out; out++)
  10796. +     if (islower(*out)) { haslower = 1; break; }
  10797. +   if (mynam.nam$b_rsl) { out = rsa; speclen = mynam.nam$b_rsl; }
  10798. +   else                 { out = esa; speclen = mynam.nam$b_esl; }
  10799. +   if (!(mynam.nam$l_fnb & NAM$M_EXP_VER))
  10800. +     speclen = mynam.nam$l_type - out;
  10801. +   out[speclen] = '\0';
  10802. +   if (haslower) __mystrtolower(out);
  10803. +   ST(0) = sv_2mortal(newSVpv(out, speclen));
  10804. + }
  10805. + void
  10806.   vmsify_fromperl(CV *cv)
  10807.   {
  10808.     dXSARGS;
  10809. ***************
  10810. *** 3569,3574 ****
  10811. --- 3624,3630 ----
  10812.   {
  10813.     char* file = __FILE__;
  10814.   
  10815. +   newXSproto("VMS::Filespec::rmsexpand",rmsexpand_fromperl,file,"$");
  10816.     newXSproto("VMS::Filespec::vmsify",vmsify_fromperl,file,"$");
  10817.     newXSproto("VMS::Filespec::unixify",unixify_fromperl,file,"$");
  10818.     newXSproto("VMS::Filespec::pathify",pathify_fromperl,file,"$");
  10819.  
  10820. #:  End of patch  :#
  10821.