Merge branch 'patches/dward' of git@gnuradio.org:jcorgan
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Sun, 11 Oct 2009 15:42:37 +0000 (08:42 -0700)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Sun, 11 Oct 2009 15:42:37 +0000 (08:42 -0700)
* 'patches/dward' of git@gnuradio.org:jcorgan:
  #include "config.h" in db_wbxng.cc (for timespec, nanosleep, etc.)
  Add flags and dependencies for MinGW/MSYS.
  Add dependence of gruel on guile; fixes ticket #410.
  Use gruel::mutex instead of pthread_mutex in gr_histo_sink_f.
  Add .gitattributes to fix CRLF problems on MinGW/MSYS

.gitattributes [new file with mode: 0644]
.gitignore
config/gr_pwin32.m4
config/gr_python.m4
config/grc_gr_msdd6000.m4
config/grc_gruel.m4
gnuradio-core/src/lib/io/gr_histo_sink_f.cc
gnuradio-core/src/lib/io/gr_histo_sink_f.h
gnuradio-core/src/lib/missing/Makefile.am
usrp/host/lib/db_wbxng.cc

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..49a0e14
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# The following turn off LF->CRLF conversion for some files on Windows.
+# these conversions cause syntax errors on MinGW/MSYS.  They should not
+# have any effect on non-Windows systems or on Cygwin.  Any files that
+# required svn:eof-style=lf under subversion should be included here.
+#
+*.m4   -crlf
+*.ac   -crlf
+*.scm  -crlf
index 5461bf8bf37b0c9d17b201727961e7ce7cec6e66..dba263ac2390a610095a01829bbe41eb7ec33ac9 100644 (file)
@@ -24,6 +24,7 @@
 .libs
 TAGS
 *-stamp
+!.gitattributes
 !.gitignore
 make.log
 /configure
index 7b99cba6b7301de4f0c2720ab8d096cfd6e85b91..495e9dd4d39dba2246bbe9a48ef9fbd6715c2ec6 100644 (file)
@@ -99,6 +99,9 @@ struct timespec {
        long    tv_nsec;
 };
 #endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 static inline int nanosleep(const struct timespec *req, struct timespec *rem) { return usleep(req->tv_sec*1000000+req->tv_nsec/1000); }
 #endif
 
index 7479f0533dc921853d8e5bf6057344d007bdc855..43ccfc01575f5e0c53cab03a12f603e92c10c64b 100644 (file)
@@ -123,6 +123,12 @@ print path
              ;;
            esac
 
+           case $host_os in
+                *mingw* )
+             # Python 2.5 requires ".pyd" instead of ".dll" for extensions
+             PYTHON_LDFLAGS="-shrext .pyd ${PYTHON_LDFLAGS}"
+           esac
+
            AC_SUBST(PYTHON_LDFLAGS)
        fi
 ])
