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
100
101
102
103
104
105
use env;
/*
match (env::consts::OS){
"linux" => {
cc::Build::new()
.file("src/c/bitshuffle.c") // Add other .c files if needed
.file("src/c/bitshuffle_core.c")
.file("src/c/iochain.c")
.file("src/c/lz4.c")
.include("src/c/bitshuffle") // Include the header files
.include("src/c/lz4") // Include the header files
.flag_if_supported("-std=c99") // Ensure compatibility with C99 if needed
.compile("libbitshuffle.a"); // Output static library
}
"macos" => {
cc::Build::new()
.file("src/c/bitshuffle.c") // Add other .c files if needed
.file("src/c/bitshuffle_core.c")
.file("src/c/iochain.c")
.file("src/c/lz4.c")
.include("src/c/bitshuffle") // Include the header files
.include("src/c/lz4") // Include the header files
.flag_if_supported("-std=c99") // Ensure compatibility with C99 if needed
.compile("libbitshuffle.a"); // Output static library
}
_ => {}
*/
/*
if (osName == 'darwin'){
exec {
executable 'gcc'
args '-prebind',
'-dynamiclib',
'-O3',
'-std=c99',
'-I', "${home}/../include/${osName}",
'-I', "${home}/../include",
'-I', 'src/main/c',
'-I', 'src/main/c/lz4',
'-I', 'src/main/c/bitshuffle',
'-o', "src/main/resources/${osName}/${osArch}/libbitshuffle-lz4-java.dylib",
'src/main/c/lz4/lz4.c',
'src/main/c/bitshuffle/iochain.c',
'src/main/c/bitshuffle/bitshuffle_core.c',
'src/main/c/bitshuffle/bitshuffle.c',
'src/main/c/ch_psi_bitshuffle_lz4_JNI.c'
}
}
else if (osName == 'linux'){
exec {
executable 'gcc'
args '-shared',
'-O3',
'-fPIC',
'-std=c99',
'-I', "${home}/../include/${osName}",
'-I', "${home}/../include",
'-I', 'src/main/c',
'-I', 'src/main/c/lz4',
'-I', 'src/main/c/bitshuffle',
'-o', "src/main/resources/${osName}/${osArch}/libbitshuffle-lz4-java.so",
'src/main/c/lz4/lz4.c',
'src/main/c/bitshuffle/iochain.c',
'src/main/c/bitshuffle/bitshuffle_core.c',
'src/main/c/bitshuffle/bitshuffle.c',
'src/main/c/ch_psi_bitshuffle_lz4_JNI.c'
}
}
*/
//}