Chapter 9
As you can see, the Makefile gets built as it normally would. Then the MIME.pm file is
copied into blib as usual:
cp MIME.pm blib/lib/Gnome/MIME.pm
The first XS specific step happens next when xsubpp is run on MIME.xs to
produce MIME.xs, which is renamed MIME.c:
/usr/local/bin/perl I/usr/local/lib/perl5/5.6.1/i686 linux \
I/usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/5.6.1/ExtUtils/xsubpp \
typemap /usr/local/lib/perl5/5.6.1/ExtUtils/typemap MIME.xs > MIME.xsc \
&& mv MIME.xsc MIME.c
Next MIME.c is compiled into MIME.o by the cc compiler (actually gcc in this case):
cc c fno strict aliasing I/usr/local/include D_LARGEFILE_SOURCE \
D_FILE_OFFSET_BITS=64 O2 DVERSION=\"0.01\" DXS_VERSION=\"0.01\" \
fpic I/usr/local/lib/perl5/5.6.1/i686 linux/CORE MIME.c
After that a bootstrap file is created MIME.bs. Depending on your platform,
the bootstrap file might contain some Perl code used by DynaLoader to load the
shared library. You can mostly ignore this as it is not something you should modify.
Running Mkbootstrap for Gnome::MIME ()
chmod 644 MIME.bs
Finally the shared library, MIME.so, is linked using cc again and copied into blib:
rm f blib/arch/auto/Gnome/MIME/MIME.so
LD_RUN_PATH="" cc shared L/usr/local/lib MIME.o o \
blib/arch/auto/Gnome/MIME/MIME.so
chmod 755 blib/arch/auto/Gnome/MIME/MIME.so
cp MIME.bs blib/arch/auto/Gnome/MIME/MIME.bs
chmod 644 blib/arch/auto/Gnome/MIME/MIME.bs
Like most XS modules, Gnome::MIME needs to make an addition to Makefile.PL
to allow the module to link with extra libraries and find its header files. In this case
this information is provided by Gnome itself, via the gnome config program. First,
I'll add a block to check for gnome config and make sure the Gnome version falls
within the supported range:
212
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved