aboutsummaryrefslogtreecommitdiffstats
path: root/build/conf/perl.conf
blob: 681f60fc0b3064b00677c1c7afcf6041f5f36f8a (plain) (blame)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# tag:perl-specific
when ($USE_LOCAL_TOOLS == "yes") {
    PERL=$LOCAL_PERL
    PERL_VERSION=$LOCAL_PERL_VERSION
    PERL_PRIVLIB=$LOCAL_PERL_PRIVLIB
    PERL_ARCHLIB=$LOCAL_PERL_ARCHLIB
    when ($LOCAL_PERL_LIBS) {
        PERL_LIBS=$LOCAL_PERL_LIBS
    }
}
otherwise {
    PERL=NO-PERL-SELECTED
    PERL_VERSION=NO-PERL-SELECTED-VERSION
    PERL_PRIVLIB=NO-PERL-SELECTED-PRIVLIB
    PERL_ARCHLIB=NO-PERL-SELECTED-ARCHLIB
}

# tag:perl-specific
PERL_LD_LIBRARY_PATH=
PERL_INCLUDE=
USE_PERL_SYSTEM=yes
when ($USE_PERL_SYSTEM == "yes") {
    select ($PERL_SDK) {
        "ubuntu-12" ? {
            PERL_VERSION=5.14
            PERL_ROOT=${SYSTEM_PERL_514_RESOURCE_GLOBAL}/perl${PERL_VERSION}
            PERL_LIB_ARCH=
        }
        "ubuntu-14" ? {
            PERL_VERSION=5.18
            PERL_ROOT=${SYSTEM_PERL_518_RESOURCE_GLOBAL}/perl${PERL_VERSION}
            PERL_LIB_ARCH=
        }
        "ubuntu-16" ? {
            PERL_VERSION=5.22
            PERL_ROOT=${SYSTEM_PERL_522_RESOURCE_GLOBAL}/perl${PERL_VERSION}
            PERL_LIB_ARCH=/x86_64-linux-gnu
        }
        "ubuntu-18" ? {
            PERL_VERSION=5.26
            PERL_ROOT=${SYSTEM_PERL_526_RESOURCE_GLOBAL}/perl${PERL_VERSION}
            PERL_LIB_ARCH=/x86_64-linux-gnu
        }
        "ubuntu-20" ? {
            PERL_VERSION=5.30
            PERL_ROOT=${SYSTEM_PERL_530_RESOURCE_GLOBAL}/usr
            PERL_LIB_ARCH=/x86_64-linux-gnu
        }
    }

    PERL=${PERL_ROOT}/bin/perl
    PERL_ARCHLIB=${PERL_ROOT}/lib$PERL_LIB_ARCH/perl/${PERL_VERSION}
    PERL_PRIVLIB=${PERL_ROOT}/share/perl/${PERL_VERSION}
    PERL_LIBS=${PERL_ROOT}/lib${PERL_LIB_ARCH}
    PERL_LD_LIBRARY_PATH=${env:"LD_LIBRARY_PATH=${PERL_ROOT}/lib"}

    # Perl searches it's modules in INC@ paths. They can not be sysrooted or disabled (at least I haven't found a way),
    # so default Perl module directories should be prepended to perl command lines when using non-local perl.
    PERL_INCLUDE=-I${PERL_ARCHLIB} -I${PERL_PRIVLIB}
}

# tag:perl-specific
PERL_DEFAULT_PEERDIR=yes
when ($PERL_DEFAULT_PEERDIR == "yes") {
    when (($PERLXS == "yes") || ($PERLXSCPP == "yes") || ($USE_PERL == "yes")) {
        PEERDIR+=build/platform/perl
    }
}

# tag:perl-specific
PERLSUFFIX=-csuffix .cpp
PERLOUTPUT=${stdout;output:SRC.cpp}
when ($PERLC == "yes") {
    PERLSUFFIX=-csuffix .c
    PERLOUTPUT=${stdout;output:SRC.c}
}
XSUBPPFLAGS=
_XSTYPEMAPS=

macro XSTYPEMAPS(Names...) {
    SET_APPEND(_XSTYPEMAPS $Names)
}

# tag:perl-specific
### @usage: USE_PERL_LIB()
### Add dependency on Perl to your LIBRARY
macro USE_PERL_LIB() {
    PEERDIR(build/platform/perl)
}

# tag:perl-specific
### @usage: USE_PERL_514_LIB()
### Add dependency on Perl 5.14 to your LIBRARY
macro USE_PERL_514_LIB() {
    SET(PERL_SDK ubuntu-12)
    SET(PERL_DEFAULT_PEERDIR no)
    PEERDIR(build/platform/perl/5.14)
}

# tag:perl-specific
### @usage: ADD_PERL_MODULE(Dir ModuleName)
### Add dependency on specified Perl module to the library
macro ADD_PERL_MODULE(Dir, Module) {
    PEERDIR($Dir)
    SET_APPEND(modules $Module)
}