zoukankan      html  css  js  c++  java
  • Windows下编译FileZilla

    本文介绍了如何为FileZilla 3设置构建环境以及如何使用msys2在Windows下编译它,Msys2是一个cygwin环境。这些条件要求您运行64位Windows,对于完整的MSYS2系统和所有需要的依赖项,您将需要磁盘上的7GiB可用空间。

     

    1.安装MSYS2环境
    下载地址:http://www.msys2.org/

    2.安装编译器工具链
    FileZilla的shell扩展需要为32位和64位构建,因此我们需要32位和64位的编译器。

    工具和编译器

    第一次更新
    启动MSYS2 MinGW 64位shell
    pacman -Syu
    关闭MSYS2 shell。
    重复,直到没有更新。

    安装工具和编译工具链

    启动MSYS2 MinGW 64位shell,执行以下命令安装必要的包:
    pacman -S autoconf automake libtool make mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain git svn

    执行以下操作以解决工具链中一些烦人的错误

    #修复windres缺少的平台前缀
    [-f /mingw64/bin/x86_64-w64-mingw32-windres.exe] || ln -s /mingw64/bin/windres.exe /mingw64/bin/x86_64-w64-mingw32-windres.exe
    [-f /mingw32/bin/i686-w64-mingw32-windres.exe] || ln -s /mingw32/bin/windres.exe /mingw32/bin/i686-w64-mingw32-windres.exe

    设置环境

    执行以下命令:
    mkdir ~/prefix

    echo 'export PATH="HOME/prefix/bin:/mingw64/bin:/mingw32/bin:PATH"' >> ~/.profile
    echo 'export PKG_CONFIG_PATH="HOME/prefix/lib/pkgconfig"′>> /.profileecho′exportPATH="HOME/prefix/bin:/mingw64/bin:/mingw32/bin:PATH"′>> /.bashprofileecho′exportPKGCONFIGPATH="HOME/prefix/lib/pkgconfig"' >> ~/.bash_profile
    重新启动MSYS2 MINGW64 shell。


    构建依赖项
    构建GMP

    cd ~
    curl -O https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz
    tar xf gmp-6.1.2.tar.xz
    cd gmp-6.1.2
    ./configure --build=x86_64-w64-mingw32 --prefix="$HOME/prefix" --enable-shared --disable-static --enable-fat
    make && make install

    构建Nettle

    cd ~
    wget https://ftp.gnu.org/gnu/nettle/nettle-3.4.tar.gz

    wget wget https://ftp.gnu.org/gnu/nettle/nettle-3.5.1.tar.gz
    tar xf nettle-3.4.tar.gz
    cd nettle-3.4
    ./configure --build=x86_64-w64-mingw32 --prefix="$HOME/prefix" --enable-shared --disable-static --enable-fat
    make && make install

    构建zlib

    cd ~
    wget https://zlib.net/zlib-1.2.11.tar.gz
    tar xf zlib-1.2.11.tar.gz
    cd zlib-1.2.11
    LDSHAREDLIBC= ./configure --prefix="$HOME/prefix" -u=GNU
    make && make install

    构建GnuTLS

    cd ~
    wget https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.19.tar.xz
    tar xf gnutls-3.5.19.tar.xz
    cd gnutls-3.5.19
    ./configure --prefix="$HOME/prefix" --enable-shared --disable-static --build=x86_64-w64-mingw32 --with-included-libtasn1 --disable-doc --disable-guile --without-p11-kit --enable-local-libopts --disable-nls --with-included-unistring --disable-tests
    make && make install

    构建SQLite

    cd ~
    wget https://sqlite.org/2018/sqlite-autoconf-3250300.tar.gz
    tar xf sqlite-autoconf-3250300.tar.gz
    cd sqlite-autoconf-3250300
    ./configure --build=x86_64-w64-mingw32 --prefix="$HOME/prefix" --enable-shared --disable-static
    make && make install

    构建wxWidgets

    cd ~
    git clone --branch WX_3_0_BRANCH --single-branch https://github.com/wxWidgets/wxWidgets.git wx3
    cd wx3
    ./configure --prefix="$HOME/prefix" --enable-shared --disable-static --enable-unicode --without-libtiff --without-libjpeg --with-expat=builtin --with-libpng=builtin
    make && make install

    构建libfilezilla

    cd ~
    svn co https://svn.filezilla-project.org/svn/libfilezilla/trunk libfilezilla
    cd libfilezilla
    autoreconf -i 
    ./configure --prefix="$HOME/prefix" --enable-shared --disable-static
    make && make install

    构建Filezilla 
    下载FileZilla

    cd ~
    svn co https://svn.filezilla-project.org/svn/FileZilla3/trunk filezilla

    构建FileZilla

    cd ~/filezilla
    autoreconf -i
    ./configure --with-pugixml=builtin
    make

    剥掉一些符号信息和调试信息

    strip src/interface/.libs/filezilla.exe
    strip src/putty/.libs/fzsftp.exe
    strip src/putty/.libs/fzputtygen.exe
    strip src/fzshellext/64/.libs/libfzshellext-0.dll
    strip src/fzshellext/32/.libs/libfzshellext-0.dll
    strip data/dlls/*.dll

    3.构建安装程序

    安装NSIS
    http://nsis.sourceforge.net/下载并安装NSIS
    编译安装程序脚本
    在资源管理器中右键单击data / install.nsi,然后从上下文菜单中使用“编译NSIS脚本”。

  • 相关阅读:
    C语言中scanf函数的实现
    Express中设置cookie,session,token
    ajax2.0提供的FormData
    将json字符串解析为对象的三种方式
    ajax中的跨域问题
    html5中的图片预览
    jQuery中的ajax
    jQuery中的表单序列化
    实现一个瀑布流
    ajax
  • 原文地址:https://www.cnblogs.com/GameDeveloper/p/12669388.html
Copyright © 2011-2022 走看看