From: Daniel Wagner Date: Wed, 22 Dec 2021 09:35:06 +0000 (+0100) Subject: build: Prefix configuration options X-Git-Tag: v2.0-rc0~13^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4c3a8c058eb3c291b4d1ad23b46f851e00da8fa6;p=users%2Fsagi%2Fnvme-cli.git build: Prefix configuration options Use the prefix CONFIG for all configuration option. Signed-off-by: Daniel Wagner --- diff --git a/Makefile b/Makefile index 4071bc5c..aa591969 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ endif ifeq ($(LIBHUGETLBFS),0) override LDFLAGS += -lhugetlbfs - override CFLAGS += -DLIBHUGETLBFS + override CFLAGS += -DCONFIG_LIBHUGETLBFS override LIB_DEPENDS += hugetlbfs endif @@ -48,7 +48,7 @@ endif ifeq ($(LIBOPENSSL),0) override LDFLAGS += -lssl -lcrypto - override CFLAGS += -DOPENSSL + override CFLAGS += -DCONFIG_OPENSSL override LIB_DEPENDS += openssl endif diff --git a/meson.build b/meson.build index 8417a65d..c7382992 100644 --- a/meson.build +++ b/meson.build @@ -39,7 +39,7 @@ conf.set('CONFIG_LIBUUID', libuuid.found(), description: 'Is libuuid available?' json_c = dependency('json-c', version: '>=0.13', fallback : ['json-c', 'json_c_dep']) if json_c.found() conf.set('CONFIG_JSONC', true, description: 'Is json-c available?') - conf.set('LIBJSONC_14', json_c.version().version_compare('>=0.14'), description: 'Is json-c at least 0.14?') + conf.set('CONFIG_JSONC_14', json_c.version().version_compare('>=0.14'), description: 'Is json-c at least 0.14?') endif # Check for libhugetlbfs availability @@ -51,7 +51,7 @@ else libhugetlbfs_dep = [] have_libhugetlbfs = false endif -conf.set('LIBHUGETLBFS', have_libhugetlbfs, description: 'Is libhugetlbfs available?') +conf.set('CONFIG_LIBHUGETLBFS', have_libhugetlbfs, description: 'Is libhugetlbfs available?') # Check for zlib availability libz_dep = dependency('zlib', fallback : ['zlib', 'zlib_dep']) @@ -60,7 +60,7 @@ libz_dep = dependency('zlib', fallback : ['zlib', 'zlib_dep']) openssl_dep = dependency('openssl', version: '>=1.1.0', required: get_option('openssl'), fallback : ['openssl', 'openssl_dep']) -conf.set('OPENSSL', openssl_dep.found(), description: 'Is OpenSSL available?') +conf.set('CONFIG_OPENSSL', openssl_dep.found(), description: 'Is OpenSSL available?') # Set the nvme-cli version conf.set('NVME_VERSION', '"' + meson.project_version() + '"') diff --git a/nvme.c b/nvme.c index 9ab50d82..b10c0879 100644 --- a/nvme.c +++ b/nvme.c @@ -40,11 +40,11 @@ #include #include -#ifdef LIBHUGETLBFS +#ifdef CONFIG_LIBHUGETLBFS #include #endif -#ifdef OPENSSL +#ifdef CONFIG_OPENSSL #include #include #include @@ -125,7 +125,7 @@ static void *__nvme_alloc(size_t len, bool *huge) { #define HUGE_MIN 0x80000 -#ifdef LIBHUGETLBFS +#ifdef CONFIG_LIBHUGETLBFS void nvme_free(void *p, bool huge) { if (huge) { @@ -6698,7 +6698,7 @@ static int gen_dhchap_key(int argc, char **argv, struct command *command, struct char encoded_key[128]; unsigned long crc = crc32(0L, NULL, 0); int err = 0; -#ifdef OPENSSL +#ifdef CONFIG_OPENSSL const EVP_MD *md = NULL; const char *hostnqn; #else @@ -6735,7 +6735,7 @@ static int gen_dhchap_key(int argc, char **argv, struct command *command, struct return -EINVAL; } if (cfg.hmac > 0) { -#ifdef OPENSSL +#ifdef CONFIG_OPENSSL if (!cfg.nqn) { hostnqn = nvmf_hostnqn_from_file(); if (!hostnqn) { @@ -6817,7 +6817,7 @@ static int gen_dhchap_key(int argc, char **argv, struct command *command, struct } if (md) { -#ifdef OPENSSL +#ifdef CONFIG_OPENSSL HMAC_CTX *hmac_ctx = HMAC_CTX_new(); const char hmac_seed[] = "NVMe-over-Fabrics"; unsigned int key_len;