commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4745 - in gnuradio/trunk: config gr-qtgui/src/lib


From: jcorgan
Subject: [Commit-gnuradio] r4745 - in gnuradio/trunk: config gr-qtgui/src/lib
Date: Tue, 13 Mar 2007 18:11:08 -0600 (MDT)

Author: jcorgan
Date: 2007-03-13 18:11:07 -0600 (Tue, 13 Mar 2007)
New Revision: 4745

Added:
   gnuradio/trunk/config/gr_qwt.m4
Modified:
   gnuradio/trunk/config/grc_gr_qtgui.m4
   gnuradio/trunk/gr-qtgui/src/lib/Makefile.am
   gnuradio/trunk/gr-qtgui/src/lib/fftdisplay.cc
   gnuradio/trunk/gr-qtgui/src/lib/fftdisplay.h
Log:
Created configuration file for QWT library.  This is in lieu of hand installing
a .pc file per the gr-qtgui README.  Component gr-qtgui is still disabled in 
configure.ac until testing is complete.  Requires qwt files to be included using
the #include <qwt/...> syntax; this is the default for binary installations of
the qwt library. Normal users will user run ./configure without any changes.


Added: gnuradio/trunk/config/gr_qwt.m4
===================================================================
--- gnuradio/trunk/config/gr_qwt.m4                             (rev 0)
+++ gnuradio/trunk/config/gr_qwt.m4     2007-03-14 00:11:07 UTC (rev 4745)
@@ -0,0 +1,99 @@
+dnl
+dnl Copyright 2007 Free Software Foundation, Inc.
+dnl 
+dnl This file is part of GNU Radio
+dnl 
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2, or (at your option)
+dnl any later version.
+dnl 
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING.  If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+dnl
+
+dnl Configure paths for library qwt.
+dnl
+dnl GR_PATH_QWT([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl
+dnl Test for library qwt, set QWT_CFLAGS and QWT_LIBS if found. Assumes 
+dnl QT_CFLAGS and QT_LIBS have already been correctly set.
+dnl
+
+AC_DEFUN([GR_QWT],
+[
+    dnl Save the environment
+    AC_LANG_PUSH(C++)
+    qwt_save_CPPFLAGS="$CPPFLAGS"
+    qwt_save_LIBS="$LIBS"
+    libqwt_ok=yes
+
+    dnl Allow user to specify where QWT files are
+    AC_ARG_WITH([qwt-libdir],
+               [  --with-qwt-libdir=path  Prefix where QWT library is 
installed (optional)],
+               [qwt_libdir="$withval"], [qwt_libdir=""])
+
+    AC_ARG_WITH([qwt-incdir],
+               [  --with-qwt-incdir=path  Prefix where QWT include files are 
(optional)],
+               [qwt_incdir="$withval"], [qwt_incdir=""])
+
+    dnl Create QWT_CFLAGS based on user input
+    AC_MSG_CHECKING(QWT_CFLAGS)
+    if test "$qwt_incdir" != "" ; then
+       QWT_CFLAGS="$QWT_CFLAGS -I$qwt_incdir"
+    fi
+    AC_MSG_RESULT($QWT_CFLAGS)
+    
+    dnl Set CPPFLAGS so C++ tests can operate
+    CPPFLAGS="$CPPFLAGS $QT_CFLAGS $QWT_CFLAGS"
+
+    dnl Check for presence of header files
+    AC_CHECK_HEADERS([qwt/qwt.h], 
+                    [],
+                    [libqwt_ok=no;AC_MSG_RESULT([cannot find usable qwt 
headers])]
+    )
+
+    dnl Set QWT_LIBS based on user input
+    AC_MSG_CHECKING(QWT_LIBS)
+    QWT_LIBS="-lqwt"
+    if test "$qwt_libdir" != "" ; then
+       QWT_LIBS="$QWT_LIBS -L$qwt_libdir"
+    fi
+    AC_MSG_RESULT($QWT_LIBS)
+
+    dnl Set LIBS so C++ link test can operate
+    LIBS="$QWT_LIBS $QT_LIBS $LIBS"
+
+    dnl Check that library files can be linked in
+    dnl This references an arbitrary static class method 
+    AC_TRY_LINK([#include <qwt/qwt_text.h>],
+               [Qt::TextFormat tf = QwtText::defaultFormat()],
+               [],
+                [libqwt_ok=no]
+    )
+
+    dnl Restore saved variables
+    LIBS="$qwt_save_LIBS"
+    CPPFLAGS="$qwt_save_CPPFLAGS"
+    AC_LANG_POP
+
+    dnl Execute user actions
+    if test "x$libqwt_ok" = "xyes" ; then
+       ifelse([$1], , :, [$1])
+    else
+       QWT_CFLAGS=""
+       QWT_LIBDIRS=""
+       ifelse([$2], , :, [$2])
+    fi
+
+    dnl Export our variables
+    AC_SUBST(QWT_CFLAGS)
+    AC_SUBST(QWT_LIBS)
+])


Property changes on: gnuradio/trunk/config/gr_qwt.m4
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: gnuradio/trunk/config/grc_gr_qtgui.m4
===================================================================
--- gnuradio/trunk/config/grc_gr_qtgui.m4       2007-03-13 20:44:40 UTC (rev 
4744)
+++ gnuradio/trunk/config/grc_gr_qtgui.m4       2007-03-14 00:11:07 UTC (rev 
4745)
@@ -26,22 +26,19 @@
          gr-qtgui/src/lib/Makefile \
     ])
 
+    # Check for package qt or qt-mt, set QT_CFLAGS and QT_LIBS
     passed=yes
     PKG_CHECK_MODULES(QT, qt >= 3.3,[],
-    [passed=no;AC_MSG_RESULT([gr-qtgui requires qt, not found. Checking for 
qt-mt])])
+    [passed=no;AC_MSG_RESULT([gr-qtgui requires libqt or libqt-mt, libqt not 
found. Checking for libqt-mt])])
 
     if test x$passed == xno; then
        passed=yes
        PKG_CHECK_MODULES(QT, qt-mt >= 3.3,[],
-       [passed=no;AC_MSG_RESULT([gr-qtgui requires qt, not found. Checking for 
qt-mt])])
+       [passed=no;AC_MSG_RESULT([gr-qtgui requires libqt or libqt-mt, neither 
found.])])
     fi
 
