如何在Solaris 10上构建Qt 5.2?

max*_*zig 8 solaris qt5

Qt页面没有列出Solaris的预编译Qt 5软件包.搜索,它似乎也没有包含在流行的软件包存储库OpenCSW中.一些谷歌点击建议在Solaris下构建Qt 5涉及Solaris 10下的一些工作.

因此我的问题是:如何在Solaris 10下构建Qt 5.2?

max*_*zig 10

基本上它是:

cd qt-everywhere-opensource-src-5.2.0
./configure -prefix $MY_PREFIX -opensource -confirm-license -nomake tests \
    -R /opt/csw/lib/64 -R /opt/csw/X11/lib/64 -qt-xcb -platform solaris-g++-64 \
    -verbose
gmake -j16
gmake -j16 install
Run Code Online (Sandbox Code Playgroud)

加上一些调整,因为Qt 5似乎还没有在Solaris上使用.

调整

获取来源

wget http://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz
md5sum qt-everywhere-opensource-src-5.2.0.tar.gz
228b6384dfd7272de00fd8b2c144fecd  qt-everywhere-opensource-src-5.2.0.tar.gz
Run Code Online (Sandbox Code Playgroud)

如果系统没有,md5sum你可以使用openssl md5 filename.

安装依赖项

我建议使用OpenCSW,因为我们需要一些依赖来构建Qt.最重要的是:

CSWlibxcbdevel
CSWlibicu-dev    # soft-dependency
CSWgcc4g++
CSWgmake
Run Code Online (Sandbox Code Playgroud)

我建议使用GCC编译Qt.我不知道使用Solaris Studio中的C++编译器有什么好处.相反,对于许多用例,此编译器的C++/STL支持级别可能不足.

设置环境

确保您的环境干净.这意味着它/opt/csw/bin首先出现并且没有设置LD_LIBRAYR_PATH*变量.

To simplify things it is probably a good idea that some directories are removed from PATH. For example such that no cc, CC commands from a Solaris Studio installation are accidentally picked up (e.g. during the compile of a bundled 3rd party component.

Adjust the specs

The software under /usr/sfw is just too outdated. /opt/csw from OpenCSW is a better replacement. Then the X-Open version is not sufficient for some used system functions.

--- a/qtbase/mkspecs/solaris-g++-64/qmake.conf
+++ b/qtbase/mkspecs/solaris-g++-64/qmake.conf
@@ -35,7 +35,7 @@ QMAKE_LEX               = flex
 QMAKE_LEXFLAGS          =
 QMAKE_YACC              = yacc
 QMAKE_YACCFLAGS         = -d
-QMAKE_CFLAGS            = -m64 -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
+QMAKE_CFLAGS            = -m64 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__
 QMAKE_CFLAGS_DEPS       = -M
 QMAKE_CFLAGS_WARN_ON    = -Wall -W
 QMAKE_CFLAGS_WARN_OFF   = -w
@@ -58,8 +58,8 @@ QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB
 QMAKE_CXXFLAGS_YACC     = $$QMAKE_CFLAGS_YACC
 QMAKE_CXXFLAGS_THREAD   = $$QMAKE_CFLAGS_THREAD

-QMAKE_INCDIR            = /usr/sfw/include
-QMAKE_LIBDIR            = /usr/sfw/lib/64
+QMAKE_INCDIR            = /opt/csw/include /opt/csw/X11/include
+QMAKE_LIBDIR            = /opt/csw/lib/64 /opt/csw/X11/lib/64
 QMAKE_INCDIR_X11        = /usr/openwin/include
 QMAKE_LIBDIR_X11        = /usr/openwin/lib/64
 QMAKE_INCDIR_OPENGL     = /usr/openwin/include
Run Code Online (Sandbox Code Playgroud)

Fix the shell

Solaris comes with a /bin/sh that violates POSIX to an extend such that Qt's configure scripts and even shell-code in qmake-generated code fails.

POSIX没有指定/bin/sh必须符合它只是指定系统必须具有"某处"可用的符合要求的shell.在Solaris上它是例如/usr/xpg4/bin/sh.获得一致的shell的可移植方法是在getconf CS_PATH... 返回的目录中搜索它.

无论如何,我对Solaris的选择就是使用/usr/bin/bash:

无论如何,我对Solaris的选择就是使用/usr/bin/bash:

--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/usr/bin/bash
 #############################################################################
 ##
 ## Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
--- a/qtbase/configure
+++ b/qtbase/configure
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/bash
 #############################################################################
 ##
 ## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
@@ -6892,7 +6892,7 @@ fi'`
     echo "$CONFIG_STATUS" | grep '\-confirm\-license' >/dev/null 2>&1 || CONFIG_STATUS="$CONFIG_STATUS -confirm-license"

     [ -f "$outpath/config.status" ] && rm -f "$outpath/config.status"
-    echo "#!/bin/sh" > "$outpath/config.status"
+    echo "#!/usr/bin/bash" > "$outpath/config.status"
     [ -n "$PKG_CONFIG_SYSROOT_DIR" ] && \
         echo "export PKG_CONFIG_SYSROOT_DIR=$PKG_CONFIG_SYSROOT_DIR" >> "$outpath/config.status"
     [ -n "$PKG_CONFIG_LIBDIR" ] && \
--- a/qtbase/qmake/generators/makefile.cpp
+++ b/qtbase/qmake/generators/makefile.cpp
@@ -2306,6 +2306,10 @@ MakefileGenerator::writeHeader(QTextStream &t)
     if (ofile.lastIndexOf(Option::dir_sep) != -1)
         ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1);
     t << "MAKEFILE      = " << ofile << endl << endl;
