File: Makefile.PL

package info (click to toggle)
libgtk-perl 0.7009-12
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,956 kB
  • ctags: 2,260
  • sloc: perl: 13,998; xml: 9,919; ansic: 2,894; makefile: 64; cpp: 45
file content (98 lines) | stat: -rw-r--r-- 2,698 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
use ExtUtils::MakeMaker;
use Config;
use blib '../Gtk';
use Cwd;
require '../Depends.pm';
require '../tools/gendefs.pl';

$gpb = new ExtUtils::Depends('Gtk::Gdk::Pixbuf', 'Gtk');

mkdir('build', 0777);

$libs = `gdk-pixbuf-config --libs`;
$inc = `gdk-pixbuf-config --cflags`;
$libs =~ s/\s+/ /g;
$inc =~ s/\s+/ /g;
$gpb->set_inc ($inc);
$gpb->set_libs ($libs);

$gpb->add_typemaps (cwd() . '/pkg.typemap', cwd().'/build/GdkPixbufTypemap');
$gpb->add_headers (qw( <gdk-pixbuf/gdk-pixbuf-loader.h> ));

$gpb->save_config( 'build/Files.pm');
$gpb->install( 'build/Files.pm');

$gpb->add_pm('GdkPixbuf.pm' => '$(INST_ARCHLIBDIR)/Pixbuf.pm',
	'build/GdkPixbufTypes.pm' => '$(INST_ARCHLIBDIR)/Pixbuf/Types.pm');

$gpb->add_c('build/GdkPixbufDefs.c');
$gpb->add_defs('pkg.defs');
$gpb->add_xs ('xs/GdkPixbuf.xs');

@a = ( '-f', 'GdkPixbuf',
	'-p', 'Gtk=Gtk',
	'-p', 'GdkRgb=Gtk::Gdk::Rgb',
	'-p', 'Gdk=Gtk::Gdk',
	'-m', 'Gtk::Gdk::Pixbuf');

foreach ($gpb->get_defs) {
        push @a, '-d', $_;
}
foreach ($gpb->get_headers) {
        push @a, '-i', $_;
}

$gpb->add_xs(gendefs::gendefs(@a));

$depend = { 'build/GdkPixbufDefs.c' => 'build/GdkPixbufDefs.h build/PerlGdkPixbufInt.h' };

$gpb->install (qw( build/GdkPixbufDefs.h build/PerlGdkPixbufInt.h));
$gpb->write_ext("build/extension.xsh");

$gpb->add_clean ( map {"build/$_"} qw(
Files.pm	 GdkPixbufTypemap    PerlGdkPixbufInt.h  perl-gdkpixbuf-ds.pod
GdkPixbufDefs.c  GdkPixbufTypes.pm   boxed.xsh		 perl-gdkpixbuf-ref.xml
GdkPixbufDefs.h  PerlGdkPixbufExt.c  extension.xsh
GdkPixbufDefs.o  PerlGdkPixbufExt.h  objects.xsh
));

# documentation
gendefs::gen_doc('gdkpixbuf');
system($Config{perlpath}, "../tools/gendoc.pl", "-t", 'gdkpixbuf', $gpb->get_xs);
system($Config{perlpath}, "../tools/gpdoc2pod", "-t", 'GdkPixbuf');

WriteMakefile(
	'NAME'      => 'Gtk::Gdk::Pixbuf',
	'VERSION_FROM'	=> 'GdkPixbuf.pm',
	'XSOPT' => '-noversioncheck',
	'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" },
	'MAN3PODS' => {
		'build/perl-gdkpixbuf-ref.pod' => '$(INST_MAN3DIR)/Gtk::Gdk::Pixbuf::reference.3pm',
		},
	$gpb->get_makefile_vars,
);

sub MY::postamble {

'
Makefile: ' . join(' ',
        sort {$defs{$a} <=> $defs{$b}} keys %defs,
        <*/pkg*.pl>
        ) . '

build/PerlGdkPixbufExt.h build/PerlGdkPixbufExt.c build/PerlGdkPixbufInt.h: build/GdkPixbufDefs.h ../tools/genext.pl
	$(PERL) ../tools/genext.pl GdkPixbuf </dev/null

gendoc:
	$(PERL) ../tools/gendoc.pl -t gdkpixbuf $(XS_FILES)

';

}

sub MY::c_o {
	package MY; # so that "SUPER" works right
	my $inherited = shift->SUPER::c_o(@_);
	$inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a "`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
    $inherited;
}