[63574] trunk/dports/science/usrp/files

michaelld at macports.org michaelld at macports.org
Mon Feb 8 20:12:50 PST 2010


Revision: 63574
          http://trac.macports.org/changeset/63574
Author:   michaelld at macports.org
Date:     2010-02-08 20:12:49 -0800 (Mon, 08 Feb 2010)
Log Message:
-----------
added missing patches

Added Paths:
-----------
    trunk/dports/science/usrp/files/patch-configure.diff.orig
    trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_circular_linked_list.h.diff
    trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_ciurcular_buffer.h.diff
    trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_darwin.h.diff
    trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_fusb_darwin.cc.diff
    trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_fusb_darwin.h.diff

Added: trunk/dports/science/usrp/files/patch-configure.diff.orig
===================================================================
--- trunk/dports/science/usrp/files/patch-configure.diff.orig	                        (rev 0)
+++ trunk/dports/science/usrp/files/patch-configure.diff.orig	2010-02-09 04:12:49 UTC (rev 63574)
@@ -0,0 +1,829 @@
+--- configure	2009-07-14 18:56:02.000000000 -0400
++++ /Users/mlk/Desktop/configure_3.2.2	2009-10-26 15:30:14.000000000 -0400
+@@ -35894,9 +35894,195 @@
+ fi
+ done
+ 
++  req_libusb1=no
++  libusbok=no
++  have_libusb1=no
++  if test x$req_libusb1 = xyes; then
+ 
+ 
+-    libusbok=yes
++
++pkg_failed=no
++{ $as_echo "$as_me:$LINENO: checking for USB" >&5
++$as_echo_n "checking for USB... " >&6; }
++
++if test -n "$PKG_CONFIG"; then
++    if test -n "$USB_CFLAGS"; then
++        pkg_cv_USB_CFLAGS="$USB_CFLAGS"
++    else
++        if test -n "$PKG_CONFIG" && \
++    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb-1.0\"") >&5
++  ($PKG_CONFIG --exists --print-errors "libusb-1.0") 2>&5
++  ac_status=$?
++  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; then
++  pkg_cv_USB_CFLAGS=`$PKG_CONFIG --cflags "libusb-1.0" 2>/dev/null`
++else
++  pkg_failed=yes
++fi
++    fi
++else
++	pkg_failed=untried
++fi
++
++if test x$cross_compiling = xyes
++then
++    if test -n "$PKG_CONFIG"; then
++    if test -n "$USB_LIBS"; then
++        pkg_cv_USB_LIBS="$USB_LIBS"
++    else
++        if test -n "$PKG_CONFIG" && \
++    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb-1.0\"") >&5
++  ($PKG_CONFIG --exists --print-errors "libusb-1.0") 2>&5
++  ac_status=$?
++  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; then
++  pkg_cv_USB_LIBS=`$PKG_CONFIG --libs --static "libusb-1.0" 2>/dev/null`
++else
++  pkg_failed=yes
++fi
++    fi
++else
++	pkg_failed=untried
++fi
++    _pkg_tmp=
++  for flag in $pkg_cv_USB_LIBS; do
++    case $flag in
++    (-L/lib* | -L/usr/lib* )	   ;; # ignore
++    (*) _pkg_tmp="$_pkg_tmp $flag" ;;
++    esac
++  done
++  pkg_cv_USB_LIBS="$_pkg_tmp"
++else
++  if test -n "$PKG_CONFIG"; then
++    if test -n "$USB_LIBS"; then
++        pkg_cv_USB_LIBS="$USB_LIBS"
++    else
++        if test -n "$PKG_CONFIG" && \
++    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb-1.0\"") >&5
++  ($PKG_CONFIG --exists --print-errors "libusb-1.0") 2>&5
++  ac_status=$?
++  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; then
++  pkg_cv_USB_LIBS=`$PKG_CONFIG --libs --static "libusb-1.0" 2>/dev/null`
++else
++  pkg_failed=yes
++fi
++    fi
++else
++	pkg_failed=untried
++fi
++fi
++
++if test -n "$PKG_CONFIG"; then
++    if test -n "$USB_INCLUDEDIR"; then
++        pkg_cv_USB_INCLUDEDIR="$USB_INCLUDEDIR"
++    else
++        if test -n "$PKG_CONFIG" && \
++    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb-1.0\"") >&5
++  ($PKG_CONFIG --exists --print-errors "libusb-1.0") 2>&5
++  ac_status=$?
++  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; then
++  pkg_cv_USB_INCLUDEDIR=`$PKG_CONFIG --variable=includedir "libusb-1.0" 2>/dev/null`
++else
++  pkg_failed=yes
++fi
++    fi
++else
++	pkg_failed=untried
++fi
++
++
++
++
++if test $pkg_failed = yes; then
++
++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
++        _pkg_short_errors_supported=yes
++else
++        _pkg_short_errors_supported=no
++fi
++        if test $_pkg_short_errors_supported = yes; then
++	        USB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libusb-1.0"`
++        else
++	        USB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libusb-1.0"`
++        fi
++	# Put the nasty error message in config.log where it belongs
++	echo "$USB_PKG_ERRORS" >&5
++
++	{ { $as_echo "$as_me:$LINENO: error: Package requirements (libusb-1.0) were not met:
++
++$USB_PKG_ERRORS
++
++Consider adjusting the PKG_CONFIG_PATH environment variable if you
++installed software in a non-standard prefix.
++
++Alternatively, you may set the environment variables USB_CFLAGS
++and USB_LIBS to avoid the need to call pkg-config.
++See the pkg-config man page for more details.
++" >&5
++$as_echo "$as_me: error: Package requirements (libusb-1.0) were not met:
++
++$USB_PKG_ERRORS
++
++Consider adjusting the PKG_CONFIG_PATH environment variable if you
++installed software in a non-standard prefix.
++
++Alternatively, you may set the environment variables USB_CFLAGS
++and USB_LIBS to avoid the need to call pkg-config.
++See the pkg-config man page for more details.
++" >&2;}
++   { (exit 1); exit 1; }; }
++elif test $pkg_failed = untried; then
++	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++{ { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
++is in your PATH or set the PKG_CONFIG environment variable to the full
++path to pkg-config.
++
++Alternatively, you may set the environment variables USB_CFLAGS
++and USB_LIBS to avoid the need to call pkg-config.
++See the pkg-config man page for more details.
++
++To get pkg-config, see <http://pkg-config.freedesktop.org/>.
++See \`config.log' for more details." >&5
++$as_echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
++is in your PATH or set the PKG_CONFIG environment variable to the full
++path to pkg-config.
++
++Alternatively, you may set the environment variables USB_CFLAGS
++and USB_LIBS to avoid the need to call pkg-config.
++See the pkg-config man page for more details.
++
++To get pkg-config, see <http://pkg-config.freedesktop.org/>.
++See \`config.log' for more details." >&2;}
++   { (exit 1); exit 1; }; }; }
++else
++	USB_CFLAGS=$pkg_cv_USB_CFLAGS
++	USB_LIBS=$pkg_cv_USB_LIBS
++	USB_INCLUDEDIR=$pkg_cv_USB_INCLUDEDIR
++
++	USB_CPPFLAGS=""
++	for flag in $USB_CFLAGS; do
++	  case $flag in
++          -I* | -D* | -U*) USB_CPPFLAGS="$USB_CPPFLAGS $flag" ;;
++          esac
++        done
++	pkg_cv_USB_CPPFLAGS=$USB_CPPFLAGS
++
++
++        { $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
++
++      libusbok=yes
++      have_libusb1=yes
++      usb_header='libusb-1.0/libusb.h'
++      usb_lib_func='libusb_bulk_transfer'
++      usb_lib_name='usb-1.0'
++
++fi
++  else
++
+ 
+ 
+ 
+@@ -36011,283 +36197,187 @@
+ 
+ 	{ $as_echo "$as_me:$LINENO: result: no" >&5
+ $as_echo "no" >&6; }
++                libusbok=no
++elif test $pkg_failed = untried; then
++	libusbok=no
++else
++	USB_CFLAGS=$pkg_cv_USB_CFLAGS
++	USB_LIBS=$pkg_cv_USB_LIBS
++	USB_INCLUDEDIR=$pkg_cv_USB_INCLUDEDIR
+ 
+-        ac_ext=c
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_c_compiler_gnu
++	USB_CPPFLAGS=""
++	for flag in $USB_CFLAGS; do
++	  case $flag in
++          -I* | -D* | -U*) USB_CPPFLAGS="$USB_CPPFLAGS $flag" ;;
++          esac
++        done
++	pkg_cv_USB_CPPFLAGS=$USB_CPPFLAGS
+ 
+ 
++        { $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
++	libusbok=yes
++fi
++        if test $libusbok = no; then
+ 
+-for ac_header in usb.h
+-do
+-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+-$as_echo_n "checking for $ac_header... " >&6; }
+-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+-  $as_echo_n "(cached) " >&6
++
++
++pkg_failed=no
++{ $as_echo "$as_me:$LINENO: checking for USB" >&5
++$as_echo_n "checking for USB... " >&6; }
++
++if test -n "$PKG_CONFIG"; then
++    if test -n "$USB_CFLAGS"; then
++        pkg_cv_USB_CFLAGS="$USB_CFLAGS"
++    else
++        if test -n "$PKG_CONFIG" && \
++    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb-legacy\"") >&5
++  ($PKG_CONFIG --exists --print-errors "libusb-legacy") 2>&5
++  ac_status=$?
++  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; then
++  pkg_cv_USB_CFLAGS=`$PKG_CONFIG --cflags "libusb-legacy" 2>/dev/null`
++else
++  pkg_failed=yes
+ fi
+-ac_res=`eval 'as_val=${'$as_ac_Header'}
+-		 $as_echo "$as_val"'`
+-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+-$as_echo "$ac_res" >&6; }
++    fi
+ else
+-  # Is the header compilable?
+-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+-$as_echo_n "checking $ac_header usability... " >&6; }
+-cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-$ac_includes_default
+-#include <$ac_header>
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (ac_try="$ac_compile"
+-case "(($ac_try" in
+-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+-  *) ac_try_echo=$ac_try;;
+-esac
+-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+-  (eval "$ac_compile") 2>conftest.er1
++	pkg_failed=untried
++fi
++
++if test x$cross_compiling = xyes
++then
++    if test -n "$PKG_CONFIG"; then
++    if test -n "$USB_LIBS"; then
++        pkg_cv_USB_LIBS="$USB_LIBS"
++    else
++        if test -n "$PKG_CONFIG" && \
++    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb-legacy\"") >&5
++  ($PKG_CONFIG --exists --print-errors "libusb-legacy") 2>&5
+   ac_status=$?
+-  grep -v '^ *+' conftest.er1 >conftest.err
+-  rm -f conftest.er1
+-  cat conftest.err >&5
+   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } && {
+-	 test -z "$ac_c_werror_flag" ||
+-	 test ! -s conftest.err
+-       } && test -s conftest.$ac_objext; then
+-  ac_header_compiler=yes
++  (exit $ac_status); }; then
++  pkg_cv_USB_LIBS=`$PKG_CONFIG --libs --static "libusb-legacy" 2>/dev/null`
+ else
+-  $as_echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-	ac_header_compiler=no
++  pkg_failed=yes
+ fi
+-
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+-$as_echo "$ac_header_compiler" >&6; }
+-
+-# Is the header present?
+-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+-$as_echo_n "checking $ac_header presence... " >&6; }
+-cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-#include <$ac_header>
+-_ACEOF
+-if { (ac_try="$ac_cpp conftest.$ac_ext"
+-case "(($ac_try" in
+-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+-  *) ac_try_echo=$ac_try;;
+-esac
+-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
++    fi
++else
++	pkg_failed=untried
++fi
++    _pkg_tmp=
++  for flag in $pkg_cv_USB_LIBS; do
++    case $flag in
++    (-L/lib* | -L/usr/lib* )	   ;; # ignore
++    (*) _pkg_tmp="$_pkg_tmp $flag" ;;
++    esac
++  done
++  pkg_cv_USB_LIBS="$_pkg_tmp"
++else
++  if test -n "$PKG_CONFIG"; then
++    if test -n "$USB_LIBS"; then
++        pkg_cv_USB_LIBS="$USB_LIBS"
++    else
++        if test -n "$PKG_CONFIG" && \
++    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb-legacy\"") >&5
++  ($PKG_CONFIG --exists --print-errors "libusb-legacy") 2>&5
+   ac_status=$?
+-  grep -v '^ *+' conftest.er1 >conftest.err
+-  rm -f conftest.er1
+-  cat conftest.err >&5
+   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } >/dev/null && {
+-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+-	 test ! -s conftest.err
+-       }; then
+-  ac_header_preproc=yes
++  (exit $ac_status); }; then
++  pkg_cv_USB_LIBS=`$PKG_CONFIG --libs --static "libusb-legacy" 2>/dev/null`
+ else
+-  $as_echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-  ac_header_preproc=no
++  pkg_failed=yes
+ fi
+-
+-rm -f conftest.err conftest.$ac_ext
+-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+-$as_echo "$ac_header_preproc" >&6; }
+-
+-# So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+-  yes:no: )
+-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+-    ac_header_preproc=yes
+-    ;;
+-  no:yes:* )
+-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+-
+-    ;;
+-esac
+-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+-$as_echo_n "checking for $ac_header... " >&6; }
+-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+-  $as_echo_n "(cached) " >&6
++    fi
+ else
+-  eval "$as_ac_Header=\$ac_header_preproc"
++	pkg_failed=untried
+ fi
+-ac_res=`eval 'as_val=${'$as_ac_Header'}
+-		 $as_echo "$as_val"'`
+-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+-$as_echo "$ac_res" >&6; }
+-
+ fi
+-as_val=`eval 'as_val=${'$as_ac_Header'}
+-		 $as_echo "$as_val"'`
+-   if test "x$as_val" = x""yes; then
+-  cat >>confdefs.h <<_ACEOF
+-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+-_ACEOF
+ 
++if test -n "$PKG_CONFIG"; then
++    if test -n "$USB_INCLUDEDIR"; then
++        pkg_cv_USB_INCLUDEDIR="$USB_INCLUDEDIR"
++    else
++        if test -n "$PKG_CONFIG" && \
++    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb-legacy\"") >&5
++  ($PKG_CONFIG --exists --print-errors "libusb-legacy") 2>&5
++  ac_status=$?
++  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; then
++  pkg_cv_USB_INCLUDEDIR=`$PKG_CONFIG --variable=includedir "libusb-legacy" 2>/dev/null`
++else
++  pkg_failed=yes
++fi
++    fi
+ else
+-  libusbok=no; { $as_echo "$as_me:$LINENO: result: USRP requires libusb. usb.h not found. See http://libusb.sf.net" >&5
+-$as_echo "USRP requires libusb. usb.h not found. See http://libusb.sf.net" >&6; }
++	pkg_failed=untried
+ fi
+ 
+-done
+ 
+ 
+-	save_LIBS="$LIBS"
+-	case "$host_os" in
+-	  darwin*)
+-	    LIBS="$LIBS -lIOKit"
+-            ;;
+-	  *) ;;
+-        esac
+ 
+-	{ $as_echo "$as_me:$LINENO: checking for library containing usb_bulk_write" >&5
+-$as_echo_n "checking for library containing usb_bulk_write... " >&6; }
+-if test "${ac_cv_search_usb_bulk_write+set}" = set; then
+-  $as_echo_n "(cached) " >&6
+-else
+-  ac_func_search_save_LIBS=$LIBS
+-cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
++if test $pkg_failed = yes; then
+ 
+-/* Override any GCC internal prototype to avoid an error.
+-   Use char because int might match the return type of a GCC
+-   builtin and then its argument prototype would still apply.  */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-char usb_bulk_write ();
+-int
+-main ()
+-{
+-return usb_bulk_write ();
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-for ac_lib in '' usb; do
+-  if test -z "$ac_lib"; then
+-    ac_res="none required"
+-  else
+-    ac_res=-l$ac_lib
+-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+-  fi
+-  rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (ac_try="$ac_link"
+-case "(($ac_try" in
+-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+-  *) ac_try_echo=$ac_try;;
+-esac
+-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+-  (eval "$ac_link") 2>conftest.er1
+-  ac_status=$?
+-  grep -v '^ *+' conftest.er1 >conftest.err
+-  rm -f conftest.er1
+-  cat conftest.err >&5
+-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } && {
+-	 test -z "$ac_c_werror_flag" ||
+-	 test ! -s conftest.err
+-       } && test -s conftest$ac_exeext && {
+-	 test "$cross_compiling" = yes ||
+-	 $as_test_x conftest$ac_exeext
+-       }; then
+-  ac_cv_search_usb_bulk_write=$ac_res
++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
++        _pkg_short_errors_supported=yes
+ else
+-  $as_echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-
++        _pkg_short_errors_supported=no
+ fi
++        if test $_pkg_short_errors_supported = yes; then
++	        USB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libusb-legacy"`
++        else
++	        USB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libusb-legacy"`
++        fi
++	# Put the nasty error message in config.log where it belongs
++	echo "$USB_PKG_ERRORS" >&5
+ 
+-rm -rf conftest.dSYM
+-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+-      conftest$ac_exeext
+-  if test "${ac_cv_search_usb_bulk_write+set}" = set; then
+-  break
+-fi
+-done
+-if test "${ac_cv_search_usb_bulk_write+set}" = set; then
+-  :
+-else
+-  ac_cv_search_usb_bulk_write=no
+-fi
+-rm conftest.$ac_ext
+-LIBS=$ac_func_search_save_LIBS
+-fi
+-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_usb_bulk_write" >&5
+-$as_echo "$ac_cv_search_usb_bulk_write" >&6; }
+-ac_res=$ac_cv_search_usb_bulk_write
+-if test "$ac_res" != no; then
+-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+-  USB_LIBS="$LIBS"
++	{ $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
++                libusbok=no
++elif test $pkg_failed = untried; then
++	libusbok=no
+ else
+-  libusbok=no; { $as_echo "$as_me:$LINENO: result: USRP requires libusb. usb_bulk_write not found. See http://libusb.sf.net" >&5
+-$as_echo "USRP requires libusb. usb_bulk_write not found. See http://libusb.sf.net" >&6; }
+-fi
++	USB_CFLAGS=$pkg_cv_USB_CFLAGS
++	USB_LIBS=$pkg_cv_USB_LIBS
++	USB_INCLUDEDIR=$pkg_cv_USB_INCLUDEDIR
+ 
++	USB_CPPFLAGS=""
++	for flag in $USB_CFLAGS; do
++	  case $flag in
++          -I* | -D* | -U*) USB_CPPFLAGS="$USB_CPPFLAGS $flag" ;;
++          esac
++        done
++	pkg_cv_USB_CPPFLAGS=$USB_CPPFLAGS
+ 
+-        LIBS="$save_LIBS"
+ 
+-        ac_ext=c
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_c_compiler_gnu
++        { $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
++	libusbok=yes
++fi
++    fi
++        usb_header='usb.h'
++    usb_lib_func='usb_bulk_write'
++    usb_lib_name='usb'
++  fi
++  if test x$req_libusb1 != xyes || test $have_libusb1 = yes; then
++            libusbok=yes
+ 
+ 
+-elif test $pkg_failed = untried; then
+ 
+-        ac_ext=c
++    ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ 
++    save_CPPFLAGS="$CPPFLAGS"
++    if test x$USB_INCLUDEDIR != x; then
++      USB_INCLUDES="-I$USB_INCLUDEDIR"
++      CPPFLAGS="$CPPFLAGS $USB_INCLUDES"
+ 
++    fi
+ 
+-for ac_header in usb.h
++for ac_header in $usb_header
+ do
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+@@ -36429,27 +36519,49 @@
+ _ACEOF
+ 
+ else
+-  libusbok=no; { $as_echo "$as_me:$LINENO: result: USRP requires libusb. usb.h not found. See http://libusb.sf.net" >&5
+-$as_echo "USRP requires libusb. usb.h not found. See http://libusb.sf.net" >&6; }
++  libusbok=no
+ fi
+ 
+ done
+ 
++    CPPFLAGS="$save_CPPFLAGS"
++    ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ 
+-	save_LIBS="$LIBS"
+-	case "$host_os" in
+-	  darwin*)
+-	    LIBS="$LIBS -lIOKit"
+-            ;;
+-	  *) ;;
+-        esac
+ 
+-	{ $as_echo "$as_me:$LINENO: checking for library containing usb_bulk_write" >&5
+-$as_echo_n "checking for library containing usb_bulk_write... " >&6; }
+-if test "${ac_cv_search_usb_bulk_write+set}" = set; then
++    if test $libusbok = no; then
++      { $as_echo "$as_me:$LINENO: result: USRP requires libusb header '$usb_header' which was not found or was not usable. See http://www.libusb.org" >&5
++$as_echo "USRP requires libusb header '$usb_header' which was not found or was not usable. See http://www.libusb.org" >&6; }
++    else
++
++
++      ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++      save_LIBS="$LIBS"
++      LIBS=""
++      case "$host_os" in
++        darwin*)
++          USB_LIBS="$USB_LIBS -lIOKit"
++          LIBS="$USB_LIBS"
++          ;;
++        *) ;;
++      esac
++
++as_ac_Lib=`$as_echo "ac_cv_lib_$usb_lib_name''_$usb_lib_func" | $as_tr_sh`
++{ $as_echo "$as_me:$LINENO: checking for $usb_lib_func in -l$usb_lib_name" >&5
++$as_echo_n "checking for $usb_lib_func in -l$usb_lib_name... " >&6; }
++if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+   $as_echo_n "(cached) " >&6
+ else
+-  ac_func_search_save_LIBS=$LIBS
++  ac_check_lib_save_LIBS=$LIBS
++LIBS="-l$usb_lib_name  $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+@@ -36463,23 +36575,16 @@
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char usb_bulk_write ();
++char $usb_lib_func ();
+ int
+ main ()
+ {
+-return usb_bulk_write ();
++return $usb_lib_func ();
+   ;
+   return 0;
+ }
+ _ACEOF
+-for ac_lib in '' usb; do
+-  if test -z "$ac_lib"; then
+-    ac_res="none required"
+-  else
+-    ac_res=-l$ac_lib
+-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+-  fi
+-  rm -f conftest.$ac_objext conftest$ac_exeext
++rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (ac_try="$ac_link"
+ case "(($ac_try" in
+   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+@@ -36500,78 +36605,64 @@
+ 	 test "$cross_compiling" = yes ||
+ 	 $as_test_x conftest$ac_exeext
+        }; then
+-  ac_cv_search_usb_bulk_write=$ac_res
++  eval "$as_ac_Lib=yes"
+ else
+   $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+-
++	eval "$as_ac_Lib=no"
+ fi
+ 
+ rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+-      conftest$ac_exeext
+-  if test "${ac_cv_search_usb_bulk_write+set}" = set; then
+-  break
+-fi
+-done
+-if test "${ac_cv_search_usb_bulk_write+set}" = set; then
+-  :
+-else
+-  ac_cv_search_usb_bulk_write=no
+-fi
+-rm conftest.$ac_ext
+-LIBS=$ac_func_search_save_LIBS
++      conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_usb_bulk_write" >&5
+-$as_echo "$ac_cv_search_usb_bulk_write" >&6; }
+-ac_res=$ac_cv_search_usb_bulk_write
+-if test "$ac_res" != no; then
+-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+-  USB_LIBS="$LIBS"
++ac_res=`eval 'as_val=${'$as_ac_Lib'}
++		 $as_echo "$as_val"'`
++	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
++as_val=`eval 'as_val=${'$as_ac_Lib'}
++		 $as_echo "$as_val"'`
++   if test "x$as_val" = x""yes; then
++  cat >>confdefs.h <<_ACEOF
++#define `$as_echo "HAVE_LIB$usb_lib_name" | $as_tr_cpp` 1
++_ACEOF
++
++  LIBS="-l$usb_lib_name $LIBS"
++
+ else
+-  libusbok=no; { $as_echo "$as_me:$LINENO: result: USRP requires libusb. usb_bulk_write not found. See http://libusb.sf.net" >&5
+-$as_echo "USRP requires libusb. usb_bulk_write not found. See http://libusb.sf.net" >&6; }
+-fi
+ 
++        libusbok=no
++        { $as_echo "$as_me:$LINENO: result: USRP requires library '$usb_lib_name' with function '$usb_lib_func', which was either not found or was not usable. See http://www.libusb.org" >&5
++$as_echo "USRP requires library '$usb_lib_name' with function '$usb_lib_func', which was either not found or was not usable. See http://www.libusb.org" >&6; }
+ 
+-        LIBS="$save_LIBS"
++fi
+ 
+-        ac_ext=c
++      case "$host_os" in
++        cygwin* | mingw*)
++          USB_LIBS="$LIBS"
++          ;;
++        *) ;;
++      esac
++      LIBS="$save_LIBS"
++      ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ 
+-
+-else
+-	USB_CFLAGS=$pkg_cv_USB_CFLAGS
+-	USB_LIBS=$pkg_cv_USB_LIBS
+-	USB_INCLUDEDIR=$pkg_cv_USB_INCLUDEDIR
+-
+-	USB_CPPFLAGS=""
+-	for flag in $USB_CFLAGS; do
+-	  case $flag in
+-          -I* | -D* | -U*) USB_CPPFLAGS="$USB_CPPFLAGS $flag" ;;
+-          esac
+-        done
+-	pkg_cv_USB_CPPFLAGS=$USB_CPPFLAGS
+-
+-
+-        { $as_echo "$as_me:$LINENO: result: yes" >&5
+-$as_echo "yes" >&6; }
+-	:
+-fi
+-
+-    if test x$libusbok = xyes; then
+-
+-	:
+-    else
+-        passed=no;{ $as_echo "$as_me:$LINENO: result: Unable to find dependency libusb." >&5
+-$as_echo "Unable to find dependency libusb." >&6; }
+     fi
++  fi
++  if test $libusbok = yes; then
+ 
+-
++    :
++  else
++    USB_INCLUDES=
++    USB_LIBS=
++    passed=no;{ $as_echo "$as_me:$LINENO: result: Unable to find dependency libusb." >&5
++$as_echo "Unable to find dependency libusb." >&6; }
++  fi
+ 
+ 	sdccok=yes
+ 	# Extract the first word of "sdcc", so it can be a program name with args.

