-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.PL
90 lines (83 loc) · 3.63 KB
/
Build.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
78
79
80
81
82
83
84
85
86
87
88
89
use strict;
use warnings;
use File::Spec;
use ExtUtils::Constant qw/ WriteConstants /;
use Module::Build;
use vars qw/ %StarConfig /;
# Try looking up the config system
eval "use Starlink::Config qw/ :override :verbose/;";
if ($@) {
print "Could not find Starlink::Config - using /star\n";
%StarConfig = (
Star_Inc => '/star/include',
Star_Lib => '/star/lib',
);
}
# This is the list of libraries required to use the NDF module
# Note that we use a lot of libraries and not just NDF
my $ndflibs = qx/ndg_link/;
$ndflibs .= qx/ one_link/;
die "No NDF libraries were found.\n This may imply that the ndf_link command is not in your path." if $ndflibs !~ /./;
WriteConstants(
NAME => "NDF",
DEFAULT_TYPE => "IV",
NAMES => [
# These are all enums so we need to tell the routine
# not to look use #ifdef
{ name => "DAT__MXDIM", macro => 1 },
{ name => "DAT__NOWLD", macro => 1 },
{ name => "DAT__SZGRP", macro => 1 },
{ name => "DAT__SZLOC", macro => 1 },
{ name => "DAT__SZMOD", macro => 1 },
{ name => "DAT__SZNAM", macro => 1 },
{ name => "DAT__SZTYP", macro => 1 },
{ name => "EMS__OPTER", macro => 1 },
{ name => "EMS__NOMSG", macro => 1 },
{ name => "EMS__UNSET", macro => 1 },
{ name => "EMS__BADOK", macro => 1 },
{ name => "EMS__NSTER", macro => 1 },
{ name => "EMS__BDKEY", macro => 1 },
{ name => "EMS__BTUNE", macro => 1 },
{ name => "EMS__NOENV", macro => 1 },
{ name => "EMS__EROVF", macro => 1 },
{ name => "EMS__CXOVF", macro => 1 },
{ name => "ERR__OPTER", macro => 1 },
{ name => "ERR__UNSET", macro => 1 },
{ name => "ERR__BADOK", macro => 1 },
{ name => "MSG__NORM", macro => 1 },
{ name => "MSG__QUIET", macro => 1 },
{ name => "MSG__SZMSG", macro => 1 },
{ name => "MSG__VERB", macro => 1 },
{ name => "NDF__SZHIS", macro => 1 },
{ name => "NDF__SZHMX", macro => 1 },
{ name => "SAI__OK", macro => 1 },
{ name => "SAI__WARN", macro => 1 },
{ name => "SAI__ERROR", macro => 1 },
]);
my $file = File::Spec->catfile( "lib", "NDF.pm" );
my $build = Module::Build->new
(
module_name => "NDF",
abstract_from => $file,
license => "gpl",
author => [
'Tim Jenness <[email protected]>',
],
version_from => $file,
meta_merge => {
resources => {
repository => "https://github.com/Starlink/perl-NDF.git",
},
},
build_requires => {
"Test::More" => 0,
"Test::Number::Delta" => 0,
},
c_source => "src",
configure_requires => {
"Module::Build" => '0.20',
},
extra_compiler_flags => [ "-I$StarConfig{Star_Inc}" ],
extra_linker_flags => "-L$StarConfig{Star_Lib} -Wl,-rpath,$StarConfig{Star_Lib} $ndflibs",
);
$build->create_build_script;