-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.js
94 lines (82 loc) · 2.3 KB
/
init.js
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
if(isMac())
{
say("Warning: The default Mac clang compiler (even aliased gcc) will not work with this project, as it lacks OpenMP support.")
say("If you have another compiler, you can define it with 'export CXX=g++-7' and 'export CCX=gcc-7' prior to executing the build.")
say("")
}
// Asn1c
Resource("http://lionet.info/soft/asn1c-0.9.28.tar.gz", "asn1c.tar.gz", function (f)
{
extract(f);
extract("asn1c.tar");
copy("resources/enber.c", "asn1c-0.9.28/asn1c/enber.c");
copy("resources/unber.c", "asn1c-0.9.28/asn1c/unber.c");
copy("resources/getopt.h", "asn1c-0.9.28/asn1c/getopt.h");
});
// cryptopp
Resource("https://www.cryptopp.com/cryptopp600.zip", "cryptopp.zip", function(f)
{
extract2(f, "cryptopp")
})
function make_cryptopp()
{
// For cryptopp
if(isWindows())
{
// This will be modified later on to allow you to pick which build you want to execute.
if(detect("msbuild"))
{
sys("cd cryptopp & msbuild cryptlib.vcxproj /p:Configuration=Release /p:Platform=x64")
}
else
{
var make = "make"
if(detect("mingw32-make")) make = "mingw32-make"
sys("cd cryptopp & " + make + " libcryptopp.a")
}
}
else
{
sys("cd cryptopp; make libcryptopp.a")
}
}
make_cryptopp()
function nspdhOut()
{
say("nspdh built.");
if(detect("upx"))
sys("upx nspdh.exe --lzma")
}
function make_asn1c()
{
if(detect("msbuild"))
{
sys('cd asn1c-0.9.28/asn1c & cl /I"../libasn1compiler" /I"../libasn1print" /I"../libasn1parser" /I"../libasn1fix" /I"../skeletons" /DBufferMode /c enber.c')
waitAll()
}
else
{
// already executed in make_nspdh
}
}
function make_nspdh()
{
say("Building program.")
// This will be modified later on to allow you to pick which build you want to execute.
if(detect("msbuild"))
{
make_asn1c()
sys("cl /DLINKASN1C /DREQUIRE_XML_EXPORT src/*.cpp /openmp /Ox cryptopp/x64/Output/Release/cryptlib.lib asn1c-0.9.28/asn1c/enber.obj /DForce2011 /Fenspdh", nspdhOut)
}
else
{
var make = "make";
if(detect("mingw32-make"))
{
make = "mingw32-make";
}
sys(make, nspdhOut);
}
}
waitAll()
make_nspdh()