return 0;
}
-bool nvme_ipaddrs_eq(const char *addr1, const char *addr2) {
+#ifdef HAVE_NETDB
+bool nvme_ipaddrs_eq(const char *addr1, const char *addr2)
+{
bool result = false;
struct addrinfo *info1 = NULL, hint1 = { .ai_flags=AI_NUMERICHOST, .ai_family=AF_UNSPEC };
struct addrinfo *info2 = NULL, hint2 = { .ai_flags=AI_NUMERICHOST, .ai_family=AF_UNSPEC };
freeaddrinfo(info2);
return result;
}
+#else /* HAVE_NETDB */
+bool nvme_ipaddrs_eq(const char *addr1, const char *addr2)
+{
+ nvme_msg(NULL, LOG_ERR, "no support for hostname ip address resolution; " \
+ "recompile with libnss support.\n");
+ return false;
+}
+#endif /* HAVE_NETDB */
test('uuid', uuid)
-tree = executable(
- 'tree',
- ['tree.c'],
- dependencies: libnvme_dep,
- include_directories: [incdir, internal_incdir]
-)
+if conf.get('HAVE_NETDB')
+ tree = executable(
+ 'tree',
+ ['tree.c'],
+ dependencies: libnvme_dep,
+ include_directories: [incdir, internal_incdir]
+ )
-test('tree', tree)
+ test('tree', tree)
-test_util = executable(
- 'test-util',
- ['test-util.c'],
- include_directories: [incdir, internal_incdir]
-)
-test('Test util.c', test_util)
+ test_util = executable(
+ 'test-util',
+ ['test-util.c'],
+ include_directories: [incdir, internal_incdir]
+ )
+ test('Test util.c', test_util)
+endif
subdir('nbft')