This repository was archived by the owner on Mar 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 592
/
Copy pathBUILD
97 lines (91 loc) · 2.71 KB
/
BUILD
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
load("@rules_cc//cc:defs.bzl", "cc_library")
licenses(["notice"])
package(default_visibility = ["//visibility:public"])
genrule(
name = "zookeeper-srcs",
outs = [
"bin/cli_mt",
"bin/cli_st",
"bin/load_gen",
"include/zookeeper/proto.h",
"include/zookeeper/recordio.h",
"include/zookeeper/zookeeper.h",
"include/zookeeper/zookeeper.jute.h",
"include/zookeeper/zookeeper_log.h",
"include/zookeeper/zookeeper_version.h",
"lib/libzookeeper_mt.a",
"lib/libzookeeper_st.a",
],
cmd = select({
":darwin": "\n".join([
"export INSTALL_DIR=$$(pwd)/$(@D)",
"export TMP_DIR=$$(mktemp -d -t zookeeper.XXXXX)",
"export CXXFLAGS=-Wno-error",
"export CFLAGS=-Wno-error",
"mkdir -p $$TMP_DIR",
"cp -R $$(pwd)/external/org_apache_zookeeper/* $$TMP_DIR",
"cd $$TMP_DIR/zookeeper-client/zookeeper-client-c",
"./configure --prefix=$$INSTALL_DIR --enable-shared=no",
"make install",
"rm -rf $$TMP_DIR",
]),
"//conditions:default": "\n".join([
"export INSTALL_DIR=$$(pwd)/$(@D)",
"export TMP_DIR=$$(mktemp -d -t zookeeper.XXXXX)",
"export CXXFLAGS=-Wno-error",
"export CFLAGS=-Wno-error",
"mkdir -p $$TMP_DIR",
"cp -R $$(pwd)/external/org_apache_zookeeper/* $$TMP_DIR",
"cd $$TMP_DIR",
"ant compile_jute",
"cd $$TMP_DIR/zookeeper-client/zookeeper-client-c",
"autoreconf -if",
"./configure --prefix=$$INSTALL_DIR --enable-shared=no",
"make install",
"rm -rf $$TMP_DIR",
]),
}),
)
cc_library(
name = "zookeeper_st-cxx",
srcs = [
"include/zookeeper/proto.h",
"include/zookeeper/recordio.h",
"include/zookeeper/zookeeper.jute.h",
"include/zookeeper/zookeeper_log.h",
"include/zookeeper/zookeeper_version.h",
"lib/libzookeeper_st.a",
],
hdrs = [
"include/zookeeper/zookeeper.h",
],
includes = [
"include",
],
linkstatic = 1,
)
cc_library(
name = "zookeeper",
srcs = [
"include/zookeeper/proto.h",
"include/zookeeper/recordio.h",
"include/zookeeper/zookeeper.jute.h",
"include/zookeeper/zookeeper_log.h",
"include/zookeeper/zookeeper_version.h",
"lib/libzookeeper_mt.a",
],
hdrs = [
"include/zookeeper/zookeeper.h",
],
includes = [
"include",
],
linkstatic = 1,
)
config_setting(
name = "darwin",
values = {
"cpu": "darwin",
},
visibility = ["//visibility:public"],
)