+
+    t << "# custom mod because Solaris /bin/sh is such a standard-violating choice\n"
+      << "#   - gs, 2013-12-23" << endl;
+    t << "SHELL         = /usr/bin/bash" << endl << endl;
 }

 QList<MakefileGenerator::SubTarget*>
Run Code Online (Sandbox Code Playgroud)

修复ICU测试

Solaris 10附带了一个过时的libicu - 缺少Qt 5需要的功能.因此,我们只是扩展了icu-test.然后,如果我们安装最近的libicu,例如通过OpenCSW,则不构建ICU支持或正确构建.

--- a/qtbase/config.tests/unix/icu/icu.cpp
+++ b/qtbase/config.tests/unix/icu/icu.cpp
@@ -43,6 +43,16 @@
 #include <unicode/ucol.h>
 #include <unicode/ustring.h>

+// for testing if ucal_clone is there (i.e. if we have libicu >= 4.0)
+#include <unicode/ucal.h>
+
+static UCalendar *ucp(UCalendar *i)
+{
+    UErrorCode status = U_ZERO_ERROR;
+    UCalendar *r = ucal_clone(i, &status);
+    return r;
+}
+
 int main(int, char **)
 {
     UErrorCode status = U_ZERO_ERROR;
@@ -50,5 +60,10 @@ int main(int, char **)
     if (U_FAILURE(status))
         return 0;
     ucol_close(collator);
+
+    UCalendar *cal = ucal_open(0, -1, "C", UCAL_GREGORIAN, &status);
+    UCalendar *x = ucp(cal);
+    ucal_close(x);
+
     return 0;
 }
Run Code Online (Sandbox Code Playgroud)

修复捆绑的pcre

或许可以通过OpenCSW安装libpcre.

--- a/qtbase/src/3rdparty/pcre/pcre_compile.c
+++ b/qtbase/src/3rdparty/pcre/pcre_compile.c
@@ -66,6 +66,8 @@ COMPILE_PCREx macro will already be appropriately set. */
 #endif


+#include <stdint.h>
+
 /* Macro for setting individual bits in class bitmaps. */

 #define SETBIT(a,b) a[(b)/8] |= (1 << ((b)&7))
Run Code Online (Sandbox Code Playgroud)

修复sha3

至少在Solaris 10/Sparc的功能fromBytesToWordfromWordtoBytes使用由代码,从而:

--- a/qtbase/src/3rdparty/sha3/KeccakF-1600-opt64.c
+++ b/qtbase/src/3rdparty/sha3/KeccakF-1600-opt64.c
@@ -324,7 +324,7 @@ static void KeccakPermutation(unsigned char *state)
     KeccakPermutationOnWords((UINT64*)state);
 }

