From 634ac768bad781b44662376bf4c9a03300a118ba Mon Sep 17 00:00:00 2001 From: Krzysztof Karas Date: Mon, 23 Jan 2023 14:48:08 +0100 Subject: [PATCH] config: detect uuid_generate_sha1() function definition Some systems (like FreeBSD and Centos 7) do not have this method in their system libraries. To let bdev UUIDs be generated with SHA1, detect if this symbol is present. Otherwise, define a new symbol that indicates a need to use internal implementation of uuid_generate_sha1() method. Change-Id: I3a3617d1b413af7f5af487b2eb6f3fe33f58a95e Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16413 Reviewed-by: Artur Paszkiewicz Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Konrad Sztyber --- CONFIG | 3 +++ configure | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CONFIG b/CONFIG index 0f235136a..8abbf58c5 100644 --- a/CONFIG +++ b/CONFIG @@ -204,6 +204,9 @@ CONFIG_IDXD_KERNEL=n # arc4random is available in stdlib.h CONFIG_HAVE_ARC4RANDOM=n +# uuid_generate_sha1 is available in uuid/uuid.h +CONFIG_HAVE_UUID_GENERATE_SHA1=n + # Is DPDK using libbsd? CONFIG_HAVE_LIBBSD=n diff --git a/configure b/configure index 5935ff50e..f5557ce2c 100755 --- a/configure +++ b/configure @@ -1109,6 +1109,11 @@ if echo -e '#include \nint main(void) { arc4random(); return 0; }\n' \ CONFIG[HAVE_ARC4RANDOM]="y" fi +if echo -e '#include \nint main(void) { uuid_generate_sha1(NULL, NULL, NULL, 0); return 0; }\n' \ + | "${BUILD_CMD[@]}" - -luuid 2> /dev/null; then + CONFIG[HAVE_UUID_GENERATE_SHA1]="y" +fi + if [[ "${CONFIG[OCF]}" = "y" ]]; then echo "WARNING: OCF - bdev_ocf is deprecated." # If OCF_PATH is a file, assume it is a library and use it to compile with