-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libsinsp: Refine pkg-config file generation.
The generated pkg-config file now makes use of pkg-config Requires and Requires.static fields, which should reduce over-linking when linking to shared libraries. * cmake/modules/BuildPkgConfigDependencies.cmake (add_pkgconfig_library): Add debug messages and fix an issue where IN_LIST had no effect. * cmake/modules/libscap.cmake: Add json, pman, protobuf and zlib to ignored link dependencies, since these are now recorded as Requires in the pkg-config file. * userspace/libscap/libscap.pc.in (prefix): Set directly to CMAKE_INSTALL_PREFIX. (Requires, Requires.private): New fields. * userspace/libsinsp/CMakeLists.txt: Separate libraries into pkg-config Requires and Requires.private lists. Add the pkg-config requirements to the ignored link dependencies, since these are now recorded as Requires in the pkg-config file. * userspace/libsinsp/libsinsp.pc.in (Requires): Add @LIBSINSP_REQUIRES@. (Requires.private): New field. (Libs): Remove -lsinsp, automatically computed in SINSP_PKG_CONFIG_LIBS. Signed-off-by: Maxim Cournoyer <[email protected]>
- Loading branch information
Showing
5 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
prefix=${pcfiledir}/../.. | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@LIBS_PACKAGE_NAME@ | ||
|
||
Name: libscap | ||
Description: lib for System CAPture | ||
Version: @FALCOSECURITY_LIBS_VERSION@ | ||
|
||
# Note: jsoncpp and protobuf are required by scap_engine_gvisor, which | ||
# currently lacks its own pkg-config file. Similarly, libelf is | ||
# required by scap_engine_bpf. | ||
Requires: jsoncpp libelf libpman protobuf | ||
Requires.private: zlib | ||
Libs: -L${libdir} @LIBSCAP_LINK_LIBDIRS_FLAGS@ @LIBSCAP_LINK_LIBRARIES_FLAGS@ | ||
Cflags: -I${includedir} -I${includedir}/libscap -I${includedir}/driver -I@UTHASH_INCLUDE@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
prefix=${pcfiledir}/../.. | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@LIBS_PACKAGE_NAME@ | ||
|
||
Name: libsinsp | ||
Description: lib for System INSPection | ||
Version: @FALCOSECURITY_LIBS_VERSION@ | ||
|
||
Requires: libscap | ||
Libs: -L${libdir} -lsinsp @SINSP_PKG_CONFIG_LIBDIRS@ @SINSP_PKG_CONFIG_LIBS@ | ||
Requires: libscap @LIBSINSP_REQUIRES@ | ||
Requires.private: @LIBSINSP_REQUIRES_PRIVATE@ | ||
Libs: -L${libdir} @SINSP_PKG_CONFIG_LIBDIRS@ @SINSP_PKG_CONFIG_LIBS@ | ||
Cflags: -I${includedir} -I${includedir}/libsinsp -I${includedir}/driver @SINSP_PKG_CONFIG_INCLUDES@ |