name: Linux_Meson_log
path: build/meson-logs/meson-log.txt
- build-static:
+ build-with-libray-static:
runs-on: ubuntu-latest
steps:
- name: install libraries
name: Linux_Meson_log
path: build/meson-logs/meson-log.txt
+ build-static:
+ runs-on: ubuntu-latest
+ steps:
+ - name: install libraries
+ run: sudo apt-get install -y libpam-dev libcap-ng-dev
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v4
+ with:
+ python-version: '3.x'
+ - uses: BSFishy/meson-build@v1.0.3
+ with:
+ setup-options: --werror --wrap-mode=forcefallback --cross-file=.github/cross/ubuntu-static.txt --default-library=static
+ options: --verbose
+ action: test
+ meson-version: 0.61.2
+ # Preserve meson's log file on failure
+ - uses: actions/upload-artifact@v3
+ if: failure()
+ with:
+ name: Linux_Meson_log
+ path: build/meson-logs/meson-log.txt
+
code-coverage:
runs-on: ubuntu-latest
steps:
# Check for libsystemd availability. Optional, only required for MCTP dbus scan
libsystemd_dep = dependency('libsystemd', version: '>219', required: false)
-conf.set('CONFIG_LIBSYSTEMD', libsystemd_dep.found(), description: 'Is libsystemd(>219) available?')
+if libsystemd_dep.found()
+ if cc.links('''#include <systemd/sd-bus.h>
+ int main(void) {
+ struct sd_bus *ret;
+ return sd_bus_default(&ret);
+ }
+ ''',
+ dependencies: libsystemd_dep,
+ name: 'Link check')
+ conf.set('CONFIG_LIBSYSTEMD', libsystemd_dep.found(), description: 'Is libsystemd(>219) available?')
+ else
+ libsystemd_dep = dependency('', required: false)
+ endif
+endif
# local (cross-compilable) implementations of ccan configure steps
conf.set10(
description: 'Is linux/mctp.h include-able?'
)
+conf.set(
+ 'HAVE_LIBNSS',
+ cc.links(
+ '''int main(int argc, char **argv) {
+ struct addrinfo hints, *result;
+ return getaddrinfo(argv[1], argv[2], &hints, &result);
+ }
+ ''',
+ name: 'havelibnss',
+ ),
+ description: 'Is network address and service translation available'
+)
+
if cc.has_function_attribute('fallthrough')
conf.set('fallthrough', '__attribute__((__fallthrough__))')
else
return s;
}
+#ifdef HAVE_LIBNSS
char *hostname2traddr(struct nvme_root *r, const char *traddr)
{
struct addrinfo *host_info, hints = {.ai_family = AF_UNSPEC};
return ret_traddr;
}
+#else /* !HAVE_LIBNSS */
+
+char *hostname2traddr(struct nvme_root *r, const char *traddr)
+{
+ nvme_msg(NULL, LOG_ERR, "No support for hostname IP address resolution; " \
+ "recompile with libnss support.\n");
+
+ errno = -ENOTSUP;
+ return NULL;
+}
+#endif /* HAVE_LIBNSS */
+
char *startswith(const char *s, const char *prefix)
{
size_t l;