Do not explicitly specify mkspec file when invoking qmake.
qmake itself is aware of the cross mkspec file (compiled in)
AND of the mkspec file for host builds.
Specifying it explicitly doesn't let qmake choose the
correct one and always tries to cross-compile everything.
QMAKE_SPEC:=linux-g++
QMAKE_XSPEC:=linux-openwrt-g++
-QMAKE_SPECFILE:=$(QT_HOST_DATA)/mkspecs/$(QMAKE_XSPEC)
-
PKG_INSTALL_DIR_ROOT:=$(PKG_INSTALL_DIR)
PKG_INSTALL_DIR:=$(PKG_INSTALL_DIR_ROOT)/$(STAGING_DIR)
TARGET_CXXFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CXXFLAGS)" \
TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
qmake \
- -spec $(QMAKE_SPECFILE) \
-o $(PKG_BUILD_DIR)/$(2)/Makefile \
$(PKG_BUILD_DIR)/$(2)/$(if $(1),$(1),$(PKG_NAME)).pro
endef