Rebuild Qt Libraries
You can re-build the Unigine Qt libraries but it's not recommended for the Qt components to work properly.
Unigine SDK uses 5.4.1 and 5.6.1-1 versions of Qt:
- Qt 5.4.1 is used for Unigine SDK Browser
- Qt 5.6.1-1 is used for Unigine Editor
Build Qt for Windows
Preparation
- Build ICU libraries:
- Install cygwin
- Download ICU source code
- Build ICU with the following batch script, changing %CYGWIN_PATH% variable with the path where cygwin installed
set PATH=%CYGWIN_PATH%\bin;%PATH% call %VS120COMNTOOLS%vsvars32.bat :: for x64 build use: :: call %VS120COMNTOOLS%..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat cd icu/source bash runConfigureICU Cygwin/MSVC --enable-static --disable-shared nmake nmake install
- Build OpenSSL libraries:
- Install perl
- Download OpenSSL v1.0.2 source code
- Build OpenSSL for x86, changing %PERL_PATH% variable with the path where perl installed
call %VS120COMNTOOLS%vsvars32.bat set PATH=%PERL_PATH%\bin;%PATH% cd openssl-1.0.2 call perl Configure VC-WIN32 no-shared no-asm call ms\do_ms nmake -f ms\nt.mak nmake -f ms\nt.mak install
- For building OpenSSL 64-bit version use the following script
call %VS120COMNTOOLS%..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat set PATH=%PERL_PATH%\bin;%PATH% cd openssl-1.0.2 call perl Configure VC-WIN64A no-shared no-asm call ms\do_win64a nmake -f ms\nt.mak nmake -f ms\nt.mak install
Build
Download sources of Qt modules and unpack them:
- For 5.4.1 Qt build download:
- For 5.6.1-1 Qt build download:
- Build Qt base libraries with the script, setting variables %VERSION%, %ICU_PATH% and %OPENSSL_PATH% before
set QMAKESPEC=win32-msvc2013 call %VS120COMNTOOLS%vsvars32.bat set PREFIX=%~dp0 set LIBDIR=%~dp0\lib set INFIX=Unigine_x86 set PATH=%ICU_PATH%\bin;%PATH% set INCLUDE=%ICU_PATH%\include;%INCLUDE% set LIB=%ICU_PATH%\lib;%LIB% set INCLUDE=%OPENSSL_PATH%\include;%INCLUDE% set LIB=%OPENSSL_PATH%\lib;%LIB% cd qtbase-opensource-src-%VERSION% call configure.exe -prefix %PREFIX% -libdir %LIBDIR% -plugindir %LIBDIR% -qtlibinfix %INFIX% -release -opensource -confirm-license ^ -no-sql-mysql -no-sql-psql -no-sql-oci -no-sql-odbc -no-sql-tds -no-sql-db2 -qt-sql-sqlite -no-sql-sqlite2 -no-sql-ibase ^ -no-plugin-manifests -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 ^ -no-ltcg -no-nis -no-iconv -no-evdev -no-mtdev -no-inotify -no-fontconfig ^ -qt-zlib -icu -no-gif -qt-libpng -qt-libjpeg -qt-freetype -no-harfbuzz -no-angle ^ -openssl-linked -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug -no-directwrite -no-direct2d ^ -qt-style-windowsvista -no-style-windowsce -no-style-windowsmobile ^ -no-native-gestures -no-mp -opengl desktop ^ -nomake examples -nomake tests nmake nmake install
- Build Qt UiTools library with previously built qmake tool
cd qttools-opensource-src-%VERSION%\src\designer\src set QMAKESPEC=win32-msvc2013 call %VS120COMNTOOLS%vsvars32.bat qmake nmake nmake install
- Build Qt WebKit libraries. For Qt 5.4.1 only
- Install ruby
- Install GNUWin32
- Install SQLite. For SQLite, download the 'amalgamation' sources and make sure you set SQLITE3SRCDIR environment variable to the directory containing the source files. (You could also set %SQLITE3SRCDIR% to the sources in your Qt's base source directory src/3rdparty/sqlite)
- Build QtWebKit and QtWebKitWidgets libraries with the following batch script, changing variables with the real pathes
set QMAKESPEC=win32-msvc2013 call %VS120COMNTOOLS%vsvars32.bat set PATH=%CYGWIN_PATH%\bin;%PATH% set PATH=%PERL_PATH%\bin;%PATH% set PATH=%RUBY_PATH%\bin;%PATH% set PATH=%GNUWIN32_PATH%\bin;%PATH% set PATH=%ICU_PATH%\bin;%PATH% set INCLUDE=%ICU_PATH%\include;%INCLUDE% set LIB=%ICU_PATH%\lib;%LIB% set SQLITE3SRCDIR=%SQLITE_PATH% cd qtwebkit-opensource-src-5.4.1 call perl Tools\Scripts\build-webkit --qt --release --minimal cd WebKitBuild\Release call nmake install
Build Qt for Linux
Preparation
- Build ICU libraries:
- Download ICU source code
- Unpack and build ICU with the following shell script
cd icu/source ./configure --enable-static --disable-shared make make install
- Build OpenSSL 1.0.2 libraries:
- Download OpenSSL v1.0.2 source code
- Unpack and build
cd openssl-1.0.2 ./config no-shared -fPIC make make install
Build
- Download sources of Qt modules and unpack them:
- For 5.4.1 Qt build download:
- For 5.6.1-1 Qt build download:
- Build Qt base libraries with the script, setting variable $VERSION before
PREFIX=../ LIBDIR=../lib INFIX=Unigine_x64 cd ./qtbase-opensource-src-$VERSION ./configure -verbose -prefix $PREFIX -libdir $LIBDIR -plugindir $LIBDIR -qtlibinfix $INFIX -release -opensource -confirm-license \ -I$PWD/../icu/include -I$PWD/../openssl/include -L$PWD/../icu/lib -L$PWD/../openssl/lib -ldl \ -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -qt-sql-sqlite -no-sql-sqlite2 -no-sql-tds \ -no-qml-debug -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 \ -qt-zlib -no-mtdev -no-gif -qt-libpng -qt-libjpeg -qt-freetype -no-harfbuzz -openssl-linked \ -qt-pcre -no-xinput2 -no-glib -no-pulseaudio -no-alsa -no-gtkstyle \ -no-nis -no-cups -no-iconv -no-evdev -icu -fontconfig -no-pch -no-dbus \ -qt-xcb -no-libudev -no-tslib -no-eglfs -no-directfb -no-linuxfb -no-kms \ -qpa xcb -opengl desktop \ -nomake examples -nomake tests make -j 8 make install
- Build Qt UiTools library with previously built qmake tool
cd qttools-opensource-src-$VERSION\src\designer\src qmake make make install
- Build Qt WebKit libraries with the script included (for Qt 5.4.1 only):
cd qtwebkit-opensource-src-5.4.1 ./Tools/Scripts/build-webkit --qt --release --minimal --makeargs="-j8" cd ./WebKitBuild/Release make install
- When the build was successfully finished, run the following script from the directory with Qt libraries:
MAJOR=5 MINOR=4 VER=1 for i in *.la *.prl *_x64.so *_x64.so.$MAJOR.$MINOR; do rm $i done for i in *_x64.so.$MAJOR.$MINOR.$VER; do mv $i ${i/so.$MAJOR.$MINOR.$VER/so.$MAJOR} done for i in *_x64.so.$MAJOR; do ln -s $i ${i/so.$MAJOR/so} done
Build Qt for Mac OS X
Preparation
- Build OpenSSL 1.0.2 libraries:
- Download OpenSSL v1.0.2 source code
- Unpack and build
cd openssl-1.0.2 ./Configure darwin64-x86_64-cc no-shared make make install
Build
- Download sources of Qt modules and unpack them:
- For 5.4.1 Qt build download:
- For 5.6.1-1 Qt build download:
- Build Qt base libraries with the script
PREFIX=../ LIBDIR=../lib INFIX=Unigine_x64 cd ./qtbase-opensource-src-$VERSION ./configure -verbose -prefix $PREFIX -libdir $LIBDIR -plugindir $LIBDIR -qtlibinfix $INFIX -release -opensource -confirm-license \ -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -qt-sql-sqlite -no-sql-sqlite2 -no-sql-tds \ -no-qml-debug -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 \ -qt-zlib -no-mtdev -no-gif -qt-libpng -qt-libjpeg -qt-freetype -no-harfbuzz -openssl-linked \ -qt-pcre -no-xinput2 -no-glib -no-pulseaudio -no-alsa -no-gtkstyle \ -no-nis -no-cups -no-iconv -no-evdev -no-icu -fontconfig -no-pch -no-dbus \ -no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms \ -qpa cocoa -opengl desktop -no-framework \ -nomake examples -nomake tests make -j 8 make install
- Build Qt UiTools library with previously built qmake tool
cd qttools-opensource-src-$VERSION\src\designer\src qmake make make install
- Build Qt WebKit libraries with the script included
cd qtwebkit-opensource-src-5.4.1 ./Tools/Scripts/build-webkit --qt --release --minimal --makeargs="-j8" cd ./WebKitBuild/Release make install
- When the build was successfully finished, run the following script in the directory with Qt libraries:
PREFIX=$PWD NAMES='' MAJOR=5 MINOR=4 VER=1 for i in *.la *.prl *_x64.dylib *_x64.$MAJOR.$MINOR.dylib; do rm $i done for i in *_x64.$MAJOR.$MINOR.$VER.dylib; do mv $i ${i/$MAJOR.$MINOR.$VER.dylib/$MAJOR.dylib} done for i in *_x64.$MAJOR.dylib; do ln -s $i ${i/$MAJOR.dylib/dylib} done for i in *.$MAJOR.dylib; do install_name_tool -id @rpath/$i $i for j in *.$MAJOR.dylib; do install_name_tool -change $PREFIX/$j @rpath/$j $i done NAMES="$NAMES $i" done cd ./platforms for i in *.dylib; do for j in $NAMES; do install_name_tool -change $PREFIX/$j @rpath/$j $i done done
Last update: 03.07.2017
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter