File: Makefile.PL

package info (click to toggle)
libnet-bluetooth-perl 0.41-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 172 kB
  • sloc: perl: 131; makefile: 8
file content (49 lines) | stat: -rw-r--r-- 1,308 bytes parent folder | download | duplicates (5)
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
use ExtUtils::MakeMaker;
use Config qw(%Config);
require 5.008;
my $win_include = '"-IC:\\PROGRAM FILES\\MICROSOFT PLATFORM SDK FOR WINDOWS SERVER 2003 R2\\INCLUDE"';
my $lib_path = "";
my $inc_path = "";

print "OS = $Config{osname}\n";

if($Config{osname} =~ /^MSWin/i) {
	print "**ATTENTION!!**\n";
	print "Attempting to build for Windows with the following include path:\n";
	print "$win_include\n";
	print "If this is not the include path for the SP2 SDK, please change the\n";
	print "\$win_include variable in Makefile.PL.\n\n\n";

	$inc_path = $win_include;
	copy_xs("MSWin.xs", "Bluetooth.xs"); 
}

else {
	$lib_path = '-lbluetooth';
	copy_xs("BlueZ.xs", "Bluetooth.xs"); 
}


sub copy_xs {
my $source = shift;
my $dest = shift;

	open(SOURCE, "$source") or die "$! $source\n";
	open(DEST, ">$dest") or die "$! $dest\n";
	@contents = <SOURCE>;
	print DEST @contents;
	close(DEST);
	close(SOURCE);
}

 

WriteMakefile(
    'NAME'	=> 'Net::Bluetooth',
    'VERSION_FROM' => 'Bluetooth.pm', # finds $VERSION
    'LIBS'	=> [$lib_path],   # e.g., '-lm' 
    'DEFINE'	=> $define,     # e.g., '-DHAVE_SOMETHING' 
    'INC'	=> $inc_path,     # e.g., '-I/usr/include/other' 
    'clean'     => {FILES => 'Bluetooth.xs'},
    'XSPROTOARG' => '-prototypes' 
);