qt5base-lts/cmake/FindGSSAPI.cmake
Niclas Rosenvik fadd87ed15 Add Solaris support in cmake build
Add SOLARIS cmake platform definition.
Add settings for QT_DEFAULT_MKSPEC so that qplatformdefs.h can be found.
Solaris has its gssapi symbols in libgss.
Solaris supports @ORIGIN.

Solaris ld does not support --dynamic-list needed for reduce relocations.
Make solaris fail the reduce relocation test.

getauxval is specific to GNU libc and some other libc implementations on
Linux but sys/auxv.h is not. The bootstrap uses sys/aux.h as the only
indication for getauxval. This breaks builds on Solaris, so only make
sys/auxv.h an indicator for getauxval on linux or glibc based systems.

Solaris uses X11 so add it to the X11_SUPPORTED list.

Solaris network libraries for sockets etc are in socket and nsl.
ifreq does not have a member ifr_ifindex on Solaris, it uses
ifr_index. Add test to check if ifr_index is a member of ifreq.
The first struct in the in_addr union on solaris is defined as four
uint8_t, therefore four arguments are needed for its initializer list.

Change-Id: Ieed4c1bbac8559a7ae1db9c4e1e91f609f150270
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-04-21 20:57:04 +00:00

41 lines
1.3 KiB
CMake

find_package(PkgConfig QUIET)
pkg_check_modules(PC_GSSAPI QUIET krb5-gssapi)
find_path(GSSAPI_INCLUDE_DIRS
NAMES gssapi/gssapi.h
HINTS ${PC_GSSAPI_INCLUDEDIR}
PATH_SUFFIXES gssapi)
find_library(GSSAPI_LIBRARIES
NAMES
GSS # framework
gss # solaris
gssapi_krb5
HINTS ${PC_GSSAPILIBDIR}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GSSAPI DEFAULT_MSG GSSAPI_LIBRARIES GSSAPI_INCLUDE_DIRS)
if(GSSAPI_FOUND AND NOT TARGET GSSAPI::GSSAPI)
if(GSSAPI_LIBRARIES MATCHES "/([^/]+)\\.framework$")
add_library(GSSAPI::GSSAPI INTERFACE IMPORTED)
set_target_properties(GSSAPI::GSSAPI PROPERTIES
INTERFACE_LINK_LIBRARIES "${GSSAPI_LIBRARIES}")
else()
add_library(GSSAPI::GSSAPI UNKNOWN IMPORTED)
set_target_properties(GSSAPI::GSSAPI PROPERTIES
IMPORTED_LOCATION "${GSSAPI_LIBRARIES}")
endif()
set_target_properties(GSSAPI::GSSAPI PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GSSAPI_INCLUDE_DIRS}")
endif()
mark_as_advanced(GSSAPI_INCLUDE_DIRS GSSAPI_LIBRARIES)
include(FeatureSummary)
set_package_properties(GSSAPI PROPERTIES
DESCRIPTION "Generic Security Services Application Program Interface")