@ -18,11 +18,6 @@ Main options:
--help This help text.
--help This help text.
Dependency options:
Dependency options:
--with-libtorrent-inc=[path] Path to libtorrent-rasterbar include
files
--with-libtorrent-lib=[path] Path to libtorrent-rasterbar library
files
--with-libtorrent-static-lib=[path] Path to libtorrent-rasterbar .a file
--with-libboost-inc=[path] Path to libboost include files
--with-libboost-inc=[path] Path to libboost include files
--with-libcurl-inc=[path] Path to libcurl include files
--with-libcurl-inc=[path] Path to libcurl include files
--with-libcurl-lib=[path] Path to libcurl library files
--with-libcurl-lib=[path] Path to libcurl library files
@ -145,21 +140,6 @@ while [ $# -gt 0 ]; do
shift
shift
;;
;;
--with-libtorrent-inc=*)
QC_WITH_LIBTORRENT_INC=$optarg
shift
;;
--with-libtorrent-lib=*)
QC_WITH_LIBTORRENT_LIB=$optarg
shift
;;
--with-libtorrent-static-lib=*)
QC_WITH_LIBTORRENT_STATIC_LIB=$optarg
shift
;;
--with-libboost-inc=*)
--with-libboost-inc=*)
QC_WITH_LIBBOOST_INC=$optarg
QC_WITH_LIBBOOST_INC=$optarg
shift
shift
@ -211,9 +191,6 @@ echo PREFIX=$PREFIX
echo BINDIR=$BINDIR
echo BINDIR=$BINDIR
echo DATADIR=$DATADIR
echo DATADIR=$DATADIR
echo EX_QTDIR=$EX_QTDIR
echo EX_QTDIR=$EX_QTDIR
echo QC_WITH_LIBTORRENT_INC=$QC_WITH_LIBTORRENT_INC
echo QC_WITH_LIBTORRENT_LIB=$QC_WITH_LIBTORRENT_LIB
echo QC_WITH_LIBTORRENT_STATIC_LIB=$QC_WITH_LIBTORRENT_STATIC_LIB
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
echo QC_WITH_LIBCURL_INC=$QC_WITH_LIBCURL_INC
echo QC_WITH_LIBCURL_INC=$QC_WITH_LIBCURL_INC
echo QC_WITH_LIBCURL_LIB=$QC_WITH_LIBCURL_LIB
echo QC_WITH_LIBCURL_LIB=$QC_WITH_LIBCURL_LIB
@ -346,70 +323,29 @@ public:
/*
/*
-----BEGIN QCMOD-----
-----BEGIN QCMOD-----
name: libtorrent-rasterbar
name: libtorrent-rasterbar
arg: with-libtorrent-inc=[path], Path to libtorrent-rasterbar include files
arg: with-libtorrent-lib=[path], Path to libtorrent-rasterbar library files
arg: with-libtorrent-static-lib=[path], Path to libtorrent-rasterbar .a file
-----END QCMOD-----
-----END QCMOD-----
*/
*/
// see Conf::findPkgConfig
class qc_libtorrent_rasterbar : public ConfObj
class qc_libtorrent_rasterbar : public ConfObj
{
{
public:
public:
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent-rasterbar >= 0.14"; }
QString name() const { return "libtorrent-rasterbar >= 0.14.0 (>= 0.14.4 advised) "; }
QString shortname() const { return "libtorrent-rasterbar"; }
QString shortname() const { return "libtorrent-rasterbar"; }
bool exec(){
bool exec(){
QString s;
QStringList incs;
s = conf->getenv("QC_WITH_LIBTORRENT_INC");
QString req_ver = "0.14.0";
if(!s.isEmpty()) {
QString adv_ver = "0.14.4";
if(!conf->checkHeader(s, "libtorrent/magnet_uri.hpp")) {
QString version, libs, other;
return false;
VersionMode mode = VersionMin;
}
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, req_ver, &version, &incs, &libs, &other))
}else{
QStringList sl;
sl << "/usr/include";
sl << "/usr/local/include";
bool found = false;
foreach(s, sl){
if(conf->checkHeader(s, "libtorrent/magnet_uri.hpp")){
found = true;
break;
}
}
if(!found) {
return false;
}
}
conf->addIncludePath(s);
conf->addIncludePath(s+QDir::separator()+"libtorrent");
s = conf->getenv("QC_WITH_LIBTORRENT_STATIC_LIB");
if(!s.isEmpty() && QFile::exists(s) && s.endsWith(".a")){
conf->addLib(s);
return true;
}
s = conf->getenv("QC_WITH_LIBTORRENT_LIB");
if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "torrent-rasterbar")) {
return false;
return false;
}
for(int n = 0; n < incs.count(); ++n)
conf->addLib(QString("-L") + s);
conf->addIncludePath(incs[n]);
}else{
if(!libs.isEmpty())
QStringList sl;
conf->addLib(libs);
sl << "/usr/lib/";
if(!conf->findPkgConfig("libtorrent-rasterbar", mode, adv_ver, &version, &incs, &libs, &other))
sl << "/usr/lib64/";
printf("\nWarning: libtorrent-rasterbar v%s was detected. Although it will compile and run, you will probably experience some bugs. Please consider updating to v%s!\n", version.toUtf8().data(), adv_ver.toUtf8().data());
sl << "/usr/local/lib/";
sl << "/usr/local/lib64/";
bool found = false;
foreach(s, sl){
if(conf->checkLibrary(s, "torrent-rasterbar")){
found = true;
break;
}
}
if(!found) return false;
conf->addLib(QString("-L") + s);
}
return true;
return true;
}
}
};
};
@ -1567,9 +1503,6 @@ export PREFIX
export BINDIR
export BINDIR
export DATADIR
export DATADIR
export EX_QTDIR
export EX_QTDIR
export QC_WITH_LIBTORRENT_INC
export QC_WITH_LIBTORRENT_LIB
export QC_WITH_LIBTORRENT_STATIC_LIB
export QC_WITH_LIBBOOST_INC
export QC_WITH_LIBBOOST_INC
export QC_WITH_LIBCURL_INC
export QC_WITH_LIBCURL_INC
export QC_WITH_LIBCURL_LIB
export QC_WITH_LIBCURL_LIB