./configure fails to find "uv.h" on BSD
On FreeBSD and OpenBSD (and likely any system which has libuv headers installed outside of /usr/include
) ./configure
fails to find uv.h
:
configure:18059: checking for libuv
configure:18063: checking for LIBUV
configure:18070: $PKG_CONFIG --exists --print-errors "libuv >= 1.0.0"
configure:18073: $? = 0
configure:18087: $PKG_CONFIG --exists --print-errors "libuv >= 1.0.0"
configure:18090: $? = 0
configure:18128: result: yes
configure:18134: checking whether UV_UDP_MMSG_FREE is declared
configure:18134: cc -c -g -O2 -pthread conftest.c >&5
conftest.c:76:10: fatal error: 'uv.h' file not found
#include <uv.h>
^~~~~~
libuv is detected by pkg-config
correctly:
$ pkg-config --modversion libuv
1.42.0
$ pkg-config --cflags libuv
-I/usr/local/include
$ pkg-config --libs libuv
-L/usr/local/lib -luv
This results in believing UV_UDP_*
are undeclared in libuv:
checking for libuv... checking for libuv >= 1.0.0... yes
checking whether UV_UDP_MMSG_FREE is declared... no
checking whether UV_UDP_MMSG_CHUNK is declared... no
checking whether struct msghdr uses padding for alignment... no
checking whether UV_UDP_RECVMMSG is declared... no
checking whether UV_UDP_LINUX_RECVERR is declared... no
While they are present in /usr/local/include/uv.h
:
$ grep -n -e UV_UDP_MMSG_FREE -e UV_UDP_MMSG_CHUNK -e UV_UDP_RECVMMSG -e UV_UDP_LINUX_RECVERR /usr/local/include/uv.h
628: UV_UDP_MMSG_CHUNK = 8,
634: UV_UDP_MMSG_FREE = 16,
642: UV_UDP_LINUX_RECVERR = 32,
646: UV_UDP_RECVMMSG = 256
CFLAGS="-I/usr/local/include" ./configure
identifies uv.h
correctly:
checking for libuv... checking for LIBUV... yes
checking whether UV_UDP_MMSG_FREE is declared... yes
checking whether UV_UDP_MMSG_CHUNK is declared... yes
checking whether struct msghdr uses padding for alignment... no
checking whether UV_UDP_RECVMMSG is declared... yes
checking whether UV_UDP_LINUX_RECVERR is declared... yes