do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
}
+feature_not_found() {
+ feature=$1
+ packages=$2
+
+ echo ""
+ echo "ERROR: $feature package requirements not met"
+ if test ! -z "$packages" ; then
+ echo "ERROR: needs $packages installed"
+ fi
+ fatal ""
+}
+
has() {
type "$1" >/dev/null 2>&1
}
libuuid="no"
${ld} -o /dev/null -luuid >/dev/null 2>&1
if [ $? -eq 0 ]; then
- libuuid="yes"
+ libuuid="yes"
fi
print_config "libuuid" "${libuuid}"
##########################################
# check for SystemD
-havesystemd="no"
-pkg-config --exists systemd --atleast-version=232
+systemd="no"
+pkg-config --exists systemd --atleast-version=232
if [ $? -eq 0 ]; then
- havesystemd="yes"
+ systemd="yes"
fi
-print_config "havesystemd" "${havesystemd}"
+print_config "systemd" "${systemd}"
if test "$libuuid" = "yes"; then
- output_sym "LIBUUID"
+ output_sym "CONFIG_LIBUUID"
echo "override LDFLAGS += -luuid" >> $config_host_mak
echo "override LIB_DEPENDS += uuid" >> $config_host_mak
fi
-if test "$havesystemd" = "yes"; then
- output_sym "HAVE_SYSTEMD"
+if test "$systemd" = "yes"; then
+ output_sym "CONFIG_SYSTEMD"
echo "override LDFLAGS += -lsystemd" >> $config_host_mak
fi
CCANDIR=ccan/
-CFLAGS ?= -g -fomit-frame-pointer -O2 -I/usr/include -Invme/ -I$(CCANDIR)
+CFLAGS ?= -g -fomit-frame-pointer -O2 -I/usr/include -Invme/ -I$(CCANDIR) -include ../config-host.h
override CFLAGS += -Wall -fPIC
SO_CFLAGS=-shared $(CFLAGS)
L_CFLAGS=$(CFLAGS)
#include <sys/stat.h>
#include <sys/types.h>
+#ifdef CONFIG_SYSTEMD
#include <systemd/sd-id128.h>
+#define NVME_HOSTNQN_ID SD_ID128_MAKE(c7,f4,61,81,12,be,49,32,8c,83,10,6f,9d,dd,d8,6b)
+#endif
#include <ccan/array_size/array_size.h>
#include "util.h"
#define NVMF_HOSTID_SIZE 36
-#define NVME_HOSTNQN_ID SD_ID128_MAKE(c7,f4,61,81,12,be,49,32,8c,83,10,6f,9d,dd,d8,6b)
const char *nvmf_dev = "/dev/nvme-fabrics";
const char *nvmf_hostnqn_file = "/etc/nvme/hostnqn";
return ret;
}
+#ifdef CONFIG_SYSTEMD
char *nvmf_hostnqn_generate()
{
char *ret = NULL;
return ret;
}
+#else
+char *nvmf_hostnqn_generate()
+{
+ errno = ENOTSUP;
+ return NULL;
+}
+#endif
static char *nvmf_read_file(const char *f, int len)
{