 
            I'm afraid something's not fully done yet.
On a FreeBSD system with hwlock installed in a non-default PREFIX configure runs as follows:
checking for hwloc.h... yes checking for hwloc_topology_init in -lhwloc... yes
For the build then to fail as follows:
dlls/ntdll/unix/system.c: In function ‘traverse_hwloc_topology’: dlls/ntdll/unix/system.c:1406:10: error: ‘HWLOC_OBJ_L1CACHE’ undeclared (first use in this function); did you mean ‘HWLOC_OBJ_CACHE’? 1406 | case HWLOC_OBJ_L1CACHE: | ^~~~~~~~~~~~~~~~~ | HWLOC_OBJ_CACHE dlls/ntdll/unix/system.c:1406:10: note: each undeclared identifier is reported only once for each function it appears in dlls/ntdll/unix/system.c:1407:10: error: ‘HWLOC_OBJ_L1ICACHE’ undeclared (first use in this function); did you mean ‘HWLOC_OBJ_CACHE’? 1407 | case HWLOC_OBJ_L1ICACHE: | ^~~~~~~~~~~~~~~~~~ | HWLOC_OBJ_CACHE dlls/ntdll/unix/system.c:1410:10: error: ‘HWLOC_OBJ_L2CACHE’ undeclared (first use in this function); did you mean ‘HWLOC_OBJ_CACHE’?
Looking into all of the include files installed, HWLOC_OBJ_L does not show up anywhere.
Now https://www.open-mpi.org/projects/hwloc/doc/v2.3.0/a00360.php has the following:
HWLOC_OBJ_CACHE replaced
Instead of a single HWLOC_OBJ_CACHE, there are now 8 types HWLOC_OBJ_L1CACHE, ..., HWLOC_OBJ_L5CACHE, HWLOC_OBJ_L1ICACHE, ..., HWLOC_OBJ_L3ICACHE.
So it looks as if:
(1) configure needs to be tightened?
(2) And is the FreeBSD's devel/hwloc really sufficient? Or is there something newer you used for development and testing?