From fc263f4c40a42a6803cc6d8285887405de940fd9 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 12 May 2008 09:32:54 +0000 Subject: [PATCH] Add configure bat QWT libraries, so that bat can be built with or without the QWT libaries. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6956 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/config.h.in | 3 +++ bacula/autoconf/configure.in | 12 +++++++--- bacula/configure | 28 ++++++++++++++++------- bacula/src/qt-console/bat.h | 2 +- bacula/src/qt-console/bat.pro.in | 14 ++++++++---- bacula/src/qt-console/joblist/joblist.cpp | 9 ++++++++ bacula/src/qt-console/joblist/joblist.h | 2 ++ bacula/src/qt-console/mainwin.cpp | 9 ++++++++ bacula/src/qt-console/mainwin.h | 4 +++- bacula/src/version.h | 4 ++-- bacula/technotes-2.1 | 3 +++ 11 files changed, 70 insertions(+), 20 deletions(-) diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 1c3a0aff69..260b0398d0 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -527,6 +527,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H +/* Set if bat QWT library found */ +#undef HAVE_QWT + /* Define to 1 if you have the `readdir_r' function. */ #undef HAVE_READDIR_R diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index b0338e7b40..4b004db182 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -272,6 +272,8 @@ fi got_qwt=no QWT_INC= QWT_LDFLAGS= +QWT_LIB= +QWT= if test x$support_bat = xyes; then AC_MSG_CHECKING(for qwt support) AC_ARG_WITH(qwt, @@ -284,6 +286,8 @@ if test x$support_bat = xyes; then if test -f ${with_qwt}/include/qwt.h; then QWT_INC="${with_qwt}/include" QWT_LDFLAGS="-L${with_qwt}/lib" + QWT_LIB="-lqwt" + QWT="qwt" fi ;; esac @@ -302,6 +306,8 @@ if test x$support_bat = xyes; then else QWT_LDFLAGS="-L${root}/lib" fi + QWT_LIB="-lqwt" + QWT="qwt" got_qwt=yes break; fi @@ -310,10 +316,8 @@ if test x$support_bat = xyes; then fi if test x$QWT_INC = x; then AC_MSG_RESULT(no) - AC_MSG_ERROR(Unable to find qwt package needed by bat) - BAT_DIR= - support_bat=no else + AC_DEFINE(HAVE_QWT, 1, [Set if bat QWT library found]) AC_MSG_RESULT(yes) fi fi @@ -321,6 +325,8 @@ fi AC_SUBST(BAT_DIR) AC_SUBST(QWT_INC) AC_SUBST(QWT_LDFLAGS) +AC_SUBST(QWT_LIB) +AC_SUBST(QWT) # ------------------------------------------- diff --git a/bacula/configure b/bacula/configure index 55cf39024f..ce0bed17a1 100755 --- a/bacula/configure +++ b/bacula/configure @@ -774,6 +774,8 @@ GNOME_DIR BAT_DIR QWT_INC QWT_LDFLAGS +QWT_LIB +QWT WXCONS_CPPFLAGS WXCONS_LDFLAGS WX_DIR @@ -13512,6 +13514,8 @@ fi got_qwt=no QWT_INC= QWT_LDFLAGS= +QWT_LIB= +QWT= if test x$support_bat = xyes; then { echo "$as_me:$LINENO: checking for qwt support" >&5 echo $ECHO_N "checking for qwt support... $ECHO_C" >&6; } @@ -13526,6 +13530,8 @@ if test "${with_qwt+set}" = set; then if test -f ${with_qwt}/include/qwt.h; then QWT_INC="${with_qwt}/include" QWT_LDFLAGS="-L${with_qwt}/lib" + QWT_LIB="-lqwt" + QWT="qwt" fi ;; esac @@ -13546,6 +13552,8 @@ fi else QWT_LDFLAGS="-L${root}/lib" fi + QWT_LIB="-lqwt" + QWT="qwt" got_qwt=yes break; fi @@ -13555,12 +13563,12 @@ fi if test x$QWT_INC = x; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } - { { echo "$as_me:$LINENO: error: Unable to find qwt package needed by bat" >&5 -echo "$as_me: error: Unable to find qwt package needed by bat" >&2;} - { (exit 1); exit 1; }; } - BAT_DIR= - support_bat=no else + +cat >>confdefs.h <<\_ACEOF +#define HAVE_QWT 1 +_ACEOF + { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } fi @@ -13571,6 +13579,8 @@ fi + + # ------------------------------------------- # bwx-console (default off) # ------------------------------------------- @@ -31048,6 +31058,8 @@ GNOME_DIR!$GNOME_DIR$ac_delim BAT_DIR!$BAT_DIR$ac_delim QWT_INC!$QWT_INC$ac_delim QWT_LDFLAGS!$QWT_LDFLAGS$ac_delim +QWT_LIB!$QWT_LIB$ac_delim +QWT!$QWT$ac_delim WXCONS_CPPFLAGS!$WXCONS_CPPFLAGS$ac_delim WXCONS_LDFLAGS!$WXCONS_LDFLAGS$ac_delim WX_DIR!$WX_DIR$ac_delim @@ -31076,8 +31088,6 @@ PYTHON_INCDIR!$PYTHON_INCDIR$ac_delim OPENSSL_LIBS!$OPENSSL_LIBS$ac_delim OPENSSL_INC!$OPENSSL_INC$ac_delim working_dir!$working_dir$ac_delim -archivedir!$archivedir$ac_delim -scriptdir!$scriptdir$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -31119,6 +31129,8 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +archivedir!$archivedir$ac_delim +scriptdir!$scriptdir$ac_delim dump_email!$dump_email$ac_delim job_email!$job_email$ac_delim smtp_host!$smtp_host$ac_delim @@ -31174,7 +31186,7 @@ DISTVER!$DISTVER$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 53; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 55; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/bacula/src/qt-console/bat.h b/bacula/src/qt-console/bat.h index 5b66229b8a..308f1e05cb 100644 --- a/bacula/src/qt-console/bat.h +++ b/bacula/src/qt-console/bat.h @@ -34,10 +34,10 @@ * Kern Sibbald, January 2007 */ +#include "config.h" #include #include #include "mainwin.h" -#include "config.h" #include "bacula.h" #include "bat_conf.h" #include "jcr.h" diff --git a/bacula/src/qt-console/bat.pro.in b/bacula/src/qt-console/bat.pro.in index acb80cf356..341dcd1480 100644 --- a/bacula/src/qt-console/bat.pro.in +++ b/bacula/src/qt-console/bat.pro.in @@ -7,7 +7,7 @@ # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # -CONFIG += qt debug +CONFIG += qt debug @QWT@ bins.path = /$(DESTDIR)@sbindir@ bins.files = ./bat @@ -20,7 +20,7 @@ DEPENDPATH += . INCLUDEPATH += .. . ./console ./restore ./select INCLUDEPATH += @QWT_INC@ LIBS += -L../lib -lbac @OPENSSL_LIBS@ -LIBS += @QWT_LDFLAGS@ -lqwt +LIBS += @QWT_LDFLAGS@ @QWT_LIB@ RESOURCES = main.qrc MOC_DIR = moc @@ -42,7 +42,9 @@ FORMS += medialist/medialist.ui mediaedit/mediaedit.ui joblist/joblist.ui FORMS += clients/clients.ui storage/storage.ui fileset/fileset.ui FORMS += joblog/joblog.ui jobs/jobs.ui FORMS += help/help.ui -FORMS += jobgraphs/jobplotcontrols.ui +qwt { + FORMS += jobgraphs/jobplotcontrols.ui +} # Main directory HEADERS += mainwin.h bat.h bat_conf.h qstd.h pages.h @@ -117,8 +119,10 @@ HEADERS += restore/restoretree.h SOURCES += restore/restoretree.cpp ## Job Step Graphs -HEADERS += jobgraphs/jobplot.h -SOURCES += jobgraphs/jobplot.cpp +qwt { + HEADERS += jobgraphs/jobplot.h + SOURCES += jobgraphs/jobplot.cpp +} # Help dialog HEADERS += help/help.h diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index dc2495579a..d04f01d91c 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -37,7 +37,9 @@ #include "joblist.h" #include "restore.h" #include "joblog/joblog.h" +#ifdef HAVE_QWT #include "jobgraphs/jobplot.h" +#endif /* * Constructor for the class @@ -403,7 +405,11 @@ void JobList::createConnections() connect(actionRefreshJobList, SIGNAL(triggered()), this, SLOT(populateTable())); connect(refreshButton, SIGNAL(pressed()), this, SLOT(populateTable())); +#ifdef HAVE_QWT connect(graphButton, SIGNAL(pressed()), this, SLOT(graphTable())); +#else + graphButton->setEnabled(false); +#endif /* for the tableItemChanged to maintain m_currentJob */ connect(mp_tableWidget, SIGNAL( currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)), @@ -568,6 +574,7 @@ void JobList::consoleCancelJob() /* * Graph this table */ +#ifdef HAVE_QWT void JobList::graphTable() { JobPlotPass pass; @@ -586,6 +593,8 @@ void JobList::graphTable() QTreeWidgetItem* pageSelectorTreeWidgetItem = mainWin->getFromHash(this); new JobPlot(pageSelectorTreeWidgetItem, pass); } +#endif + /* * Save user settings associated with this page */ diff --git a/bacula/src/qt-console/joblist/joblist.h b/bacula/src/qt-console/joblist/joblist.h index f16fbd9e02..27e65e4e96 100644 --- a/bacula/src/qt-console/joblist/joblist.h +++ b/bacula/src/qt-console/joblist/joblist.h @@ -67,7 +67,9 @@ private slots: void preRestoreFromTime(); void showLogForJob(); void consoleCancelJob(); +#ifdef HAVE_QWT void graphTable(); +#endif private: void createConnections(); diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index 5ce2baf2d1..3dbc1146e8 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -50,7 +50,9 @@ #include "restore/restoretree.h" #include "help/help.h" #include "jobs/jobs.h" +#ifdef HAVE_QWT #include "jobgraphs/jobplot.h" +#endif /* * Daemon message callback @@ -144,9 +146,12 @@ void MainWin::createPages() new FileSet(); new Jobs(); createPageJobList("", "", "", "", NULL); + +#ifdef HAVE_QWT JobPlotPass pass; pass.use = false; new JobPlot(NULL, pass); +#endif new MediaList(); new Storage(); new restoreTree(); @@ -233,7 +238,9 @@ void MainWin::createConnections() connect(actionRun, SIGNAL(triggered()), this, SLOT(runButtonClicked())); connect(actionEstimate, SIGNAL(triggered()), this, SLOT(estimateButtonClicked())); connect(actionBrowse, SIGNAL(triggered()), this, SLOT(browseButtonClicked())); +#ifdef HAVE_QWT connect(actionJobPlot, SIGNAL(triggered()), this, SLOT(jobPlotButtonClicked())); +#endif connect(actionRestore, SIGNAL(triggered()), this, SLOT(restoreButtonClicked())); connect(actionUndock, SIGNAL(triggered()), this, SLOT(undockWindowButton())); connect(actionToggleDock, SIGNAL(triggered()), this, SLOT(toggleDockContextWindow())); @@ -434,12 +441,14 @@ void MainWin::restoreButtonClicked() new prerestorePage(); } +#ifdef HAVE_QWT void MainWin::jobPlotButtonClicked() { JobPlotPass pass; pass.use = false; new JobPlot(NULL, pass); } +#endif /* * The user just finished typing a line in the command line edit box diff --git a/bacula/src/qt-console/mainwin.h b/bacula/src/qt-console/mainwin.h index 1db143c3a1..4cee8da0f6 100644 --- a/bacula/src/qt-console/mainwin.h +++ b/bacula/src/qt-console/mainwin.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2007 Free Software Foundation Europe e.V. + Copyright (C) 2007-2008 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -106,7 +106,9 @@ public slots: void runButtonClicked(); void estimateButtonClicked(); void browseButtonClicked(); +#ifdef HAVE_QWT void jobPlotButtonClicked(); +#endif void restoreButtonClicked(); void undockWindowButton(); void treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *); diff --git a/bacula/src/version.h b/bacula/src/version.h index cf68646fc7..49260476de 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.2.10-b3" -#define BDATE "11 May 2008" -#define LSMDATE "11May08" +#define BDATE "12 May 2008" +#define LSMDATE "12May08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 95ebf71c0a..071125d9a8 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -2,6 +2,9 @@ General: +12May08 +kes Add configure bat QWT libraries, so that bat can be built + with or without the QWT libaries. 11May08 kes Apply batfix bat cleanup patch from Riccardo. kes Make sure we unload the right slot when swapping. -- 2.39.5