]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
build: Prefix configuration options
authorDaniel Wagner <dwagner@suse.de>
Wed, 22 Dec 2021 09:35:06 +0000 (10:35 +0100)
committerDaniel Wagner <dwagner@suse.de>
Mon, 27 Dec 2021 14:27:45 +0000 (15:27 +0100)
Use the prefix CONFIG for all configuration option.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Makefile
meson.build
nvme.c

index 4071bc5cb433ab9fa8c5c2605e9dd2e93741dec0..aa59196921883faf5c0e965ac60d35c73bc88292 100644 (file)
--- 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
 
index 8417a65d247998dcfc87e53883331cd054953d36..c7382992498220734db591fe21140ef736f5ed0e 100644 (file)
@@ -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 9ab50d82faa29511fdb61151c7c4f1d8f1b5f5f3..b10c087965adcae41fa0b5af00f564323e5830a9 100644 (file)
--- a/nvme.c
+++ b/nvme.c
 #include <libgen.h>
 #include <zlib.h>
 
-#ifdef LIBHUGETLBFS
+#ifdef CONFIG_LIBHUGETLBFS
 #include <hugetlbfs.h>
 #endif
 
-#ifdef OPENSSL
+#ifdef CONFIG_OPENSSL
 #include <openssl/engine.h>
 #include <openssl/evp.h>
 #include <openssl/hmac.h>
@@ -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;