home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl501m.zip / patches / patch.1k < prev    next >
Text File  |  1995-06-06  |  123KB  |  3,662 lines

  1. # This is my patch  patch.1k for perl5.001.  See description below.
  2. #    Andy Dougherty        doughera@lafcol.lafayette.edu
  3. #
  4.  
  5. # Please execute the following command before applying this patch.
  6. # (You can feed this patch to 'sh' to do so.)
  7.  
  8. # This is not needed.
  9. rm -f ext/Fcntl/MANIFEST
  10. exit
  11.  
  12. This is my patch  patch.1k  for perl5.001.
  13.  
  14. This patch brings you MakeMaker-4.15.  This is MakeMaker-4.13 plus
  15. patches to provide the LD_RUN_PATH environment variable for building
  16. shared libraries, and the appropriate -I flags for running xsubpp
  17. while building perl.
  18.  
  19. To apply, change to your perl directory, run the command above, then
  20. apply with
  21.     patch -p1 -N  < thispatch.
  22.  
  23. After you apply this patch, you should apply patch.1l.
  24.  
  25. Patch and enjoy,
  26.     
  27.     Andy Dougherty        doughera@lafcol.lafayette.edu
  28.     Dept. of Physics
  29.     Lafayette College, Easton PA 18042
  30.  
  31.  
  32. Index: MANIFEST
  33. *** perl5.001j/MANIFEST    Mon Jun  5 14:14:23 1995
  34. --- perl5.001k/MANIFEST    Tue Jun  6 14:17:58 1995
  35. ***************
  36. *** 98,104 ****
  37.   ext/DynaLoader/dlutils.c    Dynamic loader utilities for dl_*.xs files
  38.   ext/Fcntl/Fcntl.pm        Fcntl extension Perl module
  39.   ext/Fcntl/Fcntl.xs        Fcntl extension external subroutines
  40. - ext/Fcntl/MANIFEST        Fcntl extension file list
  41.   ext/Fcntl/Makefile.PL        Fcntl extension makefile writer
  42.   ext/GDBM_File/GDBM_File.pm    GDBM extension Perl module
  43.   ext/GDBM_File/GDBM_File.xs    GDBM extension external subroutines
  44. --- 98,103 ----
  45. ***************
  46. *** 249,255 ****
  47. --- 248,257 ----
  48.   lib/English.pm        Readable aliases for short variables
  49.   lib/Env.pm        Map environment into ordinary variables
  50.   lib/Exporter.pm        Exporter base class
  51. + lib/ExtUtils/Liblist.pm    Locates libraries
  52.   lib/ExtUtils/MakeMaker.pm    Write Makefiles for extensions
  53. + lib/ExtUtils/Manifest.pm    Utilities to write MANIFEST files
  54. + lib/ExtUtils/Mkbootstrap.pm    Writes a bootstrap file (see MakeMaker)
  55.   lib/ExtUtils/typemap        Extension interface types
  56.   lib/ExtUtils/xsubpp        External subroutine preprocessor
  57.   lib/File/Basename.pm    A module to emulate the basename program
  58. Index: ext/DynaLoader/Makefile.PL
  59. *** perl5.001j/ext/DynaLoader/Makefile.PL    Thu Jan 19 18:58:50 1995
  60. --- perl5.001k/ext/DynaLoader/Makefile.PL    Tue Jun  6 12:24:37 1995
  61. ***************
  62. *** 11,23 ****
  63.   sub MY::postamble {
  64.       '
  65.   DynaLoader.c: $(DLSRC)
  66. !     $(PERL) $(XSUBPP) $(XSUBPPARGS) $(DLSRC) >tmp && mv tmp $@
  67.   
  68.   # Perform very simple tests just to check for major gaffs.
  69.   # We can\'t do much more for platforms we are not executing on.
  70.   test-xs:
  71.       for i in dl_*xs; \
  72. !         do $(PERL) $(XSUBPP) $(XSUBPPARGS) $$i > /dev/null; \
  73.       done
  74.   ';
  75.   }
  76. --- 11,23 ----
  77.   sub MY::postamble {
  78.       '
  79.   DynaLoader.c: $(DLSRC)
  80. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSUBPPARGS) $(DLSRC) >tmp && mv tmp $@
  81.   
  82.   # Perform very simple tests just to check for major gaffs.
  83.   # We can\'t do much more for platforms we are not executing on.
  84.   test-xs:
  85.       for i in dl_*xs; \
  86. !         do $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSUBPPARGS) $$i > /dev/null; \
  87.       done
  88.   ';
  89.   }
  90. Index: lib/ExtUtils/Liblist.pm
  91. *** /dev/null    Mon Jun  5 17:45:32 1995
  92. --- perl5.001k/lib/ExtUtils/Liblist.pm    Mon Jun  5 17:01:51 1995
  93. ***************
  94. *** 0 ****
  95. --- 1,151 ----
  96. + package ExtUtils::Liblist;
  97. + require ExtUtils::MakeMaker; # currently for MM_Unix::lsdir
  98. + # Broken out of MakeMaker from version 4.11
  99. + use Config;
  100. + use Cwd;
  101. + # --- Determine libraries to use and how to use them ---
  102. + sub ext {
  103. +     my($potential_libs, $Verbose) = @_;
  104. +     return ("", "", "") unless $potential_libs;
  105. +     print STDOUT "Potential libraries are '$potential_libs':" if $Verbose;
  106. +     my($so)   = $Config{'so'};
  107. +     my($libs) = $Config{'libs'};
  108. +     # compute $extralibs, $bsloadlibs and $ldloadlibs from
  109. +     # $potential_libs
  110. +     # this is a rewrite of Andy Dougherty's extliblist in perl
  111. +     # its home is in <distribution>/ext/util
  112. +     my(@searchpath); # from "-L/path" entries in $potential_libs
  113. +     my(@libpath) = split " ", $Config{'libpth'};
  114. +     my(@ldloadlibs, @bsloadlibs, @extralibs);
  115. +     my($fullname, $thislib, $thispth, @fullname);
  116. +     my($pwd) = fastcwd(); # from Cwd.pm
  117. +     my($found) = 0;
  118. +     foreach $thislib (split ' ', $potential_libs){
  119. +     # Handle possible linker path arguments.
  120. +     if ($thislib =~ s/^(-[LR])//){    # save path flag type
  121. +         my($ptype) = $1;
  122. +         unless (-d $thislib){
  123. +         print STDOUT "$ptype$thislib ignored, directory does not exist\n"
  124. +             if $Verbose;
  125. +         next;
  126. +         }
  127. +         if ($thislib !~ m|^/|) {
  128. +           print STDOUT "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n";
  129. +           $thislib = "$pwd/$thislib";
  130. +         }
  131. +         push(@searchpath, $thislib);
  132. +         push(@extralibs,  "$ptype$thislib");
  133. +         push(@ldloadlibs, "$ptype$thislib");
  134. +         next;
  135. +     }
  136. +     # Handle possible library arguments.
  137. +     unless ($thislib =~ s/^-l//){
  138. +       print STDOUT "Unrecognized argument in LIBS ignored: '$thislib'\n";
  139. +       next;
  140. +     }
  141. +     my($found_lib)=0;
  142. +     foreach $thispth (@searchpath, @libpath){
  143. +         # Try to find the full name of the library.  We need this to
  144. +         # determine whether it's a dynamically-loadable library or not.
  145. +         # This tends to be subject to various os-specific quirks.
  146. +         # For gcc-2.6.2 on linux (March 1995), DLD can not load
  147. +         # .sa libraries, with the exception of libm.sa, so we
  148. +         # deliberately skip them.
  149. +         if (@fullname = MM_Unix::lsdir($thispth,"^lib$thislib\.$so\.[0-9]+")){
  150. +         # Take care that libfoo.so.10 wins against libfoo.so.9.
  151. +         # Compare two libraries to find the most recent version
  152. +         # number.  E.g.  if you have libfoo.so.9.0.7 and
  153. +         # libfoo.so.10.1, first convert all digits into two
  154. +         # decimal places.  Then we'll add ".00" to the shorter
  155. +         # strings so that we're comparing strings of equal length
  156. +         # Thus we'll compare libfoo.so.09.07.00 with
  157. +         # libfoo.so.10.01.00.  Some libraries might have letters
  158. +         # in the version.  We don't know what they mean, but will
  159. +         # try to skip them gracefully -- we'll set any letter to
  160. +         # '0'.  Finally, sort in reverse so we can take the
  161. +         # first element.
  162. +         #TODO: iterate through the directory instead of sorting
  163. +         $fullname = "$thispth/" .
  164. +         (sort { my($ma) = $a;
  165. +             my($mb) = $b;
  166. +             $ma =~ tr/A-Za-z/0/s;
  167. +             $ma =~ s/\b(\d)\b/0$1/g;
  168. +             $mb =~ tr/A-Za-z/0/s;
  169. +             $mb =~ s/\b(\d)\b/0$1/g;
  170. +             while (length($ma) < length($mb)) { $ma .= ".00"; }
  171. +             while (length($mb) < length($ma)) { $mb .= ".00"; }
  172. +             # Comparison deliberately backwards
  173. +             $mb cmp $ma;} @fullname)[0];
  174. +         } elsif (-f ($fullname="$thispth/lib$thislib.$so")
  175. +          && (($Config{'dlsrc'} ne "dl_dld.xs") || ($thislib eq "m"))){
  176. +         } elsif (-f ($fullname="$thispth/lib${thislib}_s.a")
  177. +          && ($thislib .= "_s") ){ # we must explicitly use _s version
  178. +         } elsif (-f ($fullname="$thispth/lib$thislib.a")){
  179. +         } elsif (-f ($fullname="$thispth/Slib$thislib.a")){
  180. +         } else {
  181. +         print STDOUT "$thislib not found in $thispth" if $Verbose;
  182. +         next;
  183. +         }
  184. +         print STDOUT "'-l$thislib' found at $fullname" if $Verbose;
  185. +         $found++;
  186. +         $found_lib++;
  187. +         # Now update library lists
  188. +         # what do we know about this library...
  189. +         my $is_dyna = ($fullname !~ /\.a$/);
  190. +         my $in_perl = ($libs =~ /\B-l${thislib}\b/s);
  191. +         # Do not add it into the list if it is already linked in
  192. +         # with the main perl executable.
  193. +         # We have to special-case the NeXT, because all the math 
  194. +         # is also in libsys_s
  195. +         unless ($in_perl || 
  196. +             ($Config{'osname'} eq 'next' && $thislib eq 'm') ){
  197. +         push(@extralibs, "-l$thislib");
  198. +         }
  199. +         # We might be able to load this archive file dynamically
  200. +         if ( $Config{'dlsrc'} =~ /dl_next|dl_dld/){
  201. +         # We push -l$thislib instead of $fullname because
  202. +         # it avoids hardwiring a fixed path into the .bs file.
  203. +         # Mkbootstrap will automatically add dl_findfile() to
  204. +         # the .bs file if it sees a name in the -l format.
  205. +         # USE THIS, when dl_findfile() is fixed: 
  206. +         # push(@bsloadlibs, "-l$thislib");
  207. +         # OLD USE WAS while checking results against old_extliblist
  208. +         push(@bsloadlibs, "$fullname");
  209. +         } else {
  210. +         if ($is_dyna){
  211. +                     # For SunOS4, do not add in this shared library if
  212. +                     # it is already linked in the main perl executable
  213. +             push(@ldloadlibs, "-l$thislib")
  214. +             unless ($in_perl and $Config{'osname'} eq 'sunos');
  215. +         } else {
  216. +             push(@ldloadlibs, "-l$thislib");
  217. +         }
  218. +         }
  219. +         last;    # found one here so don't bother looking further
  220. +     }
  221. +     print STDOUT "Warning (non-fatal): No library found for -l$thislib" 
  222. +         unless $found_lib>0;
  223. +     }
  224. +     return ('','','') unless $found;
  225. +     ("@extralibs", "@bsloadlibs", "@ldloadlibs");
  226. + }
  227. + 1;
  228. Index: lib/ExtUtils/MakeMaker.pm
  229. *** perl5.001j/lib/ExtUtils/MakeMaker.pm    Tue May 30 14:56:48 1995
  230. --- perl5.001k/lib/ExtUtils/MakeMaker.pm    Tue Jun  6 14:11:40 1995
  231. ***************
  232. *** 1,6 ****
  233.   package ExtUtils::MakeMaker;
  234.   
  235. ! $Version = 4.095; # Last edited 17 Apr 1995 by Andy Dougherty
  236.   
  237.   use Config;
  238.   use Carp;
  239. --- 1,11 ----
  240.   package ExtUtils::MakeMaker;
  241.   
  242. ! $Version = 4.15; # Last edited $Date: 1995/06/06 14:04:00 $ by Andreas Koenig
  243. ! $Version_OK = 4.13;    # Makefiles older than $Version_OK will die
  244. !             # (Will be checked from MakeMaker version 4.13 onwards)
  245. ! # $Id: MakeMaker.pm,v 1.21 1995/06/06 06:14:16 k Exp k $
  246.   
  247.   use Config;
  248.   use Carp;
  249. ***************
  250. *** 8,17 ****
  251.   
  252.   require Exporter;
  253.   @ISA = qw(Exporter);
  254. ! @EXPORT = qw(&WriteMakefile $Verbose);
  255. ! @EXPORT_OK = qw($Version %att %skip %Recognized_Att_Keys
  256.       @MM_Sections %MM_Sections
  257. !     &help &lsdir &neatvalue &mkbootstrap &mksymlists);
  258.   
  259.   $Is_VMS = $Config{'osname'} eq 'VMS';
  260.   require ExtUtils::MM_VMS if $Is_VMS;
  261. --- 13,22 ----
  262.   
  263.   require Exporter;
  264.   @ISA = qw(Exporter);
  265. ! @EXPORT = qw(&WriteMakefile $Verbose &prompt);
  266. ! @EXPORT_OK = qw($Version &Version_check %att %skip %Recognized_Att_Keys
  267.       @MM_Sections %MM_Sections
  268. !     &help &neatvalue &mkbootstrap &mksymlists);
  269.   
  270.   $Is_VMS = $Config{'osname'} eq 'VMS';
  271.   require ExtUtils::MM_VMS if $Is_VMS;
  272. ***************
  273. *** 22,278 ****
  274.   $Verbose = 0;
  275.   $^W=1;
  276.   
  277. ! =head1 NAME
  278. ! ExtUtils::MakeMaker - create an extension Makefile
  279. ! =head1 SYNOPSIS
  280. ! C<use ExtUtils::MakeMaker;>
  281. ! C<WriteMakefile( ATTRIBUTE =E<gt> VALUE [, ...] );>
  282. ! =head1 DESCRIPTION
  283. ! This utility is designed to write a Makefile for an extension module
  284. ! from a Makefile.PL. It is based on the Makefile.SH model provided by
  285. ! Andy Dougherty and the perl5-porters.
  286. ! It splits the task of generating the Makefile into several subroutines
  287. ! that can be individually overridden.  Each subroutine returns the text
  288. ! it wishes to have written to the Makefile.
  289. ! MakeMaker.pm uses the architecture specific information from
  290. ! Config.pm. In addition the extension may contribute to the C<%Config>
  291. ! hash table of Config.pm by supplying hints files in a C<hints/>
  292. ! directory. The hints files are expected to be named like their
  293. ! counterparts in C<PERL_SRC/hints>, but with an C<.pl> file name
  294. ! extension (eg. C<next_3_2.pl>). They are simply C<eval>ed by MakeMaker
  295. ! within the WriteMakefile() subroutine, and can be used to execute
  296. ! commands as well as to include special variables. If there is no
  297. ! hintsfile for the actual system, but for some previous releases of the
  298. ! same operating system, the latest one of those is used.
  299. ! =head2 Default Makefile Behaviour
  300. ! The automatically generated Makefile enables the user of the extension
  301. ! to invoke
  302. !   perl Makefile.PL
  303. !   make
  304. !   make test # optionally set TEST_VERBOSE=1
  305. !   make install # See below
  306. ! The Makefile to be produced may be altered by adding arguments of the
  307. ! form C<KEY=VALUE>. If the user wants to have the extension installed
  308. ! into a directory different from C<$Config{"installprivlib"}> it can be
  309. ! done by specifying
  310. !   perl Makefile.PL INST_LIB=~/myperllib INST_EXE=~/bin
  311. ! Note, that in this example MakeMaker does the tilde expansion for you
  312. ! and INST_ARCHLIB is set to either C<INST_LIB/$Config{"archname"}> if
  313. ! that directory exists and otherwise to INST_LIB.
  314. ! Other interesting targets in the generated Makefile are
  315. !   make config     # to check if the Makefile is up-to-date
  316. !   make clean      # delete local temporary files (Makefile gets renamed)
  317. !   make realclean  # delete all derived files (including installed files)
  318. !   make dist       # produce a gzipped file ready for shipping
  319. ! The macros in the produced Makefile may be overridden on the command
  320. ! line to the make call as in the following example:
  321. !   make INST_LIB=/some/where INST_ARCHLIB=/some/where INST_EXE=/u/k/bin
  322. ! Note, that this is a solution provided by C<make> in general, so tilde
  323. ! expansion will probably not be available and INST_ARCHLIB will not be
  324. ! set automatically when INST_LIB is given as argument.
  325. ! The generated Makefile does not set any permissions. The installer has
  326. ! to decide, which umask should be in effect.
  327. ! =head2 Special case C<make install>
  328. ! The I<install> target of the generated Makefile is for system
  329. ! administrators only that have writing permissions on the
  330. ! system-specific directories $Config{installprivlib},
  331. ! $Config{installarchlib}, and $Config{installbin}. This works, because
  332. ! C<make> alone in fact puts all relevant files into directories that
  333. ! are named by the macros INST_LIB, INST_ARCHLIB, and INST_EXE. All
  334. ! three default to ./blib if you are not building below the perl source
  335. ! directory. C<make install> is just a recursive call to C<make> with
  336. ! the three relevant parameters set accordingly to the system-wide
  337. ! defaults.
  338. ! C<make install> per default writes some documentation of what has been
  339. ! done into the file C<$Config{'installarchlib'}/perllocal.pod>. This is
  340. ! an experimental feature. It can be bypassed by calling C<make
  341. ! pure_install>.
  342. ! Users that do not have privileges on the system but want to install
  343. ! the relevant files of the module into their private library or binary
  344. ! directories do not call C<make install>. In priciple they have the
  345. ! choice to either say
  346. !     # case: trust the module
  347. !     perl Makefile.PL INST_LIB=~/perllib INST_EXE=~/bin
  348. !     make
  349. !     make test
  350. ! or
  351. !     # case: want to run tests before installation
  352. !     perl Makefile.PL
  353. !     make
  354. !     make test
  355. !     make INST_LIB=/some/where INST_ARCHLIB=/foo/bar INST_EXE=/somebin
  356. ! (C<make test> is not necessarily supported for all modules.)
  357. ! =head2 Support to Link a new Perl Binary
  358. ! An extension that is built with the above steps is ready to use on
  359. ! systems supporting dynamic loading. On systems that do not support
  360. ! dynamic loading, any newly created extension has to be linked together
  361. ! with the available ressources. MakeMaker supports the linking process
  362. ! by creating appropriate targets in the Makefile whenever an extension
  363. ! is built. You can invoke the corresponding section of the makefile with
  364. !     make perl
  365. ! That produces a new perl binary in the current directory with all
  366. ! extensions linked in that can be found in INST_ARCHLIB and
  367. ! PERL_ARCHLIB.
  368. ! The binary can be installed into the directory where perl normally
  369. ! resides on your machine with
  370. !     make inst_perl
  371. ! To produce a perl binary with a different name than C<perl>, either say
  372. !     perl Makefile.PL MAP_TARGET=myperl
  373. !     make myperl
  374. !     make inst_perl
  375. ! or say
  376. !     perl Makefile.PL
  377. !     make myperl MAP_TARGET=myperl
  378. !     make inst_perl MAP_TARGET=myperl
  379. ! In any case you will be prompted with the correct invocation of the
  380. ! C<inst_perl> target that installs the new binary into
  381. ! $Config{'installbin'}.
  382. ! Note, that there is a C<makeaperl> scipt in the perl distribution,
  383. ! that supports the linking of a new perl binary in a similar fashion,
  384. ! but with more options.
  385. ! C<make inst_perl> per default writes some documentation of what has been
  386. ! done into the file C<$Config{'installarchlib'}/perllocal.pod>. This
  387. ! can be bypassed by calling C<make pure_inst_perl>.
  388. ! Warning: the inst_perl: target is rather mighty and will probably
  389. ! overwrite your existing perl binary. Use with care!
  390. ! =head2 Determination of Perl Library and Installation Locations
  391. ! MakeMaker needs to know, or to guess, where certain things are
  392. ! located.  Especially INST_LIB and INST_ARCHLIB (where to install files
  393. ! into), PERL_LIB and PERL_ARCHLIB (where to read existing modules
  394. ! from), and PERL_INC (header files and C<libperl*.*>).
  395. ! Extensions may be built either using the contents of the perl source
  396. ! directory tree or from an installed copy of the perl library.
  397. ! If an extension is being built below the C<ext/> directory of the perl
  398. ! source then MakeMaker will set PERL_SRC automatically (e.g., C<../..>).
  399. ! If PERL_SRC is defined then other variables default to the following:
  400. !   PERL_INC     = PERL_SRC
  401. !   PERL_LIB     = PERL_SRC/lib
  402. !   PERL_ARCHLIB = PERL_SRC/lib
  403. !   INST_LIB     = PERL_LIB
  404. !   INST_ARCHLIB = PERL_ARCHLIB
  405. ! If an extension is being built away from the perl source then MakeMaker
  406. ! will leave PERL_SRC undefined and default to using the installed copy
  407. ! of the perl library. The other variables default to the following:
  408. !   PERL_INC     = $archlib/CORE
  409. !   PERL_LIB     = $privlib
  410. !   PERL_ARCHLIB = $archlib
  411. !   INST_LIB     = ./blib
  412. !   INST_ARCHLIB = ./blib
  413. ! If perl has not yet been installed then PERL_SRC can be defined on the
  414. ! command line as shown in the previous section.
  415. ! =head2 Useful Default Makefile Macros
  416. ! FULLEXT = Pathname for extension directory (eg DBD/Oracle).
  417. ! BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
  418. ! ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)
  419. ! PERL_LIB = Directory where we read the perl library files
  420. ! PERL_ARCHLIB = Same as above for architecture dependent files
  421. ! INST_LIB = Directory where we put library files of this extension
  422. ! while building it. If we are building below PERL_SRC/ext
  423. ! we default to PERL_SRC/lib, else we default to ./blib.
  424. ! INST_ARCHLIB = Same as above for architecture dependent files
  425. ! INST_LIBDIR = C<$(INST_LIB)$(ROOTEXT)>
  426. ! INST_AUTODIR = C<$(INST_LIB)/auto/$(FULLEXT)>
  427. ! INST_ARCHAUTODIR = C<$(INST_ARCHLIB)/auto/$(FULLEXT)>
  428. ! =head2 Customizing The Generated Makefile
  429. ! If the Makefile generated does not fit your purpose you can change it
  430. ! using the mechanisms described below.
  431. ! =head2 Using Attributes (and Parameters)
  432. ! The following attributes can be specified as arguments to WriteMakefile()
  433. ! or as NAME=VALUE pairs on the command line:
  434. ! This description is not yet documented; you can get at the description
  435. ! with the command
  436. ! C<perl Makefile.PL help>    (if you already have a basic Makefile.PL)
  437. ! or
  438. ! C<perl -e 'use ExtUtils::MakeMaker qw(&help); &help;'>
  439. ! =head2 Overriding MakeMaker Methods
  440. ! If you cannot achieve the desired Makefile behaviour by specifying
  441. ! attributes you may define private subroutines in the Makefile.PL.
  442. ! Each subroutines returns the text it wishes to have written to
  443. ! the Makefile. To override a section of the Makefile you can
  444. ! either say:
  445. !     sub MY::c_o { "new literal text" }
  446. ! or you can edit the default by saying something like:
  447. !     sub MY::c_o { $_=MM->c_o; s/old text/new text/; $_ }
  448. ! If you still need a different solution, try to develop another
  449. ! subroutine, that fits your needs and submit the diffs to
  450. ! F<perl5-porters@nicoh.com> or F<comp.lang.perl> as appropriate.
  451. ! =cut
  452.   
  453.   sub check_hints {
  454.       # We allow extension-specific hints files.
  455. --- 27,44 ----
  456.   $Verbose = 0;
  457.   $^W=1;
  458.   
  459. ! sub prompt {
  460. !     my($mess,$def)=@_;
  461. !     local $\="";
  462. !     local $/="\n";
  463. !     local $|=1;
  464. !     die "prompt function called without an argument" unless defined $mess;
  465. !     $def = "" unless defined $def;
  466. !     my $dispdef = "[$def] ";
  467. !     print "$mess $dispdef";
  468. !     chop(my $ans = <STDIN>);
  469. !     $ans || $def;
  470. ! }
  471.   
  472.   sub check_hints {
  473.       # We allow extension-specific hints files.
  474. ***************
  475. *** 282,287 ****
  476. --- 48,54 ----
  477.       my($hint)="$Config{'osname'}_$Config{'osvers'}";
  478.       $hint =~ s/\./_/g;
  479.       $hint =~ s/_$//;
  480. +     local(*DIR);
  481.       opendir DIR, "hints";
  482.       while (defined ($_ = readdir DIR)) {
  483.       next if /^\./;
  484. ***************
  485. *** 331,349 ****
  486.    VERSION:    Your version number for distributing the package.
  487.           This defaults to 0.1.
  488.   
  489. !  INST_LIB:    Perl library directory to install the module into.
  490. !  INST_ARCHLIB:    Perl architecture-dependent library to install into
  491. !         (defaults to INST_LIB)
  492.   
  493.    PERL_LIB:    Directory containing the Perl library to use.
  494.    PERL_SRC:    Directory containing the Perl source code
  495.           (use of this should be avoided, it may be undefined)
  496.   
  497.    INC:        Include file dirs eg: '-I/usr/5include -I/path/to/inc'
  498.    DEFINE:    something like "-DHAVE_UNISTD_H"
  499.    OBJECT:    List of object files, defaults to '$(BASEEXT).o',
  500.           but can be a long string containing all object files,
  501.               e.g. "tkpBind.o tkpButton.o tkpCanvas.o"
  502.    MYEXTLIB:    If the extension links to a library that it builds
  503.           set this to the name of the library (see SDBM_File)
  504.   
  505. --- 98,134 ----
  506.    VERSION:    Your version number for distributing the package.
  507.           This defaults to 0.1.
  508.   
  509. !  INST_LIB:    Perl library directory to directly install
  510. !         into during 'make'.
  511. !  INSTALLPRIVLIB:Used by 'make install', which sets INST_LIB to this value.
  512. !  INST_ARCHLIB:    Perl architecture-dependent library to directly install
  513. !         into during 'make'.
  514. !  INSTALLARCHLIB:Used by 'make install', which sets INST_ARCHLIB to this value.
  515. !  INST_EXE:    Directory, where executable scripts should be installed during
  516. !         'make'. Defaults to "./blib", just to have a dummy location
  517. !         during testing. C<make install> will set INST_EXE to INSTALLBIN.
  518. !  INSTALLBIN:    Used by 'make install' which sets INST_EXE to this value.
  519.   
  520.    PERL_LIB:    Directory containing the Perl library to use.
  521. +  PERL_ARCHLIB:    Architectur dependent directory containing the Perl library to use.
  522.    PERL_SRC:    Directory containing the Perl source code
  523.           (use of this should be avoided, it may be undefined)
  524.   
  525.    INC:        Include file dirs eg: '-I/usr/5include -I/path/to/inc'
  526.    DEFINE:    something like "-DHAVE_UNISTD_H"
  527.    OBJECT:    List of object files, defaults to '$(BASEEXT).o',
  528.           but can be a long string containing all object files,
  529.               e.g. "tkpBind.o tkpButton.o tkpCanvas.o"
  530.    MYEXTLIB:    If the extension links to a library that it builds
  531.           set this to the name of the library (see SDBM_File)
  532.   
  533. ***************
  534. *** 398,409 ****
  535.           produce output to the target files themselves.
  536.   
  537.    EXE_FILES:    Ref to array of executable files. The files will be copied to 
  538. !         the INST_EXE directory. The installed files will be deleted 
  539. !         by a make realclean.
  540. !  INST_EXE:    Directory, where executable scripts should be installed. Defaults
  541. !         to "./blib", just to have a dummy location during testing.
  542. !         C<make install> will set INST_EXE to $Config{'installbin'}.
  543.   
  544.    LINKTYPE:    =>'static' or 'dynamic' (default unless usedl=undef in config.sh)
  545.           Should only be used to force static linking (also see linkext below).
  546. --- 183,190 ----
  547.           produce output to the target files themselves.
  548.   
  549.    EXE_FILES:    Ref to array of executable files. The files will be copied to 
  550. !         the INST_EXE directory. Make realclean will delete them from
  551. !         there again.
  552.   
  553.    LINKTYPE:    =>'static' or 'dynamic' (default unless usedl=undef in config.sh)
  554.           Should only be used to force static linking (also see linkext below).
  555. ***************
  556. *** 424,429 ****
  557. --- 205,211 ----
  558.           (e.g. [ qw( Foo_version Foo_numstreams Foo_tree ) ])
  559.   
  560.    CONFIG:    =>[qw(archname manext)] defines ARCHNAME & MANEXT from config.sh
  561.    SKIP:      =>[qw(name1 name2)] skip (do not write) sections of the Makefile
  562.   
  563.    MAP_TARGET:    If it is intended, that a new perl binary be produced, this variable
  564. ***************
  565. *** 439,450 ****
  566.   methods which implement that part of the Makefile. These are not
  567.   normally required:
  568.   
  569.    installpm:    {SPLITLIB => '$(INST_LIB)' (default) or '$(INST_ARCHLIB)'}
  570.    linkext:    {LINKTYPE => 'static', 'dynamic' or ''}
  571.    dynamic_lib:    {ARMAYBE => 'ar', OTHERLDFLAGS => '...'}
  572.    clean:        {FILES => "*.xyz foo"}
  573.    realclean:    {FILES => '$(INST_ARCHAUTODIR)/*.xyz'}
  574. !  dist:        {TARNAME=>'MyTarFile', TARFLAGS=>'cvfF', COMPRESS=>'gzip'}
  575.    tool_autosplit:    {MAXLEN => 8}
  576.   END
  577.   
  578. --- 221,233 ----
  579.   methods which implement that part of the Makefile. These are not
  580.   normally required:
  581.   
  582. +  macro:        {ANY_MACRO => ANY_VALUE, ...}
  583.    installpm:    {SPLITLIB => '$(INST_LIB)' (default) or '$(INST_ARCHLIB)'}
  584.    linkext:    {LINKTYPE => 'static', 'dynamic' or ''}
  585.    dynamic_lib:    {ARMAYBE => 'ar', OTHERLDFLAGS => '...'}
  586.    clean:        {FILES => "*.xyz foo"}
  587.    realclean:    {FILES => '$(INST_ARCHAUTODIR)/*.xyz'}
  588. !  dist:        {TARFLAGS=>'cvfF', COMPRESS=>'gzip', SUFFIX=>'gz', SHAR=>'shar -m'}
  589.    tool_autosplit:    {MAXLEN => 8}
  590.   END
  591.   
  592. ***************
  593. *** 459,464 ****
  594. --- 242,248 ----
  595.       'tool_autosplit'    => {},
  596.       'tool_xsubpp'    => {},
  597.       'tools_other'    => {},
  598. +     'macro'        => {},
  599.       'post_constants'    => {},
  600.       'pasthru'        => {},
  601.       'c_o'        => {},
  602. ***************
  603. *** 530,536 ****
  604.       %att = @_;
  605.       local($\)="\n";
  606.   
  607. !     print STDOUT "MakeMaker" if $Verbose;
  608.   
  609.       parse_args(\%att, @ARGV);
  610.       my(%initial_att) = %att; # record initial attributes
  611. --- 314,345 ----
  612.       %att = @_;
  613.       local($\)="\n";
  614.   
  615. !     print STDOUT "MakeMaker (v$Version)" if $Verbose;
  616. !     if ( Carp::longmess("") =~ "runsubdirpl" ){
  617. !     $Correct_relativ_directories++;
  618. !     } else {
  619. !     $Correct_relativ_directories=0;
  620. !     }
  621. !     if (-f "MANIFEST"){
  622. !     eval {require ExtUtils::Manifest};
  623. !     if ($@){
  624. !         print STDOUT "Warning: you have not installed the ExtUtils::Manifest
  625. !          module -- skipping check of the MANIFEST file";
  626. !     } else {
  627. !         print STDOUT "Checking if your kit is complete...";
  628. !         $ExtUtils::Manifest::Quiet=$ExtUtils::Manifest::Quiet=1; #avoid warning
  629. !         my(@missed)=ExtUtils::Manifest::manicheck();
  630. !         if (@missed){
  631. !         print STDOUT "Warning: the following files are missing in your kit:";
  632. !         print "\t", join "\n\t", @missed;
  633. !         print STDOUT "Please inform the author.\n";
  634. !         } else {
  635. !         print STDOUT "Looks good";
  636. !         }
  637. !     }
  638. !     }
  639.   
  640.       parse_args(\%att, @ARGV);
  641.       my(%initial_att) = %att; # record initial attributes
  642. ***************
  643. *** 543,548 ****
  644. --- 352,371 ----
  645.   
  646.       print STDOUT "Writing Makefile for $att{NAME}";
  647.   
  648. +     if (! $att{PERL_SRC} && 
  649. +     $INC{'Config.pm'} ne "$Config{'archlib'}/Config.pm"){
  650. +     (my $pthinks = $INC{'Config.pm'}) =~ s!/Config\.pm$!!;
  651. +     $pthinks =~ s!.*/!!;
  652. +     print STDOUT <<END;
  653. + Your perl and your Config.pm seem to have different ideas about the architecture
  654. + they are running on.
  655. + Perl thinks: $pthinks
  656. + Config says: $Config{"archname"}
  657. + This may or may not cause problems. Please check your installation of perl if you
  658. + have problems building this extension.
  659. + END
  660. +     }
  661.       MY->init_dirscan();
  662.       MY->init_others();
  663.   
  664. ***************
  665. *** 598,607 ****
  666.       1;
  667.   }
  668.   
  669. ! sub mkbootstrap{
  670. !     parse_args(\%att, @ARGV);
  671. !     MY->mkbootstrap(@_);
  672.   }
  673.   
  674.   sub mksymlists{
  675. --- 421,432 ----
  676.       1;
  677.   }
  678.   
  679. ! sub Version_check {
  680. !     my($checkversion) = @_;
  681. !     die "Your Makefile was built with ExtUtils::MakeMaker v $checkversion.
  682. ! Current Version is $Version. There have been considerable changes in the meantime.
  683. ! Please rerun 'perl Makefile.PL' to regenerate the Makefile.\n" if $checkversion < $Version_OK;
  684. !     print STDOUT "Makefile built with ExtUtils::MakeMaker v $checkversion. Current Version is $Version." unless $checkversion == $Version;
  685.   }
  686.   
  687.   sub mksymlists{
  688. ***************
  689. *** 610,615 ****
  690. --- 435,454 ----
  691.       MY->mksymlists(@_);
  692.   }
  693.   
  694. + # The following mkbootstrap() is only for installations that are calling
  695. + # the pre-4.1 mkbootstrap() from their old Makefiles. This MakeMaker
  696. + # write Makefiles, that use ExtUtils::Mkbootstrap directly.
  697. + sub mkbootstrap{
  698. +     parse_args(\%att, @ARGV);
  699. +     MY->init_main() unless defined $att{BASEEXT};
  700. +     eval {require ExtUtils::Mkbootstrap};
  701. +     if ($@){
  702. +     # Very difficult to arrive here, I suppose
  703. +     carp "Error: $@\nVersion mismatch: This MakeMaker (v$Version) needs the ExtUtils::Mkbootstrap package. Please check your installation.";
  704. +     }
  705. +     ExtUtils::Mkbootstrap::Mkbootstrap($att{BASEEXT},@_);
  706. + }
  707.   sub parse_args{
  708.       my($attr, @args) = @_;
  709.       foreach (@args){
  710. ***************
  711. *** 620,628 ****
  712.       }
  713.       my($name, $value) = ($1, $2);
  714.       if ($value =~ m/^~(\w+)?/){ # tilde with optional username
  715. !         my($home) = ($1) ? (getpwnam($1))[7] : (getpwuid($>))[7];
  716. !         $value =~ s/^~(\w+)?/$home/;
  717.       }
  718.       $$attr{$name} = $value;
  719.       }
  720.       # catch old-style 'potential_libs' and inform user how to 'upgrade'
  721. --- 459,480 ----
  722.       }
  723.       my($name, $value) = ($1, $2);
  724.       if ($value =~ m/^~(\w+)?/){ # tilde with optional username
  725. !         $value =~ s [^~(\w*)]
  726. !         [$1 ? 
  727. !          ((getpwnam($1))[7] || "~$1") : 
  728. !          (getpwuid($>))[7]
  729. !          ]ex;
  730. !     }
  731. !     if ($Correct_relativ_directories){
  732. !         # This is experimental, so we don't care for efficiency
  733. !         my @dirs = qw(INST_LIB INST_ARCHLIB INST_EXE);
  734. !         my %dirs;
  735. !         @dirs{@dirs}=@dirs;
  736. !         if ($dirs{$name} && $value !~ m!^/!){ # a relativ directory
  737. !         $value = "../$value";
  738. !         }
  739.       }
  740.       $$attr{$name} = $value;
  741.       }
  742.       # catch old-style 'potential_libs' and inform user how to 'upgrade'
  743. ***************
  744. *** 692,721 ****
  745.   
  746.   
  747.   sub init_main {
  748.       # Find out directory name.  This may contain the extension name.
  749.       my($pwd) = fastcwd(); # from Cwd.pm
  750.   
  751. !     # --- Initialize PERL_LIB, INST_LIB, PERL_SRC
  752. !     # *Real* information: where did we get these two from? ...
  753. !     my $inc_config_dir = dirname($INC{'Config.pm'});
  754. !     my $inc_carp_dir   = dirname($INC{'Carp.pm'});
  755. !     # Typically PERL_* and INST_* will be identical but that need
  756. !     # not be the case (e.g., installing into project libraries etc).
  757. !     # Perl Macro:    With source    No source
  758.       # PERL_LIB       ../../lib      /usr/local/lib/perl5
  759.       # PERL_ARCHLIB   ../../lib      /usr/local/lib/perl5/sun4-sunos
  760.       # PERL_SRC       ../..          (undefined)
  761.   
  762. !     # INST Macro:    Locally        Publically
  763.       # INST_LIB       ../../lib      ./blib
  764.       # INST_ARCHLIB   ../../lib      ./blib
  765.   
  766.       unless ($att{PERL_SRC}){
  767. !     foreach(qw(../.. ../../.. ../../../..)){
  768. !         if ( -f "$_/config.sh" && -f "$_/perl.h" && -f "$_/lib/Exporter.pm") {
  769.           $att{PERL_SRC}=$_ ;
  770.           last;
  771.           }
  772. --- 544,599 ----
  773.   
  774.   
  775.   sub init_main {
  776. +     my($self) = @_;
  777.       # Find out directory name.  This may contain the extension name.
  778.       my($pwd) = fastcwd(); # from Cwd.pm
  779. +     # --- Initialize Module Name and Paths
  780.   
  781. !     # NAME    = The perl module name for this extension (eg DBD::Oracle).
  782. !     # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
  783. !     # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
  784. !     # ROOTEXT = Directory part of FULLEXT with leading /.
  785. !     unless($att{NAME}){ # we have to guess our name
  786. !     my($name) = $pwd;
  787. !     if ($Is_VMS) {
  788. !       $name =~ s:.*?([^.\]]+)\]:$1: unless ($name =~ s:.*[.\[]ext\.(.*)\]:$1:i);
  789. !       ($att{NAME}=$name) =~ s#[.\]]#::#g;
  790. !     } else {
  791. !       $name =~ s:.*/:: unless ($name =~ s:^.*/ext/::);
  792. !       ($att{NAME} =$name) =~ s#/#::#g;
  793. !     }
  794. !     }
  795. !     ($att{FULLEXT} =$att{NAME}) =~ s#::#/#g ;        #eg. BSD/Foo/Socket
  796. !     ($att{BASEEXT} =$att{NAME}) =~ s#.*::##;        #eg. Socket
  797. !     ($att{ROOTEXT} =$att{FULLEXT}) =~ s#/?\Q$att{BASEEXT}\E$## ; # eg. /BSD/Foo
  798. !     $att{ROOTEXT} = ($Is_VMS ? '' : '/') . $att{ROOTEXT} if $att{ROOTEXT};
  799. !     # --- Initialize PERL_LIB, INST_LIB, PERL_SRC
  800. !     # *Real* information: where did we get these two from? ...
  801. !     my $inc_config_dir = dirname($INC{'Config.pm'});
  802. !     my $inc_carp_dir   = dirname($INC{'Carp.pm'});
  803. !     # Typically PERL_* and INST_* will be identical but that need
  804. !     # not be the case (e.g., installing into project libraries etc).
  805. !     # Perl Macro:    With source    No source
  806.       # PERL_LIB       ../../lib      /usr/local/lib/perl5
  807.       # PERL_ARCHLIB   ../../lib      /usr/local/lib/perl5/sun4-sunos
  808.       # PERL_SRC       ../..          (undefined)
  809.   
  810. !     # INST Macro:    For standard   for any other
  811. !     #                modules        module
  812.       # INST_LIB       ../../lib      ./blib
  813.       # INST_ARCHLIB   ../../lib      ./blib
  814.   
  815.       unless ($att{PERL_SRC}){
  816. !     foreach (qw(../.. ../../.. ../../../..)){
  817. !         if ( -f "$_/config.sh" 
  818. !         && -f "$_/perl.h" 
  819. !         && -f "$_/lib/Exporter.pm") {
  820.           $att{PERL_SRC}=$_ ;
  821.           last;
  822.           }
  823. ***************
  824. *** 726,735 ****
  825.       $att{PERL_LIB}     = $Config{'privlib'} unless $att{PERL_LIB};
  826.       $att{PERL_ARCHLIB} = $Config{'archlib'} unless $att{PERL_ARCHLIB};
  827.       $att{PERL_INC}     = "$att{PERL_ARCHLIB}/CORE"; # wild guess for now
  828. !     die "Unable to locate Perl source. Try setting PERL_SRC in Makefile.PL or on command line.\n"
  829. !         unless (-f "$att{PERL_INC}/perl.h");
  830. !     print STDOUT "Using header files found in $att{PERL_INC}" if $Verbose;
  831. !     } else {
  832.       $att{PERL_LIB}     = "$att{PERL_SRC}/lib" unless $att{PERL_LIB};
  833.       $att{PERL_ARCHLIB} = $att{PERL_LIB};
  834.       $att{PERL_INC}     = $att{PERL_SRC};
  835. --- 604,625 ----
  836.       $att{PERL_LIB}     = $Config{'privlib'} unless $att{PERL_LIB};
  837.       $att{PERL_ARCHLIB} = $Config{'archlib'} unless $att{PERL_ARCHLIB};
  838.       $att{PERL_INC}     = "$att{PERL_ARCHLIB}/CORE"; # wild guess for now
  839. !     die <<EOM unless (-f "$att{PERL_INC}/perl.h");
  840. ! Error: Unable to locate installed Perl libraries or Perl source code.
  841. ! It is recommended that you install perl in a standard location before
  842. ! building extensions. You can say:
  843. !     $^X Makefile.PL PERL_SRC=/path/to/perl/source/directory
  844. ! if you have not yet installed perl but still want to build this
  845. ! extension now.
  846. ! EOM
  847. !     print STDOUT "Using header files found in $att{PERL_INC}" if $Verbose && $self->needs_linking;
  848. !     } else { # PERL_SRC is defined here...
  849.       $att{PERL_LIB}     = "$att{PERL_SRC}/lib" unless $att{PERL_LIB};
  850.       $att{PERL_ARCHLIB} = $att{PERL_LIB};
  851.       $att{PERL_INC}     = $att{PERL_SRC};
  852. ***************
  853. *** 750,759 ****
  854.   
  855.       # INST_LIB typically pre-set if building an extension after
  856.       # perl has been built and installed. Setting INST_LIB allows
  857. !     # you to build directly into privlib and avoid installperl.
  858.       unless ($att{INST_LIB}){
  859.       if (defined $att{PERL_SRC}) {
  860. !         $att{INST_LIB} = $att{PERL_LIB};
  861.       } else {
  862.           $att{INST_LIB} = "./blib";
  863.       }
  864. --- 640,675 ----
  865.   
  866.       # INST_LIB typically pre-set if building an extension after
  867.       # perl has been built and installed. Setting INST_LIB allows
  868. !     # you to build directly into, say $Config{'privlib'}.
  869.       unless ($att{INST_LIB}){
  870.       if (defined $att{PERL_SRC}) {
  871. ! #        require ExtUtils::Manifest;
  872. ! #        my $file;
  873. !         my $standard = 0;
  874. ! #        my $mani = ExtUtils::Manifest::maniread("$att{PERL_SRC}/MANIFEST");
  875. ! #        foreach $file (keys %$mani){
  876. ! #        if ($file =~ m!^ext/\Q$att{FULLEXT}!){
  877. ! #            $standard++;
  878. ! #            last;
  879. ! #        }
  880. ! #        }
  881. ! #### Temporary solution for perl5.001f:
  882. ! $standard = 1;
  883. ! #### This is just the same as was MakeMaker 4.094, but everything's prepared to
  884. ! #### switch to a different behaviour after 5.001f
  885. !         if ($standard){
  886. !         $att{INST_LIB} = $att{PERL_LIB};
  887. !         } else {
  888. !         $att{INST_LIB} = "./blib";
  889. !         print STDOUT <<END;
  890. ! Warning: The $att{NAME} extension will not be installed by 'make install' in the
  891. ! perl source directory. Please install it with 'make install' from the
  892. !     $pwd
  893. ! directory.
  894. ! END
  895. !         }
  896.       } else {
  897.           $att{INST_LIB} = "./blib";
  898.       }
  899. ***************
  900. *** 764,770 ****
  901.           "./blib"        => "./blib", # our private build lib
  902.           $att{PERL_LIB}    => $att{PERL_ARCHLIB},
  903.           $Config{'privlib'}    => $Config{'archlib'},
  904. -         $Config{'installprivlib'}    => $Config{'installarchlib'},
  905.           $inc_carp_dir    => $inc_config_dir,
  906.       );
  907.       $att{INST_ARCHLIB} = $archmap{$att{INST_LIB}};
  908. --- 680,685 ----
  909. ***************
  910. *** 780,818 ****
  911.               "(not architecture independent).\n";
  912.           }
  913.       }
  914. -     $att{INST_EXE} = "./blib" unless $att{INST_EXE};
  915. -     $att{MAP_TARGET} = "perl" unless $att{MAP_TARGET};
  916. -     $att{LIBPERL_A} = $Is_VMS ? 'libperl.olb' : 'libperl.a'
  917. -         unless $att{LIBPERL_A};
  918.       }
  919.   
  920. !     # make a few simple checks
  921. !     die "PERL_LIB ($att{PERL_LIB}) is not a perl library directory"
  922. !     unless (-f "$att{PERL_LIB}/Exporter.pm");
  923. !     # --- Initialize Module Name and Paths
  924. !     # NAME    = The perl module name for this extension (eg DBD::Oracle).
  925. !     # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
  926. !     # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
  927. !     # ROOTEXT = Directory part of FULLEXT with leading /.
  928. !     unless($att{NAME}){ # we have to guess our name
  929. !     my($name) = $pwd;
  930. !     if ($Is_VMS) {
  931. !       $name =~ s:.*?([^.\]]+)\]:$1: unless ($name =~ s:.*[.\[]ext\.(.*)\]:$1:i);
  932. !       ($att{NAME}=$name) =~ s#[.\]]#::#g;
  933.       } else {
  934. !       $name =~ s:.*/:: unless ($name =~ s:^.*/ext/::);
  935. !       ($att{NAME} =$name) =~ s#/#::#g;
  936.       }
  937.       }
  938. !     ($att{FULLEXT} =$att{NAME}) =~ s#::#/#g ;        #eg. BSD/Foo/Socket
  939. !     ($att{BASEEXT} =$att{NAME}) =~ s#.*::##;        #eg. Socket
  940. !     ($att{ROOTEXT} =$att{FULLEXT}) =~ s#/?\Q$att{BASEEXT}\E$## ; # eg. /BSD/Foo
  941. !     $att{ROOTEXT} = ($Is_VMS ? '' : '/') . $att{ROOTEXT} if $att{ROOTEXT};
  942.   
  943.       ($att{DISTNAME}=$att{NAME}) =~ s#(::)#-#g unless $att{DISTNAME};
  944.       $att{VERSION} = "0.1" unless $att{VERSION};
  945.   
  946.   
  947.       # --- Initialize Perl Binary Locations
  948. --- 695,730 ----
  949.               "(not architecture independent).\n";
  950.           }
  951.       }
  952.       }
  953. +     $att{INST_EXE} = "./blib" unless $att{INST_EXE};
  954.   
  955. !     if( $att{INSTALLPRIVLIB} && ! $att{INSTALLARCHLIB} ){
  956. !     my($archname) = $Config{'archname'};
  957. !     if (-d "$att{INSTALLPRIVLIB}/$archname"){
  958. !         $att{INSTALLARCHLIB} = "$att{INSTALLPRIVLIB}/$archname";
  959. !         print STDOUT "Defaulting INSTALLARCHLIB to INSTALLPRIVLIB/$archname\n";
  960.       } else {
  961. !         $att{INSTALLARCHLIB} = $att{INSTALLPRIVLIB};
  962. !         print STDOUT "Warning: Defaulting INSTALLARCHLIB to INSTALLPRIVLIB ",
  963. !         "(not architecture independent).\n";
  964.       }
  965.       }
  966. !     $att{INSTALLPRIVLIB} ||= $Config{'installprivlib'};
  967. !     $att{INSTALLARCHLIB} ||= $Config{'installarchlib'};
  968. !     $att{INSTALLBIN}     ||= $Config{'installbin'};
  969. !     $att{MAP_TARGET} = "perl" unless $att{MAP_TARGET};
  970. !     $att{LIBPERL_A} = $Is_VMS ? 'libperl.olb' : 'libperl.a'
  971. !     unless $att{LIBPERL_A};
  972. !     # make a few simple checks
  973. !     warn "Warning: PERL_LIB ($att{PERL_LIB}) seems not to be a perl library directory
  974. !         (Exporter.pm not found)"
  975. !     unless (-f "$att{PERL_LIB}/Exporter.pm");
  976.   
  977.       ($att{DISTNAME}=$att{NAME}) =~ s#(::)#-#g unless $att{DISTNAME};
  978.       $att{VERSION} = "0.1" unless $att{VERSION};
  979. +     ($att{VERSION_SYM} = $att{VERSION}) =~ s/\W/_/g;
  980.   
  981.   
  982.       # --- Initialize Perl Binary Locations
  983. ***************
  984. *** 820,828 ****
  985.       # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
  986.       # will be working versions of perl 5. miniperl has priority over perl
  987.       # for PERL to ensure that $(PERL) is usable while building ./ext/*
  988. !     $att{'PERL'} = MY->find_perl(5.0, [ qw(miniperl perl) ],
  989. !         [ grep defined $_, $att{PERL_SRC}, split(":", $ENV{PATH}), $Config{'bin'} ], $Verbose )
  990. !     unless ($att{'PERL'} && -x $att{'PERL'});
  991.   
  992.       # Define 'FULLPERL' to be a non-miniperl (used in test: target)
  993.       ($att{'FULLPERL'} = $att{'PERL'}) =~ s/miniperl/perl/
  994. --- 732,743 ----
  995.       # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
  996.       # will be working versions of perl 5. miniperl has priority over perl
  997.       # for PERL to ensure that $(PERL) is usable while building ./ext/*
  998. !     $att{'PERL'} =
  999. !       MY->find_perl(5.0, ['miniperl','perl','perl5',"perl$]" ],
  1000. !             [ grep defined $_, $att{PERL_SRC}, split(":", $ENV{PATH}),
  1001. !              $Config{'bin'} ], $Verbose )
  1002. !     unless ($att{'PERL'});    # don't check, if perl is executable, maybe they
  1003. !                 # they have decided to supply switches with perl
  1004.   
  1005.       # Define 'FULLPERL' to be a non-miniperl (used in test: target)
  1006.       ($att{'FULLPERL'} = $att{'PERL'}) =~ s/miniperl/perl/
  1007. ***************
  1008. *** 924,930 ****
  1009.   
  1010.   
  1011.   sub libscan {
  1012. !     return undef if m:/RCS/: ;
  1013.       $_;
  1014.   }
  1015.   
  1016. --- 839,845 ----
  1017.   
  1018.   
  1019.   sub libscan {
  1020. !     return '' if m:/RCS/: ; # return undef triggered warnings with $Verbose>=2
  1021.       $_;
  1022.   }
  1023.   
  1024. ***************
  1025. *** 941,951 ****
  1026. --- 856,870 ----
  1027.       # undefined. In any case we turn it into an anon array:
  1028.       $att{LIBS}=[] unless $att{LIBS};
  1029.       $att{LIBS}=[$att{LIBS}] if ref \$att{LIBS} eq SCALAR;
  1030. +     $att{LD_RUN_PATH} = "";
  1031.       foreach ( @{$att{'LIBS'}} ){
  1032.       s/^\s*(.*\S)\s*$/$1/; # remove leading and trailing whitespace
  1033.       my(@libs) = MY->extliblist($_);
  1034.       if ($libs[0] or $libs[1] or $libs[2]){
  1035.           @att{EXTRALIBS, BSLOADLIBS, LDLOADLIBS} = @libs;
  1036. +         if ($libs[2]) {
  1037. +         $att{LD_RUN_PATH} = join(":",grep($_=~s/^-L//,split(" ", $libs[2])));
  1038. +         }
  1039.           last;
  1040.       }
  1041.       }
  1042. ***************
  1043. *** 954,961 ****
  1044.       if ($att{CONFIG} and ref $att{CONFIG} ne 'ARRAY');
  1045.       $att{CONFIG} = [] unless (ref $att{CONFIG});
  1046.       push(@{$att{CONFIG}},
  1047. !     qw( cc libc ldflags lddlflags ccdlflags cccdlflags
  1048. !         ranlib so dlext dlsrc installprivlib installarchlib
  1049.       ));
  1050.       push(@{$att{CONFIG}}, 'shellflags') if $Config{'shellflags'};
  1051.   
  1052. --- 873,880 ----
  1053.       if ($att{CONFIG} and ref $att{CONFIG} ne 'ARRAY');
  1054.       $att{CONFIG} = [] unless (ref $att{CONFIG});
  1055.       push(@{$att{CONFIG}},
  1056. !     qw(cc libc ldflags lddlflags ccdlflags cccdlflags
  1057. !        ranlib so dlext dlsrc
  1058.       ));
  1059.       push(@{$att{CONFIG}}, 'shellflags') if $Config{'shellflags'};
  1060.   
  1061. ***************
  1062. *** 989,994 ****
  1063. --- 908,914 ----
  1064.       $att{TOUCH} = "touch";
  1065.       $att{CP} = "cp";
  1066.       $att{MV} = "mv";
  1067. +     $att{CHMOD} = "chmod";
  1068.   }
  1069.   
  1070.   
  1071. ***************
  1072. *** 1029,1035 ****
  1073.             $out = `$dir/$name -e 'require $ver; print "VER_OK\n" ' 2>&1`;
  1074.           }
  1075.           if ($out =~ /VER_OK/) {
  1076. !         print "Using $dir/$name" if $trace;
  1077.           return "$dir/$name";
  1078.           }
  1079.       }
  1080. --- 949,955 ----
  1081.             $out = `$dir/$name -e 'require $ver; print "VER_OK\n" ' 2>&1`;
  1082.           }
  1083.           if ($out =~ /VER_OK/) {
  1084. !         print "Using PERL=$dir/$name" if $trace;
  1085.           return "$dir/$name";
  1086.           }
  1087.       }
  1088. ***************
  1089. *** 1043,1072 ****
  1090.       "";
  1091.   }
  1092.   
  1093.   
  1094.   sub constants {
  1095.       my(@m);
  1096.   
  1097.       push @m, "
  1098.   NAME = $att{NAME}
  1099.   DISTNAME = $att{DISTNAME}
  1100.   VERSION = $att{VERSION}
  1101.   
  1102. ! # In which library should we install this extension?
  1103. ! # This is typically the same as PERL_LIB.
  1104.   # (also see INST_LIBDIR and relationship to ROOTEXT)
  1105.   INST_LIB = $att{INST_LIB}
  1106.   INST_ARCHLIB = $att{INST_ARCHLIB}
  1107.   INST_EXE = $att{INST_EXE}
  1108.   
  1109.   # Perl library to use when building the extension
  1110.   PERL_LIB = $att{PERL_LIB}
  1111.   PERL_ARCHLIB = $att{PERL_ARCHLIB}
  1112.   LIBPERL_A = $att{LIBPERL_A}
  1113.   ";
  1114.   
  1115.       # Define I_PERL_LIBS to include the required -Ipaths
  1116.       # To be cute we only include PERL_ARCHLIB if different
  1117.       # To be portable we add quotes for VMS
  1118.       my(@i_perl_libs) = qw{-I$(PERL_ARCHLIB) -I$(PERL_LIB)};
  1119.       shift(@i_perl_libs) if ($att{PERL_ARCHLIB} eq $att{PERL_LIB});
  1120. --- 963,1012 ----
  1121.       "";
  1122.   }
  1123.   
  1124. + sub needs_linking {    # Does this module need linking?
  1125. +     return 1 if $att{OBJECT} or @{$att{C} || []} or $att{MYEXTLIB};
  1126. +     return 0;
  1127. + }
  1128.   
  1129.   sub constants {
  1130. +     my($self) = @_;
  1131.       my(@m);
  1132.   
  1133.       push @m, "
  1134.   NAME = $att{NAME}
  1135.   DISTNAME = $att{DISTNAME}
  1136.   VERSION = $att{VERSION}
  1137. + VERSION_SYM = $att{VERSION_SYM}
  1138.   
  1139. ! # In which directory should we put this extension during 'make'?
  1140. ! # This is typically ./blib.
  1141.   # (also see INST_LIBDIR and relationship to ROOTEXT)
  1142.   INST_LIB = $att{INST_LIB}
  1143.   INST_ARCHLIB = $att{INST_ARCHLIB}
  1144.   INST_EXE = $att{INST_EXE}
  1145.   
  1146. + # AFS users will want to set the installation directories for
  1147. + # the final 'make install' early without setting INST_LIB,
  1148. + # INST_ARCHLIB, and INST_EXE for the testing phase
  1149. + INSTALLPRIVLIB = $att{INSTALLPRIVLIB}
  1150. + INSTALLARCHLIB = $att{INSTALLARCHLIB}
  1151. + INSTALLBIN = $att{INSTALLBIN}
  1152.   # Perl library to use when building the extension
  1153.   PERL_LIB = $att{PERL_LIB}
  1154.   PERL_ARCHLIB = $att{PERL_ARCHLIB}
  1155.   LIBPERL_A = $att{LIBPERL_A}
  1156. + MAKEMAKER = \$(PERL_LIB)/ExtUtils/MakeMaker.pm
  1157. + MM_VERSION = $ExtUtils::MakeMaker::Version
  1158.   ";
  1159.   
  1160.       # Define I_PERL_LIBS to include the required -Ipaths
  1161.       # To be cute we only include PERL_ARCHLIB if different
  1162. +     #### Deprecated from Version 4.11: We want to avoid different
  1163. +     #### behavior for variables with make(1) and perl(1)
  1164.       # To be portable we add quotes for VMS
  1165.       my(@i_perl_libs) = qw{-I$(PERL_ARCHLIB) -I$(PERL_LIB)};
  1166.       shift(@i_perl_libs) if ($att{PERL_ARCHLIB} eq $att{PERL_LIB});
  1167. ***************
  1168. *** 1112,1117 ****
  1169. --- 1052,1059 ----
  1170.   
  1171.   .PRECIOUS: Makefile
  1172.   
  1173. + .NO_PARALLEL:
  1174.   .PHONY: all config static dynamic test linkext
  1175.   
  1176.   # This extension may link to it's own library (see SDBM_File)
  1177. ***************
  1178. *** 1130,1139 ****
  1179.   INST_ARCHAUTODIR  = $(INST_ARCHLIB)/auto/$(FULLEXT)
  1180.   ';
  1181.   
  1182. !     push @m, '
  1183.   INST_STATIC  = $(INST_ARCHAUTODIR)/$(BASEEXT).a
  1184.   INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(BASEEXT).$(DLEXT)
  1185.   INST_BOOT    = $(INST_ARCHAUTODIR)/$(BASEEXT).bs
  1186.   INST_PM = '.join(" \\\n\t", sort values %{$att{PM}}).'
  1187.   ';
  1188.   
  1189. --- 1072,1092 ----
  1190.   INST_ARCHAUTODIR  = $(INST_ARCHLIB)/auto/$(FULLEXT)
  1191.   ';
  1192.   
  1193. !     if ($self->needs_linking) {
  1194. !     push @m, '
  1195.   INST_STATIC  = $(INST_ARCHAUTODIR)/$(BASEEXT).a
  1196.   INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(BASEEXT).$(DLEXT)
  1197.   INST_BOOT    = $(INST_ARCHAUTODIR)/$(BASEEXT).bs
  1198. + ';
  1199. +     } else {
  1200. +     push @m, '
  1201. + INST_STATIC  =
  1202. + INST_DYNAMIC =
  1203. + INST_BOOT    =
  1204. + ';
  1205. +     }
  1206. +     push @m, '
  1207.   INST_PM = '.join(" \\\n\t", sort values %{$att{PM}}).'
  1208.   ';
  1209.   
  1210. ***************
  1211. *** 1220,1232 ****
  1212.       }
  1213.   
  1214.       my($new) = "$cc -c $ccflags $optimize $perltype $large $split";
  1215. !     if (defined($old) and $new ne $old) {
  1216. !     print STDOUT "Warning (non-fatal): cflags evaluation in MakeMaker differs from shell output\n"
  1217. !     ."   package: $att{NAME}\n"
  1218. !     ."   old: $old\n"
  1219. !     ."   new: $new\n"
  1220. !     ."   Using 'old' set.\n"
  1221. !     ."Please notify perl5-porters\@nicoh.com\n";
  1222.       }
  1223.       my($cccmd)=($old) ? $old : $new;
  1224.       $cccmd =~ s/^\s*\Q$Config{'cc'}\E\s/\$(CC) /;
  1225. --- 1173,1192 ----
  1226.       }
  1227.   
  1228.       my($new) = "$cc -c $ccflags $optimize $perltype $large $split";
  1229. !     $new =~ s/^\s+//; $new =~ s/\s+/ /g; $new =~ s/\s+$//;
  1230. !     if (defined($old)){
  1231. !     $old =~ s/^\s+//; $old =~ s/\s+/ /g; $old =~ s/\s+$//;
  1232. !     if ($new ne $old) {
  1233. !         print STDOUT "Warning (non-fatal): cflags evaluation in "
  1234. !           ."MakeMaker ($ExtUtils::MakeMaker::Version) "
  1235. !           ."differs from shell output\n"
  1236. !           ."   package: $att{NAME}\n"
  1237. !           ."   old: $old\n"
  1238. !           ."   new: $new\n"
  1239. !           ."   Using 'old' set.\n"
  1240. !           . Config::myconfig()
  1241. !           ."\nPlease send these details to perl5-porters\@nicoh.com\n";
  1242. !     }
  1243.       }
  1244.       my($cccmd)=($old) ? $old : $new;
  1245.       $cccmd =~ s/^\s*\Q$Config{'cc'}\E\s/\$(CC) /;
  1246. ***************
  1247. *** 1275,1280 ****
  1248. --- 1235,1243 ----
  1249.   # LDLOADLIBS =    List of those libraries which can or must be linked into
  1250.   #        the shared library when created using ld. These may be
  1251.   #        static or dynamic libraries.
  1252. + #        LD_RUN_PATH is a colon separated list of the directories
  1253. + #        in LDLOADLIBS. It is passed as an environment variable to
  1254. + #        the process that links the shared library.
  1255.   #
  1256.   # BSLOADLIBS =    List of those libraries that are needed but can be
  1257.   #        linked in dynamically at run time on this platform.
  1258. ***************
  1259. *** 1285,1290 ****
  1260. --- 1248,1254 ----
  1261.   EXTRALIBS  = $att{'EXTRALIBS'}
  1262.   LDLOADLIBS = $att{'LDLOADLIBS'}
  1263.   BSLOADLIBS = $att{'BSLOADLIBS'}
  1264. + LD_RUN_PATH= $att{'LD_RUN_PATH'}
  1265.   ";
  1266.   }
  1267.   
  1268. ***************
  1269. *** 1297,1303 ****
  1270.       $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
  1271.       q{
  1272.   # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
  1273. ! AUTOSPLITFILE = $(PERL) $(I_PERL_LIBS) -e 'use AutoSplit;}.$asl.q{autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
  1274.   };
  1275.   }
  1276.   
  1277. --- 1261,1267 ----
  1278.       $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
  1279.       q{
  1280.   # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
  1281. ! AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e 'use AutoSplit;}.$asl.q{autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
  1282.   };
  1283.   }
  1284.   
  1285. ***************
  1286. *** 1327,1332 ****
  1287. --- 1291,1297 ----
  1288.   MV = $att{MV}
  1289.   RM_F  = $att{RM_F}
  1290.   RM_RF = $att{RM_RF}
  1291. + CHMOD = $att{CHMOD}
  1292.   ".q{
  1293.   # The following is a portable way to say mkdir -p
  1294.   MKPATH = $(PERL) -wle '$$"="/"; foreach $$p (@ARGV){ next if -d $$p; my(@p); foreach(split(/\//,$$p)){ push(@p,$$_); next if -d "@p/"; print "mkdir @p"; mkdir("@p",0777)||die $$! }} exit 0;'
  1295. ***************
  1296. *** 1338,1354 ****
  1297.       "";
  1298.   }
  1299.   
  1300.   sub pasthru {
  1301. !     my(@m,@pasthru,$key);
  1302. !     # It has to be considered carefully, which variables are apt to be passed through, e.g. PERL_SRC
  1303. !     # is not suited for subdirectories, as it might be relativ to the parent directory.
  1304. !     # Probably we need a PASTHRU2 variable. PASTHRU1 is a conservative approach, that hardly changes
  1305.       # MakeMaker between version 4.086 and 4.09.
  1306. !     push @m, "\nPASTHRU1 = ";
  1307. !     foreach $key (qw(INST_ARCHLIB INST_EXE INST_LIB LIBPERL_A LINKTYPE)){
  1308. !     push @pasthru, "$key=\"\$($key)\"";
  1309.       }
  1310. !     push @m, join "\\\n\t", @pasthru;
  1311.       join "", @m;
  1312.   }
  1313.   
  1314. --- 1303,1345 ----
  1315.       "";
  1316.   }
  1317.   
  1318. + sub macro {
  1319. +     my($self,%attribs) = @_;
  1320. +     my(@m,$key,$val);
  1321. +     while (($key,$val) = each %attribs){
  1322. +     push @m, "$key = $val\n";
  1323. +     }
  1324. +     join "", @m;
  1325. + }
  1326.   sub pasthru {
  1327. !     my(@m,$key);
  1328. !     # It has to be considered carefully, which variables are apt 
  1329. !     # to be passed through, e.g. ALL RELATIV DIRECTORIES are
  1330. !     # not suited for PASTHRU to subdirectories.
  1331. !     # Moreover: No directories at all have a chance, because we
  1332. !     # don't know yet, if the directories are absolute or relativ
  1333. !     # PASTHRU2 is a conservative approach, that hardly changed
  1334.       # MakeMaker between version 4.086 and 4.09.
  1335. !     # PASTHRU1 is a revolutionary approach :), it cares for having
  1336. !     # a prepended "../" whenever runsubdirpl is called, but only
  1337. !     # for the three crucial INST_* directories.
  1338. !     my(@pasthru1,@pasthru2); # 1 for runsubdirpl, 2 for the rest
  1339. !     foreach $key (qw(INST_LIB INST_ARCHLIB INST_EXE)){
  1340. !     push @pasthru1, "$key=\"\$($key)\"";
  1341.       }
  1342. !     foreach $key (qw(INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN LIBPERL_A LINKTYPE)){
  1343. !     push @pasthru1, "$key=\"\$($key)\"";
  1344. !     push @pasthru2, "$key=\"\$($key)\"";
  1345. !     }
  1346. !     push @m, "\nPASTHRU1 = ", join ("\\\n\t", @pasthru1), "\n";
  1347. !     push @m, "\nPASTHRU2 = ", join ("\\\n\t", @pasthru2), "\n";
  1348.       join "", @m;
  1349.   }
  1350.   
  1351. ***************
  1352. *** 1366,1379 ****
  1353.   sub xs_c {
  1354.       '
  1355.   .xs.c:
  1356. !     $(PERL) $(XSUBPP) $(XSUBPPARGS) $*.xs >$*.tc && mv $*.tc $@
  1357.   ';
  1358.   }
  1359.   
  1360.   sub xs_o {    # many makes are too dumb to use xs_c then c_o
  1361.       '
  1362.   .xs.o:
  1363. !     $(PERL) $(XSUBPP) $(XSUBPPARGS) $*.xs >xstmp.c && mv xstmp.c $*.c
  1364.       $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $(INC) $*.c
  1365.   ';
  1366.   }
  1367. --- 1357,1370 ----
  1368.   sub xs_c {
  1369.       '
  1370.   .xs.c:
  1371. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSUBPPARGS) $*.xs >$*.tc && mv $*.tc $@
  1372.   ';
  1373.   }
  1374.   
  1375.   sub xs_o {    # many makes are too dumb to use xs_c then c_o
  1376.       '
  1377.   .xs.o:
  1378. !     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSUBPPARGS) $*.xs >xstmp.c && mv xstmp.c $*.c
  1379.       $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $(INC) $*.c
  1380.   ';
  1381.   }
  1382. ***************
  1383. *** 1387,1407 ****
  1384.   all ::    config linkext $(INST_PM)
  1385.   '.$att{NOOP}.'
  1386.   
  1387. ! config :: '.$att{MAKEFILE}.' $(INST_LIBDIR)/.exists $(INST_ARCHAUTODIR)/.exists
  1388.   ';
  1389.   
  1390. !     push @m, MM->dir_target('$(INST_LIBDIR)', '$(INST_ARCHAUTODIR)');
  1391.   
  1392.       push @m, '
  1393.   $(O_FILES): $(H_FILES)
  1394.   ' if @{$att{O_FILES} || []} && @{$att{H} || []};
  1395.       join('',@m);
  1396.   }
  1397.   
  1398.   sub linkext {
  1399.       my($self, %attribs) = @_;
  1400. !     # LINKTYPE => static or dynamic
  1401. !     my($linktype) = $attribs{LINKTYPE} || '$(LINKTYPE)';
  1402.       "
  1403.   linkext :: $linktype
  1404.   $att{NOOP}
  1405. --- 1378,1411 ----
  1406.   all ::    config linkext $(INST_PM)
  1407.   '.$att{NOOP}.'
  1408.   
  1409. ! config :: '.$att{MAKEFILE}.' $(INST_LIBDIR)/.exists $(INST_ARCHAUTODIR)/.exists Version_check
  1410.   ';
  1411.   
  1412. !     push @m, MM->dir_target('$(INST_LIBDIR)', '$(INST_ARCHAUTODIR)', '$(INST_EXE)');
  1413.   
  1414.       push @m, '
  1415.   $(O_FILES): $(H_FILES)
  1416.   ' if @{$att{O_FILES} || []} && @{$att{H} || []};
  1417. +     push @m, q{
  1418. + help:
  1419. +     $(PERL) -I$(PERL_LIB) -e 'use ExtUtils::MakeMaker "&help"; &help;'
  1420. + };
  1421. +     push @m, q{
  1422. + Version_check:
  1423. +     @$(PERL) -I$(PERL_LIB) -e 'use ExtUtils::MakeMaker qw($$Version &Version_check);' \
  1424. +         -e '&Version_check($(MM_VERSION))'
  1425. + };
  1426.       join('',@m);
  1427.   }
  1428.   
  1429.   sub linkext {
  1430.       my($self, %attribs) = @_;
  1431. !     # LINKTYPE => static or dynamic or ''
  1432. !     my($linktype) = defined $attribs{LINKTYPE} ? 
  1433. !       $attribs{LINKTYPE} : '$(LINKTYPE)';
  1434.       "
  1435.   linkext :: $linktype
  1436.   $att{NOOP}
  1437. ***************
  1438. *** 1429,1435 ****
  1439.   
  1440.       push(@m,"
  1441.   $att{BASEEXT}.exp: Makefile.PL
  1442. ! ",'    $(PERL) $(I_PERL_LIBS) -e \'use ExtUtils::MakeMaker qw(&mksymlists); \\
  1443.       &mksymlists(DL_FUNCS => ',
  1444.       %$funcs ? neatvalue($funcs) : '""',', DL_VARS => ',
  1445.       @$vars  ? neatvalue($vars)  : '""', ", NAME => \"$att{NAME}\")'
  1446. --- 1433,1439 ----
  1447.   
  1448.       push(@m,"
  1449.   $att{BASEEXT}.exp: Makefile.PL
  1450. ! ",'    $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::MakeMaker qw(&mksymlists); \\
  1451.       &mksymlists(DL_FUNCS => ',
  1452.       %$funcs ? neatvalue($funcs) : '""',', DL_VARS => ',
  1453.       @$vars  ? neatvalue($vars)  : '""', ", NAME => \"$att{NAME}\")'
  1454. ***************
  1455. *** 1451,1472 ****
  1456.   
  1457.   sub dynamic_bs {
  1458.       my($self, %attribs) = @_;
  1459.       '
  1460.   BOOTSTRAP = '."$att{BASEEXT}.bs".'
  1461.   
  1462. ! # As MakeMaker mkbootstrap might not write a file (if none is required)
  1463.   # we use touch to prevent make continually trying to remake it.
  1464.   # The DynaLoader only reads a non-empty file.
  1465.   $(BOOTSTRAP): '."$att{MAKEFILE} $att{BOOTDEP}".'
  1466. !     @ echo "Running mkbootstrap for $(NAME) ($(BSLOADLIBS))"
  1467. !     @ $(PERL) $(I_PERL_LIBS) \
  1468. !         -e \'use ExtUtils::MakeMaker qw(&mkbootstrap); &mkbootstrap("$(BSLOADLIBS)");\' \
  1469. !         INST_LIB=$(INST_LIB) INST_ARCHLIB=$(INST_ARCHLIB) PERL_SRC=$(PERL_SRC) NAME=$(NAME)
  1470.       @ $(TOUCH) $(BOOTSTRAP)
  1471.   
  1472.   $(INST_BOOT): $(BOOTSTRAP)
  1473.       @ '.$att{RM_RF}.' $(INST_BOOT)
  1474.       -'.$att{CP}.' $(BOOTSTRAP) $(INST_BOOT)
  1475.   ';
  1476.   }
  1477.   
  1478. --- 1455,1481 ----
  1479.   
  1480.   sub dynamic_bs {
  1481.       my($self, %attribs) = @_;
  1482. +     return '' unless $self->needs_linking;
  1483.       '
  1484.   BOOTSTRAP = '."$att{BASEEXT}.bs".'
  1485.   
  1486. ! # As Mkbootstrap might not write a file (if none is required)
  1487.   # we use touch to prevent make continually trying to remake it.
  1488.   # The DynaLoader only reads a non-empty file.
  1489.   $(BOOTSTRAP): '."$att{MAKEFILE} $att{BOOTDEP}".'
  1490. !     @ echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
  1491. !     @ $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
  1492. !         -e \'use ExtUtils::Mkbootstrap;\' \
  1493. !         -e \'Mkbootstrap("$(BASEEXT)","$(BSLOADLIBS)");\'
  1494.       @ $(TOUCH) $(BOOTSTRAP)
  1495. +     $(CHMOD) 644 $@
  1496. +     @echo $@ >> $(INST_ARCHAUTODIR)/.packlist
  1497.   
  1498.   $(INST_BOOT): $(BOOTSTRAP)
  1499.       @ '.$att{RM_RF}.' $(INST_BOOT)
  1500.       -'.$att{CP}.' $(BOOTSTRAP) $(INST_BOOT)
  1501. +     $(CHMOD) 644 $@
  1502. +     @echo $@ >> $(INST_ARCHAUTODIR)/.packlist
  1503.   ';
  1504.   }
  1505.   
  1506. ***************
  1507. *** 1476,1481 ****
  1508. --- 1485,1491 ----
  1509.       my($otherldflags) = $attribs{OTHERLDFLAGS} || "";
  1510.       my($armaybe) = $attribs{ARMAYBE} || $att{ARMAYBE} || ":";
  1511.       my($ldfrom) = '$(LDFROM)';
  1512. +     return '' unless $self->needs_linking;
  1513.       my($osname) = $Config{'osname'};
  1514.       $armaybe = 'ar' if ($osname eq 'dec_osf' and $armaybe eq ':');
  1515.       my(@m);
  1516. ***************
  1517. *** 1493,1500 ****
  1518.       push(@m,'    $(RANLIB) '."$ldfrom\n");
  1519.       }
  1520.       $ldfrom = "-all $ldfrom -none" if ($osname eq 'dec_osf');
  1521. !     push(@m,'    $(LD) -o $@ $(LDDLFLAGS) '.$ldfrom.
  1522. !             ' $(OTHERLDFLAGS) $(MYEXTLIB) $(LDLOADLIBS)'."\n");
  1523.   
  1524.       push @m, MM->dir_target('$(INST_ARCHAUTODIR)');
  1525.       join('',@m);
  1526. --- 1503,1514 ----
  1527.       push(@m,'    $(RANLIB) '."$ldfrom\n");
  1528.       }
  1529.       $ldfrom = "-all $ldfrom -none" if ($osname eq 'dec_osf');
  1530. !     push(@m,'    LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) -o $@ $(LDDLFLAGS) '.$ldfrom.
  1531. !             ' $(OTHERLDFLAGS) $(MYEXTLIB) $(LDLOADLIBS)');
  1532. !     push @m, '
  1533. !     $(CHMOD) 755 $@
  1534. !     @echo $@ >> $(INST_ARCHAUTODIR)/.packlist
  1535. ! ';
  1536.   
  1537.       push @m, MM->dir_target('$(INST_ARCHAUTODIR)');
  1538.       join('',@m);
  1539. ***************
  1540. *** 1513,1518 ****
  1541. --- 1527,1534 ----
  1542.   }
  1543.   
  1544.   sub static_lib{
  1545. +     my($self) = @_;
  1546. +     return '' unless $self->needs_linking;
  1547.       my(@m);
  1548.       push(@m, <<'END');
  1549.   $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)/.exists
  1550. ***************
  1551. *** 1524,1529 ****
  1552. --- 1540,1547 ----
  1553.       push(@m, <<'END');
  1554.       ar cr $@ $(OBJECT) && $(RANLIB) $@
  1555.       @echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
  1556. +     $(CHMOD) 755 $@
  1557. +     @echo $@ >> $(INST_ARCHAUTODIR)/.packlist
  1558.   END
  1559.   
  1560.   # Old mechanism - still available:
  1561. ***************
  1562. *** 1531,1536 ****
  1563. --- 1549,1555 ----
  1564.       push(@m, <<'END') if $att{PERL_SRC};
  1565.       @ echo "$(EXTRALIBS)" >> $(PERL_SRC)/ext.libs
  1566.   END
  1567.       push @m, MM->dir_target('$(INST_ARCHAUTODIR)');
  1568.       join('', "\n",@m);
  1569.   }
  1570. ***************
  1571. *** 1558,1569 ****
  1572.   
  1573.   sub installpm_x { # called by installpm per file
  1574.       my($self, $dist, $inst, $splitlib) = @_;
  1575.       my($instdir) = $inst =~ m|(.*)/|;
  1576.       my(@m);
  1577.       push(@m,"
  1578. ! $inst: $dist Makefile $instdir/.exists
  1579.   ".'    @ '.$att{RM_F}.' $@
  1580.       '."$att{CP} $dist".' $@
  1581.   ');
  1582.       push(@m, "\t\@\$(AUTOSPLITFILE) \$@ $splitlib/auto\n")
  1583.       if ($splitlib and $inst =~ m/\.pm$/);
  1584. --- 1577,1592 ----
  1585.   
  1586.   sub installpm_x { # called by installpm per file
  1587.       my($self, $dist, $inst, $splitlib) = @_;
  1588. +     warn "Warning: Most probably 'make' will have problems processing this file: $inst\n"
  1589. +     if $inst =~ m![:#]!;
  1590.       my($instdir) = $inst =~ m|(.*)/|;
  1591.       my(@m);
  1592.       push(@m,"
  1593. ! $inst: $dist $att{MAKEFILE} $instdir/.exists
  1594.   ".'    @ '.$att{RM_F}.' $@
  1595.       '."$att{CP} $dist".' $@
  1596. +     $(CHMOD) 644 $@
  1597. +     @echo $@ >> $(INST_ARCHAUTODIR)/.packlist
  1598.   ');
  1599.       push(@m, "\t\@\$(AUTOSPLITFILE) \$@ $splitlib/auto\n")
  1600.       if ($splitlib and $inst =~ m/\.pm$/);
  1601. ***************
  1602. *** 1606,1613 ****
  1603.   ");
  1604.   
  1605.       while (($from,$to) = each %fromto) {
  1606.       push @m, "
  1607. ! $to: $from $att{MAKEFILE}
  1608.       $att{CP} $from $to
  1609.   ";
  1610.       }
  1611. --- 1629,1637 ----
  1612.   ");
  1613.   
  1614.       while (($from,$to) = each %fromto) {
  1615. +     my $todir = dirname($to);
  1616.       push @m, "
  1617. ! $to: $from $att{MAKEFILE} $todir/.exists
  1618.       $att{CP} $from $to
  1619.   ";
  1620.       }
  1621. ***************
  1622. *** 1647,1652 ****
  1623. --- 1671,1677 ----
  1624.       my($self,$subdir) = @_;
  1625.       chdir($subdir) or die "chdir($subdir): $!";
  1626.       ExtUtils::MakeMaker::check_hints();
  1627. +     package main;
  1628.       require "Makefile.PL";
  1629.   }
  1630.   
  1631. ***************
  1632. *** 1660,1677 ****
  1633.       # MY::subdir_x() method to override this one.
  1634.       qq{
  1635.   config :: $subdir/$att{MAKEFILE}
  1636. !     cd $subdir && \$(MAKE) config \$(PASTHRU1) \$(SUBDIR_MAKEFILE_PL_ARGS)
  1637.   
  1638.   $subdir/$att{MAKEFILE}: $subdir/Makefile.PL \$(CONFIGDEP)
  1639.   }.'    @echo "Rebuilding $@ ..."
  1640. !     $(PERL) $(I_PERL_LIBS) \\
  1641.           -e "use ExtUtils::MakeMaker; MM->runsubdirpl(qw('.$subdir.'))" \\
  1642.           $(PASTHRU1) $(SUBDIR_MAKEFILE_PL_ARGS)
  1643.       @echo "Rebuild of $@ complete."
  1644.   '.qq{
  1645.   
  1646.   subdirs ::
  1647. !     cd $subdir && \$(MAKE) all \$(PASTHRU1)
  1648.   
  1649.   };
  1650.   }
  1651. --- 1685,1702 ----
  1652.       # MY::subdir_x() method to override this one.
  1653.       qq{
  1654.   config :: $subdir/$att{MAKEFILE}
  1655. !     cd $subdir && \$(MAKE) config \$(PASTHRU2) \$(SUBDIR_MAKEFILE_PL_ARGS)
  1656.   
  1657.   $subdir/$att{MAKEFILE}: $subdir/Makefile.PL \$(CONFIGDEP)
  1658.   }.'    @echo "Rebuilding $@ ..."
  1659. !     @$(PERL) -I"$(PERL_ARCHLIB)" -I"$(PERL_LIB)" \\
  1660.           -e "use ExtUtils::MakeMaker; MM->runsubdirpl(qw('.$subdir.'))" \\
  1661.           $(PASTHRU1) $(SUBDIR_MAKEFILE_PL_ARGS)
  1662.       @echo "Rebuild of $@ complete."
  1663.   '.qq{
  1664.   
  1665.   subdirs ::
  1666. !     cd $subdir && \$(MAKE) all \$(PASTHRU2)
  1667.   
  1668.   };
  1669.   }
  1670. ***************
  1671. *** 1728,1748 ****
  1672.   
  1673.   sub dist {
  1674.       my($self, %attribs) = @_;
  1675.       # VERSION should be sanitised before use as a file name
  1676. !     my($tarname)  = $attribs{TARNAME}  || '$(DISTNAME)-$(VERSION)';
  1677. !     my($tarflags) = $attribs{TARFLAGS} || 'cvf';
  1678. !     my($compress) = $attribs{COMPRESS} || 'compress'; # eg gzip
  1679. !     my($preop)    = $attribs{PREOP}  || '@:'; # e.g., update MANIFEST
  1680. !     my($postop)   = $attribs{POSTOP} || '@:';
  1681. !     my($mkfiles)  = join(' ', map("$_/$att{MAKEFILE} $_/$att{MAKEFILE}.old", ".", @{$att{DIR}}));
  1682. !     "
  1683. ! dist:     clean
  1684. !     $preop
  1685. !     $att{RM_F} $mkfiles
  1686. !     cd .. && tar $tarflags $tarname.tar \$(BASEEXT)
  1687. !     cd .. && $compress $tarname.tar
  1688. !     $postop
  1689.   ";
  1690.   }
  1691.   
  1692.   
  1693. --- 1753,1836 ----
  1694.   
  1695.   sub dist {
  1696.       my($self, %attribs) = @_;
  1697. +     my(@m);
  1698.       # VERSION should be sanitised before use as a file name
  1699. !     if ($attribs{TARNAME}){
  1700. !     print STDOUT "Error (fatal): Attribute TARNAME for target dist is deprecated
  1701. ! Please use DISTNAME and VERSION";
  1702. !     }
  1703. !     my($name)     = $attribs{NAME}     || '$(DISTNAME)-$(VERSION)';            
  1704. !     my($tar)      = $attribs{TAR}      || 'tar';        # eg /usr/bin/gnutar   
  1705. !     my($tarflags) = $attribs{TARFLAGS} || 'cvf';                               
  1706. !     my($compress) = $attribs{COMPRESS} || 'compress';   # eg gzip              
  1707. !     my($suffix)   = $attribs{SUFFIX}   || 'Z';          # eg gz                
  1708. !     my($shar)     = $attribs{SHAR}     || 'shar';       # eg "shar --gzip"     
  1709. !     my($preop)    = $attribs{PREOP}    || '@ :';         # eg update MANIFEST   
  1710. !     my($postop)   = $attribs{POSTOP}   || '@ :';         # eg remove the distdir
  1711. !     my($ci)       = $attribs{CI}       || 'ci -u';
  1712. !     my($rcs)      = $attribs{RCS}      || 'rcs -Nv$(VERSION_SYM):';
  1713. !     my($dist_default) = $attribs{DIST_DEFAULT} || 'tardist';
  1714. !     push @m, "
  1715. ! TAR  = $tar
  1716. ! TARFLAGS = $tarflags
  1717. ! COMPRESS = $compress
  1718. ! SUFFIX = $suffix
  1719. ! SHAR = $shar
  1720. ! PREOP = $preop
  1721. ! POSTOP = $postop
  1722. ! CI = $ci
  1723. ! RCS = $rcs
  1724. ! DIST_DEFAULT = $dist_default
  1725.   ";
  1726. +     push @m, q{
  1727. + distclean :: realclean distcheck
  1728. + distcheck :
  1729. +     $(PERL) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&fullcheck";' \\
  1730. +         -e 'fullcheck();'
  1731. + manifest :
  1732. +     $(PERL) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&mkmanifest";' \\
  1733. +         -e 'mkmanifest();'
  1734. + dist : $(DIST_DEFAULT)
  1735. + tardist : $(DISTNAME)-$(VERSION).tar.$(SUFFIX)
  1736. + $(DISTNAME)-$(VERSION).tar.$(SUFFIX) : distdir
  1737. +     $(PREOP)
  1738. +     $(TAR) $(TARFLAGS) $(DISTNAME)-$(VERSION).tar $(DISTNAME)-$(VERSION)
  1739. +     $(COMPRESS) $(DISTNAME)-$(VERSION).tar
  1740. +     $(RM_RF) $(DISTNAME)-$(VERSION)
  1741. +     $(POSTOP)
  1742. + uutardist : $(DISTNAME)-$(VERSION).tar.$(SUFFIX)
  1743. +     uuencode $(DISTNAME)-$(VERSION).tar.$(SUFFIX) \\
  1744. +         $(DISTNAME)-$(VERSION).tar.$(SUFFIX) > \\
  1745. +         $(DISTNAME)-$(VERSION).tar.$(SUFFIX).uu
  1746. + shdist : distdir
  1747. +     $(PREOP)
  1748. +     $(SHAR) $(DISTNAME)-$(VERSION) > $(DISTNAME)-$(VERSION).shar
  1749. +     $(RM_RF) $(DISTNAME)-$(VERSION)
  1750. +     $(POSTOP)
  1751. + distdir :
  1752. +     $(RM_RF) $(DISTNAME)-$(VERSION)
  1753. +     $(PERL) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "/mani/";' \\
  1754. +         -e 'manicopy(maniread(),"$(DISTNAME)-$(VERSION)");'
  1755. + ci :
  1756. +     $(PERL) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&maniread";' \\
  1757. +         -e '@all = keys %{maniread()};' \\
  1758. +         -e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \\
  1759. +         -e 'print("Executing $(RCS) ...\n"); system("$(RCS) @all");'
  1760. + };
  1761. +     join "", @m;
  1762.   }
  1763.   
  1764.   
  1765. ***************
  1766. *** 1763,1769 ****
  1767.       push(@m, <<'END') if -f "test.pl";
  1768.       $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) test.pl
  1769.   END
  1770. !     push(@m, map("\tcd $_ && test -f $att{MAKEFILE} && \$(MAKE) test \$(PASTHRU)\n",
  1771.            @{$att{DIR}}));
  1772.       push(@m, "\t\@echo 'No tests defined for \$(NAME) extension.'\n") unless @m > 1;
  1773.       join("", @m);
  1774. --- 1851,1857 ----
  1775.       push(@m, <<'END') if -f "test.pl";
  1776.       $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) test.pl
  1777.   END
  1778. !     push(@m, map("\tcd $_ && test -f $att{MAKEFILE} && \$(MAKE) test \$(PASTHRU2)\n",
  1779.            @{$att{DIR}}));
  1780.       push(@m, "\t\@echo 'No tests defined for \$(NAME) extension.'\n") unless @m > 1;
  1781.       join("", @m);
  1782. ***************
  1783. *** 1775,1799 ****
  1784.       my(@m);
  1785.       push @m, q{
  1786.   doc_install ::
  1787.       @ $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB)  \\
  1788.           -e "use ExtUtils::MakeMaker; MM->writedoc('Module', '$(NAME)', \\
  1789. !         'LINKTYPE=$(LINKTYPE)', 'VERSION=$(VERSION)', 'EXE_FILES=$(EXE_FILES)')"
  1790.   };
  1791.   
  1792.       push(@m, "
  1793.   install :: pure_install doc_install
  1794.   
  1795. ! pure_install :: all
  1796.   ");
  1797.       # install subdirectories first
  1798. !     push(@m, map("\tcd $_ && test -f $att{MAKEFILE} && \$(MAKE) install\n",@{$att{DIR}}));
  1799.   
  1800. !     push(@m, "\t: perl5.000 and MM pre 3.8 autosplit into INST_ARCHLIB, we delete these old files here
  1801. !     $att{RM_F} $Config{'installarchlib'}/auto/\$(FULLEXT)/*.al
  1802. !     $att{RM_F} $Config{'installarchlib'}/auto/\$(FULLEXT)/*.ix
  1803. !     \$(MAKE) INST_LIB=$Config{'installprivlib'} INST_ARCHLIB=$Config{'installarchlib'} INST_EXE=$Config{'installbin'}
  1804.   ");
  1805.   
  1806.       join("",@m);
  1807.   }
  1808.   
  1809. --- 1863,1902 ----
  1810.       my(@m);
  1811.       push @m, q{
  1812.   doc_install ::
  1813. +     @ echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
  1814.       @ $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB)  \\
  1815.           -e "use ExtUtils::MakeMaker; MM->writedoc('Module', '$(NAME)', \\
  1816. !         'LINKTYPE=$(LINKTYPE)', 'VERSION=$(VERSION)', \\
  1817. !         'EXE_FILES=$(EXE_FILES)')" >> $(INSTALLARCHLIB)/perllocal.pod
  1818.   };
  1819.   
  1820.       push(@m, "
  1821.   install :: pure_install doc_install
  1822.   
  1823. ! pure_install ::
  1824.   ");
  1825.       # install subdirectories first
  1826. !     push(@m, map("\tcd $_ && test -f $att{MAKEFILE} && \$(MAKE) install\n",
  1827. !          @{$att{DIR}}));
  1828.   
  1829. !     push(@m, "\t\@\$(PERL) -e 'foreach (\@ARGV){die qq{You do not have permissions to install into \$\$_\\n} unless -w \$\$_}' \$(INSTALLPRIVLIB) \$(INSTALLARCHLIB)
  1830. !     : perl5.000 and MM pre 3.8 autosplit into INST_ARCHLIB, we delete these old files here
  1831. !     $att{RM_F} \$(INSTALLARCHLIB)/auto/\$(FULLEXT)/*.al
  1832. !     $att{RM_F} \$(INSTALLARCHLIB)/auto/\$(FULLEXT)/*.ix
  1833. !     \$(MAKE) INST_LIB=\$(INSTALLPRIVLIB) INST_ARCHLIB=\$(INSTALLARCHLIB) INST_EXE=\$(INSTALLBIN)
  1834. !     \@\$(PERL) -i.bak -lne 'print unless \$\$seen{\$\$_}++' \$(INSTALLARCHLIB)/auto/\$(FULLEXT)/.packlist
  1835.   ");
  1836.   
  1837. +     push @m, '
  1838. + #### UNINSTALL IS STILL EXPERIMENTAL ####
  1839. + uninstall ::
  1840. + ';
  1841. +     push(@m, map("\tcd $_ && test -f $att{MAKEFILE} && \$(MAKE) uninstall\n",
  1842. +          @{$att{DIR}}));
  1843. +     push @m, "\t".'$(RM_RF) `cat $(INSTALLARCHLIB)/auto/$(FULLEXT)/.packlist`
  1844. + ';
  1845.       join("",@m);
  1846.   }
  1847.   
  1848. ***************
  1849. *** 1805,1811 ****
  1850.   
  1851.   
  1852.   sub perldepend {
  1853. !     my(@m);
  1854.       push(@m,'
  1855.   PERL_HDRS = $(PERL_INC)/EXTERN.h $(PERL_INC)/INTERN.h \
  1856.       $(PERL_INC)/XSUB.h    $(PERL_INC)/av.h    $(PERL_INC)/cop.h \
  1857. --- 1908,1914 ----
  1858.   
  1859.   
  1860.   sub perldepend {
  1861. !     my(@m);
  1862.       push(@m,'
  1863.   PERL_HDRS = $(PERL_INC)/EXTERN.h $(PERL_INC)/INTERN.h \
  1864.       $(PERL_INC)/XSUB.h    $(PERL_INC)/av.h    $(PERL_INC)/cop.h \
  1865. ***************
  1866. *** 1818,1826 ****
  1867.       $(PERL_INC)/scope.h    $(PERL_INC)/sv.h    $(PERL_INC)/unixish.h \
  1868.       $(PERL_INC)/util.h    $(PERL_INC)/config.h
  1869.   
  1870. - $(OBJECT) : $(PERL_HDRS)
  1871.   ');
  1872.   
  1873.       push(@m,'
  1874.   # Check for unpropogated config.sh changes. Should never happen.
  1875.   # We do NOT just update config.h because that is not sufficient.
  1876. --- 1921,1932 ----
  1877.       $(PERL_INC)/scope.h    $(PERL_INC)/sv.h    $(PERL_INC)/unixish.h \
  1878.       $(PERL_INC)/util.h    $(PERL_INC)/config.h
  1879.   
  1880.   ');
  1881.   
  1882. +     push @m, '
  1883. + $(OBJECT) : $(PERL_HDRS)
  1884. + ' if $att{OBJECT};
  1885.       push(@m,'
  1886.   # Check for unpropogated config.sh changes. Should never happen.
  1887.   # We do NOT just update config.h because that is not sufficient.
  1888. ***************
  1889. *** 1840,1861 ****
  1890.   
  1891.   
  1892.   sub makefile {
  1893.       # We do not know what target was originally specified so we
  1894.       # must force a manual rerun to be sure. But as it should only
  1895.       # happen very rarely it is not a significant problem.
  1896. !     '
  1897.   $(OBJECT) : '.$att{MAKEFILE}.'
  1898.   
  1899.   # We take a very conservative approach here, but it\'s worth it.
  1900.   # We move Makefile to Makefile.old here to avoid gnu make looping.
  1901. ! '.$att{MAKEFILE}.':    Makefile.PL $(CONFIGDEP)
  1902.       @echo "Makefile out-of-date with respect to $?"
  1903.       @echo "Cleaning current config before rebuilding Makefile..."
  1904.       -@mv '."$att{MAKEFILE} $att{MAKEFILE}.old".'
  1905.       -$(MAKE) -f '.$att{MAKEFILE}.'.old clean >/dev/null 2>&1 || true
  1906. !     $(PERL) $(I_PERL_LIBS) Makefile.PL '."@ARGV".'
  1907.       @echo "Now you must rerun make."; false
  1908.   ';
  1909.   }
  1910.   
  1911.   sub postamble{
  1912. --- 1946,1970 ----
  1913.   
  1914.   
  1915.   sub makefile {
  1916. +     my @m;
  1917.       # We do not know what target was originally specified so we
  1918.       # must force a manual rerun to be sure. But as it should only
  1919.       # happen very rarely it is not a significant problem.
  1920. !     push @m, '
  1921.   $(OBJECT) : '.$att{MAKEFILE}.'
  1922.   
  1923.   # We take a very conservative approach here, but it\'s worth it.
  1924.   # We move Makefile to Makefile.old here to avoid gnu make looping.
  1925. ! '.$att{MAKEFILE}.' :    Makefile.PL $(CONFIGDEP)
  1926.       @echo "Makefile out-of-date with respect to $?"
  1927.       @echo "Cleaning current config before rebuilding Makefile..."
  1928.       -@mv '."$att{MAKEFILE} $att{MAKEFILE}.old".'
  1929.       -$(MAKE) -f '.$att{MAKEFILE}.'.old clean >/dev/null 2>&1 || true
  1930. !     $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL '."@ARGV".'
  1931.       @echo "Now you must rerun make."; false
  1932.   ';
  1933. +     join "", @m;
  1934.   }
  1935.   
  1936.   sub postamble{
  1937. ***************
  1938. *** 1872,1878 ****
  1939.   %Dir_Target = (); # package global
  1940.   
  1941.   sub dir_target {
  1942. !     my($self,@dirs)=@_;
  1943.       my(@m,$dir);
  1944.       foreach $dir (@dirs) {
  1945.       next if $Dir_Target{$dir};
  1946. --- 1981,1987 ----
  1947.   %Dir_Target = (); # package global
  1948.   
  1949.   sub dir_target {
  1950. !     my($self,@dirs) = @_;
  1951.       my(@m,$dir);
  1952.       foreach $dir (@dirs) {
  1953.       next if $Dir_Target{$dir};
  1954. ***************
  1955. *** 1963,1971 ****
  1956.   ";
  1957.   
  1958.       unless ($libperl && -f $libperl) {
  1959. !     my $dir = (defined $att{PERL_SRC}) ? $att{PERL_SRC}
  1960. !                        : "$Config{'installarchlib'}/CORE";
  1961. !     $libperl = "libperl.a" unless $libperl;
  1962.       $libperl = "$dir/$libperl";
  1963.       print STDOUT "Warning: $libperl not found"
  1964.           unless (-f $libperl || defined($att{PERL_SRC}));
  1965. --- 2072,2079 ----
  1966.   ";
  1967.   
  1968.       unless ($libperl && -f $libperl) {
  1969. !     my $dir = $att{PERL_SRC} || "$att{PERL_ARCHLIB}/CORE";
  1970. !     $libperl ||= "libperl.a";
  1971.       $libperl = "$dir/$libperl";
  1972.       print STDOUT "Warning: $libperl not found"
  1973.           unless (-f $libperl || defined($att{PERL_SRC}));
  1974. ***************
  1975. *** 2008,2265 ****
  1976.   # We write EXTRA outside the perl program to have it eval'd by the shell
  1977.       push @m, q{
  1978.   doc_inst_perl:
  1979.       @ $(FULLPERL) -e 'use ExtUtils::MakeMaker; MM->writedoc("Perl binary",' \\
  1980.           -e '"$(MAP_TARGET)", "MAP_STATIC=$(MAP_STATIC)",' \\
  1981. !         -e '"MAP_EXTRA=@ARGV", "MAP_LIBPERL=$(MAP_LIBPERL)")' -- `cat extralibs.ld`
  1982.   };
  1983.   
  1984.       push @m, qq{
  1985.   inst_perl: pure_inst_perl doc_inst_perl
  1986.   
  1987.   pure_inst_perl: \$(MAP_TARGET)
  1988. !     $att{CP} \$(MAP_TARGET) $Config{'installbin'}/\$(MAP_TARGET)
  1989.   
  1990.   realclean :: map_clean
  1991.   
  1992. - distclean :: realclean
  1993.   map_clean :
  1994. !     $att{RM_F} $tmp/perlmain.o $tmp/perlmain.c $makefilename
  1995.   };
  1996.   
  1997.       join '', @m;
  1998.   }
  1999.   
  2000. ! # --- Determine libraries to use and how to use them ---
  2001. ! sub extliblist{
  2002. !     my($self, $potential_libs)=@_;
  2003. !     return ("", "", "") unless $potential_libs;
  2004. !     print STDOUT "Potential libraries are '$potential_libs':" if $Verbose;
  2005. !     my($so)   = $Config{'so'};
  2006. !     my($libs) = $Config{'libs'};
  2007. !     # compute $extralibs, $bsloadlibs and $ldloadlibs from
  2008. !     # $potential_libs
  2009. !     # this is a rewrite of Andy Dougherty's extliblist in perl
  2010. !     # its home is in <distribution>/ext/util
  2011. !     my(@searchpath); # from "-L/path" entries in $potential_libs
  2012. !     my(@libpath) = split " ", $Config{'libpth'};
  2013. !     my(@ldloadlibs, @bsloadlibs, @extralibs);
  2014. !     my($fullname, $thislib, $thispth, @fullname);
  2015. !     my($pwd) = fastcwd(); # from Cwd.pm
  2016. !     my($found) = 0;
  2017. !     foreach $thislib (split ' ', $potential_libs){
  2018. !     # Handle possible linker path arguments.
  2019. !     if ($thislib =~ s/^(-[LR])//){    # save path flag type
  2020. !         my($ptype) = $1;
  2021. !         unless (-d $thislib){
  2022. !         print STDOUT "$ptype$thislib ignored, directory does not exist\n"
  2023. !             if $Verbose;
  2024. !         next;
  2025. !         }
  2026. !         if ($thislib !~ m|^/|) {
  2027. !           print STDOUT "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n";
  2028. !           $thislib = "$pwd/$thislib";
  2029. !         }
  2030. !         push(@searchpath, $thislib);
  2031. !         push(@extralibs,  "$ptype$thislib");
  2032. !         push(@ldloadlibs, "$ptype$thislib");
  2033. !         next;
  2034. !     }
  2035. !     # Handle possible library arguments.
  2036. !     unless ($thislib =~ s/^-l//){
  2037. !       print STDOUT "Unrecognized argument in LIBS ignored: '$thislib'\n";
  2038. !       next;
  2039. !     }
  2040. !     my($found_lib)=0;
  2041. !     foreach $thispth (@searchpath, @libpath){
  2042. !         # Try to find the full name of the library.  We need this to
  2043. !         # determine whether it's a dynamically-loadable library or not.
  2044. !         # This tends to be subject to various os-specific quirks.
  2045. !         # For gcc-2.6.2 on linux (March 1995), DLD can not load
  2046. !         # .sa libraries, with the exception of libm.sa, so we
  2047. !         # deliberately skip them.
  2048. !         if (@fullname = lsdir($thispth,"^lib$thislib\.$so\.[0-9]+")){
  2049. !         # Take care that libfoo.so.10 wins against libfoo.so.9.
  2050. !         # Compare two libraries to find the most recent version
  2051. !         # number.  E.g.  if you have libfoo.so.9.0.7 and
  2052. !         # libfoo.so.10.1, first convert all digits into two
  2053. !         # decimal places.  Then we'll add ".00" to the shorter
  2054. !         # strings so that we're comparing strings of equal length
  2055. !         # Thus we'll compare libfoo.so.09.07.00 with
  2056. !         # libfoo.so.10.01.00.  Some libraries might have letters
  2057. !         # in the version.  We don't know what they mean, but will
  2058. !         # try to skip them gracefully -- we'll set any letter to
  2059. !         # '0'.  Finally, sort in reverse so we can take the
  2060. !         # first element.
  2061. !         $fullname = "$thispth/" .
  2062. !         (sort { my($ma) = $a;
  2063. !             my($mb) = $b;
  2064. !             $ma =~ tr/A-Za-z/0/s;
  2065. !             $ma =~ s/\b(\d)\b/0$1/g;
  2066. !             $mb =~ tr/A-Za-z/0/s;
  2067. !             $mb =~ s/\b(\d)\b/0$1/g;
  2068. !             while (length($ma) < length($mb)) { $ma .= ".00"; }
  2069. !             while (length($mb) < length($ma)) { $mb .= ".00"; }
  2070. !             # Comparison deliberately backwards
  2071. !             $mb cmp $ma;} @fullname)[0];
  2072. !         } elsif (-f ($fullname="$thispth/lib$thislib.$so")
  2073. !          && (($Config{'dlsrc'} ne "dl_dld.xs") || ($thislib eq "m"))){
  2074. !         } elsif (-f ($fullname="$thispth/lib${thislib}_s.a")
  2075. !          && ($thislib .= "_s") ){ # we must explicitly use _s version
  2076. !         } elsif (-f ($fullname="$thispth/lib$thislib.a")){
  2077. !         } elsif (-f ($fullname="$thispth/Slib$thislib.a")){
  2078. !         } else {
  2079. !         print STDOUT "$thislib not found in $thispth" if $Verbose;
  2080. !         next;
  2081. !         }
  2082. !         print STDOUT "'-l$thislib' found at $fullname" if $Verbose;
  2083. !         $found++;
  2084. !         $found_lib++;
  2085. !         # Now update library lists
  2086. !         # what do we know about this library...
  2087. !         my $is_dyna = ($fullname !~ /\.a$/);
  2088. !         my $in_perl = ($libs =~ /\B-l${thislib}\b/s);
  2089. !         # Do not add it into the list if it is already linked in
  2090. !         # with the main perl executable.
  2091. !         # We have to special-case the NeXT, because all the math 
  2092. !         # is also in libsys_s
  2093. !         unless ($in_perl || 
  2094. !             ($Config{'osname'} eq 'next' && $thislib eq 'm') ){
  2095. !         push(@extralibs, "-l$thislib");
  2096. !         }
  2097. !         # We might be able to load this archive file dynamically
  2098. !         if ( $Config{'dlsrc'} =~ /dl_next|dl_dld/){
  2099. !         # We push -l$thislib instead of $fullname because
  2100. !         # it avoids hardwiring a fixed path into the .bs file.
  2101. !         # mkbootstrap will automatically add dl_findfile() to
  2102. !         # the .bs file if it sees a name in the -l format.
  2103. !         # USE THIS, when dl_findfile() is fixed: 
  2104. !         # push(@bsloadlibs, "-l$thislib");
  2105. !         # OLD USE WAS while checking results against old_extliblist
  2106. !         push(@bsloadlibs, "$fullname");
  2107. !         } else {
  2108. !         if ($is_dyna){
  2109. !                     # For SunOS4, do not add in this shared library if
  2110. !                     # it is already linked in the main perl executable
  2111. !             push(@ldloadlibs, "-l$thislib")
  2112. !             unless ($in_perl and $Config{'osname'} eq 'sunos');
  2113. !         } else {
  2114. !             push(@ldloadlibs, "-l$thislib");
  2115. !         }
  2116. !         }
  2117. !         last;    # found one here so don't bother looking further
  2118. !     }
  2119. !     print STDOUT "Warning (non-fatal): No library found for -l$thislib" 
  2120. !         unless $found_lib>0;
  2121. !     }
  2122. !     return ('','','') unless $found;
  2123. !     ("@extralibs", "@bsloadlibs", "@ldloadlibs");
  2124. ! }
  2125. ! # --- Write a DynaLoader bootstrap file if required
  2126. ! sub mkbootstrap {
  2127. ! =head1 USEFUL SUBROUTINES
  2128. ! =head2 mkbootstrap()
  2129. ! Make a bootstrap file for use by this system's DynaLoader.  It
  2130. ! typically gets called from an extension Makefile.
  2131. ! There is no C<*.bs> file supplied with the extension. Instead a
  2132. ! C<*_BS> file which has code for the special cases, like posix for
  2133. ! berkeley db on the NeXT.
  2134. ! This file will get parsed, and produce a maybe empty
  2135. ! C<@DynaLoader::dl_resolve_using> array for the current architecture.
  2136. ! That will be extended by $BSLOADLIBS, which was computed by Andy's
  2137. ! extliblist script. If this array still is empty, we do nothing, else
  2138. ! we write a .bs file with an C<@DynaLoader::dl_resolve_using> array, but
  2139. ! without any C<if>s, because there is no longer a need to deal with
  2140. ! special cases.
  2141. ! The C<*_BS> file can put some code into the generated C<*.bs> file by placing
  2142. ! it in C<$bscode>. This is a handy 'escape' mechanism that may prove
  2143. ! useful in complex situations.
  2144. ! If @DynaLoader::dl_resolve_using contains C<-L*> or C<-l*> entries then
  2145. ! mkbootstrap will automatically add a dl_findfile() call to the
  2146. ! generated C<*.bs> file.
  2147. ! =cut
  2148. !     my($self, @bsloadlibs)=@_;
  2149. !     @bsloadlibs = grep($_, @bsloadlibs); # strip empty libs
  2150. !     print STDOUT "    bsloadlibs=@bsloadlibs\n" if $Verbose;
  2151. !     # We need DynaLoader here because we and/or the *_BS file may
  2152. !     # call dl_findfile(). We don't say `use' here because when
  2153. !     # first building perl extensions the DynaLoader will not have
  2154. !     # been built when MakeMaker gets first used.
  2155. !     require DynaLoader;
  2156. !     import DynaLoader;
  2157. !     init_main() unless defined $att{'BASEEXT'};
  2158. !     rename "$att{BASEEXT}.bs", "$att{BASEEXT}.bso";
  2159. !     if (-f "$att{BASEEXT}_BS"){
  2160. !     $_ = "$att{BASEEXT}_BS";
  2161. !     package DynaLoader; # execute code as if in DynaLoader
  2162. !     local($osname, $dlsrc) = (); # avoid warnings
  2163. !     ($osname, $dlsrc) = @Config::Config{qw(osname dlsrc)};
  2164. !     $bscode = "";
  2165. !     unshift @INC, ".";
  2166. !     require $_;
  2167. !     shift @INC;
  2168. !     }
  2169. !     if ($Config{'dlsrc'} =~ /^dl_dld/){
  2170. !     package DynaLoader;
  2171. !     push(@dl_resolve_using, dl_findfile('-lc'));
  2172. !     }
  2173. !     my(@all) = (@bsloadlibs, @DynaLoader::dl_resolve_using);
  2174. !     my($method) = '';
  2175. !     if (@all){
  2176. !     open BS, ">$att{BASEEXT}.bs"
  2177. !         or die "Unable to open $att{BASEEXT}.bs: $!";
  2178. !     print STDOUT "Writing $att{BASEEXT}.bs\n";
  2179. !     print STDOUT "    containing: @all" if $Verbose;
  2180. !     print BS "# $att{BASEEXT} DynaLoader bootstrap file for $Config{'osname'} architecture.\n";
  2181. !     print BS "# Do not edit this file, changes will be lost.\n";
  2182. !     print BS "# This file was automatically generated by the\n";
  2183. !     print BS "# mkbootstrap routine in ExtUtils/MakeMaker.pm.\n";
  2184. !     print BS "\@DynaLoader::dl_resolve_using = ";
  2185. !     # If @all contains names in the form -lxxx or -Lxxx then it's asking for
  2186. !     # runtime library location so we automatically add a call to dl_findfile()
  2187. !     if (" @all" =~ m/ -[lLR]/){
  2188. !         print BS "  dl_findfile(qw(\n  @all\n  ));\n";
  2189. !     }else{
  2190. !         print BS "  qw(@all);\n";
  2191. !     }
  2192. !     # write extra code if *_BS says so
  2193. !     print BS $DynaLoader::bscode if $DynaLoader::bscode;
  2194. !     print BS "\n1;\n";
  2195. !     close BS;
  2196. !     }
  2197.   }
  2198.   
  2199.   sub mksymlists {
  2200. --- 2116,2147 ----
  2201.   # We write EXTRA outside the perl program to have it eval'd by the shell
  2202.       push @m, q{
  2203.   doc_inst_perl:
  2204. +     @ echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
  2205.       @ $(FULLPERL) -e 'use ExtUtils::MakeMaker; MM->writedoc("Perl binary",' \\
  2206.           -e '"$(MAP_TARGET)", "MAP_STATIC=$(MAP_STATIC)",' \\
  2207. !         -e '"MAP_EXTRA=@ARGV", "MAP_LIBPERL=$(MAP_LIBPERL)")' \\
  2208. !         -- `cat extralibs.ld` >> $(INSTALLARCHLIB)/perllocal.pod
  2209.   };
  2210.   
  2211.       push @m, qq{
  2212.   inst_perl: pure_inst_perl doc_inst_perl
  2213.   
  2214.   pure_inst_perl: \$(MAP_TARGET)
  2215. !     $att{CP} \$(MAP_TARGET) \$(INSTALLBIN)/\$(MAP_TARGET)
  2216.   
  2217.   realclean :: map_clean
  2218.   
  2219.   map_clean :
  2220. !     $att{RM_F} $tmp/perlmain.o $tmp/perlmain.c $makefilename extralibs.ld
  2221.   };
  2222.   
  2223.       join '', @m;
  2224.   }
  2225.   
  2226. ! sub extliblist {
  2227. !     my($self,$libs) = @_;
  2228. !     require ExtUtils::Liblist;
  2229. !     ExtUtils::Liblist::ext($libs, $Verbose);
  2230.   }
  2231.   
  2232.   sub mksymlists {
  2233. ***************
  2234. *** 2301,2523 ****
  2235.   # --- perllocal.pod section ---
  2236.   sub writedoc {
  2237.       my($self,$what,$name,@attribs)=@_;
  2238. !     -w $Config{'installarchlib'} or die "No write permission to $Config{'installarchlib'}";
  2239. !     my($localpod) = "$Config{'installarchlib'}/perllocal.pod";
  2240.       my($time);
  2241. !     if (-f $localpod) {
  2242. !     print "Appending installation info to $localpod\n";
  2243. !     open POD, ">>$localpod" or die "Couldn't open $localpod";
  2244. !     } else {
  2245. !     print "Writing new file $localpod\n";
  2246. !     open POD, ">$localpod" or die "Couldn't open $localpod";
  2247. !     print POD "=head1 NAME
  2248. ! perllocal - locally installed modules and perl binaries
  2249. ! \n=head1 HISTORY OF LOCAL INSTALLATIONS
  2250. ! ";
  2251. !     }
  2252.       require "ctime.pl";
  2253.       chop($time = ctime(time));
  2254. !     print POD "=head2 $time: $what C<$name>\n\n=over 4\n\n=item *\n\n";
  2255. !     print POD join "\n\n=item *\n\n", map("C<$_>",@attribs);
  2256. !     print POD "\n\n=back\n\n";
  2257. !     close POD;
  2258.   }
  2259.   
  2260.   
  2261.   =head1 AUTHORS
  2262.   
  2263.   Andy Dougherty F<E<lt>doughera@lafcol.lafayette.eduE<gt>>, Andreas
  2264.   Koenig F<E<lt>k@franz.ww.TU-Berlin.DEE<gt>>, Tim Bunce
  2265.   F<E<lt>Tim.Bunce@ig.co.ukE<gt>>.  VMS support by Charles Bailey
  2266. ! F<E<lt>bailey@HMIVAX.HUMGEN.UPENN.EDUE<gt>>.
  2267.   
  2268.   =head1 MODIFICATION HISTORY
  2269.   
  2270.   v1, August 1994; by Andreas Koenig. Based on Andy Dougherty's Makefile.SH.
  2271.   v2, September 1994 by Tim Bunce.
  2272.   v3.0 October  1994 by Tim Bunce.
  2273.   v3.1 November 11th 1994 by Tim Bunce.
  2274.   v3.2 November 18th 1994 by Tim Bunce.
  2275.   v3.3 November 27th 1994 by Andreas Koenig.
  2276.   v3.4 December  7th 1994 by Andreas Koenig and Tim Bunce.
  2277.   v3.5 December 15th 1994 by Tim Bunce.
  2278.   v3.6 December 15th 1994 by Tim Bunce.
  2279.   v3.7 December 30th 1994 By Tim Bunce
  2280.   v3.8 January  17th 1995 By Andreas Koenig and Tim Bunce
  2281.   v3.9 January 19th 1995 By Tim Bunce
  2282.   v3.10 January 23rd 1995 By Tim Bunce
  2283.   v3.11 January 24th 1995 By Andreas Koenig
  2284.   v4.00 January 24th 1995 By Tim Bunce
  2285.   v4.01 January 25th 1995 By Tim Bunce
  2286.   v4.02 January 29th 1995 By Andreas Koenig
  2287.   v4.03 January 30th 1995 By Andreas Koenig
  2288.   v4.04 Februeary 5th 1995 By Andreas Koenig
  2289.   v4.05 February 8th 1995 By Andreas Koenig
  2290.   v4.06 February 10th 1995 By Andreas Koenig
  2291.   v4.061 February 12th 1995 By Andreas Koenig
  2292.   v4.08 - 4.085  February 14th-21st 1995 by Andreas Koenig
  2293.   
  2294. ! Introduces EXE_FILES and INST_EXE for installing executable scripts 
  2295. ! and fixes documentation to reflect the new variable.
  2296.   
  2297. ! Introduces the automated documentation of the installation history. Every
  2298. !   make install
  2299. ! and
  2300. !   make inst_perl
  2301. ! add some documentation to the file C<$installarchlib/perllocal.pod>.
  2302. ! This is done by the writedoc() routine in the MM_Unix class. The
  2303. ! documentation is rudimentary until we find an agreement, what 
  2304. ! information is supposed to go into the pod.
  2305.   
  2306. ! Added ability to specify the another name than C<perl> for a new binary.
  2307.   
  2308. ! Both C<make perl> and C<makeaperl> now prompt the user, how to install
  2309. ! the new binary after the build.
  2310.   
  2311. ! Reduced noise during the make.
  2312.   
  2313. ! Variable LIBPERL_A enables indirect setting of the switches -DEMBED,
  2314. ! -DDEBUGGING and -DMULTIPLICITY in the same way as done by cflags.
  2315.   
  2316. ! old_extliblist() code deleted, new_extliblist() renamed to extliblist().
  2317.   
  2318. ! Improved algorithm in extliblist, that returns ('','','') if no
  2319. ! library has been found, even if a C<-L> directory has been found.
  2320.   
  2321. ! Fixed a bug that didn't allow lib/ directory work as documented.
  2322.   
  2323. ! Allowed C<make test TEST_VERBOSE=1>
  2324.   
  2325. ! v4.086 March 9 1995 by Andy Dougherty
  2326.   
  2327. ! Fixed some AIX buglets.  Fixed DLD support for Linux with gcc 2.6.2.
  2328.   
  2329. ! v4.09 March 31 1995 by Andreas Koenig
  2330.   
  2331. ! Patches from Tim (/usr/local/lib/perl5/hpux/CORE/libperl.a not found
  2332. ! message eliminated, and a small makeaperl patch).
  2333.   
  2334. ! blib now is a relative directory (./blib).
  2335.   
  2336. ! Documentation bug fixed.
  2337.   
  2338. ! Chdir in the Makefile always followed by "&&", not by ";".
  2339.   
  2340. ! The output of cflags is no longer directed to /dev/null, but the shell
  2341. ! version of cflags is now only called once.
  2342.   
  2343. ! The result of MakeMaker's cflags takes precedence over
  2344. ! shell-cflags.
  2345.   
  2346. ! Introduced a $(PASTHRU) variable, that doesn't have much effect yet,
  2347. ! but now it's easier to add variables that have to be passed to
  2348. ! recursive makes.
  2349.   
  2350. ! 'make config' will now always reapply the original arguments to the
  2351. ! 'perl Makefile.PL'.
  2352.   
  2353. ! MKPATH will be called only once for any directory (should speed up Tk
  2354. ! building and installation considerably).
  2355.   
  2356. ! "Subroutine mkbootstrap redefined" message eliminated. It was
  2357. ! necessary to move &mkbootstrap and &mksymlists from @EXPORT to
  2358. ! @EXPORT_OK.
  2359.   
  2360. ! C<*.PL> files will be processed by C<$(PERL)>.
  2361.   
  2362. ! Turned some globals into my() variables, where it was obvious to be an
  2363. ! oversight.
  2364.   
  2365. ! Changed some continuation lines so that they work on Solaris and Unicos.
  2366.   
  2367. ! v4.091 April 3 1995 by Andy Dougherty
  2368.   
  2369. ! Another attempt to fix writedoc() from Dean Roehrich.
  2370.   
  2371. ! v4.092 April 11 1995 by Andreas Koenig
  2372. ! Fixed a docu bug in hint file description. Added printing of a warning
  2373. ! from eval in the hintfile section if the eval has errors.  Moved
  2374. ! check_hints() into the WriteMakefile() subroutine to avoid evaling
  2375. ! hintsfiles for other uses of the module (mkbootstrap, mksymlists).
  2376.   
  2377. ! Eliminated csh globbing to work around buggy Linux csh.
  2378.   
  2379. ! In extliblist() libfoo.so.10 now wins against libfoo.so.9.
  2380.   
  2381. ! Use $(CC) instead of $Config{'cc'} everywhere to allow overriding
  2382. ! according to a patch by Dean Roehrich.
  2383.   
  2384. ! Introduce a ./extralibs.ld file that contains the contents of all
  2385. ! relevant extralibs.ld files for a static build to shorten the command
  2386. ! line for the linking of a new static perl.
  2387.   
  2388. ! Minor cosmetics.
  2389.   
  2390. ! v4.093 April 12 1995 by Andy Dougherty
  2391.   
  2392. ! Rename distclean target to plain dist.  Insert a dummy distclean
  2393. ! target that's the same as realclean.  This is more consistent with the
  2394. ! main perl makefile.
  2395.   
  2396. ! Fix up extliblist() so even bizarre names like libfoo.so.10.0.1
  2397. ! are handled.
  2398.   
  2399. ! Include Tim's suggestions about $verbose and more careful substitution
  2400. ! of $(CC) for $Config{'cc'}.
  2401.   
  2402. ! v4.094 April 12 1995 by Andy Dougherty
  2403.   
  2404. ! Include Andreas' improvement of $(CC) detection.
  2405.   
  2406. ! v4.095 May 30 1995 by Andy Dougherty
  2407.   
  2408. ! Include installation of .pod and .pm files.
  2409.   
  2410. ! Space out documentation for better printing with pod2man.
  2411. ! =head1 NOTES
  2412. ! MakeMaker development work still to be done:
  2413.   
  2414.   Needs more complete documentation.
  2415.   
  2416. ! Add a html: target when there has been found a general solution to
  2417.   installing html files.
  2418.   
  2419. - Add an uninstall target.
  2420.   Add a FLAVOR variable that makes it easier to build debugging,
  2421. ! embedded or multiplicity perls.
  2422.   
  2423.   =cut
  2424. - # the following keeps AutoSplit happy
  2425. - package ExtUtils::MakeMaker;
  2426. - 1;
  2427. - __END__
  2428. --- 2183,2807 ----
  2429.   # --- perllocal.pod section ---
  2430.   sub writedoc {
  2431.       my($self,$what,$name,@attribs)=@_;
  2432. ! # the following would have to move to a ExtUtils::Perllocal.pm, if we want it
  2433. ! # it's dangerous wrt AFS, and it's against the philosophy that MakeMaker
  2434. ! # should never write to files. We write to stdout and append to the file
  2435. ! # during make install, but we cannot rely on '-f $Config{"installarchlib"},
  2436. ! # as there is a time window between the WriteMakefile and the make.
  2437. ! #    -w $Config{'installarchlib'} or die "No write permission to $Config{'installarchlib'}";
  2438. ! #    my($localpod) = "$Config{'installarchlib'}/perllocal.pod";
  2439.       my($time);
  2440. ! #    if (-f $localpod) {
  2441. ! #    print "Appending installation info to $localpod\n";
  2442. ! #    open POD, ">>$localpod" or die "Couldn't open $localpod";
  2443. ! #    } else {
  2444. ! #    print "Writing new file $localpod\n";
  2445. ! #    open POD, ">$localpod" or die "Couldn't open $localpod";
  2446. ! #    print POD "=head1 NAME
  2447. ! #
  2448. ! #perllocal - locally installed modules and perl binaries
  2449. ! #\n=head1 HISTORY OF LOCAL INSTALLATIONS
  2450. ! #
  2451. ! #";
  2452. ! #    }
  2453.       require "ctime.pl";
  2454.       chop($time = ctime(time));
  2455. !     print "=head2 $time: $what C<$name>\n\n=over 4\n\n=item *\n\n";
  2456. !     print join "\n\n=item *\n\n", map("C<$_>",@attribs);
  2457. !     print "\n\n=back\n\n";
  2458. ! #    close POD;
  2459.   }
  2460.   
  2461.   
  2462. + # the following keeps AutoSplit happy
  2463. + package ExtUtils::MakeMaker;
  2464. + 1;
  2465. + __END__
  2466. + =head1 NAME
  2467. + ExtUtils::MakeMaker - create an extension Makefile
  2468. + =head1 SYNOPSIS
  2469. + C<use ExtUtils::MakeMaker;>
  2470. + C<WriteMakefile( ATTRIBUTE =E<gt> VALUE [, ...] );>
  2471. + =head1 DESCRIPTION
  2472. + This utility is designed to write a Makefile for an extension module
  2473. + from a Makefile.PL. It is based on the Makefile.SH model provided by
  2474. + Andy Dougherty and the perl5-porters.
  2475. + It splits the task of generating the Makefile into several subroutines
  2476. + that can be individually overridden.  Each subroutine returns the text
  2477. + it wishes to have written to the Makefile.
  2478. + MakeMaker.pm uses the architecture specific information from
  2479. + Config.pm. In addition the extension may contribute to the C<%Config>
  2480. + hash table of Config.pm by supplying hints files in a C<hints/>
  2481. + directory. The hints files are expected to be named like their
  2482. + counterparts in C<PERL_SRC/hints>, but with an C<.pl> file name
  2483. + extension (eg. C<next_3_2.pl>). They are simply C<eval>ed by MakeMaker
  2484. + within the WriteMakefile() subroutine, and can be used to execute
  2485. + commands as well as to include special variables. If there is no
  2486. + hintsfile for the actual system, but for some previous releases of the
  2487. + same operating system, the latest one of those is used.
  2488. + =head2 Default Makefile Behaviour
  2489. + The automatically generated Makefile enables the user of the extension
  2490. + to invoke
  2491. +   perl Makefile.PL # optionally "perl Makefile.PL verbose"
  2492. +   make
  2493. +   make test # optionally set TEST_VERBOSE=1
  2494. +   make install # See below
  2495. + The Makefile to be produced may be altered by adding arguments of the
  2496. + form C<KEY=VALUE>. If the user wants to work with a different perl
  2497. + than the default, this is achieved by specifying
  2498. +   perl Makefile.PL PERL=/tmp/myperl5
  2499. + Other interesting targets in the generated Makefile are
  2500. +   make config     # to check if the Makefile is up-to-date
  2501. +   make clean      # delete local temporary files (Makefile gets renamed)
  2502. +   make realclean  # delete all derived files (including installed files)
  2503. +   make dist       # see below the Distribution Support section
  2504. + =head2 Special case C<make install>
  2505. + C<make> alone puts all relevant files into directories that are named
  2506. + by the macros INST_LIB, INST_ARCHLIB, and INST_EXE. All three default
  2507. + to ./blib if you are I<not> building below the perl source directory. If
  2508. + you I<are> building below the perl source, INST_LIB and INST_ARCHLIB
  2509. + default to ../../lib, and INST_EXE is not defined.
  2510. + The I<install> target of the generated Makefile is a recursive call to
  2511. + make which sets
  2512. +     INST_LIB     to INSTALLPRIVLIB
  2513. +     INST_ARCHLIB to INSTALLARCHLIB
  2514. +     INST_EXE     to INSTALLBIN
  2515. + The three INSTALL... macros in turn default to
  2516. + $Config{installprivlib}, $Config{installarchlib}, and
  2517. + $Config{installbin} respectively.
  2518. + The recommended way to proceed is to set only the INSTALL* macros, not
  2519. + the INST_* targets. In doing so, you give room to the compilation
  2520. + process without affecting important directories. Usually a 'make test'
  2521. + will succeed after the make, and a 'make install' can finish the game.
  2522. + MakeMaker gives you much more freedom than needed to configure
  2523. + internal variables and get different results. It is worth to mention,
  2524. + that make(1) also lets you configure most of the variables that are
  2525. + used in the Makefile. But in the majority of situations this will not
  2526. + be necessary, and should only be done, if the author of a package
  2527. + recommends it.
  2528. + The usual relationship between INSTALLPRIVLIB and INSTALLARCHLIB is
  2529. + that the latter is a subdirectory of the former with the name
  2530. + C<$Config{'archname'}>, MakeMaker supports the user who sets
  2531. + INSTALLPRIVLIB. If INSTALLPRIVLIB is set, but INSTALLARCHLIB not, then
  2532. + MakeMaker defaults the latter to be INSTALLPRIVLIB/ARCHNAME if that
  2533. + directory exists, otherwise it defaults to INSTALLPRIVLIB.
  2534. + Previous versions of MakeMaker suggested to use the INST_* macros. For
  2535. + backwards compatibility, these are still supported but deprecated in
  2536. + favor of the INSTALL* macros.
  2537. + Here is the description, what they are used for: If the user specifies
  2538. + the final destination for the INST_... macros, then there is no need
  2539. + to call 'make install', because 'make' will already put all files in
  2540. + place.
  2541. + If there is a need to first build everything in the C<./blib>
  2542. + directory and test the product, then it's appropriate to use the
  2543. + INSTALL... macros. So the users have the choice to either say
  2544. +     # case: trust the module
  2545. +     perl Makefile.PL INST_LIB=~/perllib INST_EXE=~/bin
  2546. +     make
  2547. +     make test
  2548. + or
  2549. +     perl Makefile.PL INSTALLPRIVLIB=~/foo \
  2550. +             INSTALLARCHLIB=~/foo/bar  INSTALLBIN=~/bin
  2551. +     make
  2552. +     make test
  2553. +     make install
  2554. + Note, that the tilde expansion is done by MakeMaker, not by perl by
  2555. + default, nor by make. So be careful to use the tilde only with the
  2556. + C<perl Makefile.PL> call.
  2557. + It is important to know, that the INSTALL* macros should be absolute
  2558. + paths, never relativ ones. Packages with multiple Makefile.PLs in
  2559. + different directories get the contents of the INSTALL* macros
  2560. + propagated verbatim. (The INST_* macros will be corrected, if they are
  2561. + relativ paths, but not the INSTALL* macros.)
  2562. + If the user has superuser privileges, and is not working on AFS
  2563. + (Andrew File System) or relatives, then the defaults for
  2564. + INSTALLPRIVLIB, INSTALLARCHLIB, and INSTALLBIN will be appropriate,
  2565. + and this incantation will be the best:
  2566. +     perl Makefile.PL; make; make test
  2567. +     make install
  2568. + (I<make test> is not necessarily supported for all modules.)
  2569. + C<make install> per default writes some documentation of what has been
  2570. + done into the file C<$Config{'installarchlib'}/perllocal.pod>. This is
  2571. + an experimental feature. It can be bypassed by calling C<make
  2572. + pure_install>.
  2573. + =head2 Support to Link a new Perl Binary (eg dynamic loading not available)
  2574. + An extension that is built with the above steps is ready to use on
  2575. + systems supporting dynamic loading. On systems that do not support
  2576. + dynamic loading, any newly created extension has to be linked together
  2577. + with the available resources. MakeMaker supports the linking process
  2578. + by creating appropriate targets in the Makefile whenever an extension
  2579. + is built. You can invoke the corresponding section of the makefile with
  2580. +     make perl
  2581. + That produces a new perl binary in the current directory with all
  2582. + extensions linked in that can be found in INST_ARCHLIB (usually
  2583. + C<./blib>) and PERL_ARCHLIB.
  2584. + The binary can be installed into the directory where perl normally
  2585. + resides on your machine with
  2586. +     make inst_perl
  2587. + To produce a perl binary with a different name than C<perl>, either say
  2588. +     perl Makefile.PL MAP_TARGET=myperl
  2589. +     make myperl
  2590. +     make inst_perl
  2591. + or say
  2592. +     perl Makefile.PL
  2593. +     make myperl MAP_TARGET=myperl
  2594. +     make inst_perl MAP_TARGET=myperl
  2595. + In any case you will be prompted with the correct invocation of the
  2596. + C<inst_perl> target that installs the new binary into INSTALLBIN.
  2597. + Note, that there is a C<makeaperl> scipt in the perl distribution,
  2598. + that supports the linking of a new perl binary in a similar fashion,
  2599. + but with more options.
  2600. + C<make inst_perl> per default writes some documentation of what has been
  2601. + done into the file C<$Config{'installarchlib'}/perllocal.pod>. This
  2602. + can be bypassed by calling C<make pure_inst_perl>.
  2603. + Warning: the inst_perl: target is rather mighty and will probably
  2604. + overwrite your existing perl binary. Use with care!
  2605. + =head2 Determination of Perl Library and Installation Locations
  2606. + MakeMaker needs to know, or to guess, where certain things are
  2607. + located.  Especially INST_LIB and INST_ARCHLIB (where to install files
  2608. + into), PERL_LIB and PERL_ARCHLIB (where to read existing modules
  2609. + from), and PERL_INC (header files and C<libperl*.*>).
  2610. + Extensions may be built either using the contents of the perl source
  2611. + directory tree or from an installed copy of the perl library.
  2612. + If an extension is being built below the C<ext/> directory of the perl
  2613. + source then MakeMaker will set PERL_SRC automatically (e.g., C<../..>).
  2614. + If PERL_SRC is defined then other variables default to the following:
  2615. +   PERL_INC     = PERL_SRC
  2616. +   PERL_LIB     = PERL_SRC/lib
  2617. +   PERL_ARCHLIB = PERL_SRC/lib
  2618. +   INST_LIB     = PERL_LIB
  2619. +   INST_ARCHLIB = PERL_ARCHLIB
  2620. + If an extension is being built away from the perl source then MakeMaker
  2621. + will leave PERL_SRC undefined and default to using the installed copy
  2622. + of the perl library. The other variables default to the following:
  2623. +   PERL_INC     = $archlib/CORE
  2624. +   PERL_LIB     = $privlib
  2625. +   PERL_ARCHLIB = $archlib
  2626. +   INST_LIB     = ./blib
  2627. +   INST_ARCHLIB = ./blib
  2628. + If perl has not yet been installed then PERL_SRC can be defined on the
  2629. + command line as shown in the previous section.
  2630. + =head2 Useful Default Makefile Macros
  2631. + FULLEXT = Pathname for extension directory (eg DBD/Oracle).
  2632. + BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
  2633. + ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)
  2634. + PERL_LIB = Directory where we read the perl library files
  2635. + PERL_ARCHLIB = Same as above for architecture dependent files
  2636. + INST_LIB = Directory where we put library files of this extension
  2637. + while building it. If we are building below PERL_SRC/ext
  2638. + we default to PERL_SRC/lib, else we default to ./blib.
  2639. + INST_ARCHLIB = Same as above for architecture dependent files
  2640. + INST_LIBDIR = C<$(INST_LIB)$(ROOTEXT)>
  2641. + INST_AUTODIR = C<$(INST_LIB)/auto/$(FULLEXT)>
  2642. + INST_ARCHAUTODIR = C<$(INST_ARCHLIB)/auto/$(FULLEXT)>
  2643. + =head2 Customizing The Generated Makefile
  2644. + If the Makefile generated does not fit your purpose you can change it
  2645. + using the mechanisms described below.
  2646. + =head2 Using Attributes (and Parameters)
  2647. + The following attributes can be specified as arguments to WriteMakefile()
  2648. + or as NAME=VALUE pairs on the command line:
  2649. + This description is not yet documented; you can get at the description
  2650. + with one of the commands
  2651. + =over 4
  2652. + =item C<perl Makefile.PL help>
  2653. + (if you already have a basic Makefile.PL)
  2654. + =item C<make help>
  2655. + (if you already have a Makefile)
  2656. + =item C<perl -e 'use ExtUtils::MakeMaker "&help"; &help;'>
  2657. + (if you have neither nor)
  2658. + =back
  2659. + =head2 Overriding MakeMaker Methods
  2660. + If you cannot achieve the desired Makefile behaviour by specifying
  2661. + attributes you may define private subroutines in the Makefile.PL.
  2662. + Each subroutines returns the text it wishes to have written to
  2663. + the Makefile. To override a section of the Makefile you can
  2664. + either say:
  2665. +     sub MY::c_o { "new literal text" }
  2666. + or you can edit the default by saying something like:
  2667. +     sub MY::c_o { $_=MM->c_o; s/old text/new text/; $_ }
  2668. + If you still need a different solution, try to develop another
  2669. + subroutine, that fits your needs and submit the diffs to
  2670. + F<perl5-porters@nicoh.com> or F<comp.lang.perl> as appropriate.
  2671. + =head2 Distribution Support
  2672. + For authors of extensions MakeMaker provides several Makefile
  2673. + targets. Most of the support comes from the ExtUtils::Manifest module,
  2674. + where additional documentation can be found.
  2675. + =over 4
  2676. + =item    make distcheck
  2677. + reports which files are below the build directory but not in the
  2678. + MANIFEST file and vice versa. (See ExtUtils::Manifest::fullcheck() for
  2679. + details)
  2680. + =item    make distclean
  2681. + does a realclean first and then the distcheck. Note that this is not
  2682. + needed to build a new distribution as long as you are sure, that the
  2683. + MANIFEST file is ok.
  2684. + =item    make manifest
  2685. + rewrites the MANIFEST file, adding all remaining files found (See
  2686. + ExtUtils::Manifest::mkmanifest() for details)
  2687. + =item    make distdir
  2688. + Copies all the files that are in the MANIFEST file to a newly created
  2689. + directory with the name C<$(DISTNAME)-$(VERSION)>. If that directory
  2690. + exists, it will be removed first.
  2691. + =item    make tardist
  2692. + First does a command $(PREOP) which defaults to a null command. Does a
  2693. + distdir next and runs C<tar> on that directory into a tarfile. Then
  2694. + deletes the distdir. Finishes with a command $(POSTOP) which defaults
  2695. + to a null command.
  2696. + =item    make dist
  2697. + Defaults to $(DIST_DEFAULT) which in turn defaults to tardist.
  2698. + =item    make uutardist
  2699. + Runs a tardist first and uuencodes the tarfile.
  2700. + =item    make shdist
  2701. + First does a command $(PREOP) which defaults to a null command. Does a
  2702. + distdir next and runs C<shar> on that directory into a sharfile. Then
  2703. + deletes the distdir. Finishes with a command $(POSTOP) which defaults
  2704. + to a null command.  Note: For shdist to work properly a C<shar>
  2705. + program that can handle directories is mandatory.
  2706. + =item    make ci
  2707. + Does a $(CI) (defaults to C<ci -u>) and a $(RCS) (C<rcs -q
  2708. + -Nv$(VERSION_SYM):>) on all files in the MANIFEST file
  2709. + Customization of the dist targets can be done by specifying a hash
  2710. + reference to the dist attribute of the WriteMakefile call. The
  2711. + following parameters are recognized:
  2712. +     TAR          ('tar')
  2713. +     TARFLAGS     ('cvf')
  2714. +     COMPRESS     ('compress')
  2715. +     SUFFIX       ('Z')
  2716. +     SHAR         ('shar')
  2717. +     PREOP        ('@ :')
  2718. +     POSTOP       ('@ :')
  2719. + An example:
  2720. +     WriteMakefile( 'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" })
  2721. + =back
  2722.   =head1 AUTHORS
  2723.   
  2724.   Andy Dougherty F<E<lt>doughera@lafcol.lafayette.eduE<gt>>, Andreas
  2725.   Koenig F<E<lt>k@franz.ww.TU-Berlin.DEE<gt>>, Tim Bunce
  2726.   F<E<lt>Tim.Bunce@ig.co.ukE<gt>>.  VMS support by Charles Bailey
  2727. ! F<E<lt>bailey@HMIVAX.HUMGEN.UPENN.EDUE<gt>>. Contact the makemaker
  2728. ! mailing list L<mailto:makemaker@franz.ww.tu-berlin.de>, if you have any
  2729. ! questions.
  2730.   
  2731.   =head1 MODIFICATION HISTORY
  2732.   
  2733.   v1, August 1994; by Andreas Koenig. Based on Andy Dougherty's Makefile.SH.
  2734.   v2, September 1994 by Tim Bunce.
  2735.   v3.0 October  1994 by Tim Bunce.
  2736.   v3.1 November 11th 1994 by Tim Bunce.
  2737.   v3.2 November 18th 1994 by Tim Bunce.
  2738.   v3.3 November 27th 1994 by Andreas Koenig.
  2739.   v3.4 December  7th 1994 by Andreas Koenig and Tim Bunce.
  2740.   v3.5 December 15th 1994 by Tim Bunce.
  2741.   v3.6 December 15th 1994 by Tim Bunce.
  2742.   v3.7 December 30th 1994 By Tim Bunce
  2743.   v3.8 January  17th 1995 By Andreas Koenig and Tim Bunce
  2744.   v3.9 January 19th 1995 By Tim Bunce
  2745.   v3.10 January 23rd 1995 By Tim Bunce
  2746.   v3.11 January 24th 1995 By Andreas Koenig
  2747.   v4.00 January 24th 1995 By Tim Bunce
  2748.   v4.01 January 25th 1995 By Tim Bunce
  2749.   v4.02 January 29th 1995 By Andreas Koenig
  2750.   v4.03 January 30th 1995 By Andreas Koenig
  2751.   v4.04 Februeary 5th 1995 By Andreas Koenig
  2752.   v4.05 February 8th 1995 By Andreas Koenig
  2753.   v4.06 February 10th 1995 By Andreas Koenig
  2754.   v4.061 February 12th 1995 By Andreas Koenig
  2755.   v4.08 - 4.085  February 14th-21st 1995 by Andreas Koenig
  2756. + v4.086 March 9 1995 by Andy Dougherty
  2757. + v4.09 March 31 1995 by Andreas Koenig
  2758. + v4.091 April 3 1995 by Andy Dougherty
  2759. + v4.092 April 11 1995 by Andreas Koenig
  2760. + v4.093 April 12 1995 by Andy Dougherty
  2761. + v4.094 April 12 1995 by Andy Dougherty
  2762.   
  2763. ! v4.100 May 10 1995 by Andreas Koenig
  2764.   
  2765. ! Broken out Mkbootstrap to make the file smaller and easier to manage,
  2766. ! and to speed up the build process.
  2767.   
  2768. ! Added ExtUtils::Manifest as an extra module that is used to streamline
  2769. ! distributions. (See pod section I<distribution support>).
  2770.   
  2771. ! Added a VERSION_SYM macro, that is derived from VERSION but all C<\W>
  2772. ! characters replaced by an underscore.
  2773.   
  2774. ! Moved the whole documentation below __END__ for easier maintanance.
  2775.   
  2776. ! linkext =E<gt> { LINKTYPE =E<gt> '' } should work now as expected.
  2777.   
  2778. ! Rechecked the use of INST_LIB, INST_ARCHLIB, and INST_EXE from the
  2779. ! perspective of an AFS user (thanks to Rudolph T Maceyko for the
  2780. ! hint). With full backward compatiblity it is now possible, to set
  2781. ! INSTALLPRIVLIB, INSTALLARCHLIB, and INSTALLBIN either with 'perl
  2782. ! Makefile.PL' or with 'make install'. A bare 'make' ignores these
  2783. ! settings.  The effect of this change is that it is no longer
  2784. ! recommended to set the INST_* attributes directly, although it doesn't
  2785. ! hurt, if they do so. The PASTHRU variables (now PASTHRU1 and PASTHRU2)
  2786. ! are fully aware of their duty: the INST_* attributes are only
  2787. ! propagated to runsubdirpl, not to 'cd subdir && make config' and 'cd
  2788. ! subdir && make all'.
  2789.   
  2790. ! Included Tim's "Unable to locate Perl library" patch.
  2791.   
  2792. ! Eliminated any excess of spaces in the $old/$new comparison in
  2793. ! const_cccmd().
  2794.   
  2795. ! Added a prompt function with usage $answer = prompt $message, $default.
  2796.   
  2797. ! Included Tim's patch that searches for perl5 and perl$] as well as
  2798. ! perl and miniperl.
  2799.   
  2800. ! Added .NO_PARALLEL for the time until I have a multiple cpu machine
  2801. ! myself :)
  2802.   
  2803. ! Introduced a macro() subroutine. WriteMakefile("macro" =E<gt> { FOO
  2804. ! =E<gt> BAR }) defines the macro FOO = BAR in the generated Makefile.
  2805.   
  2806. ! Rolled in Tim's patch for needs_linking.
  2807.   
  2808. ! writedoc now tries to be less clever. It was trying to determine, if a
  2809. ! perllocal.pod had to be created or appended to. As we have now the
  2810. ! possibility, that INSTALLARCHLIB is determined at make's runtime, we
  2811. ! cannot do this anymore. We append to that file in any case.
  2812.   
  2813. ! Added Kenneth's pod installation patch.
  2814.   
  2815. ! v4.110 May 19 1995 by Andreas Koenig
  2816.   
  2817. ! =head1 NEW in 4.11
  2818.   
  2819. ! MANIFEST.SKIP now contains only regular expressions. RCS directories
  2820. ! are no longer skipped by default, as this may be configured in the
  2821. ! SKIP file.
  2822.   
  2823. ! The manifest target now does no realclean anymore.
  2824.   
  2825. ! I_PERL_LIBS depreciated (no longer used). (unless you speak up, of
  2826. ! course)
  2827.   
  2828. ! I could not justify that we rebuild the Makefile when MakeMaker has
  2829. ! changed (as Kenneth suggested). If this is really a strong desire,
  2830. ! please convince me. But a minor change of the MakeMaker should not
  2831. ! trigger a 60 minutes rebuild of Tk, IMO.
  2832.   
  2833. ! Broken out extliblist into the new module ExtUtils::Liblist. Should
  2834. ! help extension writers for their own Configure scripts. The breaking
  2835. ! into pieces should be done now, I suppose.
  2836.   
  2837. ! Added an (experimenta!!) uninstall target that works with a
  2838. ! packlist. AutoSplit files are not yet in the packlist. This needs a
  2839. ! patch to AutoSplit, doesn't it? The packlist file is installed in
  2840. ! INST_ARCHAUTODIR/.packlist. It doesn't have means to decide, if a file
  2841. ! is architecture dependent or not, we just collect as much as we can
  2842. ! get. make -n recommended before actually executing. (I leave this
  2843. ! target undocumented in the pod section). Suggestions welcome!
  2844.   
  2845. ! Added basic chmod support. Nothing spectacular. *.so and *.a files get
  2846. ! permission 755, because I seem to recall, that some systems need
  2847. ! execute permissions in some weird constellations. The rest becomes
  2848. ! 644. What else do we need to make this flexible?
  2849.   
  2850. ! Then I took Tim's word serious: no bloat. No turning all packages into
  2851. ! perl scripts. Leaving shar, tar, uu be what they are... Sorry,
  2852. ! Kenneth, we still have to convince Larry that a growing MakeMaker
  2853. ! makes sense :)
  2854.   
  2855. ! Added an extra check whenever they install below the perl source tree:
  2856. ! is this extension a standard extension? If it is, everything behaves
  2857. ! as we are used to. If it is not, the three INST_ macros are set to
  2858. ! ./blib, and they get a warning that this extension has to be
  2859. ! installed manually with 'make install'.
  2860.   
  2861. ! Added a warning for targets that have a colon or a hashmark within
  2862. ! their names, because most make(1)s will not be able to process them.
  2863.   
  2864. ! Applied Hallvard's patch to ~user evaluation for cases where user does
  2865. ! not exist.
  2866.   
  2867. ! Added a ci target that checks in all files from the MANIFEST into rcs.
  2868.   
  2869. ! =head1 new in 4.12/4.13
  2870.   
  2871. ! "Please notify perl5-porters" message is now accompanied by
  2872. ! Config::myconfig().
  2873.   
  2874. ! (Manifest.pm) Change delimiter for the evaluation of the regexes from
  2875. ! MANIFEST.SKIP to from "!" to "/". I had overlooked the fact, that ! no
  2876. ! has a meaning in regular expressions.
  2877.   
  2878. ! Disabled the new logic that prevents non-standard extensions from
  2879. ! writing to PERL_SRC/lib to give Andy room for 5.001f.
  2880.   
  2881. ! Added a Version_check target that calls MakeMaker for a simple Version
  2882. ! control function on every invocation of 'make' in the future. Doesn't
  2883. ! have an effect currently.
  2884.   
  2885. ! Target dist is still defaulting to tardist, but the level of
  2886. ! indirection has changed. The Makefile macro DIST_DEFAULT takes it's
  2887. ! place. This allows me to make dist dependent from whatever I intend as
  2888. ! my standard distribution.
  2889.   
  2890. ! Made sure that INST_EXE is created for extensions that need it.
  2891.   
  2892. ! 4.13 is just a cleanup/documentation patch. And it adds a MakeMaker FAQ :)
  2893.   
  2894. ! =head v4.14 June 5, 1995, by Andreas Koenig
  2895.   
  2896. ! Reintroduces the LD_RUN_PATH macro. LD_RUN_PATH is passed as an
  2897. ! environment variable to the ld run. It is needed on Sun OS, and does
  2898. ! no harm on other systems. It is a colon seperated list of the
  2899. ! directories in LDLOADLIBS.
  2900.   
  2901. ! =head v4.15 June 6, 1995, by Andreas Koenig
  2902.   
  2903. ! Add -I$(PERL_ARCHLIB) -I$(PERL_LIB) to calls to xsubpp.
  2904.   
  2905. ! =head1 TODO
  2906.   
  2907.   Needs more complete documentation.
  2908.   
  2909. ! Add a C<html:> target when there has been found a general solution to
  2910.   installing html files.
  2911.   
  2912.   Add a FLAVOR variable that makes it easier to build debugging,
  2913. ! embedded or multiplicity perls. Currently the easiest way to produce a
  2914. ! debugging perl seems to be (after haveing built perl):
  2915. !     make clobber
  2916. !     ./Configure -D"archname=IP22-irix-d" -des
  2917. !     make perllib=libperld.a
  2918. !     make test perllib=libperld.a
  2919. !     mv /usr/local/bin/perl /usr/local/bin/perl/O_perl5.001e
  2920. !     make install perllib=libperld.a
  2921. !     cp /usr/local/bin/perl/O_perl5.001e /usr/local/bin/perl
  2922. ! It would be nice, if the Configure step could be dropped. Also nice, but 
  2923. ! maybe expensive, if 'make clobber' wouldn't be needed.
  2924. ! The uninstall target has to be completed, it's just a sketch.
  2925. ! Reconsider Makefile macros. The output of macro() should be the last
  2926. ! before PASTHRU and none should come after that -- tough work.
  2927. ! Think about Nick's desire, that the pTk subdirectory needs a special
  2928. ! treatment.
  2929. ! Find a way to have multiple MYEXTLIB archive files combined into
  2930. ! one. Actually I need some scenario, where this problem can be
  2931. ! illustrated. I currently don't see the problem.
  2932. ! Test if .NOPARALLEL can be omitted.
  2933. ! Don't let extensions write to PERL_SRC/lib anymore, build perl from
  2934. ! the extensions found below ext, run 'make test' and 'make install' on
  2935. ! each extension (giving room for letting them fail). Move some of the
  2936. ! tests from t/lib/* to the libraries.
  2937. ! Streamline the production of a new perl binary on systems that DO have
  2938. ! dynamic loading (especially make test needs further support, as test
  2939. ! most probably needs the new binary).
  2940.   
  2941.   =cut
  2942. Index: lib/ExtUtils/Manifest.pm
  2943. *** /dev/null    Mon Jun  5 17:45:32 1995
  2944. --- perl5.001k/lib/ExtUtils/Manifest.pm    Mon Jun  5 17:01:52 1995
  2945. ***************
  2946. *** 0 ****
  2947. --- 1,264 ----
  2948. + package ExtUtils::Manifest;
  2949. + =head1 NAME
  2950. + ExtUtils::Manifest - utilities to write and check a MANIFEST file
  2951. + =head1 SYNOPSIS
  2952. + C<require ExtUtils::Manifest;>
  2953. + C<ExtUtils::Manifest::mkmanifest;>
  2954. + C<ExtUtils::Manifest::manicheck;>
  2955. + C<ExtUtils::Manifest::filecheck;>
  2956. + C<ExtUtils::Manifest::fullcheck;>
  2957. + C<ExtUtils::Manifest::maniread($file);>
  2958. + C<ExtUtils::Manifest::manicopy($read,$target);>
  2959. + =head1 DESCRIPTION
  2960. + Mkmanifest() writes all files in and below the current directory to a
  2961. + file named C<MANIFEST> in the current directory. It works similar to
  2962. +     find . -print
  2963. + but in doing so checks each line in an existing C<MANIFEST> file and
  2964. + includes any comments that are found in the existing C<MANIFEST> file
  2965. + in the new one. Anything between white space and an end of line within
  2966. + a C<MANIFEST> file is considered to be a comment. Filenames and
  2967. + comments are seperated by one or more TAB characters in the
  2968. + output. All files that match any regular expression in a file
  2969. + C<MANIFEST.SKIP> (if such a file exists) are ignored.
  2970. + Manicheck() checks if all the files within a C<MANIFEST> in the current
  2971. + directory really do exist.
  2972. + Filecheck() finds files below the current directory that are not
  2973. + mentioned in the C<MANIFEST> file. An optional file C<MANIFEST.SKIP>
  2974. + will be consulted. Any file matching a regular expression in such a
  2975. + file will not be reported as missing in the C<MANIFEST> file.
  2976. + Fullcheck() does both a manicheck() and a filecheck().
  2977. + Maniread($file) reads a named C<MANIFEST> file (defaults to
  2978. + C<MANIFEST> in the current directory) and returns a HASH reference
  2979. + with files being the keys and comments being the values of the HASH.
  2980. + I<Manicopy($read,$target)> copies the files that are the keys in the
  2981. + HASH I<%$read> to the named target directory. The HASH reference
  2982. + I<$read> is typically returned by the maniread() function. This
  2983. + function is useful for producing a directory tree identical to the
  2984. + intended distribution tree.
  2985. + =head1 MANIFEST.SKIP
  2986. + The file MANIFEST.SKIP may contain regular expressions of files that
  2987. + should be ignored by mkmanifest() and filecheck(). The regular
  2988. + expressions should appear one on each line. A typical example:
  2989. +     \bRCS\b
  2990. +     ^MANIFEST\.
  2991. +     ^Makefile$
  2992. +     ~$
  2993. +     \.html$
  2994. +     \.old$
  2995. +     ^blib/
  2996. +     ^MakeMaker-\d
  2997. + =head1 EXPORT_OK
  2998. + C<&mkmanifest>, C<&manicheck>, C<&filecheck>, C<&fullcheck>,
  2999. + C<&maniread>, and C<&manicopy> are exportable.
  3000. + =head1 DIAGNOSTICS
  3001. + All diagnostic output is sent to C<STDERR>.
  3002. + =over
  3003. +     
  3004. + =item C<Not in MANIFEST:> I<file>
  3005. + is reported if a file is found, that is missing in the C<MANIFEST>
  3006. + file which is excluded by a regular expression in the file
  3007. + C<MANIFEST.SKIP>.
  3008. + =item C<No such file:> I<file>
  3009. + is reported if a file mentioned in a C<MANIFEST> file does not
  3010. + exist.
  3011. + =item C<MANIFEST:> I<$!>
  3012. + is reported if C<MANIFEST> could not be opened.
  3013. + =item C<Added to MANIFEST:> I<file>
  3014. + is reported by mkmanifest() if $Verbose is set and a file is added
  3015. + to MANIFEST. $Verbose is set to 1 by default.
  3016. + =back
  3017. + =head1 AUTHOR
  3018. + Andreas Koenig F<E<lt>koenig@franz.ww.TU-Berlin.DEE<gt>>
  3019. + =cut
  3020. + require Exporter;
  3021. + @ISA=('Exporter');
  3022. + @EXPORT_OK = ('mkmanifest', 'manicheck', 'fullcheck', 'filecheck', 
  3023. +           'maniread', 'manicopy');
  3024. + use File::Find;
  3025. + use Carp;
  3026. + $Debug = 0;
  3027. + $Verbose = 1;
  3028. + ($Version) = sprintf("%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/);
  3029. + $Version = $Version; #avoid warning
  3030. + $Quiet = 0;
  3031. + sub mkmanifest {
  3032. +     my $manimiss = 0;
  3033. +     my $read = maniread() or $manimiss++;
  3034. +     $read = {} if $manimiss;
  3035. +     my $matches = _maniskip();
  3036. +     my $found = manifind();
  3037. +     my($key,$val,$file,%all);
  3038. +     my %all = (%$found, %$read);
  3039. +     local *M;
  3040. +     rename "MANIFEST", "MANIFEST.bak" unless $manimiss;
  3041. +     open M, ">MANIFEST" or die "Could not open MANIFEST: $!";
  3042. +     foreach $file (sort keys %all) {
  3043. +     next if &$matches($file);
  3044. +     if ($Verbose){
  3045. +         warn "Added to MANIFEST: $file\n" unless exists $read->{$file};
  3046. +     }
  3047. +     my $tabs = (5 - (length($file)+1)/8);
  3048. +     $tabs = 1 if $tabs < 1;
  3049. +     $tabs = 0 unless $all{$file};
  3050. +     print M $file, "\t" x $tabs, $all{$file}, "\n";
  3051. +     }
  3052. +     close M;
  3053. + }
  3054. + sub manifind {
  3055. +     local $found = {};
  3056. +     find(sub {return if -d $_;
  3057. +           (my $name = $File::Find::name) =~ s|./||;
  3058. +           warn "Debug: diskfile $name\n" if $Debug;
  3059. +           $found->{$name} = "";}, ".");
  3060. +     $found;
  3061. + }
  3062. + sub fullcheck {
  3063. +     _manicheck(3);
  3064. + }
  3065. + sub manicheck {
  3066. +     return @{(_manicheck(1))[0]};
  3067. + }
  3068. + sub filecheck {
  3069. +     return @{(_manicheck(2))[1]};
  3070. + }
  3071. + sub _manicheck {
  3072. +     my($arg) = @_;
  3073. +     my $read = maniread();
  3074. +     my $file;
  3075. +     my(@missfile,@missentry);
  3076. +     if ($arg & 1){
  3077. +     my $found = manifind();
  3078. +     foreach $file (sort keys %$read){
  3079. +         warn "Debug: manicheck checking from MANIFEST $file\n" if $Debug;
  3080. +         unless ( exists $found->{$file} ) {
  3081. +           warn "No such file: $file\n" unless $Quiet;
  3082. +           push @missfile, $file;
  3083. +         }
  3084. +     }
  3085. +     }
  3086. +     if ($arg & 2){
  3087. +     $read ||= {};
  3088. +     my $matches = _maniskip();
  3089. +     my $found = manifind();
  3090. +     foreach $file (sort keys %$found){
  3091. +         next if &$matches($file);
  3092. +         warn "Debug: manicheck checking from disk $file\n" if $Debug;
  3093. +         unless ( exists $read->{$file} ) {
  3094. +           warn "Not in MANIFEST: $file\n" unless $Quiet;
  3095. +           push @missentry, $file;
  3096. +         }
  3097. +     }
  3098. +     }
  3099. +     (\@missfile,\@missentry);
  3100. + }
  3101. + sub maniread {
  3102. +     my ($mfile) = @_;
  3103. +     $mfile = "MANIFEST" unless defined $mfile;
  3104. +     my $read = {};
  3105. +     local *M;
  3106. +     unless (open M, $mfile){
  3107. +     warn "$mfile: $!";
  3108. +     return $read;
  3109. +     }
  3110. +     while (<M>){
  3111. +     chomp;
  3112. +     /^(\S+)\s*(.*)/ and $read->{$1}=$2;
  3113. +     }
  3114. +     close M;
  3115. +     $read;
  3116. + }
  3117. + # returns an anonymous sub that decides if an argument matches
  3118. + sub _maniskip {
  3119. +     my ($mfile) = @_;
  3120. +     my $matches = sub {0};
  3121. +     my @skip ;
  3122. +     my $mfile = "MANIFEST.SKIP" unless defined $mfile;
  3123. +     local *M;
  3124. +     return $matches unless -f $mfile;
  3125. +     open M, $mfile or return $matches;
  3126. +     while (<M>){
  3127. +     chomp;
  3128. +     next if /^\s*$/;
  3129. +     push @skip, $_;
  3130. +     }
  3131. +     close M;
  3132. +     my $sub = "\$matches = "
  3133. +     . "sub { my(\$arg)=\@_; return 1 if "
  3134. +     . join (" || ",  (map {s!/!\\/!g; "\$arg =~ m/$_/o "} @skip), 0)
  3135. +     . " }";
  3136. +     eval $sub;
  3137. +     print "Debug: $sub\n" if $Debug;
  3138. +     $matches;
  3139. + }
  3140. + sub manicopy {
  3141. +     my($read,$target)=@_;
  3142. +     croak "manicopy() called without target argument" unless defined $target;
  3143. +     require File::Path;
  3144. +     require File::Basename;
  3145. +     my(%dirs,$file);
  3146. +     foreach $file (keys %$read){
  3147. +     my $dir = File::Basename::dirname($file);
  3148. +     File::Path::mkpath("$target/$dir");
  3149. +     cp_if_diff($file, "$target/$file");
  3150. +     }
  3151. + }
  3152. + sub cp_if_diff {
  3153. +     my($from,$to)=@_;
  3154. +     -f $from || carp "$0: $from not found";
  3155. +     system "cmp", "-s", $from, $to;
  3156. +     if ($?) {
  3157. +     unlink($to);   # In case we don't have write permissions.
  3158. +     (system 'cp', $from, $to) == 0 or confess "system 'cp': $!";
  3159. +     }
  3160. + }
  3161. + 1;
  3162. Index: lib/ExtUtils/Mkbootstrap.pm
  3163. *** /dev/null    Mon Jun  5 17:45:32 1995
  3164. --- perl5.001k/lib/ExtUtils/Mkbootstrap.pm    Mon Jun  5 17:01:53 1995
  3165. ***************
  3166. *** 0 ****
  3167. --- 1,95 ----
  3168. + package ExtUtils::Mkbootstrap;
  3169. + use Config;
  3170. + use Exporter;
  3171. + @ISA=('Exporter');
  3172. + @EXPORT='&Mkbootstrap';
  3173. + $Version=2.0; # just to start somewhere
  3174. + sub Mkbootstrap {
  3175. + =head1 USEFUL SUBROUTINES
  3176. + =head2 Mkbootstrap()
  3177. + Make a bootstrap file for use by this system's DynaLoader.  It
  3178. + typically gets called from an extension Makefile.
  3179. + There is no C<*.bs> file supplied with the extension. Instead a
  3180. + C<*_BS> file which has code for the special cases, like posix for
  3181. + berkeley db on the NeXT.
  3182. + This file will get parsed, and produce a maybe empty
  3183. + C<@DynaLoader::dl_resolve_using> array for the current architecture.
  3184. + That will be extended by $BSLOADLIBS, which was computed by Andy's
  3185. + extliblist script. If this array still is empty, we do nothing, else
  3186. + we write a .bs file with an C<@DynaLoader::dl_resolve_using> array, but
  3187. + without any C<if>s, because there is no longer a need to deal with
  3188. + special cases.
  3189. + The C<*_BS> file can put some code into the generated C<*.bs> file by placing
  3190. + it in C<$bscode>. This is a handy 'escape' mechanism that may prove
  3191. + useful in complex situations.
  3192. + If @DynaLoader::dl_resolve_using contains C<-L*> or C<-l*> entries then
  3193. + Mkbootstrap will automatically add a dl_findfile() call to the
  3194. + generated C<*.bs> file.
  3195. + =cut
  3196. +     my($baseext, @bsloadlibs)=@_;
  3197. +     @bsloadlibs = grep($_, @bsloadlibs); # strip empty libs
  3198. +     print STDOUT "    bsloadlibs=@bsloadlibs\n" if $Verbose;
  3199. +     # We need DynaLoader here because we and/or the *_BS file may
  3200. +     # call dl_findfile(). We don't say `use' here because when
  3201. +     # first building perl extensions the DynaLoader will not have
  3202. +     # been built when MakeMaker gets first used.
  3203. +     require DynaLoader;
  3204. +     rename "$baseext.bs", "$baseext.bso"
  3205. +       if -s "$baseext.bs";
  3206. +     if (-f "${baseext}_BS"){
  3207. +     $_ = "${baseext}_BS";
  3208. +     package DynaLoader; # execute code as if in DynaLoader
  3209. +     local($osname, $dlsrc) = (); # avoid warnings
  3210. +     ($osname, $dlsrc) = @Config::Config{qw(osname dlsrc)};
  3211. +     $bscode = "";
  3212. +     unshift @INC, ".";
  3213. +     require $_;
  3214. +     shift @INC;
  3215. +     }
  3216. +     if ($Config{'dlsrc'} =~ /^dl_dld/){
  3217. +     package DynaLoader;
  3218. +     push(@dl_resolve_using, dl_findfile('-lc'));
  3219. +     }
  3220. +     my(@all) = (@bsloadlibs, @DynaLoader::dl_resolve_using);
  3221. +     my($method) = '';
  3222. +     if (@all){
  3223. +     open BS, ">$baseext.bs"
  3224. +         or die "Unable to open $baseext.bs: $!";
  3225. +     print STDOUT "Writing $baseext.bs\n";
  3226. +     print STDOUT "    containing: @all" if $Verbose;
  3227. +     print BS "# $baseext DynaLoader bootstrap file for $Config{'osname'} architecture.\n";
  3228. +     print BS "# Do not edit this file, changes will be lost.\n";
  3229. +     print BS "# This file was automatically generated by the\n";
  3230. +     print BS "# Mkbootstrap routine in ExtUtils::Mkbootstrap (v$Version).\n";
  3231. +     print BS "\@DynaLoader::dl_resolve_using = ";
  3232. +     # If @all contains names in the form -lxxx or -Lxxx then it's asking for
  3233. +     # runtime library location so we automatically add a call to dl_findfile()
  3234. +     if (" @all" =~ m/ -[lLR]/){
  3235. +         print BS "  dl_findfile(qw(\n  @all\n  ));\n";
  3236. +     }else{
  3237. +         print BS "  qw(@all);\n";
  3238. +     }
  3239. +     # write extra code if *_BS says so
  3240. +     print BS $DynaLoader::bscode if $DynaLoader::bscode;
  3241. +     print BS "\n1;\n";
  3242. +     close BS;
  3243. +     }
  3244. + }
  3245.  
  3246.  
  3247. End of patch.
  3248.