Browse Source

- qConf is buggy and the configure file was not working properly. I had to rewrite most of the configure code to get it working.

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
732cc41be4
  1. 44
      qcm/libboost.qcm
  2. 35
      qcm/libcurl.qcm
  3. 34
      qcm/libtorrent.qcm

44
qcm/libboost.qcm

@ -1,6 +1,7 @@
/* /*
-----BEGIN QCMOD----- -----BEGIN QCMOD-----
name: libboost name: libboost
arg: with-libboost-inc=[path], Path to libboost include files
-----END QCMOD----- -----END QCMOD-----
*/ */
class qc_libboost : public ConfObj class qc_libboost : public ConfObj
@ -11,30 +12,45 @@ public:
QString shortname() const { return "libboost"; } QString shortname() const { return "libboost"; }
bool exec(){ bool exec(){
QString s; QString s;
s = conf->getenv("QC_WITH_LIBBOOST_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "boost/format.hpp")) {
return false;
}
if(!conf->checkHeader(s, "boost/date_time/posix_time/posix_time.hpp")) {
return false;
}
if(!conf->checkHeader(s, "boost/filesystem/path.hpp")) {
return false;
}
if(!conf->checkHeader(s, "boost/thread.hpp")) {
return false;
}
}else{
QStringList sl; QStringList sl;
sl += "/usr/include"; sl << "/usr/include";
sl += "/usr/local/include"; sl << "/usr/local/include";
sl += "/sw/include"; bool found = false;
if(!conf->findHeader("boost/format.hpp", sl, &s)) { foreach(s, sl){
qWarning("libboost includes not found!"); if(conf->checkHeader(s, "boost/format.hpp")){
found = true;
break;
}
}
if(!found) {
return false; return false;
} }
conf->addIncludePath(s); if(!conf->checkHeader(s, "boost/date_time/posix_time/posix_time.hpp")) {
if(!conf->findHeader("boost/date_time/posix_time/posix_time.hpp", sl, &s)) {
qWarning("libboost-date-time includes not found!");
return false; return false;
} }
conf->addIncludePath(s); if(!conf->checkHeader(s, "boost/filesystem/path.hpp")) {
if(!conf->findHeader("boost/filesystem/path.hpp", sl, &s)) {
qWarning("libboost-filesystem includes not found!");
return false; return false;
} }
if(!conf->findHeader("boost/thread.hpp", sl, &s)) { if(!conf->checkHeader(s, "boost/thread.hpp")) {
qWarning("libboost-thread includes not found!");
return false; return false;
} }
}
conf->addIncludePath(s); conf->addIncludePath(s);
return true; return true;
} }
}; };

35
qcm/libcurl.qcm

@ -16,39 +16,46 @@ public:
s = conf->getenv("QC_WITH_LIBCURL_INC"); s = conf->getenv("QC_WITH_LIBCURL_INC");
if(!s.isEmpty()) { if(!s.isEmpty()) {
if(!conf->checkHeader(s, "curl/curl.h")) { if(!conf->checkHeader(s, "curl/curl.h")) {
qWarning("libcurl includes not found!");
return false; return false;
} }
conf->addIncludePath(s);
}else{ }else{
QStringList sl; QStringList sl;
sl += "/usr/include"; sl << "/usr/include";
sl += "/usr/local/include"; sl << "/usr/local/include";
if(!conf->findHeader("curl/curl.h", sl, &s)) { bool found = false;
qWarning("libcurl includes not found!"); foreach(s, sl){
if(conf->checkHeader(s, "curl/curl.h")){
found = true;
break;
}
}
if(!found) {
return false; return false;
} }
conf->addIncludePath(s);
} }
conf->addIncludePath(s);
s = conf->getenv("QC_WITH_LIBCURL_LIB"); s = conf->getenv("QC_WITH_LIBCURL_LIB");
if(!s.isEmpty()) { if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "curl")) { if(!conf->checkLibrary(s, "curl")) {
qWarning("libcurl library not found!");
return false; return false;
} }
conf->addLib(QString("-L") + s); conf->addLib(QString("-L") + s);
}else{ }else{
if(!conf->findLibrary("curl", &s)) { QStringList sl;
qWarning("libcurl library not found!"); sl << "/usr/lib/";
return false; sl << "/usr/local/lib/";
bool found = false;
foreach(s, sl){
if(conf->checkLibrary(s, "curl")){
found = true;
break;
}
} }
if (!s.isEmpty()) if(!found) return false;
conf->addLib(QString("-L") + s); conf->addLib(QString("-L") + s);
} }
conf->addLib("-lcurl"); conf->addLib("-lcurl");
return true; return true;
} }
}; };

34
qcm/libtorrent.qcm

@ -16,39 +16,47 @@ public:
s = conf->getenv("QC_WITH_LIBTORRENT_INC"); s = conf->getenv("QC_WITH_LIBTORRENT_INC");
if(!s.isEmpty()) { if(!s.isEmpty()) {
if(!conf->checkHeader(s, "libtorrent/extensions/ut_pex.hpp")) { if(!conf->checkHeader(s, "libtorrent/extensions/ut_pex.hpp")) {
qWarning("libtorrent v0.12 includes not found!\nYou can download it at http://www.libtorrent.net");
return false; return false;
} }
conf->addIncludePath(s);
}else{ }else{
QStringList sl; QStringList sl;
sl << "/usr/include/"; sl << "/usr/include";
sl << "/usr/local/include"; sl << "/usr/local/include";
if(!conf->findHeader("libtorrent/extensions/ut_pex.hpp", sl, &s)) { bool found = false;
qWarning("libtorrent v0.12 includes not found!\nYou can download it at http://www.libtorrent.net"); foreach(s, sl){
if(conf->checkHeader(s, "libtorrent/extensions/ut_pex.hpp")){
found = true;
break;
}
}
if(!found) {
return false; return false;
} }
conf->addIncludePath(s);
} }
conf->addIncludePath(s);
conf->addIncludePath(s+QDir::separator()+"libtorrent");
s = conf->getenv("QC_WITH_LIBTORRENT_LIB"); s = conf->getenv("QC_WITH_LIBTORRENT_LIB");
if(!s.isEmpty()) { if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "torrent")) { if(!conf->checkLibrary(s, "torrent")) {
qWarning("libtorrent library not found!");
return false; return false;
} }
conf->addLib(QString("-L") + s); conf->addLib(QString("-L") + s);
}else{ }else{
if(!conf->findLibrary("torrent", &s)) { QStringList sl;
qWarning("libtorrent library not found!"); sl << "/usr/lib/";
return false; sl << "/usr/local/lib/";
bool found = false;
foreach(s, sl){
if(conf->checkLibrary(s, "torrent")){
found = true;
break;
}
} }
if (!s.isEmpty()) if(!found) return false;
conf->addLib(QString("-L") + s); conf->addLib(QString("-L") + s);
} }
conf->addLib("-ltorrent"); conf->addLib("-ltorrent");
return true; return true;
} }
}; };

Loading…
Cancel
Save