-    PKG_CHECK_MODULES(qwt, qwt >= 5.0,[],
-    [passed=no;AC_MSG_RESULT([gr-qtgui requires qwt, not found. Checking for 
qt-mt])])
+    # Fetch QWT variables
+    GR_QWT([], [passed=no])
 
-    
-    GRC_BUILD_CONDITIONAL([gr-qtgui], [
-    AC_SUBST(QT_LIBS)
-    AC_SUBST(QWT_CFLAGS)
-    AC_SUBST(QWT_LIBS)])
+    GRC_BUILD_CONDITIONAL([gr-qtgui],[])
 ])

Modified: gnuradio/trunk/gr-qtgui/src/lib/Makefile.am
===================================================================
--- gnuradio/trunk/gr-qtgui/src/lib/Makefile.am 2007-03-13 20:44:40 UTC (rev 
4744)
+++ gnuradio/trunk/gr-qtgui/src/lib/Makefile.am 2007-03-14 00:11:07 UTC (rev 
4745)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004,2005 Free Software Foundation, Inc.
+# Copyright 2004,2005,2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -48,7 +48,7 @@
 
 nodist_qt_examples_SOURCES =           \
        $(BUILT_SOURCES)
-       
+
 qt_examples_SOURCES =                  \
        fftdisplay.cc                   \
        qt_examples.cc
@@ -57,9 +57,5 @@
                    $(QT_LIBS)          \
                    $(GNURADIO_CORE_LA)
 
-
-qt_examples_LDFLAGS = $(QT_CFLAGS)     \
-                     $(QWT_CFLAGS)
-
 MOSTLYCLEANFILES =                     \
        *~ $(BUILT_SOURCES)

Modified: gnuradio/trunk/gr-qtgui/src/lib/fftdisplay.cc
===================================================================
--- gnuradio/trunk/gr-qtgui/src/lib/fftdisplay.cc       2007-03-13 20:44:40 UTC 
(rev 4744)
+++ gnuradio/trunk/gr-qtgui/src/lib/fftdisplay.cc       2007-03-14 00:11:07 UTC 
(rev 4745)
@@ -1,10 +1,10 @@
 #ifndef FFT_DISPLAY_CC
 #define FFT_DISPLAY_CC
 
-#include <qwt_painter.h>
-#include <qwt_plot_canvas.h>
-#include <qwt_plot_curve.h>
-#include <qwt_scale_engine.h>
+#include <qwt/qwt_painter.h>
+#include <qwt/qwt_plot_canvas.h>
+#include <qwt/qwt_plot_curve.h>
+#include <qwt/qwt_scale_engine.h>
 #include <qapplication.h>
 #include <fftdisplay.h>
 

Modified: gnuradio/trunk/gr-qtgui/src/lib/fftdisplay.h
===================================================================
--- gnuradio/trunk/gr-qtgui/src/lib/fftdisplay.h        2007-03-13 20:44:40 UTC 
(rev 4744)
+++ gnuradio/trunk/gr-qtgui/src/lib/fftdisplay.h        2007-03-14 00:11:07 UTC 
(rev 4745)
@@ -6,7 +6,7 @@
 #include <vector>
 
 #include <qwidget.h>
-#include <qwt_plot.h>
+#include <qwt/qwt_plot.h>
 #include <qevent.h>
 
 class fft_display_event:public QCustomEvent{





reply via email to

[Prev in Thread] Current Thread [Next in Thread]