blob: d916fb0c2c9dec4f6efaf1843eb21761304192c0 [file] [log] [blame]
cc_binary_host {
// Not named "flex" because we need the flex module to build scan.l below,
// and we don't support dependency loops. The stem renames this back to
// 'flex' in the installed path
name: "flex_bin",
stem: "flex",
stl: "none",
srcs: [
"ccl.c",
"dfa.c",
"ecs.c",
"scanflags.c",
"gen.c",
"main.c",
"misc.c",
"nfa.c",
"parse.y",
"scan.l",
"sym.c",
"tblcmp.c",
"yylex.c",
"options.c",
"scanopt.c",
"buf.c",
"tables.c",
"tables_shared.c",
"filter.c",
"regex.c",
":flex_skel.c",
],
cflags: [
"-DHAVE_ALLOCA=1",
"-DHAVE_LIMITS_H=1",
"-DHAVE_UNISTD_H=1",
"-DHAVE_NETINET_IN_H=1",
"-DHAVE_SYS_WAIT_H=1",
"-DHAVE_STDBOOL_H=1",
"-DHAVE_REGEX_H=1",
"-DSTDC_HEADERS=1",
"-DVERSION=\"2.6.4\"",
// TODO: This should use a hermetic m4 -- this is a default that can be overwritten
// overwritten with the M4 environment variable, which may be simpler within the build.
"-DM4=\"m4\"",
"-Wno-pointer-sign",
"-Wno-unused-parameter",
"-Wno-unused-variable",
"-Wno-unused-label",
"-Wno-error=dangling-else",
"-Wno-error=incompatible-pointer-types-discards-qualifiers",
"-Wno-error=int-conversion",
],
}
genrule {
name: "flex_skel.c",
// This is lightly modified from Makefile.am
cmd: "/bin/bash $(location mkskel.sh) `dirname $(in)` $(location m4) 2.6.4 >$(out)",
tool_files: [
"mkskel.sh",
"flexint.h",
"tables_shared.c",
"tables_shared.h",
],
tools: ["m4"],
srcs: [
"flex.skl",
],
out: [
"skel.c",
],
}