File: wscript

package info (click to toggle)
ntpsec 1.2.0%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 10,044 kB
  • sloc: ansic: 60,737; python: 31,610; sh: 1,494; yacc: 1,291; makefile: 176; javascript: 138
file content (71 lines) | stat: -rw-r--r-- 1,940 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
66
67
68
69
70
71
import os

def build(ctx):

    libntp_source = [
        "authkeys.c",
        "authreadkeys.c",
        "clocktime.c",
        "decodenetnum.c",
        "dolfptoa.c",
        "getopt.c",
        "initnetwork.c",
        "isc_interfaceiter.c",
        "isc_net.c",
        "macencrypt.c",
        "ntp_endian.c",
        "numtoa.c",
        "refidsmear.c",
        "socket.c",
        "socktoa.c",
        "ssl_init.c",
        "syssignal.c",
    ]

    libntp_source_sharable = [
        "assert.c",
        "clockwork.c",
        "emalloc.c",
        "hextolfp.c",
        "lib_strbuf.c",
        "msyslog.c",
        "ntp_calendar.c",
        "ntp_random.c",
        "prettydate.c",
        "statestr.c",
        "systime.c",
        "timespecops.c",
    ]

    if not ctx.env.HAVE_STRLCAT or not ctx.env.HAVE_STRLCPY:
        libntp_source_sharable += ["strl_obsd.c"]

    # C library
    ctx(
        features="c cstlib",
        includes=[ctx.bldnode.parent.abspath(), "../include"],
        source=libntp_source + libntp_source_sharable,
        target="ntp",
        use="CRYPTO SSL",
    )

    if ctx.env['ntpc'] == 'ffi':
        # Loadable FFI stub
        ctx(
            features="c cshlib",
            includes=[ctx.bldnode.parent.abspath(), "../include"],
            source=["ntp_c.c", "pymodule-mac.c"] + libntp_source_sharable,
            target="../pylib/ntpc",  # Put the output in the pylib directory
            use="M RT CRYPTO",
            vnum=ctx.env['ntpcver'],
        )
    elif ctx.env['ntpc'] == 'ext':
        # Loadable Python extension
        ctx(
            features="c cshlib pyext",
            install_path='${PYTHONARCHDIR}/ntp',
            includes=[ctx.bldnode.parent.abspath(), "../include"],
            source=["pymodule.c", "pymodule-mac.c"] + libntp_source_sharable,
            target="../pylib/ntpc",  # Put the output in the pylib directory
            use="M RT CRYPTO",
        )