-#if 0 // Unused in the Qt configuration
+#if 1 // Unused in the Qt configuration
 static void fromBytesToWord(UINT64 *word, const UINT8 *bytes)
 {
     unsigned int i;
@@ -445,7 +445,7 @@ static void KeccakAbsorb(unsigned char *state, const unsigned char *data, unsign
 #endif
 }

-#if 0 // Unused in the Qt configuration
+#if 1 // Unused in the Qt configuration
 static void fromWordToBytes(UINT8 *bytes, const UINT64 word)
 {
     unsigned int i;
Run Code Online (Sandbox Code Playgroud)

包含/类型/用法修复

The uname() function is activated via a CPP construct on Solaris and is declared in that header:

--- a/qtbase/src/corelib/io/qfileselector.cpp
+++ b/qtbase/src/corelib/io/qfileselector.cpp
@@ -51,6 +51,8 @@
 #include <QtCore/QLocale>
 #include <QtCore/QDebug>

+#include <sys/utsname.h>
+
 QT_BEGIN_NAMESPACE

 //Environment variable to allow tooling full control of file selectors
Run Code Online (Sandbox Code Playgroud)

Under Solaris parent is unused in that code-path and the code gets compiled with -Werror ...

--- a/qtbase/src/corelib/io/qfilesystemwatcher.cpp
+++ b/qtbase/src/corelib/io/qfilesystemwatcher.cpp
@@ -77,6 +77,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine(QObject
 #elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
     return QKqueueFileSystemWatcherEngine::create(parent);
 #else
+    (void)parent;
     return 0;
 #endif
 }
Run Code Online (Sandbox Code Playgroud)

Under Solaris uid_t has an 'unexpected' sign (-> Werror). Casting it to ssize_t should be a portable and safe choice:

--- a/qtbase/src/corelib/io/qstandardpaths_unix.cpp
+++ b/qtbase/src/corelib/io/qstandardpaths_unix.cpp
@@ -132,7 +132,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
         }
         // "The directory MUST be owned by the user"
         QFileInfo fileInfo(xdgRuntimeDir);
-        if (fileInfo.ownerId() != myUid) {
+        if (fileInfo.ownerId() != ssize_t(myUid)) {
             qWarning("QStandardPaths: wrong ownership on runtime directory %s, %d instead of %d", qPrintable(xdgRuntimeDir),
                      fileInfo.ownerId(), myUid);
             return QString();
Run Code Online (Sandbox Code Playgroud)

Similar issue with threading code (Werror because of sign-mismatch in pointer cast). Casting to size_t should be a portable safe choice:

--- a/qtbase/src/corelib/thread/qthread_unix.cpp
+++ b/qtbase/src/corelib/thread/qthread_unix.cpp
@@ -231,7 +231,7 @@ QThreadData *QThreadData::current()
         }
         data->deref();
         data->isAdopted = true;
-        data->threadId = (Qt::HANDLE)pthread_self();
+        data->threadId = (Qt::HANDLE)((size_t)pthread_self());
         if (!QCoreApplicationPrivate::theMainThread)
             QCoreApplicationPrivate::theMainThread = data->thread;
     }
@@ -314,7 +314,7 @@ void *QThreadPrivate::start(void *arg)
             thr->d_func()->setPriority(QThread::Priority(thr->d_func()->priority & ~ThreadPriorityResetFlag));
         }

-        data->threadId = (Qt::HANDLE)pthread_self();
+        data->threadId = (Qt::HANDLE)((size_t)pthread_self());
         set_thread_data(data);

         data->ref();
@@ -393,7 +393,7 @@ void QThreadPrivate::finish(void *arg)
 Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
 {
     // requires a C cast here otherwise we run into trouble on AIX
-    return (Qt::HANDLE)pthread_self();
+    return (Qt::HANDLE)((size_t)pthread_self());
 }

 #if defined(QT_LINUXBASE) && !defined(_SC_NPROCESSORS_ONLN)
Run Code Online (Sandbox Code Playgroud)

The struct in_addr has a struct as first attribute on Solaris, thus gives a warning with GCC when initializing with {0} - thus, yields an error during Qt-compile:

--- a/qtbase/src/network/socket/qnativesocketengine_unix.cpp
+++ b/qtbase/src/network/socket/qnativesocketengine_unix.cpp
@@ -63,6 +63,7 @@
 #endif

 #include <netinet/tcp.h>
