Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / ExtUtils::MakeMaker::FAQ.3
.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "ExtUtils::MakeMaker::FAQ 3"
.TH ExtUtils::MakeMaker::FAQ 3 "2003-08-18" "perl v5.8.0" "User Contributed Perl Documentation"
.SH "NAME"
ExtUtils::MakeMaker::FAQ \- Frequently Asked Questions About MakeMaker
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
FAQs, tricks and tips for \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR.
.Sh "Module Installation"
.IX Subsection "Module Installation"
.IP "How do I keep from installing man pages?" 4
.IX Item "How do I keep from installing man pages?"
Recent versions of MakeMaker will only install man pages on Unix like
operating systems.
.Sp
For an individual module:
.Sp
.Vb 1
\& perl Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none
.Ve
.Sp
If you want to suppress man page installation for all modules you have
to reconfigure Perl and tell it 'none' when it asks where to install
man pages.
.IP "How do I use a module without installing it?" 4
.IX Item "How do I use a module without installing it?"
Two ways. One is to build the module normally...
.Sp
.Vb 2
\& perl Makefile.PL
\& make
.Ve
.Sp
\&...and then set the \s-1PERL5LIB\s0 environment variable to point at the
blib/lib and blib/arch directories.
.Sp
The other is to install the module in a temporary location.
.Sp
.Vb 1
\& perl Makefile.PL PREFIX=/tmp LIB=/tmp/lib/perl
.Ve
.Sp
And then set \s-1PERL5LIB\s0 to /tmp/lib/perl. This works well when you have
multiple modules to work with. It also ensures that the module goes
through its full installation process which may modify it.
.Sh "Philosophy and History"
.IX Subsection "Philosophy and History"
.IP "Why not just use <insert other build config tool here>?" 4
.IX Item "Why not just use <insert other build config tool here>?"
Why did MakeMaker reinvent the build configuration wheel? Why not
just use autoconf or automake or ppm or Ant or ...
.Sp
There are many reasons, but the major one is cross-platform
compatibility.
.Sp
Perl is one of the most ported pieces of software ever. It works on
operating systems I've never even heard of (see perlport for details).
It needs a build tool that can work on all those platforms and with
any wacky C compilers and linkers they might have.
.Sp
No such build tool exists. Even make itself has wildly different
dialects. So we have to build our own.
.IP "What is Module::Build and how does it relate to MakeMaker?" 4
.IX Item "What is Module::Build and how does it relate to MakeMaker?"
Module::Build is a project by Ken Williams to supplant MakeMaker.
Its primary advantages are:
.RS 4
.IP "\(bu pure perl. no make, no shell commands" 8
.IX Item "pure perl. no make, no shell commands"
.PD 0
.IP "\(bu easier to customize" 8
.IX Item "easier to customize"
.IP "\(bu cleaner internals" 8
.IX Item "cleaner internals"
.IP "\(bu less cruft" 8
.IX Item "less cruft"
.RE
.RS 4
.PD
.Sp
Module::Build is the official heir apparent to MakeMaker and we
encourage people to work on M::B rather than spending time adding features
to MakeMaker.
.RE
.Sh "Module Writing"
.IX Subsection "Module Writing"
.ie n .IP "How do I keep my $VERSION up to date without resetting it manually?" 4
.el .IP "How do I keep my \f(CW$VERSION\fR up to date without resetting it manually?" 4
.IX Item "How do I keep my $VERSION up to date without resetting it manually?"
Often you want to manually set the \f(CW$VERSION\fR in the main module
distribution because this is the version that everybody sees on \s-1CPAN\s0
and maybe you want to customize it a bit. But for all the other
modules in your dist, \f(CW$VERSION\fR is really just bookkeeping and all that's
important is it goes up every time the module is changed. Doing this
by hand is a pain and you often forget.
.Sp
Simplest way to do it automatically is to use your version control
system's revision number (you are using version control, right?).
.Sp
In \s-1CVS\s0 and \s-1RCS\s0 you use $\&Revision$ writing it like so:
.Sp
.Vb 1
\& $VERSION = sprintf "%d.%03d", q$Revision: 1.10 $ =~ /(\ed+)/g;
.Ve
.Sp
Every time the file is checked in the $\&Revision$ will be updated,
updating your \f(CW$VERSION\fR.
.Sp
In \s-1CVS\s0 version 1.9 is followed by 1.10. Since \s-1CPAN\s0 compares version
numbers numerically we use a \fIsprintf()\fR to convert 1.9 to 1.009 and
1.10 to 1.010 which compare properly.
.Sp
If branches are involved (ie. $\&Revision: 1.5.3.4) its a little more
complicated.
.Sp
.Vb 2
\& # must be all on one line or MakeMaker will get confused.
\& $VERSION = do { my @r = (q$Revision: 1.10 $ =~ /\ed+/g); sprintf "%d."."%03d" x $#r, @r };
.Ve
.IP "What's this \fI\s-1META\s0.yml\fR thing and how did it get in my \fI\s-1MANIFEST\s0\fR?!" 4
.IX Item "What's this META.yml thing and how did it get in my MANIFEST?!"
\&\fI\s-1META\s0.yml\fR is a module meta-data file pioneered by Module::Build and
automatically generated as part of the 'distdir' target (and thus
\&'dist'). See \*(L"Module Meta\-Data\*(R" in ExtUtils::MakeMaker.
.Sp
To shut off its generation, pass the \f(CW\*(C`NO_META\*(C'\fR flag to \f(CW\*(C`WriteMakefile()\*(C'\fR.
.Sh "\s-1XS\s0"
.IX Subsection "XS"
.ie n .IP "How to I prevent ""object version X.XX does not match bootstrap parameter Y.YY"" errors?" 4
.el .IP "How to I prevent ``object version X.XX does not match bootstrap parameter Y.YY'' errors?" 4
.IX Item "How to I prevent object version X.XX does not match bootstrap parameter Y.YY errors?"
\&\s-1XS\s0 code is very sensitive to the module version number and will
complain if the version number in your Perl module doesn't match. If
you change your module's version # without reruning Makefile.PL the old
version number will remain in the Makefile causing the \s-1XS\s0 code to be built
with the wrong number.
.Sp
To avoid this, you can force the Makefile to be rebuilt whenever you
change the module containing the version number by adding this to your
\&\fIWriteMakefile()\fR arguments.
.Sp
.Vb 1
\& depend => { '$(FIRST_MAKEFILE)' => '$(VERSION_FROM)' }
.Ve
.IP "How do I make two or more \s-1XS\s0 files coexist in the same directory?" 4
.IX Item "How do I make two or more XS files coexist in the same directory?"
Sometimes you need to have two and more \s-1XS\s0 files in the same package.
One way to go is to put them into separate directories, but sometimes
this is not the most suitable solution. The following technique allows
you to put two (and more) \s-1XS\s0 files in the same directory.
.Sp
Let's assume that we have a package \f(CW\*(C`Cool::Foo\*(C'\fR, which includes
\&\f(CW\*(C`Cool::Foo\*(C'\fR and \f(CW\*(C`Cool::Bar\*(C'\fR modules each having a separate \s-1XS\s0
file. First we use the following \fIMakefile.PL\fR:
.Sp
.Vb 1
\& use ExtUtils::MakeMaker;
.Ve
.Sp
.Vb 6
\& WriteMakefile(
\& NAME => 'Cool::Foo',
\& VERSION_FROM => 'Foo.pm',
\& OBJECT => q/$(O_FILES)/,
\& # ... other attrs ...
\& );
.Ve
.Sp
Notice the \f(CW\*(C`OBJECT\*(C'\fR attribute. MakeMaker generates the following
variables in \fIMakefile\fR:
.Sp
.Vb 7
\& # Handy lists of source code files:
\& XS_FILES= Bar.xs \e
\& Foo.xs
\& C_FILES = Bar.c \e
\& Foo.c
\& O_FILES = Bar.o \e
\& Foo.o
.Ve
.Sp
Therefore we can use the \f(CW\*(C`O_FILES\*(C'\fR variable to tell MakeMaker to use
these objects into the shared library.
.Sp
That's pretty much it. Now write \fIFoo.pm\fR and \fIFoo.xs\fR, \fIBar.pm\fR
and \fIBar.xs\fR, where \fIFoo.pm\fR bootstraps the shared library and
\&\fIBar.pm\fR simply loading \fIFoo.pm\fR.
.Sp
The only issue left is to how to bootstrap \fIBar.xs\fR. This is done
from \fIFoo.xs\fR:
.Sp
.Vb 1
\& MODULE = Cool::Foo PACKAGE = Cool::Foo
.Ve
.Sp
.Vb 3
\& BOOT:
\& # boot the second XS file
\& boot_Cool__Bar(aTHX_ cv);
.Ve
.Sp
If you have more than two files, this is the place where you should
boot extra \s-1XS\s0 files from.
.Sp
The following four files sum up all the details discussed so far.
.Sp
.Vb 3
\& Foo.pm:
\& -------
\& package Cool::Foo;
.Ve
.Sp
.Vb 1
\& require DynaLoader;
.Ve
.Sp
.Vb 3
\& our @ISA = qw(DynaLoader);
\& our $VERSION = '0.01';
\& bootstrap Cool::Foo $VERSION;
.Ve
.Sp
.Vb 1
\& 1;
.Ve
.Sp
.Vb 3
\& Bar.pm:
\& -------
\& package Cool::Bar;
.Ve
.Sp
.Vb 1
\& use Cool::Foo; # bootstraps Bar.xs
.Ve
.Sp
.Vb 1
\& 1;
.Ve
.Sp
.Vb 5
\& Foo.xs:
\& -------
\& #include "EXTERN.h"
\& #include "perl.h"
\& #include "XSUB.h"
.Ve
.Sp
.Vb 1
\& MODULE = Cool::Foo PACKAGE = Cool::Foo
.Ve
.Sp
.Vb 3
\& BOOT:
\& # boot the second XS file
\& boot_Cool__Bar(aTHX_ cv);
.Ve
.Sp
.Vb 1
\& MODULE = Cool::Foo PACKAGE = Cool::Foo PREFIX = cool_foo_
.Ve
.Sp
.Vb 2
\& void
\& cool_foo_perl_rules()
.Ve
.Sp
.Vb 2
\& CODE:
\& fprintf(stderr, "Cool::Foo says: Perl Rules\en");
.Ve
.Sp
.Vb 5
\& Bar.xs:
\& -------
\& #include "EXTERN.h"
\& #include "perl.h"
\& #include "XSUB.h"
.Ve
.Sp
.Vb 1
\& MODULE = Cool::Bar PACKAGE = Cool::Bar PREFIX = cool_bar_
.Ve
.Sp
.Vb 2
\& void
\& cool_bar_perl_rules()
.Ve
.Sp
.Vb 2
\& CODE:
\& fprintf(stderr, "Cool::Bar says: Perl Rules\en");
.Ve
.Sp
And of course a very basic test:
.Sp
.Vb 9
\& test.pl:
\& --------
\& use Test;
\& BEGIN { plan tests => 1 };
\& use Cool::Foo;
\& use Cool::Bar;
\& Cool::Foo::perl_rules();
\& Cool::Bar::perl_rules();
\& ok 1;
.Ve
.Sp
This tip has been brought to you by Nick Ing-Simmons and Stas Bekman.
.SH "PATCHING"
.IX Header "PATCHING"
If you have a question you'd like to see added to the \s-1FAQ\s0 (whether or
not you have the answer) please send it to makemaker@perl.org.
.SH "AUTHOR"
.IX Header "AUTHOR"
The denizens of makemaker@perl.org.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
ExtUtils::MakeMaker