#!/bin/bash

set -e

MINGW=${MINGW:-${ARCH:-x86_64}-w64-mingw32}
PREFIX=${PREFIX:-usr}
WORKSPACE=${WORKSPACE:-$(pwd)}
TARGET=${TARGET:-${WORKSPACE}}
WINREQ=${WINREQ:-${TARGET}/${PREFIX}}
BUILD_NUMBER=${BUILD_NUMBER:-}
ARCH=${ARCH:-${MINGW%%-*}}
BINDIR=${BINDIR:-${PREFIX}/exe}
LIBDIR=${LIBDIR:-${PREFIX}/exe}
PLUGINDIR=${PLUGINDIR:-${PREFIX}/exe}
WININC=${WININC:-${WINREQ}/include}
WINLIB=${WINLIB:-${WINREQ}/exe}

version=
download=

; do
    case "$1" in
        (-h|--help)
            cat<<EOF
$ [OPTIONS] [CONFIGURE-ARGUMENTS]
OPTIONS:
  -h, --help         show this help
  -z, --zip          create zip package
  -v, --version      specify version string
  -d, --download     download sources
                     otherwise sources must be in $(pwd)
CONFIGURE-ARGUMENTS:
Arguments that are passed to configure.
VARIABLES:
  MINGW              mingw parameter (default: $MINGW)
  PREFIX             relative installation prefix (default: $PREFIX)
  WORKSPACE          workspace path (default: $WORKSPACE)
  WINREQ             path to required windows libraries (default: $WINREQ)
  TARGET             installation target (default: $TARGET)
  BUILD_NUMBER       build number (default: $BUILD_NUMBER)
  ARCH               architecture (default: $ARCH)
  BINDIR             install dir for exe files (default: $BINDIR)
  LIBDIR             install dir for dll files (default: $LIBDIR)
  PLUGINDIR          install dir for qt plugins (default: $PLUGINDIR)
  WININC             path to required windows include files (default: $WININC)
  WINLIB             path to required windows libraries (default: $WINLIB)
DEPENDENCIES:
  openssl        /build-openssl.sh
  icu            /build-icu.sh
Builds QT for Windows
EOF
            exit
            ;;
        (-d|--download) download=;;
        (-v|--version) shift; version="$1";;
        (-z|--;;
        (*) break;;
    esac
    ; then
        >&
        exit
    fi
    shift
done

set -x

cd ${WORKSPACE}
; then
    git clone https://code.qt.io/qt/qt5.git qt5
    cd qt5
    if test -z "$version"; then
        version=$(git branch -r | )
    fi
    git checkout "$version"
    perl init-repository --module-subset=default,-qtwebkit,-qtwebkit-examples,-qtwebengine
elif test -d qt5; then
    cd qt5
fi
if test -z "$version"; then
    version=$(git branch | sed -n 's,^\* *,,p')
fi
path=qt-${version}
[[ -.]+$ ]]

echo "Version: $version"
echo "Package: $path"

git submodule foreach --recursive "git clean -dfx"

# bugfixes:
#   MinGW has no uiviewsettingsinterop.h
sed -i '/^ *# *define *HAS_UI_VIEW_SETTINGS_INTEROP *$/d' qtbase/src/plugins/platforms/windows/qwin10helpers.cpp
#   https://bugreports.qt.io/browse/QTBUG-38223
sed -i '/option(host_build)/d' qtactiveqt/src/tools/idc/idc.pro

# /workdir/qtwinextras/src/winextras
# qwinjumplist.:: error: ‘SHCreateItemFromParsingName’ was not declared in this scope
sed -i '/# *if *defined *( *_WIN32_IE *) *&& *_WIN32_IE *<< *0x0700/{s,<<,<,}' qtwinextras/src/winextras/qwinjumplist.cpp

# in qtexttospeech_sapi.cpp file sphelper.h is missing → "-skip qtspeech"
./configure -v -recheck-all -opensource -confirm-license \
    -xplatform win32-g++ -device-option CROSS_COMPILE=${MINGW}- \
    -no-compile-examples \
    -I"${WININC}" \
    -L"${WINLIB}" \
    -prefix "${TARGET}/${PREFIX}" \
    -bindir "${TARGET}/$BINDIR" \
    -libdir "${TARGET}/$LIBDIR" \
    -plugindir "${TARGET}/$PLUGINDIR" \
    -libexecdir "${TARGET}/$LIBDIR" \
    -system-proxies \
    -opengl desktop \
    -openssl-runtime \
    -skip qtspeech \
    -skip qtlocation \
    -shared \
    -release \
    $*

make
make install

# bugfixes:
#  Qt pkg-config files link to debug version in release build
#  https://bugreports.qt.io/browse/QTBUG-60028
for f in "${TARGET}/${LIBDIR}"/pkgconfig/*.pc; do
    sed -i 's,\(-lQt5[-_a-zA-Z0-9]*\)d,\1,g' "$f"
done

if test $zip -eq 1; then
    cd "${TARGET}"
    zip -r "${path}~windows.${BUILD_NUMBER}_${ARCH}.zip" "${PREFIX}"
fi

https://github.com/mwaeckerlin/mingw/blob/master/build-qt.sh

build-qt.sh(Cross compile in Linux for Windows)的更多相关文章

  1. 2018.4.12 各个系统安装MyEclipse过程(包括Mac、Linux、Windows)

    首先下载MyEclipse 最新官网在这里http://www.myeclipsecn.com/ mac 安装 . 在安装第一步会显示 "安装myeclipse显示更低版本javase6&q ...

  2. 新成员!Visual Studio Code --跨平台的开发工具(支持OSX, Linux 和 Windows)

    原文出处:新成员!Visual Studio Code --跨平台的开发工具(支持OSX, Linux 和 Windows) 这是我的文章备份  http://www.dotblogs.com.tw/ ...

  3. 磁盘IO性能监控(Linux 和 Windows)

    磁盘IO性能监控(Linux 和 Windows) 作者:终南   <li.zhongnan@hotmail.com> 磁盘的IO性能是衡量计算机总体性能的一个重要指标.Linux提供了i ...

  4. java获取本机器的IP(linux和windows)

    目录 描述 方案描述 获取Windows下的IP 获取linux下的IP 判断操作系统的类型 最后将上面三个方法进行整合 参考 描述 由于项目是部署在集群上的,需要项目能够自动采集各机器的信息.jav ...

  5. ISE(Iris Server Engine)是一个基于现代C++的跨平台(Linux和Windows)框架

    ISE(Iris Server Engine)是一个基于现代C++的跨平台(Linux和Windows)的高性能多线程并发网络服务器程序框架.它封装了琐碎的socket以及各种操作系统APIs,以面向 ...

  6. LoadRunner 服务器(Linux、Windows) 性能指标度量说明

    服务器资源性能计数器 下表描述了可用的计数器: 监控器 度量 说明 CPU 监控器 Utilization 监测 CPU 利用率. 磁盘空间监控器 Disk space 监测可用空间 (MB) 和已用 ...

  7. openCV 简单实现身高测量(未考虑相机标定,windows)

    (一) OpenCV3.1.0+VS2015开发环境配置 下载OpenCV安装包(笔者下载3.1.0版本) 环境变量配置(opencv安装路径\build\x64\vc14\bin,注意的是x64文件 ...

  8. 静态编译Qt5.4.1和Qt WebKit(网事如风的blog)good

    blog文章地址:http://godebug.org/index.php/archives/133/ WebKit是个好东西,做爬虫.显示网页还是想用HTML来做桌面应用的界面都可以用他,不过一直以 ...

  9. 原创)CentOS6.4下安装xampp(一定要在linux上下载)

    一.xampp下载地址: http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/1.8.3/ 二.我下载的是xampp-linux-x64 ...

随机推荐

  1. phpstorm 2018本地激活

    这是简书上找到的,害怕以后找不到,记录一下网址为https://www.jianshu.com/p/133af2e4fe3f

  2. jquery 无刷新上传的小function

    function zll_up(click_id,up_url,text_id,show_id){ this.create = function(){} //当点击指定元素时,创建iframe for ...

  3. boost::any的一般使用方法

    01.#include <iostream>    02.#include <list>    03.#include <boost/any.hpp>    04. ...

  4. Linux系统下的单调时间函数

    欢迎转载,转载请注明出处:http://forever.blog.chinaunix.net 一.编写linux下应用程序的时候,有时候会用到高精度相对时间的概念,比如间隔100ms.那么应该使用哪个 ...

  5. Qt on Android: http下载与Json解析

    百度提供有查询 ip 归属地的开放接口,当你在搜索框中输入一个 ip 地址进行搜索,就会打开由 ip138 提供的百度框应用,你能够在框内直接输入 ip 地址查询.我查看了页面请求,提取出查询 ip ...

  6. PXC安装

    安装软件依赖包yum install -y  perl-IO-Socket-SSL perl-DBD-MySQL perl-Time-HiRes socat nc    openssl-devel l ...

  7. php汉字字符串长度和截取

    mb_strlen("你好123",'utf-8');//返回5 strlen("你好");//返回几我也不知道,肯定不是2,但你想要2就用上面的 substr ...

  8. linux 安装scrt

    http://www.vandyke.com/products/securecrt/  wget http://download.boll.me/securecrt_linux_crack.pl pe ...

  9. 如何使用Name对象,包括WorkspaceNames和DatasetNames

    转自chanyinhelv原文 如何使用Name对象,包括WorkspaceNames和DatasetNames 第一原文链接 该博主还有很多有关arcgis二次开发的不错的文章. 如何使用Name对 ...

  10. springmvc使用和经验总结(长沙师说网络科技有限公司)

    springmvc 先分析下代码,高速学习.先要把配置文件写好, 给上2个类详细看看 package com.shishuo.studio.action; import org.apache.log4 ...