+#include <string.h>

 QT_BEGIN_NAMESPACE

@@ -737,7 +738,8 @@ QNetworkInterface QNativeSocketEnginePrivate::nativeMulticastInterface() const
         return QNetworkInterface::interfaceFromIndex(v);
     }

-    struct in_addr v = { 0 };
+    struct in_addr v;
+    memset(&v, 0, sizeof(struct in_addr));
     QT_SOCKOPTLEN_T sizeofv = sizeof(v);
     if (::getsockopt(socketDescriptor, IPPROTO_IP, IP_MULTICAST_IF, &v, &sizeofv) == -1)
         return QNetworkInterface();
Run Code Online (Sandbox Code Playgroud)

The header comment of X11/Xutil.h lists X11/Xutil.h as dependency, and indeed, without that include some declarations are missing under Solaris.

--- a/qtbase/src/plugins/platforms/xcb/qxcbmime.cpp
+++ b/qtbase/src/plugins/platforms/xcb/qxcbmime.cpp
@@ -46,6 +46,7 @@
 #include <QtCore/QBuffer>
 #include <qdebug.h>

+#include <X11/Xlib.h>
 #include <X11/Xutil.h>

 #undef XCB_ATOM_STRING
Run Code Online (Sandbox Code Playgroud)

The X11/extensions/XIproto.h is not C++-safe under Solaris. That means it contains struct members names class. Fortunately, the header does not seem to be used in that code.

--- a/qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp
+++ b/qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp
@@ -43,7 +43,7 @@

 #include <QtCore/QByteArray>

-#include <X11/extensions/XIproto.h>
+//#include <X11/extensions/XIproto.h>

 QT_BEGIN_NAMESPACE
 /* Implementation of http://standards.freedesktop.org/xsettings-spec/xsettings-0.5.html */
Run Code Online (Sandbox Code Playgroud)

The pow() function has some overloads as specified in the C++ standard which introduce ambiguities under Solaris. Fixing the types like this should be portable and safe:

