summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2021-12-10 01:35:03 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2021-12-10 01:35:59 -0500
commit18850c5c889bd48e0caeddf719bcf05c2029b95f (patch)
tree386ac9d67d842bd8dd606e21f5365e78321f37d5 /src/CMakeLists.txt
parent8a535e7e064b0c33c3b60a92df88b349d79b94c2 (diff)
downloadlighttpd-git-18850c5c889bd48e0caeddf719bcf05c2029b95f.tar.gz
[build] check getxattr before attr_get and -lattr
check getxattr before attr_get and -lattr; do not link with -lattr if getxattr is available from glibc (modern glibc systems do not require libattr-devel build dependency)
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9aa9b339..67b3821c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -272,9 +272,13 @@ endmacro(XCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
if(WITH_XATTR)
check_include_files("sys/types.h;sys/xattr.h" HAVE_SYS_XATTR_H)
check_function_exists(getxattr HAVE_XATTR)
- check_include_files("sys/types.h;attr/attributes.h" HAVE_ATTR_ATTRIBUTES_H)
- if(HAVE_ATTR_ATTRIBUTES_H)
- check_library_exists(attr attr_get "" HAVE_XATTR)
+ check_include_files("sys/types.h;sys/extattr.h" HAVE_SYS_EXTATTR_H)
+ check_function_exists(extattr_get_file HAVE_EXTATTR)
+ if(NOT HAVE_XATTR AND NOT HAVE_EXTATTR)
+ check_include_files("sys/types.h;attr/attributes.h" HAVE_ATTR_ATTRIBUTES_H)
+ if(HAVE_ATTR_ATTRIBUTES_H)
+ check_library_exists(attr attr_get "" HAVE_XATTR)
+ endif()
endif()
else()
unset(HAVE_ATTR_ATTRIBUTES_H)