-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.PL
32 lines (27 loc) · 902 Bytes
/
Makefile.PL
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
use 5.008005;
use strict;
use warnings;
use ExtUtils::MakeMaker 7.12;
my $os = $^O;
my $linux_mongoc_flags = `pkg-config --cflags --libs libmongoc-1.0 libbson-1.0`;
chomp($linux_mongoc_flags);
my %config = (
NAME => 'Pongo',
VERSION_FROM => 'lib/Pongo.pm',
PREREQ_PM => { 'ExtUtils::MakeMaker' => '7.12' },
ABSTRACT_FROM => 'lib/Pongo.pm',
AUTHOR => 'Rudraditya Thakur',
CCFLAGS => '-Wall -std=c99 -O3',
LICENSE => 'GPL-3.0 License',
XSMULTI => 1,
);
if ($os eq 'linux') {
$config{CCFLAGS} = " $linux_mongoc_flags";
$config{LIBS} = [$linux_mongoc_flags];
} elsif ($os eq 'darwin') {
$config{CCFLAGS} = '-Wall -std=c99 -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0';
$config{LIBS} = ['-lmongoc-1.0 -lbson-1.0'];
} else {
die "Unsupported operating system: $os";
}
WriteMakefile(%config);