fi
config_host_mak="config-host.mak"
-config_host_h="config-host.h"
+config_h="config.h"
rm -rf $config_host_mak
-rm -rf $config_host_h
+rm -rf $config_h
fatal() {
echo $@
echo "Configure failed, check config.log and/or the above output"
rm -rf $config_host_mak
- rm -rf $config_host_h
+ rm -rf $config_h
exit 1
}
}
# Default CFLAGS
-CFLAGS="-D_GNU_SOURCE -include config-host.h"
+CFLAGS="-D_GNU_SOURCE -include config.h"
BUILD_CFLAGS=""
cmdstr=$(printf " '%s'" "$0" "$@")
-# Print configure header at the top of $config_host_h
-cat > $config_host_h <<EOF
+# Print configure header at the top of $config_h
+cat > $config_h <<EOF
/*
* Automatically generated by configure - do not modify
* Configured with:
output_sym() {
output_mak "$1" "y"
- echo "#define $1" >> $config_host_h
+ echo "#define $1" >> $config_h
}
print_and_output_mak() {
description: 'Is isblank() available?'
)
-configure_file(
- output: 'config-host.h',
+config_h = configure_file(
+ output: 'config.h',
configuration: conf
)
)
################################################################################
-add_project_arguments('-include', 'config-host.h', language : 'c')
+add_project_arguments('-include', 'config.h', language : 'c')
add_global_arguments(['-fomit-frame-pointer', '-D_GNU_SOURCE'], language : 'c')
-incdir = include_directories(['ccan', 'src'])
+incdir = include_directories(['.', 'ccan', 'src'])
################################################################################
-subdir('ccan')
subdir('src')
subdir('pynvme')
subdir('test')
CCANDIR=../ccan/
-CFLAGS ?= -g -fomit-frame-pointer -O2 -I/usr/include -Invme/ -I$(CCANDIR) -include ../config-host.h -D_GNU_SOURCE
+CFLAGS ?= -g -fomit-frame-pointer -O2 -I/usr/include -Invme/ -I$(CCANDIR) -I.. -include ../config.h -D_GNU_SOURCE
override CFLAGS += -Wall -fPIC
SO_CFLAGS=-shared $(CFLAGS)
L_CFLAGS=$(CFLAGS)
all: $(all_targets)
-$(CCANDIR)config.h: $(CCANDIR)tools/configurator/configurator
+$(CCANDIR)ccan-config.h: $(CCANDIR)tools/configurator/configurator
$< > $@
+$(CCANDIR)tools/configurator/configurator: CFLAGS = -D_GNU_SOURCE
libccan_headers := $(wildcard $(CCANDIR)ccan/*/*.h)
libccan_srcs := $(wildcard $(CCANDIR)ccan/*/*.c)
libccan_objs := $(patsubst %.c,%.ol,$(libccan_srcs))
libccan_sobjs := $(patsubst %.c,%.os,$(libccan_srcs))
-$(libccan_objs) $(libccan_sobjs): $(libccan_headers) $(CCANDIR)config.h
+$(libccan_objs) $(libccan_sobjs): $(libccan_headers) $(CCANDIR)ccan-config.h
libnvme_priv := nvme/private.h
libnvme_api := libnvme.h nvme/types.h nvme/ioctl.h nvme/filters.h nvme/tree.h nvme/util.h nvme/fabrics.h nvme/log.h
endif
$(libnvme_objs): $(libnvme_api) $(libnvme_private)
-$(libccan_objs): $(libccan_headers) $(CCANDIR)config.h
+$(libccan_objs): $(libccan_headers) $(CCANDIR)ccan-config.h
clean:
rm -f $(all_targets) $(libnvme_objs) $(libnvme_sobjs) $(libccan_objs) $(libccan_sobjs) $(soname).new
- rm -f $(CCANDIR)config.h
+ rm -f $(CCANDIR)ccan-config.h
rm -f $(CCANDIR)tools/configurator/configurator
rm -f *.so* *.a *.o