|
1 | 1 | # ******************************************************************************* |
2 | | -# Copyright (c) 2025 Contributors to the Eclipse Foundation |
| 2 | +# Copyright (c) 2026 Contributors to the Eclipse Foundation |
3 | 3 | # |
4 | 4 | # See the NOTICE file(s) distributed with this work for additional |
5 | 5 | # information regarding copyright ownership. |
|
11 | 11 | # SPDX-License-Identifier: Apache-2.0 |
12 | 12 | # ******************************************************************************* |
13 | 13 |
|
| 14 | +""" Bazel BUILD file for the ACL library. |
| 15 | +""" |
| 16 | + |
14 | 17 | load("@rules_cc//cc:defs.bzl", "cc_library") |
15 | 18 |
|
16 | 19 | cc_library( |
17 | | - name = "acl", |
18 | | - srcs = select({ |
19 | | - "@platforms//cpu:aarch64": ["usr/lib/libacl.a"], |
20 | | - "@platforms//cpu:x86_64": ["usr/lib/libacl.a"], |
| 20 | + name = "config", |
| 21 | + hdrs = select({ |
| 22 | + "@platforms//os:linux": ["bazel/configs/linux/config.h"], |
| 23 | + }), |
| 24 | + strip_include_prefix = select({ |
| 25 | + "@platforms//os:linux": "bazel/configs/linux", |
21 | 26 | }), |
| 27 | +) |
| 28 | + |
| 29 | +cc_library( |
| 30 | + name = "acl_h", |
| 31 | + hdrs = ["include/acl.h"], |
| 32 | + copts = [ |
| 33 | + '-DEXPORT=__attribute__((visibility("default"))) extern', |
| 34 | + ], |
| 35 | + include_prefix = "sys", |
| 36 | + includes = ["include"], |
| 37 | + strip_include_prefix = "include", |
| 38 | +) |
| 39 | + |
| 40 | +cc_library( |
| 41 | + name = "libacl_h", |
| 42 | + hdrs = ["include/libacl.h"], |
| 43 | + include_prefix = "acl", |
| 44 | + includes = ["include"], |
| 45 | + strip_include_prefix = "include", |
| 46 | +) |
| 47 | + |
| 48 | +cc_library( |
| 49 | + name = "includes", |
22 | 50 | hdrs = [ |
23 | | - "usr/include/acl/libacl.h", |
24 | | - "usr/include/sys/acl.h", |
| 51 | + "include/acl_ea.h", |
| 52 | + "include/misc.h", |
| 53 | + "include/walk_tree.h", |
| 54 | + ], |
| 55 | + includes = ["include"], |
| 56 | +) |
| 57 | + |
| 58 | +cc_library( |
| 59 | + name = "acl", |
| 60 | + srcs = glob(["libacl/*c"]) + [ |
| 61 | + "libmisc/high_water_alloc.c", |
| 62 | + "libmisc/next_line.c", |
| 63 | + "libmisc/quote.c", |
| 64 | + "libmisc/uid_gid_lookup.c", |
| 65 | + "libmisc/unquote.c", |
| 66 | + "libmisc/walk_tree.c", |
25 | 67 | ], |
26 | | - includes = ["usr/include/"], |
| 68 | + hdrs = glob(["libacl/*h"]), |
| 69 | + copts = [ |
| 70 | + "-include libacl/perm_copy.h", |
| 71 | + "-include", |
| 72 | + "config.h", |
| 73 | + "-Wno-error=missing-prototypes", |
| 74 | + "-Wno-error=cast-qual", |
| 75 | + "-Wno-error=int-conversion", |
| 76 | + "-Wno-error=implicit-function-declaration", |
| 77 | + ], |
| 78 | + includes = ["libacl"], |
| 79 | + linkstatic = True, |
27 | 80 | visibility = ["//visibility:public"], |
| 81 | + deps = [ |
| 82 | + ":acl_h", |
| 83 | + ":config", |
| 84 | + ":includes", |
| 85 | + ":libacl_h", |
| 86 | + "@bazel_attr//:attr", |
| 87 | + ], |
28 | 88 | ) |
0 commit comments