Writing C Modules with XS
# check to make sure we have Gnome 1.2, 1.3 or 1.4 and can use gnome config
my $version = gnome config version gnome ;
unless ($version and $version =~ /1.[234]/) {
print <
#######################################################################
Gnome 1.[234].x not found. Please make sure you have Gnome installed
and that gnome config is in your path. Then re run "perl Makefile.PL".
You can find more information about Gnome at http://gnome.org
#######################################################################
END
exit 1;
}
Next I'll modify the call to WriteMakefile() to use gnome config to get the
correct LIBS and INC settings:
WriteMakefile(
NAME => "Gnome::MIME",
VERSION_FROM => "MIME.pm",
PREREQ_PM => {},
ABSTRACT_FROM => "MIME.pm",
AUTHOR => Sam Tregar ,
LIBS => [ gnome config libs gnome ],
INC => gnome config cflags gnome ,
);
A rebuild shows the effect in the compilation line:
cc c I/usr/include DNEED_GNOMESUPPORT_H I/usr/lib/gnome libs/include \
I/usr/include/gtk 1.2 I/usr/include/glib 1.2 I/usr/lib/glib/include \
I/usr/X11R6/include 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
and the link line:
LD_RU_PATH="/usr/lib" cc shared L/usr/local/lib MIME.o \
o blib/arch/auto/Gnome/MIME/MIME.so L/usr/lib lgnome lgnomesupport \
lesd laudiofile lm ldb1 lglib ldl
21
213
3
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