--- a/qtdeclarative/src/qml/jsruntime/qv4globalobject.cpp
+++ b/qtdeclarative/src/qml/jsruntime/qv4globalobject.cpp
@@ -534,7 +534,7 @@ ReturnedValue GlobalFunctions::method_parseInt(CallContext *ctx)
     }

     if (overflow) {
-        double result = (double) v_overflow * pow(R, overflow_digit_count);
+        double result = (double) v_overflow * pow(double(R), int(overflow_digit_count));
         result += v;
         return Encode(sign * result);
     } else {
Run Code Online (Sandbox Code Playgroud)

Under Solaris, alloca needs another header:

--- a/qtdeclarative/src/qml/jsruntime/qv4stringobject.cpp
+++ b/qtdeclarative/src/qml/jsruntime/qv4stringobject.cpp
@@ -73,6 +73,11 @@
 #  include <windows.h>
 #endif

+
+#if OS(SOLARIS)
+#include <alloca.h>
+#endif
+
 using namespace QV4;

 DEFINE_MANAGED_VTABLE(StringObject);
Run Code Online (Sandbox Code Playgroud)

Fix deep mkdir

Qt does a 'deep' mkdir() (e.g. something like mkdir -p for e.g. creating a directory hierarchy, e.g. ~/.config/company/product. The Qt 5.2 algorithm may abort too soon on Solaris if an existing directory is located inside a non-writable NFS mounted parent - because in that case Solaris returns EACCESS instead of EEXIST.

--- a/qtbase/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/qtbase/src/corelib/io/qfilesystemengine_unix.cpp
@@ -579,6 +579,11 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
                         // on the QNet mountpoint returns successfully and reports S_IFDIR.
                         || errno == ENOENT
 #endif
+#if defined(Q_OS_SOLARIS)
+                        // On Solaris 10, mkdir returns EACCESS on a directory which exists
+                        // inside an NFS mount ...
+                        || errno == EACCES
+#endif
                     ) {
                         QT_STATBUF st;
                         if (QT_STAT(chunk.constData(), &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR)
Run Code Online (Sandbox Code Playgroud)

Temporary files

Solaris also does not have mkdtemp():

--- a/qtbase/src/corelib/io/qtemporarydir.cpp
+++ b/qtbase/src/corelib/io/qtemporarydir.cpp
@@ -52,7 +52,7 @@
 #endif

 #include <stdlib.h> // mkdtemp
-#if defined(Q_OS_QNX) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID)
+#if defined(Q_OS_QNX) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID) || defined(Q_OS_SOLARIS)
 #include <private/qfilesystemengine_p.h>
 #endif

@@ -96,7 +96,7 @@ static QString defaultTemplateName()

 static char *q_mkdtemp(char *templateName)
 {
-#if defined(Q_OS_QNX ) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID)
+#if defined(Q_OS_QNX ) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID) || defined(Q_OS_SOLARIS)
     static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

     const size_t length = strlen(templateName);
Run Code Online (Sandbox Code Playgroud)

Pthreads

Solaris does not have pthread_get_stacksize_np (the _np suffix stands for non-portable).

Solaris has another function for getting stack-address/size values. My attempt:

--- a/qtdeclarative/src/qml/jsruntime/qv4engine.cpp
+++ b/qtdeclarative/src/qml/jsruntime/qv4engine.cpp
@@ -73,6 +73,11 @@
 #include "qv4isel_moth_p.h"

 #if USE(PTHREADS)
+
+#if OS(SOLARIS)
+#include <thread.h>
+#endif
+
 #  include <pthread.h>
 #endif

@@ -103,6 +108,11 @@ quintptr getStackLimit()
     } else
         size = pthread_get_stacksize_np(thread_self);
     stackLimit -= size;
+#  elif OS(SOLARIS)
+    stack_t ss;
+    int r = thr_stksegment(&ss);
+    (void)r;
+    stackLimit = reinterpret_cast<quintptr>(ss.ss_sp);
 #  else
     void* stackBottom = 0;
     pthread_attr_t attr;


--- a/qtdeclarative/src/qml/jsruntime/qv4mm.cpp
+++ b/qtdeclarative/src/qml/jsruntime/qv4mm.cpp
@@ -67,6 +67,11 @@
 #include <sys/storage.h>   // __tls()
 #endif

+#if OS(SOLARIS)
+#include <thread.h>
+#include <pthread.h>
+#endif
+
 QT_BEGIN_NAMESPACE

 using namespace QV4;
@@ -218,6 +223,11 @@ MemoryManager::MemoryManager()
 #  if OS(DARWIN)
     void *st = pthread_get_stackaddr_np(pthread_self());
     m_d->stackTop = static_cast<quintptr *>(st);
+#  elif OS(SOLARIS)
+    stack_t ss;
+    int r = thr_stksegment(&ss);
+    (void)r;
+    m_d->stackTop = static_cast<quintptr *>(ss.ss_sp) + ss.ss_size/sizeof(quintptr);
 #  else
     void* stackBottom = 0;
     pthread_attr_t attr;
Run Code Online (Sandbox Code Playgroud)

I recommend a careful review of that code because my Qt-code does not use that Qt-module, thus, I did not test it much.

XKB extension

Qt 5 seems to heavily rely on the XKB extension. It seems that you can't build Qt 5 without XKB support. It comes bundled with xkbcommon.

First, make sure that it finds the right XKB database. Otherwise keyboard input does not work at all in your Qt programs!

Solaris does not have the default value /usr/share/X11/xkb. It has instead:

/usr/X11/lib/X11/xkb
/usr/openwin/lib/X11/xkb
Run Code Online (Sandbox Code Playgroud)

But I havn't had luck with those - xkbcommon simply could not find any components with those.

I ended up with copying /usr/share/X11/xkb from a cygwin distribution to a custom path and configuring that as XKB database.

Whatever XKB you choose you have to configure it:

--- a/qtbase/src/3rdparty/xkbcommon.pri
+++ b/qtbase/src/3rdparty/xkbcommon.pri
@@ -1,7 +1,12 @@
 QMAKE_CFLAGS += -std=gnu99 -w
 INCLUDEPATH += $$PWD/xkbcommon $$PWD/xkbcommon/src $$PWD/xkbcommon/src/xkbcomp

+solaris-g++-64 {
+DEFINES += DFLT_XKB_CONFIG_ROOT='\\"/MY/XKB/CHOICE\\"'
+} else {
 DEFINES += DFLT_XKB_CONFIG_ROOT='\\"/usr/share/X11/xkb\\"'
+}

 ### RMLVO names can be overwritten with environmental variables (See libxkbcommon documentation)
 DEFINES += DEFAULT_XKB_RULES='\\"evdev\\"'
Run Code Online (Sandbox Code Playgroud)

For testing it also make sense to check for NULL values in error message parameters:

--- a/qtbase/src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c
+++ b/qtbase/src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c
@@ -68,8 +68,11 @@ text_v1_keymap_new_from_names(struct xkb_keymap *keymap,
         log_err(keymap->ctx,
                 "Couldn't look up rules '%s', model '%s', layout '%s', "
                 "variant '%s', options '%s'\n",
-                rmlvo->rules, rmlvo->model, rmlvo->layout, rmlvo->variant,
-                rmlvo->options);
+                rmlvo->rules, rmlvo->model,
+                rmlvo->layout ? rmlvo->layout : "(NULL)",
+                rmlvo->variant ? rmlvo->variant : "(NULL)",
+                rmlvo->options ? rmlvo->options : "(NULL)"
+                );
         return false;
     }
Run Code Online (Sandbox Code Playgroud)

There is also the possibility that your XServer does not even support the XKB extension. Again, I don't know if Qt 5 can be configured with disabled-XKB-support under X.

You can check your X-server like this:

xprop -root | grep xkb
Run Code Online (Sandbox Code Playgroud)

Or call a random xkb-program, e.g.:

xkbvleds
Run Code Online (Sandbox Code Playgroud)

Such call should not result in an error like:

Fatal Error: Server doesn't support a compatible XKB
Run Code Online (Sandbox Code Playgroud)

In case your XServer does not have XKB - Qt programs are likely to segfault. Qt does not seem to really check for XKB support. It does not seem to have a fallback mechanism when XKB is not usable.

Examples

Some examples fail because of module quick not being found:

--- a/qtconnectivity/examples/bluetooth/scanner/scanner.pro
+++ b/qtconnectivity/examples/bluetooth/scanner/scanner.pro
@@ -1,4 +1,4 @@
-QT = core bluetooth quick
+QT = core bluetooth # quick
 SOURCES += qmlscanner.cpp

 TARGET = qml_scanner
diff --git a/qtconnectivity/examples/nfc/poster/poster.pro b/qtconnectivity/examples/nfc/poster/poster.pro
index d108b2a..d0d0659 100644
--- a/qtconnectivity/examples/nfc/poster/poster.pro
+++ b/qtconnectivity/examples/nfc/poster/poster.pro
@@ -1,4 +1,4 @@
-QT += qml quick network nfc widgets
+QT += qml network nfc widgets # quick

 SOURCES += \
     qmlposter.cpp
Run Code Online (Sandbox Code Playgroud)

They are also built without.

make install

A gmake install surprisingly triggers the compilation of several modules not yet compiled. Thus it make sense to execute it in parallel:

$ gmake -j16 install
Run Code Online (Sandbox Code Playgroud)

(assuming that your system has a sufficient number of cores)

QtHelp

The bundled QtHelp module is not build/installed with the main compile/install steps.

To fix that:

cd qttools
PATH=$MY_PREFIX/bin:$PATH qmake
gmake
gmake install
Run Code Online (Sandbox Code Playgroud)

Open issues

  • when using a remote Cygwin-X connection some colors are weird - e.g. the standard widget-gray is some light-light-blue - any ideas where to start to look for that?
  • QtSVG is successfully built but displaying a small SVG (e.g. inside a QLabel) hangs the dialog - a truss -u : shows function calls inside libm/QtWidget - perhaps the system is just way too slow and/or some code-path is not optimized on Solaris/in combination with a X-forwarding over ssh
  • a Qt-Program prints on startup: Qt Warning: Could not find a location of the system's Compose files. Consider setting the QTCOMPOSE environment variable. - no idea what feature this is about

Conclusion

With those adjustments 'normal' Qt programs (without QtSvg) compile and run fine under Solaris 10.

  • 其中许多问题已在Solaris 11中得到修复,它比Solaris 10早了7年. (2认同)