From a8bc3f6d4dde807b616555b27b2b9916fec2a34d Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 1 Jan 2011 17:21:02 +0000 Subject: [PATCH] BUGFIX: Added --enable-debug parameter to the configure script --- Changelog | 3 +++ configure | 46 ++++++++++++++++++++++----------------- qbittorrent.qc | 2 ++ qcm/qt4.qcm | 9 +++++++- src/src.pro | 59 ++++++++++++++++++++++---------------------------- unixconf.pri | 3 +++ 6 files changed, 68 insertions(+), 54 deletions(-) diff --git a/Changelog b/Changelog index 29c1624dd..1b2fe420d 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +* Unreleased - Christophe Dumez - v2.5.4 + - BUGFIX: Added --enable-debug parameter to the configure script + * Sat Jan 1 2011 - Christophe Dumez - v2.5.3 - BUGFIX: Fix priority up/down for multiple torrents at the same time (closes #692184) - BUGFIX: Make sure the number of torrents is properly set on startup (closes #694135) diff --git a/configure b/configure index de6c56c84..e0b424335 100755 --- a/configure +++ b/configure @@ -18,22 +18,21 @@ Main options: --help This help text. Dependency options: + --enable-debug Enable debug mode --disable-gui Disable qBittorrent Graphical user interface for headless running + --enable-debug Enable debug mode --with-libboost-inc=[path] Path to libboost include files --with-libboost-lib=[path] Path to libboost library files --disable-libnotify Disable use of libnotify - --disable-geoip-database Disable use of geoip-database --with-geoip-database-embedded Geoip Database will be embedded in qBittorrent executable (please follow instructions in src/geoip/README) - --disable-qtsingleapplication Disable use of - qtsingleapplication --with-qtsingleapplication=[system|shipped] Use the shipped qtsingleapplication library or the system one @@ -153,11 +152,21 @@ while [ $# -gt 0 ]; do shift ;; + --enable-debug) + QC_ENABLE_DEBUG="Y" + shift + ;; + --disable-gui) QC_DISABLE_GUI="Y" shift ;; + --enable-debug) + QC_ENABLE_DEBUG="Y" + shift + ;; + --with-libboost-inc=*) QC_WITH_LIBBOOST_INC=$optarg shift @@ -173,21 +182,11 @@ while [ $# -gt 0 ]; do shift ;; - --disable-geoip-database) - QC_DISABLE_geoip_database="Y" - shift - ;; - --with-geoip-database-embedded) QC_WITH_GEOIP_DATABASE_EMBEDDED="Y" shift ;; - --disable-qtsingleapplication) - QC_DISABLE_qtsingleapplication="Y" - shift - ;; - --with-qtsingleapplication=*) QC_WITH_QTSINGLEAPPLICATION=$optarg shift @@ -214,13 +213,13 @@ echo PREFIX=$PREFIX echo BINDIR=$BINDIR echo DATADIR=$DATADIR echo EX_QTDIR=$EX_QTDIR +echo QC_ENABLE_DEBUG=$QC_ENABLE_DEBUG echo QC_DISABLE_GUI=$QC_DISABLE_GUI +echo QC_ENABLE_DEBUG=$QC_ENABLE_DEBUG echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC echo QC_WITH_LIBBOOST_LIB=$QC_WITH_LIBBOOST_LIB echo QC_DISABLE_libnotify=$QC_DISABLE_libnotify -echo QC_DISABLE_geoip_database=$QC_DISABLE_geoip_database echo QC_WITH_GEOIP_DATABASE_EMBEDDED=$QC_WITH_GEOIP_DATABASE_EMBEDDED -echo QC_DISABLE_qtsingleapplication=$QC_DISABLE_qtsingleapplication echo QC_WITH_QTSINGLEAPPLICATION=$QC_WITH_QTSINGLEAPPLICATION echo fi @@ -327,7 +326,9 @@ cat >$1/modules.cpp <= 4.5 +arg: enable-debug, Enable debug mode arg: disable-gui, Disable qBittorrent Graphical user interface for headless running +arg: enable-debug, Enable debug mode -----END QCMOD----- */ class qc_qt4 : public ConfObj @@ -338,9 +339,14 @@ public: QString shortname() const { return "Qt 4.5"; } bool exec() { + // NOX mode if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) { conf->addExtra("CONFIG += nox"); - } + } + // Debug mode + if(!conf->getenv("QC_ENABLE_DEBUG").isEmpty()) { + conf->addExtra("CONFIG += debug"); + } return(QT_VERSION >= 0x040500); } }; @@ -653,10 +659,10 @@ cat >$1/modules_new.cpp <required = false; o->disabled = false; o = new qc_geoip_database(conf); - o->required = false; + o->required = true; o->disabled = false; o = new qc_qtsingleapplication(conf); - o->required = false; + o->required = true; o->disabled = false; EOT @@ -1603,13 +1609,13 @@ export PREFIX export BINDIR export DATADIR export EX_QTDIR +export QC_ENABLE_DEBUG export QC_DISABLE_GUI +export QC_ENABLE_DEBUG export QC_WITH_LIBBOOST_INC export QC_WITH_LIBBOOST_LIB export QC_DISABLE_libnotify -export QC_DISABLE_geoip_database export QC_WITH_GEOIP_DATABASE_EMBEDDED -export QC_DISABLE_qtsingleapplication export QC_WITH_QTSINGLEAPPLICATION export QC_VERBOSE rm -rf .qconftemp diff --git a/qbittorrent.qc b/qbittorrent.qc index c9d1811ea..f102f2d0e 100644 --- a/qbittorrent.qc +++ b/qbittorrent.qc @@ -18,7 +18,9 @@ + + diff --git a/qcm/qt4.qcm b/qcm/qt4.qcm index d7b4d228d..126c94fe6 100644 --- a/qcm/qt4.qcm +++ b/qcm/qt4.qcm @@ -1,7 +1,9 @@ /* -----BEGIN QCMOD----- name: Qt >= 4.5 +arg: enable-debug, Enable debug mode arg: disable-gui, Disable qBittorrent Graphical user interface for headless running +arg: enable-debug, Enable debug mode -----END QCMOD----- */ class qc_qt4 : public ConfObj @@ -12,9 +14,14 @@ public: QString shortname() const { return "Qt 4.5"; } bool exec() { + // NOX mode if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) { conf->addExtra("CONFIG += nox"); - } + } + // Debug mode + if(!conf->getenv("QC_ENABLE_DEBUG").isEmpty()) { + conf->addExtra("CONFIG += debug"); + } return(QT_VERSION >= 0x040500); } }; diff --git a/src/src.pro b/src/src.pro index 32325da5b..0b1b7618c 100644 --- a/src/src.pro +++ b/src/src.pro @@ -2,39 +2,6 @@ TEMPLATE = app CONFIG += qt thread -unix:!macx { - exists(../conf.pri) { - # generated by configure - include(../conf.pri) - } -} - -nox { - QT = core - TARGET = qbittorrent-nox - DEFINES += DISABLE_GUI -} else { - QT += xml - TARGET = qbittorrent -} -QT += network - -# Vars -LANG_PATH = lang -ICONS_PATH = Icons - -# use "CONFIG -= debug" to disable debug -CONFIG -= debug -CONFIG += release - -# Disable debug output in release mode -!debug { - DEFINES += QT_NO_DEBUG_OUTPUT -} - -# VERSION DEFINES -include(../version.pri) - # Windows specific configuration win32 { include(../winconf.pri) @@ -55,6 +22,32 @@ os2 { include(../os2conf.pri) } +nox { + QT -= gui + TARGET = qbittorrent-nox + DEFINES += DISABLE_GUI +} else { + QT += xml + TARGET = qbittorrent +} +QT += network + +# Vars +LANG_PATH = lang +ICONS_PATH = Icons + +CONFIG(debug, debug|release):message(Project is built in DEBUG mode.) +CONFIG(release, debug|release):message(Project is built in RELEASE mode.) + +# Disable debug output in release mode +!debug { + message(Disabling debug output.) + DEFINES += QT_NO_DEBUG_OUTPUT +} + +# VERSION DEFINES +include(../version.pri) + DEFINES += QT_NO_CAST_TO_ASCII # Fast concatenation (Qt >= 4.6) DEFINES += QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_PLUS diff --git a/unixconf.pri b/unixconf.pri index 184d5204c..abc5e1f49 100644 --- a/unixconf.pri +++ b/unixconf.pri @@ -1,3 +1,6 @@ +# Generated by the configure file +include(../conf.pri) + # COMPILATION SPECIFIC QT += dbus QMAKE_LFLAGS_APP += -rdynamic