Blob Blame History Raw
From 4982aa3da7ae00cd3656db7f47ac3706e85ab7d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
Date: Thu, 23 Jan 2020 16:24:37 +0100
Subject: [PATCH] Fix FindACL.cmake

find_path parameter `NAMES` values should be separated. According to
https://cmake.org/cmake/help/latest/command/find_path.html it should be:
`NAMES name1 [name2 ...]`

find_library parameter `NAMES` either should not contain `lib` or should
contain both `lib` and `.so.` The documentation at
https://cmake.org/cmake/help/latest/command/find_library.html says: Each
library name given to the `NAMES` option is first considered as a
library file name and then considered with platform-specific prefixes
(e.g. `lib`) and suffixes (e.g. `.so`).

This bug caused that even if cmake reported that libacl was found, the
library wasn't linked to the built `libopenscap.so`. Also,
`HAVE_ACL_EXTENDED_FILE`, `HAVE_ACL_LIBACL_H` and `HAVE_SYS_ACL_H` were
undefined in `config.h`, which caused some guarded pieces of code to not
compile, which means features missing.
---
 cmake/FindACL.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmake/FindACL.cmake b/cmake/FindACL.cmake
index 2d4a3027c..a41f2c13a 100644
--- a/cmake/FindACL.cmake
+++ b/cmake/FindACL.cmake
@@ -12,13 +12,13 @@ libfind_pkg_check_modules(ACL_PKGCONF libacl)
 
 # Include dir
 find_path(ACL_INCLUDE_DIR
-	NAMES "acl/libacl.h sys/libacl.h"
+	NAMES "acl/libacl.h" "sys/libacl.h"
 	PATHS ${ACL_PKGCONF_INCLUDE_DIRS}
 )
 
 # Finally the library itself
 find_library(ACL_LIBRARY
-	NAMES libacl
+	NAMES acl
 	PATHS ${ACL_PKGCONF_LIBRARY_DIRS}
 )