| 1 | import feature : feature ;
|
|---|
| 2 | import project ;
|
|---|
| 3 | import "class" : new ;
|
|---|
| 4 | import targets ;
|
|---|
| 5 | import property-set ;
|
|---|
| 6 | import common ;
|
|---|
| 7 | import type ;
|
|---|
| 8 | import toolset : flags ;
|
|---|
| 9 | import stage ;
|
|---|
| 10 |
|
|---|
| 11 | # Make this module into a project.
|
|---|
| 12 | project.initialize $(__name__) ;
|
|---|
| 13 | project cryptopp ;
|
|---|
| 14 |
|
|---|
| 15 | if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
|
|---|
| 16 | {
|
|---|
| 17 | .debug-configuration = true ;
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | rule initialized ( )
|
|---|
| 21 | {
|
|---|
| 22 | return $(.initialized) ;
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | rule isEnabled ( )
|
|---|
| 26 | {
|
|---|
| 27 | return $(.enabled) ;
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | rule getSource ( )
|
|---|
| 31 | {
|
|---|
| 32 | return $(.source) ;
|
|---|
| 33 | }
|
|---|
| 34 | rule getTarget ( )
|
|---|
| 35 | {
|
|---|
| 36 | return $(.target) ;
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | rule isDebug ( )
|
|---|
| 40 | {
|
|---|
| 41 | return $(.debug-configuration) ;
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | rule printEnv ( )
|
|---|
| 45 | {
|
|---|
| 46 | echo "Crypto++ SOURCE : change with --with-cryptopp=<source>" ;
|
|---|
| 47 | echo "Crypto++ SOURCE : $(.source) (change with --with-cryptopp=<source>" ;
|
|---|
| 48 | echo "Crypto++ TARGET : $(.target) (change with --with-cryptopp-target=<target>" ;
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 | # Initialize Lua support.
|
|---|
| 52 | rule init (
|
|---|
| 53 | version ? :
|
|---|
| 54 | source # Location of source files
|
|---|
| 55 | )
|
|---|
| 56 | {
|
|---|
| 57 |
|
|---|
| 58 | if $(.initialized)
|
|---|
| 59 | {
|
|---|
| 60 | errors.error "Attempt the reinitialize Lua!" ;
|
|---|
| 61 | }
|
|---|
| 62 | else
|
|---|
| 63 | {
|
|---|
| 64 | .initialized = true ;
|
|---|
| 65 | .source = $(source) ;
|
|---|
| 66 |
|
|---|
| 67 | local has-cryptopp = [ MATCH "^--with-cryptopp=(.*)" : [ modules.peek : ARGV ] ] ;
|
|---|
| 68 | if $(has-cryptopp) {
|
|---|
| 69 | .source = $(has-cryptopp) ;
|
|---|
| 70 | }
|
|---|
| 71 | local has-generic-hdr = [ MATCH "^--include-path=(.*)" : [ modules.peek : ARGV ] ] ;
|
|---|
| 72 | if $(has-generic-hdr) {
|
|---|
| 73 | .headers = $(has-generic-hdr) ;
|
|---|
| 74 | }
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 | local has-cryptopp-tgt = [ MATCH "^--with-cryptopp-target=(.*)" : [ modules.peek : ARGV ] ] ;
|
|---|
| 78 | if $(has-cryptopp-tgt) {
|
|---|
| 79 | .target = $(has-cryptopp-tgt) ;
|
|---|
| 80 | .all_headers = [ path.glob-tree $(.source) : *.h ] ;
|
|---|
| 81 | }
|
|---|
| 82 |
|
|---|
| 83 | if ( ( --with-cryptopp in [ modules.peek : ARGV ] ) || $(has-cryptopp) )
|
|---|
| 84 | && ! ( --without-cryptopp in [ modules.peek : ARGV ] ) {
|
|---|
| 85 | .enabled = true ;
|
|---|
| 86 | } else {
|
|---|
| 87 | .enabled = false ;
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 | echo $(.source)/x64masm.asm ;
|
|---|
| 91 | obj x64masm.obj : $(.source)/x64masm.asm ;
|
|---|
| 92 |
|
|---|
| 93 | local project = [ project.current ] ;
|
|---|
| 94 | project.pop-current ;
|
|---|
| 95 | }
|
|---|
| 96 | }
|
|---|
| 97 |
|
|---|
| 98 | rule generate-asm-source ( properties * )
|
|---|
| 99 | {
|
|---|
| 100 | local path = $(.source) ;
|
|---|
| 101 | result += <source>$(path)/x64masm.asm ;
|
|---|
| 102 | local result ;
|
|---|
| 103 | }
|
|---|
| 104 |
|
|---|
| 105 | obj x64masm.obj : $(.source)/x64masm.asm ;
|
|---|
| 106 |
|
|---|
| 107 | rule generate-source ( properties * )
|
|---|
| 108 | {
|
|---|
| 109 |
|
|---|
| 110 | local path = $(.source) ;
|
|---|
| 111 | local result ;
|
|---|
| 112 |
|
|---|
| 113 | result += <source>$(path)/3way.cpp ;
|
|---|
| 114 | result += <source>$(path)/adhoc.cpp.proto ;
|
|---|
| 115 | result += <source>$(path)/adler32.cpp ;
|
|---|
| 116 | result += <source>$(path)/algebra.cpp ;
|
|---|
| 117 | result += <source>$(path)/algparam.cpp ;
|
|---|
| 118 | result += <source>$(path)/arc4.cpp ;
|
|---|
| 119 | result += <source>$(path)/asn.cpp ;
|
|---|
| 120 | result += <source>$(path)/base32.cpp ;
|
|---|
| 121 | result += <source>$(path)/base64.cpp ;
|
|---|
| 122 | result += <source>$(path)/basecode.cpp ;
|
|---|
| 123 | result += <source>$(path)/bfinit.cpp ;
|
|---|
| 124 | result += <source>$(path)/blowfish.cpp ;
|
|---|
| 125 | result += <source>$(path)/blumshub.cpp ;
|
|---|
| 126 | result += <source>$(path)/camellia.cpp ;
|
|---|
| 127 | result += <source>$(path)/cast.cpp ;
|
|---|
| 128 | result += <source>$(path)/casts.cpp ;
|
|---|
| 129 | result += <source>$(path)/cbcmac.cpp ;
|
|---|
| 130 | result += <source>$(path)/channels.cpp ;
|
|---|
| 131 | result += <source>$(path)/cpu.cpp ;
|
|---|
| 132 | result += <source>$(path)/crc.cpp ;
|
|---|
| 133 | result += <source>$(path)/cryptlib.cpp ;
|
|---|
| 134 | result += <source>$(path)/default.cpp ;
|
|---|
| 135 | result += <source>$(path)/des.cpp ;
|
|---|
| 136 | result += <source>$(path)/dessp.cpp ;
|
|---|
| 137 | result += <source>$(path)/dh.cpp ;
|
|---|
| 138 | result += <source>$(path)/dh2.cpp ;
|
|---|
| 139 | result += <source>$(path)/dll.cpp ;
|
|---|
| 140 | result += <source>$(path)/dsa.cpp ;
|
|---|
| 141 | result += <source>$(path)/ec2n.cpp ;
|
|---|
| 142 | result += <source>$(path)/eccrypto.cpp ;
|
|---|
| 143 | result += <source>$(path)/ecp.cpp ;
|
|---|
| 144 | result += <source>$(path)/elgamal.cpp ;
|
|---|
| 145 | result += <source>$(path)/emsa2.cpp ;
|
|---|
| 146 | result += <source>$(path)/eprecomp.cpp ;
|
|---|
| 147 | result += <source>$(path)/esign.cpp ;
|
|---|
| 148 | result += <source>$(path)/files.cpp ;
|
|---|
| 149 | result += <source>$(path)/filters.cpp ;
|
|---|
| 150 | result += <source>$(path)/fips140.cpp ;
|
|---|
| 151 | # result += <source>$(path)/fipstest.cpp ;
|
|---|
| 152 | result += <source>$(path)/gf256.cpp ;
|
|---|
| 153 | result += <source>$(path)/gf2_32.cpp ;
|
|---|
| 154 | result += <source>$(path)/gf2n.cpp ;
|
|---|
| 155 | result += <source>$(path)/gfpcrypt.cpp ;
|
|---|
| 156 | result += <source>$(path)/gost.cpp ;
|
|---|
| 157 | result += <source>$(path)/gzip.cpp ;
|
|---|
| 158 | result += <source>$(path)/hex.cpp ;
|
|---|
| 159 | result += <source>$(path)/hmac.cpp ;
|
|---|
| 160 | result += <source>$(path)/hrtimer.cpp ;
|
|---|
| 161 | result += <source>$(path)/ida.cpp ;
|
|---|
| 162 | result += <source>$(path)/idea.cpp ;
|
|---|
| 163 | result += <source>$(path)/integer.cpp ;
|
|---|
| 164 | result += <source>$(path)/iterhash.cpp ;
|
|---|
| 165 | result += <source>$(path)/luc.cpp ;
|
|---|
| 166 | result += <source>$(path)/mars.cpp ;
|
|---|
| 167 | result += <source>$(path)/marss.cpp ;
|
|---|
| 168 | result += <source>$(path)/md2.cpp ;
|
|---|
| 169 | result += <source>$(path)/md4.cpp ;
|
|---|
| 170 | result += <source>$(path)/md5.cpp ;
|
|---|
| 171 | result += <source>$(path)/misc.cpp ;
|
|---|
| 172 | result += <source>$(path)/modes.cpp ;
|
|---|
| 173 | result += <source>$(path)/mqueue.cpp ;
|
|---|
| 174 | result += <source>$(path)/mqv.cpp ;
|
|---|
| 175 | result += <source>$(path)/nbtheory.cpp ;
|
|---|
| 176 | result += <source>$(path)/network.cpp ;
|
|---|
| 177 | result += <source>$(path)/oaep.cpp ;
|
|---|
| 178 | result += <source>$(path)/osrng.cpp ;
|
|---|
| 179 | result += <source>$(path)/panama.cpp ;
|
|---|
| 180 | result += <source>$(path)/pch.cpp ;
|
|---|
| 181 | result += <source>$(path)/pkcspad.cpp ;
|
|---|
| 182 | result += <source>$(path)/polynomi.cpp ;
|
|---|
| 183 | result += <source>$(path)/pssr.cpp ;
|
|---|
| 184 | result += <source>$(path)/pubkey.cpp ;
|
|---|
| 185 | result += <source>$(path)/queue.cpp ;
|
|---|
| 186 | result += <source>$(path)/rabin.cpp ;
|
|---|
| 187 | result += <source>$(path)/randpool.cpp ;
|
|---|
| 188 | result += <source>$(path)/rc2.cpp ;
|
|---|
| 189 | result += <source>$(path)/rc5.cpp ;
|
|---|
| 190 | result += <source>$(path)/rc6.cpp ;
|
|---|
| 191 | result += <source>$(path)/rdtables.cpp ;
|
|---|
| 192 | result += <source>$(path)/rijndael.cpp ;
|
|---|
| 193 | result += <source>$(path)/ripemd.cpp ;
|
|---|
| 194 | result += <source>$(path)/rng.cpp ;
|
|---|
| 195 | result += <source>$(path)/rsa.cpp ;
|
|---|
| 196 | result += <source>$(path)/rw.cpp ;
|
|---|
| 197 | result += <source>$(path)/safer.cpp ;
|
|---|
| 198 | result += <source>$(path)/salsa.cpp ;
|
|---|
| 199 | result += <source>$(path)/seal.cpp ;
|
|---|
| 200 | result += <source>$(path)/serpent.cpp ;
|
|---|
| 201 | result += <source>$(path)/sha.cpp ;
|
|---|
| 202 | result += <source>$(path)/shacal2.cpp ;
|
|---|
| 203 | result += <source>$(path)/shark.cpp ;
|
|---|
| 204 | result += <source>$(path)/sharkbox.cpp ;
|
|---|
| 205 | result += <source>$(path)/simple.cpp ;
|
|---|
| 206 | result += <source>$(path)/skipjack.cpp ;
|
|---|
| 207 | result += <source>$(path)/socketft.cpp ;
|
|---|
| 208 | result += <source>$(path)/sosemanuk.cpp ;
|
|---|
| 209 | result += <source>$(path)/square.cpp ;
|
|---|
| 210 | result += <source>$(path)/squaretb.cpp ;
|
|---|
| 211 | result += <source>$(path)/strciphr.cpp ;
|
|---|
| 212 | result += <source>$(path)/tea.cpp ;
|
|---|
| 213 | result += <source>$(path)/tftables.cpp ;
|
|---|
| 214 | result += <source>$(path)/tiger.cpp ;
|
|---|
| 215 | result += <source>$(path)/tigertab.cpp ;
|
|---|
| 216 | result += <source>$(path)/trdlocal.cpp ;
|
|---|
| 217 | result += <source>$(path)/ttmac.cpp ;
|
|---|
| 218 | result += <source>$(path)/twofish.cpp ;
|
|---|
| 219 | result += <source>$(path)/vmac.cpp ;
|
|---|
| 220 | result += <source>$(path)/wait.cpp ;
|
|---|
| 221 | result += <source>$(path)/wake.cpp ;
|
|---|
| 222 | result += <source>$(path)/whrlpool.cpp ;
|
|---|
| 223 | result += <source>$(path)/winpipes.cpp ;
|
|---|
| 224 |
|
|---|
| 225 | # TODO readd this for 64 bit!
|
|---|
| 226 | # This needs a patched boost build (http://zigzag.cs.msu.su/boost.build/attachment/ticket/214/msvc_asm.patch)
|
|---|
| 227 | if <address-model>64 in $(properties) {
|
|---|
| 228 | result += <source>$(path)/x64masm.asm ;
|
|---|
| 229 | result += <source>$(path)/x64dll.asm ;
|
|---|
| 230 | }
|
|---|
| 231 | result += <source>$(path)/xtr.cpp ;
|
|---|
| 232 | result += <source>$(path)/xtrcrypt.cpp ;
|
|---|
| 233 | result += <source>$(path)/zdeflate.cpp ;
|
|---|
| 234 | result += <source>$(path)/zinflate.cpp ;
|
|---|
| 235 | result += <source>$(path)/zlib.cpp ;
|
|---|
| 236 |
|
|---|
| 237 | return $(result) ;
|
|---|
| 238 | }
|
|---|
| 239 | rule generate-usage-requirements ( properties * )
|
|---|
| 240 | {
|
|---|
| 241 | local result ;
|
|---|
| 242 | if ( $(.enabled) = true ) {
|
|---|
| 243 | result += <define>HAVE_LIBCRYPTOPP ;
|
|---|
| 244 | result += <library>libcryptopp ;
|
|---|
| 245 | result += <include>$(.headers) ;
|
|---|
| 246 | }
|
|---|
| 247 | return $(result) ;
|
|---|
| 248 | }
|
|---|
| 249 |
|
|---|
| 250 | lib libcryptopp
|
|---|
| 251 | : # sources
|
|---|
| 252 | : # requirements
|
|---|
| 253 | <conditional>@generate-source
|
|---|
| 254 | <link>static
|
|---|
| 255 | : # default-build
|
|---|
| 256 | : # usage-requirements
|
|---|
| 257 | ;
|
|---|
| 258 |
|
|---|
| 259 | alias embedded
|
|---|
| 260 | : # source
|
|---|
| 261 | libcryptopp
|
|---|
| 262 | : # requirements
|
|---|
| 263 | : # default-build
|
|---|
| 264 | : # usage-requirements
|
|---|
| 265 | <conditional>@generate-usage-requirements
|
|---|
| 266 | ;
|
|---|