index 6d40e893111e7263026c200fd427372ed473bf2a..0c6fc320ed5998c4eda3fe63509803285fc2b52f 100644 (file)
@@ -29,7 +29,7 @@ AC_DEFUN([GRC_GR_MSDD6000],[
     dnl Don't do gr-msdd6000 if gnuradio-core skipped
     GRC_CHECK_DEPENDENCY(gr-msdd6000, gnuradio-core)
 
-    AC_CHECK_HEADERS(netinet/in.h arpa/inet.h sys/socket.h netdb.h)
+    AC_CHECK_HEADERS(netinet/in.h arpa/inet.h sys/socket.h netdb.h, [], [passed=no])
 
     GRC_BUILD_CONDITIONAL([gr-msdd6000],[
         dnl run_tests is created from run_tests.in.  Make it executable.
index 7295714341b63edcb9ad43417db5933aeffe2a34..d8ac95fed63265dd3fa7a11b3e0f49a0cb14f615 100644 (file)
@@ -25,6 +25,10 @@ AC_DEFUN([GRC_GRUEL],[
     dnl   with : if the --with code didn't error out
     dnl   yes  : if the --enable code passed muster and all dependencies are met
     dnl   no   : otherwise
+    if test $passed = yes; then
+       dnl Don't do gruel if guile not available
+       GRC_CHECK_GUILE(gruel)
+    fi
     if test $passed != with; then
        dnl how and where to find INCLUDES and LA and such
        gruel_INCLUDES="\
index a923a7e45428529d11a0043ea425de6604249ba5..2885fe428a12575cfa04f4e59139b049885c763d 100644 (file)
@@ -53,7 +53,6 @@ gr_histo_sink_f::gr_histo_sink_f (gr_msg_queue_sptr msgq)
   : gr_sync_block ("histo_sink_f", gr_make_io_signature (1, 1, sizeof (float)), gr_make_io_signature (0, 0, 0)),
   d_msgq (msgq), d_num_bins(11), d_frame_size(1000), d_sample_count(0), d_bins(NULL), d_samps(NULL)
 {
-  pthread_mutex_init(&d_mutex, 0);
   //allocate arrays and clear
   set_num_bins(d_num_bins);
   set_frame_size(d_frame_size);
@@ -61,7 +60,6 @@ gr_histo_sink_f::gr_histo_sink_f (gr_msg_queue_sptr msgq)
 
 gr_histo_sink_f::~gr_histo_sink_f (void)
 {
-  pthread_mutex_destroy(&d_mutex);
   delete [] d_samps;
   delete [] d_bins;
 }
@@ -72,7 +70,7 @@ gr_histo_sink_f::work (int noutput_items,
   gr_vector_void_star &output_items)
 {
   const float *in = (const float *) input_items[0];
-  pthread_mutex_lock(&d_mutex);
+  gruel::scoped_lock guard(d_mutex);   // hold mutex for duration of this function
   for (unsigned int i = 0; i < (unsigned int)noutput_items; i++){
     d_samps[d_sample_count] = in[i];
     d_sample_count++;
@@ -82,7 +80,6 @@ gr_histo_sink_f::work (int noutput_items,
       clear();
     }
   }
-  pthread_mutex_unlock(&d_mutex);
   return noutput_items;
 }
 
@@ -148,22 +145,20 @@ gr_histo_sink_f::get_num_bins(void){
  **************************************************/
 void
 gr_histo_sink_f::set_frame_size(unsigned int frame_size){
-  pthread_mutex_lock(&d_mutex);
+  gruel::scoped_lock guard(d_mutex);   // hold mutex for duration of this function
   d_frame_size = frame_size;
   /* allocate a new sample array */
   delete [] d_samps;
   d_samps = new float[d_frame_size];
   clear();
-  pthread_mutex_unlock(&d_mutex);
 }
 
 void
 gr_histo_sink_f::set_num_bins(unsigned int num_bins){
-  pthread_mutex_lock(&d_mutex);
+  gruel::scoped_lock guard(d_mutex);   // hold mutex for duration of this function
   d_num_bins = num_bins;
   /* allocate a new bin array */
   delete [] d_bins;
   d_bins = new unsigned int[d_num_bins];
   clear();
-  pthread_mutex_unlock(&d_mutex);
 }
index 640398c60a4a1d960e132f42f436b16610b1c486..8ba45ec55cf5713856e8dd895c7bb37051b902b9 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <gr_sync_block.h>
 #include <gr_msg_queue.h>
-#include <pthread.h>
+#include <gruel/thread.h>
 
 class gr_histo_sink_f;
 typedef boost::shared_ptr<gr_histo_sink_f> gr_histo_sink_f_sptr;
@@ -45,7 +45,7 @@ private:
   unsigned int d_sample_count;
   unsigned int *d_bins;
   float *d_samps;
-  pthread_mutex_t d_mutex;
+  gruel::mutex d_mutex;
 
   friend gr_histo_sink_f_sptr gr_make_histo_sink_f (gr_msg_queue_sptr msgq);
   gr_histo_sink_f (gr_msg_queue_sptr msgq);
index 08e521cb362a04bff8d5ecb3e003a1ec1de49d9b..2383709101db330fa6f5cac5351b42a768b80372 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2003,2004,2008 Free Software Foundation, Inc.
+# Copyright 2003,2004,2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -33,6 +33,14 @@ EXTRA_DIST =                         \
 
 noinst_LTLIBRARIES = libmissing.la
 
-libmissing_la_SOURCES =        \
-       bug_work_around_8.cc    \
+libmissing_la_common_SOURCES = \
+       bug_work_around_8.cc
+
+powerpc_CODE = \
        posix_memalign.cc       
+
+if MD_CPU_powerpc
+libmissing_la_SOURCES = $(libmissing_la_common_SOURCES) $(powerpc_CODE)
+else
+libmissing_la_SOURCES = $(libmissing_la_common_SOURCES)
+endif
index 38c3a28860b7652b777353d5a185622c486eb1c3..56a8486ce1aaddf59814d5e9dadcf3aeee5a2655 100644 (file)
 // the Free Software Foundation, Inc., 51 Franklin Street,
 // Boston, MA 02110-1301, USA.
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <usrp/db_wbxng.h>
 #include "db_wbxng_adf4350.h"
 #include <db_base_impl.h>