From: Kern Sibbald Date: Mon, 12 May 2008 16:21:14 +0000 (+0000) Subject: Add configure bat QWT libraries, so that bat can be built X-Git-Tag: Release-7.0.0~4593 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4444b78dbdc2a3be6d064cb4be5d4eec3473aee1;p=bacula%2Fbacula 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/trunk@6957 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index fd50ccf18e..38459d5c33 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -9,9 +9,6 @@ /* Define if you want SmartAlloc debug code enabled */ #undef SMARTALLOC -/* Define if you want to use faketape driver */ -#undef USE_FAKETAPE - /* Define to `int' if doesn't define. */ #undef daddr_t @@ -533,6 +530,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 @@ -867,6 +867,9 @@ /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME +/* Set if you want faketape enabled */ +#undef USE_FAKETAPE + /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index ae994edfe2..c39f2e00c7 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -273,6 +273,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, @@ -285,6 +287,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 @@ -303,6 +307,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 @@ -311,10 +317,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 @@ -322,6 +326,8 @@ fi AC_SUBST(BAT_DIR) AC_SUBST(QWT_INC) AC_SUBST(QWT_LDFLAGS) +AC_SUBST(QWT_LIB) +AC_SUBST(QWT) # ------------------------------------------- @@ -400,7 +406,7 @@ fi # faketape (default off) # ------------------------------------------- AC_ARG_ENABLE(faketape, - [ --enable-faketape enable faketape debugging support [disabled]], + [ --enable-faketape enable faketape debugging support [disabled]], [if test x$enableval = xyes; then support_faketape=yes fi]) @@ -1388,16 +1394,16 @@ if test x$DB_TYPE = xdbi; then if test $DB_PROG = mysql; then A=`nm $DB_PROG_LIB | grep pthread_mutex_lock` - pkg=$? + pkg=$? fi if test $pkg = 0; then AC_ARG_ENABLE(batch-insert, - [ --enable-batch-insert enable the DB batch insert code [disabled]], + [ --enable-batch-insert enable the DB batch insert code [disabled]], [if test x$enableval = xno; then - support_batch_insert=no + support_batch_insert=no else - support_batch_insert=yes + support_batch_insert=yes fi]) fi fi diff --git a/bacula/configure b/bacula/configure index 6efb78a727..b7817aac83 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 @@ -833,6 +835,7 @@ SQL_INCLUDE SQL_BINDIR DBI_DBD_DRIVERDIR DB_PROG +DB_PROG_LIB cats DB_TYPE GETCONF @@ -1458,6 +1461,7 @@ Optional Features: --enable-bwx-console enable build of wxWidgets console disabled --enable-tray-monitor enable build of Gnome tray monitor (compatible with KDE) disabled --enable-smartalloc enable smartalloc debugging support disabled + --enable-faketape enable faketape debugging support disabled --enable-static-tools enable static tape tools disabled --enable-static-fd enable static File daemon disabled --enable-static-sd enable static Storage daemon disabled @@ -1473,6 +1477,7 @@ Optional Features: --disable-readline disable readline support disable --enable-batch-insert enable the DB batch insert code disabled + --enable-batch-insert enable the DB batch insert code disabled --disable-largefile omit support for large files Optional Packages: @@ -13425,7 +13430,7 @@ _ACEOF fi - +support_faketape=no support_mysql=no support_sqlite=no support_sqlite3=no @@ -13523,6 +13528,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; } @@ -13537,6 +13544,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 @@ -13557,6 +13566,8 @@ fi else QWT_LDFLAGS="-L${root}/lib" fi + QWT_LIB="-lqwt" + QWT="qwt" got_qwt=yes break; fi @@ -13566,12 +13577,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 @@ -13582,6 +13593,8 @@ fi + + # ------------------------------------------- # bwx-console (default off) # ------------------------------------------- @@ -13668,6 +13681,25 @@ _ACEOF fi +# ------------------------------------------- +# faketape (default off) +# ------------------------------------------- +# Check whether --enable-faketape was given. +if test "${enable_faketape+set}" = set; then + enableval=$enable_faketape; if test x$enableval = xyes; then + support_faketape=yes + fi +fi + + +if test x$support_faketape = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_FAKETAPE 1 +_ACEOF + +fi + # ------------------------------------------- # static-tools (default off) # ------------------------------------------- @@ -18014,10 +18046,48 @@ if test "${with_dbi_driver+set}" = set; then db_prog="mysql" if test -f /usr/local/mysql/bin/mysql; then SQL_BINDIR=/usr/local/mysql/bin + if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a \ + -o -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.so; then + SQL_LIBDIR=/usr/local/mysql/lib64/mysql + else + SQL_LIBDIR=/usr/local/mysql/lib/mysql + fi elif test -f /usr/bin/mysql; then SQL_BINDIR=/usr/bin + if test -f /usr/lib64/mysql/libmysqlclient_r.a \ + -o -f /usr/lib64/mysql/libmysqlclient_r.so; then + SQL_LIBDIR=/usr/lib64/mysql + elif test -f /usr/lib/mysql/libmysqlclient_r.a \ + -o -f /usr/lib/mysql/libmysqlclient_r.so; then + SQL_LIBDIR=/usr/lib/mysql + else + SQL_LIBDIR=/usr/lib + fi elif test -f /usr/local/bin/mysql; then SQL_BINDIR=/usr/local/bin + if test -f /usr/local/lib64/mysql/libmysqlclient_r.a \ + -o -f /usr/local/lib64/mysql/libmysqlclient_r.so; then + SQL_LIBDIR=/usr/local/lib64/mysql + elif test -f /usr/local/lib/mysql/libmysqlclient_r.a \ + -o -f /usr/local/lib/mysql/libmysqlclient_r.so; then + SQL_LIBDIR=/usr/local/lib/mysql + else + SQL_LIBDIR=/usr/local/lib + fi + elif test -f $withval/bin/mysql; then + SQL_BINDIR=$withval/bin + if test -f $withval/lib64/mysql/libmysqlclient_r.a \ + -o -f $withval/lib64/mysql/libmysqlclient_r.so; then + SQL_LIBDIR=$withval/lib64/mysql + elif test -f $withval/lib64/libmysqlclient_r.a \ + -o -f $withval/lib64/libmysqlclient_r.so; then + SQL_LIBDIR=$withval/lib64 + elif test -f $withval/lib/libmysqlclient_r.a \ + -o -f $withval/lib/libmysqlclient_r.so; then + SQL_LIBDIR=$withval/lib/ + else + SQL_LIBDIR=$withval/lib/mysql + fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } @@ -18025,23 +18095,47 @@ echo "${ECHO_T}no" >&6; } echo "$as_me: error: Unable to find mysql in standard locations" >&2;} { (exit 1); exit 1; }; } fi + DB_PROG_LIB=$SQL_LIBDIR/libmysqlclient_r.a ;; "postgresql") db_prog="postgresql" PG_CONFIG=`which pg_config` - if test -n "$PG_CONFIG";then + if test -n "$PG_CONFIG"; then SQL_BINDIR=`"$PG_CONFIG" --bindir` + SQL_LIBDIR=`"$PG_CONFIG" --libdir` elif test -f /usr/local/bin/psql; then SQL_BINDIR=/usr/local/bin + if test -d /usr/local/lib64; then + SQL_LIBDIR=/usr/local/lib64 + else + SQL_LIBDIR=/usr/local/lib + fi elif test -f /usr/bin/psql; then - SQL_BINDIR=/usr/bin + SQL_BINDIR=/usr/local/bin + if test -d /usr/lib64/postgresql; then + SQL_LIBDIR=/usr/lib64/postgresql + elif test -d /usr/lib/postgresql; then + SQL_LIBDIR=/usr/lib/postgresql + elif test -d /usr/lib64; then + SQL_LIBDIR=/usr/lib64 + else + SQL_LIBDIR=/usr/lib + fi + elif test -f $withval/bin/psql; then + SQL_BINDIR=$withval/bin + if test -d $withval/lib64; then + SQL_LIBDIR=$withval/lib64 + else + SQL_LIBDIR=$withval/lib + fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { { echo "$as_me:$LINENO: error: Unable to find psql in standard locations" >&5 echo "$as_me: error: Unable to find psql in standard locations" >&2;} { (exit 1); exit 1; }; } - fi + fi + DB_PROG_LIB=$SQL_LIBDIR/libpq.a ;; *) { echo "$as_me:$LINENO: result: no" >&5 @@ -18055,7 +18149,6 @@ echo "$as_me: error: Unable to set DBI driver. $withval is not supported" >&2;} { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } DB_PROG=$db_prog - else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } @@ -18076,6 +18169,7 @@ fi + # ------------------------------------------- # enable batch attribute DB insert (default on) # ------------------------------------------- @@ -18107,6 +18201,29 @@ fi if test x$DB_TYPE = xdbi; then DB_TYPE=$DB_PROG db_type=$DB_PROG + pkg=1 + # Check for batch insert + if test $DB_PROG = postgresql; then + A=`nm $DB_PROG_LIB | grep PQputCopyData` + pkg=$? + fi + + if test $DB_PROG = mysql; then + A=`nm $DB_PROG_LIB | grep pthread_mutex_lock` + pkg=$? + fi + + if test $pkg = 0; then + # Check whether --enable-batch-insert was given. +if test "${enable_batch_insert+set}" = set; then + enableval=$enable_batch_insert; if test x$enableval = xno; then + support_batch_insert=no + else + support_batch_insert=yes + fi +fi + + fi fi if test $support_batch_insert = yes ; then @@ -31303,6 +31420,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 @@ -31331,8 +31450,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 @@ -31374,6 +31491,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 @@ -31403,6 +31522,7 @@ SQL_INCLUDE!$SQL_INCLUDE$ac_delim SQL_BINDIR!$SQL_BINDIR$ac_delim DBI_DBD_DRIVERDIR!$DBI_DBD_DRIVERDIR$ac_delim DB_PROG!$DB_PROG$ac_delim +DB_PROG_LIB!$DB_PROG_LIB$ac_delim cats!$cats$ac_delim DB_TYPE!$DB_TYPE$ac_delim GETCONF!$GETCONF$ac_delim @@ -31431,7 +31551,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` = 55; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 58; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -32141,6 +32261,7 @@ Configuration on `date`: Encryption support: ${support_crypto} ZLIB support: ${have_zlib} enable-smartalloc: ${support_smartalloc} + enable-faketape: ${support_faketape} bat support: ${support_bat} ${QWT_LDFLAGS} enable-gnome: ${support_gnome} ${gnome_version} enable-bwx-console: ${support_wx_console} ${wx_version} 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 828836d692..bfb9871ffb 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 @@ -18,9 +18,12 @@ TEMPLATE = app TARGET = bat DEPENDPATH += . INCLUDEPATH += .. . ./console ./restore ./select -INCLUDEPATH += @QWT_INC@ LIBS += -L../lib -lbac @OPENSSL_LIBS@ -LIBS += @QWT_LDFLAGS@ -lqwt + +qwt { + INCLUDEPATH += @QWT_INC@ + LIBS += @QWT_LDFLAGS@ @QWT_LIB@ +} RESOURCES = main.qrc MOC_DIR = moc @@ -42,10 +45,12 @@ 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 FORMS += status/dirstat.ui FORMS += status/clientstat.ui FORMS += status/storstat.ui +qwt { + FORMS += jobgraphs/jobplotcontrols.ui +} # Main directory HEADERS += mainwin.h bat.h bat_conf.h qstd.h pages.h @@ -120,8 +125,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 4116d235d6..bb3e49d9cf 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 @@ -436,7 +438,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 *)), @@ -601,6 +607,7 @@ void JobList::consoleCancelJob() /* * Graph this table */ +#ifdef HAVE_QWT void JobList::graphTable() { JobPlotPass pass; @@ -619,6 +626,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 15ec02c28d..19456bf687 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 9a2b5ac78d..4a485b747e 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 #include "status/dirstat.h" /* @@ -145,10 +147,12 @@ void MainWin::createPages() new FileSet(); new Jobs(); createPageJobList("", "", "", "", NULL); +#ifdef HAVE_QWT JobPlotPass pass; pass.use = false; if (m_openPlot) new JobPlot(NULL, pass); +#endif new MediaList(); new Storage(); if (m_openBrowser) @@ -239,7 +243,9 @@ void MainWin::createConnections() connect(actionEstimate, SIGNAL(triggered()), this, SLOT(estimateButtonClicked())); connect(actionBrowse, SIGNAL(triggered()), this, SLOT(browseButtonClicked())); connect(actionStatusDirPage, SIGNAL(triggered()), this, SLOT(statusPageButtonClicked())); +#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())); @@ -461,12 +467,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 d96b5885c8..0316817d5a 100644 --- a/bacula/src/qt-console/mainwin.h +++ b/bacula/src/qt-console/mainwin.h @@ -116,7 +116,9 @@ public slots: void estimateButtonClicked(); void browseButtonClicked(); void statusPageButtonClicked(); +#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 4d64267f58..d55b977b73 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.3.21" -#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.3 b/bacula/technotes-2.3 index 91f1128019..38a4ec9d95 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -24,6 +24,9 @@ Add long term statistics job table General: +12May08 +kes Add configure bat QWT libraries, so that bat can be built + with or without the QWT libaries. 11May08 ebl Add dummy tape driver for regression tests. kes Make sure we unload the right slot when swapping.