Added: trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_circular_linked_list.h.diff
===================================================================
--- trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_circular_linked_list.h.diff	                        (rev 0)
+++ trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_circular_linked_list.h.diff	2010-02-09 04:12:49 UTC (rev 63574)
@@ -0,0 +1,96 @@
+--- usrp/host/lib/legacy/circular_linked_list.h.orig	2010-02-04 20:33:16.000000000 -0500
++++ usrp/host/lib/legacy/circular_linked_list.h	2010-02-04 20:37:18.000000000 -0500
+@@ -1,6 +1,6 @@
+ /* -*- c++ -*- */
+ /*
+- * Copyright 2006 Free Software Foundation, Inc.
++ * Copyright 2006,2009 Free Software Foundation, Inc.
+  * 
+  * This file is part of GNU Radio.
+  *
+@@ -109,12 +109,12 @@
+ 
+ private:
+   s_node_ptr d_current, d_iterate, d_available, d_inUse;
+-  UInt32 d_n_nodes, d_n_used;
++  size_t d_n_nodes, d_n_used;
+   mld_mutex_ptr d_internal;
+   mld_condition_ptr d_ioBlock;
+ 
+ public:
+-  circular_linked_list (UInt32 n_nodes) {
++  circular_linked_list (size_t n_nodes) {
+     if (n_nodes == 0)
+       throw std::runtime_error ("circular_linked_list(): n_nodes == 0");
+ 
+@@ -136,7 +136,7 @@
+       l_prev->next (l_next);
+       l_prev->prev (l_next);
+       if (n_nodes > 2) {
+-	UInt32 n = n_nodes - 2;
++	size_t n = n_nodes - 2;
+ 	while (n-- > 0) {
+ 	  d_current = new s_node<T> (l_prev, l_next);
+ 	  d_current->set_available ();
+@@ -171,17 +171,17 @@
+     d_internal->lock ();
+ // find an available node
+     s_node_ptr l_node = d_available; 
+-    DEBUG (fprintf (stderr, "w "););
++    DEBUG (std::cerr << "w ");
+     while (! l_node) {
+-      DEBUG (fprintf (stderr, "x\n"););
++      DEBUG (std::cerr << "x" << std::endl);
+       // the ioBlock condition will automatically unlock() d_internal
+       d_ioBlock->wait ();
+       // and lock() is here
+-      DEBUG (fprintf (stderr, "y\n"););
++      DEBUG (std::cerr << "y" << std::endl);
+       l_node = d_available;
+     }
+-    DEBUG (fprintf (stderr, "::f_n_a_n: #u = %ld, node = %p\n",
+-		    num_used(), l_node););
++    DEBUG (std::cerr << "::f_n_a_n: #u = " << num_used()
++	   << ", node = " << l_node << std::endl);
+ // remove this one from the current available list
+     if (num_available () == 1) {
+ // last one, just set available to NULL
+@@ -203,8 +203,8 @@
+   void make_node_available (s_node_ptr l_node) {
+     if (!l_node) return;
+     d_internal->lock ();
+-    DEBUG (fprintf (stderr, "::m_n_a: #u = %ld, node = %p\n",
+-		    num_used(), l_node););
++    DEBUG (std::cerr << "::m_n_a: #u = " << num_used()
++	   << ", node = " << l_node << std::endl);
+ // remove this node from the inUse list
+     if (num_used () == 1) {
+ // last one, just set inUse to NULL
+@@ -219,10 +219,10 @@
+       l_node->insert_before (d_available);
+     d_n_used--;
+ 
+-    DEBUG (fprintf (stderr, "s%ld ", d_n_used););
++    DEBUG (std::cerr << "s" << d_n_used);
+ // signal the condition when new data arrives
+     d_ioBlock->signal ();
+-    DEBUG (fprintf (stderr, "t "););
++    DEBUG (std::cerr << "t ");
+ 
+ // unlock the mutex for thread safety
+     d_internal->unlock ();
+@@ -251,10 +251,10 @@
+ 
+   __INLINE__ T object () { return (d_current->d_object); };
+   __INLINE__ void object (T l_object) { d_current->d_object = l_object; };
+-  __INLINE__ UInt32 num_nodes () { return (d_n_nodes); };
+-  __INLINE__ UInt32 num_used () { return (d_n_used); };
+-  __INLINE__ void num_used (UInt32 l_n_used) { d_n_used = l_n_used; };
+-  __INLINE__ UInt32 num_available () { return (d_n_nodes - d_n_used); };
++  __INLINE__ size_t num_nodes () { return (d_n_nodes); };
++  __INLINE__ size_t num_used () { return (d_n_used); };
++  __INLINE__ void num_used (size_t l_n_used) { d_n_used = l_n_used; };
++  __INLINE__ size_t num_available () { return (d_n_nodes - d_n_used); };
+   __INLINE__ void num_used_inc (void) {
+     if (d_n_used < d_n_nodes) ++d_n_used;
+   };

Added: trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_ciurcular_buffer.h.diff
===================================================================
--- trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_ciurcular_buffer.h.diff	                        (rev 0)
+++ trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_ciurcular_buffer.h.diff	2010-02-09 04:12:49 UTC (rev 63574)
@@ -0,0 +1,209 @@
+--- usrp/host/lib/legacy/circular_buffer.h.orig	2010-02-04 20:33:10.000000000 -0500
++++ usrp/host/lib/legacy/circular_buffer.h	2010-02-04 20:37:18.000000000 -0500
+@@ -1,6 +1,6 @@
+ /* -*- c++ -*- */
+ /*
+- * Copyright 2006 Free Software Foundation, Inc.
++ * Copyright 2006,2009 Free Software Foundation, Inc.
+  * 
+  * This file is part of GNU Radio.
+  *
+@@ -24,6 +24,7 @@
+ #define _CIRCULAR_BUFFER_H_
+ 
+ #include "mld_threads.h"
++#include <iostream>
+ #include <stdexcept>
+ 
+ #ifndef DO_DEBUG
+@@ -43,8 +44,8 @@
+   T* d_buffer;
+ 
+ // the following are in Items (type T)
+-  UInt32 d_bufLen_I, d_readNdx_I, d_writeNdx_I;
+-  UInt32 d_n_avail_write_I, d_n_avail_read_I;
++  size_t d_bufLen_I, d_readNdx_I, d_writeNdx_I;
++  size_t d_n_avail_write_I, d_n_avail_read_I;
+ 
+ // stuff to control access to class internals
+   mld_mutex_ptr d_internal;
+@@ -69,7 +70,7 @@
+   };
+ 
+ public:
+-  circular_buffer (UInt32 bufLen_I,
++  circular_buffer (size_t bufLen_I,
+ 		   bool doWriteBlock = true, bool doFullRead = false) {
+     if (bufLen_I == 0)
+       throw std::runtime_error ("circular_buffer(): "
+@@ -81,10 +82,10 @@
+     d_internal = NULL;
+     d_readBlock = d_writeBlock = NULL;
+     reset ();
+-    DEBUG (fprintf (stderr, "c_b(): buf len (items) = %ld, "
+-		    "doWriteBlock = %s, doFullRead = %s\n", d_bufLen_I,
+-		    (d_doWriteBlock ? "true" : "false"),
+-		    (d_doFullRead ? "true" : "false")););
++    DEBUG (std::cerr << "c_b(): buf len (items) = " << d_bufLen_
++	   << ", doWriteBlock = " << (d_doWriteBlock ? "true" : "false")
++	   << ", doFullRead = " << (d_doFullRead ? "true" : "false")
++	   << std::endl);
+   };
+ 
+   ~circular_buffer () {
+@@ -92,21 +93,21 @@
+     delete [] d_buffer;
+   };
+ 
+-  inline UInt32 n_avail_write_items () {
++  inline size_t n_avail_write_items () {
+     d_internal->lock ();
+-    UInt32 retVal = d_n_avail_write_I;
++    size_t retVal = d_n_avail_write_I;
+     d_internal->unlock ();
+     return (retVal);
+   };
+ 
+-  inline UInt32 n_avail_read_items () {
++  inline size_t n_avail_read_items () {
+     d_internal->lock ();
+-    UInt32 retVal = d_n_avail_read_I;
++    size_t retVal = d_n_avail_read_I;
+     d_internal->unlock ();
+     return (retVal);
+   };
+ 
+-  inline UInt32 buffer_length_items () {return (d_bufLen_I);};
++  inline size_t buffer_length_items () {return (d_bufLen_I);};
+   inline bool do_write_block () {return (d_doWriteBlock);};
+   inline bool do_full_read () {return (d_doFullRead);};
+ 
+@@ -149,14 +150,15 @@
+  *     buffer length is larger than the instantiated buffer length
+  */
+ 
+-  int enqueue (T* buf, UInt32 bufLen_I) {
+-    DEBUG (fprintf (stderr, "enqueue: buf = %X, bufLen = %ld, #av_wr = %ld, "
+-		    "#av_rd = %ld.\n", (unsigned int)buf, bufLen_I,
+-		    d_n_avail_write_I, d_n_avail_read_I););
++  int enqueue (T* buf, size_t bufLen_I) {
++    DEBUG (std::cerr << "enqueue: buf = " << (void*) buf
++	   << ", bufLen = " << bufLen_I
++	   << ", #av_wr = " << d_n_avail_write_I
++	   << ", #av_rd = " << d_n_avail_read_I << std::endl);
+     if (bufLen_I > d_bufLen_I) {
+-      fprintf (stderr, "cannot add buffer longer (%ld"
+-	       ") than instantiated length (%ld"
+-	       ").\n", bufLen_I, d_bufLen_I);
++      std::cerr << "ERROR: cannot add buffer longer ("
++		<< bufLen_I << ") than instantiated length ("
++		<< d_bufLen_I << ")." << std::endl;
+       throw std::runtime_error ("circular_buffer::enqueue()");
+     }
+ 
+@@ -175,25 +177,25 @@
+     if (bufLen_I > d_n_avail_write_I) {
+       if (d_doWriteBlock) {
+ 	while (bufLen_I > d_n_avail_write_I) {
+-	  DEBUG (fprintf (stderr, "enqueue: #len > #a, waiting.\n"););
++	  DEBUG (std::cerr << "enqueue: #len > #a, waiting." << std::endl);
+ 	  // wait will automatically unlock() the internal mutex
+ 	  d_writeBlock->wait ();
+ 	  // and lock() it here.
+ 	  if (d_doAbort) {
+ 	    d_internal->unlock ();
+-	    DEBUG (fprintf (stderr, "enqueue: #len > #a, aborting.\n"););
++	    DEBUG (std::cerr << "enqueue: #len > #a, aborting." << std::endl);
+ 	    return (2);
+ 	  }
+-	  DEBUG (fprintf (stderr, "enqueue: #len > #a, done waiting.\n"););
++	  DEBUG (std::cerr << "enqueue: #len > #a, done waiting." << std::endl);
+ 	}
+       } else {
+ 	d_n_avail_read_I = d_bufLen_I - bufLen_I;
+ 	d_n_avail_write_I = bufLen_I;
+-	DEBUG (fprintf (stderr, "circular_buffer::enqueue: overflow\n"););
++	DEBUG (std::cerr << "circular_buffer::enqueue: overflow" << std::endl);
+ 	retval = -1;
+       }
+     }
+-    UInt32 n_now_I = d_bufLen_I - d_writeNdx_I, n_start_I = 0;
++    size_t n_now_I = d_bufLen_I - d_writeNdx_I, n_start_I = 0;
+     if (n_now_I > bufLen_I)
+       n_now_I = bufLen_I;
+     else if (n_now_I < bufLen_I)
+@@ -232,23 +234,24 @@
+  *     buffer length is larger than the instantiated buffer length
+  */
+ 
+-  int dequeue (T* buf, UInt32* bufLen_I) {
+-    DEBUG (fprintf (stderr, "dequeue: buf = %X, *bufLen = %ld, #av_wr = %ld, "
+-		    "#av_rd = %ld.\n", (unsigned int)buf, *bufLen_I,
+-		    d_n_avail_write_I, d_n_avail_read_I););
++  int dequeue (T* buf, size_t* bufLen_I) {
++    DEBUG (std::cerr << "dequeue: buf = " << ((void*) buf)
++	   << ", *bufLen = " << (*bufLen_I)
++	   << ", #av_wr = " <<  d_n_avail_write_I
++	   << ", #av_rd = " << d_n_avail_read_I << std::endl);
+     if (!bufLen_I)
+       throw std::runtime_error ("circular_buffer::dequeue(): "
+ 				"input bufLen pointer is NULL.\n");
+     if (!buf)
+       throw std::runtime_error ("circular_buffer::dequeue(): "
+ 				"input buffer pointer is NULL.\n");
+-    UInt32 l_bufLen_I = *bufLen_I;
++    size_t l_bufLen_I = *bufLen_I;
+     if (l_bufLen_I == 0)
+       return (0);
+     if (l_bufLen_I > d_bufLen_I) {
+-      fprintf (stderr, "cannot remove buffer longer (%ld"
+-	       ") than instantiated length (%ld"
+-	       ").\n", l_bufLen_I, d_bufLen_I);
++      std::cerr << "ERROR: cannot remove buffer longer ("
++		<< l_bufLen_I << ") than instantiated length ("
++		<< d_bufLen_I << ")." << std::endl;
+       throw std::runtime_error ("circular_buffer::dequeue()");
+     }
+ 
+@@ -259,34 +262,34 @@
+     }
+     if (d_doFullRead) {
+       while (d_n_avail_read_I < l_bufLen_I) {
+-	DEBUG (fprintf (stderr, "dequeue: #a < #len, waiting.\n"););
++	DEBUG (std::cerr << "dequeue: #a < #len, waiting." << std::endl);
+ 	// wait will automatically unlock() the internal mutex
+ 	d_readBlock->wait ();
+ 	// and lock() it here.
+ 	if (d_doAbort) {
+ 	  d_internal->unlock ();
+-	  DEBUG (fprintf (stderr, "dequeue: #a < #len, aborting.\n"););
++	  DEBUG (std::cerr << "dequeue: #a < #len, aborting." << std::endl);
+ 	  return (2);
+ 	}
+-	DEBUG (fprintf (stderr, "dequeue: #a < #len, done waiting.\n"););
++	DEBUG (std::cerr << "dequeue: #a < #len, done waiting." << std::endl);
+      }
+     } else {
+       while (d_n_avail_read_I == 0) {
+-	DEBUG (fprintf (stderr, "dequeue: #a == 0, waiting.\n"););
++	DEBUG (std::cerr << "dequeue: #a == 0, waiting." << std::endl);
+ 	// wait will automatically unlock() the internal mutex
+ 	d_readBlock->wait ();
+ 	// and lock() it here.
+ 	if (d_doAbort) {
+ 	  d_internal->unlock ();
+-	  DEBUG (fprintf (stderr, "dequeue: #a == 0, aborting.\n"););
++	  DEBUG (std::cerr << "dequeue: #a == 0, aborting." << std::endl);
+ 	  return (2);
+ 	}
+-	DEBUG (fprintf (stderr, "dequeue: #a == 0, done waiting.\n"););
++	DEBUG (std::cerr << "dequeue: #a == 0, done waiting." << std::endl);
+       }
+     }
+     if (l_bufLen_I > d_n_avail_read_I)
+       l_bufLen_I = d_n_avail_read_I;
+-    UInt32 n_now_I = d_bufLen_I - d_readNdx_I, n_start_I = 0;
++    size_t n_now_I = d_bufLen_I - d_readNdx_I, n_start_I = 0;
+     if (n_now_I > l_bufLen_I)
+       n_now_I = l_bufLen_I;
+     else if (n_now_I < l_bufLen_I)

Added: trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_darwin.h.diff
===================================================================
--- trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_darwin.h.diff	                        (rev 0)
+++ trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_darwin.h.diff	2010-02-09 04:12:49 UTC (rev 63574)
@@ -0,0 +1,228 @@
+--- usrp/host/lib/legacy/darwin_libusb.h.orig	2010-02-04 20:33:21.000000000 -0500
++++ usrp/host/lib/legacy/darwin_libusb.h	2010-02-04 20:37:22.000000000 -0500
+@@ -1,6 +1,6 @@
+ /* -*- c++ -*- */
+ /*
+- * Copyright 2006 Free Software Foundation, Inc.
++ * Copyright 2006,2009 Free Software Foundation, Inc.
+  * 
+  * This file is part of GNU Radio.
+  *
+@@ -42,28 +42,41 @@
+ #include <IOKit/IOKitLib.h>
+ 
+ extern "C" {
+-static char *
++
++static const char* darwin_error_strings[] = {
++  "no error",
++  "device not opened for exclusive access",
++  "no connection to an IOService",
++  "no asyc port has been opened for interface",
++  "another process has device opened for exclusive access",
++  "pipe is stalled",
++  "could not establish a connection to Darin kernel",
++  "invalid argument",
++  "unknown error"
++};
++
++static const char *
+ darwin_error_str (int result)
+ {
+   switch (result) {
+   case kIOReturnSuccess:
+-    return "no error";
++    return (darwin_error_strings[0]);
+   case kIOReturnNotOpen:
+-    return "device not opened for exclusive access";
++    return (darwin_error_strings[1]);
+   case kIOReturnNoDevice:
+-    return "no connection to an IOService";
++    return (darwin_error_strings[2]);
+   case kIOUSBNoAsyncPortErr:
+-    return "no asyc port has been opened for interface";
++    return (darwin_error_strings[3]);
+   case kIOReturnExclusiveAccess:
+-    return "another process has device opened for exclusive access";
++    return (darwin_error_strings[4]);
+   case kIOUSBPipeStalled:
+-    return "pipe is stalled";
++    return (darwin_error_strings[5]);
+   case kIOReturnError:
+-    return "could not establish a connection to Darin kernel";
++    return (darwin_error_strings[6]);
+   case kIOReturnBadArgument:
+-    return "invalid argument";
++    return (darwin_error_strings[7]);
+   default:
+-    return "unknown error";
++    return (darwin_error_strings[8]);
+   }
+ }
+ 
+@@ -103,40 +116,49 @@
+ extern int usb_error_errno;
+ extern usb_error_type_t usb_error_type;
+ 
+-#define USB_ERROR(r, x)				\
+-	do { \
+-          usb_error_type = USB_ERROR_TYPE_ERRNO; \
+-          usb_error_errno = x; \
+-	  return r; \
+-	} while (0)
+-
+-#define USB_ERROR_STR(r, x, format, args...)	\
+-	do { \
+-	  usb_error_type = USB_ERROR_TYPE_STRING; \
+-	  snprintf(usb_error_str, sizeof(usb_error_str) - 1, format, ## args); \
+-          if (usb_debug) \
+-            fprintf(stderr, "USB error: %s\n", usb_error_str);	\
+-	  return r; \
+-	} while (0)
+-
+-#define USB_ERROR_STR_ORIG(x, format, args...)	\
+-	do { \
+-	  usb_error_type = USB_ERROR_TYPE_STRING; \
+-	  snprintf(usb_error_str, sizeof(usb_error_str) - 1, format, ## args); \
+-          if (usb_debug) \
+-            fprintf(stderr, "USB error: %s\n", usb_error_str);	\
+-	  return x; \
+-	} while (0)
+-
+-#define USB_ERROR_STR_NO_RET(x, format, args...)	\
+-	do { \
+-	  usb_error_type = USB_ERROR_TYPE_STRING; \
+-	  snprintf(usb_error_str, sizeof(usb_error_str) - 1, format, ## args); \
+-          if (usb_debug) \
+-            fprintf(stderr, "USB error: %s\n", usb_error_str);	\
+-	} while (0)
++#define USB_ERROR(r, x)				 \
++  do {						 \
++    usb_error_type = USB_ERROR_TYPE_ERRNO;	 \
++    usb_error_errno = x;			 \
++    return (r);					 \
++  } while (0)
++
++#define USB_ERROR_STR(r, x, format, args...)				\
++  do {									\
++    usb_error_type = USB_ERROR_TYPE_STRING;				\
++    snprintf (usb_error_str, sizeof (usb_error_str) - 1,		\
++	      format, ## args);						\
++    if (usb_debug) {							\
++      std::cerr << "USB error: " << usb_error_str << std::cerr;		\
++    }									\
++    return (r);								\
++  } while (0)
++
++#define USB_ERROR_STR_ORIG(x, format, args...)				\
++  do {									\
++    usb_error_type = USB_ERROR_TYPE_STRING;				\
++    snprintf (usb_error_str, sizeof (usb_error_str) - 1,		\
++	      format, ## args);						\
++    if (usb_debug) {							\
++      std::cerr << "USB error: " << usb_error_str << std::endl;		\
++    }									\
++    return (x);								\
++  } while (0)
++
++#define USB_ERROR_STR_NO_RET(x, format, args...)			\
++  do {									\
++    usb_error_type = USB_ERROR_TYPE_STRING;				\
++    snprintf (usb_error_str, sizeof (usb_error_str) - 1,		\
++	      format, ## args);						\
++    if (usb_debug) {							\
++      std::cerr << "USB error: " << usb_error_str << std::endl;		\
++    }									\
++  } while (0)
+ 
+-/* simple function that figures out what pipeRef is associated with an endpoint */
++/*
++ * simple function that figures out what pipeRef
++ * is associated with an endpoint
++ */
+ static int ep_to_pipeRef (darwin_dev_handle *device, int ep)
+ {
+   io_return_t ret;
+@@ -145,45 +167,60 @@
+   UInt16 dont_care2;
+   int i;
+ 
+-  if (usb_debug > 3)
+-    fprintf(stderr, "Converting ep address to pipeRef.\n");
++  if (usb_debug > 3) {
++    std::cerr << "Converting ep address to pipeRef." << std::endl;
++  }
+ 
+   /* retrieve the total number of endpoints on this interface */
+   ret = (*(device->interface))->GetNumEndpoints(device->interface, &numep);
+   if ( ret ) {
+-    if ( usb_debug > 3 )
+-      fprintf ( stderr, "ep_to_pipeRef: interface is %p\n", device->interface );
+-    USB_ERROR_STR_ORIG ( -ret, "ep_to_pipeRef: can't get number of endpoints for interface" );
++    if ( usb_debug > 3 ) {
++      std::cerr << "ep_to_pipeRef: interface is "
++		<< device->interface << std::endl;
++    }
++    USB_ERROR_STR_ORIG ( -ret, "ep_to_pipeRef: can't get number of "
++			 "endpoints for interface" );
+   }
+ 
+   /* iterate through the pipeRefs until we find the correct one */
+   for (i = 1 ; i <= numep ; i++) {
+-    ret = (*(device->interface))->GetPipeProperties(device->interface, i, &direction, &number,
+-						    &dont_care1, &dont_care2, &dont_care3);
++    ret = (*(device->interface))->GetPipeProperties
++      (device->interface, i, &direction, &number,
++       &dont_care1, &dont_care2, &dont_care3);
+ 
+     if (ret != kIOReturnSuccess) {
+-      fprintf (stderr, "ep_to_pipeRef: an error occurred getting pipe information on pipe %d\n",
+-	       i );
+-      USB_ERROR_STR_ORIG (-darwin_to_errno(ret), "ep_to_pipeRef(GetPipeProperties): %s", darwin_error_str(ret));
+-    }
++      std::cerr << "ep_to_pipeRef: an error occurred getting "
++		<< "pipe information on pipe " << i << std::endl;
+ 
+-    if (usb_debug > 3)
+-      fprintf (stderr, "ep_to_pipeRef: Pipe %i: DIR: %i number: %i\n", i, direction, number);
++      USB_ERROR_STR_ORIG (-darwin_to_errno(ret),
++			  "ep_to_pipeRef(GetPipeProperties): %s",
++			  darwin_error_str(ret));
++    }
+ 
+-    /* calculate the endpoint of the pipe and check it versus the requested endpoint */
+-    if ( ((direction << 7 & USB_ENDPOINT_DIR_MASK) | (number & USB_ENDPOINT_ADDRESS_MASK)) == ep ) {
+-      if (usb_debug > 3)
+-	fprintf(stderr, "ep_to_pipeRef: pipeRef for ep address 0x%02x found: 0x%02x\n", ep, i);
++    if (usb_debug > 3) {
++      std::cerr << "ep_to_pipeRef: Pipe " << i << ": DIR: "
++		<< direction << " number: " << number << std::endl;
++    }
+ 
+-      return i;
++    /* calculate the endpoint of the pipe and check it versus
++       the requested endpoint */
++    if ( ((direction << 7 & USB_ENDPOINT_DIR_MASK) |
++	  (number & USB_ENDPOINT_ADDRESS_MASK)) == ep ) {
++      if (usb_debug > 3) {
++	std::cerr << "ep_to_pipeRef: pipeRef for ep address "
++		  << ep << " found: " << i << std::endl;
++      }
++      return (i);
+     }
+   }
+ 
+-  if (usb_debug > 3)
+-    fprintf(stderr, "ep_to_pipeRef: No pipeRef found with endpoint address 0x%02x.\n", ep);
+-  
++  if (usb_debug > 3) {
++    std::cerr << "ep_to_pipeRef: No pipeRef found with endpoint address "
++	      << ep << std::endl;
++  }
++
+   /* none of the found pipes match the requested endpoint */
+-  return -1;
++  return (-1);
+ }
+ 
+ }

Added: trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_fusb_darwin.cc.diff
===================================================================
--- trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_fusb_darwin.cc.diff	                        (rev 0)
+++ trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_fusb_darwin.cc.diff	2010-02-09 04:12:49 UTC (rev 63574)
@@ -0,0 +1,347 @@
+--- usrp/host/lib/legacy/fusb_darwin.cc.orig	2010-02-04 20:33:35.000000000 -0500
++++ usrp/host/lib/legacy/fusb_darwin.cc	2010-02-04 20:37:34.000000000 -0500
+@@ -1,6 +1,6 @@
+ /* -*- c++ -*- */
+ /*
+- * Copyright 2006 Free Software Foundation, Inc.
++ * Copyright 2006,2009 Free Software Foundation, Inc.
+  * 
+  * This file is part of GNU Radio.
+  *
+@@ -33,6 +33,7 @@
+ #include "fusb.h"
+ #include "fusb_darwin.h"
+ #include "darwin_libusb.h"
++#include <iostream>
+ 
+ static const int USB_TIMEOUT = 100;	// in milliseconds
+ static const UInt8 NUM_QUEUE_ITEMS = 20;
+@@ -153,9 +154,10 @@
+     USB_ERROR_STR (false, -ENOENT, "fusb_ephandle_darwin::start: "
+ 		   "device not initialized");
+ 
+-  if (usb_debug)
+-    fprintf (stderr, "fusb_ephandle_darwin::start: "
+-	     "dev = %p, device = %p\n", dev, device);
++  if (usb_debug) {
++    std::cerr << "fusb_ephandle_darwin::start: dev = " <<
++      (void*) dev << ", device = " << (void*) device << std::endl;
++  }
+ 
+   d_interfaceRef = device->interface;
+   if (! d_interfaceRef)
+@@ -165,10 +167,10 @@
+ 
+ // get read or write pipe info (depends on "d_input_p")
+ 
+-  if (usb_debug > 3)
+-    fprintf (stderr, "fusb_ephandle_darwin::start "
+-	     "d_endpoint = %d, d_input_p = %s\n",
+-	     d_endpoint, d_input_p ? "TRUE" : "FALSE");
++  if (usb_debug > 3) {
++    std::cerr << "fusb_ephandle_darwin::start d_endpoint = " << d_endpoint
++	      << ", d_input_p = " << (d_input_p ? "TRUE" : "FALSE") << std::endl;
++  }
+ 
+   int l_endpoint = (d_input_p ? USB_ENDPOINT_IN : USB_ENDPOINT_OUT);
+   int pipeRef = ep_to_pipeRef (device, d_endpoint | l_endpoint);
+@@ -184,12 +186,14 @@
+ 				  &d_transferType,
+ 				  &maxPacketSize,
+ 				  &interval);
+-  if (usb_debug == 3)
+-    fprintf (stderr, "fusb_ephandle_darwin::start: %s: ep = 0x%02x, "
+-	     "pipeRef = %d, d_i = %p, d_iR = %p, if_dir = %d, if_# = %d, "
+-	     "if_int = %d, if_maxPS = %d\n", d_input_p ? "read" : "write",
+-	     d_endpoint, d_pipeRef, d_interface, d_interfaceRef, direction,
+-	     number, interval, maxPacketSize);
++  if (usb_debug == 3) {
++    std::cerr << "fusb_ephandle_darwin::start: " << (d_input_p ? "read" : "write")
++	      << ": ep = " << d_endpoint << ", pipeRef = " << d_pipeRef << "interface = "
++	      << d_interface << ", interfaceRef = " << d_interfaceRef
++	      << ", if_direction = " << direction << ", if_# = " << number
++	      << ", if_interval = " << interval << ", if_maxPacketSize = "
++	      << maxPacketSize << std::endl;
++  }
+ 
+   // set global start boolean
+   d_started = true;
+@@ -205,9 +209,10 @@
+   // going; this will unlock the mutex before waiting for a signal ()
+   d_runBlock->wait ();
+ 
+-  if (usb_debug)
+-    fprintf (stderr, "fusb_ephandle_darwin::start: %s started.\n",
+-	     d_input_p ? "read" : "write");
++  if (usb_debug) {
++    std::cerr << "fusb_ephandle_darwin::start: " << (d_input_p ? "read" : "write")
++	      << " started." << std::endl;
++  }
+ 
+   return (true);
+ }
+@@ -229,10 +234,10 @@
+ 
+   bool l_input_p = This->d_input_p;
+ 
+-  if (usb_debug)
+-    fprintf (stderr, "fusb_ephandle_darwin::run_thread: "
+-	     "starting for %s.\n",
+-	     l_input_p ? "read" : "write");
++  if (usb_debug) {
++    std::cerr << "fusb_ephandle_darwin::run_thread: starting for "
++	      << (l_input_p ? "read" : "write") << "." << std::endl;
++  }
+ 
+   usb_interface_t** l_interfaceRef = This->d_interfaceRef;
+   usb_interface_t* l_interface = This->d_interface;
+@@ -286,9 +291,10 @@
+   CFRunLoopRemoveSource (CFRunLoopGetCurrent (),
+ 			 l_cfSource, kCFRunLoopDefaultMode);
+ 
+-  if (usb_debug)
+-    fprintf (stderr, "fusb_ephandle_darwin::run_thread: finished for %s.\n",
+-	     l_input_p ? "read" : "write");
++  if (usb_debug) {
++    std::cerr << "fusb_ephandle_darwin::run_thread: finished for "
++	      << (l_input_p ? "read" : "write") << "." << std::endl;
++  }
+ 
+   // release the run thread running mutex
+   l_runThreadRunning->unlock ();
+@@ -297,8 +303,9 @@
+ void
+ fusb_ephandle_darwin::read_thread (void* arg)
+ {
+-  if (usb_debug)
+-    fprintf (stderr, "fusb_ephandle_darwin::read_thread: starting.\n");
++  if (usb_debug) {
++    std::cerr << "fusb_ephandle_darwin::read_thread: starting." << std::endl;
++  }
+ 
+   fusb_ephandle_darwin* This = static_cast<fusb_ephandle_darwin*>(arg);
+ 
+@@ -331,8 +338,9 @@
+     l_node = l_queue->iterate_next ();
+   }
+ 
+-  if (usb_debug)
+-    fprintf (stderr, "fusb_ephandle_darwin::read_thread: finished.\n");
++  if (usb_debug) {
++    std::cerr << "fusb_ephandle_darwin::read_thread: finished." << std::endl;
++  }
+ 
+   // release the read running mutex, to let the parent thread knows
+   // that this thread is finished
+@@ -343,10 +351,11 @@
+ fusb_ephandle_darwin::read_issue (s_both_ptr l_both)
+ {
+   if ((! l_both) || (! d_started)) {
+-    if (usb_debug > 4)
+-      fprintf (stderr, "fusb_ephandle_darwin::read_issue: Doing nothing; "
+-	       "l_both is %X; started is %s\n", (unsigned int) l_both,
+-	       d_started ? "TRUE" : "FALSE");
++    if (usb_debug > 4) {
++      std::cerr << "fusb_ephandle_darwin::read_issue: Doing nothing; "
++		<< "l_both is " << (void*) l_both << "; started is "
++		<< (d_started ? "TRUE" : "FALSE") << std::endl;
++    }
+     return;
+   }
+ 
+@@ -356,7 +365,7 @@
+   void* v_buffer = (void*) l_buf->buffer ();
+ 
+ // read up to d_bufLenBytes
+-  UInt32 bufLen = d_bufLenBytes;
++  size_t bufLen = d_bufLenBytes;
+   l_buf->n_used (bufLen);
+ 
+ // setup system call result
+@@ -378,9 +387,10 @@
+ 			  "(ReadPipeAsync%s): %s",
+ 			  d_transferType == kUSBInterrupt ? "" : "TO",
+ 			  darwin_error_str (result));
+-  else if (usb_debug > 4)
+-    fprintf (stderr, "fusb_ephandle_darwin::read_issue: "
+-	     "Queued %X (%ld Bytes)\n", (unsigned int) l_both, bufLen);
++  else if (usb_debug > 4) {
++    std::cerr << "fusb_ephandle_darwin::read_issue: Queued " << (void*) l_both
++	      << " (" << bufLen << " Bytes)" << std::endl;
++  }
+ }
+ 
+ void
+@@ -388,26 +398,27 @@
+ 				      io_return_t result,
+ 				      void* io_size)
+ {
+-  UInt32 l_size = (UInt32) io_size;
++  size_t l_size = (size_t) io_size;
+   s_both_ptr l_both = static_cast<s_both_ptr>(refCon);
+   fusb_ephandle_darwin* This = static_cast<fusb_ephandle_darwin*>(l_both->This ());
+   s_node_ptr l_node = l_both->node ();
+   circular_buffer<char>* l_buffer = This->d_buffer;
+   s_buffer_ptr l_buf = l_node->object ();
+-  UInt32 l_i_size = l_buf->n_used ();
++  size_t l_i_size = l_buf->n_used ();
+ 
+-  if (This->d_started && (l_i_size != l_size))
+-    fprintf (stderr, "fusb_ephandle_darwin::read_completed: "
+-	     "Expected %ld bytes; read %ld.\n",
+-	     l_i_size, l_size);
+-  else if (usb_debug > 4)
+-    fprintf (stderr, "fusb_ephandle_darwin::read_completed: "
+-	     "Read %X (%ld bytes)\n",
+-	     (unsigned int) l_both, l_size);
++  if (This->d_started && (l_i_size != l_size)) {
++    std::cerr << "fusb_ephandle_darwin::read_completed: Expected " << l_i_size
++	      << " bytes; read " << l_size << "." << std::endl;
++  } else if (usb_debug > 4) {
++    std::cerr << "fusb_ephandle_darwin::read_completed: Read " << (void*) l_both
++	      << " (" << l_size << " bytes)" << std::endl;
++  }
+ 
+-// add this read to the transfer buffer
++// add this read to the transfer buffer, and check for overflow
++// -> data is being enqueued faster than it can be dequeued
+   if (l_buffer->enqueue (l_buf->buffer (), l_size) == -1) {
+-    fputs ("iU", stderr);
++// print out that there's an overflow
++    fputs ("uO", stderr);
+     fflush (stderr);
+   }
+ 
+@@ -421,11 +432,13 @@
+ int
+ fusb_ephandle_darwin::read (void* buffer, int nbytes)
+ {
+-  UInt32 l_nbytes = (UInt32) nbytes;
++  size_t l_nbytes = (size_t) nbytes;
+   d_buffer->dequeue ((char*) buffer, &l_nbytes);
+ 
+-  if (usb_debug > 4)
+-    fprintf (stderr, "fusb_ephandle_darwin::read: request for %d bytes, %ld bytes retrieved.\n", nbytes, l_nbytes);
++  if (usb_debug > 4) {
++    std::cerr << "fusb_ephandle_darwin::read: request for " << nbytes
++	      << " bytes, " << l_nbytes << " bytes retrieved." << std::endl;
++  }
+ 
+   return ((int) l_nbytes);
+ }
+@@ -433,18 +446,18 @@
+ int
+ fusb_ephandle_darwin::write (const void* buffer, int nbytes)
+ {
+-  UInt32 l_nbytes = (UInt32) nbytes;
++  size_t l_nbytes = (size_t) nbytes;
+ 
+   if (! d_started) {
+-    if (usb_debug)
+-      fprintf (stderr, "fusb_ephandle_darwin::write: Not yet started.\n");
+-
++    if (usb_debug) {
++      std::cerr << "fusb_ephandle_darwin::write: Not yet started." << std::endl;
++    }
+     return (0);
+   }
+ 
+   while (l_nbytes != 0) {
+ // find out how much data to copy; limited to "d_bufLenBytes" per node
+-    UInt32 t_nbytes = (l_nbytes > d_bufLenBytes) ? d_bufLenBytes : l_nbytes;
++    size_t t_nbytes = (l_nbytes > d_bufLenBytes) ? d_bufLenBytes : l_nbytes;
+ 
+ // get next available node to write into;
+ // blocks internally if none available
+@@ -476,8 +489,8 @@
+ 		     d_transferType == kUSBInterrupt ? "" : "TO",
+ 		     darwin_error_str (result));
+     else if (usb_debug > 4) {
+-      fprintf (stderr, "fusb_ephandle_darwin::write_thread: "
+-	       "Queued %X (%ld Bytes)\n", (unsigned int) l_both, t_nbytes);
++      std::cerr << "fusb_ephandle_darwin::write_thread: Queued " << (void*) l_both
++		<< " (" << t_nbytes << " Bytes)" << std::endl;
+     }
+     l_nbytes -= t_nbytes;
+   }
+@@ -492,19 +505,19 @@
+ {
+   s_both_ptr l_both = static_cast<s_both_ptr>(refCon);
+   fusb_ephandle_darwin* This = static_cast<fusb_ephandle_darwin*>(l_both->This ());
+-  UInt32 l_size = (UInt32) io_size;
++  size_t l_size = (size_t) io_size;
+   s_node_ptr l_node = l_both->node ();
+   s_queue_ptr l_queue = This->d_queue;
+   s_buffer_ptr l_buf = l_node->object ();
+-  UInt32 l_i_size = l_buf->n_used ();
++  size_t l_i_size = l_buf->n_used ();
+ 
+-  if (This->d_started && (l_i_size != l_size))
+-    fprintf (stderr, "fusb_ephandle_darwin::write_completed: "
+-	     "Expected %ld bytes written; wrote %ld.\n",
+-	     l_i_size, l_size);
+-  else if (usb_debug > 4)
+-    fprintf (stderr, "fusb_ephandle_darwin::write_completed: "
+-	     "Wrote %X (%ld Bytes)\n", (unsigned int) l_both, l_size);
++  if (This->d_started && (l_i_size != l_size)) {
++    std::cerr << "fusb_ephandle_darwin::write_completed: Expected " << l_i_size
++	      << " bytes written; wrote " << l_size << "." << std::endl;
++  } else if (usb_debug > 4) {
++    std::cerr << "fusb_ephandle_darwin::write_completed: Wrote " << (void*) l_both
++	      << " (" << l_size << " Bytes)" << std::endl;
++  }
+ 
+ // set buffer's # data to 0
+   l_buf->n_used (0);
+@@ -515,8 +528,9 @@
+ void
+ fusb_ephandle_darwin::abort ()
+ {
+-  if (usb_debug)
+-    fprintf (stderr, "fusb_ephandle_darwin::abort: starting.\n");
++  if (usb_debug) {
++    std::cerr << "fusb_ephandle_darwin::abort: starting." << std::endl;
++  }
+ 
+   io_return_t result = d_interface->AbortPipe (d_interfaceRef, d_pipeRef);
+ 
+@@ -524,8 +538,9 @@
+     USB_ERROR_STR_NO_RET (- darwin_to_errno (result),
+ 			  "fusb_ephandle_darwin::abort "
+ 			  "(AbortPipe): %s", darwin_error_str (result));
+-  if (usb_debug)
+-    fprintf (stderr, "fusb_ephandle_darwin::abort: finished.\n");
++  if (usb_debug) {
++    std::cerr << "fusb_ephandle_darwin::abort: finished." << std::endl;
++  }
+ }
+ 
+ bool
+@@ -534,9 +549,10 @@
+   if (! d_started)
+     return (true);
+ 
+-  if (usb_debug)
+-    fprintf (stderr, "fusb_ephandle_darwin::stop: stopping %s.\n",
+-	     d_input_p ? "read" : "write");
++  if (usb_debug) {
++    std::cerr << "fusb_ephandle_darwin::stop: stopping "
++	      << (d_input_p ? "read" : "write") << "." << std::endl;
++  }
+ 
+   d_started = false;
+ 
+@@ -556,9 +572,10 @@
+   d_runThreadRunning->lock ();
+   d_runThreadRunning->unlock ();
+ 
+-  if (usb_debug)
+-    fprintf (stderr, "fusb_ephandle_darwin::stop: %s stopped.\n",
+-	     d_input_p ? "read" : "write");
++  if (usb_debug) {
++    std::cerr << "fusb_ephandle_darwin::stop: " << (d_input_p ? "read" : "write")
++	      << " stopped." << std::endl;
++  }
+ 
+   return (true);
+ }

Added: trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_fusb_darwin.h.diff
===================================================================
--- trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_fusb_darwin.h.diff	                        (rev 0)
+++ trunk/dports/science/usrp/files/patch-usrp_host_lib_legacy_fusb_darwin.h.diff	2010-02-09 04:12:49 UTC (rev 63574)
@@ -0,0 +1,56 @@
+--- usrp/host/lib/legacy/fusb_darwin.h.orig	2010-02-04 20:33:29.000000000 -0500
++++ usrp/host/lib/legacy/fusb_darwin.h	2010-02-04 20:37:34.000000000 -0500
+@@ -1,6 +1,6 @@
+ /* -*- c++ -*- */
+ /*
+- * Copyright 2006 Free Software Foundation, Inc.
++ * Copyright 2006,2009 Free Software Foundation, Inc.
+  * 
+  * This file is part of GNU Radio.
+  *
+@@ -75,10 +75,10 @@
+ {
+ private:
+   char* d_buffer;
+-  UInt32 d_n_used, d_n_alloc;
++  size_t d_n_used, d_n_alloc;
+ 
+ public:
+-  inline s_buffer (UInt32 n_alloc = 0) {
++  inline s_buffer (size_t n_alloc = 0) {
+     d_n_used = 0;
+     d_n_alloc = n_alloc;
+     if (n_alloc) {
+@@ -92,17 +92,17 @@
+       delete [] d_buffer;
+     }
+   };
+-  inline UInt32 n_used () { return (d_n_used); };
+-  inline void n_used (UInt32 bufLen) {
++  inline size_t n_used () { return (d_n_used); };
++  inline void n_used (size_t bufLen) {
+     d_n_used = (bufLen > d_n_alloc) ? d_n_alloc : bufLen; };
+-  inline UInt32 n_alloc () { return (d_n_alloc); };
+-  void buffer (char* l_buffer, UInt32 bufLen) {
++  inline size_t n_alloc () { return (d_n_alloc); };
++  void buffer (char* l_buffer, size_t bufLen) {
+     if (bufLen > d_n_alloc) {
+-      fprintf (stderr, "s_buffer::set: Copying only allocated bytes.\n");
++      std::cerr << "s_buffer::set: Copying only allocated bytes." << std::endl;
+       bufLen = d_n_alloc;
+     }
+     if (!l_buffer) {
+-      fprintf (stderr, "s_buffer::set: NULL buffer.\n");
++      std::cerr << "s_buffer::set: NULL buffer." << std::endl;
+       return;
+     }
+     bcopy (l_buffer, d_buffer, bufLen);
+@@ -173,7 +173,7 @@
+   usb_interface_t* d_interface;
+   s_queue_ptr d_queue;
+   circular_buffer<char>* d_buffer;
+-  UInt32 d_bufLenBytes;
++  size_t d_bufLenBytes;
+   mld_mutex_ptr d_readRunning;
+   mld_condition_ptr d_runBlock, d_readBlock;
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100208/bf230814/attachment-0001.html>


More information about the macports-changes mailing list