Qtをソースからビルドする

2019年12月29日

Qt5 ソースからビルド

ツールキット Qt 5.12 LTS をソースからビルドする。

参考サイト:
<https://wiki.qt.io/Building_Qt_5_from_Git>

ビルドの準備

# Build essentials
sudo apt install build-essential perl python git
# Libxcb
sudo apt install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev
# OpenGL
sudo apt install flex bison gperf libicu-dev libxslt-dev ruby

# Qt WebEngine
sudo apt install libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libdbus-1-dev libfontconfig1-dev libcap-dev libxtst-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libxss-dev libegl1-mesa-dev

# Qt Multimedia
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

# QDoc Documentation Generator Tool
sudo apt install libclang-6.0-dev llvm-6.0


# source
git clone git://git.qt-users.jp/mirror/qt/qt5.git --branch v5.12.6 --depth 1
cd qt5
./init-repository --module-subset=qtbase,qtdeclarative,qtsvg,qttools,qttranslations,qtx11extras

# オプション設定

time nice ./configure --opensource --confirm-license --nomake=examples --nomake=tests --developer-build QMAKE_CXXFLAGS+=-w

```
+ cd qtbase
+ /media/qtuser/XF/qt5/qtbase/configure -top-level --opensource --confirm-license --nomake=examples --nomake=tests --developer-build QMAKE_CXXFLAGS+=-w
<srcbase> = /media/qtuser/XF/qt5/qtbase
<bldbase> = /media/qtuser/XF/qt5/qtbase
<outbase> = /media/qtuser/XF/qt5/qtbase
Creating qmake...
............................................................................................Done.

This is the Qt Open Source Edition.

You have already accepted the terms of the Open Source license.

Running configuration tests...
Done running configuration tests.

Configure summary:

Build type: linux-g++ (i386, CPU features: <none>)
Compiler: gcc 7.4.0
Configuration: use_gold_linker sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples enable_gdb_index enable_new_dtags f16c headersclean largefile precompile_header rdrnd shani warnings_are_errors x86SimdAlways private_tests shared rpath debug c++11 c++14 c++1z concurrent dbus reduce_exports reduce_relocations release_tools stl
Build options:
  Mode ................................... debug; optimized tools
  Optimize debug build ................... no
  Building shared libraries .............. yes
  Using C standard ....................... C11
  Using C++ standard ..................... C++1z
  Using ccache ........................... no
  Using gold linker ...................... yes
  Using new DTAGS ........................ yes
  Generating GDB index ................... yes
  Using precompiled headers .............. yes
  Using LTCG ............................. no
  Target compiler supports:
    SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
    AVX .................................. AVX AVX2
    AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI
    Other x86 ............................ AES F16C RDRAND SHA
    Intrinsics without -mXXX option ...... yes
  Build parts ............................ libs tools
Qt modules and options:
  Qt Concurrent .......................... yes
  Qt D-Bus ............................... yes
  Qt D-Bus directly linked to libdbus .... yes
  Qt Gui ................................. yes
  Qt Network ............................. yes
  Qt Sql ................................. yes
  Qt Testlib ............................. yes
  Qt Widgets ............................. yes
  Qt Xml ................................. yes
Support enabled for:
  Using pkg-config ....................... yes
  udev ................................... yes
  Using system zlib ...................... yes
Qt Core:
  DoubleConversion ....................... yes
    Using system DoubleConversion ........ no
  GLib ................................... yes
  iconv .................................. no
  ICU .................................... yes
  Tracing backend ........................ <none>
  Logging backends:
    journald ............................. no
    syslog ............................... no
    slog2 ................................ no
  Using system PCRE2 ..................... no
Qt Network:
  getifaddrs() ........................... yes
  IPv6 ifname ............................ yes
  libproxy ............................... no
  Linux AF_NETLINK ....................... yes
  OpenSSL ................................ yes
    Qt directly linked to OpenSSL ........ no
  OpenSSL 1.1 ............................ yes
  DTLS ................................... yes
  SCTP ................................... no
  Use system proxies ..................... yes
Qt Gui:
  Accessibility .......................... yes
  FreeType ............................... yes
    Using system FreeType ................ yes
  HarfBuzz ............................... yes
    Using system HarfBuzz ................ yes
  Fontconfig ............................. yes
  Image formats:
    GIF .................................. yes
    ICO .................................. yes
    JPEG ................................. yes
      Using system libjpeg ............... yes
    PNG .................................. yes
      Using system libpng ................ yes
  EGL .................................... yes
  OpenVG ................................. no
  OpenGL:
    Desktop OpenGL ....................... yes
    OpenGL ES 2.0 ........................ no
    OpenGL ES 3.0 ........................ no
    OpenGL ES 3.1 ........................ no
    OpenGL ES 3.2 ........................ no
  Vulkan ................................. no
  Session Management ..................... yes
Features used by QPA backends:
  evdev .................................. yes
  libinput ............................... yes
  INTEGRITY HID .......................... no
  mtdev .................................. yes
  tslib .................................. no
  xkbcommon .............................. yes
  X11 specific:
    XLib ................................. yes
    XCB Xlib ............................. yes
    EGL on X11 ........................... yes
QPA backends:
  DirectFB ............................... no
  EGLFS .................................. yes
  EGLFS details:
    EGLFS OpenWFD ........................ no
    EGLFS i.Mx6 .......................... no
    EGLFS i.Mx6 Wayland .................. no
    EGLFS RCAR ........................... no
    EGLFS EGLDevice ...................... yes
    EGLFS GBM ............................ no
    EGLFS VSP2 ........................... no
    EGLFS Mali ........................... no
    EGLFS Raspberry Pi ................... no
    EGLFS X11 ............................ yes
  LinuxFB ................................ yes
  VNC .................................... yes
  Mir client ............................. no
  XCB:
    Using system-provided XCB libraries .. yes
    XCB XKB .............................. yes
    XCB XInput ........................... yes
    Native painting (experimental) ....... yes
    GL integrations:
      GLX Plugin ......................... yes
        XCB GLX .......................... yes
      EGL-X11 Plugin ..................... yes
Qt Sql:
  SQL item models ........................ yes
Qt Widgets:
  GTK+ ................................... no
  Styles ................................. Fusion Windows
Qt PrintSupport:
  CUPS ................................... no
Qt Sql Drivers:
  DB2 (IBM) .............................. no
  InterBase .............................. no
  MySql .................................. no
  OCI (Oracle) ........................... no
  ODBC ................................... no
  PostgreSQL ............................. no
  SQLite2 ................................ no
  SQLite ................................. yes
    Using system provided SQLite ......... no
  TDS (Sybase) ........................... no
Qt Testlib:
  Tester for item models ................. yes
Qt QML:
  QML network support .................... yes
  QML debugging and profiling support .... yes
  QML sequence object .................... yes
  QML list model ......................... yes
  QML XML http request ................... yes
  QML Locale ............................. yes
  QML delegate model ..................... yes
Qt Quick:
  Direct3D 12 ............................ no
  AnimatedImage item ..................... yes
  Canvas item ............................ yes
  Support for Qt Quick Designer .......... yes
  Flipable item .......................... yes
  GridView item .......................... yes
  ListView item .......................... yes
  TableView item ......................... yes
  Path support ........................... yes
  PathView item .......................... yes
  Positioner items ....................... yes
  Repeater item .......................... yes
  ShaderEffect item ...................... yes
  Sprite item ............................ yes
Qt Tools:
  QDoc ................................... yes

Note: Also available for Linux: linux-clang linux-icc

Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing.

Qt is now configured for building. Just run 'make'.
Once everything is built, Qt is installed.
You should NOT run 'make install'.
Note that this build cannot be deployed to other machines or devices.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.


real    17m33.331s
user    6m6.481s
sys     0m33.242s
```

makeを実行


time nice make

永遠と続く…
 

古い記録

git clone git://code.qt.io/qt/qt5.git --branch v5.12.6
./init-repository --module-subset=qtbase,qtdeclarative
mkdir build
cd build
../configure -opensource -confirm-license -release -make libs -no-widgets -no-pch -prefix /usr/local

nice time make
make install

参考
https://qiita.com/task_jp/items/f0753c52c86a26928465