cd "F:\\aria2"
gmp-6.1.2.tar.lz
expat-2.2.0.tar.bz2
sqlite-autoconf-3160200.tar.gz
zlib-1.2.11.tar.gz
c-ares-1.12.0.tar.gz
libssh2-1.8.0.tar.gz

--enable-libaria2
--enable-static

libgnutls-dev(对于HTTPS,BitTorrent,校验和支持是必需的)
nettle-dev(对于BitTorrent,校验和支持)
libgmp-dev(对于BitTorrent是必需的)
libssh2-1-dev(SFTP支持需要)
libc-ares-dev(需要异步DNS支持)
libxml2-dev(Metalink支持需要)
zlib1g-dev(对于gzip必需,在HTTP中支持解压缩)
libsqlite3-dev(适用于Firefox3 / Chromium cookie支持)
pkg-config(用于检测已安装的库)

apt-cyg安装工具设置   https://blog.csdn.net/jinguangliu/article/details/79657456    
./autogen.sh
autoscan
aclocal
autoheader
automake --add-missing
autoreconf  -ivf
autoconf


./configure
./configure ARIA2_STATIC = yes
export CXXFLAGS="-g -O2 -mwindows"     //无控制台启动aria2.exe
make
HOST = x86_64-w64-mingw32 ./mingw-config
i686-w64-mingw32


#ifdef BUILD_DLL
    #define DLL_EXPORT __declspec(dllexport)
#else
    #define DLL_EXPORT __declspec(dllimport)
#endif

ARIA2_DLL_API int64_t             extern "C" int64_t ARIA2_DLL_API
ARIA2_DLL_API int             extern "C" int ARIA2_DLL_API
ARIA2_DLL_API void             extern "C" void ARIA2_DLL_API
ARIA2_DLL_API bool             extern "C" bool ARIA2_DLL_API
ARIA2_DLL_API A2Gid             extern "C" A2Gid ARIA2_DLL_API
ARIA2_DLL_API DownloadHandle*             extern "C" DownloadHandle* ARIA2_DLL_API
ARIA2_DLL_API DownloadStatus             extern "C" DownloadStatus ARIA2_DLL_API
ARIA2_DLL_API Session*      extern "C" Session* ARIA2_DLL_API
ARIA2_DLL_API time_t      extern "C" time_t ARIA2_DLL_API
ARIA2_DLL_API BtFileMode      extern "C" BtFileMode ARIA2_DLL_API
ARIA2_DLL_API size_t      extern "C" size_t ARIA2_DLL_API

extern "C" int ARIA2_DLL_API64_t           extern "C" int64_t ARIA2_DLL_API


//vs开发人员工具命令行
pexports libaria2-0.dll>libaria2-0.def
lib /def:libaria2-0.def /machine:i386 /out:libaria2-0.lib

我这里是直接修改Qt编译后的配置,找到
QTDIR/mkspec/win32-g++ /qmake.conf,QMAKE_LFLAGS = -static-libgcc -static-libstdc++改成这样,
这段代码是去掉了对上面所说两个动态链接库的动态调用依赖.

Windows下特殊处理

#define CXX11_OVERRIDE override
#define PACKAGE_VERSION 0
typedef size_t ssize_t;
#include "pch.h"
#define NOMINMAX
 

参考

GitHub - jashking/aria2: aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.

http://wangjie.rocks/2017/02/12/build-aria2/

https://github.com/aria2/aria2.git

https://github.com/geetam/qaria/tree/master/src

https://github.com/manox14/qtaria

dll.a和lib 引用MinGW生成的dll.a后出现的问题_生成了dll.a-CSDN博客

https://github.com/imazes/aria2_ctl

https://github.com/cool2528/aria2cengine.git

https://github.com/jashking/aria2/blob/master/src/includes/aria2/aria2.h

http://wangjie.rocks/2017/02/12/build-aria2/


创作不易,小小的支持一下吧!

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部