1 use ExtUtils::MakeMaker;
4 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
5 # the contents of the Makefile that is written.
7 # Note: This is a hack. This hack is necessary because MacFUSE's libfuse
8 # (and libfuse_ino64, by extension) don't link in libiconv. This wouldn't
9 # be a problem, but it appears the Darwin/OS X dynamic linker won't
10 # satisfy runtime link dependencies in those libraries from libraries
11 # imported by our library, and it uses a symbol from libiconv without
12 # actually linking the library to itself. Awesome.
14 sub test_via_harness {
15 my($self, $perl, $tests) = @_;
16 local $_ = $self->SUPER::test_via_harness($perl, $tests);
17 s/PERL_DL_NONLAZY=1//g if $^O eq 'darwin';
22 my($self, $perl, $tests) = @_;
23 local $_ = $self->SUPER::test_via_script($perl, $tests);
24 s/PERL_DL_NONLAZY=1//g if $^O eq 'darwin';
30 chomp(my $fusever = `pkg-config --modversion fuse 2> /dev/null`);
31 # Required for refuse on NetBSD
33 chomp($fusever = `fusermount -V`);
34 $fusever =~ s/^.*?version:\s+//;
38 # make CPANPLUS happy and don't report errors if fuse isn't installed
39 die("No support for os: $^O\n",
40 "You need to have fuse-dev (or similar) package installed and have sufficient permissions in order to install this module\n",
41 $^O eq 'darwin' ? ("One option on Mac is http://code.google.com/p/macfuse/\n") : (),
44 if ($fusever && $fusever + 0 < 2.6) {
45 die "FUSE API is ", $fusever, ", must be 2.6 or later\n";
47 warn "fuse version found: ", $fusever, "\n";
50 chomp(my $inc = `pkg-config --cflags-only-I fuse 2> /dev/null` || '-I ../include');
51 chomp(my $libs = `pkg-config --libs-only-L fuse 2> /dev/null`);
52 chomp($libs .= `pkg-config --libs-only-l fuse 2> /dev/null` || (($^O eq 'netbsd') ? '-lrefuse' : '-lfuse'));
53 if ($^O eq 'darwin' && (uname())[2] =~ /^10\./) {
54 $libs =~ s/-lfuse/-lfuse_ino64/;
56 chomp(my $def = '-Wall -g -ggdb -DFUSE_USE_VERSION=26 ' . `pkg-config --cflags-only-other fuse 2> /dev/null` || '-D_FILE_OFFSET_BITS=64');
57 chomp($def .= `pkg-config --libs-only-other fuse 2> /dev/null`);
58 $def .= ' -DPERL_HAS_64BITINT' if $Config{'use64bitint'};
62 'VERSION_FROM' => 'Fuse.pm', # finds $VERSION
63 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
64 ($] >= 5.005 ? ## Add these new keywords supported since 5.005
65 (ABSTRACT_FROM => 'Fuse.pm', # retrieve abstract from module
66 AUTHOR => 'Mark Glines <mark@glines.org>') : ()),
67 ($ExtUtils::MakeMaker::VERSION < 6.46 ? () : (
70 bugtracker => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Fuse',
71 repository => 'http://github.com/dpavlin/perl-fuse'
75 'LIBS' => '-lpthread ' . $libs, # e.g., '-lm'
76 'DEFINE' => $def, # e.g., '-DHAVE_SOMETHING'
77 # Insert -I. if you add *.h files later:
78 'INC' => $inc, # e.g., '-I/usr/include/other'
79 # Un-comment this if you add C files to link with later:
80 'OBJECT' => 'Fuse$(OBJ_EXT)', # link all the C files too
93 @echo -n "Upload" Fuse-*.tar.gz "to CPAN? [y/N]:"
94 @read upload && test "$$upload" == "y" && cpan-upload -verbose Fuse-*.tar.gz
99 svn2cvs.pl file:///home/dpavlin/private/svn/fuse/perl-llin :ext:dpavlin@fuse.cvs.sourceforge.net:/cvsroot/fuse perl
104 # vim: ts=4 ai et hls