File: Makefile.PL

package info (click to toggle)
libcrypt-dh-gmp-perl 0.00012-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 260 kB
  • ctags: 222
  • sloc: perl: 2,093; ansic: 202; makefile: 2
file content (65 lines) | stat: -rw-r--r-- 2,044 bytes parent folder | download
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
use inc::Module::Install;

my @DEFINES;
if (grep { $_ eq '--very-verbose' } @ARGV) {
    push @DEFINES, '-DVERY_VERBOSE';
}

my @CCFLAGS = split(' ', $ENV{CCFLAGS} || '');
my @LDFLAGS = split(' ', $ENV{LDFLAGS} || '');
my @INCLUDES;
my @LIBPATHS;

if ($^O eq 'darwin') {
    if (! exists $ENV{USE_MACPORTS}) {
        print 
            "======\n\n",
            "Automatically enabling pushing MacPorts into our path(s)...\n",
            "Set USE_MACPORTS=0 if you don't want me to do this\n\n",
            "======\n"
        ;
        $ENV{USE_MACPORTS} = 1;
    }
    if ($ENV{USE_MACPORTS}) {
        if ( ! -d '/opt/local/include' ) {
            print " * Attempted to push /opt/local/include in our path, but it wasn't there.\n";
        } else {
            push @INCLUDES , '/opt/local/include';
        }

        if ( ! -d '/opt/local/lib') {
            print " * Attempted to push /opt/local/lib in our path, but it wasn't there.\n";
        } else {
            push @LIBPATHS, '/opt/local/lib';
        }
    }
} 

# Stolen from Math::BigInt::GMP
if (($Config::Config{'osname'} eq 'darwin') && ! (join (' ', @ARGV) =~ /LDDLFLAGS/))
{
    ### reads pre-existing LDDLFLAGS for a darwin system as defined in
    ###  /System/Library/Perl/x.x.x/darwin-thread-multi-2level/Config.pm
    ###  where x.x.x is the perl version, which is 5.8.1 for MacOS X 10.3,
    ###  and appends ' -read_only_relocs suppress' 
    ### default behavior if LDDLFLAGS is defined
    push @ARGV, sprintf "LDDLFLAGS=%s -read_only_relocs suppress", $Config::Config{'lddlflags'};
}

name 'Crypt-DH-GMP';
all_from 'lib/Crypt/DH/GMP.pm';
use_ppport;
cc_libs @LDFLAGS;
cc_include_paths @INCLUDES;
cc_append_to_ccflags @CCFLAGS if @CCFLAGS;
cc_define @DEFINES;
cc_assert_lib libpath => \@LIBPATHS, incpath => \@INCLUDES, lib => 'gmp', header => 'gmp.h';
cc_libs 'gmp', map { "-L$_" } @LIBPATHS;
cc_src_paths 'xs';
author_tests 'xt';

repository 'https://github.com/lestrrat/Crypt-DH-GMP';

test_requires 'Test::More';
test_requires 'Test::Requires';
WriteAll;