Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cmake): fixed shared libs and pkg config files #1842

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Aug 28, 2024

  1. userspace: Extend CFLAGS of libscap.pc and libsinsp.pc.

    This is to so that includes work whether using e.g. #include <scap.h>
    or #include <libscap/scap.h>, and likewise for libsinp.
    
    * userspace/libsinsp/libsinsp.pc.in (Cflags): Add include directive
    for falcosecurity/driver.
    * userspace/libscap/libscap.pc.in: Likewise.  Also add include
    directive for uthash.
    
    Signed-off-by: Maxim Cournoyer <[email protected]>
    Apteryks authored and FedeDP committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    fc6a5cb View commit details
    Browse the repository at this point in the history
  2. build: Install the pman library and its header.

    This is needed when linking to the static scap library, as its
    pkg-config file contains an '-lpman' directive.
    
    * userspace/libpman/CMakeLists.txt: New install target.
    
    Signed-off-by: Maxim Cournoyer <[email protected]>
    Apteryks authored and FedeDP committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    b062f15 View commit details
    Browse the repository at this point in the history
  3. libscap: Guard against install_lib_link_libraries-NOTFOUND.

    Previously, an erroneous -linstall_lib_link_libraries-NOTFOUND
    directive could be added to the configured libscap.pc pkg-config file.
    
    * cmake/modules/libscap.cmake: Ensure ${install_lib_link_library} is
    true.
    
    Signed-off-by: Maxim Cournoyer <[email protected]>
    Apteryks authored and FedeDP committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    369db06 View commit details
    Browse the repository at this point in the history
  4. build: Fix shared library build.

    * driver/CMakeLists.txt (DRIVER_SOURCES): Add missing headers.
    * userspace/libscap/engine/gvisor/CMakeLists.txt
    [BUILD_SHARED_LIBS]: Add missing include directories.
    * test/libscap/CMakeLists.txt (LIBSCAP_TESTS_LIBRARIES): Add
    ${PROTOBUF_LIB}.
    
    Fixes: falcosecurity#1820
    Signed-off-by: Maxim Cournoyer <[email protected]>
    Apteryks authored and FedeDP committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    906d3c2 View commit details
    Browse the repository at this point in the history
  5. 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.
    
    * userspace/libscap/libscap.pc.in (prefix): Set directly to
    CMAKE_INSTALL_PREFIX.
    (Libs): Add -L{libdir}/@LIBS_PACKAGE_NAME@/libscap.
    * userspace/libsinsp/CMakeLists.txt: Separate libraries into
    pkg-config Requires and Requires.private lists.  Do not infer from
    installable targets.
    * userspace/libsinsp/libsinsp.pc.in (Requires): Add
    @LIBSINSP_REQUIRES@.
    (Requires.private): New field.
    (Libs): Replace @SINSP_PKG_CONFIG_LIBDIRS@ and @SINSP_PKG_CONFIG_LIBS@
    with @LIBSINSP_LINK_FLAGS@.
    (Cflags): Remove @SINSP_PKG_CONFIG_INCLUDES@ and
    @SINSP_PKG_CONFIG_INCLUDES@/driver.  Add
    -I${includedir}/@LIBS_PACKAGE_NAME@/driver.
    
    Signed-off-by: Maxim Cournoyer <[email protected]>
    Apteryks authored and FedeDP committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    f74a20d View commit details
    Browse the repository at this point in the history