From fadd87ed15b5f7bf6e7aaed1263e2f2d661a623d Mon Sep 17 00:00:00 2001 From: Niclas Rosenvik Date: Wed, 14 Apr 2021 08:09:17 +0000 Subject: 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 Reviewed-by: Joerg Bornemann --- src/network/kernel/qnetworkinterface_unix.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/network/kernel/qnetworkinterface_unix.cpp') diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp index 5b34b99caaa..b1e351a2899 100644 --- a/src/network/kernel/qnetworkinterface_unix.cpp +++ b/src/network/kernel/qnetworkinterface_unix.cpp @@ -111,7 +111,11 @@ uint QNetworkInterfaceManager::interfaceIndexFromName(const QString &name) uint id = 0; if (qt_safe_ioctl(socket, SIOCGIFINDEX, &req) >= 0) +# if QT_CONFIG(ifr_index) + id = req.ifr_index; +# else id = req.ifr_ifindex; +# endif qt_safe_close(socket); return id; #else @@ -130,7 +134,11 @@ QString QNetworkInterfaceManager::interfaceNameFromIndex(uint index) int socket = qt_safe_socket(AF_INET, SOCK_STREAM, 0); if (socket >= 0) { memset(&req, 0, sizeof(ifreq)); +# if QT_CONFIG(ifr_index) + req.ifr_index = index; +# else req.ifr_ifindex = index; +# endif if (qt_safe_ioctl(socket, SIOCGIFNAME, &req) >= 0) { qt_safe_close(socket); @@ -216,7 +224,7 @@ static QNetworkInterfacePrivate *findInterface(int socket, QList= 0) -# if defined(Q_OS_HAIKU) +# if QT_CONFIG(ifr_index) ifindex = req.ifr_index; # else ifindex = req.ifr_ifindex; -- cgit v1.2.3