aboutsummaryrefslogtreecommitdiff
path: root/openssl/buildfile
blob: a0bd50574a32a9db6658d9cb55102f3ca1b6593c (plain)
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
# file      : openssl/buildfile
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

import libs = libbutl%lib{butl}

./: exe{openssl-client}: client/cxx{client} client/libue{openssl}

client/
{
  libue{openssl}: {hxx ixx txx cxx}{* -client -options -*.test...} \
                  {hxx ixx cxx}{options}                           \
                  ../libue{openssl}
}

./: exe{openssl-agent-pkcs11}: agent/pkcs11/cxx{agent}     \
                               agent/pkcs11/libue{openssl}


agent/pkcs11/
{
  libue{openssl}: {hxx ixx txx cxx}{* -agent -options -*.test...}   \
                  {hxx ixx cxx}{options}                            \
                  h{pkcs11}                                         \
                  ../../libue{openssl}

  libue{openssl}: cxx.libs += -ldl
}

libue{openssl}: {hxx ixx txx cxx}{* -options -version -*.test...} \
                {hxx ixx cxx}{options} {hxx}{version} $libs

hxx{version}: in{version} $src_root/manifest

# Unit tests.
#
exe{*.test}:
{
  test = true
  install = false
}

for t: cxx{**.test...}
{
  d = $directory($t)
  n = $name($t)...

  ./: $d/exe{$n}: $t $d/{hxx ixx txx}{+$n} $d/testscript{+$n}
  $d/exe{$n}: $d/libue{openssl}: bin.whole = false
}

# Generated options parser.
#
if $cli.configured
{
               cli.cxx{options}:              cli{options}
        client/cli.cxx{options}:       client/cli{options}
  agent/pkcs11/cli.cxx{options}: agent/pkcs11/cli{options}

  cli.options += -I $src_root --include-with-brackets              \
--cxx-prologue "#include <openssl/types-parsers.hxx>"              \
--cli-namespace openssl::cli --generate-specifier --generate-parse

  cli.cxx{options}: cli.options += --include-prefix openssl \
--guard-prefix OPENSSL # No usage.

  # Usage options.
  #
  cli.options += --suppress-undocumented --long-usage --ansi-color \
--page-usage 'openssl::print_$name$_' --option-length 20

  client/cli.cxx{options}: cli.options += --include-prefix openssl/client \
--guard-prefix OPENSSL_CLIENT

  agent/pkcs11/cli.cxx{options}: cli.options += \
--include-prefix openssl/agent/pkcs11 --guard-prefix OPENSSL_AGENT_PKCS11

  # Include the generated cli files into the distribution and don't remove
  # them when cleaning in src (so that clean results in a state identical to
  # distributed).
  #
  cli.cxx{*}:
  {
    dist  = true
    clean = ($src_root != $out_root)
  }
}