mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
- Added UPnP support (experimental) - taken from aMule CVS
This commit is contained in:
parent
f8e7687551
commit
fd2d2ddc0b
12 changed files with 2602 additions and 4 deletions
89
configure
vendored
89
configure
vendored
|
@ -22,6 +22,9 @@ Dependency options:
|
|||
--with-libtorrent-lib=[path] Path to libtorrent library files
|
||||
--with-libcurl-inc=[path] Path to libcurl include files
|
||||
--with-libcurl-lib=[path] Path to libcurl library files
|
||||
--disable-libupnp Disable use of libupnp
|
||||
--disable-upnp disable UPnP support
|
||||
--with-libupnp-inc=[path] Path to libupnp include files
|
||||
|
||||
EOT
|
||||
}
|
||||
|
@ -158,6 +161,21 @@ while [ $# -gt 0 ]; do
|
|||
shift
|
||||
;;
|
||||
|
||||
--disable-libupnp)
|
||||
QC_DISABLE_libupnp="Y"
|
||||
shift
|
||||
;;
|
||||
|
||||
--disable-upnp)
|
||||
QC_DISABLE_UPNP="Y"
|
||||
shift
|
||||
;;
|
||||
|
||||
--with-libupnp-inc=*)
|
||||
QC_WITH_LIBUPNP_INC=$optarg
|
||||
shift
|
||||
;;
|
||||
|
||||
--verbose)
|
||||
QC_DEBUG="Y"
|
||||
shift
|
||||
|
@ -183,6 +201,9 @@ echo QC_WITH_LIBTORRENT_INC=$QC_WITH_LIBTORRENT_INC
|
|||
echo QC_WITH_LIBTORRENT_LIB=$QC_WITH_LIBTORRENT_LIB
|
||||
echo QC_WITH_LIBCURL_INC=$QC_WITH_LIBCURL_INC
|
||||
echo QC_WITH_LIBCURL_LIB=$QC_WITH_LIBCURL_LIB
|
||||
echo QC_DISABLE_libupnp=$QC_DISABLE_libupnp
|
||||
echo QC_DISABLE_UPNP=$QC_DISABLE_UPNP
|
||||
echo QC_WITH_LIBUPNP_INC=$QC_WITH_LIBUPNP_INC
|
||||
echo
|
||||
fi
|
||||
|
||||
|
@ -447,6 +468,68 @@ public:
|
|||
return false;
|
||||
}
|
||||
};
|
||||
#line 1 "libupnp.qcm"
|
||||
/*
|
||||
-----BEGIN QCMOD-----
|
||||
name: libupnp
|
||||
arg: disable-upnp, disable UPnP support
|
||||
arg: with-libupnp-inc=[path], Path to libupnp include files
|
||||
-----END QCMOD-----
|
||||
*/
|
||||
class qc_libupnp : public ConfObj
|
||||
{
|
||||
public:
|
||||
qc_libupnp(Conf *c) : ConfObj(c) {}
|
||||
QString name() const { return "libupnp"; }
|
||||
QString shortname() const { return "libupnp"; }
|
||||
bool exec(){
|
||||
QString s;
|
||||
s = conf->getenv("QC_DISABLE_UPNP");
|
||||
if(!s.isEmpty()){
|
||||
conf->addDefine("NO_UPNP");
|
||||
return false;
|
||||
}
|
||||
s = conf->getenv("QC_WITH_LIBUPNP_INC");
|
||||
if(!s.isEmpty()) {
|
||||
if(!conf->checkHeader(s, "upnp/upnp.h")) {
|
||||
//qWarning("libupnp includes not found!");
|
||||
conf->addDefine("NO_UPNP");
|
||||
return false;
|
||||
}
|
||||
conf->addIncludePath(s);
|
||||
}else{
|
||||
QStringList sl;
|
||||
sl += "/usr/include";
|
||||
sl += "/usr/local/include";
|
||||
if(!conf->findHeader("upnp/upnp.h", sl, &s)) {
|
||||
//qWarning("libupnp includes not found!");
|
||||
conf->addDefine("NO_UPNP");
|
||||
return false;
|
||||
}
|
||||
conf->addIncludePath(s);
|
||||
}
|
||||
|
||||
/*s = conf->getenv("QC_WITH_LIBUPNP_LIB");
|
||||
if(!s.isEmpty()) {
|
||||
if(!conf->checkLibrary(s, "upnp")) {
|
||||
qWarning("libupnp library not found!");
|
||||
return false;
|
||||
}
|
||||
conf->addLib(QString("-L") + s);
|
||||
}else{
|
||||
if(!conf->findLibrary("upnp", &s)) {
|
||||
qWarning("libupnp library not found!");
|
||||
return false;
|
||||
}
|
||||
if (!s.isEmpty())
|
||||
conf->addLib(QString("-L") + s);
|
||||
}
|
||||
|
||||
conf->addLib("-lupnp");*/
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
EOT
|
||||
cat >$1/modules_new.cpp <<EOT
|
||||
|
@ -465,6 +548,9 @@ cat >$1/modules_new.cpp <<EOT
|
|||
o = new qc_python(conf);
|
||||
o->required = true;
|
||||
o->disabled = false;
|
||||
o = new qc_libupnp(conf);
|
||||
o->required = false;
|
||||
o->disabled = false;
|
||||
|
||||
EOT
|
||||
cat >$1/conf4.h <<EOT
|
||||
|
@ -1395,6 +1481,9 @@ export QC_WITH_LIBTORRENT_INC
|
|||
export QC_WITH_LIBTORRENT_LIB
|
||||
export QC_WITH_LIBCURL_INC
|
||||
export QC_WITH_LIBCURL_LIB
|
||||
export QC_DISABLE_libupnp
|
||||
export QC_DISABLE_UPNP
|
||||
export QC_WITH_LIBUPNP_INC
|
||||
export QC_DEBUG
|
||||
rm -rf .qconftemp
|
||||
(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue