2021-03-12 16:54:14 +00:00
|
|
|
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")
|
2019-01-28 21:10:31 +00:00
|
|
|
|
2021-02-26 20:21:13 +00:00
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "all_srcs",
|
2021-12-30 16:37:31 +00:00
|
|
|
srcs = glob(
|
|
|
|
include = ["**"],
|
|
|
|
exclude = ["*.bazel"],
|
|
|
|
),
|
2021-02-26 20:21:13 +00:00
|
|
|
)
|
|
|
|
|
2022-06-17 17:05:28 +00:00
|
|
|
# I tested and this builds for me on macOS and Linux, did not check Windows
|
2019-01-28 21:10:31 +00:00
|
|
|
configure_make(
|
|
|
|
name = "bison",
|
2021-11-19 00:56:08 +00:00
|
|
|
build_data = [
|
|
|
|
"@m4",
|
|
|
|
],
|
2023-06-09 10:29:12 +00:00
|
|
|
env = select({
|
|
|
|
"@platforms//os:linux": {
|
|
|
|
"M4": "$$EXT_BUILD_DEPS$$/bin/m4/bin/m4",
|
|
|
|
},
|
|
|
|
"@platforms//os:macos": {
|
|
|
|
"AR": "",
|
|
|
|
"M4": "$$EXT_BUILD_DEPS$$/bin/m4/bin/m4",
|
|
|
|
},
|
|
|
|
"//conditions:default": {},
|
|
|
|
}),
|
2021-03-11 17:14:00 +00:00
|
|
|
lib_source = ":all_srcs",
|
|
|
|
out_binaries = [
|
2019-01-28 21:10:31 +00:00
|
|
|
"bison",
|
|
|
|
"yacc",
|
|
|
|
],
|
2023-06-09 10:29:12 +00:00
|
|
|
# Bison depends on m4sugar.m4 in the "share" directory at runtime
|
|
|
|
out_data_dirs = ["share"],
|
2021-03-11 17:14:00 +00:00
|
|
|
out_static_libs = ["liby.a"],
|
2019-01-28 21:10:31 +00:00
|
|
|
)
|
2023-06-09 10:29:12 +00:00
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "gen_dir",
|
|
|
|
srcs = [":bison"],
|
|
|
|
output_group = "gen_dir",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|