-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.PL
77 lines (72 loc) · 2.58 KB
/
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
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
use 5.006;
use ExtUtils::MakeMaker;
use Config;
use strict;
#
## Search for udunits2 library and include file
#
my ($udunits_lib_path, $udunits_inc_path);
foreach my $libdir (
$ENV{UDUNITS2_LIBDIR},
'/usr/local/udunits2/lib',
'/usr/local/lib',
'/opt/local/lib',
'/usr/lib',
'/opt/lib',
# Add new library paths here!!
) {
my $dynlib = "$libdir/libudunits2." . $Config{dlext};
if (-e $dynlib) {
$udunits_lib_path = $libdir;
print "Found libudunits2 at $dynlib\n";
last;
}
my $staticlib = "$libdir/libudunits2.a";
if (-e $staticlib) {
$udunits_lib_path = $libdir;
print "Found static libudunits2 at $staticlib\n";
last;
}
}
if (!defined $udunits_lib_path) {
die <<EODIE;
Cannot find libudunits2. Please install udunits2 and set the
environment variable UDUNITS2_LIBDIR to the installed directory, i.e. /my/home/udunits2/lib
EODIE
}
foreach my $incdir (
$ENV{UDUNITS2_INCDIR},
'/usr/local/udunits2/include',
'/usr/local/include',
'/opt/local/include',
'/usr/include',
'/opt/include',
# Add new header paths here!!
) {
if (-e "$incdir/udunits2.h") {
$udunits_inc_path = $incdir;
print "Found udunits2.h at $incdir/netcdf.h\n";
last;
}
}
if (!defined $udunits_inc_path) {
die <<EODIE;
Cannot find udunits2.h Please install udunits2 and set the
environment variable UDUNITS2_INCDIR to the installed directory, i.e. /my/home/udunits2/include
EODIE
}
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'Physics::Udunits2',
VERSION_FROM => 'lib/Physics/Udunits2.pm', # finds $VERSION
PREREQ_PM => {}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/Physics/Udunits2.pm', # retrieve abstract from module
AUTHOR => 'Heiko Klein <[email protected]>') : ()),
LIBS => ["-L$udunits_lib_path".' -ludunits2 -lm'], # e.g., '-lm'
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
INC => "-I. -I$udunits_inc_path",
# Un-comment this if you add C files to link with later:
# OBJECT => '$(O_FILES)', # link all the C files too
);