Skip to content

Commit 9f99f3e

Browse files
committed
better document Miniperl.pm, (mini)perlmain.c
ExtUtils::Miniperl is used to generate both miniperlmain.c and perlmain.c, but in different ways (via regen and via make respectively). Update the pod in Miniperl.pm to explain this more clearly, and imporve the header comment it emits in miniperlmain.c and perlmain.c.
1 parent 69b63ee commit 9f99f3e

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use vars qw($VERSION @ISA @EXPORT);
88

99
@ISA = qw(Exporter);
1010
@EXPORT = qw(writemain);
11-
$VERSION = '1.05';
11+
$VERSION = '1.06';
1212

1313
# blead will run this with miniperl, hence we can't use autodie or File::Temp
1414
my $temp;
@@ -36,10 +36,10 @@ sub writemain{
3636
my(@exts) = @_;
3737

3838
printf $fh <<'EOF!HEAD', xsi_header();
39-
/* miniperlmain.c
39+
/* miniperlmain.c or perlmain.c - a generated file
4040
*
4141
* Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
42-
* 2004, 2005, 2006, 2007, by Larry Wall and others
42+
* 2004, 2005, 2006, 2007, 2016 by Larry Wall and others
4343
*
4444
* You may distribute under the terms of either the GNU General Public
4545
* License or the Artistic License, as specified in the README file.
@@ -56,11 +56,18 @@ sub writemain{
5656
5757
/* This file contains the main() function for the perl interpreter.
5858
* Note that miniperlmain.c contains main() for the 'miniperl' binary,
59-
* while perlmain.c contains main() for the 'perl' binary.
59+
* while perlmain.c contains main() for the 'perl' binary. The typical
60+
* difference being that the latter includes Dynaloader.
6061
*
6162
* Miniperl is like perl except that it does not support dynamic loading,
6263
* and in fact is used to build the dynamic modules needed for the 'real'
6364
* perl executable.
65+
*
66+
* The content of the body of this generated file is mostly contained
67+
* in Miniperl.pm - edit that file if you want to change anything.
68+
* miniperlmain.c is generated by running regen/miniperlmain.pl.pl, while
69+
* perlmain.c is built automatically by Makefile (so the former is
70+
* included in the tarball while the latter isn't).
6471
*/
6572
6673
#ifdef OEMVS
@@ -217,7 +224,7 @@ __END__
217224
218225
=head1 NAME
219226
220-
ExtUtils::Miniperl - write the C code for perlmain.c
227+
ExtUtils::Miniperl - write the C code for miniperlmain.c and perlmain.c
221228
222229
=head1 SYNOPSIS
223230
@@ -230,18 +237,21 @@ ExtUtils::Miniperl - write the C code for perlmain.c
230237
231238
=head1 DESCRIPTION
232239
233-
C<writemain()> takes an argument list of directories containing archive
240+
C<writemain()> takes an argument list of zero or more directories
241+
containing archive
234242
libraries that relate to perl modules and should be linked into a new
235-
perl binary. It writes a corresponding F<perlmain.c> file that
243+
perl binary. It writes a corresponding F<miniperlmain.c> or F<perlmain.c>
244+
file that
236245
is a plain C file containing all the bootstrap code to make the
237246
modules associated with the libraries available from within perl.
238247
If the first argument to C<writemain()> is a reference to a scalar it is
239248
used as the filename to open for output. Any other reference is used as
240249
the filehandle to write to. Otherwise output defaults to C<STDOUT>.
241250
242-
The typical usage is from within a Makefile generated by
243-
L<ExtUtils::MakeMaker>. So under normal circumstances you won't have to
244-
deal with this module directly.
251+
The typical usage is from within perl's own Makefile (to build
252+
F<perlmain.c>) or from F<regen/miniperlmain.pl> (to build miniperlmain.c).
253+
So under normal circumstances you won't have to deal with this module
254+
directly.
245255
246256
=head1 SEE ALSO
247257

miniperlmain.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
Any changes made here will be lost!
55
*/
66

7-
/* miniperlmain.c
7+
/* miniperlmain.c or perlmain.c - a generated file
88
*
99
* Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
10-
* 2004, 2005, 2006, 2007, by Larry Wall and others
10+
* 2004, 2005, 2006, 2007, 2016 by Larry Wall and others
1111
*
1212
* You may distribute under the terms of either the GNU General Public
1313
* License or the Artistic License, as specified in the README file.
@@ -24,11 +24,18 @@
2424

2525
/* This file contains the main() function for the perl interpreter.
2626
* Note that miniperlmain.c contains main() for the 'miniperl' binary,
27-
* while perlmain.c contains main() for the 'perl' binary.
27+
* while perlmain.c contains main() for the 'perl' binary. The typical
28+
* difference being that the latter includes Dynaloader.
2829
*
2930
* Miniperl is like perl except that it does not support dynamic loading,
3031
* and in fact is used to build the dynamic modules needed for the 'real'
3132
* perl executable.
33+
*
34+
* The content of the body of this generated file is mostly contained
35+
* in Miniperl.pm - edit that file if you want to change anything.
36+
* miniperlmain.c is generated by running regen/miniperlmain.pl.pl, while
37+
* perlmain.c is built automatically by Makefile (so the former is
38+
* included in the tarball while the latter isn't).
3239
*/
3340

3441
#ifdef OEMVS

0 commit comments

Comments
 (0)