Hi,
I'm using new_http_archive to import libcoap
new_http_archive(
name = "libcoap",
sha256 = "4caf73446a4994a0571afaf5e60a62a749bda92a29e9407174614733e984c238",
strip_prefix = "libcoap-4.1.2",
build_file = "config/libcoap.BUILD",
# sha256 = "aac5b9101fad4cf722f0166f2739ebcefe55ad0ca7aa475550b11c8eb4740511",
# strip_prefix = "libcoap-IoTivity-1.2.1d",
)
The lib must be configured, which involves running autogen.sh (which runs autoreconf etc.) and then configure.
The following genrule seems to be doing this. Note that my output is just for while I'm developing; once I get configure running successfully I'll deal with the outputs.
genrule(
name = "config",
srcs = ["autogen.sh",
"Makefile.am",
"NEWS",
"README",
"AUTHORS",
"ChangeLog",
"doc/Doxyfile.in",
"doc/Makefile.am",
"examples/Makefile.am",
"tests/Makefile.am",
],
outs = ["autotest"],
cmd = "\n".join([
"echo 'foo' > $@",
"cd external/libcoap",
"./autogen.sh 2>&1",
"sleep 1",
"./configure --disable-examples"
])
)
However, it chokes on a config macro:
checking whether to build static libraries... yes
./configure: line 12764: syntax error near unexpected token `-Wlogical-op,'
./configure: line 12764: `AX_CHECK_COMPILE_FLAG(-Wlogical-op, WARNING_CFLAGS="$WARNING_CFLAGS -Wlogical-op",,-Werror)'
Target @libcoap//:config failed to build
But if I manually download the library, run autogen.sh and then configure, it does not throw this error.
So my inference is that Bazel's environment is doing something that configure cannot abide. Any suggestions?
Thanks,
Gregg