aboutsummaryrefslogtreecommitdiff
path: root/openssl/buildfile
blob: 8ce80123377a8e6db8492f56fdc11d953371e0d3 (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
88
89
90
91
92
93
94
95
96
97
98
99
# file      : openssl/buildfile
# license   : MIT; see accompanying LICENSE file

import libs = libbutl%lib{butl}

./: exe{openssl-client}: client/{hxx ixx txx 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/{hxx ixx txx 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
}

# Build options.
#
# Pass the copyright notice extracted from the LICENSE file.
#
copyright = $process.run_regex(                                 \
  cat $src_root/LICENSE,                                        \
  'Copyright \(c\) (.+) \(see the AUTHORS and LEGAL files\)\.', \
  '\1')

obj{agent/pkcs11/agent client/client}:                     \
  cxx.poptions += -DOPENSSL_AGENT_COPYRIGHT=\"$copyright\"

# 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 += --std c++11 -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)
  }
}