diff --git a/configure b/configure index 83f2b8c21..8b04219e9 100755 --- a/configure +++ b/configure @@ -21,6 +21,7 @@ Dependency options: --with-libtorrent-inc=[path] Path to libtorrent include files --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 EOT } @@ -152,6 +153,11 @@ while [ $# -gt 0 ]; do shift ;; + --with-libcurl-lib=*) + QC_WITH_LIBCURL_LIB=$optarg + shift + ;; + --verbose) QC_DEBUG="Y" shift @@ -176,6 +182,7 @@ 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_LIBCURL_INC=$QC_WITH_LIBCURL_INC +echo QC_WITH_LIBCURL_LIB=$QC_WITH_LIBCURL_LIB echo fi @@ -293,7 +300,10 @@ public: } conf->addIncludePath(s); }else{ - if(!conf->findHeader("libtorrent/extensions/ut_pex.hpp", QStringList(), &s)) { + QStringList sl; + sl << "/usr/include/"; + sl << "/usr/local/include"; + if(!conf->findHeader("libtorrent/extensions/ut_pex.hpp", sl, &s)) { qWarning("libtorrent v0.12 includes not found!\nYou can download it at http://www.libtorrent.net"); return false; } @@ -367,6 +377,7 @@ public: -----BEGIN QCMOD----- name: libcurl arg: with-libcurl-inc=[path], Path to libcurl include files +arg: with-libcurl-lib=[path], Path to libcurl library files -----END QCMOD----- */ class qc_libcurl : public ConfObj @@ -384,19 +395,36 @@ public: return false; } conf->addIncludePath(s); - return true; }else{ QStringList sl; sl += "/usr/include"; sl += "/usr/local/include"; - sl += "/sw/include"; if(!conf->findHeader("curl/curl.h", sl, &s)) { qWarning("libcurl includes not found!"); return false; } conf->addIncludePath(s); - return true; } + + s = conf->getenv("QC_WITH_LIBCURL_LIB"); + if(!s.isEmpty()) { + if(!conf->checkLibrary(s, "curl")) { + qWarning("libcurl library not found!"); + return false; + } + conf->addLib(QString("-L") + s); + }else{ + if(!conf->findLibrary("curl", &s)) { + qWarning("libcurl library not found!"); + return false; + } + if (!s.isEmpty()) + conf->addLib(QString("-L") + s); + } + + conf->addLib("-lcurl"); + + return true; } }; #line 1 "python.qcm" @@ -1366,6 +1394,7 @@ export EX_QTDIR export QC_WITH_LIBTORRENT_INC export QC_WITH_LIBTORRENT_LIB export QC_WITH_LIBCURL_INC +export QC_WITH_LIBCURL_LIB export QC_DEBUG rm -rf .qconftemp ( diff --git a/qcm/libcurl.qcm b/qcm/libcurl.qcm index 66db0e644..d49c59401 100644 --- a/qcm/libcurl.qcm +++ b/qcm/libcurl.qcm @@ -2,6 +2,7 @@ -----BEGIN QCMOD----- name: libcurl arg: with-libcurl-inc=[path], Path to libcurl include files +arg: with-libcurl-lib=[path], Path to libcurl library files -----END QCMOD----- */ class qc_libcurl : public ConfObj @@ -19,18 +20,35 @@ public: return false; } conf->addIncludePath(s); - return true; }else{ QStringList sl; sl += "/usr/include"; sl += "/usr/local/include"; - sl += "/sw/include"; if(!conf->findHeader("curl/curl.h", sl, &s)) { qWarning("libcurl includes not found!"); return false; } conf->addIncludePath(s); - return true; } + + s = conf->getenv("QC_WITH_LIBCURL_LIB"); + if(!s.isEmpty()) { + if(!conf->checkLibrary(s, "curl")) { + qWarning("libcurl library not found!"); + return false; + } + conf->addLib(QString("-L") + s); + }else{ + if(!conf->findLibrary("curl", &s)) { + qWarning("libcurl library not found!"); + return false; + } + if (!s.isEmpty()) + conf->addLib(QString("-L") + s); + } + + conf->addLib("-lcurl"); + + return true; } }; diff --git a/qcm/libtorrent.qcm b/qcm/libtorrent.qcm index 1a6693ad3..31907612e 100644 --- a/qcm/libtorrent.qcm +++ b/qcm/libtorrent.qcm @@ -21,7 +21,10 @@ public: } conf->addIncludePath(s); }else{ - if(!conf->findHeader("libtorrent/extensions/ut_pex.hpp", QStringList(), &s)) { + QStringList sl; + sl << "/usr/include/"; + sl << "/usr/local/include"; + if(!conf->findHeader("libtorrent/extensions/ut_pex.hpp", sl, &s)) { qWarning("libtorrent v0.12 includes not found!\nYou can download it at http://www.libtorrent.net"); return false; }