I have now made a new build with Qt Lite. This is not another product, just a method to make smaller builds.
export LLVM_INSTALL_DIR=/usr/lib/llvm-6.0
../qt5/config.opt
make module-qtbase
The export is for clang (to make docs) and can be skipped.
config.opt is
../qt5/configure \
-release \
-shared \
-opensource \
-confirm-license \
-optimize-size \
-ltcg \
-nomake examples \
-nomake tests \
-skip qtmultimedia \
-no-pch \
-no-feature-abstractbutton \
-no-feature-accessibility-atspi-bridge \
-no-feature-action \
-no-feature-alloca \
-no-feature-alloca_h \
-no-feature-alloca_malloc_h \
-no-feature-android-style-assets \
-no-feature-angle \
-no-feature-angle_d3d11_qdtd \
-no-feature-animation \
-no-feature-appstore-compliant \
-no-feature-avx2 \
-no-feature-big_codecs \
-no-feature-buttongroup \
-no-feature-c++11 \
-no-feature-c++14 \
-no-feature-c++1z \
-no-feature-c11 \
-no-feature-c99 \
-no-feature-calendarwidget \
-no-feature-checkbox \
-no-feature-clipboard \
-no-feature-clock-gettime \
-no-feature-colordialog \
-no-feature-colornames \
-no-feature-columnview \
-no-feature-combined-angle-lib \
-no-feature-combobox \
-no-feature-commandlineparser \
-no-feature-commandlinkbutton \
-no-feature-completer \
-no-feature-concurrent \
-no-feature-contextmenu \
-no-feature-cross_compile \
-no-feature-cssparser \
-no-feature-cursor \
-no-feature-cxx11_future \
-no-feature-datawidgetmapper \
-no-feature-datetimeedit \
-no-feature-datetimeparser \
-no-feature-dbus \
-no-feature-dbus-linked \
-no-feature-debug_and_release \
-no-feature-desktopservices \
-no-feature-dial \
-no-feature-dialog \
-no-feature-dialogbuttonbox \
-no-feature-direct2d \
-no-feature-direct2d1_1 \
-no-feature-direct3d11 \
-no-feature-direct3d11_1 \
-no-feature-direct3d9 \
-no-feature-directfb \
-no-feature-dirmodel \
-no-feature-dlopen \
-no-feature-dockwidget \
-no-feature-draganddrop \
-no-feature-drm_atomic \
-no-feature-dxgi \
-no-feature-dxgi1_2 \
-no-feature-dxguid \
-no-feature-effects \
-no-feature-egl \
-no-feature-egl_x11 \
-no-feature-eglfs \
-no-feature-eglfs_brcm \
-no-feature-eglfs_egldevice \
-no-feature-eglfs_gbm \
-no-feature-eglfs_mali \
-no-feature-eglfs_openwfd \
-no-feature-eglfs_rcar \
-no-feature-eglfs_viv \
-no-feature-eglfs_viv_wl \
-no-feature-eglfs_vsp2 \
-no-feature-eglfs_x11 \
-no-feature-errormessage \
-no-feature-etw \
-no-feature-evdev \
-no-feature-filedialog \
-no-feature-filesystemiterator \
-no-feature-filesystemmodel \
-no-feature-filesystemwatcher \
-no-feature-force_asserts \
-no-feature-formlayout \
-no-feature-framework \
-no-feature-fontcombobox \
-no-feature-fontconfig \
-no-feature-fontdialog \
-no-feature-fscompleter \
-no-feature-futimens \
-no-feature-futimes \
-no-feature-future \
-no-feature-gestures \
-no-feature-getauxval \
-no-feature-getentropy \
-no-feature-gif \
-no-feature-glib \
-no-feature-glibc \
-no-feature-gnu-libiconv \
-no-feature-graphicseffect \
-no-feature-graphicsview \
-no-feature-groupbox \
-no-feature-gtk3 \
-no-feature-harfbuzz \
-no-feature-ico \
-no-feature-iconv \
-no-feature-icu \
-no-feature-identityproxymodel \
-no-feature-im \
-no-feature-image_heuristic_mask \
-no-feature-image_text \
-no-feature-imageformat_bmp \
-no-feature-imageformat_ppm \
-no-feature-imageformat_xbm \
-no-feature-imageformat_xpm \
-no-feature-inotify \
-no-feature-inputdialog \
-no-feature-integrityfb \
-no-feature-integrityhid \
-no-feature-journald \
-no-feature-keysequenceedit \
-no-feature-kms \
-no-feature-lcdnumber \
-no-feature-libinput \
-no-feature-libinput-axis-api \
-no-feature-library \
-no-feature-libudev \
-no-feature-lineedit \
-no-feature-linkat \
-no-feature-linuxfb \
-no-feature-listview \
-no-feature-listwidget \
-no-feature-lttng \
-no-feature-mainwindow \
-no-feature-mdiarea \
-no-feature-messagebox \
-no-feature-mirclient \
-no-feature-movie \
-no-feature-mtdev \
-no-feature-multiprocess \
-no-feature-network \
-no-feature-opengl \
-no-feature-opengles2 \
-no-feature-opengles3 \
-no-feature-opengles31 \
-no-feature-opengles32 \
-no-feature-openvg \
-no-feature-paint_debug \
-no-feature-pdf \
-no-feature-picture \
-no-feature-pkg-config \
-no-feature-posix-libiconv \
-no-feature-posix_fallocate \
-no-feature-printer \
-no-feature-process \
-no-feature-processenvironment \
-no-feature-progressbar \
-no-feature-progressdialog \
-no-feature-qeventtransition \
-no-feature-qml-animation \
-no-feature-qml-debug \
-no-feature-qml-delegate-model \
-no-feature-qml-devtools \
-no-feature-qml-list-model \
-no-feature-qml-locale \
-no-feature-qml-network \
-no-feature-qml-preview \
-no-feature-qml-profiler \
-no-feature-qml-sequence-object \
-no-feature-qml-worker-script \
-no-feature-qml-xml-http-request \
-no-feature-quick-canvas \
-no-feature-quick-designer \
-no-feature-quick-flipable \
-no-feature-quick-gridview \
-no-feature-quick-listview \
-no-feature-quick-particles \
-no-feature-quick-path \
-no-feature-quick-pathview \
-no-feature-quick-positioners \
-no-feature-quick-repeater \
-no-feature-quick-shadereffect \
-no-feature-quick-sprite \
-no-feature-quick-tableview \
-no-feature-radiobutton \
-no-feature-reduce_exports \
-no-feature-reduce_relocations \
-no-feature-release_tools \
-no-feature-renameat2 \
-no-feature-resizehandler \
-no-feature-rpath \
-no-feature-rubberband \
-no-feature-scroller \
-no-feature-separate_debug_info \
-no-feature-sessionmanager \
-no-feature-settings \
-no-feature-sha3-fast \
-no-feature-sharedmemory \
-no-feature-shortcut \
-no-feature-simulator_and_device \
-no-feature-sizegrip \
-no-feature-slog2 \
-no-feature-sortfilterproxymodel \
-no-feature-spinbox \
-no-feature-splashscreen \
-no-feature-splitter \
-no-feature-sql \
-no-feature-sql-sqlite \
-no-feature-stack-protector-strong \
-no-feature-standarditemmodel \
-no-feature-statemachine \
-no-feature-statusbar \
-no-feature-statustip \
-no-feature-statx \
-no-feature-style-android \
-no-feature-style-fusion \
-no-feature-style-mac \
-no-feature-style-stylesheet \
-no-feature-style-windows \
-no-feature-style-windowsvista \
-no-feature-syntaxhighlighter \
-no-feature-syslog \
-no-feature-system-doubleconversion \
-no-feature-system-freetype \
-no-feature-system-harfbuzz \
-no-feature-system-pcre2 \
-no-feature-system-png \
-no-feature-system-zlib \
-no-feature-systemsemaphore \
-no-feature-systemtrayicon \
-no-feature-tabletevent \
-no-feature-tableview \
-no-feature-tablewidget \
-no-feature-testlib \
-no-feature-textbrowser \
-no-feature-textedit \
-no-feature-texthtmlparser \
-no-feature-textodfwriter \
-no-feature-texture_format_astc_experimental \
-no-feature-timezone \
-no-feature-toolbox \
-no-feature-tooltip \
-no-feature-topleveldomain \
-no-feature-translation \
-no-feature-treeview \
-no-feature-treewidget \
-no-feature-tslib \
-no-feature-tuiotouch \
-no-feature-undocommand \
-no-feature-undogroup \
-no-feature-undostack \
-no-feature-undoview \
-no-feature-validator \
-no-feature-vnc \
-no-feature-vsp2 \
-no-feature-vulkan \
-no-feature-whatsthis \
-no-feature-wheelevent \
-no-feature-wizard \
-no-feature-xcb-xinput \
-no-feature-xlib \
-no-feature-xml \
-no-feature-xmlstreamwriter \
-xcb \
-feature-xlib \
-feature-xcb-xlib \
-feature-jpeg
This file is the heart of Qt Lite. It defines what you skip but also (by what is not there) what is included. The file will likely be tweaked later to fit just what we need.
It is interesting to look at config.summary. It tells what is and is not there.
[code]Build type: linux-g++ (x86_64, CPU features: mmx sse sse2)
Compiler: gcc 7.5.0
Configuration: use_gold_linker sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx compile_examples enable_new_dtags f16c largefile ltcg optimize_size rdrnd shani x86SimdAlways shared release no-pkg-config stl
Build options:
Mode … release
Optimize release build for size … yes
Building shared libraries … yes
Using C standard … C89
Using C++ standard …
Using ccache … no
Using gold linker … yes
Using new DTAGS … yes
Using precompiled headers … no
Using LTCG … yes
Target compiler supports:
SSE … SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
AVX … AVX
AVX512 …
Other x86 … AES F16C RDRAND SHA
Intrinsics without -mXXX option … yes
Build parts … libs tools
Qt modules and options:
Qt Concurrent … no
Qt D-Bus … no
Qt D-Bus directly linked to libdbus … no
Qt Gui … yes
Qt Network … no
Qt Sql … no
Qt Testlib … no
Qt Widgets … yes
Qt Xml … no
Support enabled for:
Using pkg-config … no
udev … no
Using system zlib … no
Qt Core:
DoubleConversion … yes
Using system DoubleConversion … no
GLib … no
iconv … no
ICU … no
Tracing backend …
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 … no
HarfBuzz … no
Using system HarfBuzz … no
Fontconfig … no
Image formats:
GIF … no
ICO … no
JPEG … yes
Using system libjpeg … no
PNG … yes
Using system libpng … no
EGL … no
OpenVG … no
OpenGL:
Desktop OpenGL … no
OpenGL ES 2.0 … no
OpenGL ES 3.0 … no
OpenGL ES 3.1 … no
OpenGL ES 3.2 … no
Vulkan … no
Session Management … no
Features used by QPA backends:
evdev … no
libinput … no
INTEGRITY HID … no
mtdev … no
tslib … no
xkbcommon … yes
X11 specific:
XLib … yes
XCB Xlib … yes
EGL on X11 … no
QPA backends:
DirectFB … no
EGLFS … no
LinuxFB … no
VNC … no
Mir client … no
XCB:
Using system-provided XCB libraries … no
XCB XKB … no
XCB XInput … no
Native painting (experimental) … no
GL integrations:
GLX Plugin … no
EGL-X11 Plugin … no
Qt Sql:
SQL item models … yes
Qt Widgets:
GTK+ … no
Styles …
Qt PrintSupport:
CUPS … no
Qt Sql Drivers:
DB2 (IBM) … no
InterBase … no
MySql … no
OCI (Oracle) … no
ODBC … no
PostgreSQL … no
SQLite2 … no
SQLite … no
Using system provided SQLite … no
TDS (Sybase) … no
Qt Testlib:
Tester for item models … yes
Qt QML:
QML network support … no
QML debugging and profiling support … no
QML sequence object … no
QML list model … no
QML XML http request … no
QML Locale … no
QML delegate model … no
Qt Quick:
Direct3D 12 … no
AnimatedImage item … no
Canvas item … no
Support for Qt Quick Designer … no
Flipable item … no
GridView item … no
ListView item … no
TableView item … no
Path support … no
PathView item … no
Positioner items … no
Repeater item … no
ShaderEffect item … no
Sprite item … no
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.
[/code]
The size of the new libs are astounding.
-rwxrwx--- 1 root vboxsf 4547600 Aug 7 00:56 libQt5Core.so.5.12.9
-rwxrwx--- 1 root vboxsf 3947432 Aug 7 01:02 libQt5Gui.so.5.12.9
-rwxrwx--- 1 root vboxsf 1946456 Aug 7 01:06 libQt5Widgets.so.5.12.9
-rwxrwx--- 1 root vboxsf 1658440 Aug 7 01:08 libQt5XcbQpa.so.5.12.9
libQt5Core.so.5.12.9 — 4,5 MB
libQt5Gui.so.5.12.9 — 3,9 MB
libQt5Widgets.so.5.12.9 — 1,9 MB
libQt5XcbQpa.so.5.12.9 — 1,7 MB
I think I managed to reduce their size 
This can easily go in a distribution.
Now for the binding. I ran lqt cmake on the new build-qt5 but it produced errors. I will come back to this later.