diff options
307 files changed, 8207 insertions, 6300 deletions
diff --git a/config.guess b/config.guess index 285237846..187cd54ed 100755..100644 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2010-08-21' +timestamp='2011-02-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -92,7 +92,7 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' HUP INT TERM +trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -106,7 +106,7 @@ trap 'exit 1' HUP INT TERM set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -181,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -224,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -270,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -296,7 +299,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -395,23 +398,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -481,8 +484,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -495,7 +498,7 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -595,52 +598,52 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -731,22 +734,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -770,14 +773,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -805,14 +808,14 @@ EOF echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -867,7 +870,7 @@ EOF EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -892,7 +895,7 @@ EOF echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -960,7 +963,7 @@ EOF echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -978,7 +981,7 @@ EOF echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -987,11 +990,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1023,7 +1026,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1051,13 +1054,13 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1092,8 +1095,8 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1136,10 +1139,10 @@ EOF echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm @@ -1165,11 +1168,11 @@ EOF exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1234,6 +1237,9 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1279,13 +1285,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1325,11 +1331,11 @@ main () #include <sys/param.h> printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff --git a/config.sub b/config.sub index 320e30388..18b17aa46 100755..100644 --- a/config.sub +++ b/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2010-09-11' +timestamp='2011-03-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -76,7 +76,7 @@ version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -158,8 +158,8 @@ case $os in os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -175,10 +175,10 @@ case $os in os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -288,7 +288,7 @@ case $basic_machine in | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ @@ -296,12 +296,12 @@ case $basic_machine in | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; @@ -325,6 +325,18 @@ case $basic_machine in basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -384,22 +396,22 @@ case $basic_machine in | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -424,7 +436,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -507,7 +519,7 @@ case $basic_machine in basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -539,7 +551,7 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -755,7 +767,7 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; mingw32) @@ -862,10 +874,10 @@ case $basic_machine in np1) basic_machine=np1-gould ;; - neo-tandem) + neo-tandem) basic_machine=neo-tandem ;; - nse-tandem) + nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) @@ -950,9 +962,10 @@ case $basic_machine in ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1046,6 +1059,9 @@ case $basic_machine in basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1102,8 +1118,8 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) + # This must be matched before tile*. + tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; @@ -1178,6 +1194,9 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1275,11 +1294,11 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1364,7 +1383,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1413,7 +1432,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1458,8 +1477,8 @@ case $os in -dicos*) os=-dicos ;; - -nacl*) - ;; + -nacl*) + ;; -none) ;; *) @@ -1482,10 +1501,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1497,8 +1516,8 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; tic54x-*) os=-coff @@ -1534,7 +1553,7 @@ case $basic_machine in m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1561,7 +1580,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff --git a/config/Makefile.am b/config/Makefile.am index 68ff3c78c..535844507 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -51,12 +51,7 @@ m4macros = \ grc_gnuradio_examples.m4 \ grc_grc.m4 \ grc_gr_atsc.m4 \ - grc_gr_audio_alsa.m4 \ - grc_gr_audio_jack.m4 \ - grc_gr_audio_oss.m4 \ - grc_gr_audio_osx.m4 \ - grc_gr_audio_portaudio.m4 \ - grc_gr_audio_windows.m4 \ + grc_gr_audio.m4 \ grc_gr_comedi.m4 \ grc_gr_gcell.m4 \ grc_gr_gpio.m4 \ diff --git a/config/gr_qwt.m4 b/config/gr_qwt.m4 index 16ec63819..537348ac6 100644 --- a/config/gr_qwt.m4 +++ b/config/gr_qwt.m4 @@ -59,25 +59,25 @@ AC_DEFUN([GR_QWT], dnl if not set by user if test "$qwt_incdir" = "" ; then - dnl check qwt/qwt.h (as in Fedora) + dnl check qwt-qt4/qwt.h (as in Ubuntu) AC_CHECK_HEADER( - [qwt/qwt.h], - [qwt_qwt_h=yes], - [qwt_qwt_h=no] + [qwt-qt4/qwt_double_interval.h], + [qwt_qt4_qwt_h=yes], + [qwt_qt4_qwt_h=no] ) dnl If it was found, set the flags and move on - if test "$qwt_qwt_h" = "yes" ; then - QWT_CFLAGS="$QWT_CFLAGS -I/usr/include/qwt" + if test "$qwt_qt4_qwt_h" = "yes" ; then + QWT_CFLAGS="$QWT_CFLAGS -I/usr/include/qwt-qt4" else - dnl otherwise, check qwt-qt4/qwt.h (as in Ubuntu) + dnl check qwt/qwt.h (as in Fedora) AC_CHECK_HEADER( - [qwt-qt4/qwt.h], - [qwt_qt4_qwt_h=yes], - [qwt_qt4_qwt_h=no] + [qwt/qwt_double_interval.h], + [qwt_qwt_h=yes], + [qwt_qwt_h=no] ) dnl if it was found, set the flags and move on - if test "$qwt_qt4_qwt_h" = "yes" ; then - QWT_CFLAGS="$QWT_CFLAGS -I/usr/include/qwt-qt4" + if test "$qwt_qwt_h" = "yes" ; then + QWT_CFLAGS="$QWT_CFLAGS -I/usr/include/qwt" else dnl otherwise, qwt.h wasn't found, so set the flag to no libqwt_ok=no diff --git a/config/grc_gnuradio_examples.m4 b/config/grc_gnuradio_examples.m4 index 0aad0c0da..203f39d0d 100644 --- a/config/grc_gnuradio_examples.m4 +++ b/config/grc_gnuradio_examples.m4 @@ -20,12 +20,14 @@ dnl Boston, MA 02110-1301, USA. AC_DEFUN([GRC_GNURADIO_EXAMPLES],[ GRC_ENABLE(gnuradio-examples) - dnl Do not do gnuradio-examples if gnuradio-core skipped + dnl Do not do gnuradio-examples if gnuradio-core or gr-audio skipped GRC_CHECK_DEPENDENCY(gnuradio-examples, gnuradio-core) + GRC_CHECK_DEPENDENCY(gnuradio-examples, gr-audio) AC_CONFIG_FILES([ \ gnuradio-examples/Makefile \ gnuradio-examples/c++/Makefile \ + gnuradio-examples/c++/audio/Makefile \ gnuradio-examples/python/Makefile \ gnuradio-examples/grc/Makefile \ gnuradio-examples/python/apps/hf_explorer/Makefile \ diff --git a/config/grc_gr_audio.m4 b/config/grc_gr_audio.m4 new file mode 100644 index 000000000..bcb19be35 --- /dev/null +++ b/config/grc_gr_audio.m4 @@ -0,0 +1,112 @@ +dnl Copyright 2011 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 3, 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. + +AC_DEFUN([GRC_GR_AUDIO],[ + GRC_ENABLE(gr-audio) + + GRC_CHECK_DEPENDENCY(gr-audio, gnuradio-core) + + #################################################################### + ## ALSA Support + #################################################################### + PKG_CHECK_MODULES(ALSA, alsa >= 0.9,[GR_AUDIO_ALSA_SUPPORT=true], + [GR_AUDIO_ALSA_SUPPORT=false;AC_MSG_RESULT([gr-audio alsa support requires package alsa, not found.])]) + AM_CONDITIONAL(GR_AUDIO_ALSA_SUPPORT, $GR_AUDIO_ALSA_SUPPORT) + + #################################################################### + ## OSS Support + #################################################################### + dnl Make sure the correct library and/or headers are available. + case $host_os in + netbsd*) + AC_HAVE_LIBRARY(ossaudio,[GR_AUDIO_OSS_SUPPORT=true], + [GR_AUDIO_OSS_SUPPORT=false;AC_MSG_RESULT([gr-audio oss support requires library ossaudio, not found.])]) + if test $GR_AUDIO_OSS_SUPPORT != false; then + OSS_LIBS=-lossaudio + AC_SUBST(OSS_LIBS) + AC_MSG_RESULT([Using OSS library $OSS_LIBS]) + fi + ;; + darwin*) + dnl OSX / Darwin can't use OSS + GR_AUDIO_OSS_SUPPORT=false + ;; + *) + AC_CHECK_HEADER(sys/soundcard.h,[GR_AUDIO_OSS_SUPPORT=true], + [GR_AUDIO_OSS_SUPPORT=false;AC_MSG_RESULT([gr-audio oss support requires sys/soundcard.h, not found.])]) + esac + AM_CONDITIONAL(GR_AUDIO_OSS_SUPPORT, $GR_AUDIO_OSS_SUPPORT) + + #################################################################### + ## Jack Support + #################################################################### + PKG_CHECK_MODULES(JACK, jack >= 0.8, [GR_AUDIO_JACK_SUPPORT=true], + [GR_AUDIO_JACK_SUPPORT=false;AC_MSG_RESULT([gr-audio jack support requires package jack, not found.])]) + AM_CONDITIONAL(GR_AUDIO_JACK_SUPPORT, $GR_AUDIO_JACK_SUPPORT) + + #################################################################### + ## OSX Support + #################################################################### + case "$host_os" in + darwin*) + MACOSX_AUDIOUNIT([GR_AUDIO_OSX_SUPPORT=true], + [GR_AUDIO_OSX_SUPPORT=false;AC_MSG_RESULT([gr-audio osx support requires AudioUnit, not found.])]) + ;; + *) + AC_MSG_RESULT([gr-audio osx support will build on Mac OS X and Darwin only.]) + GR_AUDIO_OSX_SUPPORT=false + ;; + esac + AM_CONDITIONAL(GR_AUDIO_OSX_SUPPORT, $GR_AUDIO_OSX_SUPPORT) + + #################################################################### + ## PortAudio Support + #################################################################### + PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= 19,[GR_AUDIO_PORTAUDIO_SUPPORT=true], + [GR_AUDIO_PORTAUDIO_SUPPORT=false;AC_MSG_RESULT([gr-audio portaudio support requires package portaudio, not found.])]) + AM_CONDITIONAL(GR_AUDIO_PORTAUDIO_SUPPORT, $GR_AUDIO_PORTAUDIO_SUPPORT) + + #################################################################### + ## Windows Support + #################################################################### + case "$host_os" in + cygwin*|win*|mingw*) + AC_HAVE_LIBRARY(winmm, [GR_AUDIO_WINDOWS_SUPPORT=true], + [GR_AUDIO_WINDOWS_SUPPORT=false;AC_MSG_RESULT([gr-audio windows support requires library winmm, not found.])]) + ;; + *) + AC_MSG_RESULT([gr-audio windows support will build on a Windows Unix environment only.]) + GR_AUDIO_WINDOWS_SUPPORT=false + ;; + esac + WINAUDIO_LIBS=-lwinmm + AC_SUBST(WINAUDIO_LIBS) + AM_CONDITIONAL(GR_AUDIO_WINDOWS_SUPPORT, $GR_AUDIO_WINDOWS_SUPPORT) + + AC_CONFIG_FILES([ \ + gr-audio/Makefile \ + gr-audio/grc/Makefile \ + gr-audio/include/Makefile \ + gr-audio/lib/Makefile \ + gr-audio/swig/Makefile \ + gr-audio/gnuradio-audio.pc \ + ]) + + GRC_BUILD_CONDITIONAL(gr-audio) +]) diff --git a/config/grc_gr_audio_alsa.m4 b/config/grc_gr_audio_alsa.m4 deleted file mode 100644 index 35389d81d..000000000 --- a/config/grc_gr_audio_alsa.m4 +++ /dev/null @@ -1,49 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 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 3, 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. - -AC_DEFUN([GRC_GR_AUDIO_ALSA],[ - GRC_ENABLE(gr-audio-alsa) - - dnl Don't do gr-audio-alsa if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-alsa, gnuradio-core) - - dnl If execution gets to here, $passed will be: - 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 gr-audio-alsa if the 'alsa' package is not installed. - PKG_CHECK_MODULES(ALSA, alsa >= 0.9,[], - [passed=no;AC_MSG_RESULT([gr-audio-alsa requires package alsa, not found.])]) - fi - - AC_CONFIG_FILES([ \ - gr-audio-alsa/Makefile \ - gr-audio-alsa/gnuradio-audio-alsa.pc \ - gr-audio-alsa/src/Makefile \ - gr-audio-alsa/src/run_guile_tests \ - gr-audio-alsa/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-alsa,[ - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_alsa], - [chmod +x gr-audio-alsa/src/run_tests gr-audio-alsa/src/run_guile_tests]) - ]) -]) diff --git a/config/grc_gr_audio_jack.m4 b/config/grc_gr_audio_jack.m4 deleted file mode 100644 index d1853588b..000000000 --- a/config/grc_gr_audio_jack.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 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 3, 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. - -AC_DEFUN([GRC_GR_AUDIO_JACK],[ - GRC_ENABLE(gr-audio-jack) - - dnl Don't do gr-audio-jack if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-jack, gnuradio-core) - - dnl If execution gets to here, $passed will be: - 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 gr-audio-jack if in 'jack' isn't installed - PKG_CHECK_MODULES(JACK, jack >= 0.8, [], - [passed=no;AC_MSG_RESULT([gr-audio-jack requires package jack, not found.])]) - fi - - AC_CONFIG_FILES([ \ - gr-audio-jack/Makefile \ - gr-audio-jack/gnuradio-audio-jack.pc \ - gr-audio-jack/src/Makefile \ - gr-audio-jack/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-jack,[ - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_jack], [chmod +x gr-audio-jack/src/run_tests]) - ]) -]) diff --git a/config/grc_gr_audio_oss.m4 b/config/grc_gr_audio_oss.m4 deleted file mode 100644 index 13c83bba9..000000000 --- a/config/grc_gr_audio_oss.m4 +++ /dev/null @@ -1,63 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 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 3, 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. - -AC_DEFUN([GRC_GR_AUDIO_OSS],[ - GRC_ENABLE(gr-audio-oss) - - dnl Don't do gr-audio-oss if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-oss, gnuradio-core) - - dnl If execution gets to here, $passed will be: - 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 Make sure the correct library and/or headers are available. - case $host_os in - netbsd*) - AC_HAVE_LIBRARY(ossaudio,[], - [passed=no;AC_MSG_RESULT([gr-audio-oss requires library ossaudio, not found.])]) - if test $passed != no; then - OSS_LIBS=-lossaudio - AC_SUBST(OSS_LIBS) - AC_MSG_RESULT([Using OSS library $OSS_LIBS]) - fi - ;; - darwin*) - dnl OSX / Darwin can't use OSS - passed=no - ;; - *) - AC_CHECK_HEADER(sys/soundcard.h,[], - [passed=no;AC_MSG_RESULT([gr-audio-oss requires sys/soundcard.h, not found.])]) - esac - fi - - AC_CONFIG_FILES([ \ - gr-audio-oss/Makefile \ - gr-audio-oss/gnuradio-audio-oss.pc \ - gr-audio-oss/src/Makefile \ - gr-audio-oss/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-oss,[ - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_oss], [chmod +x gr-audio-oss/src/run_tests]) - ]) -]) diff --git a/config/grc_gr_audio_osx.m4 b/config/grc_gr_audio_osx.m4 deleted file mode 100644 index df8634ff6..000000000 --- a/config/grc_gr_audio_osx.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2010 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 3, 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. - -AC_DEFUN([GRC_GR_AUDIO_OSX],[ - GRC_ENABLE(gr-audio-osx) - - dnl Don't do gr-audio-osx if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-osx, gnuradio-core) - - dnl If execution gets to here, $passed will be: - 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 - case "$host_os" in - darwin*) - MACOSX_AUDIOUNIT([], - [passed=no;AC_MSG_RESULT([gr-audio-osx requires AudioUnit, not found.])]) - ;; - *) - AC_MSG_RESULT([gr-audio-osx will build on Mac OS X and Darwin only.]) - passed=no - ;; - esac - fi - - AC_CONFIG_FILES([ \ - gr-audio-osx/Makefile \ - gr-audio-osx/src/Makefile \ - gr-audio-osx/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-osx,[ - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_osx], [chmod +x gr-audio-osx/src/run_tests]) - ]) -]) diff --git a/config/grc_gr_audio_portaudio.m4 b/config/grc_gr_audio_portaudio.m4 deleted file mode 100644 index ff551b38a..000000000 --- a/config/grc_gr_audio_portaudio.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 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 3, 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. - -AC_DEFUN([GRC_GR_AUDIO_PORTAUDIO],[ - GRC_ENABLE(gr-audio-portaudio) - - dnl Don't do gr-audio-portaudio if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-portaudio, gnuradio-core) - - dnl If execution gets to here, $passed will be: - 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 gr-audio-portaudio if the 'portaudio' library is unavailable. - PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= 19,[], - [passed=no;AC_MSG_RESULT([gr-audio-portaudio requires package portaudio, not found.])]) - fi - - AC_CONFIG_FILES([ \ - gr-audio-portaudio/Makefile \ - gr-audio-portaudio/gnuradio-audio-portaudio.pc \ - gr-audio-portaudio/src/Makefile \ - gr-audio-portaudio/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-portaudio,[ - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_portaudio], [chmod +x gr-audio-portaudio/src/run_tests]) - ]) -]) diff --git a/config/grc_gr_audio_windows.m4 b/config/grc_gr_audio_windows.m4 deleted file mode 100644 index bb6244163..000000000 --- a/config/grc_gr_audio_windows.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 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 3, 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. - -AC_DEFUN([GRC_GR_AUDIO_WINDOWS],[ - GRC_ENABLE(gr-audio-windows) - - dnl Don't do gr-audio-windows if gnuradio-core skipped - GRC_CHECK_DEPENDENCY(gr-audio-windows, gnuradio-core) - - dnl If execution gets to here, $passed will be: - 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 - case "$host_os" in - cygwin*|win*|mingw*) - dnl Don't do gr-audio-windows if the 'winmm' library isn't available. - AC_HAVE_LIBRARY(winmm, [], - [passed=no;AC_MSG_RESULT([gr-audio-windows requires library winmm, not found.])]) - ;; - *) - AC_MSG_RESULT([gr-audio-windows will build on a Windows Unix environment only.]) - passed=no - ;; - esac - fi - - AC_CONFIG_FILES([ \ - gr-audio-windows/Makefile \ - gr-audio-windows/src/Makefile \ - gr-audio-windows/src/run_tests \ - ]) - - GRC_BUILD_CONDITIONAL(gr-audio-windows,[ - WINAUDIO_LIBS=-lwinmm - AC_SUBST(WINAUDIO_LIBS) - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_audio_windows], [chmod +x gr-audio-windows/src/run_tests]) - ]) -]) diff --git a/config/grc_gr_qtgui.m4 b/config/grc_gr_qtgui.m4 index 4027bb332..aa9646b3c 100644 --- a/config/grc_gr_qtgui.m4 +++ b/config/grc_gr_qtgui.m4 @@ -1,4 +1,4 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc. +dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2011 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl @@ -29,13 +29,12 @@ AC_DEFUN([GRC_GR_QTGUI],[ dnl no : otherwise PYTHON_CHECK_MODULE([PyQt4.QtCore], [PyQt4 for Qt4], \ - [passed=yes], [passed=no], \ - [PyQt4.QtCore.PYQT_VERSION >= 260000]) + [], [passed=no], \ + [PyQt4.QtCore.PYQT_VERSION >= 260000]) - # Enable this if we want to test for PyQwt, too - #PYTHON_CHECK_MODULE([PyQt4.Qwt5], [PyQwt5 for Qt4], \ - # [passed=yes], [passed=no], \ - # [PyQt4.Qwt5.QWT_VERSION >= 327000]) + PYTHON_CHECK_MODULE([PyQt4.Qwt5], [PyQwt5 for Qt4], \ + [], [passed=no], \ + [PyQt4.Qwt5.QWT_VERSION >= 327000]) # Check for: # QtOpenGL @@ -82,10 +81,16 @@ AC_DEFUN([GRC_GR_QTGUI],[ AC_CONFIG_FILES([ \ gr-qtgui/Makefile \ + gr-qtgui/grc/Makefile \ gr-qtgui/src/Makefile \ gr-qtgui/src/lib/Makefile \ gr-qtgui/src/python/Makefile \ + gr-qtgui/src/python/run_tests \ ]) - GRC_BUILD_CONDITIONAL(gr-qtgui) + GRC_BUILD_CONDITIONAL(gr-qtgui,[ + dnl run_tests is created from run_tests.in. Make it executable. + AC_CONFIG_COMMANDS([run_tests_qtgui], + [chmod +x gr-qtgui/src/python/run_tests]) + ]) ]) diff --git a/config/grc_gr_uhd.m4 b/config/grc_gr_uhd.m4 index 030b15155..3cc9691e5 100644 --- a/config/grc_gr_uhd.m4 +++ b/config/grc_gr_uhd.m4 @@ -35,9 +35,10 @@ AC_DEFUN([GRC_GR_UHD],[ # Use this to tell the Makefile whether to define # GR_HAVE_UHD for swig. - AM_CONDITIONAL([GR_DEFINE_HAVE_UHD],[test $passed = yes]) fi + AM_CONDITIONAL([GR_DEFINE_HAVE_UHD],[test $passed = yes]) + AC_CONFIG_FILES([ \ gr-uhd/Makefile \ gr-uhd/grc/Makefile \ diff --git a/config/grc_gr_usrp.m4 b/config/grc_gr_usrp.m4 index b850f0050..c3d2667ca 100644 --- a/config/grc_gr_usrp.m4 +++ b/config/grc_gr_usrp.m4 @@ -1,4 +1,4 @@ -dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc. +dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2011 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl @@ -26,6 +26,7 @@ AC_DEFUN([GRC_GR_USRP],[ AC_CONFIG_FILES([ \ gr-usrp/Makefile \ + gr-usrp/grc/Makefile \ gr-usrp/gnuradio-usrp.pc \ gr-usrp/src/Makefile \ gr-usrp/src/run_tests \ diff --git a/config/grc_gr_usrp2.m4 b/config/grc_gr_usrp2.m4 index 5a9bb3b70..3d64db6d6 100644 --- a/config/grc_gr_usrp2.m4 +++ b/config/grc_gr_usrp2.m4 @@ -1,4 +1,4 @@ -dnl Copyright 2008 Free Software Foundation, Inc. +dnl Copyright 2008,2011 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl @@ -26,6 +26,7 @@ AC_DEFUN([GRC_GR_USRP2],[ AC_CONFIG_FILES([ \ gr-usrp2/Makefile \ + gr-usrp2/grc/Makefile \ gr-usrp2/gnuradio-usrp2.pc \ gr-usrp2/src/Makefile \ gr-usrp2/src/run_tests \ diff --git a/config/grc_gr_wxgui.m4 b/config/grc_gr_wxgui.m4 index c443f7c6c..17925fcc5 100644 --- a/config/grc_gr_wxgui.m4 +++ b/config/grc_gr_wxgui.m4 @@ -36,6 +36,7 @@ AC_DEFUN([GRC_GR_WXGUI],[ AC_CONFIG_FILES([ \ gr-wxgui/Makefile \ gr-wxgui/gr-wxgui.pc \ + gr-wxgui/grc/Makefile \ gr-wxgui/src/Makefile \ gr-wxgui/src/python/Makefile \ gr-wxgui/src/python/plotter/Makefile \ diff --git a/config/grc_gruel.m4 b/config/grc_gruel.m4 index 729571434..c3238b39e 100644 --- a/config/grc_gruel.m4 +++ b/config/grc_gruel.m4 @@ -42,12 +42,16 @@ AC_DEFUN([GRC_GRUEL],[ gruel/src/include/gruel/Makefile \ gruel/src/include/gruel/inet.h \ gruel/src/lib/Makefile \ + gruel/src/swig/Makefile \ + gruel/src/python/Makefile \ + gruel/src/python/run_tests \ gruel/src/lib/pmt/Makefile \ gruel/src/lib/msg/Makefile \ gruel/src/scheme/Makefile \ gruel/src/scheme/gnuradio/Makefile \ ]) + dnl Allow creating autoconf independent header files for bytesex routines AC_CHECK_HEADER(arpa/inet.h, [GR_HAVE_ARPA_INET=1],[GR_HAVE_ARPA_INET=0]) AC_CHECK_HEADER(netinet/in.h, [GR_HAVE_NETINET_IN=1],[GR_HAVE_NETINET_IN=0]) @@ -56,5 +60,7 @@ AC_DEFUN([GRC_GRUEL],[ AC_SUBST(GR_HAVE_NETINET_IN) AC_SUBST(GR_HAVE_BYTESWAP) - GRC_BUILD_CONDITIONAL(gruel,[]) + GRC_BUILD_CONDITIONAL(gruel,[ + AC_CONFIG_COMMANDS([run_tests_gruel],[chmod +x gruel/src/python/run_tests]) + ]) ]) diff --git a/configure.ac b/configure.ac index 7546eb302..73ebbd6af 100644 --- a/configure.ac +++ b/configure.ac @@ -219,20 +219,11 @@ AC_CHECK_LIB(m, sincos, [AC_DEFINE([HAVE_SINCOS],[1],[Define to 1 if your system AC_CHECK_LIB(m, sincosf,[AC_DEFINE([HAVE_SINCOSF],[1],[Define to 1 if your system has `sincosf'.])]) AC_CHECK_LIB(m, sinf, [AC_DEFINE([HAVE_SINF],[1],[Define to 1 if your system has `sinf'.])]) AC_CHECK_LIB(m, cosf, [AC_DEFINE([HAVE_COSF],[1],[Define to 1 if your system has `cosf'.])]) -AC_CHECK_LIB(m, trunc, [AC_DEFINE([HAVE_TRUNC],[1],[Define to 1 if your system has `trunc'.])]) AC_CHECK_LIB(m, exp10, [AC_DEFINE([HAVE_EXP10],[1],[Define to 1 if your system has 'exp10'.])]) AC_CHECK_LIB(m, log2, [AC_DEFINE([HAVE_LOG2],[1],[Define to 1 if your system has 'log2'.])]) #AC_FUNC_MKTIME AH_BOTTOM([ -#ifndef HAVE_TRUNC -#include <math.h> -inline static double trunc(double x) -{ - return x >= 0 ? floor(x) : ceil(x); -} -#endif - #ifndef HAVE_EXP10 #include <math.h> inline static double exp10(double x) @@ -367,12 +358,7 @@ GRC_GR_USRP dnl this must come after GRC_USRP GRC_GR_USRP2 GRC_GR_GCELL dnl this must come after GRC_GCELL and GRC_GNURADIO_CORE GRC_GR_MSDD6000 -GRC_GR_AUDIO_ALSA -GRC_GR_AUDIO_JACK -GRC_GR_AUDIO_OSS -GRC_GR_AUDIO_OSX -GRC_GR_AUDIO_PORTAUDIO -GRC_GR_AUDIO_WINDOWS +GRC_GR_AUDIO GRC_GR_ATSC GRC_GR_COMEDI GRC_GR_CVSD_VOCODER diff --git a/gnuradio-core/gnuradio-core.conf b/gnuradio-core/gnuradio-core.conf index d64f58401..178b288e8 100644 --- a/gnuradio-core/gnuradio-core.conf +++ b/gnuradio-core/gnuradio-core.conf @@ -5,15 +5,3 @@ [DEFAULT] verbose = False - - -[audio] - -# specify which audio module to load, or use "auto" to have the system -# select one. Valid choices depend on your OS and which modules -# you've installed, but typically include: auto, audio_alsa, -# audio_oss, audio_portaudio, audio_jack, audio_osx, audio_windows - -audio_module = auto - - diff --git a/gnuradio-core/src/guile/.gitignore b/gnuradio-core/src/guile/.gitignore index 82a29a907..ea2593923 100644 --- a/gnuradio-core/src/guile/.gitignore +++ b/gnuradio-core/src/guile/.gitignore @@ -2,3 +2,4 @@ /Makefile.in /run_guile_tests /guile.log +/gr-run-waveform-script diff --git a/gnuradio-core/src/lib/bug_work_around_6.cc b/gnuradio-core/src/lib/bug_work_around_6.cc index b829360fc..f8012af0d 100644 --- a/gnuradio-core/src/lib/bug_work_around_6.cc +++ b/gnuradio-core/src/lib/bug_work_around_6.cc @@ -1,3 +1,3 @@ // if libgrio has no sources, it doesn't get built correctly - -static int gr_bug_work_around_6 __attribute__((unused)); +#include <gruel/attributes.h> +static int gr_bug_work_around_6 __GR_ATTR_UNUSED; diff --git a/gnuradio-core/src/lib/filter/qa_gr_rotator.cc b/gnuradio-core/src/lib/filter/qa_gr_rotator.cc index ce71a3d88..ef41127fd 100644 --- a/gnuradio-core/src/lib/filter/qa_gr_rotator.cc +++ b/gnuradio-core/src/lib/filter/qa_gr_rotator.cc @@ -20,6 +20,11 @@ * Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <gruel/attributes.h> #include <cppunit/TestAssert.h> #include <qa_gr_rotator.h> #include <gr_rotator.h> @@ -29,7 +34,7 @@ // error vector magnitude -__attribute__((unused)) static float +__GR_ATTR_UNUSED static float error_vector_mag(gr_complex a, gr_complex b) { return abs(a-b); diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc index e87d93ebf..ca76c8eb8 100644 --- a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc +++ b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc @@ -42,6 +42,7 @@ typedef gr_complex acc_type; using std::vector; +#define MAX_DATA (32767) #define ERR_DELTA (1e-5) #define NELEM(x) (sizeof (x) / sizeof (x[0])) @@ -56,8 +57,8 @@ static void random_complex (gr_complex *buf, unsigned n) { for (unsigned i = 0; i < n; i++){ - float re = rint (uniform () * 32767); - float im = rint (uniform () * 32767); + float re = rint (uniform () * MAX_DATA); + float im = rint (uniform () * MAX_DATA); buf[i] = gr_complex (re, im); } } @@ -151,7 +152,7 @@ qa_gri_fir_filter_with_buffer_ccc::test_decimate(unsigned int decimate) for (int o = 0; o < (int)(ol/decimate); o++){ CPPUNIT_ASSERT_COMPLEXES_EQUAL(expected_output[o], actual_output[o], - abs (expected_output[o]) * ERR_DELTA); + sqrt((float)n)*0.25*MAX_DATA*MAX_DATA * ERR_DELTA); } delete f1; } diff --git a/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc b/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc index 3c379ea25..2fc97a78a 100644 --- a/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc +++ b/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc @@ -20,6 +20,11 @@ * Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <gruel/attributes.h> #include <cppunit/TestAssert.h> #include <qa_gri_mmse_fir_interpolator_cc.h> #include <gri_mmse_fir_interpolator_cc.h> @@ -55,7 +60,7 @@ void qa_gri_mmse_fir_interpolator_cc::t1() { static const unsigned N = 100; - gr_complex input[N + 10] __attribute__ ((aligned (8))); + __GR_ATTR_ALIGNED(8) gr_complex input[N + 10]; for (unsigned i = 0; i < NELEM(input); i++) input[i] = test_fcn ((double) i); diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index 8f895f364..3b8997d8c 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -143,6 +143,7 @@ libgeneral_la_SOURCES = \ gr_rms_cf.cc \ gr_rms_ff.cc \ gr_short_to_float.cc \ + gr_int_to_float.cc \ gr_simple_correlator.cc \ gr_simple_framer.cc \ gr_simple_squelch_cc.cc \ @@ -309,6 +310,7 @@ grinclude_HEADERS = \ gr_rms_cf.h \ gr_rms_ff.h \ gr_short_to_float.h \ + gr_int_to_float.h \ gr_simple_correlator.h \ gr_simple_framer.h \ gr_simple_framer_sync.h \ @@ -429,6 +431,7 @@ swiginclude_HEADERS = \ gr_glfsr_source_b.i \ gr_glfsr_source_f.i \ gr_head.i \ + gr_int_to_float.i \ gr_interleave.i \ gr_interleaved_short_to_complex.i \ gr_iqcomp_cc.i \ diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index dddda60af..d9648ef64 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -42,6 +42,7 @@ #include <gr_float_to_char.h> #include <gr_float_to_uchar.h> #include <gr_short_to_float.h> +#include <gr_int_to_float.h> #include <gr_char_to_float.h> #include <gr_uchar_to_float.h> #include <gr_frequency_modulator_fc.h> @@ -171,6 +172,7 @@ %include "gr_float_to_char.i" %include "gr_float_to_uchar.i" %include "gr_short_to_float.i" +%include "gr_int_to_float.i" %include "gr_char_to_float.i" %include "gr_uchar_to_float.i" %include "gr_frequency_modulator_fc.i" diff --git a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc index 0f6f0d719..bff22be25 100644 --- a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc +++ b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -28,6 +28,7 @@ #include <gr_io_signature.h> #include <gr_sincos.h> #include <math.h> +#include <boost/math/special_functions/trunc.hpp> gr_frequency_modulator_fc_sptr gr_make_frequency_modulator_fc (double sensitivity) @@ -62,7 +63,7 @@ gr_frequency_modulator_fc::work (int noutput_items, // to avoid loss of precision in the addition above. if (fabs (d_phase) > 16 * M_PI){ - double ii = trunc (d_phase / (2 * M_PI)); + double ii = boost::math::trunc (d_phase / (2 * M_PI)); d_phase = d_phase - (ii * 2 * M_PI); } diff --git a/gnuradio-core/src/lib/general/gr_int_to_float.cc b/gnuradio-core/src/lib/general/gr_int_to_float.cc new file mode 100644 index 000000000..b5a19e5c0 --- /dev/null +++ b/gnuradio-core/src/lib/general/gr_int_to_float.cc @@ -0,0 +1,59 @@ +/* -*- c++ -*- */ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gr_int_to_float.h> +#include <gr_io_signature.h> + +gr_int_to_float_sptr +gr_make_int_to_float () +{ + return gnuradio::get_initial_sptr(new gr_int_to_float ()); +} + +gr_int_to_float::gr_int_to_float () + : gr_sync_block ("gr_int_to_float", + gr_make_io_signature (1, 1, sizeof (int32_t)), + gr_make_io_signature (1, 1, sizeof (float))) +{ +} + +int +gr_int_to_float::work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) +{ + const int32_t *in = (const int32_t *) input_items[0]; + float *out = (float *) output_items[0]; + + for(int i=0; i < noutput_items; i++) { + out[i] = (float)in[i]; + } + + return noutput_items; +} + + + diff --git a/gnuradio-examples/c++/dial_tone/dial_tone.cc b/gnuradio-core/src/lib/general/gr_int_to_float.h index 9a2772a18..cf1223be5 100644 --- a/gnuradio-examples/c++/dial_tone/dial_tone.cc +++ b/gnuradio-core/src/lib/general/gr_int_to_float.h @@ -1,5 +1,6 @@ +/* -*- c++ -*- */ /* - * Copyright 2006,2008 Free Software Foundation, Inc. + * Copyright 2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -19,25 +20,32 @@ * Boston, MA 02110-1301, USA. */ -#include <dial_tone.h> -#include <gr_io_signature.h> -#include <gr_sig_source_f.h> -#include <audio_alsa_sink.h> +#ifndef INCLUDED_GR_INT_TO_FLOAT_H +#define INCLUDED_GR_INT_TO_FLOAT_H -// Shared pointer constructor -dial_tone_sptr make_dial_tone() -{ - return gnuradio::get_initial_sptr(new dial_tone()); -} +#include <gr_sync_block.h> + +class gr_int_to_float; +typedef boost::shared_ptr<gr_int_to_float> gr_int_to_float_sptr; -// Hierarchical block constructor, with no inputs or outputs -dial_tone::dial_tone() : - gr_top_block("dial_tone") +gr_int_to_float_sptr +gr_make_int_to_float (); + +/*! + * \brief Convert stream of short to a stream of float + * \ingroup converter_blk + */ + +class gr_int_to_float : public gr_sync_block { - gr_sig_source_f_sptr src0 = gr_make_sig_source_f(48000, GR_SIN_WAVE, 350, 0.1); - gr_sig_source_f_sptr src1 = gr_make_sig_source_f(48000, GR_SIN_WAVE, 440, 0.1); - audio_alsa_sink_sptr sink = audio_alsa_make_sink(48000); + friend gr_int_to_float_sptr gr_make_int_to_float (); + gr_int_to_float (); + + public: + virtual int work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); +}; + - connect(src0, 0, sink, 0); - connect(src1, 0, sink, 1); -} +#endif /* INCLUDED_GR_INT_TO_FLOAT_H */ diff --git a/gnuradio-examples/c++/dial_tone/dial_tone.h b/gnuradio-core/src/lib/general/gr_int_to_float.i index c645439bb..8cb9e35b5 100644 --- a/gnuradio-examples/c++/dial_tone/dial_tone.h +++ b/gnuradio-core/src/lib/general/gr_int_to_float.i @@ -1,5 +1,6 @@ +/* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -19,15 +20,11 @@ * Boston, MA 02110-1301, USA. */ -#include <gr_top_block.h> +GR_SWIG_BLOCK_MAGIC(gr,int_to_float) -class dial_tone; -typedef boost::shared_ptr<dial_tone> dial_tone_sptr; -dial_tone_sptr make_dial_tone(); +gr_int_to_float_sptr gr_make_int_to_float (); -class dial_tone : public gr_top_block +class gr_int_to_float : public gr_sync_block { -private: - dial_tone(); - friend dial_tone_sptr make_dial_tone(); + gr_int_to_float (); }; diff --git a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h b/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h index 024d74ada..f17b68aa0 100644 --- a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h +++ b/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_GR_MPSK_RECEIVER_CC_H #define INCLUDED_GR_MPSK_RECEIVER_CC_H +#include <gruel/attributes.h> #include <gr_block.h> #include <gr_complex.h> #include <fstream> @@ -299,7 +300,7 @@ protected: static const unsigned int DLLEN = 8; //! delay line plus some length for overflow protection - gr_complex d_dl[2*DLLEN] __attribute__ ((aligned(8))); + __GR_ATTR_ALIGNED(8) gr_complex d_dl[2*DLLEN]; //! index to delay line unsigned int d_dl_idx; diff --git a/gnuradio-core/src/lib/general/gr_throttle.cc b/gnuradio-core/src/lib/general/gr_throttle.cc index 3189e01c0..a24b1da8c 100644 --- a/gnuradio-core/src/lib/general/gr_throttle.cc +++ b/gnuradio-core/src/lib/general/gr_throttle.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2010 Free Software Foundation, Inc. + * Copyright 2005-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -26,92 +26,64 @@ #include <gr_throttle.h> #include <gr_io_signature.h> -#include <errno.h> -#include <stdio.h> -#include <math.h> -#include <string.h> -#ifdef HAVE_TIME_H -#include <time.h> -#endif -#if !defined(HAVE_NANOSLEEP) && defined(HAVE_SSLEEP) -#include <windows.h> -#endif - +#include <cstring> +#include <boost/thread/thread.hpp> -#ifdef HAVE_NANOSLEEP -void -gr_nanosleep(struct timespec *ts) -{ - struct timespec *req = ts; - struct timespec rem; - int r = nanosleep(req, &rem); - while (r < 0 && errno == EINTR){ - req = &rem; - r = nanosleep(req, &rem); - } - if (r < 0) - perror ("gr_nanosleep"); -} -#endif - -gr_throttle_sptr -gr_make_throttle(size_t itemsize, double samples_per_sec) -{ - return gnuradio::get_initial_sptr(new gr_throttle(itemsize, samples_per_sec)); -} +class gr_throttle_impl : public gr_throttle{ +public: + gr_throttle_impl(size_t itemsize): + gr_sync_block("throttle", + gr_make_io_signature(1, 1, itemsize), + gr_make_io_signature(1, 1, itemsize)), + d_itemsize(itemsize) + { + /* NOP */ + } -gr_throttle::gr_throttle(size_t itemsize, double samples_per_sec) - : gr_sync_block("throttle", - gr_make_io_signature(1, 1, itemsize), - gr_make_io_signature(1, 1, itemsize)), - d_itemsize(itemsize), d_samples_per_sec(samples_per_sec), - d_total_samples(0) -{ -#ifdef HAVE_GETTIMEOFDAY - gettimeofday(&d_start, 0); -#endif -} + void set_sample_rate(double rate){ + //changing the sample rate performs a reset of state params + d_start = boost::get_system_time(); + d_total_samples = 0; + d_samps_per_tick = rate/boost::posix_time::time_duration::ticks_per_second(); + d_samps_per_us = rate/1e6; + } -gr_throttle::~gr_throttle() -{ -} + int work ( + int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items + ){ + //calculate the expected number of samples to have passed through + boost::system_time now = boost::get_system_time(); + boost::int64_t ticks = (now - d_start).ticks(); + uint64_t expected_samps = uint64_t(d_samps_per_tick*ticks); -int -gr_throttle::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const char *in = (const char *) input_items[0]; - char *out = (char *) output_items[0]; + //if the expected samples was less, we need to throttle back + if (d_total_samples > expected_samps){ + boost::this_thread::sleep(boost::posix_time::microseconds( + long((d_total_samples - expected_samps)/d_samps_per_us) + )); + } -#if defined(HAVE_GETTIMEOFDAY) - // - // If our average sample rate exceeds our target sample rate, - // delay long enough to reduce to our target rate. - // - struct timeval now; - gettimeofday(&now, 0); - long t_usec = now.tv_usec - d_start.tv_usec; - long t_sec = now.tv_sec - d_start.tv_sec; - double t = (double)t_sec + (double)t_usec * 1e-6; - if (t < 1e-6) // avoid unlikely divide by zero - t = 1e-6; + //copy all samples output[i] <= input[i] + const char *in = (const char *) input_items[0]; + char *out = (char *) output_items[0]; + std::memcpy(out, in, noutput_items * d_itemsize); + d_total_samples += noutput_items; + return noutput_items; + } - double actual_samples_per_sec = d_total_samples / t; - if (actual_samples_per_sec > d_samples_per_sec){ // need to delay - double delay = d_total_samples / d_samples_per_sec - t; -#ifdef HAVE_NANOSLEEP - struct timespec ts; - ts.tv_sec = (time_t)floor(delay); - ts.tv_nsec = (long)((delay - floor(delay)) * 1e9); - gr_nanosleep(&ts); -#elif HAVE_SSLEEP - Sleep( (DWORD)(delay*1000) ); -#endif - } -#endif +private: + boost::system_time d_start; + size_t d_itemsize; + uint64_t d_total_samples; + double d_samps_per_tick, d_samps_per_us; +}; - memcpy(out, in, noutput_items * d_itemsize); - d_total_samples += noutput_items; - return noutput_items; +gr_throttle::sptr +gr_make_throttle(size_t itemsize, double samples_per_sec) +{ + gr_throttle::sptr throttle(new gr_throttle_impl(itemsize)); + throttle->set_sample_rate(samples_per_sec); + return throttle; } diff --git a/gnuradio-core/src/lib/general/gr_throttle.h b/gnuradio-core/src/lib/general/gr_throttle.h index a1c9773c9..a82821f77 100644 --- a/gnuradio-core/src/lib/general/gr_throttle.h +++ b/gnuradio-core/src/lib/general/gr_throttle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,15 +23,6 @@ #define INCLUDED_GR_THROTTLE_H #include <gr_sync_block.h> -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif - -class gr_throttle; -typedef boost::shared_ptr<gr_throttle> gr_throttle_sptr; - - -gr_throttle_sptr gr_make_throttle(size_t itemsize, double samples_per_sec); /*! * \brief throttle flow of samples such that the average rate does not exceed samples_per_sec. @@ -44,25 +35,15 @@ gr_throttle_sptr gr_make_throttle(size_t itemsize, double samples_per_sec); * controlling the rate of samples. That should be controlled by a * source or sink tied to sample clock. E.g., a USRP or audio card. */ -class gr_throttle : public gr_sync_block +class gr_throttle : virtual public gr_sync_block { - friend gr_throttle_sptr gr_make_throttle(size_t itemsize, double samples_per_sec); - size_t d_itemsize; - double d_samples_per_sec; - double d_total_samples; -#ifdef HAVE_SYS_TIME_H - struct timeval d_start; -#endif - - gr_throttle(size_t itemsize, double samples_per_sec); - public: - ~gr_throttle(); + typedef boost::shared_ptr<gr_throttle> sptr; - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); + //! Sets the sample rate in samples per second + virtual void set_sample_rate(double rate) = 0; }; - + +gr_throttle::sptr gr_make_throttle(size_t itemsize, double samples_per_sec); #endif /* INCLUDED_GR_THROTTLE_H */ diff --git a/gnuradio-core/src/lib/general/gr_throttle.i b/gnuradio-core/src/lib/general/gr_throttle.i index 21f7703ef..0b1ec165f 100644 --- a/gnuradio-core/src/lib/general/gr_throttle.i +++ b/gnuradio-core/src/lib/general/gr_throttle.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005 Free Software Foundation, Inc. + * Copyright 2005-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,11 +20,10 @@ * Boston, MA 02110-1301, USA. */ -GR_SWIG_BLOCK_MAGIC(gr,throttle); +%{ +#include <gr_throttle.h> +%} -gr_throttle_sptr gr_make_throttle (size_t itemsize, double samples_per_sec); +GR_SWIG_BLOCK_MAGIC(gr,throttle); -class gr_throttle : public gr_sync_block -{ - gr_throttle (size_t itemsize, double samples_per_sec); -}; +%include <gr_throttle.h> diff --git a/gnuradio-core/src/lib/io/gr_histo_sink_f.cc b/gnuradio-core/src/lib/io/gr_histo_sink_f.cc index a37189c24..fc0c12ce6 100644 --- a/gnuradio-core/src/lib/io/gr_histo_sink_f.cc +++ b/gnuradio-core/src/lib/io/gr_histo_sink_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2009,2010 Free Software Foundation, Inc. + * Copyright 2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -26,6 +26,7 @@ #include <gr_histo_sink_f.h> #include <gr_io_signature.h> +#include <boost/math/special_functions/round.hpp> static float get_clean_num(float num){ if (num == 0) return 0; @@ -101,7 +102,7 @@ gr_histo_sink_f::send_frame(void){ int index; float bin_width = (maximum - minimum)/(d_num_bins-1); for (unsigned int i = 0; i < d_sample_count; i++){ - index = round((d_samps[i] - minimum)/bin_width); + index = boost::math::iround((d_samps[i] - minimum)/bin_width); /* ensure the index range in case a small floating point error is involed */ if (index < 0) index = 0; if (index >= (int)d_num_bins) index = d_num_bins-1; diff --git a/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc b/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc index c76ede542..154611c32 100644 --- a/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc +++ b/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc @@ -26,7 +26,6 @@ #include <gr_tagged_file_sink.h> #include <gr_io_signature.h> -#include <cstdio> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> diff --git a/gnuradio-core/src/lib/io/gr_tagged_file_sink.h b/gnuradio-core/src/lib/io/gr_tagged_file_sink.h index 956340f8d..2e0a5c63a 100644 --- a/gnuradio-core/src/lib/io/gr_tagged_file_sink.h +++ b/gnuradio-core/src/lib/io/gr_tagged_file_sink.h @@ -24,6 +24,7 @@ #define INCLUDED_GR_TAGGED_FILE_SINK_H #include <gr_sync_block.h> +#include <cstdio> // for FILE class gr_tagged_file_sink; typedef boost::shared_ptr<gr_tagged_file_sink> gr_tagged_file_sink_sptr; diff --git a/gnuradio-core/src/lib/io/gr_wavfile_sink.cc b/gnuradio-core/src/lib/io/gr_wavfile_sink.cc index b60a6e3ab..a96aadc72 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_sink.cc +++ b/gnuradio-core/src/lib/io/gr_wavfile_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc. + * Copyright 2004,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -33,6 +33,7 @@ #include <cmath> #include <fcntl.h> #include <gruel/thread.h> +#include <boost/math/special_functions/round.hpp> // win32 (mingw/msvc) specific #ifdef HAVE_IO_H @@ -224,7 +225,7 @@ gr_wavfile_sink::convert_to_short(float sample) sample = d_min_sample_val; } - return (short int) roundf(sample); + return (short int) boost::math::iround(sample); } diff --git a/gnuradio-core/src/lib/io/gr_wavfile_source.cc b/gnuradio-core/src/lib/io/gr_wavfile_source.cc index d00dd3028..136e52611 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_source.cc +++ b/gnuradio-core/src/lib/io/gr_wavfile_source.cc @@ -27,7 +27,6 @@ #include <gr_wavfile_source.h> #include <gr_io_signature.h> #include <gri_wavfile.h> -#include <cstdio> #include <sys/types.h> #include <fcntl.h> #include <stdexcept> diff --git a/gnuradio-core/src/lib/io/gr_wavfile_source.h b/gnuradio-core/src/lib/io/gr_wavfile_source.h index 0c663f0a0..e434a6b4c 100644 --- a/gnuradio-core/src/lib/io/gr_wavfile_source.h +++ b/gnuradio-core/src/lib/io/gr_wavfile_source.h @@ -24,6 +24,7 @@ #define INCLUDED_GR_WAVFILE_SOURCE_H #include <gr_sync_block.h> +#include <cstdio> // for FILE class gr_wavfile_source; typedef boost::shared_ptr<gr_wavfile_source> gr_wavfile_source_sptr; diff --git a/gnuradio-core/src/lib/missing/bug_work_around_8.cc b/gnuradio-core/src/lib/missing/bug_work_around_8.cc index b2cbdb3d9..5e431a210 100644 --- a/gnuradio-core/src/lib/missing/bug_work_around_8.cc +++ b/gnuradio-core/src/lib/missing/bug_work_around_8.cc @@ -1,2 +1,3 @@ // if libmisc has no sources, it doesn't get built correctly -static int gr_bug_work_around_8 __attribute__((unused)); +#include <gruel/attributes.h> +static int gr_bug_work_around_8 __GR_ATTR_UNUSED; diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.h b/gnuradio-core/src/lib/runtime/gr_basic_block.h index ce7a1aa1d..3b0cd51dd 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.h +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.h @@ -73,6 +73,8 @@ protected: long d_unique_id; vcolor d_color; + gr_basic_block(void){} //allows pure virtual interface sub-classes + //! Protected constructor prevents instantiation by non-derived classes gr_basic_block(const std::string &name, gr_io_signature_sptr input_signature, diff --git a/gnuradio-core/src/lib/runtime/gr_block.h b/gnuradio-core/src/lib/runtime/gr_block.h index ad7fa9555..fc22f9ea8 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.h +++ b/gnuradio-core/src/lib/runtime/gr_block.h @@ -236,7 +236,7 @@ class gr_block : public gr_basic_block { tag_propagation_policy_t d_tag_propagation_policy; // policy for moving tags downstream protected: - + gr_block (void){} //allows pure virtual interface sub-classes gr_block (const std::string &name, gr_io_signature_sptr input_signature, gr_io_signature_sptr output_signature); diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.h b/gnuradio-core/src/lib/runtime/gr_buffer.h index aa26f1e09..e5725d386 100644 --- a/gnuradio-core/src/lib/runtime/gr_buffer.h +++ b/gnuradio-core/src/lib/runtime/gr_buffer.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2009,2010 Free Software Foundation, Inc. + * Copyright 2004,2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -27,6 +27,7 @@ #include <boost/weak_ptr.hpp> #include <gruel/thread.h> #include <gruel/pmt.h> +#include <deque> class gr_vmcircbuf; diff --git a/gnuradio-core/src/lib/runtime/gr_error_handler.cc b/gnuradio-core/src/lib/runtime/gr_error_handler.cc index 6dbb0a5d2..4b4cdacef 100644 --- a/gnuradio-core/src/lib/runtime/gr_error_handler.cc +++ b/gnuradio-core/src/lib/runtime/gr_error_handler.cc @@ -48,7 +48,6 @@ #include <assert.h> #include <stdexcept> #include <unistd.h> -#include <stdio.h> #ifdef HAVE_IO_H #include <io.h> diff --git a/gnuradio-core/src/lib/runtime/gr_error_handler.h b/gnuradio-core/src/lib/runtime/gr_error_handler.h index 530a2c23c..aedb6f41f 100644 --- a/gnuradio-core/src/lib/runtime/gr_error_handler.h +++ b/gnuradio-core/src/lib/runtime/gr_error_handler.h @@ -45,6 +45,7 @@ #include <stdarg.h> #include <string> +#include <cstdio> // for FILE /*! * \brief abstract error handler diff --git a/gnuradio-core/src/lib/runtime/gr_flowgraph.cc b/gnuradio-core/src/lib/runtime/gr_flowgraph.cc index 27f6257cc..0d3bbb011 100644 --- a/gnuradio-core/src/lib/runtime/gr_flowgraph.cc +++ b/gnuradio-core/src/lib/runtime/gr_flowgraph.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2007,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -28,6 +28,7 @@ #include <gr_io_signature.h> #include <stdexcept> #include <sstream> +#include <iterator> #define GR_FLOWGRAPH_DEBUG 0 diff --git a/gnuradio-core/src/lib/runtime/gr_sync_block.h b/gnuradio-core/src/lib/runtime/gr_sync_block.h index 3a5d89d19..c5a6a50f1 100644 --- a/gnuradio-core/src/lib/runtime/gr_sync_block.h +++ b/gnuradio-core/src/lib/runtime/gr_sync_block.h @@ -34,7 +34,7 @@ class gr_sync_block : public gr_block { protected: - + gr_sync_block (void){} //allows pure virtual interface sub-classes gr_sync_block (const std::string &name, gr_io_signature_sptr input_signature, gr_io_signature_sptr output_signature); diff --git a/gnuradio-core/src/python/gnuradio/Makefile.am b/gnuradio-core/src/python/gnuradio/Makefile.am index 55a2ba1df..1bec7dd19 100644 --- a/gnuradio-core/src/python/gnuradio/Makefile.am +++ b/gnuradio-core/src/python/gnuradio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2007,2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2004-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,7 +26,6 @@ SUBDIRS = gr gru gruimpl blks2 blks2impl vocoder utils grpython_PYTHON = \ __init__.py \ - audio.py \ eng_notation.py \ eng_option.py \ modulation_utils.py \ diff --git a/gnuradio-core/src/python/gnuradio/audio.py b/gnuradio-core/src/python/gnuradio/audio.py deleted file mode 100644 index f6e921f0e..000000000 --- a/gnuradio-core/src/python/gnuradio/audio.py +++ /dev/null @@ -1,88 +0,0 @@ -# -# Copyright 2004,2006 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -""" -This is the 'generic' audio or soundcard interface. - -The behavior of this module is controlled by the [audio] audio_module -configuration parameter. If it is 'auto' we attempt to import modules -from the known_modules list, using the first one imported successfully. - -If [audio] audio_module is not 'auto', we assume it's the name of -an audio module and attempt to import it. -""" - -__all__ = ['source', 'sink'] - -from gnuradio import gr -import sys - -source = None -sink = None - - -known_modules = ( - 'audio_alsa', 'audio_oss', 'audio_osx', 'audio_jack', 'audio_portaudio', 'audio_windows') - - -def try_import(name): - """ - Build a blob of code and try to execute it. - If it succeeds we will have set the globals source and sink - as side effects. - - returns True or False - """ - global source, sink - full_name = "gnuradio." + name - code = """ -import %s -source = %s.source -sink = %s.sink -""" % (full_name, full_name, full_name) - try: - exec code in globals() - return True - except ImportError: - return False - - -def __init__ (): - p = gr.prefs() # get preferences (config file) object - verbose = p.get_bool('audio', 'verbose', False) - module = p.get_string('audio', 'audio_module', 'auto') - - if module == 'auto': # search our list for the first one that we can import - for m in known_modules: - if try_import(m): - if verbose: sys.stderr.write('audio: using %s\n' % (m,)) - return - raise ImportError, 'Unable to locate an audio module.' - - else: # use the one the user specified - if try_import(module): - if verbose: sys.stderr.write('audio: using %s\n' % (module,)) - else: - msg = 'Failed to import user-specified audio module %s' % (module,) - if verbose: sys.stderr.write('audio: %s\n' % (msg,)) - raise ImportError, msg - -__init__() diff --git a/gnuradio-core/src/python/gnuradio/gr/Makefile.am b/gnuradio-core/src/python/gnuradio/gr/Makefile.am index db2cc6eb3..78480b412 100644 --- a/gnuradio-core/src/python/gnuradio/gr/Makefile.am +++ b/gnuradio-core/src/python/gnuradio/gr/Makefile.am @@ -72,6 +72,7 @@ noinst_PYTHON = \ qa_hier_block2.py \ qa_hilbert.py \ qa_iir.py \ + qa_int_to_float.py \ qa_interleave.py \ qa_interp_fir_filter.py \ qa_kludge_copy.py \ diff --git a/gr-audio-portaudio/src/qa_portaudio.py b/gnuradio-core/src/python/gnuradio/gr/qa_int_to_float.py index 20731f38d..edfc26409 100755 --- a/gr-audio-portaudio/src/qa_portaudio.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_int_to_float.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005,2010 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,9 +21,8 @@ # from gnuradio import gr, gr_unittest -import audio_portaudio -class test_audio_portaudio (gr_unittest.TestCase): +class test_int_to_float (gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () @@ -31,10 +30,20 @@ class test_audio_portaudio (gr_unittest.TestCase): def tearDown (self): self.tb = None - def test_000_nop (self): - """Just see if we can import the module... - They may not have PORTAUDIO drivers, etc. Don't try to run anything""" - pass - + def test_001(self): + + src_data = (0, 1, 2, 3, 4, 5, -1, -2, -3, -4, -5) + expected_result = [float(s) for s in src_data] + src = gr.vector_source_i(src_data) + op = gr.int_to_float() + dst = gr.vector_sink_f() + + self.tb.connect(src, op, dst) + self.tb.run() + result_data = dst.data() + + self.assertFloatTuplesAlmostEqual(expected_result, result_data) + if __name__ == '__main__': - gr_unittest.run(test_audio_portaudio, "test_audio_portaudio.xml") + gr_unittest.run(test_int_to_float, "test_int_to_float.xml") + diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc index 5d53a9f89..8ef26a40d 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc @@ -56,7 +56,8 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) { int i; gr_complex coeffs[NTAPS]; - gr_complex input[BLOCK_SIZE + NTAPS]; + //gr_complex input[BLOCK_SIZE + NTAPS]; // not always 16-bit aligned + gr_complex *input = new gr_complex[BLOCK_SIZE + NTAPS]; long n; gr_complex result; #ifdef HAVE_SYS_RESOURCE_H @@ -86,7 +87,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) exit (1); } #else - clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC); + clock_start= (double) clock() / CLOCKS_PER_SEC; #endif // do the actual work @@ -116,7 +117,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) double total = user + sys; #else - clock_end = (double) clock() * (1000000. / CLOCKS_PER_SEC); + clock_end = (double) clock() / CLOCKS_PER_SEC; double total = clock_end - clock_start; #endif @@ -126,6 +127,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); delete f; + delete [] input; } static void diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc index 60855ec94..ed3c49165 100644 --- a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc +++ b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc @@ -56,7 +56,8 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) { int i; float coeffs[NTAPS]; - gr_complex input[BLOCK_SIZE + NTAPS]; + //gr_complex input[BLOCK_SIZE + NTAPS]; // not always 16-bit aligned + gr_complex *input = new gr_complex[BLOCK_SIZE + NTAPS]; long n; gr_complex result; #ifdef HAVE_SYS_RESOURCE_H @@ -86,7 +87,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) exit (1); } #else - clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC); + clock_start= (double) clock() / CLOCKS_PER_SEC; #endif // do the actual work @@ -118,7 +119,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) double total = user + sys; #else - clock_end= (double) clock() * (1000000. / CLOCKS_PER_SEC); + clock_end= (double) clock() / CLOCKS_PER_SEC; double total = clock_end - clock_start; #endif @@ -128,6 +129,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name) implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total); delete f; + delete [] input; } static void diff --git a/gnuradio-examples/c++/Makefile.am b/gnuradio-examples/c++/Makefile.am index 43c63847a..5a49e0e89 100644 --- a/gnuradio-examples/c++/Makefile.am +++ b/gnuradio-examples/c++/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2006,2008 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,4 +20,4 @@ # include $(top_srcdir)/Makefile.common -#SUBDIRS = dial_tone +SUBDIRS = audio diff --git a/gnuradio-examples/c++/dial_tone/.gitignore b/gnuradio-examples/c++/audio/.gitignore index c5e345858..bb08aaf91 100644 --- a/gnuradio-examples/c++/dial_tone/.gitignore +++ b/gnuradio-examples/c++/audio/.gitignore @@ -1,5 +1,3 @@ -/.deps -/.libs /Makefile /Makefile.in /dial_tone diff --git a/gnuradio-examples/c++/dial_tone/Makefile.am b/gnuradio-examples/c++/audio/Makefile.am index 188275fca..88bd7c1fd 100644 --- a/gnuradio-examples/c++/dial_tone/Makefile.am +++ b/gnuradio-examples/c++/audio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2006,2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,25 +21,18 @@ include $(top_srcdir)/Makefile.common -# For compiling within the GNU Radio build tree +# For compiling with the GNU Radio build tree, use include dir below. +# For compiling outside the tree, use 'pkg-config --cflags gnuradio-audio' AM_CPPFLAGS = \ - -I$(top_srcdir)/gr-audio-alsa/src \ + -I$(top_srcdir)/gr-audio/include \ $(STD_DEFINES_AND_INCLUDES) \ $(WITH_INCLUDES) -GR_AUDIO_ALSA_LA=$(top_builddir)/gr-audio-alsa/src/libgnuradio-audio-alsa.la - -# For compiling outside the tree, these will get fished out by pkgconfig +# For compiling within the GNU Radio build tree, link against GR_AUDIO_LA +# For compiling outside the tree, use 'pkg-config --libs gnuradio-audio' +GR_AUDIO_LA=$(top_builddir)/gr-audio/lib/libgnuradio-audio.la noinst_PROGRAMS = dial_tone -noinst_HEADERS = \ - dial_tone.h - -dial_tone_SOURCES = \ - dial_tone.cc \ - main.cc - -dial_tone_LDADD = \ - $(GNURADIO_CORE_LA) \ - $(GR_AUDIO_ALSA_LA) +dial_tone_SOURCES = dial_tone.cc +dial_tone_LDADD = $(GNURADIO_CORE_LA) $(GR_AUDIO_LA) diff --git a/gnuradio-examples/c++/audio/dial_tone.cc b/gnuradio-examples/c++/audio/dial_tone.cc new file mode 100644 index 000000000..e4e3d8ceb --- /dev/null +++ b/gnuradio-examples/c++/audio/dial_tone.cc @@ -0,0 +1,78 @@ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + + +/* + * GNU Radio C++ example creating dial tone + * ("the simplest thing that could possibly work") + * + * Send a tone each to the left and right channels of stereo audio + * output and let the user's brain sum them. + * + * GNU Radio makes extensive use of Boost shared pointers. Signal processing + * blocks are typically created by calling a "make" factory function, which + * returns an instance of the block as a typedef'd shared pointer that can + * be used in any way a regular pointer can. Shared pointers created this way + * keep track of their memory and free it at the right time, so the user + * doesn't need to worry about it (really). + * + */ + +// Include header files for each block used in flowgraph +#include <gr_top_block.h> +#include <gr_sig_source_f.h> +#include <gr_audio_sink.h> + +int main(int argc, char **argv) +{ + int rate = 48000; // Audio card sample rate + float ampl = 0.1; // Don't exceed 0.5 or clipping will occur + + // Construct a top block that will contain flowgraph blocks. Alternatively, + // one may create a derived class from gr_top_block and hold instantiated blocks + // as member data for later manipulation. + gr_top_block_sptr tb = gr_make_top_block("dial_tone"); + + // Construct a real-valued signal source for each tone, at given sample rate + gr_sig_source_f_sptr src0 = gr_make_sig_source_f(rate, GR_SIN_WAVE, 350, ampl); + gr_sig_source_f_sptr src1 = gr_make_sig_source_f(rate, GR_SIN_WAVE, 440, ampl); + + // Construct an audio sink to accept audio tones + audio_sink::sptr sink = audio_make_sink(rate); + + // Connect output #0 of src0 to input #0 of sink (left channel) + tb->connect(src0, 0, sink, 0); + + // Connect output #0 of src1 to input #1 of sink (right channel) + tb->connect(src1, 0, sink, 1); + + // Tell GNU Radio runtime to start flowgraph threads; the foreground thread + // will block until either flowgraph exits (this example doesn't) or the + // application receives SIGINT (e.g., user hits CTRL-C). + // + // Real applications may use tb->start() which returns, allowing the foreground + // thread to proceed, then later use tb->stop(), followed by tb->wait(), to cleanup + // GNU Radio before exiting. + tb->run(); + + // Exit normally. + return 0; +} diff --git a/gnuradio-examples/c++/dial_tone/README b/gnuradio-examples/c++/dial_tone/README deleted file mode 100644 index 6d5ed5059..000000000 --- a/gnuradio-examples/c++/dial_tone/README +++ /dev/null @@ -1,16 +0,0 @@ -This example requires that gr-audio-alsa be built in the main tree in order -to compile successfully. It is not built automatically. - -To build this example, you must make two modifications to the build system: - -1) Add the following line inside config/grc_gnuradio_examples.m4: - - gnuradio-examples/c++/dial_tone/Makefile - - ...to the list of Makefiles already in there. - -2) In gnuradio-examples/c++/Makefile.am, uncomment the SUBDIRS line - -# SUBDIRS = dial_tone - -Then, from the top-level directory, re-run ./bootstrap and ./configure.
\ No newline at end of file diff --git a/gr-audio-alsa/.gitignore b/gr-audio-alsa/.gitignore deleted file mode 100644 index cdcf41b15..000000000 --- a/gr-audio-alsa/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 diff --git a/gr-audio-alsa/gnuradio-audio-alsa.pc.in b/gr-audio-alsa/gnuradio-audio-alsa.pc.in deleted file mode 100644 index d5147e6af..000000000 --- a/gr-audio-alsa/gnuradio-audio-alsa.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: gnuradio-audio-alsa -Description: The GNU Radio block for the ALSA sound system -Requires: gnuradio-core alsa -Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-audio-alsa -Cflags: -I${includedir} diff --git a/gr-audio-alsa/src/.gitignore b/gr-audio-alsa/src/.gitignore deleted file mode 100644 index 8de8fe39c..000000000 --- a/gr-audio-alsa/src/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/usrp.py -/usrp.cc -/audio_oss.cc -/audio_oss.py -/audio_alsa.py -/audio_alsa.cc -/run_tests -/run_guile_tests -/*.pyc -/gnuradio -/guile -/python diff --git a/gr-audio-alsa/src/Makefile.am b/gr-audio-alsa/src/Makefile.am deleted file mode 100644 index 330158aa5..000000000 --- a/gr-audio-alsa/src/Makefile.am +++ /dev/null @@ -1,88 +0,0 @@ -# -# Copyright 2004,2008,2009,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -EXTRA_DIST += run_tests.in run_guile_tests.in -DISTCLEANFILES += run_tests run_guile_tests - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_alsa_sink.h \ - audio_alsa_source.h - -noinst_HEADERS = \ - gri_alsa.h - -noinst_PYTHON = \ - qa_audio_alsa.py - -noinst_GUILE = \ - audio_alsa.test - - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - -# ------------------------------------------------------------------------ -# ALSA C++ library, including OS interface, sink, and source - -lib_LTLIBRARIES = libgnuradio-audio-alsa.la - -libgnuradio_audio_alsa_la_SOURCES = \ - audio_alsa_sink.cc \ - audio_alsa_source.cc \ - gri_alsa.cc - -libgnuradio_audio_alsa_la_LIBADD = \ - $(GNURADIO_CORE_LA) \ - $(ALSA_LIBS) - -libgnuradio_audio_alsa_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) - - -# ------------------------------------------------------------------------ -# SWIG generated bindings - -TOP_SWIG_IFILES = \ - audio_alsa.i - -# Install so that they end up available as: -# import gnuradio.audio_alsa -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_alsa_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -audio_alsa_la_swig_libadd = \ - libgnuradio-audio-alsa.la - -if PYTHON -TESTS += run_tests -endif - -if GUILE -TESTS += run_guile_tests -endif - - diff --git a/gr-audio-alsa/src/Makefile.swig.gen b/gr-audio-alsa/src/Makefile.swig.gen deleted file mode 100644 index 785095d96..000000000 --- a/gr-audio-alsa/src/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -# Makefile.swig.gen for audio_alsa.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_alsa -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_alsa -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -audio_alsa_pythondir_category ?= gnuradio/audio_alsa -audio_alsa_pylibdir_category ?= $(audio_alsa_pythondir_category) -audio_alsa_pythondir = $(pythondir)/$(audio_alsa_pythondir_category) -audio_alsa_pylibdir = $(pyexecdir)/$(audio_alsa_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -audio_alsa_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_alsa -# FIXME: determince whether these should be installed with gnuradio. -audio_alsa_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -audio_alsa_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -audio_alsa_swiginclude_HEADERS = \ - audio_alsa.i \ - $(audio_alsa_swiginclude_headers) - -if PYTHON -audio_alsa_pylib_LTLIBRARIES = \ - _audio_alsa.la - -_audio_alsa_la_SOURCES = \ - python/audio_alsa.cc \ - $(audio_alsa_la_swig_sources) - -audio_alsa_python_PYTHON = \ - audio_alsa.py \ - $(audio_alsa_python) - -_audio_alsa_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_alsa_la_swig_libadd) - -_audio_alsa_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_alsa_la_swig_ldflags) - -_audio_alsa_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_alsa_la_swig_cxxflags) - -python/audio_alsa.cc: audio_alsa.py -audio_alsa.py: audio_alsa.i - -# Include the python dependencies for this file --include python/audio_alsa.d - -endif # end of if python - -if GUILE - -audio_alsa_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_alsa.la -libguile_gnuradio_audio_alsa_la_SOURCES = \ - guile/audio_alsa.cc \ - $(audio_alsa_la_swig_sources) -nobase_audio_alsa_scm_DATA = \ - gnuradio/audio_alsa.scm \ - gnuradio/audio_alsa-primitive.scm -libguile_gnuradio_audio_alsa_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_alsa_la_swig_libadd) -libguile_gnuradio_audio_alsa_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_alsa_la_swig_ldflags) -libguile_gnuradio_audio_alsa_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_alsa_la_swig_cxxflags) - -guile/audio_alsa.cc: gnuradio/audio_alsa.scm -gnuradio/audio_alsa.scm: audio_alsa.i -gnuradio/audio_alsa-primitive.scm: gnuradio/audio_alsa.scm - -# Include the guile dependencies for this file --include guile/audio_alsa.d - -endif # end of GUILE - - diff --git a/gr-audio-alsa/src/audio_alsa.i b/gr-audio-alsa/src/audio_alsa.i deleted file mode 100644 index 215acf33d..000000000 --- a/gr-audio-alsa/src/audio_alsa.i +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_alsa_sink.h" -#include "audio_alsa_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_alsa,source) - -audio_alsa_source_sptr -audio_alsa_make_source (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_alsa_source : public gr_sync_block { - - protected: - audio_alsa_source (int sampling_rate, - const std::string device_name, - bool ok_to_block = true - ) throw (std::runtime_error); - - public: - ~audio_alsa_source (); - - bool start(); - bool stop(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_alsa,sink) - -audio_alsa_sink_sptr -audio_alsa_make_sink (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_alsa_sink : public gr_sync_block { - - protected: - audio_alsa_sink (int sampling_rate, - const std::string device_name, - bool ok_to_block - ) throw (std::runtime_error); - - public: - ~audio_alsa_sink (); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_alsa" "scm_init_gnuradio_audio_alsa_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-alsa/src/audio_alsa.test b/gr-audio-alsa/src/audio_alsa.test deleted file mode 100644 index 7997b9283..000000000 --- a/gr-audio-alsa/src/audio_alsa.test +++ /dev/null @@ -1,37 +0,0 @@ -;;; -*- Scheme -*- -;;; -;;; Copyright 2010 Free Software Foundation, Inc. -;;; -;;; This file is part of GNU Radio -;;; -;;; GNU Radio is free software; you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3, or (at your option) -;;; any later version. -;;; -;;; GNU Radio is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see <http://www.gnu.org/licenses/>. -;;; - -;;; If you're using Emacs's Scheme mode: -;;; (put 'with-test-prefix 'scheme-indent-function 1) - -;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. -;;; See also the very end of the file, where the test-equal, test-eqv -;;; and test-eq macros are defined. - -(define-module (test-module) - #:use-module (oop goops) - #:use-module (gnuradio core) - #:use-module (gnuradio test-suite lib) - #:duplicates (merge-generics replace check)) - -;;; Just see if we can import the module... -;;; They may not have ALSA drivers, etc. - -(use-modules (gnuradio audio_alsa)) diff --git a/gr-audio-alsa/src/run_guile_tests.in b/gr-audio-alsa/src/run_guile_tests.in deleted file mode 100644 index 5d08b0dd5..000000000 --- a/gr-audio-alsa/src/run_guile_tests.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -. @top_builddir@/setup_guile_test_env - -# 1st argument is absolute path to hand coded guile source directory -# 2nd argument is absolute path to component C++ shared library build directory -# 3nd argument is absolute path to component SWIG build directory - -add_local_paths \ - @srcdir@ \ - @abs_builddir@ \ - @abs_builddir@ - -@GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t @srcdir@ diff --git a/gr-audio-alsa/src/run_tests.in b/gr-audio-alsa/src/run_tests.in deleted file mode 100644 index fd3963068..000000000 --- a/gr-audio-alsa/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-alsa \ - @abs_top_builddir@/gr-audio-alsa \ - @srcdir@ diff --git a/gr-audio-jack/.gitignore b/gr-audio-jack/.gitignore deleted file mode 100644 index cdcf41b15..000000000 --- a/gr-audio-jack/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 diff --git a/gr-audio-jack/gnuradio-audio-jack.pc.in b/gr-audio-jack/gnuradio-audio-jack.pc.in deleted file mode 100644 index 8fb4a2e0d..000000000 --- a/gr-audio-jack/gnuradio-audio-jack.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: gnuradio-audio-jack -Description: GNU Radio blocks for the JACK sound system -Requires: gnuradio-core jack -Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-audio-jack -Cflags: -I${includedir} diff --git a/gr-audio-jack/src/.gitignore b/gr-audio-jack/src/.gitignore deleted file mode 100644 index 347796beb..000000000 --- a/gr-audio-jack/src/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/audio_jack.cc -/audio_jack.py -/run_tests -/gnuradio -/guile -/python diff --git a/gr-audio-jack/src/Makefile.am b/gr-audio-jack/src/Makefile.am deleted file mode 100644 index 9a0c8b9be..000000000 --- a/gr-audio-jack/src/Makefile.am +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright 2005,2008,2009,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -EXTRA_DIST += run_tests.in -DISTCLEANFILES += run_tests - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_jack_sink.h \ - audio_jack_source.h - -noinst_HEADERS = \ - gri_jack.h - -lib_LTLIBRARIES = libgnuradio-audio-jack.la - -libgnuradio_audio_jack_la_SOURCES = \ - audio_jack_sink.cc \ - audio_jack_source.cc \ - gri_jack.cc - -libgnuradio_audio_jack_la_LIBADD = \ - $(GNURADIO_CORE_LA) \ - $(JACK_LIBS) - -libgnuradio_audio_jack_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) - -noinst_PYTHON = \ - qa_jack.py - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - -################################### -# SWIG interfaces and libraries - -TOP_SWIG_IFILES = \ - audio_jack.i - -# Install so that they end up available as: -# import gnuradio.audio_jack -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_jack_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -audio_jack_la_swig_libadd = \ - libgnuradio-audio-jack.la - - -if PYTHON -TESTS += run_tests -endif diff --git a/gr-audio-jack/src/audio_jack.i b/gr-audio-jack/src/audio_jack.i deleted file mode 100644 index 67747cb16..000000000 --- a/gr-audio-jack/src/audio_jack.i +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_jack_sink.h" -#include "audio_jack_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_jack,source) - -audio_jack_source_sptr -audio_jack_make_source (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_jack_source : public gr_sync_block { - - protected: - audio_jack_source (int sampling_rate, - const std::string device_name, - bool ok_to_block - ) throw (std::runtime_error); - - public: - ~audio_jack_source (); - - bool start(); - bool stop(); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_jack,sink) - -audio_jack_sink_sptr -audio_jack_make_sink (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_jack_sink : public gr_sync_block { - - protected: - audio_jack_sink (int sampling_rate, - const std::string device_name, - bool ok_to_block - ) throw (std::runtime_error); - - public: - ~audio_jack_sink (); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_jack" "scm_init_gnuradio_audio_jack_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-jack/src/run_tests.in b/gr-audio-jack/src/run_tests.in deleted file mode 100644 index 77af85641..000000000 --- a/gr-audio-jack/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-jack \ - @abs_top_builddir@/gr-audio-jack \ - @srcdir@ diff --git a/gr-audio-oss/.gitignore b/gr-audio-oss/.gitignore deleted file mode 100644 index cdcf41b15..000000000 --- a/gr-audio-oss/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 diff --git a/gr-audio-oss/src/.gitignore b/gr-audio-oss/src/.gitignore deleted file mode 100644 index c082252f9..000000000 --- a/gr-audio-oss/src/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/usrp.py -/usrp.cc -/audio_oss.cc -/audio_oss.py -/run_tests -/*.pyc -/gnuradio -/guile -/python diff --git a/gr-audio-oss/src/Makefile.swig.gen b/gr-audio-oss/src/Makefile.swig.gen deleted file mode 100644 index 95b59c58b..000000000 --- a/gr-audio-oss/src/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -# Makefile.swig.gen for audio_oss.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_oss -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_oss -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -audio_oss_pythondir_category ?= gnuradio/audio_oss -audio_oss_pylibdir_category ?= $(audio_oss_pythondir_category) -audio_oss_pythondir = $(pythondir)/$(audio_oss_pythondir_category) -audio_oss_pylibdir = $(pyexecdir)/$(audio_oss_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -audio_oss_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_oss -# FIXME: determince whether these should be installed with gnuradio. -audio_oss_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -audio_oss_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -audio_oss_swiginclude_HEADERS = \ - audio_oss.i \ - $(audio_oss_swiginclude_headers) - -if PYTHON -audio_oss_pylib_LTLIBRARIES = \ - _audio_oss.la - -_audio_oss_la_SOURCES = \ - python/audio_oss.cc \ - $(audio_oss_la_swig_sources) - -audio_oss_python_PYTHON = \ - audio_oss.py \ - $(audio_oss_python) - -_audio_oss_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_oss_la_swig_libadd) - -_audio_oss_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_oss_la_swig_ldflags) - -_audio_oss_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_oss_la_swig_cxxflags) - -python/audio_oss.cc: audio_oss.py -audio_oss.py: audio_oss.i - -# Include the python dependencies for this file --include python/audio_oss.d - -endif # end of if python - -if GUILE - -audio_oss_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_oss.la -libguile_gnuradio_audio_oss_la_SOURCES = \ - guile/audio_oss.cc \ - $(audio_oss_la_swig_sources) -nobase_audio_oss_scm_DATA = \ - gnuradio/audio_oss.scm \ - gnuradio/audio_oss-primitive.scm -libguile_gnuradio_audio_oss_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_oss_la_swig_libadd) -libguile_gnuradio_audio_oss_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_oss_la_swig_ldflags) -libguile_gnuradio_audio_oss_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_oss_la_swig_cxxflags) - -guile/audio_oss.cc: gnuradio/audio_oss.scm -gnuradio/audio_oss.scm: audio_oss.i -gnuradio/audio_oss-primitive.scm: gnuradio/audio_oss.scm - -# Include the guile dependencies for this file --include guile/audio_oss.d - -endif # end of GUILE - - diff --git a/gr-audio-oss/src/audio_oss.i b/gr-audio-oss/src/audio_oss.i deleted file mode 100644 index 2150cba9f..000000000 --- a/gr-audio-oss/src/audio_oss.i +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_oss_sink.h" -#include "audio_oss_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_oss,sink) - -audio_oss_sink_sptr -audio_oss_make_sink (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - - -class audio_oss_sink : public gr_sync_block { - protected: - audio_oss_sink (int sampling_rate, const std::string device_name = "", bool ok_to_block = true); - - public: - ~audio_oss_sink (); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_oss,source) - -audio_oss_source_sptr -audio_oss_make_source (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_oss_source : public gr_sync_block { - protected: - audio_oss_source (int sampling_rate, const std::string device_name = "", bool ok_to_block = true); - - public: - ~audio_oss_source (); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_oss" "scm_init_gnuradio_audio_oss_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-oss/src/qa_oss.py b/gr-audio-oss/src/qa_oss.py deleted file mode 100755 index 365dabc25..000000000 --- a/gr-audio-oss/src/qa_oss.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2005,2007,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import audio_oss - -class test_audio_oss (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000_nop (self): - """Just see if we can import the module... - They may not have OSS drivers, etc. Don't try to run anything""" - pass - -if __name__ == '__main__': - gr_unittest.run(test_audio_oss, "test_audio_oss.xml") diff --git a/gr-audio-osx/.gitignore b/gr-audio-osx/.gitignore deleted file mode 100644 index cdcf41b15..000000000 --- a/gr-audio-osx/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 diff --git a/gr-audio-osx/README_OSX b/gr-audio-osx/README_OSX deleted file mode 100644 index 2a98e96bb..000000000 --- a/gr-audio-osx/README_OSX +++ /dev/null @@ -1,61 +0,0 @@ -Michael Dickens -2006-Apr-30 - -0) This module should compile and install in the same manner as the -other GNURadio modules (e.g. gnuradio-core), with the possible -exception that GNU libtool 1.5.20 or newer should be installed and -used (if not first in the path) via "make LIBTOOL=/..." and so forth. -Version 1.5.10 has failed making, and while picking version 1.5.20 is -somewhat arbitrary, the newer version compiles and installs easily -under OSX. - -1) This module should be automatically loaded by the Python command -"from gr import audio". The audio import script will automatically -select gr.audio_osx if it is available (though it will try to import -ALSA first, then OSS, then OSX, and finally WINDOWS audio modules, in -that order). If that import command doesn't work, try reinstalling -gnuradio-core from scratch followed by gr-audio-osx. - -2) Instantiation arguments for either source or sink are: - -* sample_rate : integer : default == 44100 - OSX converts the integer sample rate to a double internally; it - would be nice to have this input as a double natively, but that - doesn't work with other audio devices. - -* device_name : string : default == "2" - For OSX, the device name should be an integer string. This value is - the maximum number of channels to allocate (for input or output). - In the "source" case (input), the actual number of channels will be - whatever is available on that current system input device. In the - "sink" case (output), OSX will convert the provided channels into - whatever format is required by the current system output device. - For example, "3" would try to setup for 3 input or output channels. - NOTE that this is a very different use than that for other audio - modules (though they can interpret the number of channels from this - argument). - -* do_block : boolean : default == true - If the data transfer buffer between OSX internals and GNURadio gets - full, either block (true) or overwrite (false) depending on this - variable. - -The following are currently non-standard arguments: - -* channel_config : integer : default == -1 - An enum (internally) describing the channel configuration. Not - currently used, but rather reserved for future expansion. - -* max_sample_count : integer : default == -1 - The maximum number of samples to buffer between OSX internals and - GNURadio. The value -1 is mapped to 1 second's worth of data. - -3) When the buffer is full and do_block is false and new data comes -in, the oldest data will be overwritten. The source will print out -"iX" each time this happens; the sink will print out "oX". - -4) In the "src" directory is a python script "test_audio_loop" which -connects the default audio input device to the default audio output -device. This script is very useful in testing that audio is correctly -installed and both the source and sink are functional. This script is -not run by "make check". diff --git a/gr-audio-osx/TODO b/gr-audio-osx/TODO deleted file mode 100644 index e36ed2b25..000000000 --- a/gr-audio-osx/TODO +++ /dev/null @@ -1,51 +0,0 @@ -List as of 2006-Apr-22, by Michael Dickens, primary author - -* Change buffering to use gr_buffer's and necessary related classes. - Currently uses a circular_buffer I wrote myself (in - ./src/circular_buffer.h ), which hides the "circular" part from the - user but otherwise is very fast as well as thread safe. - -* A current limitation of this implementation is that the user cannot - dynamically switch audio devices (input or output) during playback - and use the new device without stopping the current executing GR and - restarting the process. I would like to figure out how to get a - CoreAudio "listener" for when the default hardware input / output - device changes (e.g. when switched by the user in the "Sound" system - preference pane). The code in ./src/audio-osx-source.cc creates - listeners for the AudioUnit being used as well as the Hardware - device, but these for some reason don't do the trick. It's possible - that the Python framework doesn't allow for one to do this. - -* In both the source and sink, move the code which defines the "Audio - Stream Basic Description" (ASBD) to a routine to do this as needed - as start-up as well as in a callback ("listener") if the default - device changes. - -* Tweak the mutex (d_internal) to only where it is truly needed - (around class-specific variables used across all threads) in order - to improve performance. Currently the mutex is used at the - start and end of any function requiring access to the class variables. - -* Change the instantiation arguments ... once those arguments are - finalized. Right now gr.audio.source () takes the sample rate (int - - should be double), the device name (std::string), a boolean for - blocking or not, and 2 completely non-standard ones for channel - configuration and the maximum sample count to buffer. These are - reasonable for OSX, but might not be for other OSs. Nothing to do - right now but wait and discuss. - -* Once the previous issue has been resolved, then the current method - of determining the number of channels needs to be updated. - Currently the "device_name" for OSX should contain a numeric string - for the maximum number of channels to use (e.g. "3" means 3 - channels, generally mapped to 2 channel stereo by OSX). The - "device_name" is generally input via "-O" in Python scripts, so "-O - 3" would allow for 3 incoming output channels (or fewer). In theory - the "channel_config" argument would make more sense for determining - channel usage. Example config strings might be "2.1" for stereo w/ - subwoofer (3 channels), "5.1" or "6.1" for various surround w/ - subwoofer (6 & 7 channels, respectively). OSX can handle all sorts - of channel configurations, but the names for these will be different - than those use for OSS or ALMA or Windows ... thus the need for a - common naming scheme for all cared-about configurations, possibly - with options for other OS-specific options. diff --git a/gr-audio-osx/src/.gitignore b/gr-audio-osx/src/.gitignore deleted file mode 100644 index 7e84b05b3..000000000 --- a/gr-audio-osx/src/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/usrp.py -/usrp.cc -/audio_osx.cc -/audio_osx.py -/run_tests -/gnuradio -/guile -/python diff --git a/gr-audio-osx/src/Makefile.am b/gr-audio-osx/src/Makefile.am deleted file mode 100644 index fce31c9d2..000000000 --- a/gr-audio-osx/src/Makefile.am +++ /dev/null @@ -1,80 +0,0 @@ -# -# Copyright 2006,2008,2009,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio. -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -EXTRA_DIST += run_tests.in -DISTCLEANFILES += run_tests - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_osx_sink.h \ - audio_osx_source.h - -noinst_HEADERS = \ - audio_osx.h \ - circular_buffer.h - -noinst_PYTHON = \ - qa_osx.py \ - test_audio_loop.py - -lib_LTLIBRARIES = libgnuradio-audio-osx.la - -libgnuradio_audio_osx_la_SOURCES = \ - audio_osx_sink.cc \ - audio_osx_source.cc - -libgnuradio_audio_osx_la_LIBADD = \ - $(GNURADIO_CORE_LA) - -libgnuradio_audio_osx_la_LDFLAGS = \ - -framework AudioUnit \ - -framework CoreAudio \ - -framework AudioToolbox \ - $(NO_UNDEFINED) \ - $(LTVERSIONFLAGS) - -################################### -# SWIG interfaces and libraries - -TOP_SWIG_IFILES = \ - audio_osx.i - -# Install so that they end up available as: -# import gnuradio.audio_osx -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_osx_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -audio_osx_la_swig_libadd = \ - libgnuradio-audio-osx.la - - -if PYTHON -TESTS += run_tests -endif
\ No newline at end of file diff --git a/gr-audio-osx/src/audio_osx.i b/gr-audio-osx/src/audio_osx.i deleted file mode 100644 index a51e9bae0..000000000 --- a/gr-audio-osx/src/audio_osx.i +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_osx_sink.h" -#include "audio_osx_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_osx,sink) - -audio_osx_sink_sptr -audio_osx_make_sink (int sample_rate = 44100, - const std::string device_name = "2", - bool do_block = TRUE, - int channel_config = -1, - int max_sample_count = -1 - ) throw (std::runtime_error); - -class audio_osx_sink : public gr_sync_block { - protected: - audio_osx_sink (int sample_rate = 44100, - const std::string device_name = "2", - bool do_block = TRUE, - int channel_config = -1, - int max_sample_count = -1); - - public: - ~audio_osx_sink (); - - bool start (); - bool stop (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_osx,source) - -audio_osx_source_sptr -audio_osx_make_source (int sample_rate = 44100, - const std::string device_name = "2", - bool do_block = TRUE, - int channel_config = -1, - int max_sample_count = -1 - ) throw (std::runtime_error); - -class audio_osx_source : public gr_sync_block { - protected: - audio_osx_source (int sample_rate = 44100, - const std::string device_name = "2", - bool do_block = TRUE, - int channel_config = -1, - int max_sample_count = -1); - - public: - ~audio_osx_source (); - - bool start (); - bool stop (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_osx" "scm_init_gnuradio_audio_osx_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-osx/src/qa_osx.py b/gr-audio-osx/src/qa_osx.py deleted file mode 100755 index 385aa0269..000000000 --- a/gr-audio-osx/src/qa_osx.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2006,2007 Free Software Foundation, Inc. -# -# This file is part of GNU Radio. -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import audio_osx - -class qa_osx (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000_nop (self): - """Just see if we can import the module... - They may not have OSX drivers, etc. Don't try to run anything""" - pass - -if __name__ == '__main__': - gr_unittest.main () diff --git a/gr-audio-osx/src/run_tests.in b/gr-audio-osx/src/run_tests.in deleted file mode 100644 index d88c275e0..000000000 --- a/gr-audio-osx/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-osx \ - @abs_top_builddir@/gr-audio-osx \ - @srcdir@ diff --git a/gr-audio-osx/src/test_audio_loop.py b/gr-audio-osx/src/test_audio_loop.py deleted file mode 100755 index 662631dfb..000000000 --- a/gr-audio-osx/src/test_audio_loop.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2006,2007 Free Software Foundation, Inc. -# -# This file is part of GNU Radio. -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr -from gnuradio import audio -from gnuradio.eng_option import eng_option -from optparse import OptionParser - -class my_graph(gr.top_block): - - def __init__(self): - gr.top_block.__init__(self) - - parser = OptionParser(option_class=eng_option) - parser.add_option("-O", "--audio-output", - type="string", - default="", - help="audio output device name. E.g., hw:0,0 or /dev/dsp") - parser.add_option("-I", "--audio-input", - type="string", - default="", - help="audio input device name. E.g., hw:0,0 or /dev/dsp") - parser.add_option("-r", "--sample-rate", - type="eng_float", - default=48000, - help="set sample rate to RATE (48000)") - (options, args) = parser.parse_args () - if len(args) != 0: - parser.print_help() - raise SystemExit, 1 - - sample_rate = int(options.sample_rate) - src = audio.source (sample_rate, options.audio_output) - dst = audio.sink (sample_rate, options.audio_output) - - max_chan = max (src.output_signature().max_streams(), - dst.output_signature().max_streams()) - - for i in range (max_chan): - self.connect ((src, i), (dst, i)) - -if __name__ == '__main__': - try: - my_graph().run() - except KeyboardInterrupt: - pass diff --git a/gr-audio-portaudio/.gitignore b/gr-audio-portaudio/.gitignore deleted file mode 100644 index 53edad32f..000000000 --- a/gr-audio-portaudio/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 -/stamp-h1.in -/stamp-h2.in diff --git a/gr-audio-portaudio/README b/gr-audio-portaudio/README deleted file mode 100644 index bd6fac643..000000000 --- a/gr-audio-portaudio/README +++ /dev/null @@ -1,99 +0,0 @@ -The instructions below are now obsolete. Please see: - -http://gnuradio.org/trac/wiki/PortAudioInstall - -====== -OBSOLETED - -These instructions are intended for Linux. On other systems you will have to -construct something compatible to build gr-audio-portaudio. - -In order to use portaudio with gnuradio you will need to download and install -a late version of portaudio. Please cd to a directory where the cvs command -below will be allowed to build the portaudio directory tree. - -cvs -d:pserver:anonymous@www.portaudio.com:/home/cvs co -r v19-devel portaudio - -This will make a directory portaudio unless you already have one. It will -check out the Portaudio API version 2 release 1.9. - -In the directory where this README is found, there is a patch file. Hopefully -this patch will not be needed for long. Portaudio is working with us to use -auto*, libtool, etc. The patch is autoconfiscate.patch. - -cd to the portaudio directory and run - -patch -p0 <autoconfiscate.patch - -this will modify the portaudio source tree to use standard tools and prepare -it for use with gnuradio. Now run - -chmod u+x bootstrap - -you may need to edit bootstrap and remove the 2.50 at the end of some of the -commands (on SUSE 10.0 for example). - -./bootstrap - -./configure --help - - -will reveal the options for configure that are available to you. If you do not -understand the options or wish to accept the defaults please just run - -./configure - -If you do not want the includes and libraries install in /usr/local (standard) -then enter the prefix arguments to ./configure. This document will assume you -are doing the standard installation and that will be into /usr/local. - -On Linux if you have the jack tool available from - -http://jackit.sourceforge.net - -the portaudio configure will enable the library to talk to jack. - -Now you are ready to make the portaudio library. - -make; sudo make install;sudo ldconfig (possibly /sbin/ldconfig). - -will make the code and install it into the prefix (/usr/local) selected and -will cache the configuration information for other programs to use for their -configuration options. - -Now you are ready to install gr-audio-portaudio. In the gr-build directory -you may run - -cvs co gr-audio-portaudio - -cd gr-audio-portaudio -../buildit - -will configure, make, and install the portaudio sink and source. - -In gnuradio-examples/python/audio please test by running - -./mono_tone_portaudio.py - - -If this runs you are likely in business but this chooses the default device -(typically /dev/dsp which is being run by alsa under oss emulation and on a -Mac it will choose coreaudio). - -./mono_tone_portaudio.py -O hw:0,0 - -chooses the default alsa device. - -./mono_tone_portaudio.py -O /dev/dsp - -will force the use of OSS and the default oss device. To run with jack, you -will probably enter the following command: - -./mono_tone_portaudio.py -O alsa_pcm - - -In the portaudio directory, you may list the devices visible to portaudio by -searching for and running the command - -pa_devs - diff --git a/gr-audio-portaudio/autoconfiscate.patch b/gr-audio-portaudio/autoconfiscate.patch deleted file mode 100755 index fd7b9c370..000000000 --- a/gr-audio-portaudio/autoconfiscate.patch +++ /dev/null @@ -1,1299 +0,0 @@ -Index: portaudio-2.0.pc.in -=================================================================== -RCS file: /home/cvs/portaudio/Attic/portaudio-2.0.pc.in,v -retrieving revision 1.1.2.1 -diff -u -b -B -w -p -r1.1.2.1 portaudio-2.0.pc.in ---- portaudio-2.0.pc.in 19 Mar 2006 13:02:36 -0000 1.1.2.1 -+++ portaudio-2.0.pc.in 19 Mar 2006 22:26:01 -0000 -@@ -9,4 +9,4 @@ Requires: - Version: 19 - - Libs: -L${libdir} -lportaudio @LIBS@ --Cflags: -I${includedir} @THREAD_CFLAGS@ -+Cflags: -I${includedir} @PTHREAD_CFLAGS@ -Index: pa_asio/iasiothiscallresolver.cpp -=================================================================== -RCS file: /home/cvs/portaudio/pa_asio/Attic/iasiothiscallresolver.cpp,v -retrieving revision 1.1.2.4 -diff -u -b -B -w -p -r1.1.2.4 iasiothiscallresolver.cpp ---- pa_asio/iasiothiscallresolver.cpp 10 Jul 2004 03:27:41 -0000 1.1.2.4 -+++ pa_asio/iasiothiscallresolver.cpp 19 Mar 2006 22:26:03 -0000 -@@ -152,6 +152,7 @@ - recent versions of the gcc assembler. - */ - -+#include <config.h> - - // We only need IASIOThiscallResolver at all if we are on Win32. For other - // platforms we simply bypass the IASIOThiscallResolver definition to allow us -Index: pa_asio/pa_asio.cpp -=================================================================== -RCS file: /home/cvs/portaudio/pa_asio/pa_asio.cpp,v -retrieving revision 1.7.2.68 -diff -u -b -B -w -p -r1.7.2.68 pa_asio.cpp ---- pa_asio/pa_asio.cpp 5 Dec 2005 04:55:28 -0000 1.7.2.68 -+++ pa_asio/pa_asio.cpp 19 Mar 2006 22:26:14 -0000 -@@ -106,7 +106,7 @@ - must be closed). - */ - -- -+#include <config.h> - - #include <stdio.h> - #include <assert.h> -Index: pa_common/pa_allocation.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_allocation.c,v -retrieving revision 1.1.2.6 -diff -u -b -B -w -p -r1.1.2.6 pa_allocation.c ---- pa_common/pa_allocation.c 20 Dec 2004 12:07:51 -0000 1.1.2.6 -+++ pa_common/pa_allocation.c 19 Mar 2006 22:26:15 -0000 -@@ -35,6 +35,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_allocation.h" - #include "pa_util.h" - -Index: pa_common/pa_converters.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_converters.c,v -retrieving revision 1.1.2.27 -diff -u -b -B -w -p -r1.1.2.27 pa_converters.c ---- pa_common/pa_converters.c 2 Nov 2005 12:14:07 -0000 1.1.2.27 -+++ pa_common/pa_converters.c 19 Mar 2006 22:26:23 -0000 -@@ -49,6 +49,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_converters.h" - #include "pa_dither.h" - #include "pa_endianness.h" -Index: pa_common/pa_cpuload.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_cpuload.c,v -retrieving revision 1.1.2.14 -diff -u -b -B -w -p -r1.1.2.14 pa_cpuload.c ---- pa_common/pa_cpuload.c 8 Jan 2004 22:01:12 -0000 1.1.2.14 -+++ pa_common/pa_cpuload.c 19 Mar 2006 22:26:24 -0000 -@@ -41,6 +41,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_cpuload.h" - - #include <assert.h> -Index: pa_common/pa_dither.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_dither.c,v -retrieving revision 1.1.2.6 -diff -u -b -B -w -p -r1.1.2.6 pa_dither.c ---- pa_common/pa_dither.c 28 May 2005 22:49:02 -0000 1.1.2.6 -+++ pa_common/pa_dither.c 19 Mar 2006 22:26:24 -0000 -@@ -34,6 +34,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_dither.h" - #include "pa_types.h" - -Index: pa_common/pa_front.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_front.c,v -retrieving revision 1.1.2.52 -diff -u -b -B -w -p -r1.1.2.52 pa_front.c ---- pa_common/pa_front.c 7 Dec 2005 20:10:34 -0000 1.1.2.52 -+++ pa_common/pa_front.c 19 Mar 2006 22:26:30 -0000 -@@ -89,6 +89,8 @@ enquire about status on the PortAudio ma - */ - - -+#include <config.h> -+ - #include <stdio.h> - #include <stdarg.h> - #include <memory.h> -Index: pa_common/pa_process.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_process.c,v -retrieving revision 1.1.2.51 -diff -u -b -B -w -p -r1.1.2.51 pa_process.c ---- pa_common/pa_process.c 27 Oct 2005 23:28:48 -0000 1.1.2.51 -+++ pa_common/pa_process.c 19 Mar 2006 22:26:35 -0000 -@@ -72,6 +72,8 @@ - */ - - -+#include <config.h> -+ - #include <assert.h> - #include <string.h> /* memset() */ - -Index: pa_common/pa_skeleton.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_skeleton.c,v -retrieving revision 1.1.2.39 -diff -u -b -B -w -p -r1.1.2.39 pa_skeleton.c ---- pa_common/pa_skeleton.c 26 Nov 2003 14:56:09 -0000 1.1.2.39 -+++ pa_common/pa_skeleton.c 19 Mar 2006 22:26:38 -0000 -@@ -40,6 +40,8 @@ - */ - - -+#include <config.h> -+ - #include <string.h> /* strlen() */ - - #include "pa_util.h" -Index: pa_common/pa_stream.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/Attic/pa_stream.c,v -retrieving revision 1.1.2.12 -diff -u -b -B -w -p -r1.1.2.12 pa_stream.c ---- pa_common/pa_stream.c 20 Sep 2003 21:31:00 -0000 1.1.2.12 -+++ pa_common/pa_stream.c 19 Mar 2006 22:26:39 -0000 -@@ -36,6 +36,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_stream.h" - - -Index: pa_common/pa_trace.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_common/pa_trace.c,v -retrieving revision 1.1.1.1.2.4 -diff -u -b -B -w -p -r1.1.1.1.2.4 pa_trace.c ---- pa_common/pa_trace.c 2 Nov 2005 12:06:44 -0000 1.1.1.1.2.4 -+++ pa_common/pa_trace.c 19 Mar 2006 22:26:39 -0000 -@@ -35,6 +35,8 @@ - */ - - -+#include <config.h> -+ - #include <stdio.h> - #include <stdlib.h> - #include <string.h> -Index: pa_jack/pa_jack.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_jack/Attic/pa_jack.c,v -retrieving revision 1.1.2.20 -diff -u -b -B -w -p -r1.1.2.20 pa_jack.c ---- pa_jack/pa_jack.c 2 Oct 2005 22:02:26 -0000 1.1.2.20 -+++ pa_jack/pa_jack.c 19 Mar 2006 22:26:46 -0000 -@@ -35,6 +35,8 @@ - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -+#include <config.h> -+ - #include <string.h> - #include <regex.h> - #include <stdlib.h> -@@ -56,7 +58,7 @@ - #include "pa_process.h" - #include "pa_allocation.h" - #include "pa_cpuload.h" --#include "../pablio/ringbuffer.c" -+#include "pablio/ringbuffer.c" - - static int aErr_; - static PaError paErr_; /* For use with ENSURE_PA */ -Index: pa_linux_alsa/pa_linux_alsa.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_linux_alsa/Attic/pa_linux_alsa.c,v -retrieving revision 1.1.2.90 -diff -u -b -B -w -p -r1.1.2.90 pa_linux_alsa.c ---- pa_linux_alsa/pa_linux_alsa.c 19 Mar 2006 12:28:44 -0000 1.1.2.90 -+++ pa_linux_alsa/pa_linux_alsa.c 19 Mar 2006 22:27:00 -0000 -@@ -34,6 +34,8 @@ - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -+#include <config.h> -+ - #define ALSA_PCM_NEW_HW_PARAMS_API - #define ALSA_PCM_NEW_SW_PARAMS_API - #include <alsa/asoundlib.h> -Index: pa_mac/pa_mac_hostapis.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_mac/Attic/pa_mac_hostapis.c,v -retrieving revision 1.1.2.1 -diff -u -b -B -w -p -r1.1.2.1 pa_mac_hostapis.c ---- pa_mac/pa_mac_hostapis.c 27 May 2004 22:39:58 -0000 1.1.2.1 -+++ pa_mac/pa_mac_hostapis.c 19 Mar 2006 22:27:00 -0000 -@@ -33,6 +33,7 @@ - Mac OS host API initialization function table. - */ - -+#include <config.h> - - #include "pa_hostapi.h" - -Index: pa_mac_core/pa_mac_core.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_mac_core/pa_mac_core.c,v -retrieving revision 1.8.2.11 -diff -u -b -B -w -p -r1.8.2.11 pa_mac_core.c ---- pa_mac_core/pa_mac_core.c 27 Feb 2006 14:25:50 -0000 1.8.2.11 -+++ pa_mac_core/pa_mac_core.c 19 Mar 2006 22:27:08 -0000 -@@ -45,6 +45,8 @@ - @brief AUHAL implementation of PortAudio - */ - -+#include <config.h> -+ - #include <string.h> /* strlen(), memcmp() etc. */ - - #include <AudioUnit/AudioUnit.h> -Index: pa_mac_core/pa_mac_core_old.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_mac_core/Attic/pa_mac_core_old.c,v -retrieving revision 1.1.2.1 -diff -u -b -B -w -p -r1.1.2.1 pa_mac_core_old.c ---- pa_mac_core/pa_mac_core_old.c 24 Dec 2005 01:22:52 -0000 1.1.2.1 -+++ pa_mac_core/pa_mac_core_old.c 19 Mar 2006 22:27:14 -0000 -@@ -34,6 +34,8 @@ - * - */ - -+#include <config.h> -+ - #include <CoreAudio/CoreAudio.h> - #include <AudioToolbox/AudioToolbox.h> - #include <stdio.h> -Index: pa_mac_core/pa_mac_core_utilities.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_mac_core/Attic/pa_mac_core_utilities.c,v -retrieving revision 1.1.2.2 -diff -u -b -B -w -p -r1.1.2.2 pa_mac_core_utilities.c ---- pa_mac_core/pa_mac_core_utilities.c 9 Dec 2005 19:43:14 -0000 1.1.2.2 -+++ pa_mac_core/pa_mac_core_utilities.c 19 Mar 2006 22:27:14 -0000 -@@ -10,6 +10,8 @@ - * by Bjorn Roche. - */ - -+#include <config.h> -+ - /* - * Translates MacOS generated errors into PaErrors - */ -Index: pa_mac_sm/pa_mac_sm.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_mac_sm/Attic/pa_mac_sm.c,v -retrieving revision 1.1.2.1 -diff -u -b -B -w -p -r1.1.2.1 pa_mac_sm.c ---- pa_mac_sm/pa_mac_sm.c 7 Jun 2002 21:20:48 -0000 1.1.2.1 -+++ pa_mac_sm/pa_mac_sm.c 19 Mar 2006 22:27:21 -0000 -@@ -76,6 +76,8 @@ O- Add support for native sample data fo - O- Review buffer sizing. Should it be based on result of siDeviceBufferInfo query? - O- Determine default devices somehow. - */ -+#include <config.h> -+ - #include <stdio.h> - #include <stdlib.h> - #include <string.h> -Index: pa_sgi/pa_sgi.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_sgi/pa_sgi.c,v -retrieving revision 1.2.2.20 -diff -u -b -B -w -p -r1.2.2.20 pa_sgi.c ---- pa_sgi/pa_sgi.c 3 Jan 2004 19:20:09 -0000 1.2.2.20 -+++ pa_sgi/pa_sgi.c 19 Mar 2006 22:27:27 -0000 -@@ -123,6 +123,8 @@ - a outputs stereo. One can observe this in SGI's 'Audio Queue Monitor'. - */ - -+#include <config.h> -+ - #include <string.h> /* For strlen() but also for strerror()! */ - #include <stdio.h> /* printf() */ - #include <math.h> /* fabs() */ -Index: pa_unix/pa_unix_hostapis.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_unix/Attic/pa_unix_hostapis.c,v -retrieving revision 1.1.2.5 -diff -u -b -B -w -p -r1.1.2.5 pa_unix_hostapis.c ---- pa_unix/pa_unix_hostapis.c 2 Oct 2003 12:35:46 -0000 1.1.2.5 -+++ pa_unix/pa_unix_hostapis.c 19 Mar 2006 22:27:28 -0000 -@@ -30,6 +30,8 @@ - */ - - -+#include <config.h> -+ - #include "pa_hostapi.h" - - PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); -Index: pa_unix/pa_unix_util.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_unix/Attic/pa_unix_util.c,v -retrieving revision 1.1.2.8 -diff -u -b -B -w -p -r1.1.2.8 pa_unix_util.c ---- pa_unix/pa_unix_util.c 20 Nov 2005 13:46:13 -0000 1.1.2.8 -+++ pa_unix/pa_unix_util.c 19 Mar 2006 22:27:28 -0000 -@@ -31,6 +31,8 @@ - */ - - -+#include <config.h> -+ - #include <pthread.h> - #include <unistd.h> - #include <stdlib.h> -Index: pa_unix_oss/pa_unix_oss.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_unix_oss/pa_unix_oss.c,v -retrieving revision 1.6.2.27 -diff -u -b -B -w -p -r1.6.2.27 pa_unix_oss.c ---- pa_unix_oss/pa_unix_oss.c 21 Feb 2006 19:13:56 -0000 1.6.2.27 -+++ pa_unix_oss/pa_unix_oss.c 19 Mar 2006 22:27:35 -0000 -@@ -35,6 +35,8 @@ - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -+#include <config.h> -+ - #include <stdio.h> - #include <string.h> - #include <math.h> -@@ -42,7 +44,6 @@ - #include <sys/ioctl.h> - #include <unistd.h> - #include <pthread.h> --#include <alloca.h> - #include <malloc.h> - #include <assert.h> - #include <errno.h> -@@ -52,14 +53,21 @@ - #include <limits.h> - #include <semaphore.h> - --#ifdef __FreeBSD__ -+#ifdef HAVE_SYS_SOUNDCARD_H - # include <sys/soundcard.h> -+#elif HAVE_LINUX_SOUNDCARD_H -+# include <linux/soundcard.h> -+#elif HAVE_SOUNDCARD_H -+# include <soundcard.h> -+#else -+# include <machine/soundcard.h> /* JH20010905 */ -+#endif -+ -+#ifdef __FreeBSD__ - # define DEVICE_NAME_BASE "/dev/dsp" - #elif defined __linux__ --# include <linux/soundcard.h> - # define DEVICE_NAME_BASE "/dev/dsp" - #else --# include <machine/soundcard.h> /* JH20010905 */ - # define DEVICE_NAME_BASE "/dev/audio" - #endif - -@@ -1913,7 +1921,12 @@ static signed long GetStreamWriteAvailab - PaOssStream *stream = (PaOssStream*)s; - int delay = 0; - -+/* -+ * FIXME: SNDCTL_DSP_GETODELAY does not exist on NetBSD -+ */ -+#ifdef SNDCTL_DSP_GETODELAY - if( ioctl( stream->playback->fd, SNDCTL_DSP_GETODELAY, &delay ) < 0 ) -+#endif - return paUnanticipatedHostError; - - return (PaOssStreamComponent_BufferSize( stream->playback ) - delay) / PaOssStreamComponent_FrameSize( stream->playback ); -Index: pa_unix_oss/recplay.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_unix_oss/recplay.c,v -retrieving revision 1.1.1.1 -diff -u -b -B -w -p -r1.1.1.1 recplay.c ---- pa_unix_oss/recplay.c 22 Jan 2002 00:52:44 -0000 1.1.1.1 -+++ pa_unix_oss/recplay.c 19 Mar 2006 22:27:35 -0000 -@@ -4,6 +4,8 @@ - * Minimal record and playback test. - * - */ -+#include <config.h> -+ - #include <stdio.h> - #include <unistd.h> - #include <stdlib.h> -Index: pa_win/pa_win_hostapis.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win/Attic/pa_win_hostapis.c,v -retrieving revision 1.1.2.10 -diff -u -b -B -w -p -r1.1.2.10 pa_win_hostapis.c ---- pa_win/pa_win_hostapis.c 8 Sep 2004 17:31:37 -0000 1.1.2.10 -+++ pa_win/pa_win_hostapis.c 19 Mar 2006 22:27:36 -0000 -@@ -36,6 +36,7 @@ - the Unix version does, we should consider being consistent. - */ - -+#include <config.h> - - #include "pa_hostapi.h" - -Index: pa_win/pa_win_util.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win/Attic/pa_win_util.c,v -retrieving revision 1.1.2.7 -diff -u -b -B -w -p -r1.1.2.7 pa_win_util.c ---- pa_win/pa_win_util.c 15 Sep 2003 18:30:26 -0000 1.1.2.7 -+++ pa_win/pa_win_util.c 19 Mar 2006 22:27:36 -0000 -@@ -37,6 +37,9 @@ - bug. (see msdn kb Q274323). - */ - -+#include <config.h> -+ -+ - #include <windows.h> - #include <mmsystem.h> /* for timeGetTime() */ - -Index: pa_win/pa_x86_plain_converters.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win/Attic/pa_x86_plain_converters.c,v -retrieving revision 1.1.2.2 -diff -u -b -B -w -p -r1.1.2.2 pa_x86_plain_converters.c ---- pa_win/pa_x86_plain_converters.c 28 Feb 2003 01:49:59 -0000 1.1.2.2 -+++ pa_win/pa_x86_plain_converters.c 19 Mar 2006 22:27:40 -0000 -@@ -1,3 +1,5 @@ -+#include <config.h> -+ - #include "pa_x86_plain_converters.h" - - #include "pa_converters.h" -Index: pa_win_ds/dsound_wrapper.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win_ds/dsound_wrapper.c,v -retrieving revision 1.1.1.1.2.11 -diff -u -b -B -w -p -r1.1.1.1.2.11 dsound_wrapper.c ---- pa_win_ds/dsound_wrapper.c 7 Sep 2003 13:04:53 -0000 1.1.1.1.2.11 -+++ pa_win_ds/dsound_wrapper.c 19 Mar 2006 22:27:43 -0000 -@@ -33,6 +33,8 @@ - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ -+#include <config.h> -+ - #include <stdio.h> - #include <stdlib.h> - #include <math.h> -Index: pa_win_ds/pa_win_ds.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win_ds/Attic/pa_win_ds.c,v -retrieving revision 1.1.2.51 -diff -u -b -B -w -p -r1.1.2.51 pa_win_ds.c ---- pa_win_ds/pa_win_ds.c 26 Jan 2006 01:13:18 -0000 1.1.2.51 -+++ pa_win_ds/pa_win_ds.c 19 Mar 2006 22:27:49 -0000 -@@ -58,6 +58,8 @@ - O- fix "patest_stop.c" - */ - -+#include <config.h> -+ - #include <stdio.h> - #include <string.h> /* strlen() */ - -Index: pa_win_wdmks/pa_win_wdmks.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win_wdmks/Attic/pa_win_wdmks.c,v -retrieving revision 1.1.2.4 -diff -u -b -B -w -p -r1.1.2.4 pa_win_wdmks.c ---- pa_win_wdmks/pa_win_wdmks.c 19 Nov 2005 10:14:01 -0000 1.1.2.4 -+++ pa_win_wdmks/pa_win_wdmks.c 19 Mar 2006 22:28:00 -0000 -@@ -42,6 +42,8 @@ - of a device for the duration of active stream using those devices - */ - -+#include <config.h> -+ - #include <stdio.h> - - /* Debugging/tracing support */ -Index: pa_win_wmme/pa_win_wmme.c -=================================================================== -RCS file: /home/cvs/portaudio/pa_win_wmme/pa_win_wmme.c,v -retrieving revision 1.6.2.88 -diff -u -b -B -w -p -r1.6.2.88 pa_win_wmme.c ---- pa_win_wmme/pa_win_wmme.c 16 Feb 2006 01:56:45 -0000 1.6.2.88 -+++ pa_win_wmme/pa_win_wmme.c 19 Mar 2006 22:28:14 -0000 -@@ -100,6 +100,8 @@ Non-critical stuff for the future: - Events (when necessary) inside the ReadStream() and WriteStream() functions. - */ - -+#include <config.h> -+ - #include <stdio.h> - #include <stdlib.h> - #include <math.h> ---- /dev/null 2006-03-10 00:02:48.821312048 +0100 -+++ Makefile.am 2006-03-19 22:49:42.000000000 +0100 -@@ -0,0 +1,215 @@ -+# -+# PortAudio V19 Makefile.am -+# -+# Stéphane Fillod -+# -+ -+INCLUDES = -I$(top_srcdir)/pa_common -+ -+COMMON_SRC = \ -+ pa_common/pa_allocation.c \ -+ pa_common/pa_converters.c \ -+ pa_common/pa_cpuload.c \ -+ pa_common/pa_dither.c \ -+ pa_common/pa_front.c \ -+ pa_common/pa_process.c \ -+ pa_common/pa_skeleton.c \ -+ pa_common/pa_stream.c \ -+ pa_common/pa_trace.c -+ -+libportaudio_coreaudio_la_SOURCES = \ -+ pa_mac/pa_mac_hostapis.c \ -+ pa_mac_core/pa_mac_core.c -+ -+libportaudio_mac_asio_la_SOURCES = \ -+ pa_asio/iasiothiscallresolver.cpp -+libportaudio_mac_asio_la_LIBADD = @ASIO_OBJS@ -+ -+libportaudio_dsound_la_SOURCES = \ -+ pa_win_ds/pa_win_ds.c \ -+ pa_win_ds/dsound_wrapper.c \ -+ pa_win/pa_win_hostapis.c \ -+ pa_win/pa_win_util.c -+ -+libportaudio_win_asio_la_SOURCES = \ -+ pa_asio/pa_asio.cpp \ -+ pa_win/pa_win_hostapis.c \ -+ pa_win/pa_win_util.c \ -+ pa_asio/iasiothiscallresolver.cpp -+libportaudio_win_asio_la_LIBADD = @ASIO_OBJS@ -+ -+libportaudio_wdmks_la_SOURCES = \ -+ pa_win_wdmks/pa_win_wdmks.c \ -+ pa_win/pa_win_hostapis.c \ -+ pa_win/pa_win_util.c -+ -+libportaudio_wmme_la_SOURCES = \ -+ pa_win_wmme/pa_win_wmme.c \ -+ pa_win/pa_win_hostapis.c \ -+ pa_win/pa_win_util.c -+ -+libportaudio_sgi_la_SOURCES = \ -+ pa_sgi/pa_sgi.c -+ -+libportaudio_alsa_la_SOURCES = \ -+ pa_linux_alsa/pa_linux_alsa.c -+ -+libportaudio_jack_la_SOURCES = \ -+ pa_jack/pa_jack.c -+ -+libportaudio_oss_la_SOURCES = \ -+ pa_unix_oss/pa_unix_oss.c -+ -+libportaudio_unix_la_SOURCES = \ -+ pa_unix/pa_unix_hostapis.c \ -+ pa_unix/pa_unix_util.c -+ -+EXTRA_LTLIBRARIES = \ -+ libportaudio-coreaudio.la \ -+ libportaudio-mac-asio.la \ -+ libportaudio-dsound.la \ -+ libportaudio-win-asio.la \ -+ libportaudio-wdmks.la \ -+ libportaudio-wmme.la \ -+ libportaudio-sgi.la \ -+ libportaudio-alsa.la \ -+ libportaudio-jack.la \ -+ libportaudio-oss.la \ -+ libportaudio-unix.la -+ -+noinst_LTLIBRARIES = @PA_LIBADD@ -+lib_LTLIBRARIES = libportaudio.la -+ -+ -+libportaudio_la_SOURCES = \ -+ $(COMMON_SRC) -+ -+# -no-undefined is required by Win32 and MacOSX, should be harmless otherwise -+libportaudio_la_LDFLAGS = $(WINLDFLAGS) -no-undefined -version-info @PA_ABI@:@PA_REV@:@PA_AGE@ -+libportaudio_la_CFLAGS = $(AM_CFLAGS) -+libportaudio_la_LIBADD = @PA_LIBADD@ -lm -+libportaudio_la_DEPENDENCIES = @PA_LIBADD@ -+ -+ -+noinst_HEADERS = \ -+ pa_asio/iasiothiscallresolver.h \ -+ pa_asio/pa_asio.h \ -+ pa_beos/PlaybackNode.h \ -+ pablio/pablio.h \ -+ pablio/ringbuffer.h \ -+ pa_common/pa_allocation.h \ -+ pa_common/pa_converters.h \ -+ pa_common/pa_cpuload.h \ -+ pa_common/pa_dither.h \ -+ pa_common/pa_endianness.h \ -+ pa_common/pa_hostapi.h \ -+ pa_common/pa_process.h \ -+ pa_common/pa_stream.h \ -+ pa_common/pa_trace.h \ -+ pa_common/pa_types.h \ -+ pa_common/pa_util.h \ -+ pa_dll_switch/PaDllEntry.h \ -+ pa_dll_switch/portaudio.h \ -+ pa_linux_alsa/pa_linux_alsa.h \ -+ pa_mac_core/pa_mac_core.h \ -+ pa_unix/pa_unix_util.h \ -+ pa_win_ds/dsound_wrapper.h \ -+ pa_win/pa_x86_plain_converters.h \ -+ pa_win_wmme/pa_win_wmme.h -+ -+include_HEADERS = \ -+ pa_common/portaudio.h -+ -+ -+TESTS = \ -+ pa_tests/paqa_errs \ -+ pa_tests/patest1 \ -+ pa_tests/patest_buffer \ -+ pa_tests/patest_callbackstop \ -+ pa_tests/patest_clip \ -+ pa_tests/patest_dither \ -+ pa_tests/patest_hang \ -+ pa_tests/patest_in_overflow \ -+ pa_tests/patest_latency \ -+ pa_tests/patest_leftright \ -+ pa_tests/patest_longsine \ -+ pa_tests/patest_many \ -+ pa_tests/patest_maxsines \ -+ pa_tests/patest_multi_sine \ -+ pa_tests/patest_out_underflow \ -+ pa_tests/patest_pink \ -+ pa_tests/patest_prime \ -+ pa_tests/patest_read_record \ -+ pa_tests/patest_record \ -+ pa_tests/patest_ringmix \ -+ pa_tests/patest_saw \ -+ pa_tests/patest_sine8 \ -+ pa_tests/patest_sine \ -+ pa_tests/patest_sine_formats \ -+ pa_tests/patest_sine_time \ -+ pa_tests/patest_start_stop \ -+ pa_tests/patest_stop \ -+ pa_tests/patest_sync \ -+ pa_tests/patest_toomanysines \ -+ pa_tests/patest_underflow \ -+ pa_tests/patest_wire \ -+ pa_tests/patest_write_sine \ -+ pa_tests/pa_devs \ -+ pa_tests/pa_fuzz \ -+ pa_tests/pa_minlat \ -+ pa_tests/paqa_devs -+ -+check_PROGRAMS = $(TESTS) -+ -+LDADD = libportaudio.la -+ -+# Most of these don't compile yet. Put them in TESTS, above, if -+# you want to try to compile them... -+ALL_TESTS = \ -+ pa_tests/debug_convert \ -+ pa_tests/debug_dither_calc \ -+ pa_tests/debug_dual \ -+ pa_tests/debug_multi_in \ -+ pa_tests/debug_multi_out \ -+ pa_tests/debug_record \ -+ pa_tests/debug_record_reuse \ -+ pa_tests/debug_sine_amp \ -+ pa_tests/debug_sine \ -+ pa_tests/debug_sine_formats \ -+ pa_tests/debug_srate \ -+ pa_tests/debug_test1 \ -+ $(TESTS) -+ -+pkgconfigdir = $(libdir)/pkgconfig -+pkgconfig_DATA = portaudio-2.0.pc -+ -+ -+SUBDIRS= -+DIST_SUBDIRS= -+ -+ACLOCAL_AMFLAGS = -I config -+ -+doc: config.doxy -+ doxygen config.doxy -+ -+# pa_asio pa_beos pablio pa_common pa_dll_switch pa_jack pa_linux_alsa pa_mac pa_mac_core pa_mac_sm pa_sgi pa_tests pa_unix pa_unix_oss pa_win pa_win_ds pa_win_wdmks pa_win_wmme -+ -+PABLIO = \ -+ pablio/pablio.def \ -+ pablio/README.txt \ -+ pablio/ringbuffer.h \ -+ pablio/test_rw_echo.c \ -+ pablio/test_w_saw.c \ -+ pablio/pablio.c \ -+ pablio/pablio.h \ -+ pablio/ringbuffer.c \ -+ pablio/test_rw.c \ -+ pablio/test_w_saw8.c -+ -+EXTRA_DIST = \ -+ $(PABLIO) \ -+ config.doxy \ -+ LICENSE.txt \ -+ README.txt \ -+ portaudio-2.0.pc.in \ -+ V19-devel-readme.txt ---- /dev/null 2006-03-10 00:02:48.821312048 +0100 -+++ configure.ac 2006-03-19 22:49:13.000000000 +0100 -@@ -0,0 +1,278 @@ -+dnl -+dnl portaudio V19 configure.ac script -+dnl -+dnl Stephane Fillod, Dominic Mazzoni, Arve Knudsen -+dnl -+ -+dnl Require autoconf >= 2.57 -+AC_PREREQ(2.57) -+ -+dnl Init autoconf and make sure configure is being called -+dnl from the right directory -+AC_INIT([portaudio], [2.0cvs], [portaudio@techweb.rfa.org]) -+AC_CONFIG_SRCDIR([pa_common/portaudio.h]) -+AC_CONFIG_HEADERS(config.h) -+AC_CANONICAL_TARGET([]) -+ -+dnl Automake Initialisation. -+AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, -) -+AM_MAINTAINER_MODE -+ -+dnl Portaudio library interface version, see libtool(info), esp. -+dnl node 6.3 "Updating version info" -+PA_ABI=19 -+PA_REV=0 -+PA_AGE=0 -+AC_SUBST(PA_ABI) -+AC_SUBST(PA_REV) -+AC_SUBST(PA_AGE) -+ -+ -+dnl Checks for programs. -+ -+AC_PROG_CC -+AC_PROG_CXX -+AC_PROG_RANLIB -+AC_PROG_INSTALL -+AC_PROG_MAKE_SET -+ -+AC_AIX -+AC_ISC_POSIX -+AC_MINIX -+AM_PROG_CC_STDC -+AC_PROG_GCC_TRADITIONAL -+AC_C_CONST -+AC_C_INLINE -+ -+dnl Check for Mingw support -+#GR_PWIN32 -+ -+dnl libtool Initialisation -+AC_LIBTOOL_WIN32_DLL -+AC_PROG_LIBTOOL -+ -+ACX_PTHREAD -+ -+dnl This must be one of the first tests we do or it will fail... -+AC_C_BIGENDIAN -+ -+dnl checks for various host APIs and arguments to configure that -+dnl turn them on or off -+ -+AC_CHECK_LIB(asound, snd_pcm_open, [have_alsa=yes], [have_alsa=no]) -+ -+ -+PKG_CHECK_MODULES(JACK, jack, [have_jack=yes], [have_jack=no]) -+PKG_CHECK_LIB(jack_client_new, [$JACK_LIBS], [$JACK_CFLAGS], [have_jack=yes], [have_jack=no]) -+ -+AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h soundcard.h machine/soundcard.h]) -+AC_CHECK_HEADERS(sys/ioctl.h, [have_oss=yes], [have_oss=no]) -+ -+dnl sizeof checks: we will need a 16-bit and a 32-bit type -+ -+AC_CHECK_SIZEOF(short) -+AC_CHECK_SIZEOF(int) -+AC_CHECK_SIZEOF(long) -+ -+dnl Specify options -+ -+AC_ARG_WITH(alsa, -+ [ --with-alsa (default=yes)], -+ [with_alsa=$withval], [with_alsa=$have_alsa]) -+ -+AC_ARG_WITH(jack, -+ [ --with-jack (default=yes)], -+ [with_jack=$withval], [with_jack=$have_jack]) -+ -+AC_ARG_WITH(oss, -+ [ --with-oss (default=yes)], -+ [with_oss=$withval], [with_oss=$have_oss]) -+ -+AC_ARG_WITH(winapi, -+ [ --with-winapi ((wmme/directx/asio) default=wmme)], -+ [with_winapi=$withval], [with_winapi="wmme"]) -+ -+dnl Mac API added for ASIO, can have other api's listed -+AC_ARG_WITH(macapi, -+ [ --with-macapi ((asio/core/sm) default=core)], -+ [with_macapi=$withval], [with_macapi="core"]) -+ -+AC_ARG_WITH(asiodir, -+ [ --with-asiodir (default=/usr/local/asiosdk2)], -+ [with_asiodir=$withval], [with_asiodir="/usr/local/asiosdk2"]) -+ -+AC_ARG_WITH(dxdir, -+ [ --with-dxdir (default=/usr/local/dx7sdk)], -+ [with_dxdir=$withval], [with_dxdir="/usr/local/dx7sdk"]) -+ -+AC_ARG_ENABLE(debug-output, -+ [ --enable-debug-output], -+ [if test x$enableval != xno ; then -+ AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages]) -+ fi -+ ]) -+ -+dnl BSD configuration -+AC_HAVE_LIBRARY(ossaudio) -+ -+dnl Mac OS X configuration -+ -+AC_CHECK_LIB(CoreAudio, OpenAComponent, -+ [ -+ have_coreaudio=yes -+ PA_LIBADD="$PA_LIBADD libportaudio-coreaudio.la" -+ AC_DEFINE([PA_USE_COREAUDIO], [], [Define to use Mac OS X CoreAudio]) -+ #LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon" -+ LIBS="-lCoreAudio -lAudioToolbox -lAudioUnit -lCarbon" -+ ], have_coreaudio=no) -+ -+ASIO_CFLAGS="" -+ASIO_OBJS="" -+ -+if [[ $with_asiodir ]] ; then -+ ASIODIR="$with_asiodir" -+fi -+ -+if [[ $with_macapi = "asio" ]] ; then -+ echo "ASIODIR: $ASIODIR" -+ ASIO_CFLAGS="-Ipa_asio -I$ASIDIR/host/mac -I$ASIODIR/common" -+ ASIO_OBJS=$ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/mac/asioshlib.o -+ PA_LIBADD="$PA_LIBADD libportaudio-mac-asio.la" -+fi -+ -+if [[ $with_winapi = "asio" ]] ; then -+ echo "ASIODIR: $ASIODIR" -+ ASIO_CFLAGS="-ffast-math -fomit-frame-pointer -Ipa_asio -I$ASIDIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS" -+ ASIO_OBJS=$ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o -+ LIBS="$LIBS -lwinmm -lole32 -luuid" -+ PA_LIBADD="$PA_LIBADD libportaudio-win-asio.la" -+fi -+ -+ -+dnl MingW/Win configuration -+ -+AC_TRY_LINK_LIB(dsound, [DSW_InitOutputBuffer(0,0,0,0);], [ -+ #include <windows.h> -+ #include <DSound.h> -+ ], [-I$DXDIR/include], -+ [ -+ have_directx=yes -+ DXDIR="$with_dxdir" -+ echo "DXDIR: $DXDIR" -+ # LDFLAGS -L./dx7sdk/lib ? -+ LIBS="-lwinmm -ldsound -lole32" -+ CFLAGS="$CFLAGS -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO -DPA_NO_WDMKS" -+ PA_LIBADD="$PA_LIBADD libportaudio-dsound.la" -+ ], have_directx=no) -+ -+AC_TRY_LINK_LIB(kernel32, [DeviceIoControl(0,0,0,0,0,0,0,0);],[ -+ #include <windows.h> -+ #include <winbase.h> -+ #include <ks.h> -+ ], [-I$DXDIR/include], -+ [ -+ have_wdmks=yes -+ DXDIR="$with_dxdir" -+ echo "DXDIR: $DXDIR" -+ # LDFLAGS -L./dx7sdk/lib ? -+ LIBS="-lwinmm -luuid -lsetupapi -lole32" -+ CFLAGS="$CFLAGS -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO" -+ PA_LIBADD="$PA_LIBADD libportaudio-wdmks.la" -+ ], have_wdmks=no) -+ -+# WMME default ? -+AC_TRY_LINK_LIB(winmm, [waveOutOpen(0,0,0,0,0,0);],[ -+ #include <windows.h> -+ #include <mmsystem.h> -+ ], [], -+ [ -+ have_wmme=yes -+ LIBS="-lwinmm -lole32 -luuid" -+ CFLAGS="$CFLAGS -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS" -+ PA_LIBADD="$PA_LIBADD libportaudio-wmme.la" -+ ], have_wmme=no) -+ -+ -+dnl Unix configuration -+ -+dnl SGI IRIX audio library (AL) configuration (Pieter, oct 2-13, 2003). -+dnl The 'dmedia' library is needed to read the Unadjusted System Time (UST). -+dnl -+ -+AC_CHECK_LIB(audio, alOpenPort, [have_AL=1], [have_AL=0]) -+AC_CHECK_LIB(dmedia, dmGetUST, [have_dmedia=1], [have_dmedia=0]) -+ -+ -+if [[ $have_AL = "yes" ] && [ $have_dmedia = "yes" ]] ; then -+ dnl See the '#ifdef PA_USE_SGI' in file pa_unix/pa_unix_hostapis.c -+ dnl which selects the appropriate PaXXX_Initialize() function. -+ dnl -+ -+ LIBS="-ldmedia -laudio" -+ AC_DEFINE([PA_USE_SGI], [], [Define to use special SGI system support]) -+ PA_LIBADD="$PA_LIBADD libportaudio-sgi.la" -+ -+ # TODO: -+ #AC_MSG_ERROR([IRIX audio library not found!]) -+ #AC_MSG_ERROR([IRIX digital media library not found!]) -+fi -+ -+ -+if [[ $have_alsa = "yes" ] && [ $with_alsa != "no" ]] ; then -+ LIBS="$LIBS -lasound" -+ AC_DEFINE([PA_USE_ALSA], [], [Define to use ALSA]) -+ PA_LIBADD="$PA_LIBADD libportaudio-alsa.la" -+fi -+ -+if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then -+ LIBS="$LIBS $JACK_LIBS" -+ CFLAGS="$CFLAGS $JACK_CFLAGS" -+ AC_DEFINE([PA_USE_JACK], [], [Define to use JACK]) -+ PA_LIBADD="$PA_LIBADD libportaudio-jack.la" -+fi -+ -+if [[ $with_oss != "no" ]] ; then -+ AC_DEFINE([PA_USE_OSS], [], [Define to use Open Sound System]) -+ PA_LIBADD="$PA_LIBADD libportaudio-oss.la" -+fi -+ -+dnl SGI books say -lpthread should be the last of the libs mentioned. -+if [[ $acx_pthread_ok = "yes" ]] ; then -+ LIBS="$LIBS $PTHREAD_LIBS" -+ PA_LIBADD="$PA_LIBADD libportaudio-unix.la" -+else -+ if [[ $with_winapi != "wmme" -a $with_winapi != "directx" -a $with_winapi != "asio" ]] ; then -+ AC_MSG_ERROR([libpthread not found!]) -+ fi -+fi -+ -+ -+if [[ $with_macapi = "asio" ] || [ $with_winapi = "asio" ]] ; then -+ echo "ASIODIR: $ASIODIR" -+ -+ CFLAGS="$CFLAGS $ASIO_CFLAGS" -+fi -+ -+if [[ $ac_cv_c_bigendian = "yes" ]] ; then -+ CFLAGS="$CFLAGS -DPA_BIG_ENDIAN" -+else -+ CFLAGS="$CFLAGS -DPA_LITTLE_ENDIAN" -+fi -+ -+ -+CXXFLAGS="$CXXFLAGS" -+ -+#CFLAGS="-g -O2 -Wall -pedantic -pipe" -+ -+CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -+ -+ -+dnl extra variables -+AC_SUBST(PA_LIBADD) -+AC_SUBST(ASIO_OBJS) -+AC_SUBST(PTHREAD_CFLAGS) -+AC_SUBST(CXXFLAGS) -+AC_SUBST(NASM) -+AC_SUBST(NASMOPT) -+ -+AC_OUTPUT([Makefile portaudio-2.0.pc]) ---- /dev/null 2006-03-10 00:02:48.821312048 +0100 -+++ config/acx_pthread.m4 2006-03-17 15:41:05.000000000 +0100 -@@ -0,0 +1,190 @@ -+dnl Available from the GNU Autoconf Macro Archive at: -+dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html -+dnl -+AC_DEFUN([ACX_PTHREAD], [ -+AC_REQUIRE([AC_CANONICAL_HOST]) -+AC_LANG_SAVE -+AC_LANG_C -+acx_pthread_ok=no -+ -+# We used to check for pthread.h first, but this fails if pthread.h -+# requires special compiler flags (e.g. on True64 or Sequent). -+# It gets checked for in the link test anyway. -+ -+# First of all, check if the user has set any of the PTHREAD_LIBS, -+# etcetera environment variables, and if threads linking works using -+# them: -+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -+ save_LIBS="$LIBS" -+ LIBS="$PTHREAD_LIBS $LIBS" -+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) -+ AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) -+ AC_MSG_RESULT($acx_pthread_ok) -+ if test x"$acx_pthread_ok" = xno; then -+ PTHREAD_LIBS="" -+ PTHREAD_CFLAGS="" -+ fi -+ LIBS="$save_LIBS" -+ CFLAGS="$save_CFLAGS" -+fi -+ -+# We must check for the threads library under a number of different -+# names; the ordering is very important because some systems -+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -+# libraries is broken (non-POSIX). -+ -+# Create a list of thread flags to try. Items starting with a "-" are -+# C compiler flags, and other items are library names, except for "none" -+# which indicates that we try without any flags at all. -+ -+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" -+ -+# The ordering *is* (sometimes) important. Some notes on the -+# individual items follow: -+ -+# pthreads: AIX (must check this before -lpthread) -+# none: in case threads are in libc; should be tried before -Kthread and -+# other compiler flags to prevent continual compiler warnings -+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -+# -pthreads: Solaris/gcc -+# -mthreads: Mingw32/gcc, Lynx/gcc -+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -+# doesn't hurt to check since this sometimes defines pthreads too; -+# also defines -D_REENTRANT) -+# pthread: Linux, etcetera -+# --thread-safe: KAI C++ -+ -+case "${host_cpu}-${host_os}" in -+ *solaris*) -+ -+ # On Solaris (at least, for some versions), libc contains stubbed -+ # (non-functional) versions of the pthreads routines, so link-based -+ # tests will erroneously succeed. (We need to link with -pthread or -+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather -+ # a function called by this macro, so we could check for that, but -+ # who knows whether they'll stub that too in a future libc.) So, -+ # we'll just look for -pthreads and -lpthread first: -+ -+ acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" -+ ;; -+esac -+ -+if test x"$acx_pthread_ok" = xno; then -+for flag in $acx_pthread_flags; do -+ -+ case $flag in -+ none) -+ AC_MSG_CHECKING([whether pthreads work without any flags]) -+ ;; -+ -+ -*) -+ AC_MSG_CHECKING([whether pthreads work with $flag]) -+ PTHREAD_CFLAGS="$flag" -+ ;; -+ -+ *) -+ AC_MSG_CHECKING([for the pthreads library -l$flag]) -+ PTHREAD_LIBS="-l$flag" -+ ;; -+ esac -+ -+ save_LIBS="$LIBS" -+ save_CFLAGS="$CFLAGS" -+ LIBS="$PTHREAD_LIBS $LIBS" -+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -+ -+ # Check for various functions. We must include pthread.h, -+ # since some functions may be macros. (On the Sequent, we -+ # need a special flag -Kthread to make this header compile.) -+ # We check for pthread_join because it is in -lpthread on IRIX -+ # while pthread_create is in libc. We check for pthread_attr_init -+ # due to DEC craziness with -lpthreads. We check for -+ # pthread_cleanup_push because it is one of the few pthread -+ # functions on Solaris that doesn't have a non-functional libc stub. -+ # We try pthread_create on general principles. -+ AC_TRY_LINK([#include <pthread.h>], -+ [pthread_t th; pthread_join(th, 0); -+ pthread_attr_init(0); pthread_cleanup_push(0, 0); -+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], -+ [acx_pthread_ok=yes]) -+ -+ LIBS="$save_LIBS" -+ CFLAGS="$save_CFLAGS" -+ -+ AC_MSG_RESULT($acx_pthread_ok) -+ if test "x$acx_pthread_ok" = xyes; then -+ break; -+ fi -+ -+ PTHREAD_LIBS="" -+ PTHREAD_CFLAGS="" -+done -+fi -+ -+# Various other checks: -+if test "x$acx_pthread_ok" = xyes; then -+ save_LIBS="$LIBS" -+ LIBS="$PTHREAD_LIBS $LIBS" -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -+ -+ # Detect AIX lossage: threads are created detached by default -+ # and the JOINABLE attribute has a nonstandard name (UNDETACHED). -+ AC_MSG_CHECKING([for joinable pthread attribute]) -+ AC_TRY_LINK([#include <pthread.h>], -+ [int attr=PTHREAD_CREATE_JOINABLE;], -+ ok=PTHREAD_CREATE_JOINABLE, ok=unknown) -+ if test x"$ok" = xunknown; then -+ AC_TRY_LINK([#include <pthread.h>], -+ [int attr=PTHREAD_CREATE_UNDETACHED;], -+ ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) -+ fi -+ if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then -+ AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, -+ [Define to the necessary symbol if this constant -+ uses a non-standard name on your system.]) -+ fi -+ AC_MSG_RESULT(${ok}) -+ if test x"$ok" = xunknown; then -+ AC_MSG_WARN([we do not know how to create joinable pthreads]) -+ fi -+ -+ AC_MSG_CHECKING([if more special flags are required for pthreads]) -+ flag=no -+ case "${host_cpu}-${host_os}" in -+ *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; -+ *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; -+ esac -+ AC_MSG_RESULT(${flag}) -+ if test "x$flag" != xno; then -+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" -+ fi -+ -+ LIBS="$save_LIBS" -+ CFLAGS="$save_CFLAGS" -+ -+ # More AIX lossage: must compile with cc_r -+ AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) -+else -+ PTHREAD_CC="$CC" -+fi -+ -+AC_SUBST(PTHREAD_LIBS) -+AC_SUBST(PTHREAD_CFLAGS) -+AC_SUBST(PTHREAD_CC) -+ -+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -+if test x"$acx_pthread_ok" = xyes; then -+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) -+ : -+else -+ acx_pthread_ok=no -+ $2 -+fi -+AC_LANG_RESTORE -+])dnl ACX_PTHREAD ---- /dev/null 2006-03-10 00:02:48.821312048 +0100 -+++ config/pkg_check.m4 2006-03-17 22:12:37.000000000 +0100 -@@ -0,0 +1,49 @@ -+ -+AC_DEFUN([PKG_CHECK_LIB], [ -+AC_REQUIRE([AC_CANONICAL_HOST]) -+AC_LANG_SAVE -+AC_LANG_C -+ -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS $3" -+ save_LIBS="$LIBS" -+ LIBS="$2 $LIBS" -+ AC_MSG_CHECKING([for $1 in LIBS=$2 with CFLAGS=$3]) -+ AC_TRY_LINK_FUNC([$1], pkg_check_try_link=yes, pkg_check_try_link=no) -+ AC_MSG_RESULT($pkg_check_try_link) -+ LIBS="$save_LIBS" -+ CFLAGS="$save_CFLAGS" -+ -+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -+if test x"$pkg_check_try_link" = xyes; then -+ $4 -+else -+ $5 -+fi -+AC_LANG_RESTORE -+])dnl PKG_CHECK_LIB -+ -+ -+AC_DEFUN([AC_TRY_LINK_LIB], [ -+AC_REQUIRE([AC_CANONICAL_HOST]) -+AC_LANG_SAVE -+AC_LANG_C -+ -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS $4" -+ save_LIBS="$LIBS" -+ LIBS="-l$1 $LIBS" -+ AC_MSG_CHECKING([for $2 in $1]) -+ AC_TRY_LINK([$3], [$2], ac_try_link_lib=yes, ac_try_link_lib=no) -+ AC_MSG_RESULT($ac_try_link_lib) -+ LIBS="$save_LIBS" -+ CFLAGS="$save_CFLAGS" -+ -+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -+if test x"$ac_try_link_lib" = xyes; then -+ $5 -+else -+ $6 -+fi -+AC_LANG_RESTORE -+])dnl AC_TRY_LINK_LIB ---- /dev/null 2006-03-10 00:02:48.821312048 +0100 -+++ bootstrap 2006-03-19 23:33:58.000000000 +0100 -@@ -0,0 +1,9 @@ -+#!/bin/sh -+ -+rm -rf config.cache autom4te*.cache -+ -+aclocal-1.9 -I config -+autoconf2.50 -+autoheader2.50 -+libtoolize --automake -+automake-1.9 --add-missing --foreign diff --git a/gr-audio-portaudio/gnuradio-audio-portaudio.pc.in b/gr-audio-portaudio/gnuradio-audio-portaudio.pc.in deleted file mode 100644 index 086195965..000000000 --- a/gr-audio-portaudio/gnuradio-audio-portaudio.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: gnuradio-audio-portaudio -Description: The GNU Radio block for the PORTAUDIO sound system -Requires: gnuradio-core -Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-audio-portaudio -Cflags: -I${includedir} diff --git a/gr-audio-portaudio/src/.gitignore b/gr-audio-portaudio/src/.gitignore deleted file mode 100644 index f05e85127..000000000 --- a/gr-audio-portaudio/src/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -/Makefile -/Makefile.in -/.la -/.lo -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo -/usrp.py -/usrp.cc -/audio_oss.cc -/audio_oss.py -/audio_portaudio.py -/audio_portaudio.cc -/run_tests -/gnuradio -/guile -/python diff --git a/gr-audio-portaudio/src/Makefile.am b/gr-audio-portaudio/src/Makefile.am deleted file mode 100644 index f8d42792b..000000000 --- a/gr-audio-portaudio/src/Makefile.am +++ /dev/null @@ -1,77 +0,0 @@ -# -# Copyright 2004,2008,2009,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -EXTRA_DIST += run_tests.in -DISTCLEANFILES += run_tests - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ - $(PORTAUDIO_CFLAGS) $(WITH_INCLUDES) - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_portaudio_sink.h \ - audio_portaudio_source.h - -noinst_HEADERS = \ - gri_portaudio.h - -noinst_PYTHON = \ - qa_portaudio.py - -lib_LTLIBRARIES = libgnuradio-audio-portaudio.la - -libgnuradio_audio_portaudio_la_SOURCES = \ - audio_portaudio_sink.cc \ - audio_portaudio_source.cc \ - gri_portaudio.cc - -libgnuradio_audio_portaudio_la_LIBADD = \ - $(GNURADIO_CORE_LA) \ - $(PORTAUDIO_LIBS) - -libgnuradio_audio_portaudio_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) - - -################################### -# SWIG interfaces and libraries - -TOP_SWIG_IFILES = \ - audio_portaudio.i - -# Install so that they end up available as: -# import gnuradio.audio_portaudio -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_portaudio_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -audio_portaudio_la_swig_libadd = \ - libgnuradio-audio-portaudio.la - - -if PYTHON -TESTS += run_tests -endif
\ No newline at end of file diff --git a/gr-audio-portaudio/src/Makefile.swig.gen b/gr-audio-portaudio/src/Makefile.swig.gen deleted file mode 100644 index 32c2e54e1..000000000 --- a/gr-audio-portaudio/src/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -# Makefile.swig.gen for audio_portaudio.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_portaudio -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_portaudio -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -audio_portaudio_pythondir_category ?= gnuradio/audio_portaudio -audio_portaudio_pylibdir_category ?= $(audio_portaudio_pythondir_category) -audio_portaudio_pythondir = $(pythondir)/$(audio_portaudio_pythondir_category) -audio_portaudio_pylibdir = $(pyexecdir)/$(audio_portaudio_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -audio_portaudio_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_portaudio -# FIXME: determince whether these should be installed with gnuradio. -audio_portaudio_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -audio_portaudio_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -audio_portaudio_swiginclude_HEADERS = \ - audio_portaudio.i \ - $(audio_portaudio_swiginclude_headers) - -if PYTHON -audio_portaudio_pylib_LTLIBRARIES = \ - _audio_portaudio.la - -_audio_portaudio_la_SOURCES = \ - python/audio_portaudio.cc \ - $(audio_portaudio_la_swig_sources) - -audio_portaudio_python_PYTHON = \ - audio_portaudio.py \ - $(audio_portaudio_python) - -_audio_portaudio_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_portaudio_la_swig_libadd) - -_audio_portaudio_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_portaudio_la_swig_ldflags) - -_audio_portaudio_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_portaudio_la_swig_cxxflags) - -python/audio_portaudio.cc: audio_portaudio.py -audio_portaudio.py: audio_portaudio.i - -# Include the python dependencies for this file --include python/audio_portaudio.d - -endif # end of if python - -if GUILE - -audio_portaudio_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_portaudio.la -libguile_gnuradio_audio_portaudio_la_SOURCES = \ - guile/audio_portaudio.cc \ - $(audio_portaudio_la_swig_sources) -nobase_audio_portaudio_scm_DATA = \ - gnuradio/audio_portaudio.scm \ - gnuradio/audio_portaudio-primitive.scm -libguile_gnuradio_audio_portaudio_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_portaudio_la_swig_libadd) -libguile_gnuradio_audio_portaudio_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_portaudio_la_swig_ldflags) -libguile_gnuradio_audio_portaudio_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_portaudio_la_swig_cxxflags) - -guile/audio_portaudio.cc: gnuradio/audio_portaudio.scm -gnuradio/audio_portaudio.scm: audio_portaudio.i -gnuradio/audio_portaudio-primitive.scm: gnuradio/audio_portaudio.scm - -# Include the guile dependencies for this file --include guile/audio_portaudio.d - -endif # end of GUILE - - diff --git a/gr-audio-portaudio/src/audio_portaudio.i b/gr-audio-portaudio/src/audio_portaudio.i deleted file mode 100644 index 612b0afff..000000000 --- a/gr-audio-portaudio/src/audio_portaudio.i +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_portaudio_sink.h" -#include "audio_portaudio_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_portaudio,source) - -audio_portaudio_source_sptr -audio_portaudio_make_source (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_portaudio_source : public gr_sync_block { - - protected: - audio_portaudio_source (int sampling_rate, - const std::string device_name, - bool ok_to_block - ) throw (std::runtime_error); - - public: - ~audio_portaudio_source (); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_portaudio,sink) - -audio_portaudio_sink_sptr -audio_portaudio_make_sink (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true - ) throw (std::runtime_error); - -class audio_portaudio_sink : public gr_sync_block { - - protected: - audio_portaudio_sink (int sampling_rate, - const std::string device_name, - bool ok_to_block - ) throw (std::runtime_error); - - public: - ~audio_portaudio_sink (); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_portaudio" "scm_init_gnuradio_audio_portaudio_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-portaudio/src/run_tests.in b/gr-audio-portaudio/src/run_tests.in deleted file mode 100644 index 0b483dbcf..000000000 --- a/gr-audio-portaudio/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-portaudio \ - @abs_top_builddir@/gr-audio-portaudio \ - @srcdir@ diff --git a/gr-audio-windows/.gitignore b/gr-audio-windows/.gitignore deleted file mode 100644 index 53edad32f..000000000 --- a/gr-audio-windows/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 -/stamp-h1.in -/stamp-h2.in diff --git a/gr-audio-windows/README b/gr-audio-windows/README deleted file mode 100644 index 4564c7c7b..000000000 --- a/gr-audio-windows/README +++ /dev/null @@ -1,66 +0,0 @@ - -# Copyright 2001,2005 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. - -gr-audio-windows will add an audio-sink to gnuradio for windows - -Requirements for building: -make sure you have the following installed: -mingw -libtool (recent version ,built yourself, (if needed remove old libtool macros from /usr/share/aclocal)) -msys -python2.4 (just install the prebuild binary for windows) -boost (built yourself, maybe just unpacking the source somewhere will do, we only use header files) -cppunit (built yourself) -gnuradio-core (built with mingw) - -Building: -sources from cvs: -edit bootstrap to your needs (see below for example) -./bootstrap -./configure /configure --with-cppunit-prefix=/whereiscppunit --with-boost-include-dir=/c/whereisboost PYTHON=/c/Python24/python am_cv_python_pythondir=/c/Python24/Lib/site-packages am_cv_python_pyexecdir=/c/Python24/Lib/site-packages -make -make check -make install - - -If you have multiple versions of aclocal then edit bootstrap and change aclocal and automake to the latest version - -You really need a recent libtool to get this built on mingw. -If you build it with default options it will be placed in /usr/local, but the default libtool will still be in /usr. -This will result in old m4 macros will be used by aclocal. -So if you have a more recent libtool installed in /usr/local add -I /usr/local/share/aclocal to the aclocal commandline in bootstrap. -(And add any other directories with the most recent m4 macros) -You could also uninstall (delete) the old libtool macros in /usr/share/aclocal - -bootstrap example: - -!/bin/sh -rm -fr config.cache autom4te*.cache -aclocal-1.8 -I /usr/local/share/aclocal -I config -autoconf -autoheader -libtoolize --automake -automake-1.8 --add-missing - - -configuration example: -./configure --with-cppunit-prefix=/usr/local --with-boost-include-dir=/d/boost_1_32_0/include/boost-1_32 PYTHON=/d/Python24/python am_cv_python_pythondir=/d/Python24/Lib/site-packages am_cv_python_pyexecdir=/d/Python24/Lib/site-packages - -Martin Dvh, juli 2005 diff --git a/gr-audio-windows/src/.gitignore b/gr-audio-windows/src/.gitignore deleted file mode 100644 index 7f6631569..000000000 --- a/gr-audio-windows/src/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.cache -/config.h -/config.h.in -/config.log -/config.status -/configure -/depcomp -/install-sh -/libtool -/ltmain.sh -/make.log -/missing -/missing -/mkinstalldirs -/py-compile -/stamp-h -/stamp-h.in -/stamp-h1 -/stamp-h1.in -/stamp-h2.in -/run_tests -/audio_windows.cc -/audio_windows.py -/gnuradio -/guile -/python diff --git a/gr-audio-windows/src/Makefile.am b/gr-audio-windows/src/Makefile.am deleted file mode 100644 index 1d7b253ec..000000000 --- a/gr-audio-windows/src/Makefile.am +++ /dev/null @@ -1,72 +0,0 @@ -# -# Copyright 2004,2005,2008,2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -DISTCLEANFILES += run_tests -EXTRA_DIST += run_tests.in - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - -noinst_PYTHON = qa_audio_windows.py - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_windows_sink.h \ - audio_windows_source.h - -lib_LTLIBRARIES = libgnuradio-audio-windows.la - -libgnuradio_audio_windows_la_SOURCES = \ - audio_windows_sink.cc \ - audio_windows_source.cc - -libgnuradio_audio_windows_la_LIBADD = \ - $(GNURADIO_CORE_LA) \ - $(WINAUDIO_LIBS) - -libgnuradio_audio_windows_la_LDFLAGS = \ - $(LIBGNURADIO_CORE_EXTRA_LDFLAGS) \ - $(NO_UNDEFINED) \ - $(LTVERSIONFLAGS) - -################################### -# SWIG interface and library - -TOP_SWIG_IFILES = \ - audio_windows.i - -# Install so that they end up available as: -# import gnuradio.audio_windows -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_windows_pythondir_category = \ - gnuradio - -# additional libraries for linking with the SWIG-generated library -audio_windows_la_swig_libadd = \ - libgnuradio-audio-windows.la - -if PYTHON -TESTS += run_tests -endif diff --git a/gr-audio-windows/src/Makefile.swig.gen b/gr-audio-windows/src/Makefile.swig.gen deleted file mode 100644 index cc21f30bc..000000000 --- a/gr-audio-windows/src/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -# Makefile.swig.gen for audio_windows.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_windows -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_windows -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -audio_windows_pythondir_category ?= gnuradio/audio_windows -audio_windows_pylibdir_category ?= $(audio_windows_pythondir_category) -audio_windows_pythondir = $(pythondir)/$(audio_windows_pythondir_category) -audio_windows_pylibdir = $(pyexecdir)/$(audio_windows_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -audio_windows_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_windows -# FIXME: determince whether these should be installed with gnuradio. -audio_windows_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -audio_windows_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -audio_windows_swiginclude_HEADERS = \ - audio_windows.i \ - $(audio_windows_swiginclude_headers) - -if PYTHON -audio_windows_pylib_LTLIBRARIES = \ - _audio_windows.la - -_audio_windows_la_SOURCES = \ - python/audio_windows.cc \ - $(audio_windows_la_swig_sources) - -audio_windows_python_PYTHON = \ - audio_windows.py \ - $(audio_windows_python) - -_audio_windows_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_windows_la_swig_libadd) - -_audio_windows_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_windows_la_swig_ldflags) - -_audio_windows_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_windows_la_swig_cxxflags) - -python/audio_windows.cc: audio_windows.py -audio_windows.py: audio_windows.i - -# Include the python dependencies for this file --include python/audio_windows.d - -endif # end of if python - -if GUILE - -audio_windows_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_windows.la -libguile_gnuradio_audio_windows_la_SOURCES = \ - guile/audio_windows.cc \ - $(audio_windows_la_swig_sources) -nobase_audio_windows_scm_DATA = \ - gnuradio/audio_windows.scm \ - gnuradio/audio_windows-primitive.scm -libguile_gnuradio_audio_windows_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_windows_la_swig_libadd) -libguile_gnuradio_audio_windows_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_windows_la_swig_ldflags) -libguile_gnuradio_audio_windows_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_windows_la_swig_cxxflags) - -guile/audio_windows.cc: gnuradio/audio_windows.scm -gnuradio/audio_windows.scm: audio_windows.i -gnuradio/audio_windows-primitive.scm: gnuradio/audio_windows.scm - -# Include the guile dependencies for this file --include guile/audio_windows.d - -endif # end of GUILE - - diff --git a/gr-audio-windows/src/audio_windows.i b/gr-audio-windows/src/audio_windows.i deleted file mode 100644 index c154eacd6..000000000 --- a/gr-audio-windows/src/audio_windows.i +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -%include "gnuradio.i" // the common stuff - -%{ -#include "audio_windows_sink.h" -#include "audio_windows_source.h" -%} - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_windows,sink) - -audio_windows_sink_sptr -audio_windows_make_sink (int sampling_freq, - const std::string dev = "" - ) throw (std::runtime_error); - - -class audio_windows_sink : public gr_sync_block { - protected: - audio_windows_sink (int sampling_freq, const std::string device_name = ""); - - public: - ~audio_windows_sink (); -}; - -// ---------------------------------------------------------------- - -GR_SWIG_BLOCK_MAGIC(audio_windows,source) - -audio_windows_source_sptr -audio_windows_make_source (int sampling_freq, - const std::string dev = "" - ) throw (std::runtime_error); - -class audio_windows_source : public gr_sync_block { - protected: - audio_windows_source (int sampling_freq, const std::string device_name = ""); - - public: - ~audio_windows_source (); -}; - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-audio_windows" "scm_init_gnuradio_audio_windows_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-audio-windows/src/qa_audio_windows.py b/gr-audio-windows/src/qa_audio_windows.py deleted file mode 100755 index 0d14535a6..000000000 --- a/gr-audio-windows/src/qa_audio_windows.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2005,2007 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import audio_windows - -class qa_oss (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_000_nop (self): - """Just see if we can import the module... - They may not have audio drivers, soundcard, etc. Don't try to run anything""" - pass - -if __name__ == '__main__': - gr_unittest.main () diff --git a/gr-audio-windows/src/run_tests.in b/gr-audio-windows/src/run_tests.in deleted file mode 100755 index f7de663ba..000000000 --- a/gr-audio-windows/src/run_tests.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-windows \ - @abs_top_builddir@/gr-audio-windows \ - @srcdir@ diff --git a/gr-audio/.gitignore b/gr-audio/.gitignore new file mode 100644 index 000000000..a37fc0c1a --- /dev/null +++ b/gr-audio/.gitignore @@ -0,0 +1,3 @@ +/Makefile +/Makefile.in +/*.pc diff --git a/gr-audio-oss/Makefile.am b/gr-audio/Makefile.am index c55d3ecb7..bb0d05d07 100644 --- a/gr-audio-oss/Makefile.am +++ b/gr-audio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2006 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,14 +17,15 @@ # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# include $(top_srcdir)/Makefile.common -SUBDIRS = src +SUBDIRS = include lib -pkgconfigdir = $(libdir)/pkgconfig -dist_pkgconfig_DATA = gnuradio-audio-oss.pc +if PYTHON +SUBDIRS += grc swig +endif -etcdir = $(gr_prefsdir) -dist_etc_DATA = gr-audio-oss.conf +pkgconfigdir = $(libdir)/pkgconfig +dist_pkgconfig_DATA = gnuradio-audio.pc diff --git a/gr-audio/README b/gr-audio/README new file mode 100644 index 000000000..ae929a94a --- /dev/null +++ b/gr-audio/README @@ -0,0 +1,11 @@ +The gnuradio audio component provides an audio_source and audio_sink block. +The audio blocks stream floating point samples to and from audio hardware. + +The gr-audio will be built automatically when gnuradio-core is enabled. +Support for underlying audio architectures depends on OS and installed libraries. +At the time of writing, gr-audio supports oss, alsa, jack, portaudio, audiounit, and winmm. + +At runtime, gr-audio will automatically select from the available architectures. +The user can override the selection via configuration file by setting "audio_module" +to one of the following strings: oss, alsa, jack, portaudio, osx, or windows. +See gr-audio.conf for an example. diff --git a/gr-audio-oss/gnuradio-audio-oss.pc.in b/gr-audio/gnuradio-audio.pc.in index 4a215bdab..1cd6d4051 100644 --- a/gr-audio-oss/gnuradio-audio-oss.pc.in +++ b/gr-audio/gnuradio-audio.pc.in @@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: gnuradio-audio-oss -Description: The GNU Radio block for the OSS sound system +Name: gnuradio-audio +Description: The GNU Radio block for all supported audio sound systems Requires: gnuradio-core Version: @LIBVER@ -Libs: -L${libdir} -lgnuradio-audio-oss +Libs: -L${libdir} -lgnuradio-audio Cflags: -I${includedir} diff --git a/gr-audio/grc/.gitignore b/gr-audio/grc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-audio/grc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio-jack/Makefile.am b/gr-audio/grc/Makefile.am index cdc1433db..36d9daa7a 100644 --- a/gr-audio-jack/Makefile.am +++ b/gr-audio/grc/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2009 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,10 +21,9 @@ include $(top_srcdir)/Makefile.common -SUBDIRS = src +grcblocksdir = $(grc_blocksdir) -pkgconfigdir = $(libdir)/pkgconfig -dist_pkgconfig_DATA = gnuradio-audio-jack.pc +dist_grcblocks_DATA = \ + audio_source.xml \ + audio_sink.xml -etcdir = $(gr_prefsdir) -dist_etc_DATA = gr-audio-jack.conf diff --git a/grc/blocks/audio_sink.xml b/gr-audio/grc/audio_sink.xml index 75d583470..26e199d61 100644 --- a/grc/blocks/audio_sink.xml +++ b/gr-audio/grc/audio_sink.xml @@ -7,12 +7,13 @@ <block> <name>Audio Sink</name> <key>audio_sink</key> + <category>Sinks</category> <import>from gnuradio import audio</import> <make>audio.sink($samp_rate, $device_name, $ok_to_block)</make> <param> <name>Sample Rate</name> <key>samp_rate</key> - <value>32000</value> + <value>samp_rate</value> <type>int</type> <option> <name>16KHz</name> diff --git a/grc/blocks/audio_source.xml b/gr-audio/grc/audio_source.xml index 1f5d1033e..59b375244 100644 --- a/grc/blocks/audio_source.xml +++ b/gr-audio/grc/audio_source.xml @@ -7,12 +7,13 @@ <block> <name>Audio Source</name> <key>audio_source</key> + <category>Sources</category> <import>from gnuradio import audio</import> <make>audio.source($samp_rate, $device_name, $ok_to_block)</make> <param> <name>Sample Rate</name> <key>samp_rate</key> - <value>32000</value> + <value>samp_rate</value> <type>int</type> <option> <name>16KHz</name> diff --git a/gr-audio/include/.gitignore b/gr-audio/include/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-audio/include/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio-osx/Makefile.am b/gr-audio/include/Makefile.am index 84a4c69b3..a4db27d08 100644 --- a/gr-audio-osx/Makefile.am +++ b/gr-audio/include/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2006,2010 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,9 +17,11 @@ # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# include $(top_srcdir)/Makefile.common -EXTRA_DIST += README_OSX -SUBDIRS = src +grinclude_HEADERS = \ + gr_audio_api.h \ + gr_audio_source.h \ + gr_audio_sink.h diff --git a/gnuradio-examples/c++/dial_tone/main.cc b/gr-audio/include/gr_audio_api.h index a09bd8288..b21819bab 100644 --- a/gnuradio-examples/c++/dial_tone/main.cc +++ b/gr-audio/include/gr_audio_api.h @@ -1,5 +1,5 @@ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -19,17 +19,13 @@ * Boston, MA 02110-1301, USA. */ -// GNU Radio C++ application -// -// Instantiate a top block -// Instantiate a runtime, passing it the top block -// Tell the runtime to go... +#ifndef INCLUDED_GR_AUDIO_API_H +#define INCLUDED_GR_AUDIO_API_H -#include <dial_tone.h> +#ifdef gnuradio_audio_EXPORTS +# define GR_AUDIO_API //FIXME needs attributes defines +#else +# define GR_AUDIO_API //FIXME needs attributes defines +#endif -int main() -{ - dial_tone_sptr top_block = make_dial_tone(); - top_block->run(); - return 0; -} +#endif /* INCLUDED_GR_AUDIO_API_H */ diff --git a/gr-audio/include/gr_audio_sink.h b/gr-audio/include/gr_audio_sink.h new file mode 100644 index 000000000..ca3b15a37 --- /dev/null +++ b/gr-audio/include/gr_audio_sink.h @@ -0,0 +1,39 @@ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_AUDIO_SINK_H +#define INCLUDED_GR_AUDIO_SINK_H + +#include <gr_audio_api.h> +#include <gr_sync_block.h> + +class GR_AUDIO_API audio_sink : virtual public gr_sync_block{ +public: + typedef boost::shared_ptr<audio_sink> sptr; +}; + +GR_AUDIO_API audio_sink::sptr audio_make_sink( + int sampling_rate, + const std::string device_name = "", + bool ok_to_block = true +); + +#endif /* INCLUDED_GR_AUDIO_SINK_H */ diff --git a/gr-audio/include/gr_audio_source.h b/gr-audio/include/gr_audio_source.h new file mode 100644 index 000000000..b8ae2ca5f --- /dev/null +++ b/gr-audio/include/gr_audio_source.h @@ -0,0 +1,39 @@ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_AUDIO_SOURCE_H +#define INCLUDED_GR_AUDIO_SOURCE_H + +#include <gr_audio_api.h> +#include <gr_sync_block.h> + +class GR_AUDIO_API audio_source : virtual public gr_sync_block{ +public: + typedef boost::shared_ptr<audio_source> sptr; +}; + +GR_AUDIO_API audio_source::sptr audio_make_source( + int sampling_rate, + const std::string device_name = "", + bool ok_to_block = true +); + +#endif /* INCLUDED_GR_AUDIO_SOURCE_H */ diff --git a/gr-audio/lib/.gitignore b/gr-audio/lib/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-audio/lib/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio/lib/Makefile.am b/gr-audio/lib/Makefile.am new file mode 100644 index 000000000..2bec73ff0 --- /dev/null +++ b/gr-audio/lib/Makefile.am @@ -0,0 +1,180 @@ +# +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/Makefile.common + +AM_CPPFLAGS = \ + $(STD_DEFINES_AND_INCLUDES) \ + $(WITH_INCLUDES) \ + -I$(abs_top_srcdir)/gr-audio/include \ + -Dgnuradio_audio_EXPORTS + +lib_LTLIBRARIES = libgnuradio-audio.la + +libgnuradio_audio_la_SOURCES = \ + gr_audio_registry.cc + +libgnuradio_audio_la_LIBADD = \ + $(GNURADIO_CORE_LA) + +libgnuradio_audio_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) + +noinst_HEADERS = gr_audio_registry.h + +etcdir = $(gr_prefsdir) +dist_etc_DATA = gr-audio.conf + +######################################################################## +## ALSA Support +######################################################################## +if GR_AUDIO_ALSA_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/alsa \ + $(ALSA_CPPFLAGS) + +libgnuradio_audio_la_LIBADD += $(ALSA_LIBS) + +libgnuradio_audio_la_SOURCES += \ + alsa/gri_alsa.cc \ + alsa/audio_alsa_source.cc \ + alsa/audio_alsa_sink.cc + +noinst_HEADERS += \ + alsa/gri_alsa.h \ + alsa/audio_alsa_source.h \ + alsa/audio_alsa_sink.h + +dist_etc_DATA += alsa/gr-audio-alsa.conf + +endif + +######################################################################## +## OSS Support +######################################################################## +if GR_AUDIO_OSS_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/oss + +libgnuradio_audio_la_LIBADD += $(OSS_LIBS) + +libgnuradio_audio_la_SOURCES += \ + oss/audio_oss_source.cc \ + oss/audio_oss_sink.cc + +noinst_HEADERS += \ + oss/audio_oss_source.h \ + oss/audio_oss_sink.h + +dist_etc_DATA += oss/gr-audio-oss.conf + +endif + +######################################################################## +## Jack Support +######################################################################## +if GR_AUDIO_JACK_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/jack \ + $(JACK_CPPFLAGS) + +libgnuradio_audio_la_LIBADD += $(JACK_LIBS) + +libgnuradio_audio_la_SOURCES += \ + jack/gri_jack.cc \ + jack/audio_jack_source.cc \ + jack/audio_jack_sink.cc + +noinst_HEADERS += \ + jack/gri_jack.h \ + jack/audio_jack_source.h \ + jack/audio_jack_sink.h + +dist_etc_DATA += jack/gr-audio-jack.conf + +endif + +######################################################################## +## OSX Support +######################################################################## +if GR_AUDIO_OSX_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/osx + +libgnuradio_audio_la_SOURCES += \ + osx/audio_osx_source.cc \ + osx/audio_osx_sink.cc + +noinst_HEADERS += \ + osx/audio_osx.h \ + osx/audio_osx_source.h \ + osx/audio_osx_sink.h \ + osx/circular_buffer.h + +endif + +######################################################################## +## PortAudio Support +######################################################################## +if GR_AUDIO_PORTAUDIO_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/portaudio \ + $(PORTAUDIO_CPPFLAGS) + +libgnuradio_audio_la_LIBADD += $(PORTAUDIO_LIBS) + +libgnuradio_audio_la_SOURCES += \ + portaudio/gri_portaudio.cc \ + portaudio/audio_portaudio_source.cc \ + portaudio/audio_portaudio_sink.cc + +noinst_HEADERS += \ + portaudio/gri_portaudio.h \ + portaudio/audio_portaudio_source.h \ + portaudio/audio_portaudio_sink.h + +dist_etc_DATA += portaudio/gr-audio-portaudio.conf + +endif + +######################################################################## +## Windows Support +######################################################################## +if GR_AUDIO_WINDOWS_SUPPORT + +AM_CPPFLAGS += \ + -I$(srcdir)/windows + +libgnuradio_audio_la_LIBADD += $(WINAUDIO_LIBS) + +libgnuradio_audio_la_SOURCES += \ + windows/audio_windows_source.cc \ + windows/audio_windows_sink.cc + +noinst_HEADERS += \ + windows/audio_windows_source.h \ + windows/audio_windows_sink.h + +endif diff --git a/gr-audio-alsa/src/audio_alsa_sink.cc b/gr-audio/lib/alsa/audio_alsa_sink.cc index d44a93b3f..5fd197ec7 100644 --- a/gr-audio-alsa/src/audio_alsa_sink.cc +++ b/gr-audio/lib/alsa/audio_alsa_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_alsa_sink.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -32,6 +33,11 @@ #include <stdexcept> #include <gri_alsa.h> +AUDIO_REGISTER_SINK(REG_PRIO_HIGH, alsa)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_sink::sptr(new audio_alsa_sink(sampling_rate, device_name, ok_to_block)); +} static bool CHATTY_DEBUG = false; @@ -65,15 +71,6 @@ default_nperiods () // ---------------------------------------------------------------- -audio_alsa_sink_sptr -audio_alsa_make_sink (int sampling_rate, - const std::string dev, - bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_alsa_sink (sampling_rate, dev, - ok_to_block)); -} - audio_alsa_sink::audio_alsa_sink (int sampling_rate, const std::string device_name, bool ok_to_block) diff --git a/gr-audio-alsa/src/audio_alsa_sink.h b/gr-audio/lib/alsa/audio_alsa_sink.h index f3007f60f..23e406d6b 100644 --- a/gr-audio-alsa/src/audio_alsa_sink.h +++ b/gr-audio/lib/alsa/audio_alsa_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -27,27 +27,11 @@ #define ALSA_PCM_NEW_HW_PARAMS_API #define ALSA_PCM_NEW_SW_PARAMS_API -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <string> #include <alsa/asoundlib.h> #include <stdexcept> - -class audio_alsa_sink; -typedef boost::shared_ptr<audio_alsa_sink> audio_alsa_sink_sptr; - -/*! - * \brief make an alsa audio sink. - * - * \param sampling_rate sampling rate in Hz - * \param device_name ALSA pcm device name, e.g., "hw:0,0" - * \param ok_to_block (currently ignored) - */ -audio_alsa_sink_sptr -audio_alsa_make_sink (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - /*! * \brief audio sink using ALSA * @@ -56,11 +40,7 @@ audio_alsa_make_sink (int sampling_rate, * * Input samples must be in the range [-1,1]. */ -class audio_alsa_sink : public gr_sync_block { - friend audio_alsa_sink_sptr - audio_alsa_make_sink (int sampling_rate, const std::string device_name, - bool ok_to_block); - +class audio_alsa_sink : public audio_sink { // typedef for pointer to class work method typedef int (audio_alsa_sink::*work_t)(int noutput_items, gr_vector_const_void_star &input_items, @@ -88,11 +68,10 @@ class audio_alsa_sink : public gr_sync_block { void output_error_msg (const char *msg, int err); void bail (const char *msg, int err) throw (std::runtime_error); - protected: +public: audio_alsa_sink (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_alsa_sink (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-alsa/src/audio_alsa_source.cc b/gr-audio/lib/alsa/audio_alsa_source.cc index 7b3d91b9d..4f0042b22 100644 --- a/gr-audio-alsa/src/audio_alsa_source.cc +++ b/gr-audio/lib/alsa/audio_alsa_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006,2010 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_alsa_source.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -32,6 +33,11 @@ #include <stdexcept> #include <gri_alsa.h> +AUDIO_REGISTER_SOURCE(REG_PRIO_HIGH, alsa)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_source::sptr(new audio_alsa_source(sampling_rate, device_name, ok_to_block)); +} static bool CHATTY_DEBUG = false; @@ -64,14 +70,6 @@ default_nperiods () // ---------------------------------------------------------------- -audio_alsa_source_sptr -audio_alsa_make_source (int sampling_rate, const std::string dev, - bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_alsa_source (sampling_rate, dev, - ok_to_block)); -} - audio_alsa_source::audio_alsa_source (int sampling_rate, const std::string device_name, bool ok_to_block) diff --git a/gr-audio-alsa/src/audio_alsa_source.h b/gr-audio/lib/alsa/audio_alsa_source.h index db6c45683..e38af3872 100644 --- a/gr-audio-alsa/src/audio_alsa_source.h +++ b/gr-audio/lib/alsa/audio_alsa_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -27,7 +27,7 @@ #define ALSA_PCM_NEW_HW_PARAMS_API #define ALSA_PCM_NEW_SW_PARAMS_API -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <string> #include <alsa/asoundlib.h> #include <stdexcept> @@ -36,18 +36,6 @@ class audio_alsa_source; typedef boost::shared_ptr<audio_alsa_source> audio_alsa_source_sptr; /*! - * \brief Make an ALSA audio source. - * - * \param sampling_rate sampling rate - * \param device_name ALSA pcm device name, e.g., "hw:0,0" - * \param ok_to_block (currently ignored) - */ -audio_alsa_source_sptr -audio_alsa_make_source (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - -/*! * \brief audio source using ALSA * * The source has between 1 and N input streams of floats, where N is @@ -55,12 +43,7 @@ audio_alsa_make_source (int sampling_rate, * * Output samples will be in the range [-1,1]. */ -class audio_alsa_source : public gr_sync_block { - friend audio_alsa_source_sptr - audio_alsa_make_source (int sampling_rate, - const std::string device_name, - bool ok_to_block); - +class audio_alsa_source : public audio_source { // typedef for pointer to class work method typedef int (audio_alsa_source::*work_t)(int noutput_items, gr_vector_const_void_star &input_items, @@ -88,11 +71,10 @@ class audio_alsa_source : public gr_sync_block { void output_error_msg (const char *msg, int err); void bail (const char *msg, int err) throw (std::runtime_error); - protected: +public: audio_alsa_source (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_alsa_source (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-alsa/gr-audio-alsa.conf b/gr-audio/lib/alsa/gr-audio-alsa.conf index 5cec63e7a..5cec63e7a 100644 --- a/gr-audio-alsa/gr-audio-alsa.conf +++ b/gr-audio/lib/alsa/gr-audio-alsa.conf diff --git a/gr-audio-alsa/src/gri_alsa.cc b/gr-audio/lib/alsa/gri_alsa.cc index d9fda0f7d..d9fda0f7d 100644 --- a/gr-audio-alsa/src/gri_alsa.cc +++ b/gr-audio/lib/alsa/gri_alsa.cc diff --git a/gr-audio-alsa/src/gri_alsa.h b/gr-audio/lib/alsa/gri_alsa.h index 3d72fd950..3d72fd950 100644 --- a/gr-audio-alsa/src/gri_alsa.h +++ b/gr-audio/lib/alsa/gri_alsa.h diff --git a/gr-audio/lib/gr-audio.conf b/gr-audio/lib/gr-audio.conf new file mode 100644 index 000000000..e0d9221c3 --- /dev/null +++ b/gr-audio/lib/gr-audio.conf @@ -0,0 +1,12 @@ +# This file contains system wide configuration data for GNU Radio. +# You may override any setting on a per-user basis by editing +# ~/.gnuradio/config.conf + +# specify which audio module to load, or use "auto" to have the system +# select one. Valid choices depend on your OS and which modules +# you've installed, but typically include: +# auto, alsa, oss, portaudio, jack, osx, windows + +[audio] + +audio_module = auto diff --git a/gr-audio/lib/gr_audio_registry.cc b/gr-audio/lib/gr_audio_registry.cc new file mode 100644 index 000000000..da4b16b35 --- /dev/null +++ b/gr-audio/lib/gr_audio_registry.cc @@ -0,0 +1,132 @@ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "gr_audio_registry.h" +#include <boost/foreach.hpp> +#include <gr_prefs.h> +#include <stdexcept> +#include <vector> +#include <iostream> + +/*********************************************************************** + * Create registries + **********************************************************************/ + +struct source_entry_t{ + reg_prio_type prio; + std::string arch; + source_factory_t source; +}; + +static std::vector<source_entry_t> &get_source_registry(void){ + static std::vector<source_entry_t> _registry; + return _registry; +} + +struct sink_entry_t{ + reg_prio_type prio; + std::string arch; + sink_factory_t sink; +}; + +static std::vector<sink_entry_t> &get_sink_registry(void){ + static std::vector<sink_entry_t> _registry; + return _registry; +} + +/*********************************************************************** + * Register functions + **********************************************************************/ +void audio_register_source( + reg_prio_type prio, const std::string &arch, source_factory_t source +){ + source_entry_t entry; + entry.prio = prio; + entry.arch = arch; + entry.source = source; + get_source_registry().push_back(entry); +} + +void audio_register_sink( + reg_prio_type prio, const std::string &arch, sink_factory_t sink +){ + sink_entry_t entry; + entry.prio = prio; + entry.arch = arch; + entry.sink = sink; + get_sink_registry().push_back(entry); +} + +/*********************************************************************** + * Factory functions + **********************************************************************/ +static std::string default_arch_name(void){ + return gr_prefs::singleton()->get_string("audio", "audio_module", "auto"); +} + +static void do_arch_warning(const std::string &arch){ + if (arch == "auto") return; //no warning when arch not specified + std::cerr << "Could not find audio architecture \"" << arch << "\" in registry." << std::endl; + std::cerr << " Defaulting to the first available architecture..." << std::endl; +} + +audio_source::sptr audio_make_source( + int sampling_rate, + const std::string device_name, + bool ok_to_block +){ + if (get_source_registry().empty()){ + throw std::runtime_error("no available audio source factories"); + } + + std::string arch = default_arch_name(); + source_entry_t entry = get_source_registry().front(); + + BOOST_FOREACH(const source_entry_t &e, get_source_registry()){ + if (e.prio > entry.prio) entry = e; //entry is highest prio + if (arch != e.arch) continue; //continue when no match + return e.source(sampling_rate, device_name, ok_to_block); + } + //std::cout << "Audio source arch: " << entry.name << std::endl; + return entry.source(sampling_rate, device_name, ok_to_block); +} + +audio_sink::sptr audio_make_sink( + int sampling_rate, + const std::string device_name, + bool ok_to_block +){ + if (get_sink_registry().empty()){ + throw std::runtime_error("no available audio sink factories"); + } + + std::string arch = default_arch_name(); + sink_entry_t entry = get_sink_registry().front(); + + BOOST_FOREACH(const sink_entry_t &e, get_sink_registry()){ + if (e.prio > entry.prio) entry = e; //entry is highest prio + if (arch != e.arch) continue; //continue when no match + return e.sink(sampling_rate, device_name, ok_to_block); + } + do_arch_warning(arch); + //std::cout << "Audio sink arch: " << entry.name << std::endl; + return entry.sink(sampling_rate, device_name, ok_to_block); +} diff --git a/gr-audio/lib/gr_audio_registry.h b/gr-audio/lib/gr_audio_registry.h new file mode 100644 index 000000000..ec341e95e --- /dev/null +++ b/gr-audio/lib/gr_audio_registry.h @@ -0,0 +1,55 @@ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_AUDIO_REGISTRY_H +#define INCLUDED_GR_AUDIO_REGISTRY_H + +#include <gr_audio_sink.h> +#include <gr_audio_source.h> +#include <string> + +typedef audio_source::sptr(*source_factory_t)(int, const std::string &, bool); +typedef audio_sink::sptr(*sink_factory_t)(int, const std::string &, bool); + +enum reg_prio_type{ + REG_PRIO_LOW = 100, + REG_PRIO_MED = 200, + REG_PRIO_HIGH = 300 +}; + +void audio_register_source(reg_prio_type prio, const std::string &arch, source_factory_t source); +void audio_register_sink(reg_prio_type prio, const std::string &arch, sink_factory_t sink); + +#define AUDIO_REGISTER_FIXTURE(x) static struct x{x();}x;x::x() + +#define AUDIO_REGISTER_SOURCE(prio, arch) \ + static audio_source::sptr arch##_source_fcn(int, const std::string &, bool); \ + AUDIO_REGISTER_FIXTURE(arch##_source_reg){ \ + audio_register_source(prio, #arch, &arch##_source_fcn); \ + } static audio_source::sptr arch##_source_fcn + +#define AUDIO_REGISTER_SINK(prio, arch) \ + static audio_sink::sptr arch##_sink_fcn(int, const std::string &, bool); \ + AUDIO_REGISTER_FIXTURE(arch##_sink_reg){ \ + audio_register_sink(prio, #arch, &arch##_sink_fcn); \ + } static audio_sink::sptr arch##_sink_fcn + +#endif /* INCLUDED_GR_AUDIO_REGISTRY_H */ diff --git a/gr-audio-jack/src/audio_jack_sink.cc b/gr-audio/lib/jack/audio_jack_sink.cc index f28fddc34..f06e77bd5 100644 --- a/gr-audio-jack/src/audio_jack_sink.cc +++ b/gr-audio/lib/jack/audio_jack_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006,2010 Free Software Foundation, Inc. + * Copyright 2005-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_jack_sink.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -36,6 +37,12 @@ #include <pthread.h> #endif +AUDIO_REGISTER_SINK(REG_PRIO_MED, jack)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_sink::sptr(new audio_jack_sink(sampling_rate, device_name, ok_to_block)); +} + typedef jack_default_audio_sample_t sample_t; @@ -84,13 +91,6 @@ jack_sink_process (jack_nframes_t nframes, void *arg) // ---------------------------------------------------------------- -audio_jack_sink_sptr -audio_jack_make_sink(int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_jack_sink (sampling_rate, dev, - ok_to_block)); -} - audio_jack_sink::audio_jack_sink (int sampling_rate, const std::string device_name, bool ok_to_block) diff --git a/gr-audio-jack/src/audio_jack_sink.h b/gr-audio/lib/jack/audio_jack_sink.h index ac74cfc37..a11863ee0 100644 --- a/gr-audio-jack/src/audio_jack_sink.h +++ b/gr-audio/lib/jack/audio_jack_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006 Free Software Foundation, Inc. + * Copyright 2005-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -22,27 +22,12 @@ #ifndef INCLUDED_AUDIO_JACK_SINK_H #define INCLUDED_AUDIO_JACK_SINK_H -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <string> #include <jack/jack.h> #include <jack/ringbuffer.h> #include <stdexcept> -class audio_jack_sink; -typedef boost::shared_ptr<audio_jack_sink> audio_jack_sink_sptr; - -/*! - * \brief make an JACK audio sink. - * - * \param sampling_rate sampling rate in Hz - * \param device_name JACK device name, e.g., "gr_sink" - * \param ok_to_block - */ -audio_jack_sink_sptr -audio_jack_make_sink (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - int jack_sink_process (jack_nframes_t nframes, void *arg); /*! @@ -52,9 +37,7 @@ int jack_sink_process (jack_nframes_t nframes, void *arg); * * Input samples must be in the range [-1,1]. */ -class audio_jack_sink : public gr_sync_block { - friend audio_jack_sink_sptr - audio_jack_make_sink (int sampling_rate, const std::string device_name, bool ok_to_block); +class audio_jack_sink : public audio_sink { friend int jack_sink_process (jack_nframes_t nframes, void *arg); @@ -81,10 +64,9 @@ class audio_jack_sink : public gr_sync_block { void bail (const char *msg, int err) throw (std::runtime_error); - protected: +public: audio_jack_sink (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_jack_sink (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-jack/src/audio_jack_source.cc b/gr-audio/lib/jack/audio_jack_source.cc index a92e970f5..dcd41c3ac 100644 --- a/gr-audio-jack/src/audio_jack_source.cc +++ b/gr-audio/lib/jack/audio_jack_source.cc @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_jack_source.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -36,6 +37,12 @@ #include <pthread.h> #endif +AUDIO_REGISTER_SOURCE(REG_PRIO_MED, jack)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_source::sptr(new audio_jack_source(sampling_rate, device_name, ok_to_block)); +} + typedef jack_default_audio_sample_t sample_t; @@ -85,12 +92,6 @@ jack_source_process (jack_nframes_t nframes, void *arg) // ---------------------------------------------------------------- -audio_jack_source_sptr -audio_jack_make_source (int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_jack_source (sampling_rate, dev, ok_to_block)); -} - audio_jack_source::audio_jack_source (int sampling_rate, const std::string device_name, bool ok_to_block) diff --git a/gr-audio-jack/src/audio_jack_source.h b/gr-audio/lib/jack/audio_jack_source.h index 8831a7363..858f34528 100644 --- a/gr-audio-jack/src/audio_jack_source.h +++ b/gr-audio/lib/jack/audio_jack_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2006 Free Software Foundation, Inc. + * Copyright 2005-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -22,27 +22,12 @@ #ifndef INCLUDED_AUDIO_JACK_SOURCE_H #define INCLUDED_AUDIO_JACK_SOURCE_H -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <string> #include <jack/jack.h> #include <jack/ringbuffer.h> #include <stdexcept> -class audio_jack_source; -typedef boost::shared_ptr<audio_jack_source> audio_jack_source_sptr; - -/*! - * \brief make a JACK audio source. - * - * \param sampling_rate sampling rate in Hz - * \param device_name JACK device name, e.g., "gr_source" - * \param ok_to_block - */ -audio_jack_source_sptr -audio_jack_make_source (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - int jack_source_process (jack_nframes_t nframes, void *arg); /*! @@ -52,9 +37,7 @@ int jack_source_process (jack_nframes_t nframes, void *arg); * * Output samples will be in the range [-1,1]. */ -class audio_jack_source : public gr_sync_block { - friend audio_jack_source_sptr - audio_jack_make_source (int sampling_rate, const std::string device_name, bool ok_to_block); +class audio_jack_source : public audio_source { friend int jack_source_process (jack_nframes_t nframes, void *arg); @@ -81,10 +64,9 @@ class audio_jack_source : public gr_sync_block { void bail (const char *msg, int err) throw (std::runtime_error); - protected: +public: audio_jack_source (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_jack_source (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-jack/gr-audio-jack.conf b/gr-audio/lib/jack/gr-audio-jack.conf index bdbc1fd1d..bdbc1fd1d 100644 --- a/gr-audio-jack/gr-audio-jack.conf +++ b/gr-audio/lib/jack/gr-audio-jack.conf diff --git a/gr-audio-jack/src/gri_jack.cc b/gr-audio/lib/jack/gri_jack.cc index fef1c58a6..fef1c58a6 100644 --- a/gr-audio-jack/src/gri_jack.cc +++ b/gr-audio/lib/jack/gri_jack.cc diff --git a/gr-audio-jack/src/gri_jack.h b/gr-audio/lib/jack/gri_jack.h index ddc0b744d..ddc0b744d 100644 --- a/gr-audio-jack/src/gri_jack.h +++ b/gr-audio/lib/jack/gri_jack.h diff --git a/gr-audio-oss/src/audio_oss_sink.cc b/gr-audio/lib/oss/audio_oss_sink.cc index 8230ab9b6..34af16cce 100644 --- a/gr-audio-oss/src/audio_oss_sink.cc +++ b/gr-audio/lib/oss/audio_oss_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_oss_sink.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -37,6 +38,11 @@ #include <iostream> #include <stdexcept> +AUDIO_REGISTER_SINK(REG_PRIO_LOW, oss)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_sink::sptr(new audio_oss_sink(sampling_rate, device_name, ok_to_block)); +} static std::string default_device_name () @@ -44,12 +50,6 @@ default_device_name () return gr_prefs::singleton()->get_string("audio_oss", "default_output_device", "/dev/dsp"); } -audio_oss_sink_sptr -audio_oss_make_sink (int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_oss_sink (sampling_rate, dev, ok_to_block)); -} - audio_oss_sink::audio_oss_sink (int sampling_rate, const std::string device_name, bool ok_to_block) diff --git a/gr-audio-oss/src/audio_oss_sink.h b/gr-audio/lib/oss/audio_oss_sink.h index 052faac13..0d7280c2f 100644 --- a/gr-audio-oss/src/audio_oss_sink.h +++ b/gr-audio/lib/oss/audio_oss_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,18 +23,9 @@ #ifndef INCLUDED_AUDIO_OSS_SINK_H #define INCLUDED_AUDIO_OSS_SINK_H -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <string> - -class audio_oss_sink; -typedef boost::shared_ptr<audio_oss_sink> audio_oss_sink_sptr; - -audio_oss_sink_sptr -audio_oss_make_sink (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true); - /*! * \brief audio sink using OSS * @@ -42,9 +33,7 @@ audio_oss_make_sink (int sampling_rate, * Input samples must be in the range [-1,1]. */ -class audio_oss_sink : public gr_sync_block { - friend audio_oss_sink_sptr - audio_oss_make_sink (int sampling_rate, const std::string device_name, bool ok_to_block); +class audio_oss_sink : public audio_sink { int d_sampling_rate; std::string d_device_name; @@ -52,10 +41,9 @@ class audio_oss_sink : public gr_sync_block { short *d_buffer; int d_chunk_size; - protected: +public: audio_oss_sink (int sampling_rate, const std::string device_name = "", bool ok_to_block = true); - public: ~audio_oss_sink (); int work (int noutput_items, diff --git a/gr-audio-oss/src/audio_oss_source.cc b/gr-audio/lib/oss/audio_oss_source.cc index fbb898f8c..eefe4dd04 100644 --- a/gr-audio-oss/src/audio_oss_source.cc +++ b/gr-audio/lib/oss/audio_oss_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_oss_source.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -37,6 +38,11 @@ #include <iostream> #include <stdexcept> +AUDIO_REGISTER_SOURCE(REG_PRIO_LOW, oss)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_source::sptr(new audio_oss_source(sampling_rate, device_name, ok_to_block)); +} static std::string default_device_name () @@ -44,13 +50,6 @@ default_device_name () return gr_prefs::singleton()->get_string("audio_oss", "default_input_device", "/dev/dsp"); } -audio_oss_source_sptr -audio_oss_make_source (int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_oss_source (sampling_rate, dev, ok_to_block)); -} - - audio_oss_source::audio_oss_source (int sampling_rate, const std::string device_name, bool ok_to_block) diff --git a/gr-audio-oss/src/audio_oss_source.h b/gr-audio/lib/oss/audio_oss_source.h index 22d4392e2..b20ef5c05 100644 --- a/gr-audio-oss/src/audio_oss_source.h +++ b/gr-audio/lib/oss/audio_oss_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,18 +23,9 @@ #ifndef INCLUDED_AUDIO_OSS_SOURCE_H #define INCLUDED_AUDIO_OSS_SOURCE_H -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <string> - -class audio_oss_source; -typedef boost::shared_ptr<audio_oss_source> audio_oss_source_sptr; - -audio_oss_source_sptr -audio_oss_make_source (int sampling_rate, - const std::string dev = "", - bool ok_to_block = true); - /*! * \brief audio source using OSS * @@ -42,9 +33,7 @@ audio_oss_make_source (int sampling_rate, * Output samples will be in the range [-1,1]. */ -class audio_oss_source : public gr_sync_block { - friend audio_oss_source_sptr - audio_oss_make_source (int sampling_rate, const std::string device_name, bool ok_to_block); +class audio_oss_source : public audio_source { int d_sampling_rate; std::string d_device_name; @@ -52,12 +41,11 @@ class audio_oss_source : public gr_sync_block { short *d_buffer; int d_chunk_size; - protected: +public: audio_oss_source (int sampling_rate, const std::string device_name = "", bool ok_to_block = true); - public: ~audio_oss_source (); int work (int noutput_items, diff --git a/gr-audio-oss/gr-audio-oss.conf b/gr-audio/lib/oss/gr-audio-oss.conf index 6ea14d67e..6ea14d67e 100644 --- a/gr-audio-oss/gr-audio-oss.conf +++ b/gr-audio/lib/oss/gr-audio-oss.conf diff --git a/gr-audio-osx/src/audio_osx.h b/gr-audio/lib/osx/audio_osx.h index 79e79e36c..79e79e36c 100644 --- a/gr-audio-osx/src/audio_osx.h +++ b/gr-audio/lib/osx/audio_osx.h diff --git a/gr-audio-osx/src/audio_osx_sink.cc b/gr-audio/lib/osx/audio_osx_sink.cc index ec9b024e8..901881da6 100644 --- a/gr-audio-osx/src/audio_osx_sink.cc +++ b/gr-audio/lib/osx/audio_osx_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio. * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_osx_sink.h> #include <gr_io_signature.h> #include <stdexcept> @@ -31,6 +32,12 @@ #define _OSX_AU_DEBUG_ 0 +AUDIO_REGISTER_SINK(REG_PRIO_HIGH, osx)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_sink::sptr(new audio_osx_sink(sampling_rate, device_name, ok_to_block)); +} + audio_osx_sink::audio_osx_sink (int sample_rate, const std::string device_name, bool do_block, @@ -260,20 +267,6 @@ audio_osx_sink::~audio_osx_sink () d_internal = 0; } -audio_osx_sink_sptr -audio_osx_make_sink (int sampling_freq, - const std::string dev, - bool do_block, - int channel_config, - int max_sample_count) -{ - return gnuradio::get_initial_sptr(new audio_osx_sink (sampling_freq, - dev, - do_block, - channel_config, - max_sample_count)); -} - int audio_osx_sink::work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gr-audio-osx/src/audio_osx_sink.h b/gr-audio/lib/osx/audio_osx_sink.h index a1a56502c..13bd95d53 100644 --- a/gr-audio-osx/src/audio_osx_sink.h +++ b/gr-audio/lib/osx/audio_osx_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio. * @@ -23,22 +23,12 @@ #ifndef INCLUDED_AUDIO_OSX_SINK_H #define INCLUDED_AUDIO_OSX_SINK_H -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <string> #include <list> #include <AudioUnit/AudioUnit.h> #include <circular_buffer.h> -class audio_osx_sink; -typedef boost::shared_ptr<audio_osx_sink> audio_osx_sink_sptr; - -audio_osx_sink_sptr -audio_osx_make_sink (int sample_rate = 44100, - const std::string device_name = "2", - bool do_block = true, - int channel_config = -1, - int max_sample_count = -1); - /*! * \brief audio sink using OSX * @@ -46,13 +36,7 @@ audio_osx_make_sink (int sample_rate = 44100, * Input samples must be in the range [-1,1]. */ -class audio_osx_sink : public gr_sync_block { - friend audio_osx_sink_sptr - audio_osx_make_sink (int sample_rate, - const std::string device_name, - bool do_block, - int channel_config, - int max_sample_count); +class audio_osx_sink : public audio_sink { Float64 d_sample_rate; int d_channel_config; @@ -66,14 +50,13 @@ class audio_osx_sink : public gr_sync_block { // AudioUnits and Such AudioUnit d_OutputAU; -protected: +public: audio_osx_sink (int sample_rate = 44100, const std::string device_name = "2", bool do_block = true, int channel_config = -1, int max_sample_count = -1); -public: ~audio_osx_sink (); bool IsRunning (); diff --git a/gr-audio-osx/src/audio_osx_source.cc b/gr-audio/lib/osx/audio_osx_source.cc index 757e65a9e..61f8eb4a6 100644 --- a/gr-audio-osx/src/audio_osx_source.cc +++ b/gr-audio/lib/osx/audio_osx_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio. * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_osx_source.h> #include <gr_io_signature.h> #include <stdexcept> @@ -32,6 +33,12 @@ #define _OSX_AU_DEBUG_ 0 #define _OSX_DO_LISTENERS_ 0 +AUDIO_REGISTER_SOURCE(REG_PRIO_HIGH, osx)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_source::sptr(new audio_osx_source(sampling_rate, device_name, ok_to_block)); +} + void PrintStreamDesc (AudioStreamBasicDescription *inDesc) { if (inDesc == NULL) { @@ -607,20 +614,6 @@ audio_osx_source::~audio_osx_source () d_internal = 0; } -audio_osx_source_sptr -audio_osx_make_source (int sampling_freq, - const std::string device_name, - bool do_block, - int channel_config, - int max_sample_count) -{ - return gnuradio::get_initial_sptr(new audio_osx_source (sampling_freq, - device_name, - do_block, - channel_config, - max_sample_count)); -} - bool audio_osx_source::check_topology (int ninputs, int noutputs) { diff --git a/gr-audio-osx/src/audio_osx_source.h b/gr-audio/lib/osx/audio_osx_source.h index e8df47b16..a373ea94f 100644 --- a/gr-audio-osx/src/audio_osx_source.h +++ b/gr-audio/lib/osx/audio_osx_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio. * @@ -23,22 +23,12 @@ #ifndef INCLUDED_AUDIO_OSX_SOURCE_H #define INCLUDED_AUDIO_OSX_SOURCE_H -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <string> #include <AudioToolbox/AudioToolbox.h> #include <AudioUnit/AudioUnit.h> #include <circular_buffer.h> -class audio_osx_source; -typedef boost::shared_ptr<audio_osx_source> audio_osx_source_sptr; - -audio_osx_source_sptr -audio_osx_make_source (int sample_rate = 44100, - const std::string device_name = "", - bool do_block = true, - int channel_config = -1, - int max_sample_count = -1); - /*! * \brief audio source using OSX * @@ -46,13 +36,7 @@ audio_osx_make_source (int sample_rate = 44100, * Samples must be in the range [-1,1]. */ -class audio_osx_source : public gr_sync_block { - friend audio_osx_source_sptr - audio_osx_make_source (int sample_rate, - const std::string device_name, - bool do_block, - int channel_config, - int max_sample_count); +class audio_osx_source : public audio_source { Float64 d_deviceSampleRate, d_outputSampleRate; int d_channel_config; @@ -76,14 +60,13 @@ class audio_osx_source : public gr_sync_block { AudioBufferList* d_OutputBuffer; AudioConverterRef d_AudioConverter; -protected: +public: audio_osx_source (int sample_rate = 44100, const std::string device_name = "", bool do_block = true, int channel_config = -1, int max_sample_count = -1); -public: ~audio_osx_source (); bool start (); diff --git a/gr-audio-osx/src/circular_buffer.h b/gr-audio/lib/osx/circular_buffer.h index 48758bf87..48758bf87 100644 --- a/gr-audio-osx/src/circular_buffer.h +++ b/gr-audio/lib/osx/circular_buffer.h diff --git a/gr-audio-portaudio/src/audio_portaudio_sink.cc b/gr-audio/lib/portaudio/audio_portaudio_sink.cc index 64e64ccf4..7fdb99577 100644 --- a/gr-audio-portaudio/src/audio_portaudio_sink.cc +++ b/gr-audio/lib/portaudio/audio_portaudio_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_portaudio_sink.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -34,6 +35,12 @@ #include <gri_portaudio.h> #include <string.h> +AUDIO_REGISTER_SINK(REG_PRIO_MED, portaudio)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_sink::sptr(new audio_portaudio_sink(sampling_rate, device_name, ok_to_block)); +} + //#define LOGGING 0 // define to 0 or 1 #define SAMPLE_FORMAT paFloat32 @@ -120,13 +127,6 @@ portaudio_sink_callback (const void *inputBuffer, // ---------------------------------------------------------------- -audio_portaudio_sink_sptr -audio_portaudio_make_sink (int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_portaudio_sink (sampling_rate, - dev, ok_to_block)); -} - audio_portaudio_sink::audio_portaudio_sink(int sampling_rate, const std::string device_name, bool ok_to_block) diff --git a/gr-audio-portaudio/src/audio_portaudio_sink.h b/gr-audio/lib/portaudio/audio_portaudio_sink.h index 71cbfcf9f..6426a32ac 100644 --- a/gr-audio-portaudio/src/audio_portaudio_sink.h +++ b/gr-audio/lib/portaudio/audio_portaudio_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -22,7 +22,7 @@ #ifndef INCLUDED_AUDIO_PORTAUDIO_SINK_H #define INCLUDED_AUDIO_PORTAUDIO_SINK_H -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <gr_buffer.h> #include <gruel/thread.h> #include <string> @@ -30,21 +30,6 @@ #include <stdexcept> //#include <gri_logger.h> -class audio_portaudio_sink; -typedef boost::shared_ptr<audio_portaudio_sink> audio_portaudio_sink_sptr; - -/*! - * \brief PORTAUDIO audio sink. - * - * \param sampling_rate sampling rate in Hz - * \param device_name PORTAUDIO device name, e.g., "pa:" - * \param ok_to_block true if it's ok for us to block - */ -audio_portaudio_sink_sptr -audio_portaudio_make_sink (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - PaStreamCallback portaudio_sink_callback; @@ -53,11 +38,7 @@ PaStreamCallback portaudio_sink_callback; * * Input samples must be in the range [-1,1]. */ -class audio_portaudio_sink : public gr_sync_block { - friend audio_portaudio_sink_sptr - audio_portaudio_make_sink (int sampling_rate, - const std::string device_name, - bool ok_to_block); +class audio_portaudio_sink : public audio_sink { friend PaStreamCallback portaudio_sink_callback; @@ -88,11 +69,10 @@ class audio_portaudio_sink : public gr_sync_block { void create_ringbuffer(); - protected: +public: audio_portaudio_sink (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_portaudio_sink (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-portaudio/src/audio_portaudio_source.cc b/gr-audio/lib/portaudio/audio_portaudio_source.cc index e508fda22..55828ad21 100644 --- a/gr-audio-portaudio/src/audio_portaudio_source.cc +++ b/gr-audio/lib/portaudio/audio_portaudio_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_portaudio_source.h> #include <gr_io_signature.h> #include <gr_prefs.h> @@ -34,6 +35,12 @@ #include <gri_portaudio.h> #include <string.h> +AUDIO_REGISTER_SOURCE(REG_PRIO_MED, portaudio)( + int sampling_rate, const std::string &device_name, bool ok_to_block +){ + return audio_source::sptr(new audio_portaudio_source(sampling_rate, device_name, ok_to_block)); +} + //#define LOGGING 0 // define to 0 or 1 #define SAMPLE_FORMAT paFloat32 @@ -119,13 +126,6 @@ portaudio_source_callback (const void *inputBuffer, // ---------------------------------------------------------------- -audio_portaudio_source_sptr -audio_portaudio_make_source (int sampling_rate, const std::string dev, bool ok_to_block) -{ - return gnuradio::get_initial_sptr(new audio_portaudio_source (sampling_rate, - dev, ok_to_block)); -} - audio_portaudio_source::audio_portaudio_source(int sampling_rate, const std::string device_name, bool ok_to_block) diff --git a/gr-audio-portaudio/src/audio_portaudio_source.h b/gr-audio/lib/portaudio/audio_portaudio_source.h index 31e70a127..245b3410b 100644 --- a/gr-audio-portaudio/src/audio_portaudio_source.h +++ b/gr-audio/lib/portaudio/audio_portaudio_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006.2010 Free Software Foundation, Inc. + * Copyright 2006-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -22,28 +22,13 @@ #ifndef INCLUDED_AUDIO_PORTAUDIO_SOURCE_H #define INCLUDED_AUDIO_PORTAUDIO_SOURCE_H -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <gr_buffer.h> #include <gruel/thread.h> #include <string> #include <portaudio.h> #include <stdexcept> -class audio_portaudio_source; -typedef boost::shared_ptr<audio_portaudio_source> audio_portaudio_source_sptr; - -/*! - * \brief PORTAUDIO audio source. - * - * \param sampling_rate sampling rate in Hz - * \param device_name PORTAUDIO device name, e.g., "pa:" - * \param ok_to_block true if it's ok for us to block - */ -audio_portaudio_source_sptr -audio_portaudio_make_source (int sampling_rate, - const std::string device_name = "", - bool ok_to_block = true); - PaStreamCallback portaudio_source_callback; @@ -52,11 +37,7 @@ PaStreamCallback portaudio_source_callback; * * Input samples must be in the range [-1,1]. */ -class audio_portaudio_source : public gr_sync_block { - friend audio_portaudio_source_sptr - audio_portaudio_make_source (int sampling_rate, - const std::string device_name, - bool ok_to_block); +class audio_portaudio_source : public audio_source { friend PaStreamCallback portaudio_source_callback; @@ -86,11 +67,10 @@ class audio_portaudio_source : public gr_sync_block { void create_ringbuffer(); - protected: +public: audio_portaudio_source (int sampling_rate, const std::string device_name, bool ok_to_block); - public: ~audio_portaudio_source (); bool check_topology (int ninputs, int noutputs); diff --git a/gr-audio-portaudio/gr-audio-portaudio.conf b/gr-audio/lib/portaudio/gr-audio-portaudio.conf index 0dd147443..0dd147443 100644 --- a/gr-audio-portaudio/gr-audio-portaudio.conf +++ b/gr-audio/lib/portaudio/gr-audio-portaudio.conf diff --git a/gr-audio-portaudio/src/gri_portaudio.cc b/gr-audio/lib/portaudio/gri_portaudio.cc index faa472337..faa472337 100644 --- a/gr-audio-portaudio/src/gri_portaudio.cc +++ b/gr-audio/lib/portaudio/gri_portaudio.cc diff --git a/gr-audio-portaudio/src/gri_portaudio.h b/gr-audio/lib/portaudio/gri_portaudio.h index 36191e25a..36191e25a 100644 --- a/gr-audio-portaudio/src/gri_portaudio.h +++ b/gr-audio/lib/portaudio/gri_portaudio.h diff --git a/gr-audio-windows/src/audio_windows_sink.cc b/gr-audio/lib/windows/audio_windows_sink.cc index a47871954..5284ce173 100644 --- a/gr-audio-windows/src/audio_windows_sink.cc +++ b/gr-audio/lib/windows/audio_windows_sink.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* -* Copyright 2004,2010 Free Software Foundation, Inc. +* Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_windows_sink.h> #include <gr_io_signature.h> #include <sys/types.h> @@ -36,6 +37,12 @@ #include <string> #include <sstream> +AUDIO_REGISTER_SINK(REG_PRIO_HIGH, windows)( + int sampling_rate, const std::string &device_name, bool +){ + return audio_sink::sptr(new audio_windows_sink(sampling_rate, device_name)); +} + static const double CHUNK_TIME = 0.1; //0.001; // 100 ms // FIXME these should query some kind of user preference @@ -78,13 +85,6 @@ audio_windows_sink::~audio_windows_sink () delete[]d_buffer; } -audio_windows_sink_sptr -audio_windows_make_sink (int sampling_freq, const std::string dev) -{ - return gnuradio::get_initial_sptr (new audio_windows_sink (sampling_freq, dev)); -} - - int audio_windows_sink::work (int noutput_items, gr_vector_const_void_star & input_items, diff --git a/gr-audio-windows/src/audio_windows_sink.h b/gr-audio/lib/windows/audio_windows_sink.h index 2212ecf06..6819bd448 100644 --- a/gr-audio-windows/src/audio_windows_sink.h +++ b/gr-audio/lib/windows/audio_windows_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -29,16 +29,9 @@ #include <windows.h> #include <mmsystem.h> -#include <gr_sync_block.h> +#include <gr_audio_sink.h> #include <string> - -class audio_windows_sink; -typedef boost::shared_ptr <audio_windows_sink> audio_windows_sink_sptr; - -audio_windows_sink_sptr -audio_windows_make_sink (int sampling_freq, const std::string dev = ""); - /*! * \brief audio sink using winmm mmsystem (win32 only) * @@ -46,12 +39,8 @@ audio_windows_make_sink (int sampling_freq, const std::string dev = ""); * Input samples must be in the range [-1,1]. */ -class audio_windows_sink : public gr_sync_block +class audio_windows_sink : public audio_sink { - friend - audio_windows_sink_sptr - audio_windows_make_sink (int sampling_freq, const std::string device_name); - int d_sampling_freq; std::string d_device_name; int d_fd; @@ -65,13 +54,13 @@ class audio_windows_sink : public gr_sync_block protected: int string_to_int (const std::string & s); - audio_windows_sink (int sampling_freq, const std::string device_name = ""); int open_waveout_device (void); int write_waveout (HPSTR lp_data, DWORD dw_data_size); public: + audio_windows_sink (int sampling_freq, const std::string device_name = ""); ~audio_windows_sink (); int diff --git a/gr-audio-windows/src/audio_windows_source.cc b/gr-audio/lib/windows/audio_windows_source.cc index a88923afd..75b0a33bb 100644 --- a/gr-audio-windows/src/audio_windows_source.cc +++ b/gr-audio/lib/windows/audio_windows_source.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#include "gr_audio_registry.h" #include <audio_windows_source.h> #include <gr_io_signature.h> //include <sys/soundcard.h> @@ -36,6 +37,11 @@ #include <iostream> #include <stdexcept> +AUDIO_REGISTER_SOURCE(REG_PRIO_HIGH, windows)( + int sampling_rate, const std::string &device_name, bool +){ + return audio_source::sptr(new audio_windows_source(sampling_rate, device_name)); +} static const double CHUNK_TIME = 0.005; // 5 ms @@ -125,13 +131,6 @@ audio_windows_source::~audio_windows_source () */ } -audio_windows_source_sptr -audio_windows_make_source (int sampling_freq, const std::string dev) -{ - return gnuradio::get_initial_sptr (new audio_windows_source (sampling_freq, dev)); -} - - int audio_windows_source::work (int noutput_items, gr_vector_const_void_star & input_items, diff --git a/gr-audio-windows/src/audio_windows_source.h b/gr-audio/lib/windows/audio_windows_source.h index caeda36b8..36311968d 100644 --- a/gr-audio-windows/src/audio_windows_source.h +++ b/gr-audio/lib/windows/audio_windows_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,16 +23,9 @@ #ifndef INCLUDED_AUDIO_WINDOWS_SOURCE_H #define INCLUDED_AUDIO_WINDOWS_SOURCE_H -#include <gr_sync_block.h> +#include <gr_audio_source.h> #include <string> - -class audio_windows_source; -typedef boost::shared_ptr <audio_windows_source> audio_windows_source_sptr; - -audio_windows_source_sptr -audio_windows_make_source (int sampling_freq, const std::string dev = ""); - /*! * \brief audio source using winmm mmsystem (win32 only) * @@ -40,12 +33,8 @@ audio_windows_make_source (int sampling_freq, const std::string dev = ""); * Output samples will be in the range [-1,1]. */ -class audio_windows_source : public gr_sync_block +class audio_windows_source : public audio_source { - friend - audio_windows_source_sptr - audio_windows_make_source (int sampling_freq, - const std::string device_name); int d_sampling_freq; std::string d_device_name; @@ -53,10 +42,9 @@ class audio_windows_source : public gr_sync_block short *d_buffer; int d_chunk_size; -protected: +public: audio_windows_source (int sampling_freq, const std::string device_name = ""); -public: ~audio_windows_source (); int diff --git a/gr-audio/swig/.gitignore b/gr-audio/swig/.gitignore new file mode 100644 index 000000000..7fd371091 --- /dev/null +++ b/gr-audio/swig/.gitignore @@ -0,0 +1,5 @@ +/audio_swig.cc +/audio_swig.py +/Makefile +/Makefile.in +/python diff --git a/gr-audio-oss/src/Makefile.am b/gr-audio/swig/Makefile.am index 2468958b2..d95e4c5d5 100644 --- a/gr-audio-oss/src/Makefile.am +++ b/gr-audio/swig/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2005,2006,2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,54 +17,41 @@ # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# include $(top_srcdir)/Makefile.common include $(top_srcdir)/Makefile.swig -TESTS = -EXTRA_DIST += run_tests.in -DISTCLEANFILES += run_tests - -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) - - -# C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - audio_oss_sink.h \ - audio_oss_source.h +AUDIO_CPPFLAGS = -I$(abs_top_srcdir)/gr-audio/include -noinst_PYTHON = qa_oss.py +AM_CPPFLAGS = \ + $(STD_DEFINES_AND_INCLUDES) \ + $(PYTHON_CPPFLAGS) \ + $(AUDIO_CPPFLAGS) \ + $(WITH_INCLUDES) -lib_LTLIBRARIES = libgnuradio-audio-oss.la +# ---------------------------------------------------------------- +# The SWIG library -libgnuradio_audio_oss_la_SOURCES = \ - audio_oss_sink.cc \ - audio_oss_source.cc - -libgnuradio_audio_oss_la_LIBADD = \ - $(GNURADIO_CORE_LA) \ - $(OSS_LIBS) - -libgnuradio_audio_oss_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) - -################################### -# SWIG interface and library -TOP_SWIG_IFILES = \ - audio_oss.i +TOP_SWIG_IFILES = \ + audio_swig.i # Install so that they end up available as: -# import gnuradio.audio_oss +# import gnuradio.audio # This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio -audio_oss_pythondir_category = \ - gnuradio +# ${prefix}/lib/python${python_version}/site-packages/gnuradio/audio +audio_swig_pythondir_category = \ + gnuradio/audio # additional libraries for linking with the SWIG-generated library -audio_oss_la_swig_libadd = \ - libgnuradio-audio-oss.la +audio_swig_la_swig_libadd = \ + $(top_builddir)/gr-audio/lib/libgnuradio-audio.la + +# additional Python files to be installed along with the SWIG-generated one +audio_swig_python = \ + __init__.py +# additional SWIG files to be installed +audio_swig_swiginclude_headers = -if PYTHON -TESTS += run_tests -endif +audio_swig_swig_args = $(AUDIO_CPPFLAGS) diff --git a/gr-audio-jack/src/Makefile.swig.gen b/gr-audio/swig/Makefile.swig.gen index 9ca8140d4..7cdf04665 100644 --- a/gr-audio-jack/src/Makefile.swig.gen +++ b/gr-audio/swig/Makefile.swig.gen @@ -1,6 +1,6 @@ # -*- Makefile -*- # -# Copyright 2009 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,37 +20,37 @@ # Boston, MA 02110-1301, USA. # -# Makefile.swig.gen for audio_jack.i +# Makefile.swig.gen for audio_swig.i ## Default install locations for these files: ## ## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_jack +## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_swig ## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_jack +## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_swig ## ## The following can be overloaded to change the install location, but ## this has to be done in the including Makefile.am -before- ## Makefile.swig is included. -audio_jack_pythondir_category ?= gnuradio/audio_jack -audio_jack_pylibdir_category ?= $(audio_jack_pythondir_category) -audio_jack_pythondir = $(pythondir)/$(audio_jack_pythondir_category) -audio_jack_pylibdir = $(pyexecdir)/$(audio_jack_pylibdir_category) +audio_swig_pythondir_category ?= gnuradio/audio_swig +audio_swig_pylibdir_category ?= $(audio_swig_pythondir_category) +audio_swig_pythondir = $(pythondir)/$(audio_swig_pythondir_category) +audio_swig_pylibdir = $(pyexecdir)/$(audio_swig_pylibdir_category) # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -audio_jack_scmlibdir = $(libdir) +audio_swig_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_jack +# is installed, usually /usr/share/guile/site/audio_swig # FIXME: determince whether these should be installed with gnuradio. -audio_jack_scmdir = $(guiledir) +audio_swig_scmdir = $(guiledir) ## SWIG headers are always installed into the same directory. -audio_jack_swigincludedir = $(swigincludedir) +audio_swig_swigincludedir = $(swigincludedir) ## This is a template file for a "generated" Makefile addition (in ## this case, "Makefile.swig.gen"). By including the top-level @@ -75,70 +75,70 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## Makefile.am by setting the variable value there, then including ## Makefile.swig . -audio_jack_swiginclude_HEADERS = \ - audio_jack.i \ - $(audio_jack_swiginclude_headers) +audio_swig_swiginclude_HEADERS = \ + audio_swig.i \ + $(audio_swig_swiginclude_headers) if PYTHON -audio_jack_pylib_LTLIBRARIES = \ - _audio_jack.la +audio_swig_pylib_LTLIBRARIES = \ + _audio_swig.la -_audio_jack_la_SOURCES = \ - python/audio_jack.cc \ - $(audio_jack_la_swig_sources) +_audio_swig_la_SOURCES = \ + python/audio_swig.cc \ + $(audio_swig_la_swig_sources) -audio_jack_python_PYTHON = \ - audio_jack.py \ - $(audio_jack_python) +audio_swig_python_PYTHON = \ + audio_swig.py \ + $(audio_swig_python) -_audio_jack_la_LIBADD = \ +_audio_swig_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(audio_jack_la_swig_libadd) + $(audio_swig_la_swig_libadd) -_audio_jack_la_LDFLAGS = \ +_audio_swig_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_jack_la_swig_ldflags) + $(audio_swig_la_swig_ldflags) -_audio_jack_la_CXXFLAGS = \ +_audio_swig_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(audio_jack_la_swig_cxxflags) + $(audio_swig_la_swig_cxxflags) -python/audio_jack.cc: audio_jack.py -audio_jack.py: audio_jack.i +python/audio_swig.cc: audio_swig.py +audio_swig.py: audio_swig.i # Include the python dependencies for this file --include python/audio_jack.d +-include python/audio_swig.d endif # end of if python if GUILE -audio_jack_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_jack.la -libguile_gnuradio_audio_jack_la_SOURCES = \ - guile/audio_jack.cc \ - $(audio_jack_la_swig_sources) -nobase_audio_jack_scm_DATA = \ - gnuradio/audio_jack.scm \ - gnuradio/audio_jack-primitive.scm -libguile_gnuradio_audio_jack_la_LIBADD = \ +audio_swig_scmlib_LTLIBRARIES = \ + libguile-gnuradio-audio_swig.la +libguile_gnuradio_audio_swig_la_SOURCES = \ + guile/audio_swig.cc \ + $(audio_swig_la_swig_sources) +nobase_audio_swig_scm_DATA = \ + gnuradio/audio_swig.scm \ + gnuradio/audio_swig-primitive.scm +libguile_gnuradio_audio_swig_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(audio_jack_la_swig_libadd) -libguile_gnuradio_audio_jack_la_LDFLAGS = \ + $(audio_swig_la_swig_libadd) +libguile_gnuradio_audio_swig_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_jack_la_swig_ldflags) -libguile_gnuradio_audio_jack_la_CXXFLAGS = \ + $(audio_swig_la_swig_ldflags) +libguile_gnuradio_audio_swig_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(audio_jack_la_swig_cxxflags) + $(audio_swig_la_swig_cxxflags) -guile/audio_jack.cc: gnuradio/audio_jack.scm -gnuradio/audio_jack.scm: audio_jack.i -gnuradio/audio_jack-primitive.scm: gnuradio/audio_jack.scm +guile/audio_swig.cc: gnuradio/audio_swig.scm +gnuradio/audio_swig.scm: audio_swig.i +gnuradio/audio_swig-primitive.scm: gnuradio/audio_swig.scm # Include the guile dependencies for this file --include guile/audio_jack.d +-include guile/audio_swig.d endif # end of GUILE diff --git a/gr-audio-windows/Makefile.am b/gr-audio/swig/__init__.py index b3cecff96..23efda07e 100644 --- a/gr-audio-windows/Makefile.am +++ b/gr-audio/swig/__init__.py @@ -1,5 +1,5 @@ # -# Copyright 2004 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,8 +17,6 @@ # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# - -include $(top_srcdir)/Makefile.common +# -SUBDIRS = src +from audio_swig import * diff --git a/gr-audio/swig/audio_swig.i b/gr-audio/swig/audio_swig.i new file mode 100644 index 000000000..612e96d23 --- /dev/null +++ b/gr-audio/swig/audio_swig.i @@ -0,0 +1,63 @@ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + + +#define GR_AUDIO_API + +//////////////////////////////////////////////////////////////////////// +// Language independent exception handler +//////////////////////////////////////////////////////////////////////// +%include exception.i + +%exception { + try { + $action + } + catch(std::exception &e) { + SWIG_exception(SWIG_RuntimeError, e.what()); + } + catch(...) { + SWIG_exception(SWIG_RuntimeError, "Unknown exception"); + } + +} + +//////////////////////////////////////////////////////////////////////// +// standard includes +//////////////////////////////////////////////////////////////////////// +%include "gnuradio.i" + +//////////////////////////////////////////////////////////////////////// +// block headers +//////////////////////////////////////////////////////////////////////// +%{ +#include <gr_audio_source.h> +#include <gr_audio_sink.h> +%} + +//////////////////////////////////////////////////////////////////////// +// block magic +//////////////////////////////////////////////////////////////////////// +GR_SWIG_BLOCK_MAGIC(audio,source) +%include <gr_audio_source.h> + +GR_SWIG_BLOCK_MAGIC(audio,sink) +%include <gr_audio_sink.h> diff --git a/gr-howto-write-a-block/.gitignore b/gr-howto-write-a-block/.gitignore index 543c391df..16d3cf02e 100644 --- a/gr-howto-write-a-block/.gitignore +++ b/gr-howto-write-a-block/.gitignore @@ -24,3 +24,4 @@ /depcomp /ltmain.sh /install-sh +/setup_guile_test_env diff --git a/gr-howto-write-a-block/config.guess b/gr-howto-write-a-block/config.guess index dc84c68ef..187cd54ed 100755..100644 --- a/gr-howto-write-a-block/config.guess +++ b/gr-howto-write-a-block/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2009-11-20' +timestamp='2011-02-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -56,8 +56,9 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -180,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -223,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -269,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -295,7 +299,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -394,23 +398,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -480,8 +484,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -494,7 +498,7 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -551,7 +555,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -594,52 +598,52 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -730,22 +734,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -769,14 +773,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -804,14 +808,14 @@ EOF echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -866,7 +870,7 @@ EOF EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -891,7 +895,7 @@ EOF echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -959,7 +963,7 @@ EOF echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -967,6 +971,9 @@ EOF sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-tilera-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; @@ -974,7 +981,7 @@ EOF echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -983,11 +990,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1019,7 +1026,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1047,13 +1054,13 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1088,8 +1095,8 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1132,10 +1139,10 @@ EOF echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm @@ -1161,11 +1168,11 @@ EOF exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1230,6 +1237,9 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1275,13 +1285,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1321,11 +1331,11 @@ main () #include <sys/param.h> printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff --git a/gr-howto-write-a-block/config.sub b/gr-howto-write-a-block/config.sub index 2a55a5075..18b17aa46 100755..100644 --- a/gr-howto-write-a-block/config.sub +++ b/gr-howto-write-a-block/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2009-11-20' +timestamp='2011-03-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -75,8 +75,9 @@ Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,8 +124,9 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -156,8 +158,8 @@ case $os in os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -173,10 +175,10 @@ case $os in os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -281,11 +283,12 @@ case $basic_machine in | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ @@ -293,15 +296,24 @@ case $basic_machine in | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown @@ -313,6 +325,18 @@ case $basic_machine in basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -333,7 +357,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -367,25 +391,27 @@ case $basic_machine in | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -410,7 +436,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -480,11 +506,20 @@ case $basic_machine in basic_machine=powerpc-ibm os=-cnk ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -516,7 +551,7 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -732,7 +767,7 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; mingw32) @@ -839,6 +874,12 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -921,9 +962,10 @@ case $basic_machine in ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1017,6 +1059,9 @@ case $basic_machine in basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1073,17 +1118,10 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu ;; tile*) basic_machine=tile-unknown @@ -1156,6 +1194,9 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1253,11 +1294,11 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1294,7 +1335,8 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1341,7 +1383,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1390,7 +1432,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1435,6 +1477,8 @@ case $os in -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) @@ -1457,10 +1501,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1472,8 +1516,17 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1500,7 +1553,7 @@ case $basic_machine in m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1527,7 +1580,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff --git a/gr-howto-write-a-block/swig/.gitignore b/gr-howto-write-a-block/swig/.gitignore index 696b1ae84..21a9eb98c 100644 --- a/gr-howto-write-a-block/swig/.gitignore +++ b/gr-howto-write-a-block/swig/.gitignore @@ -7,3 +7,4 @@ /gnuradio /guile /python +/run_guile_tests diff --git a/gr-howto-write-a-block/version.sh b/gr-howto-write-a-block/version.sh index 0d6cc96f0..6957e2046 100644 --- a/gr-howto-write-a-block/version.sh +++ b/gr-howto-write-a-block/version.sh @@ -1,4 +1,4 @@ MAJOR_VERSION=3 API_COMPAT=4 -MINOR_VERSION=git -MAINT_VERSION=0 +MINOR_VERSION=0 +MAINT_VERSION=git diff --git a/gr-qtgui/Makefile.am b/gr-qtgui/Makefile.am index d53f96c1f..e794266cb 100644 --- a/gr-qtgui/Makefile.am +++ b/gr-qtgui/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008-2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,3 +23,8 @@ include $(top_srcdir)/Makefile.common SUBDIRS = src DIST_SUBDIRS = src + +if PYTHON +SUBDIRS += grc +DIST_SUBDIRS += grc +endif diff --git a/gr-qtgui/grc/.gitignore b/gr-qtgui/grc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-qtgui/grc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio-alsa/Makefile.am b/gr-qtgui/grc/Makefile.am index 5bd92b0ff..b3114268c 100644 --- a/gr-audio-alsa/Makefile.am +++ b/gr-qtgui/grc/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004,2006,2009 Free Software Foundation, Inc. +# Copyright 2010-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -17,14 +17,17 @@ # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# include $(top_srcdir)/Makefile.common -SUBDIRS = src - -pkgconfigdir = $(libdir)/pkgconfig -dist_pkgconfig_DATA = gnuradio-audio-alsa.pc +grcblocksdir = $(grc_blocksdir) -etcdir = $(gr_prefsdir) -dist_etc_DATA = gr-audio-alsa.conf +dist_grcblocks_DATA = \ + qtgui_check_box.xml \ + qtgui_entry.xml \ + qtgui_label.xml \ + qtgui_range.xml \ + qtgui_sink_x.xml \ + qtgui_tab_widget.xml \ + qtgui_chooser.xml diff --git a/gr-qtgui/grc/qtgui_check_box.xml b/gr-qtgui/grc/qtgui_check_box.xml new file mode 100644 index 000000000..95f4f968a --- /dev/null +++ b/gr-qtgui/grc/qtgui_check_box.xml @@ -0,0 +1,83 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Check Box: +## a gui check box form +################################################### + --> +<block> + <name>QT GUI Check Box</name> + <key>variable_qtgui_check_box</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#set $win = '_%s_check_box'%$id +#if not $label() + #set $label = '"%s"'%$id +#end if +$win = Qt.QCheckBox($label) +self._$(id)_choices = {True: $true, False: $false} +self._$(id)_choices_inv = dict((v,k) for k,v in self._$(id)_choices.iteritems()) +self._$(id)_callback = lambda i: $(win).setChecked(self._$(id)_choices_inv[i]) +self._$(id)_callback(self.$id) +$(win).stateChanged.connect(lambda i: self.set_$(id)(self._$(id)_choices[bool(i)])) +$(gui_hint()($win))</make> + <callback>self.set_$(id)($value)</callback> + <callback>self._$(id)_callback($id)</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Type</name> + <key>type</key> + <value>int</value> + <type>enum</type> + <hide>part</hide> + <option><name>Float</name><key>real</key><opt>conv:float</opt></option> + <option><name>Integer</name><key>int</key><opt>conv:int</opt></option> + <option><name>String</name><key>string</key><opt>conv:str</opt></option> + <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt></option> + <option><name>Any</name><key>raw</key><opt>conv:eval</opt></option> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>True</value> + <type>$type</type> + </param> + <param> + <name>True</name> + <key>true</key> + <value>True</value> + <type>$type</type> + </param> + <param> + <name>False</name> + <key>false</key> + <value>False</value> + <type>$type</type> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <check>$value in ($true, $false)</check> + <doc> +This block creates a variable check box. \ +Leave the label blank to use the variable id as the label. + +A check box selects between two values of similar type. \ +Te values do not necessarily need to be of boolean type. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_chooser.xml b/gr-qtgui/grc/qtgui_chooser.xml new file mode 100644 index 000000000..cb5090289 --- /dev/null +++ b/gr-qtgui/grc/qtgui_chooser.xml @@ -0,0 +1,251 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Chooser: +## A chooser, radio buttons +################################################### + --> +<block> + <name>QT GUI Chooser</name> + <key>variable_qtgui_chooser</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#slurp +#set $all_options = [$option0, $option1, $option2, $option3, $option4][:int($num_opts())] +#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_opts())] +#if not $label() + #set $label = '"%s"'%$id +#end if +######################################################################## +## Create the options list +######################################################################## +#if int($num_opts()) +self._$(id)_options = (#slurp + #for $ch in $all_options +$ch, #slurp + #end for +) +#else +self._$(id)_options = $options +#end if +######################################################################## +## Create the labels list +######################################################################## +#if int($num_opts()) +self._$(id)_labels = (#slurp + #for i, $lbl in enumerate($all_labels) + #if $lbl() +$lbl, #slurp + #else +str(self._$(id)_options[$i]), #slurp + #end if + #end for +) +#elif $labels() +self._$(id)_labels = $labels +#else +self._$(id)_labels = map(str, self._$(id)_options) +#end if +######################################################################## +## Create the combo box +######################################################################## +#if $widget() == 'combo_box' +#set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +$(win).addWidget(Qt.QLabel($label+": ")) +self._$(id)_combo_box = Qt.QComboBox() +$(win).addWidget(self._$(id)_combo_box) +for label in self._$(id)_labels: self._$(id)_combo_box.addItem(label) +self._$(id)_callback = lambda i: self._$(id)_combo_box.setCurrentIndex(self._$(id)_options.index(i)) +self._$(id)_callback(self.$id) +self._$(id)_combo_box.currentIndexChanged.connect( + lambda i: self.set_$(id)(self._$(id)_options[i])) +#end if +######################################################################## +## Create the radio buttons +######################################################################## +#if $widget() == 'radio_buttons' +#set $win = 'self._%s_group_box'%$id +$win = Qt.QGroupBox($label) +self._$(id)_box = $(orient)() +self._$(id)_button_group = Qt.QButtonGroup() +$(win).setLayout(self._$(id)_box) +for i, label in enumerate(self._$(id)_labels): + radio_button = Qt.QRadioButton(label) + self._$(id)_box.addWidget(radio_button) + self._$(id)_button_group.addButton(radio_button, i) +self._$(id)_callback = lambda i: self._$(id)_button_group.button(self._$(id)_options.index(i)).setChecked(True) +self._$(id)_callback(self.$id) +self._$(id)_button_group.buttonClicked[int].connect( + lambda i: self.set_$(id)(self._$(id)_options[i])) +#end if +$(gui_hint()($win))</make> + <callback>self.set_$(id)($value)</callback> + <callback>self._$(id)_callback($id)</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Type</name> + <key>type</key> + <value>int</value> + <type>enum</type> + <hide>part</hide> + <option><name>Float</name><key>real</key></option> + <option><name>Integer</name><key>int</key></option> + <option><name>String</name><key>string</key></option> + <option><name>Any</name><key>raw</key></option> + </param> + <param> + <name>Num Options</name> + <key>num_opts</key> + <value>3</value> + <type>enum</type> + <option><name>List</name><key>0</key></option> + <option><name>1</name><key>1</key></option> + <option><name>2</name><key>2</key></option> + <option><name>3</name><key>3</key></option> + <option><name>4</name><key>4</key></option> + <option><name>5</name><key>5</key></option> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>0</value> + <type>$type</type> + </param> + <param> + <name>Options</name> + <key>options</key> + <value>[0, 1, 2]</value> + <type>raw</type> + <hide>#if int($num_opts()) then 'all' else 'none'#</hide> + </param> + <param> + <name>Labels</name> + <key>labels</key> + <value>[]</value> + <type>raw</type> + <hide>#if int($num_opts()) then 'all' else 'none'#</hide> + </param> + <param> + <name>Option 0</name> + <key>option0</key> + <value>0</value> + <type>$type</type> + <hide>#if int($num_opts()) > 0 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 0</name> + <key>label0</key> + <value></value> + <type>string</type> + <hide>$((int($num_opts()) > 0) and ($label0() and 'none' or 'part') or 'all')</hide> + </param> + <param> + <name>Option 1</name> + <key>option1</key> + <value>1</value> + <type>$type</type> + <hide>#if int($num_opts()) > 1 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 1</name> + <key>label1</key> + <value></value> + <type>string</type> + <hide>$((int($num_opts()) > 1) and ($label1() and 'none' or 'part') or 'all')</hide> + </param> + <param> + <name>Option 2</name> + <key>option2</key> + <value>2</value> + <type>$type</type> + <hide>#if int($num_opts()) > 2 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 2</name> + <key>label2</key> + <value></value> + <type>string</type> + <hide>$((int($num_opts()) > 2) and ($label2() and 'none' or 'part') or 'all')</hide> + </param> + <param> + <name>Option 3</name> + <key>option3</key> + <value>3</value> + <type>$type</type> + <hide>#if int($num_opts()) > 3 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 3</name> + <key>label3</key> + <value></value> + <type>string</type> + <hide>$((int($num_opts()) > 3) and ($label3() and 'none' or 'part') or 'all')</hide> + </param> + <param> + <name>Option 4</name> + <key>option4</key> + <value>4</value> + <type>$type</type> + <hide>#if int($num_opts()) > 4 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 4</name> + <key>label4</key> + <value></value> + <type>string</type> + <hide>$((int($num_opts()) > 4) and ($label4() and 'none' or 'part') or 'all')</hide> + </param> + <param> + <name>Widget</name> + <key>widget</key> + <value>combo_box</value> + <type>enum</type> + <hide>part</hide> + <option><name>Combo Box</name><key>combo_box</key></option> + <option><name>Radio Buttons</name><key>radio_buttons</key></option> + </param> + <param> + <name>Orientation</name> + <key>orient</key> + <value>Qt.QVBoxLayout</value> + <type>enum</type> + <hide>#if $widget() == 'radio_buttons' then 'part' else 'all'#</hide> + <option> + <name>Horizontal</name> + <key>Qt.QHBoxLayout</key> + </option> + <option> + <name>Vertical</name> + <key>Qt.QVBoxLayout</key> + </option> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <doc> +This block creates a variable with enumerated options. \ +The gui widget is implemented as a combo box or radio button group. \ +Leave the label blank to use the variable id as the label. + +Choose the number of options available to your chooser. \ +When the label is left blank, the option will be used as the label. \ +Set the number of options to "list" to enter a single list of options and labels. \ +When the labels is an empty list, the options will be used as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_entry.xml b/gr-qtgui/grc/qtgui_entry.xml new file mode 100644 index 000000000..1a98402a0 --- /dev/null +++ b/gr-qtgui/grc/qtgui_entry.xml @@ -0,0 +1,68 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Text Entry: +## a gui text box form +################################################### + --> +<block> + <name>QT GUI Entry</name> + <key>variable_qtgui_entry</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <import>from gnuradio import eng_notation</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if not $label() + #set $label = '"%s"'%$id +#end if +$(win).addWidget(Qt.QLabel($label+": ")) +self._$(id)_line_edit = Qt.QLineEdit(str(self.$id)) +self._$(id)_tool_bar.addWidget(self._$(id)_line_edit) +self._$(id)_line_edit.returnPressed.connect( + lambda: self.set_$(id)($(type.conv)(self._$(id)_line_edit.text().toAscii()))) +$(gui_hint()($win))</make> + <callback>self.set_$(id)($value)</callback> + <callback>self._$(id)_line_edit.setText($(type.str)($id))</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Type</name> + <key>type</key> + <value>int</value> + <type>enum</type> + <hide>part</hide> + <option><name>Float</name><key>real</key><opt>conv:eng_notation.str_to_num</opt><opt>str:eng_notation.num_to_str</opt></option> + <option><name>Integer</name><key>int</key><opt>conv:int</opt><opt>str:str</opt></option> + <option><name>String</name><key>string</key><opt>conv:str</opt><opt>str:str</opt></option> + <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt><opt>str:str</opt></option> + <option><name>Any</name><key>raw</key><opt>conv:eval</opt><opt>str:repr</opt></option> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>0</value> + <type>$type</type> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <doc> +This block creates a variable with a text entry box. \ +Leave the label blank to use the variable id as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_label.xml b/gr-qtgui/grc/qtgui_label.xml new file mode 100644 index 000000000..5049118c4 --- /dev/null +++ b/gr-qtgui/grc/qtgui_label.xml @@ -0,0 +1,66 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Label Text: +## a gui static text form +################################################### + --> +<block> + <name>QT GUI Label</name> + <key>variable_qtgui_label</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <import>from gnuradio import eng_notation</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#set $win = 'self._%s_tool_bar'%$id +$win = Qt.QToolBar(self) +#if not $label() + #set $label = '"%s"'%$id +#end if +$(win).addWidget(Qt.QLabel($label+": ")) +self._$(id)_label = Qt.QLabel(str(self.$id)) +self._$(id)_tool_bar.addWidget(self._$(id)_label) +$(gui_hint()($win))</make> + <callback>self.set_$(id)($value)</callback> + <callback>self._$(id)_label.setText($(type.str)($id))</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Type</name> + <key>type</key> + <value>int</value> + <type>enum</type> + <hide>part</hide> + <option><name>Float</name><key>real</key><opt>conv:eng_notation.str_to_num</opt><opt>str:eng_notation.num_to_str</opt></option> + <option><name>Integer</name><key>int</key><opt>conv:int</opt><opt>str:str</opt></option> + <option><name>String</name><key>string</key><opt>conv:str</opt><opt>str:str</opt></option> + <option><name>Boolean</name><key>bool</key><opt>conv:bool</opt><opt>str:str</opt></option> + <option><name>Any</name><key>raw</key><opt>conv:eval</opt><opt>str:repr</opt></option> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>0</value> + <type>$type</type> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <doc> +This block creates a variable with a label widget for text. \ +Leave the label blank to use the variable id as the label. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_range.xml b/gr-qtgui/grc/qtgui_range.xml new file mode 100644 index 000000000..6b0555f98 --- /dev/null +++ b/gr-qtgui/grc/qtgui_range.xml @@ -0,0 +1,211 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Range: +## ranged widgets like a slider or a knob +################################################### + --> +<block> + <name>QT GUI Range</name> + <key>variable_qtgui_range</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <import>import PyQt4.Qwt5 as Qwt</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#set $win = 'self._%s_layout'%$id +#if not $label() + #set $label = '"%s"'%$id +#end if +######################################################################## +#if $widget() == "knob" +######################################################################## +$win = Qt.QVBoxLayout() +self._$(id)_knob = Qwt.QwtKnob() +self._$(id)_knob.setRange($start, $stop, $step) +self._$(id)_knob.setValue(self.$id) +self._$(id)_knob.valueChanged.connect(self.set_$(id)) +$(win).addWidget(self._$(id)_knob) +self._$(id)_label = Qt.QLabel($label) +self._$(id)_label.setAlignment(Qt.Qt.AlignTop | Qt.Qt.AlignHCenter) +$(win).addWidget(self._$(id)_label) +#end if +######################################################################## +#if $widget() == "thermo" +######################################################################## +$win = Qt.QVBoxLayout() +self._$(id)_label = Qt.QLabel($label) +self._$(id)_thermo = Qwt.QwtThermo() +self._$(id)_thermo.setScalePosition(Qwt.QwtThermo.$orient.scalepos) +self._$(id)_thermo.setRange($start, $stop) +self._$(id)_thermo.setValue(self.$id) +self._$(id)_thermo.$(orient.minfcn)($min_len) +#if 'horizontal' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignBottom | Qt.Qt.AlignHCenter) +$(win).addWidget(self._$(id)_label) +$(win).addWidget(self._$(id)_thermo) +#elif 'vertical' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignTop) +$(win).addWidget(self._$(id)_thermo) +$(win).addWidget(self._$(id)_label) +#end if +#end if +######################################################################## +#if $widget() == "counter" +######################################################################## +$win = Qt.QHBoxLayout() +$(win).addWidget(Qt.QLabel($label+": ")) +self._$(id)_counter = Qwt.QwtCounter() +self._$(id)_counter.setRange($start, $stop, $step) +self._$(id)_counter.setNumButtons(2) +self._$(id)_counter.setMinimumWidth($min_len) +self._$(id)_counter.setValue(self.$id) +$(win).addWidget(self._$(id)_counter) +self._$(id)_counter.valueChanged.connect(self.set_$(id)) +#end if +######################################################################## +#if $widget() == "slider" +######################################################################## +$win = Qt.QVBoxLayout() +self._$(id)_label = Qt.QLabel($label) +self._$(id)_slider = Qwt.QwtSlider(None, Qt.$orient, Qwt.QwtSlider.$orient.scalepos, Qwt.QwtSlider.BgSlot) +self._$(id)_slider.setRange($start, $stop, $step) +self._$(id)_slider.setValue(self.$id) +self._$(id)_slider.$(orient.minfcn)($min_len) +self._$(id)_slider.valueChanged.connect(self.set_$(id)) +#if 'horizontal' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignBottom | Qt.Qt.AlignHCenter) +$(win).addWidget(self._$(id)_label) +$(win).addWidget(self._$(id)_slider) +#elif 'vertical' in $orient().lower() +self._$(id)_label.setAlignment(Qt.Qt.AlignTop) +$(win).addWidget(self._$(id)_slider) +$(win).addWidget(self._$(id)_label) +#end if +#end if +######################################################################## +#if $widget() == "counter_slider" +######################################################################## +$win = Qt.QVBoxLayout() +self._$(id)_tool_bar = Qt.QToolBar(self) +$(win).addWidget(self._$(id)_tool_bar) +self._$(id)_tool_bar.addWidget(Qt.QLabel($label+": ")) +self._$(id)_counter = Qwt.QwtCounter() +self._$(id)_counter.setRange($start, $stop, $step) +self._$(id)_counter.setNumButtons(2) +self._$(id)_counter.setValue(self.$id) +self._$(id)_tool_bar.addWidget(self._$(id)_counter) +self._$(id)_counter.valueChanged.connect(self.set_$(id)) +self._$(id)_slider = Qwt.QwtSlider(None, Qt.Qt.Horizontal, Qwt.QwtSlider.BottomScale, Qwt.QwtSlider.BgSlot) +self._$(id)_slider.setRange($start, $stop, $step) +self._$(id)_slider.setValue(self.$id) +self._$(id)_slider.setMinimumWidth($min_len) +self._$(id)_slider.valueChanged.connect(self.set_$(id)) +$(win).addWidget(self._$(id)_slider) +#end if +$(gui_hint()($win))</make> + <callback>self.set_$(id)($value)</callback> + <callback>#if $widget() == "knob" +self._$(id)_knob.setValue($id) +#end if +#if $widget() == "thermo" +self._$(id)_thermo.setValue($id) +#end if +#if $widget() == "counter" +self._$(id)_counter.setValue($id) +#end if +#if $widget() == "slider" +self._$(id)_slider.setValue($id) +#end if +#if $widget() == "counter_slider" +self._$(id)_counter.setValue($id) +self._$(id)_slider.setValue($id) +#end if</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>50</value> + <type>real</type> + </param> + <param> + <name>Start</name> + <key>start</key> + <value>0</value> + <type>real</type> + </param> + <param> + <name>Stop</name> + <key>stop</key> + <value>100</value> + <type>real</type> + </param> + <param> + <name>Step</name> + <key>step</key> + <value>1</value> + <type>real</type> + </param> + <param> + <name>Widget</name> + <key>widget</key> + <value>counter_slider</value> + <type>enum</type> + <hide>part</hide> + <option><name>Counter + Slider</name><key>counter_slider</key></option> + <option><name>Counter</name><key>counter</key></option> + <option><name>Slider</name><key>slider</key></option> + <option><name>Knob</name><key>knob</key></option> + <option><name>Thermo</name><key>thermo</key></option> + </param> + <param> + <name>Orientation</name> + <key>orient</key> + <value>Qt.Horizontal</value> + <type>enum</type> + <hide>#if $widget() in ("slider", "thermo") then 'part' else 'all'#</hide> + <option> + <name>Horizontal</name> + <key>Qt.Horizontal</key> + <opt>scalepos:BottomScale</opt> + <opt>minfcn:setMinimumWidth</opt> + </option> + <option> + <name>Vertical</name> + <key>Qt.Vertical</key> + <opt>scalepos:LeftScale</opt> + <opt>minfcn:setMinimumHeight</opt> + </option> + </param> + <param> + <name>Minimum Length</name> + <key>min_len</key> + <value>200</value> + <type>int</type> + <hide>#if $widget().split('_')[0] in ("slider", "counter", "thermo") then 'part' else 'all'#</hide> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <check>$start <= $value <= $stop</check> + <check>$start < $stop</check> + <doc> +This block creates a variable with a slider. \ +Leave the label blank to use the variable id as the label. \ +The value must be a real number. \ +The value must be between the start and the stop. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml new file mode 100644 index 000000000..7a5f5ec13 --- /dev/null +++ b/gr-qtgui/grc/qtgui_sink_x.xml @@ -0,0 +1,136 @@ +<?xml version="1.0"?> +<!-- +################################################### +##QT GUI Sink +################################################### + --> +<block> + <name>QT GUI Sink</name> + <key>qtgui_sink_x</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <import>from gnuradio.qtgui import qtgui</import> + <import>from gnuradio.gr import firdes</import> + <import>import sip</import> + <make>#set $win = 'self._%s_win'%$id +qtgui.$(type.fcn)( + $fftsize, \#fftsize + $wintype, \#wintype + $fc, \#fc + $bw, \#bw + $name, \#name + $plotfreq, \#plotfreq + $plotwaterfall, \#plotwaterfall + $plotwaterfall3d, \#plotwaterfall3d + $plottime, \#plottime + $plotconst, \#plotconst +) +self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget) +$(gui_hint()($win))</make> + <callback>set_frequency_range($fc, $bw)</callback> + <param> + <name>Type</name> + <key>type</key> + <value>complex</value> + <type>enum</type> + <option><name>Complex</name><key>complex</key><opt>fcn:sink_c</opt></option> + <option><name>Float</name><key>float</key><opt>fcn:sink_f</opt></option> + </param> + <param> + <name>Name</name> + <key>name</key> + <value>QT GUI Plot</value> + <type>string</type> + </param> + <param> + <name>FFT Size</name> + <key>fftsize</key> + <value>1024</value> + <type>int</type> + </param> + <param> + <name>Window Type</name> + <key>wintype</key> + <value>firdes.WIN_BLACKMAN_hARRIS</value> + <type>int</type> + <hide>part</hide> + <option> + <name>Blackman-harris</name> + <key>firdes.WIN_BLACKMAN_hARRIS</key> + </option> + </param> + <param> + <name>Center Frequency (Hz)</name> + <key>fc</key> + <value>0</value> + <type>real</type> + </param> + <param> + <name>Bandwidth (Hz)</name> + <key>bw</key> + <value>samp_rate</value> + <type>real</type> + </param> + <param> + <name>Plot Frequency</name> + <key>plotfreq</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Waterfall</name> + <key>plotwaterfall</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Waterfall 3D</name> + <key>plotwaterfall3d</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Time</name> + <key>plottime</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Const</name> + <key>plotconst</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <sink> + <name>in</name> + <type>$type</type> + <nports>$num_inputs</nports> + </sink> + <doc> +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml new file mode 100644 index 000000000..f90054109 --- /dev/null +++ b/gr-qtgui/grc/qtgui_tab_widget.xml @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<!-- +################################################### +##WX GUI Notebook +################################################### + --> +<block> + <name>QT GUI Tab Widget</name> + <key>qtgui_tab_widget</key> + <category>QT GUI Widgets</category> + <import>from PyQt4 import Qt</import> + <make>#set $win = 'self.%s'%$id +Qt.QTabWidget() +#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_tabs())] +#for i, label in enumerate($all_labels) +self.$(id)_widget_$(i) = Qt.QWidget() +self.$(id)_layout_$(i) = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.$(id)_widget_$(i)) +self.$(id)_grid_layout_$(i) = Qt.QGridLayout() +self.$(id)_layout_$(i).addLayout(self.$(id)_grid_layout_$(i)) +$(win).addTab(self.$(id)_widget_$(i), $label) +#end for +$(gui_hint()($win))</make> + <param> + <name>Num Tabs</name> + <key>num_tabs</key> + <value>1</value> + <type>enum</type> + <option><name>1</name><key>1</key></option> + <option><name>2</name><key>2</key></option> + <option><name>3</name><key>3</key></option> + <option><name>4</name><key>4</key></option> + <option><name>5</name><key>5</key></option> + </param> + <param> + <name>Label 0</name> + <key>label0</key> + <value>Tab 0</value> + <type>string</type> + <hide>#if int($num_tabs()) > 0 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 1</name> + <key>label1</key> + <value>Tab 1</value> + <type>string</type> + <hide>#if int($num_tabs()) > 1 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 2</name> + <key>label2</key> + <value>Tab 2</value> + <type>string</type> + <hide>#if int($num_tabs()) > 2 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 3</name> + <key>label3</key> + <value>Tab 3</value> + <type>string</type> + <hide>#if int($num_tabs()) > 3 then 'none' else 'all'#</hide> + </param> + <param> + <name>Label 4</name> + <key>label4</key> + <value>Tab 4</value> + <type>string</type> + <hide>#if int($num_tabs()) > 4 then 'none' else 'all'#</hide> + </param> + <param> + <name>GUI Hint</name> + <key>gui_hint</key> + <value></value> + <type>gui_hint</type> + <hide>part</hide> + </param> + <doc> +This block creates a tabbed widget to organize other widgets. \ +The ID of this block can be used as the tab_id in the GUI hints of other widgets. + +The GUI hint can be used to position the widget within the application. \ +The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ +Both the tab specification and the grid position are optional. + </doc> +</block> diff --git a/gr-qtgui/src/lib/qtgui.h b/gr-qtgui/src/lib/qtgui.h index 6edbca12c..9831697ac 100644 --- a/gr-qtgui/src/lib/qtgui.h +++ b/gr-qtgui/src/lib/qtgui.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,30 +23,31 @@ #ifndef INCLUDED_QTGUI_H #define INCLUDED_QTGUI_H +#include <gruel/thread.h> #include <qapplication.h> #include "SpectrumGUIClass.h" class qtgui_event : public QEvent { private: - pthread_mutex_t *pmutex; + gruel::mutex &d_mutex; public: - qtgui_event(pthread_mutex_t *mut) - : QEvent((QEvent::Type)(QEvent::User+101)) + qtgui_event(gruel::mutex &mutex) + : QEvent((QEvent::Type)(QEvent::User+101)), + d_mutex(mutex) { - pmutex = mut; + //nop } void lock() { - pthread_mutex_lock(pmutex); - + d_mutex.lock(); } void unlock() { - pthread_mutex_unlock(pmutex); + d_mutex.unlock(); } }; diff --git a/gr-qtgui/src/lib/qtgui_sink_c.cc b/gr-qtgui/src/lib/qtgui_sink_c.cc index c12c451b0..05c7b28d5 100644 --- a/gr-qtgui/src/lib/qtgui_sink_c.cc +++ b/gr-qtgui/src/lib/qtgui_sink_c.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2010 Free Software Foundation, Inc. + * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -72,7 +72,6 @@ qtgui_sink_c::qtgui_sink_c (int fftsize, int wintype, } d_main_gui = NULL; - pthread_mutex_init(&d_pmutex, NULL); lock(); // Perform fftshift operation; @@ -107,12 +106,12 @@ qtgui_sink_c::forecast(int noutput_items, gr_vector_int &ninput_items_required) void qtgui_sink_c::lock() { - pthread_mutex_lock(&d_pmutex); + d_mutex.lock(); } void qtgui_sink_c::unlock() { - pthread_mutex_unlock(&d_pmutex); + d_mutex.unlock(); } @@ -151,7 +150,7 @@ qtgui_sink_c::initialize(const bool opengl) set_update_time(0.1); d_object = new qtgui_obj(d_qApplication); - qApp->postEvent(d_object, new qtgui_event(&d_pmutex)); + qApp->postEvent(d_object, new qtgui_event(d_mutex)); } @@ -289,7 +288,7 @@ qtgui_sink_c::general_work (int noutput_items, int j=0; const gr_complex *in = (const gr_complex*)input_items[0]; - pthread_mutex_lock(&d_pmutex); + gruel::scoped_lock lock(d_mutex); // Update the FFT size from the application fftresize(); @@ -322,8 +321,6 @@ qtgui_sink_c::general_work (int noutput_items, } } - pthread_mutex_unlock(&d_pmutex); - consume_each(j); return j; } diff --git a/gr-qtgui/src/lib/qtgui_sink_c.h b/gr-qtgui/src/lib/qtgui_sink_c.h index 9aee66503..bbf9983b0 100644 --- a/gr-qtgui/src/lib/qtgui_sink_c.h +++ b/gr-qtgui/src/lib/qtgui_sink_c.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009 Free Software Foundation, Inc. + * Copyright 2008,2009,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -76,7 +76,7 @@ private: double d_bandwidth; std::string d_name; - pthread_mutex_t d_pmutex; + gruel::mutex d_mutex; bool d_shift; gri_fft_complex *d_fft; diff --git a/gr-qtgui/src/lib/qtgui_sink_f.cc b/gr-qtgui/src/lib/qtgui_sink_f.cc index ab4fd082d..984c2803c 100644 --- a/gr-qtgui/src/lib/qtgui_sink_f.cc +++ b/gr-qtgui/src/lib/qtgui_sink_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2010 Free Software Foundation, Inc. + * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -72,7 +72,6 @@ qtgui_sink_f::qtgui_sink_f (int fftsize, int wintype, } d_main_gui = NULL; - pthread_mutex_init(&d_pmutex, NULL); lock(); // Perform fftshift operation; @@ -107,12 +106,12 @@ qtgui_sink_f::forecast(int noutput_items, gr_vector_int &ninput_items_required) void qtgui_sink_f::lock() { - pthread_mutex_lock(&d_pmutex); + d_mutex.lock(); } void qtgui_sink_f::unlock() { - pthread_mutex_unlock(&d_pmutex); + d_mutex.unlock(); } void @@ -146,7 +145,7 @@ qtgui_sink_f::initialize(const bool opengl) set_update_time(0.1); d_object = new qtgui_obj(d_qApplication); - qApp->postEvent(d_object, new qtgui_event(&d_pmutex)); + qApp->postEvent(d_object, new qtgui_event(d_mutex)); } void @@ -284,7 +283,7 @@ qtgui_sink_f::general_work (int noutput_items, int j=0; const float *in = (const float*)input_items[0]; - pthread_mutex_lock(&d_pmutex); + gruel::scoped_lock lock(d_mutex); // Update the FFT size from the application fftresize(); @@ -317,8 +316,6 @@ qtgui_sink_f::general_work (int noutput_items, } } - pthread_mutex_unlock(&d_pmutex); - consume_each(j); return j; } diff --git a/gr-qtgui/src/lib/qtgui_sink_f.h b/gr-qtgui/src/lib/qtgui_sink_f.h index 0cac35d90..d80a6a198 100644 --- a/gr-qtgui/src/lib/qtgui_sink_f.h +++ b/gr-qtgui/src/lib/qtgui_sink_f.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009 Free Software Foundation, Inc. + * Copyright 2008,2009,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -74,7 +74,7 @@ private: double d_bandwidth; std::string d_name; - pthread_mutex_t d_pmutex; + gruel::mutex d_mutex; bool d_shift; gri_fft_complex *d_fft; diff --git a/gr-qtgui/src/python/.gitignore b/gr-qtgui/src/python/.gitignore index b336cc7ce..604b402c5 100644 --- a/gr-qtgui/src/python/.gitignore +++ b/gr-qtgui/src/python/.gitignore @@ -1,2 +1,3 @@ /Makefile /Makefile.in +/run_tests diff --git a/gr-qtgui/src/python/Makefile.am b/gr-qtgui/src/python/Makefile.am index 31df63a44..0953a71e5 100644 --- a/gr-qtgui/src/python/Makefile.am +++ b/gr-qtgui/src/python/Makefile.am @@ -21,18 +21,25 @@ include $(top_srcdir)/Makefile.common +TESTS = +EXTRA_DIST += run_tests.in \ + qt_digital_window.ui + +if PYTHON +TESTS += run_tests +DISTCLEANFILES += run_tests + +qtguipythondir = $(grpythondir)/qtgui + noinst_PYTHON = \ pyqt_example_f.py \ pyqt_example.py \ qt_digital.py \ qt_digital_window.py \ usrp2_display.py \ - usrp_display.py - -EXTRA_DIST += \ - qt_digital_window.ui - -qtguipythondir = $(grpythondir)/qtgui + usrp_display.py \ + qa_qtgui.py -qtguipython_PYTHON = \ +qtguipython_PYTHON = \ __init__.py +endif diff --git a/gr-audio-jack/src/qa_jack.py b/gr-qtgui/src/python/qa_qtgui.py index ad6bee27b..fbf0de46e 100755 --- a/gr-audio-jack/src/qa_jack.py +++ b/gr-qtgui/src/python/qa_qtgui.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005,2010 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,20 +21,26 @@ # from gnuradio import gr, gr_unittest -import audio_jack +import qtgui +from PyQt4 import QtGui, QtCore +import sys, sip -class test_audio_jack (gr_unittest.TestCase): +class test_qtgui(gr_unittest.TestCase): def setUp (self): self.tb = gr.top_block () def tearDown (self): self.tb = None - - def test_000_nop (self): - """Just see if we can import the module... - They may not have JACK library, etc. Don't try to run anything""" - pass + def test01 (self): + pass + # Test to make sure we can instantiate these + #self.qapp = QtGui.QApplication(sys.argv) + #self.qtsnk = qtgui.sink_c(1024, gr.firdes.WIN_BLACKMAN_hARRIS, + # 0, 1, "Test", + # True, True, False, True, True) + + if __name__ == '__main__': - gr_unittest.run(test_audio_jack, "test_audio_jack.xml") + gr_unittest.run(test_qtgui, "test_qtgui.xml") diff --git a/gr-audio-oss/src/run_tests.in b/gr-qtgui/src/python/run_tests.in index b1a64c212..909194752 100644 --- a/gr-audio-oss/src/run_tests.in +++ b/gr-qtgui/src/python/run_tests.in @@ -5,6 +5,6 @@ # 3rd parameter is path to Python QA directory @top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gr-audio-oss \ - @abs_top_builddir@/gr-audio-oss \ + @abs_top_srcdir@/gr-qtgui \ + @abs_top_builddir@/gr-qtgui \ @srcdir@ diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py index 831d69fc4..8596e14a6 100644 --- a/gr-uhd/grc/gen_uhd_usrp_blocks.py +++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py @@ -65,7 +65,7 @@ self.\$(id).set_bandwidth(\$bw$(n), $n) <callback>set_bandwidth(\$bw$(n), $n)</callback> #end for <param> - <name>Input Type</name> + <name>$(direction.title())put Type</name> <key>type</key> <type>enum</type> <option> @@ -140,6 +140,7 @@ self.\$(id).set_bandwidth(\$bw$(n), $n) <key>num_mboards</key> <value>1</value> <type>int</type> + <hide>part</hide> #for $m in range(1, $max_mboards+1) <option> <name>$(m)</name> diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h index 557cb2cdb..0475957de 100644 --- a/gr-uhd/include/gr_uhd_usrp_sink.h +++ b/gr-uhd/include/gr_uhd_usrp_sink.h @@ -34,16 +34,10 @@ GR_UHD_API boost::shared_ptr<uhd_usrp_sink> uhd_make_usrp_sink( size_t num_channels ); -class GR_UHD_API uhd_usrp_sink : public gr_sync_block{ +class GR_UHD_API uhd_usrp_sink : virtual public gr_sync_block{ public: /*! - * Set the IO signature for this block. - * \param sig the input signature - */ - uhd_usrp_sink(gr_io_signature_sptr sig); - - /*! * Set the subdevice specification. * \param spec the subdev spec markup string * \param mboard the motherboard index 0 to M-1 diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h index 3b36bf45d..038f9a91e 100644 --- a/gr-uhd/include/gr_uhd_usrp_source.h +++ b/gr-uhd/include/gr_uhd_usrp_source.h @@ -34,16 +34,10 @@ GR_UHD_API boost::shared_ptr<uhd_usrp_source> uhd_make_usrp_source( size_t num_channels ); -class GR_UHD_API uhd_usrp_source : public gr_sync_block{ +class GR_UHD_API uhd_usrp_source : virtual public gr_sync_block{ public: /*! - * Set the IO signature for this block. - * \param sig the output signature - */ - uhd_usrp_source(gr_io_signature_sptr sig); - - /*! * Set the subdevice specification. * \param spec the subdev spec markup string * \param mboard the motherboard index 0 to M-1 diff --git a/gr-uhd/lib/Makefile.am b/gr-uhd/lib/Makefile.am index d93b243e2..c27682f7f 100644 --- a/gr-uhd/lib/Makefile.am +++ b/gr-uhd/lib/Makefile.am @@ -37,6 +37,6 @@ libgnuradio_uhd_la_LIBADD = \ $(GNURADIO_CORE_LA) \ $(UHD_LIBS) -libgnuradio_uhd_la_LDFLAGS = $(LTVERSIONFLAGS) +libgnuradio_uhd_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) noinst_HEADERS = diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc index 4598e54c2..d44af25ab 100644 --- a/gr-uhd/lib/gr_uhd_usrp_sink.cc +++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc @@ -24,14 +24,6 @@ #include <stdexcept> /*********************************************************************** - * UHD Multi USRP Sink - **********************************************************************/ -uhd_usrp_sink::uhd_usrp_sink(gr_io_signature_sptr sig) -:gr_sync_block("gr uhd usrp sink", sig, gr_make_io_signature(0, 0, 0)){ - /* NOP */ -} - -/*********************************************************************** * UHD Multi USRP Sink Impl **********************************************************************/ class uhd_usrp_sink_impl : public uhd_usrp_sink{ @@ -41,11 +33,14 @@ public: const uhd::io_type_t &io_type, size_t num_channels ): - uhd_usrp_sink(gr_make_io_signature( - num_channels, num_channels, io_type.size - )), + gr_sync_block( + "gr uhd usrp sink", + gr_make_io_signature(num_channels, num_channels, io_type.size), + gr_make_io_signature(0, 0, 0) + ), _type(io_type), - _nchan(num_channels) + _nchan(num_channels), + _has_time_spec(_nchan > 1) { _dev = uhd::usrp::multi_usrp::make(device_addr); } @@ -172,7 +167,7 @@ public: //send a mid-burst packet with time spec _metadata.start_of_burst = false; _metadata.end_of_burst = false; - _metadata.has_time_spec = true; + _metadata.has_time_spec = _has_time_spec; size_t num_sent = _dev->get_device()->send( input_items, noutput_items, _metadata, @@ -189,7 +184,7 @@ public: bool start(void){ _metadata.start_of_burst = true; _metadata.end_of_burst = false; - _metadata.has_time_spec = true; + _metadata.has_time_spec = _has_time_spec; _metadata.time_spec = get_time_now() + uhd::time_spec_t(0.01); _dev->get_device()->send( @@ -217,6 +212,7 @@ protected: uhd::usrp::multi_usrp::sptr _dev; const uhd::io_type_t _type; size_t _nchan; + bool _has_time_spec; uhd::tx_metadata_t _metadata; double _sample_rate; }; diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc index 09cced567..fed8e6624 100644 --- a/gr-uhd/lib/gr_uhd_usrp_source.cc +++ b/gr-uhd/lib/gr_uhd_usrp_source.cc @@ -26,14 +26,6 @@ #include <boost/format.hpp> /*********************************************************************** - * UHD Multi USRP Source - **********************************************************************/ -uhd_usrp_source::uhd_usrp_source(gr_io_signature_sptr sig) -:gr_sync_block("gr uhd usrp source", gr_make_io_signature(0, 0, 0), sig){ - /* NOP */ -} - -/*********************************************************************** * UHD Multi USRP Source Impl **********************************************************************/ class uhd_usrp_source_impl : public uhd_usrp_source{ @@ -43,10 +35,15 @@ public: const uhd::io_type_t &io_type, size_t num_channels ): - uhd_usrp_source(gr_make_io_signature( - num_channels, num_channels, io_type.size - )), - _type(io_type) + gr_sync_block( + "gr uhd usrp source", + gr_make_io_signature(0, 0, 0), + gr_make_io_signature(num_channels, num_channels, io_type.size) + ), + _type(io_type), + _nchan(num_channels), + _stream_now(_nchan == 1), + _tmp_buffs(_nchan) { _dev = uhd::usrp::multi_usrp::make(device_addr); } @@ -169,16 +166,16 @@ public: gr_vector_const_void_star &input_items, gr_vector_void_star &output_items ){ - uhd::rx_metadata_t metadata; //not passed out of this block - + //wait for a packet to become available size_t num_samps = _dev->get_device()->recv( - output_items, noutput_items, metadata, - _type, uhd::device::RECV_MODE_FULL_BUFF, 1.0 + output_items, noutput_items, _metadata, + _type, uhd::device::RECV_MODE_ONE_PACKET, 1.0 ); - switch(metadata.error_code){ + //handle possible errors conditions + switch(_metadata.error_code){ case uhd::rx_metadata_t::ERROR_CODE_NONE: - return num_samps; + break; case uhd::rx_metadata_t::ERROR_CODE_OVERFLOW: //ignore overflows and try work again @@ -187,16 +184,30 @@ public: default: std::cout << boost::format( "UHD source block got error code 0x%x" - ) % metadata.error_code << std::endl; + ) % _metadata.error_code << std::endl; return num_samps; } + + //advance the pointers and count by num_samps + noutput_items -= num_samps; + for (size_t i = 0; i < _nchan; i++){ + _tmp_buffs[i] = static_cast<char *>(output_items[i]) + num_samps*_type.size; + } + + //receive all available packets without timeout + num_samps += _dev->get_device()->recv( + _tmp_buffs, noutput_items, _metadata, + _type, uhd::device::RECV_MODE_FULL_BUFF, 0.0 + ); + + return num_samps; } bool start(void){ //setup a stream command that starts streaming slightly in the future static const double reasonable_delay = 0.1; //order of magnitude over RTT uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS); - stream_cmd.stream_now = false; + stream_cmd.stream_now = _stream_now; stream_cmd.time_spec = get_time_now() + uhd::time_spec_t(reasonable_delay); _dev->issue_stream_cmd(stream_cmd); return true; @@ -210,6 +221,10 @@ public: private: uhd::usrp::multi_usrp::sptr _dev; const uhd::io_type_t _type; + size_t _nchan; + bool _stream_now; + gr_vector_void_star _tmp_buffs; + uhd::rx_metadata_t _metadata; }; diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i index b814471b2..3ffcc7aea 100644 --- a/gr-uhd/swig/uhd_swig.i +++ b/gr-uhd/swig/uhd_swig.i @@ -66,6 +66,7 @@ %include <uhd/utils/pimpl.hpp> +%ignore uhd::dict::operator[]; //ignore warnings about %extend %include <uhd/types/dict.hpp> %template(string_string_dict_t) uhd::dict<std::string, std::string>; //define after dict @@ -88,6 +89,7 @@ %include <uhd/types/metadata.hpp> +%ignore uhd::device::register_device; //causes compile to choke in MSVC %include <uhd/device.hpp> %template(device_addr_vector_t) std::vector<uhd::device_addr_t>; diff --git a/gr-usrp/Makefile.am b/gr-usrp/Makefile.am index 221a10816..be4035dd4 100644 --- a/gr-usrp/Makefile.am +++ b/gr-usrp/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004 Free Software Foundation, Inc. +# Copyright 2004,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -27,5 +27,9 @@ EXTRA_DIST += \ SUBDIRS = src apps +if PYTHON +SUBDIRS += grc +endif + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gnuradio-usrp.pc diff --git a/gr-usrp/apps/Makefile.am b/gr-usrp/apps/Makefile.am index 0f3a21bb4..c3955ad9d 100644 --- a/gr-usrp/apps/Makefile.am +++ b/gr-usrp/apps/Makefile.am @@ -33,6 +33,8 @@ GR_USRP_LA=$(top_builddir)/gr-usrp/src/libgnuradio-usrp.la # For compiling outside the tree, these will get fished out by pkgconfig LDADD = \ + $(GNURADIO_CORE_LA) \ + $(USRP_LA) \ $(GR_USRP_LA) \ $(BOOST_LDFLAGS) \ $(BOOST_PROGRAM_OPTIONS_LIB) diff --git a/gr-usrp/grc/.gitignore b/gr-usrp/grc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-usrp/grc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-usrp/grc/Makefile.am b/gr-usrp/grc/Makefile.am new file mode 100644 index 000000000..11a5f40dc --- /dev/null +++ b/gr-usrp/grc/Makefile.am @@ -0,0 +1,42 @@ +# +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/Makefile.common + +usrp_pythondir = $(pythondir)/grc_gnuradio/usrp +usrp_python_PYTHON = \ + __init__.py \ + common.py \ + dual_usrp.py \ + simple_usrp.py + +dist_bin_SCRIPTS = usrp_probe + +grcblocksdir = $(grc_blocksdir) +dist_grcblocks_DATA = \ + usrp_dual_sink_x.xml \ + usrp_simple_sink_x.xml \ + usrp_dual_source_x.xml \ + usrp_simple_source_x.xml \ + usrp_probe.xml + +ourdatadir = $(pkgdatadir)/grc/freedesktop +dist_ourdata_DATA = gnuradio-usrp_probe.desktop diff --git a/grc/grc_gnuradio/usrp/__init__.py b/gr-usrp/grc/__init__.py index 1956bbd5b..1956bbd5b 100644 --- a/grc/grc_gnuradio/usrp/__init__.py +++ b/gr-usrp/grc/__init__.py diff --git a/grc/grc_gnuradio/usrp/common.py b/gr-usrp/grc/common.py index 65c1e7e29..65c1e7e29 100644 --- a/grc/grc_gnuradio/usrp/common.py +++ b/gr-usrp/grc/common.py diff --git a/grc/grc_gnuradio/usrp/dual_usrp.py b/gr-usrp/grc/dual_usrp.py index 66b76b2df..66b76b2df 100644 --- a/grc/grc_gnuradio/usrp/dual_usrp.py +++ b/gr-usrp/grc/dual_usrp.py diff --git a/grc/freedesktop/gnuradio-usrp_probe.desktop b/gr-usrp/grc/gnuradio-usrp_probe.desktop index 136321994..136321994 100644 --- a/grc/freedesktop/gnuradio-usrp_probe.desktop +++ b/gr-usrp/grc/gnuradio-usrp_probe.desktop diff --git a/grc/grc_gnuradio/usrp/simple_usrp.py b/gr-usrp/grc/simple_usrp.py index fb7a39570..fb7a39570 100644 --- a/grc/grc_gnuradio/usrp/simple_usrp.py +++ b/gr-usrp/grc/simple_usrp.py diff --git a/grc/blocks/usrp_dual_sink_x.xml b/gr-usrp/grc/usrp_dual_sink_x.xml index 4539b62f9..babc124d0 100644 --- a/grc/blocks/usrp_dual_sink_x.xml +++ b/gr-usrp/grc/usrp_dual_sink_x.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>USRP Dual Sink</name> + <name>USRP1 Dual Sink</name> <key>usrp_dual_sink_x</key> + <category>USRP</category> <import>from grc_gnuradio import usrp as grc_usrp</import> <make>grc_usrp.dual_sink_$(type.fcn)(which=$which) self.$(id).set_interp_rate($interpolation) diff --git a/grc/blocks/usrp_dual_source_x.xml b/gr-usrp/grc/usrp_dual_source_x.xml index 07d3174bb..4e1fa81d8 100644 --- a/grc/blocks/usrp_dual_source_x.xml +++ b/gr-usrp/grc/usrp_dual_source_x.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>USRP Dual Source</name> + <name>USRP1 Dual Source</name> <key>usrp_dual_source_x</key> + <category>USRP</category> <import>from grc_gnuradio import usrp as grc_usrp</import> <make>grc_usrp.dual_source_$(type.fcn)( which=$which, diff --git a/grc/scripts/usrp_probe b/gr-usrp/grc/usrp_probe index d2e92e753..d2e92e753 100755 --- a/grc/scripts/usrp_probe +++ b/gr-usrp/grc/usrp_probe diff --git a/grc/blocks/usrp_probe.xml b/gr-usrp/grc/usrp_probe.xml index ee207c28d..ee207c28d 100644 --- a/grc/blocks/usrp_probe.xml +++ b/gr-usrp/grc/usrp_probe.xml diff --git a/grc/blocks/usrp_simple_sink_x.xml b/gr-usrp/grc/usrp_simple_sink_x.xml index b52cd4880..e52b5f047 100644 --- a/grc/blocks/usrp_simple_sink_x.xml +++ b/gr-usrp/grc/usrp_simple_sink_x.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>USRP Sink</name> + <name>USRP1 Sink</name> <key>usrp_simple_sink_x</key> + <category>USRP</category> <import>from grc_gnuradio import usrp as grc_usrp</import> <make>grc_usrp.simple_sink_$(type.fcn)(which=$which, side=$side) self.$(id).set_interp_rate($interpolation) diff --git a/grc/blocks/usrp_simple_source_x.xml b/gr-usrp/grc/usrp_simple_source_x.xml index 7fcc7a22c..a79c78c20 100644 --- a/grc/blocks/usrp_simple_source_x.xml +++ b/gr-usrp/grc/usrp_simple_source_x.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>USRP Source</name> + <name>USRP1 Source</name> <key>usrp_simple_source_x</key> + <category>USRP</category> <import>from grc_gnuradio import usrp as grc_usrp</import> <make>grc_usrp.simple_source_$(type.fcn)(which=$which, side=$side, rx_ant=$rx_ant#if $hb_filters() then ', no_hb=True' else ''#) #if $format() diff --git a/gr-usrp/src/Makefile.am b/gr-usrp/src/Makefile.am index a0c6b7a82..29cedc96a 100644 --- a/gr-usrp/src/Makefile.am +++ b/gr-usrp/src/Makefile.am @@ -86,6 +86,7 @@ usrp_swig_pythondir_category = \ # additional arguments to the SWIG command usrp_swig_swig_args = \ + $(DEFAULT_INCLUDES) \ $(USRP_INCLUDES) # additional libraries for linking with the SWIG-generated library diff --git a/gr-usrp/src/usrp_swig.i b/gr-usrp/src/usrp_swig.i index b1797d758..80d59abc9 100644 --- a/gr-usrp/src/usrp_swig.i +++ b/gr-usrp/src/usrp_swig.i @@ -23,6 +23,7 @@ %include "gnuradio.i" // the common stuff %{ +#include "config.h" // for NOMINMAX #include <vector> %} diff --git a/gr-usrp2/Makefile.am b/gr-usrp2/Makefile.am index 2a0fbe203..f6120884a 100644 --- a/gr-usrp2/Makefile.am +++ b/gr-usrp2/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2001,2006,2008,2009 Free Software Foundation, Inc. +# Copyright 2001,2006,2008,2009,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,5 +23,9 @@ include $(top_srcdir)/Makefile.common SUBDIRS = src +if PYTHON +SUBDIRS += grc +endif + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gnuradio-usrp2.pc diff --git a/gr-usrp2/grc/.gitignore b/gr-usrp2/grc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-usrp2/grc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-usrp2/grc/Makefile.am b/gr-usrp2/grc/Makefile.am new file mode 100644 index 000000000..2502bf363 --- /dev/null +++ b/gr-usrp2/grc/Makefile.am @@ -0,0 +1,33 @@ +# +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/Makefile.common + +dist_bin_SCRIPTS = usrp2_probe + +grcblocksdir = $(grc_blocksdir) +dist_grcblocks_DATA = \ + usrp2_probe.xml \ + usrp2_source_xxxx.xml \ + usrp2_sink_xxxx.xml + +ourdatadir = $(pkgdatadir)/grc/freedesktop +dist_ourdata_DATA = gnuradio-usrp2_probe.desktop diff --git a/grc/freedesktop/gnuradio-usrp2_probe.desktop b/gr-usrp2/grc/gnuradio-usrp2_probe.desktop index c71a092b1..c71a092b1 100644 --- a/grc/freedesktop/gnuradio-usrp2_probe.desktop +++ b/gr-usrp2/grc/gnuradio-usrp2_probe.desktop diff --git a/grc/scripts/usrp2_probe b/gr-usrp2/grc/usrp2_probe index 38c8f655c..38c8f655c 100755 --- a/grc/scripts/usrp2_probe +++ b/gr-usrp2/grc/usrp2_probe diff --git a/grc/blocks/usrp2_probe.xml b/gr-usrp2/grc/usrp2_probe.xml index cc3f9c2fd..cc3f9c2fd 100644 --- a/grc/blocks/usrp2_probe.xml +++ b/gr-usrp2/grc/usrp2_probe.xml diff --git a/grc/blocks/usrp2_sink_xxxx.xml b/gr-usrp2/grc/usrp2_sink_xxxx.xml index f9fb25361..74995da99 100644 --- a/grc/blocks/usrp2_sink_xxxx.xml +++ b/gr-usrp2/grc/usrp2_sink_xxxx.xml @@ -8,6 +8,7 @@ <block> <name>USRP2 Sink</name> <key>usrp2_sink_xxxx</key> + <category>USRP</category> <import>from gnuradio import usrp2</import> <make>#if not $interface() and not $mac_addr() usrp2.sink_$(type.fcn)() diff --git a/grc/blocks/usrp2_source_xxxx.xml b/gr-usrp2/grc/usrp2_source_xxxx.xml index 584199798..a23c5bc5c 100644 --- a/grc/blocks/usrp2_source_xxxx.xml +++ b/gr-usrp2/grc/usrp2_source_xxxx.xml @@ -8,6 +8,7 @@ <block> <name>USRP2 Source</name> <key>usrp2_source_xxxx</key> + <category>USRP</category> <import>from gnuradio import usrp2</import> <make>#if not $interface() and not $mac_addr() usrp2.source_$(type.fcn)() diff --git a/gr-utils/src/python/gr_filter_design.py b/gr-utils/src/python/gr_filter_design.py index bf83cf69f..e8703db4f 100755 --- a/gr-utils/src/python/gr_filter_design.py +++ b/gr-utils/src/python/gr_filter_design.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -import sys, os +import sys, os, re, csv from optparse import OptionParser from gnuradio import gr, blks2, eng_notation @@ -24,7 +24,7 @@ except ImportError: raise SystemExit, 1 try: - from pyqt_filter import Ui_MainWindow + from gnuradio.pyqt_filter import Ui_MainWindow except ImportError: print "Could not import from pyqt_filter. Please build with \"pyuic4 pyqt_filter.ui -o pyqt_filter.py\"" raise SystemExit, 1 @@ -36,6 +36,14 @@ class gr_plot_filter(QtGui.QMainWindow): self.gui = Ui_MainWindow() self.gui.setupUi(self) + self.connect(self.gui.action_save, + Qt.SIGNAL("activated()"), + self.action_save_dialog) + self.connect(self.gui.action_open, + Qt.SIGNAL("activated()"), + self.action_open_dialog) + + self.connect(self.gui.filterTypeComboBox, Qt.SIGNAL("currentIndexChanged(const QString&)"), self.changed_filter_type) @@ -182,7 +190,7 @@ class gr_plot_filter(QtGui.QMainWindow): "Rectangular Window" : gr.firdes.WIN_RECTANGULAR, "Kaiser Window" : gr.firdes.WIN_KAISER, "Blackman-harris Window" : gr.firdes.WIN_BLACKMAN_hARRIS} - + self.EQUIRIPPLE_FILT = 6 # const for equiripple filter window types self.show() def changed_filter_type(self, ftype): @@ -295,7 +303,7 @@ class gr_plot_filter(QtGui.QMainWindow): "Complex Band Pass" : self.design_opt_cbpf, "Band Notch" : self.design_opt_bnf, "High Pass" : self.design_opt_hpf} - taps,r = designer[ftype](fs, gain) + taps,params,r = designer[ftype](fs, gain) else: designer = {"Low Pass" : self.design_win_lpf, @@ -306,17 +314,10 @@ class gr_plot_filter(QtGui.QMainWindow): "Root Raised Cosine" : self.design_win_rrc, "Gaussian" : self.design_win_gaus} wintype = self.filterWindows[winstr] - taps,r = designer[ftype](fs, gain, wintype) + taps,params,r = designer[ftype](fs, gain, wintype) if(r): - self.taps = scipy.array(taps) - self.get_fft(fs, self.taps, self.nfftpts) - self.update_time_curves() - self.update_freq_curves() - self.update_phase_curves() - self.update_group_curves() - - self.gui.nTapsEdit.setText(Qt.QString("%1").arg(self.taps.size)) + self.draw_plots(taps, params) # Filter design functions using a window @@ -334,9 +335,12 @@ class gr_plot_filter(QtGui.QMainWindow): taps = gr.firdes.low_pass_2(gain, fs, pb, tb, atten, wintype) - return (taps, ret) + params = {"fs": fs, "gain": gain, "wintype": wintype, + "filttype": "lpf", "pbend": pb, "sbstart": sb, + "atten": atten, "ntaps": len(taps)} + return (taps, params, ret) else: - return ([], ret) + return ([], [], ret) def design_win_bpf(self, fs, gain, wintype): ret = True @@ -352,9 +356,12 @@ class gr_plot_filter(QtGui.QMainWindow): if(r): taps = gr.firdes.band_pass_2(gain, fs, pb1, pb2, tb, atten, wintype) - return (taps,r) + params = {"fs": fs, "gain": gain, "wintype": wintype, + "filttype": "bpf", "pbstart": pb1, "pbend": pb2, + "tb": tb, "atten": atten, "ntaps": len(taps)} + return (taps,params,r) else: - return ([],r) + return ([],[],r) def design_win_cbpf(self, fs, gain, wintype): ret = True @@ -370,9 +377,12 @@ class gr_plot_filter(QtGui.QMainWindow): if(r): taps = gr.firdes.complex_band_pass_2(gain, fs, pb1, pb2, tb, atten, wintype) - return (taps,r) + params = {"fs": fs, "gain": gain, "wintype": wintype, + "filttype": "cbpf", "pbstart": pb1, "pbend": pb2, + "tb": tb, "atten": atten, "ntaps": len(taps)} + return (taps,params,r) else: - return ([],r) + return ([],[],r) def design_win_bnf(self, fs, gain, wintype): ret = True @@ -388,9 +398,12 @@ class gr_plot_filter(QtGui.QMainWindow): if(r): taps = gr.firdes.band_reject_2(gain, fs, pb1, pb2, tb, atten, wintype) - return (taps,r) + params = {"fs": fs, "gain": gain, "wintype": wintype, + "filttype": "bnf", "sbstart": pb1, "sbend": pb2, + "tb": tb, "atten": atten, "ntaps": len(taps)} + return (taps,params,r) else: - return ([],r) + return ([],[],r) def design_win_hpf(self, fs, gain, wintype): ret = True @@ -405,9 +418,12 @@ class gr_plot_filter(QtGui.QMainWindow): tb = pb - sb taps = gr.firdes.high_pass_2(gain, fs, pb, tb, atten, wintype) - return (taps,r) + params = {"fs": fs, "gain": gain, "wintype": wintype, + "filttype": "hpf", "sbend": sb, "pbstart": pb, + "atten": atten, "ntaps": len(taps)} + return (taps,params,r) else: - return ([],r) + return ([],[],r) def design_win_rrc(self, fs, gain, wintype): ret = True @@ -421,9 +437,12 @@ class gr_plot_filter(QtGui.QMainWindow): if(r): taps = gr.firdes.root_raised_cosine(gain, fs, sr, alpha, ntaps) - return (taps,r) + params = {"fs": fs, "gain": gain, "wintype": wintype, + "filttype": "rrc", "srate": sr, "alpha": alpha, + "ntaps": ntaps} + return (taps,params,r) else: - return ([],r) + return ([],[],r) def design_win_gaus(self, fs, gain, wintype): ret = True @@ -437,9 +456,12 @@ class gr_plot_filter(QtGui.QMainWindow): if(r): spb = fs / sr taps = gr.firdes.gaussian(gain, spb, bt, ntaps) - return (taps,r) + params = {"fs": fs, "gain": gain, "wintype": wintype, + "filttype": "gaus", "srate": sr, "bt": bt, + "ntaps": ntaps} + return (taps,params,r) else: - return ([],r) + return ([],[],r) # Design Functions for Equiripple Filters def design_opt_lpf(self, fs, gain): @@ -454,11 +476,20 @@ class gr_plot_filter(QtGui.QMainWindow): ret = r and ret if(ret): - taps = blks2.optfir.low_pass(gain, fs, pb, sb, - ripple, atten) - return (taps, ret) + try: + taps = blks2.optfir.low_pass(gain, fs, pb, sb, + ripple, atten) + except RuntimeError, e: + reply = QtGui.QMessageBox.information(self, "Filter did not converge", + e.args[0], "&Ok") + return ([],[],False) + else: + params = {"fs": fs, "gain": gain, "wintype": self.EQUIRIPPLE_FILT, + "filttype": "lpf", "pbend": pb, "sbstart": sb, + "atten": atten, "ripple": ripple, "ntaps": len(taps)} + return (taps, params, ret) else: - return ([], ret) + return ([], [], ret) def design_opt_bpf(self, fs, gain): ret = True @@ -476,11 +507,22 @@ class gr_plot_filter(QtGui.QMainWindow): if(r): sb1 = pb1 - tb sb2 = pb2 + tb - taps = blks2.optfir.band_pass(gain, fs, sb1, pb1, pb2, sb2, - ripple, atten) - return (taps,r) + try: + taps = blks2.optfir.band_pass(gain, fs, sb1, pb1, pb2, sb2, + ripple, atten) + except RuntimeError, e: + reply = QtGui.QMessageBox.information(self, "Filter did not converge", + e.args[0], "&Ok") + return ([],[],False) + + else: + params = {"fs": fs, "gain": gain, "wintype": self.EQUIRIPPLE_FILT, + "filttype": "bpf", "pbstart": pb1, "pbend": pb2, + "tb": tb, "atten": atten, "ripple": ripple, + "ntaps": len(taps)} + return (taps,params,r) else: - return ([],r) + return ([],[],r) def design_opt_cbpf(self, fs, gain): ret = True @@ -498,11 +540,21 @@ class gr_plot_filter(QtGui.QMainWindow): if(r): sb1 = pb1 - tb sb2 = pb2 + tb - taps = blks2.optfir.complex_band_pass(gain, fs, sb1, pb1, pb2, sb2, - ripple, atten) - return (taps,r) + try: + taps = blks2.optfir.complex_band_pass(gain, fs, sb1, pb1, pb2, sb2, + ripple, atten) + except RuntimeError, e: + reply = QtGui.QMessageBox.information(self, "Filter did not converge", + e.args[0], "&Ok") + return ([],[],False) + else: + params = {"fs": fs, "gain": gain, "wintype": self.EQUIRIPPLE_FILT, + "filttype": "cbpf", "pbstart": pb1, "pbend": pb2, + "tb": tb, "atten": atten, "ripple": ripple, + "ntaps": len(taps)} + return (taps,params,r) else: - return ([],r) + return ([],[],r) def design_opt_bnf(self, fs, gain): ret = True @@ -520,11 +572,21 @@ class gr_plot_filter(QtGui.QMainWindow): if(r): pb1 = sb1 - tb pb2 = sb2 + tb - taps = blks2.optfir.band_reject(gain, fs, pb1, sb1, sb2, pb2, - ripple, atten) - return (taps,r) + try: + taps = blks2.optfir.band_reject(gain, fs, pb1, sb1, sb2, pb2, + ripple, atten) + except RuntimeError, e: + reply = QtGui.QMessageBox.information(self, "Filter did not converge", + e.args[0], "&Ok") + return ([],[],False) + else: + params = {"fs": fs, "gain": gain, "wintype": self.EQUIRIPPLE_FILT, + "filttype": "bnf", "sbstart": pb1, "sbend": pb2, + "tb": tb, "atten": atten, "ripple": ripple, + "ntaps": len(taps)} + return (taps,params,r) else: - return ([],r) + return ([],[],r) def design_opt_hpf(self, fs, gain): ret = True @@ -538,11 +600,21 @@ class gr_plot_filter(QtGui.QMainWindow): ret = r and ret if(r): - taps = blks2.optfir.high_pass(gain, fs, sb, pb, - atten, ripple) - return (taps,r) + try: + taps = blks2.optfir.high_pass(gain, fs, sb, pb, + atten, ripple) + except RuntimeError, e: + reply = QtGui.QMessageBox.information(self, "Filter did not converge", + e.args[0], "&Ok") + return ([],[],False) + else: + params = {"fs": fs, "gain": gain, "wintype": self.EQUIRIPPLE_FILT, + "filttype": "hpf", "sbend": sb, "pbstart": pb, + "atten": atten, "ripple": ripple, + "ntaps": len(taps)} + return (taps,params,r) else: - return ([],r) + return ([],[],r) def nfft_edit_changed(self, nfft): infft,r = nfft.toInt() @@ -651,6 +723,135 @@ class gr_plot_filter(QtGui.QMainWindow): self.gui.groupPlot.replot() + def action_save_dialog(self): + filename = QtGui.QFileDialog.getSaveFileName(self, "Save CSV Filter File", ".", "") + try: + handle = open(filename, "wb") + except IOError: + reply = QtGui.QMessageBox.information(self, 'File Name', + ("Could not save to file: %s" % filename), + "&Ok") + return + + csvhandle = csv.writer(handle, delimiter=",") + for k in self.params.keys(): + csvhandle.writerow([k, self.params[k]]) + csvhandle.writerow(["taps",] + self.taps.tolist()) + handle.close() + + def action_open_dialog(self): + filename = QtGui.QFileDialog.getOpenFileName(self, "Open CSV Filter File", ".", "") + if(len(filename) == 0): + return + + try: + handle = open(filename, "rb") + except IOError: + reply = QtGui.QMessageBox.information(self, 'File Name', + ("Could not open file: %s" % filename), + "&Ok") + return + + csvhandle = csv.reader(handle, delimiter=",") + taps = [] + params = {} + for row in csvhandle: + if(row[0] != "taps"): + testcpx = re.findall("[+-]?\d+\.*\d*[Ee]?[-+]?\d+j", row[1]) + if(len(testcpx) > 0): # it's a complex + params[row[0]] = complex(row[1]) + else: # assume it's a float + try: # if it's not a float, its a string + params[row[0]] = float(row[1]) + except ValueError: + params[row[0]] = row[1] + else: + testcpx = re.findall("[+-]?\d+\.*\d*[Ee]?[-+]?\d+j", row[1]) + if(len(testcpx) > 0): # it's a complex + taps = [complex(r) for r in row[1:]] + else: + taps = [float(r) for r in row[1:]] + handle.close() + self.draw_plots(taps, params) + + self.gui.sampleRateEdit.setText(Qt.QString("%1").arg(params["fs"])) + self.gui.filterGainEdit.setText(Qt.QString("%1").arg(params["gain"])) + + # Set up GUI parameters for each filter type + if(params["filttype"] == "lpf"): + self.gui.filterTypeComboBox.setCurrentIndex(0) + self.gui.filterDesignTypeComboBox.setCurrentIndex(int(params["wintype"])) + + self.gui.endofLpfPassBandEdit.setText(Qt.QString("%1").arg(params["pbend"])) + self.gui.startofLpfStopBandEdit.setText(Qt.QString("%1").arg(params["sbstart"])) + self.gui.lpfStopBandAttenEdit.setText(Qt.QString("%1").arg(params["atten"])) + if(params["wintype"] == self.EQUIRIPPLE_FILT): + self.gui.lpfPassBandRippleEdit.setText(Qt.QString("%1").arg(params["ripple"])) + elif(params["filttype"] == "bpf"): + self.gui.filterTypeComboBox.setCurrentIndex(1) + self.gui.filterDesignTypeComboBox.setCurrentIndex(int(params["wintype"])) + + self.gui.startofBpfPassBandEdit.setText(Qt.QString("%1").arg(params["pbstart"])) + self.gui.endofBpfPassBandEdit.setText(Qt.QString("%1").arg(params["pbend"])) + self.gui.bpfTransitionEdit.setText(Qt.QString("%1").arg(params["tb"])) + self.gui.bpfStopBandAttenEdit.setText(Qt.QString("%1").arg(params["atten"])) + if(params["wintype"] == self.EQUIRIPPLE_FILT): + self.gui.bpfPassBandRippleEdit.setText(Qt.QString("%1").arg(params["ripple"])) + elif(params["filttype"] == "cbpf"): + self.gui.filterTypeComboBox.setCurrentIndex(2) + self.gui.filterDesignTypeComboBox.setCurrentIndex(int(params["wintype"])) + + self.gui.startofBpfPassBandEdit.setText(Qt.QString("%1").arg(params["pbstart"])) + self.gui.endofBpfPassBandEdit.setText(Qt.QString("%1").arg(params["pbend"])) + self.gui.bpfTransitionEdit.setText(Qt.QString("%1").arg(params["tb"])) + self.gui.bpfStopBandAttenEdit.setText(Qt.QString("%1").arg(params["atten"])) + if(params["wintype"] == self.EQUIRIPPLE_FILT): + self.gui.bpfPassBandRippleEdit.setText(Qt.QString("%1").arg(params["ripple"])) + elif(params["filttype"] == "bnf"): + self.gui.filterTypeComboBox.setCurrentIndex(3) + self.gui.filterDesignTypeComboBox.setCurrentIndex(int(params["wintype"])) + + self.gui.startofBnfStopBandEdit.setText(Qt.QString("%1").arg(params["sbstart"])) + self.gui.endofBnfStopBandEdit.setText(Qt.QString("%1").arg(params["sbend"])) + self.gui.bnfTransitionEdit.setText(Qt.QString("%1").arg(params["tb"])) + self.gui.bnfStopBandAttenEdit.setText(Qt.QString("%1").arg(params["atten"])) + if(params["wintype"] == self.EQUIRIPPLE_FILT): + self.gui.bnfPassBandRippleEdit.setText(Qt.QString("%1").arg(params["ripple"])) + elif(params["filttype"] == "hpf"): + self.gui.filterTypeComboBox.setCurrentIndex(4) + self.gui.filterDesignTypeComboBox.setCurrentIndex(int(params["wintype"])) + + self.gui.endofHpfStopBandEdit.setText(Qt.QString("%1").arg(params["sbend"])) + self.gui.startofHpfPassBandEdit.setText(Qt.QString("%1").arg(params["pbstart"])) + self.gui.hpfStopBandAttenEdit.setText(Qt.QString("%1").arg(params["atten"])) + if(params["wintype"] == self.EQUIRIPPLE_FILT): + self.gui.hpfPassBandRippleEdit.setText(Qt.QString("%1").arg(params["ripple"])) + elif(params["filttype"] == "rrc"): + self.gui.filterTypeComboBox.setCurrentIndex(5) + self.gui.filterDesignTypeComboBox.setCurrentIndex(int(params["wintype"])) + + self.gui.rrcSymbolRateEdit.setText(Qt.QString("%1").arg(params["srate"])) + self.gui.rrcAlphaEdit.setText(Qt.QString("%1").arg(params["alpha"])) + self.gui.rrcNumTapsEdit.setText(Qt.QString("%1").arg(params["ntaps"])) + elif(params["filttype"] == "gaus"): + self.gui.filterTypeComboBox.setCurrentIndex(6) + self.gui.filterDesignTypeComboBox.setCurrentIndex(int(params["wintype"])) + + self.gui.gausSymbolRateEdit.setText(Qt.QString("%1").arg(params["srate"])) + self.gui.gausBTEdit.setText(Qt.QString("%1").arg(params["bt"])) + self.gui.gausNumTapsEdit.setText(Qt.QString("%1").arg(params["ntaps"])) + + def draw_plots(self, taps, params): + self.params = params + self.taps = scipy.array(taps) + self.get_fft(self.params["fs"], self.taps, self.nfftpts) + self.update_time_curves() + self.update_freq_curves() + self.update_phase_curves() + self.update_group_curves() + + self.gui.nTapsEdit.setText(Qt.QString("%1").arg(self.taps.size)) + def setup_options(): usage="%prog: [options] (input_filename)" diff --git a/gr-utils/src/python/pyqt_filter.py b/gr-utils/src/python/pyqt_filter.py index 12ad183b0..0c781f234 100644 --- a/gr-utils/src/python/pyqt_filter.py +++ b/gr-utils/src/python/pyqt_filter.py @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file 'pyqt_filter.ui' # -# Created: Tue Aug 25 11:13:57 2009 -# by: PyQt4 UI code generator 4.4.3 +# Created: Thu Mar 17 10:51:17 2011 +# by: PyQt4 UI code generator 4.7.4 # # WARNING! All changes made in this file will be lost! @@ -27,23 +27,23 @@ class Ui_MainWindow(object): self.verticalLayout.setObjectName("verticalLayout") self.filterTypeComboBox = QtGui.QComboBox(self.filterFrame) self.filterTypeComboBox.setObjectName("filterTypeComboBox") - self.filterTypeComboBox.addItem(QtCore.QString()) - self.filterTypeComboBox.addItem(QtCore.QString()) - self.filterTypeComboBox.addItem(QtCore.QString()) - self.filterTypeComboBox.addItem(QtCore.QString()) - self.filterTypeComboBox.addItem(QtCore.QString()) - self.filterTypeComboBox.addItem(QtCore.QString()) - self.filterTypeComboBox.addItem(QtCore.QString()) + self.filterTypeComboBox.addItem("") + self.filterTypeComboBox.addItem("") + self.filterTypeComboBox.addItem("") + self.filterTypeComboBox.addItem("") + self.filterTypeComboBox.addItem("") + self.filterTypeComboBox.addItem("") + self.filterTypeComboBox.addItem("") self.verticalLayout.addWidget(self.filterTypeComboBox) self.filterDesignTypeComboBox = QtGui.QComboBox(self.filterFrame) self.filterDesignTypeComboBox.setObjectName("filterDesignTypeComboBox") - self.filterDesignTypeComboBox.addItem(QtCore.QString()) - self.filterDesignTypeComboBox.addItem(QtCore.QString()) - self.filterDesignTypeComboBox.addItem(QtCore.QString()) - self.filterDesignTypeComboBox.addItem(QtCore.QString()) - self.filterDesignTypeComboBox.addItem(QtCore.QString()) - self.filterDesignTypeComboBox.addItem(QtCore.QString()) - self.filterDesignTypeComboBox.addItem(QtCore.QString()) + self.filterDesignTypeComboBox.addItem("") + self.filterDesignTypeComboBox.addItem("") + self.filterDesignTypeComboBox.addItem("") + self.filterDesignTypeComboBox.addItem("") + self.filterDesignTypeComboBox.addItem("") + self.filterDesignTypeComboBox.addItem("") + self.filterDesignTypeComboBox.addItem("") self.verticalLayout.addWidget(self.filterDesignTypeComboBox) self.globalParamsLayout = QtGui.QFormLayout() self.globalParamsLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) @@ -255,6 +255,7 @@ class Ui_MainWindow(object): self.nTapsEdit.setMaximumSize(QtCore.QSize(100, 16777215)) self.nTapsEdit.setFrameShape(QtGui.QFrame.Box) self.nTapsEdit.setFrameShadow(QtGui.QFrame.Raised) + self.nTapsEdit.setText("") self.nTapsEdit.setObjectName("nTapsEdit") self.formLayout_8.setWidget(1, QtGui.QFormLayout.FieldRole, self.nTapsEdit) self.verticalLayout.addWidget(self.filterPropsBox) @@ -285,7 +286,7 @@ class Ui_MainWindow(object): self.freqTab.setObjectName("freqTab") self.horizontalLayout_2 = QtGui.QHBoxLayout(self.freqTab) self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.freqPlot = Qwt5.QwtPlot(self.freqTab) + self.freqPlot = QwtPlot(self.freqTab) self.freqPlot.setObjectName("freqPlot") self.horizontalLayout_2.addWidget(self.freqPlot) self.tabGroup.addTab(self.freqTab, "") @@ -293,7 +294,7 @@ class Ui_MainWindow(object): self.timeTab.setObjectName("timeTab") self.horizontalLayout = QtGui.QHBoxLayout(self.timeTab) self.horizontalLayout.setObjectName("horizontalLayout") - self.timePlot = Qwt5.QwtPlot(self.timeTab) + self.timePlot = QwtPlot(self.timeTab) self.timePlot.setObjectName("timePlot") self.horizontalLayout.addWidget(self.timePlot) self.tabGroup.addTab(self.timeTab, "") @@ -301,7 +302,7 @@ class Ui_MainWindow(object): self.phaseTab.setObjectName("phaseTab") self.horizontalLayout_3 = QtGui.QHBoxLayout(self.phaseTab) self.horizontalLayout_3.setObjectName("horizontalLayout_3") - self.phasePlot = Qwt5.QwtPlot(self.phaseTab) + self.phasePlot = QwtPlot(self.phaseTab) self.phasePlot.setObjectName("phasePlot") self.horizontalLayout_3.addWidget(self.phasePlot) self.tabGroup.addTab(self.phaseTab, "") @@ -309,14 +310,14 @@ class Ui_MainWindow(object): self.groupTab.setObjectName("groupTab") self.horizontalLayout_4 = QtGui.QHBoxLayout(self.groupTab) self.horizontalLayout_4.setObjectName("horizontalLayout_4") - self.groupPlot = Qwt5.QwtPlot(self.groupTab) + self.groupPlot = QwtPlot(self.groupTab) self.groupPlot.setObjectName("groupPlot") self.horizontalLayout_4.addWidget(self.groupPlot) self.tabGroup.addTab(self.groupTab, "") self.gridLayout.addWidget(self.tabGroup, 1, 1, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 1124, 24)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1124, 27)) self.menubar.setObjectName("menubar") self.menu_File = QtGui.QMenu(self.menubar) self.menu_File.setObjectName("menu_File") @@ -324,15 +325,19 @@ class Ui_MainWindow(object): self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) - self.action_open = QtGui.QAction(MainWindow) - self.action_open.setObjectName("action_open") self.action_exit = QtGui.QAction(MainWindow) self.action_exit.setObjectName("action_exit") + self.action_save = QtGui.QAction(MainWindow) + self.action_save.setObjectName("action_save") + self.action_open = QtGui.QAction(MainWindow) + self.action_open.setObjectName("action_open") + self.menu_File.addAction(self.action_open) + self.menu_File.addAction(self.action_save) self.menu_File.addAction(self.action_exit) self.menubar.addAction(self.menu_File.menuAction()) self.retranslateUi(MainWindow) - self.filterTypeWidget.setCurrentIndex(0) + self.filterTypeWidget.setCurrentIndex(5) self.tabGroup.setCurrentIndex(0) QtCore.QObject.connect(self.action_exit, QtCore.SIGNAL("activated()"), MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -419,8 +424,12 @@ class Ui_MainWindow(object): self.tabGroup.setTabText(self.tabGroup.indexOf(self.phaseTab), QtGui.QApplication.translate("MainWindow", "Phase", None, QtGui.QApplication.UnicodeUTF8)) self.tabGroup.setTabText(self.tabGroup.indexOf(self.groupTab), QtGui.QApplication.translate("MainWindow", "Group Delay", None, QtGui.QApplication.UnicodeUTF8)) self.menu_File.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8)) + self.action_exit.setText(QtGui.QApplication.translate("MainWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8)) + self.action_save.setText(QtGui.QApplication.translate("MainWindow", "&Save", None, QtGui.QApplication.UnicodeUTF8)) + self.action_save.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8)) self.action_open.setText(QtGui.QApplication.translate("MainWindow", "&Open", None, QtGui.QApplication.UnicodeUTF8)) self.action_open.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8)) - self.action_exit.setText(QtGui.QApplication.translate("MainWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8)) -from PyQt4 import Qwt5 +#from qwt_plot import QwtPlot +from PyQt4.Qwt5 import QwtPlot + diff --git a/gr-utils/src/python/pyqt_filter.ui b/gr-utils/src/python/pyqt_filter.ui index 9b31112e8..9853352e2 100644 --- a/gr-utils/src/python/pyqt_filter.ui +++ b/gr-utils/src/python/pyqt_filter.ui @@ -1,7 +1,8 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow" > - <property name="geometry" > + <widget class="QMainWindow" name="MainWindow"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -9,131 +10,131 @@ <height>696</height> </rect> </property> - <property name="windowTitle" > + <property name="windowTitle"> <string>GNU Radio Filter Design Tool</string> </property> - <widget class="QWidget" name="centralwidget" > - <layout class="QGridLayout" name="gridLayout" > - <item row="1" column="0" > - <widget class="QFrame" name="filterFrame" > - <property name="minimumSize" > + <widget class="QWidget" name="centralwidget"> + <layout class="QGridLayout" name="gridLayout"> + <item row="1" column="0"> + <widget class="QFrame" name="filterFrame"> + <property name="minimumSize"> <size> <width>300</width> <height>0</height> </size> </property> - <property name="maximumSize" > + <property name="maximumSize"> <size> <width>300</width> <height>16777215</height> </size> </property> - <property name="frameShape" > + <property name="frameShape"> <enum>QFrame::StyledPanel</enum> </property> - <property name="frameShadow" > + <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QVBoxLayout" name="verticalLayout" > + <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QComboBox" name="filterTypeComboBox" > + <widget class="QComboBox" name="filterTypeComboBox"> <item> - <property name="text" > + <property name="text"> <string>Low Pass</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Band Pass</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Complex Band Pass</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Band Notch</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>High Pass</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Root Raised Cosine</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Gaussian</string> </property> </item> </widget> </item> <item> - <widget class="QComboBox" name="filterDesignTypeComboBox" > + <widget class="QComboBox" name="filterDesignTypeComboBox"> <item> - <property name="text" > + <property name="text"> <string>Hamming Window</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Hann Window</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Blackman Window</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Rectangular Window</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Kaiser Window</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Blackman-harris Window</string> </property> </item> <item> - <property name="text" > + <property name="text"> <string>Equiripple</string> </property> </item> </widget> </item> <item> - <layout class="QFormLayout" name="globalParamsLayout" > - <property name="fieldGrowthPolicy" > + <layout class="QFormLayout" name="globalParamsLayout"> + <property name="fieldGrowthPolicy"> <enum>QFormLayout::AllNonFixedFieldsGrow</enum> </property> - <item row="0" column="0" > - <widget class="QLabel" name="sampleRateLabel" > - <property name="maximumSize" > + <item row="0" column="0"> + <widget class="QLabel" name="sampleRateLabel"> + <property name="maximumSize"> <size> <width>16777215</width> <height>30</height> </size> </property> - <property name="text" > + <property name="text"> <string>Sample Rate (sps)</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="sampleRateEdit" > - <property name="maximumSize" > + <item row="0" column="1"> + <widget class="QLineEdit" name="sampleRateEdit"> + <property name="maximumSize"> <size> <width>16777215</width> <height>30</height> @@ -141,332 +142,332 @@ </property> </widget> </item> - <item row="1" column="0" > - <widget class="QLabel" name="filterGainLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="filterGainLabel"> + <property name="text"> <string>Filter Gain</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="filterGainEdit" /> + <item row="1" column="1"> + <widget class="QLineEdit" name="filterGainEdit"/> </item> </layout> </item> <item> - <widget class="QStackedWidget" name="filterTypeWidget" > - <property name="currentIndex" > - <number>0</number> + <widget class="QStackedWidget" name="filterTypeWidget"> + <property name="currentIndex"> + <number>5</number> </property> - <widget class="QWidget" name="firlpfPage" > - <layout class="QFormLayout" name="formLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="endofLpfPassBandLabel" > - <property name="text" > + <widget class="QWidget" name="firlpfPage"> + <layout class="QFormLayout" name="formLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="endofLpfPassBandLabel"> + <property name="text"> <string>End of Pass Band (Hz)</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="endofLpfPassBandEdit" /> + <item row="0" column="1"> + <widget class="QLineEdit" name="endofLpfPassBandEdit"/> </item> - <item row="1" column="0" > - <widget class="QLabel" name="startofLpfStopBandLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="startofLpfStopBandLabel"> + <property name="text"> <string>Start of Stop Band (Hz)</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="startofLpfStopBandEdit" /> + <item row="1" column="1"> + <widget class="QLineEdit" name="startofLpfStopBandEdit"/> </item> - <item row="2" column="0" > - <widget class="QLabel" name="lpfStopBandAttenLabel" > - <property name="text" > + <item row="2" column="0"> + <widget class="QLabel" name="lpfStopBandAttenLabel"> + <property name="text"> <string>Stop Band Attenuation (dB)</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="lpfStopBandAttenEdit" /> + <item row="2" column="1"> + <widget class="QLineEdit" name="lpfStopBandAttenEdit"/> </item> - <item row="3" column="1" > - <widget class="QLineEdit" name="lpfPassBandRippleEdit" /> + <item row="3" column="1"> + <widget class="QLineEdit" name="lpfPassBandRippleEdit"/> </item> - <item row="3" column="0" > - <widget class="QLabel" name="lpfPassBandRippleLabel" > - <property name="text" > + <item row="3" column="0"> + <widget class="QLabel" name="lpfPassBandRippleLabel"> + <property name="text"> <string>Pass Band Ripple (dB)</string> </property> </widget> </item> </layout> </widget> - <widget class="QWidget" name="firbpfPage" > - <layout class="QFormLayout" name="formLayout_2" > - <item row="0" column="0" > - <widget class="QLabel" name="startofBpfPassBandLabel" > - <property name="text" > + <widget class="QWidget" name="firbpfPage"> + <layout class="QFormLayout" name="formLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="startofBpfPassBandLabel"> + <property name="text"> <string>Start of Pass Band (Hz)</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="startofBpfPassBandEdit" /> + <item row="0" column="1"> + <widget class="QLineEdit" name="startofBpfPassBandEdit"/> </item> - <item row="1" column="0" > - <widget class="QLabel" name="endofBpfPassBandLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="endofBpfPassBandLabel"> + <property name="text"> <string>End of Pass Band (Hz)</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="endofBpfPassBandEdit" /> + <item row="1" column="1"> + <widget class="QLineEdit" name="endofBpfPassBandEdit"/> </item> - <item row="3" column="1" > - <widget class="QLineEdit" name="bpfStopBandAttenEdit" /> + <item row="3" column="1"> + <widget class="QLineEdit" name="bpfStopBandAttenEdit"/> </item> - <item row="3" column="0" > - <widget class="QLabel" name="bpfStopBandAttenLabel" > - <property name="text" > + <item row="3" column="0"> + <widget class="QLabel" name="bpfStopBandAttenLabel"> + <property name="text"> <string>Stop Band Attenuation (dB)</string> </property> </widget> </item> - <item row="2" column="0" > - <widget class="QLabel" name="bpfTransitionLabel" > - <property name="text" > + <item row="2" column="0"> + <widget class="QLabel" name="bpfTransitionLabel"> + <property name="text"> <string>Transition Width (Hz)</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="bpfTransitionEdit" /> + <item row="2" column="1"> + <widget class="QLineEdit" name="bpfTransitionEdit"/> </item> - <item row="4" column="1" > - <widget class="QLineEdit" name="bpfPassBandRippleEdit" /> + <item row="4" column="1"> + <widget class="QLineEdit" name="bpfPassBandRippleEdit"/> </item> - <item row="4" column="0" > - <widget class="QLabel" name="bpfPassBandRippleLabel" > - <property name="text" > + <item row="4" column="0"> + <widget class="QLabel" name="bpfPassBandRippleLabel"> + <property name="text"> <string>Pass Band Ripple (dB)</string> </property> </widget> </item> </layout> </widget> - <widget class="QWidget" name="firbnfPage" > - <layout class="QFormLayout" name="formLayout_5" > - <property name="fieldGrowthPolicy" > + <widget class="QWidget" name="firbnfPage"> + <layout class="QFormLayout" name="formLayout_5"> + <property name="fieldGrowthPolicy"> <enum>QFormLayout::AllNonFixedFieldsGrow</enum> </property> - <item row="0" column="0" > - <widget class="QLabel" name="startofBnfStopBandLabel" > - <property name="text" > + <item row="0" column="0"> + <widget class="QLabel" name="startofBnfStopBandLabel"> + <property name="text"> <string>Start of Stop Band (Hz)</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="startofBnfStopBandEdit" /> + <item row="0" column="1"> + <widget class="QLineEdit" name="startofBnfStopBandEdit"/> </item> - <item row="1" column="0" > - <widget class="QLabel" name="endofBnfStopBandLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="endofBnfStopBandLabel"> + <property name="text"> <string>End of Stop Band (Hz)</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="endofBnfStopBandEdit" /> + <item row="1" column="1"> + <widget class="QLineEdit" name="endofBnfStopBandEdit"/> </item> - <item row="2" column="0" > - <widget class="QLabel" name="bnfTransitionLabel" > - <property name="text" > + <item row="2" column="0"> + <widget class="QLabel" name="bnfTransitionLabel"> + <property name="text"> <string>Transition Width (Hz)</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="bnfTransitionEdit" /> + <item row="2" column="1"> + <widget class="QLineEdit" name="bnfTransitionEdit"/> </item> - <item row="3" column="0" > - <widget class="QLabel" name="bnfStopBandAttenLabel" > - <property name="text" > + <item row="3" column="0"> + <widget class="QLabel" name="bnfStopBandAttenLabel"> + <property name="text"> <string>Stop Band Attenuation (dB)</string> </property> </widget> </item> - <item row="3" column="1" > - <widget class="QLineEdit" name="bnfStopBandAttenEdit" /> + <item row="3" column="1"> + <widget class="QLineEdit" name="bnfStopBandAttenEdit"/> </item> - <item row="4" column="0" > - <widget class="QLabel" name="bnfPassBandRippleLabel" > - <property name="text" > + <item row="4" column="0"> + <widget class="QLabel" name="bnfPassBandRippleLabel"> + <property name="text"> <string>Pass Band Ripple (dB)</string> </property> </widget> </item> - <item row="4" column="1" > - <widget class="QLineEdit" name="bnfPassBandRippleEdit" /> + <item row="4" column="1"> + <widget class="QLineEdit" name="bnfPassBandRippleEdit"/> </item> </layout> </widget> - <widget class="QWidget" name="firhpfPage" > - <layout class="QFormLayout" name="formLayout_3" > - <property name="fieldGrowthPolicy" > + <widget class="QWidget" name="firhpfPage"> + <layout class="QFormLayout" name="formLayout_3"> + <property name="fieldGrowthPolicy"> <enum>QFormLayout::AllNonFixedFieldsGrow</enum> </property> - <item row="0" column="0" > - <widget class="QLabel" name="endofHpfStopBandLabel" > - <property name="text" > + <item row="0" column="0"> + <widget class="QLabel" name="endofHpfStopBandLabel"> + <property name="text"> <string>End of Stop Band (Hz)</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="endofHpfStopBandEdit" /> + <item row="0" column="1"> + <widget class="QLineEdit" name="endofHpfStopBandEdit"/> </item> - <item row="1" column="0" > - <widget class="QLabel" name="startofHpfPassBandLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="startofHpfPassBandLabel"> + <property name="text"> <string>Start of Pass Band (Hz)</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="startofHpfPassBandEdit" /> + <item row="1" column="1"> + <widget class="QLineEdit" name="startofHpfPassBandEdit"/> </item> - <item row="2" column="0" > - <widget class="QLabel" name="hpfStopBandAttenLabel" > - <property name="text" > + <item row="2" column="0"> + <widget class="QLabel" name="hpfStopBandAttenLabel"> + <property name="text"> <string>Stop Band Attenuation (dB)</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="hpfStopBandAttenEdit" /> + <item row="2" column="1"> + <widget class="QLineEdit" name="hpfStopBandAttenEdit"/> </item> - <item row="3" column="0" > - <widget class="QLabel" name="hpfPassBandRippleLabel" > - <property name="text" > + <item row="3" column="0"> + <widget class="QLabel" name="hpfPassBandRippleLabel"> + <property name="text"> <string>Pass Band Ripple (dB)</string> </property> </widget> </item> - <item row="3" column="1" > - <widget class="QLineEdit" name="hpfPassBandRippleEdit" /> + <item row="3" column="1"> + <widget class="QLineEdit" name="hpfPassBandRippleEdit"/> </item> </layout> </widget> - <widget class="QWidget" name="rrcPage" > - <layout class="QFormLayout" name="formLayout_6" > - <item row="0" column="0" > - <widget class="QLabel" name="rrcSymbolRateLabel" > - <property name="text" > + <widget class="QWidget" name="rrcPage"> + <layout class="QFormLayout" name="formLayout_6"> + <item row="0" column="0"> + <widget class="QLabel" name="rrcSymbolRateLabel"> + <property name="text"> <string>Symbol Rate (sps)</string> </property> </widget> </item> - <item row="1" column="0" > - <widget class="QLabel" name="rrcAlphaLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="rrcAlphaLabel"> + <property name="text"> <string>Roll-off Factor</string> </property> </widget> </item> - <item row="2" column="0" > - <widget class="QLabel" name="rrcNumTapsLabel" > - <property name="text" > + <item row="2" column="0"> + <widget class="QLabel" name="rrcNumTapsLabel"> + <property name="text"> <string>Number of Taps</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="rrcSymbolRateEdit" /> + <item row="0" column="1"> + <widget class="QLineEdit" name="rrcSymbolRateEdit"/> </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="rrcAlphaEdit" /> + <item row="1" column="1"> + <widget class="QLineEdit" name="rrcAlphaEdit"/> </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="rrcNumTapsEdit" /> + <item row="2" column="1"> + <widget class="QLineEdit" name="rrcNumTapsEdit"/> </item> </layout> </widget> - <widget class="QWidget" name="gausPage" > - <layout class="QFormLayout" name="formLayout_7" > - <item row="0" column="0" > - <widget class="QLabel" name="gausSymbolRateLabel" > - <property name="text" > + <widget class="QWidget" name="gausPage"> + <layout class="QFormLayout" name="formLayout_7"> + <item row="0" column="0"> + <widget class="QLabel" name="gausSymbolRateLabel"> + <property name="text"> <string>Symbol Rate (sps)</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="gausSymbolRateEdit" /> + <item row="0" column="1"> + <widget class="QLineEdit" name="gausSymbolRateEdit"/> </item> - <item row="1" column="0" > - <widget class="QLabel" name="gausBTLabel" > - <property name="text" > + <item row="1" column="0"> + <widget class="QLabel" name="gausBTLabel"> + <property name="text"> <string>Roll-off Factor</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QLineEdit" name="gausBTEdit" /> + <item row="1" column="1"> + <widget class="QLineEdit" name="gausBTEdit"/> </item> - <item row="2" column="0" > - <widget class="QLabel" name="gausNumTapsLabel" > - <property name="text" > + <item row="2" column="0"> + <widget class="QLabel" name="gausNumTapsLabel"> + <property name="text"> <string>Number of Taps</string> </property> </widget> </item> - <item row="2" column="1" > - <widget class="QLineEdit" name="gausNumTapsEdit" /> + <item row="2" column="1"> + <widget class="QLineEdit" name="gausNumTapsEdit"/> </item> </layout> </widget> </widget> </item> <item> - <widget class="QGroupBox" name="filterPropsBox" > - <property name="title" > + <widget class="QGroupBox" name="filterPropsBox"> + <property name="title"> <string>Filter Properties</string> </property> - <layout class="QFormLayout" name="formLayout_8" > - <property name="fieldGrowthPolicy" > + <layout class="QFormLayout" name="formLayout_8"> + <property name="fieldGrowthPolicy"> <enum>QFormLayout::AllNonFixedFieldsGrow</enum> </property> - <item row="1" column="0" > - <widget class="QLabel" name="nTapsLabel" > - <property name="minimumSize" > + <item row="1" column="0"> + <widget class="QLabel" name="nTapsLabel"> + <property name="minimumSize"> <size> <width>150</width> <height>0</height> </size> </property> - <property name="text" > + <property name="text"> <string>Number of Taps:</string> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QLabel" name="nTapsEdit" > - <property name="maximumSize" > + <item row="1" column="1"> + <widget class="QLabel" name="nTapsEdit"> + <property name="maximumSize"> <size> <width>100</width> <height>16777215</height> </size> </property> - <property name="frameShape" > + <property name="frameShape"> <enum>QFrame::Box</enum> </property> - <property name="frameShadow" > + <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <property name="text" > + <property name="text"> <string/> </property> </widget> @@ -475,23 +476,23 @@ </widget> </item> <item> - <widget class="QGroupBox" name="sysParamsBox" > - <property name="title" > + <widget class="QGroupBox" name="sysParamsBox"> + <property name="title"> <string>System Parameters</string> </property> - <layout class="QFormLayout" name="formLayout_4" > - <item row="1" column="1" > - <widget class="QLineEdit" name="nfftEdit" /> + <layout class="QFormLayout" name="formLayout_4"> + <item row="1" column="1"> + <widget class="QLineEdit" name="nfftEdit"/> </item> - <item row="1" column="0" > - <widget class="QLabel" name="nfftLabel" > - <property name="minimumSize" > + <item row="1" column="0"> + <widget class="QLabel" name="nfftLabel"> + <property name="minimumSize"> <size> <width>150</width> <height>0</height> </size> </property> - <property name="text" > + <property name="text"> <string>Num FFT points</string> </property> </widget> @@ -500,26 +501,26 @@ </widget> </item> <item> - <widget class="QPushButton" name="designButton" > - <property name="minimumSize" > + <widget class="QPushButton" name="designButton"> + <property name="minimumSize"> <size> <width>0</width> <height>0</height> </size> </property> - <property name="maximumSize" > + <property name="maximumSize"> <size> <width>200</width> <height>16777215</height> </size> </property> - <property name="text" > + <property name="text"> <string>Design</string> </property> - <property name="autoDefault" > + <property name="autoDefault"> <bool>true</bool> </property> - <property name="default" > + <property name="default"> <bool>true</bool> </property> </widget> @@ -527,54 +528,54 @@ </layout> </widget> </item> - <item row="1" column="1" > - <widget class="QTabWidget" name="tabGroup" > - <property name="minimumSize" > + <item row="1" column="1"> + <widget class="QTabWidget" name="tabGroup"> + <property name="minimumSize"> <size> <width>800</width> <height>0</height> </size> </property> - <property name="currentIndex" > + <property name="currentIndex"> <number>0</number> </property> - <widget class="QWidget" name="freqTab" > - <attribute name="title" > + <widget class="QWidget" name="freqTab"> + <attribute name="title"> <string>Frequency Domain</string> </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_2" > + <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QwtPlot" name="freqPlot" /> + <widget class="QwtPlot" name="freqPlot"/> </item> </layout> </widget> - <widget class="QWidget" name="timeTab" > - <attribute name="title" > + <widget class="QWidget" name="timeTab"> + <attribute name="title"> <string>Time Domain</string> </attribute> - <layout class="QHBoxLayout" name="horizontalLayout" > + <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <widget class="QwtPlot" name="timePlot" /> + <widget class="QwtPlot" name="timePlot"/> </item> </layout> </widget> - <widget class="QWidget" name="phaseTab" > - <attribute name="title" > + <widget class="QWidget" name="phaseTab"> + <attribute name="title"> <string>Phase</string> </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_3" > + <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QwtPlot" name="phasePlot" /> + <widget class="QwtPlot" name="phasePlot"/> </item> </layout> </widget> - <widget class="QWidget" name="groupTab" > - <attribute name="title" > + <widget class="QWidget" name="groupTab"> + <attribute name="title"> <string>Group Delay</string> </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_4" > + <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> - <widget class="QwtPlot" name="groupPlot" /> + <widget class="QwtPlot" name="groupPlot"/> </item> </layout> </widget> @@ -582,35 +583,45 @@ </item> </layout> </widget> - <widget class="QMenuBar" name="menubar" > - <property name="geometry" > + <widget class="QMenuBar" name="menubar"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>1124</width> - <height>24</height> + <height>27</height> </rect> </property> - <widget class="QMenu" name="menu_File" > - <property name="title" > + <widget class="QMenu" name="menu_File"> + <property name="title"> <string>&File</string> </property> - <addaction name="action_exit" /> + <addaction name="action_open"/> + <addaction name="action_save"/> + <addaction name="action_exit"/> </widget> - <addaction name="menu_File" /> + <addaction name="menu_File"/> </widget> - <widget class="QStatusBar" name="statusbar" /> - <action name="action_open" > - <property name="text" > - <string>&Open</string> + <widget class="QStatusBar" name="statusbar"/> + <action name="action_exit"> + <property name="text"> + <string>E&xit</string> </property> - <property name="shortcut" > - <string>Ctrl+O</string> + </action> + <action name="action_save"> + <property name="text"> + <string>&Save</string> + </property> + <property name="shortcut"> + <string>Ctrl+S</string> </property> </action> - <action name="action_exit" > - <property name="text" > - <string>E&xit</string> + <action name="action_open"> + <property name="text"> + <string>&Open</string> + </property> + <property name="shortcut"> + <string>Ctrl+O</string> </property> </action> </widget> @@ -662,11 +673,11 @@ <receiver>MainWindow</receiver> <slot>close()</slot> <hints> - <hint type="sourcelabel" > + <hint type="sourcelabel"> <x>-1</x> <y>-1</y> </hint> - <hint type="destinationlabel" > + <hint type="destinationlabel"> <x>399</x> <y>347</y> </hint> diff --git a/gr-wxgui/Makefile.am b/gr-wxgui/Makefile.am index cee66e587..cfc7a429c 100644 --- a/gr-wxgui/Makefile.am +++ b/gr-wxgui/Makefile.am @@ -27,7 +27,7 @@ EXTRA_DIST += \ README.gl if PYTHON -SUBDIRS = src +SUBDIRS = src grc etcdir = $(gr_prefsdir) dist_etc_DATA = gr-wxgui.conf diff --git a/gr-wxgui/grc/.gitignore b/gr-wxgui/grc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gr-wxgui/grc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-wxgui/grc/Makefile.am b/gr-wxgui/grc/Makefile.am new file mode 100644 index 000000000..d8c7b3471 --- /dev/null +++ b/gr-wxgui/grc/Makefile.am @@ -0,0 +1,45 @@ +# +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/Makefile.common + +grcblocksdir = $(grc_blocksdir) +dist_grcblocks_DATA = \ + notebook.xml \ + variable_check_box.xml \ + variable_chooser.xml \ + variable_slider.xml \ + variable_static_text.xml \ + variable_text_box.xml \ + wxgui_constellationsink2.xml \ + wxgui_fftsink2.xml \ + wxgui_histosink2.xml \ + wxgui_numbersink2.xml \ + wxgui_scopesink2.xml \ + wxgui_termsink.xml \ + wxgui_waterfallsink2.xml + +#The wxgui module contains a top_block + wxgui frame. +wxgui_pythondir = $(pythondir)/grc_gnuradio/wxgui +wxgui_python_PYTHON = \ + __init__.py \ + panel.py \ + top_block_gui.py diff --git a/grc/grc_gnuradio/wxgui/__init__.py b/gr-wxgui/grc/__init__.py index 81427253b..81427253b 100644 --- a/grc/grc_gnuradio/wxgui/__init__.py +++ b/gr-wxgui/grc/__init__.py diff --git a/grc/blocks/notebook.xml b/gr-wxgui/grc/notebook.xml index d41db9e2d..bb3de51cb 100644 --- a/grc/blocks/notebook.xml +++ b/gr-wxgui/grc/notebook.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Notebook</name> + <name>WX GUI Notebook</name> <key>notebook</key> + <category>WX GUI Widgets</category> <import>from grc_gnuradio import wxgui as grc_wxgui</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' self.$(id) = wx.Notebook($(parent).GetWin(), style=$style) diff --git a/grc/grc_gnuradio/wxgui/panel.py b/gr-wxgui/grc/panel.py index e62133cac..e62133cac 100644 --- a/grc/grc_gnuradio/wxgui/panel.py +++ b/gr-wxgui/grc/panel.py diff --git a/grc/grc_gnuradio/wxgui/top_block_gui.py b/gr-wxgui/grc/top_block_gui.py index 333ccf1c1..333ccf1c1 100644 --- a/grc/grc_gnuradio/wxgui/top_block_gui.py +++ b/gr-wxgui/grc/top_block_gui.py diff --git a/grc/blocks/variable_check_box.xml b/gr-wxgui/grc/variable_check_box.xml index a703703c7..0c7bd1081 100644 --- a/grc/blocks/variable_check_box.xml +++ b/gr-wxgui/grc/variable_check_box.xml @@ -6,8 +6,9 @@ ################################################### --> <block> - <name>Variable Check Box</name> + <name>WX GUI Check Box</name> <key>variable_check_box</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/variable_chooser.xml b/gr-wxgui/grc/variable_chooser.xml index ee41f26db..e16e88c5d 100644 --- a/grc/blocks/variable_chooser.xml +++ b/gr-wxgui/grc/variable_chooser.xml @@ -7,8 +7,9 @@ ################################################### --> <block> - <name>Variable Chooser</name> + <name>WX GUI Chooser</name> <key>variable_chooser</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/variable_slider.xml b/gr-wxgui/grc/variable_slider.xml index c13d20856..5e3c175aa 100644 --- a/grc/blocks/variable_slider.xml +++ b/gr-wxgui/grc/variable_slider.xml @@ -6,8 +6,9 @@ ################################################### --> <block> - <name>Variable Slider</name> + <name>WX GUI Slider</name> <key>variable_slider</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/variable_static_text.xml b/gr-wxgui/grc/variable_static_text.xml index c866b998d..cd122e76a 100644 --- a/grc/blocks/variable_static_text.xml +++ b/gr-wxgui/grc/variable_static_text.xml @@ -6,8 +6,9 @@ ################################################### --> <block> - <name>Variable Static Text</name> + <name>WX GUI Static Text</name> <key>variable_static_text</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/variable_text_box.xml b/gr-wxgui/grc/variable_text_box.xml index 1b4b4355e..afff839cf 100644 --- a/grc/blocks/variable_text_box.xml +++ b/gr-wxgui/grc/variable_text_box.xml @@ -6,8 +6,9 @@ ################################################### --> <block> - <name>Variable Text Box</name> + <name>WX GUI Text Box</name> <key>variable_text_box</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/wxgui_constellationsink2.xml b/gr-wxgui/grc/wxgui_constellationsink2.xml index 598b55064..c200790f9 100644 --- a/grc/blocks/wxgui_constellationsink2.xml +++ b/gr-wxgui/grc/wxgui_constellationsink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Constellation Sink</name> + <name>WX GUI Constellation Sink</name> <key>wxgui_constellationsink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import constsink_gl</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' constsink_gl.const_sink_c( diff --git a/grc/blocks/wxgui_fftsink2.xml b/gr-wxgui/grc/wxgui_fftsink2.xml index 8df8f90d0..9b35ab848 100644 --- a/grc/blocks/wxgui_fftsink2.xml +++ b/gr-wxgui/grc/wxgui_fftsink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>FFT Sink</name> + <name>WX GUI FFT Sink</name> <key>wxgui_fftsink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio import window</import> <import>from gnuradio.wxgui import fftsink2</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/wxgui_histosink2.xml b/gr-wxgui/grc/wxgui_histosink2.xml index 9edf9650d..f4f6a2959 100644 --- a/grc/blocks/wxgui_histosink2.xml +++ b/gr-wxgui/grc/wxgui_histosink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Histo Sink</name> + <name>WX GUI Histo Sink</name> <key>wxgui_histosink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import histosink_gl</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' histosink_gl.histo_sink_f( diff --git a/grc/blocks/wxgui_numbersink2.xml b/gr-wxgui/grc/wxgui_numbersink2.xml index ad93dec08..255926610 100644 --- a/grc/blocks/wxgui_numbersink2.xml +++ b/gr-wxgui/grc/wxgui_numbersink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Number Sink</name> + <name>WX GUI Number Sink</name> <key>wxgui_numbersink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import numbersink2</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' numbersink2.$(type.fcn)( diff --git a/grc/blocks/wxgui_scopesink2.xml b/gr-wxgui/grc/wxgui_scopesink2.xml index ef0377373..dbf983e11 100644 --- a/grc/blocks/wxgui_scopesink2.xml +++ b/gr-wxgui/grc/wxgui_scopesink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Scope Sink</name> + <name>WX GUI Scope Sink</name> <key>wxgui_scopesink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import scopesink2</import> <import>from gnuradio import gr</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/wxgui_termsink.xml b/gr-wxgui/grc/wxgui_termsink.xml index 985d89b58..3e35c7578 100644 --- a/grc/blocks/wxgui_termsink.xml +++ b/gr-wxgui/grc/wxgui_termsink.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Terminal Sink</name> + <name>WX GUI Terminal Sink</name> <key>wxgui_termsink</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import termsink</import> diff --git a/grc/blocks/wxgui_waterfallsink2.xml b/gr-wxgui/grc/wxgui_waterfallsink2.xml index 3de67597f..7c646c3b2 100644 --- a/grc/blocks/wxgui_waterfallsink2.xml +++ b/gr-wxgui/grc/wxgui_waterfallsink2.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Waterfall Sink</name> + <name>WX GUI Waterfall Sink</name> <key>wxgui_waterfallsink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio import window</import> <import>from gnuradio.wxgui import waterfallsink2</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/Makefile.am b/grc/Makefile.am index 330777bb7..c36786281 100644 --- a/grc/Makefile.am +++ b/grc/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,16 +25,12 @@ if PYTHON SUBDIRS = \ base \ blocks \ + freedesktop \ grc_gnuradio \ gui \ python \ scripts -## append freedesktop to the list of subdirs when xdg utils are present -if XDG_UTILS -SUBDIRS += freedesktop -endif - ourpythondir = $(pkgpythondir)/grc ourpython_PYTHON = __init__.py diff --git a/grc/base/Platform.py b/grc/base/Platform.py index 51a3b2f87..096fdec41 100644 --- a/grc/base/Platform.py +++ b/grc/base/Platform.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -17,6 +17,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ +#Perform python integrity checks: +# GRC will not work with interpreters that fail the checks below. +# This can fail on interpreters built with special optimizations. +try: + assert False + raise Exception, 'Failed python integrity check: assert not supported' +except AssertionError: pass +if __doc__ is None: + raise Exception, 'Failed python integrity check: __doc__ not supported' + import os import sys from .. base import ParseXML, odict diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index 18420a013..6f7802169 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -24,8 +24,6 @@ include $(top_srcdir)/Makefile.common ourdatadir = $(grc_blocksdir) dist_ourdata_DATA = \ block_tree.xml \ - audio_sink.xml \ - audio_source.xml \ band_pass_filter.xml \ band_reject_filter.xml \ blks2_am_demod_cf.xml \ @@ -60,7 +58,6 @@ dist_ourdata_DATA = \ blks2_tcp_sink.xml \ blks2_tcp_source.xml \ blks2_valve.xml \ - blks2_variable_sink_x.xml \ blks2_wfm_rcv.xml \ blks2_wfm_rcv_pll.xml \ blks2_wfm_tx.xml \ @@ -158,6 +155,7 @@ dist_ourdata_DATA = \ gr_probe_avg_mag_sqrd_x.xml \ gr_probe_density_b.xml \ gr_probe_mpsk_snr_c.xml \ + gr_probe_signal_f.xml \ gr_pwr_squelch_xx.xml \ gr_quadrature_demod_cf.xml \ gr_rational_resampler_base_xxx.xml \ @@ -197,12 +195,10 @@ dist_ourdata_DATA = \ import.xml \ low_pass_filter.xml \ note.xml \ - notebook.xml \ options.xml \ pad_sink.xml \ pad_source.xml \ parameter.xml \ - probe_function.xml \ random_source_x.xml \ root_raised_cosine_filter.xml \ trellis_encoder_xx.xml \ @@ -212,29 +208,10 @@ dist_ourdata_DATA = \ trellis_siso_f.xml \ trellis_viterbi_combined_xx.xml \ trellis_viterbi_x.xml \ - usrp2_probe.xml \ - usrp2_sink_xxxx.xml \ - usrp2_source_xxxx.xml \ - usrp_dual_sink_x.xml \ - usrp_dual_source_x.xml \ - usrp_probe.xml \ - usrp_simple_sink_x.xml \ - usrp_simple_source_x.xml \ variable.xml \ - variable_check_box.xml \ - variable_chooser.xml \ variable_config.xml \ - variable_slider.xml \ - variable_static_text.xml \ - variable_text_box.xml \ + variable_function_probe.xml \ virtual_sink.xml \ virtual_source.xml \ - wxgui_constellationsink2.xml \ - wxgui_fftsink2.xml \ - wxgui_histosink2.xml \ - wxgui_numbersink2.xml \ - wxgui_scopesink2.xml \ - wxgui_termsink.xml \ - wxgui_waterfallsink2.xml \ xmlrpc_client.xml \ xmlrpc_server.xml diff --git a/grc/blocks/blks2_variable_sink_x.xml b/grc/blocks/blks2_variable_sink_x.xml deleted file mode 100644 index 5709c9f76..000000000 --- a/grc/blocks/blks2_variable_sink_x.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Variable Sink: Custom blks2 block -################################################### - --> -<block> - <name>Variable Sink</name> - <key>blks2_variable_sink_x</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.variable_sink_$(type.fcn)( - vlen=$vlen, - decim=$decim, - callback=self.set_$(variable()), -)</make> - <callback>set_decim($decim)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:c</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:f</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>fcn:i</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:s</opt> - </option> - <option> - <name>Byte</name> - <key>byte</key> - <opt>fcn:b</opt> - </option> - </param> - <param> - <name>Variable</name> - <key>variable</key> - <value></value> - <type>string</type> - </param> - <param> - <name>Decimation</name> - <key>decim</key> - <value>1</value> - <type>int</type> - </param> - <param> - <name>Vec Length</name> - <key>vlen</key> - <value>1</value> - <type>int</type> - </param> - <check>$vlen > 0</check> - <sink> - <name>in</name> - <type>$type</type> - <vlen>$vlen</vlen> - </sink> - <doc> -Read samples from the input stream and \ -write one in every decimation samples to the variable. - -The variable must be the id of an existing variable block. - </doc> -</block> diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 610a88102..549ffbdbf 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -18,7 +18,6 @@ <block>gr_file_source</block> <block>blks2_tcp_source</block> <block>gr_udp_source</block> - <block>audio_source</block> <block>gr_wavfile_source</block> <block>gr_message_source</block> <block>pad_source</block> @@ -26,29 +25,17 @@ </cat> <cat> <name>Sinks</name> - <block>blks2_variable_sink_x</block> <block>gr_vector_sink_x</block> <block>gr_null_sink</block> <block>gr_file_sink</block> <block>blks2_tcp_sink</block> <block>gr_udp_sink</block> - <block>audio_sink</block> <block>gr_wavfile_sink</block> <block>gr_message_sink</block> <block>pad_sink</block> <block>virtual_sink</block> </cat> <cat> - <name>Graphical Sinks</name> - <block>wxgui_numbersink2</block> - <block>wxgui_scopesink2</block> - <block>wxgui_fftsink2</block> - <block>wxgui_constellationsink2</block> - <block>wxgui_waterfallsink2</block> - <block>wxgui_histosink2</block> - <block>wxgui_termsink</block> - </cat> - <cat> <name>Operators</name> <block>gr_add_xx</block> <block>gr_sub_xx</block> @@ -138,7 +125,7 @@ <block>gr_pll_freqdet_cf</block> <block>gr_pll_refout_cc</block> - <block>gr_fll_band_edge_cc</block> + <block>gr_fll_band_edge_cc</block> <block>gr_correlate_access_code_bb</block> <block>gr_pn_correlator_cc</block> @@ -262,7 +249,7 @@ <block>gr_additive_scrambler_bb</block> </cat> <cat> - <name>Vocoders</name> + <name>Vocoders</name> <block>blks2_cvsd_encode</block> <block>blks2_cvsd_decode</block> </cat> @@ -271,26 +258,13 @@ <block>gr_probe_avg_mag_sqrd_x</block> <block>gr_probe_density_b</block> <block>gr_probe_mpsk_snr_c</block> - <block>probe_function</block> - </cat> - <cat> - <name>USRP</name> - <block>usrp_simple_source_x</block> - <block>usrp_simple_sink_x</block> - <block>usrp_dual_source_x</block> - <block>usrp_dual_sink_x</block> - <block>usrp2_source_xxxx</block> - <block>usrp2_sink_xxxx</block> + <block>gr_probe_signal_f</block> </cat> <cat> <name>Variables</name> <block>variable</block> - <block>variable_slider</block> - <block>variable_chooser</block> - <block>variable_check_box</block> - <block>variable_text_box</block> - <block>variable_static_text</block> <block>variable_config</block> + <block>variable_function_probe</block> <block>parameter</block> </cat> <cat> @@ -315,7 +289,5 @@ <block>xmlrpc_server</block> <block>xmlrpc_client</block> - - <block>notebook</block> </cat> </cat> diff --git a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml index eb855956a..6bf706ae1 100644 --- a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml +++ b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml @@ -7,15 +7,10 @@ <block> <name>Probe Avg Mag^2</name> <key>gr_probe_avg_mag_sqrd_x</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_avg_mag_sqrd_$(type)( - threshold=$threshold, - alpha=$alpha, - probe_rate=$probe_rate, -)</make> + <import>from gnuradio import gr</import> + <make>gr.probe_avg_mag_sqrd_$(type)($threshold, $alpha)</make> <callback>set_alpha($alpha)</callback> <callback>set_threshold($threshold)</callback> - <callback>set_probe_rate($probe_rate)</callback> <param> <name>Type</name> <key>type</key> @@ -43,18 +38,13 @@ <value>1</value> <type>real</type> </param> - <param> - <name>Probe Rate</name> - <key>probe_rate</key> - <value>10</value> - <type>real</type> - </param> <sink> <name>in</name> <type>$type.input</type> </sink> - <source> - <name>out</name> - <type>float</type> - </source> + <doc> +Available functions to probe: level() + +Use with the function probe block. + </doc> </block> diff --git a/grc/blocks/gr_probe_density_b.xml b/grc/blocks/gr_probe_density_b.xml index 74d3b0a2b..3a91256aa 100644 --- a/grc/blocks/gr_probe_density_b.xml +++ b/grc/blocks/gr_probe_density_b.xml @@ -7,13 +7,9 @@ <block> <name>Probe Density</name> <key>gr_probe_density_b</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_density_b( - alpha=$alpha, - probe_rate=$probe_rate, -)</make> + <import>from gnuradio import gr</import> + <make>gr.probe_density_b($alpha)</make> <callback>set_alpha($alpha)</callback> - <callback>set_probe_rate($probe_rate)</callback> <param> <name>Alpha</name> <key>alpha</key> @@ -30,8 +26,9 @@ <name>in</name> <type>byte</type> </sink> - <source> - <name>out</name> - <type>float</type> - </source> + <doc> +Available functions to probe: density() + +Use with the function probe block. + </doc> </block> diff --git a/grc/blocks/gr_probe_mpsk_snr_c.xml b/grc/blocks/gr_probe_mpsk_snr_c.xml index 7f562d2f3..5687e867d 100644 --- a/grc/blocks/gr_probe_mpsk_snr_c.xml +++ b/grc/blocks/gr_probe_mpsk_snr_c.xml @@ -7,49 +7,22 @@ <block> <name>Probe MPSK SNR</name> <key>gr_probe_mpsk_snr_c</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_mpsk_snr_c( - type='$type', - alpha=$alpha, - probe_rate=$probe_rate, -)</make> + <import>from gnuradio import gr</import> + <make>gr.probe_mpsk_snr_c($alpha)</make> <callback>set_alpha($alpha)</callback> - <callback>set_probe_rate($probe_rate)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>SNR</name> - <key>snr</key> - </option> - <option> - <name>Signal Mean</name> - <key>signal_mean</key> - </option> - <option> - <name>Noise Variance</name> - <key>noise_variance</key> - </option> - </param> <param> <name>Alpha</name> <key>alpha</key> <value>1</value> <type>real</type> </param> - <param> - <name>Probe Rate</name> - <key>probe_rate</key> - <value>10</value> - <type>real</type> - </param> <sink> <name>in</name> <type>complex</type> </sink> - <source> - <name>out</name> - <type>float</type> - </source> + <doc> +Available functions to probe: signal_mean(), noise_variance() + +Use with the function probe block. + </doc> </block> diff --git a/grc/blocks/gr_probe_signal_f.xml b/grc/blocks/gr_probe_signal_f.xml new file mode 100644 index 000000000..5c38e816f --- /dev/null +++ b/grc/blocks/gr_probe_signal_f.xml @@ -0,0 +1,21 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Probe Signal +################################################### + --> +<block> + <name>Probe Signal</name> + <key>gr_probe_signal_f</key> + <import>from gnuradio import gr</import> + <make>gr.probe_signal_f()</make> + <sink> + <name>in</name> + <type>float</type> + </sink> + <doc> +Available functions to probe: level() + +Use with the function probe block. + </doc> +</block> diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index 4d0dd2899..b27ea900c 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -15,6 +15,10 @@ from grc_gnuradio import wxgui as grc_wxgui import wx #end if +#if $generate_options() == 'qt_gui' +from PyQt4 import Qt +import sys +#end if #if $generate_options() != 'hb' from optparse import OptionParser from gnuradio.eng_option import eng_option @@ -56,12 +60,15 @@ else: self.stop(); self.wait()</callback> <key>generate_options</key> <value>wx_gui</value> <type>enum</type> - <hide>#if $generate_options() == 'wx_gui' then 'part' else 'none'#</hide> <option> <name>WX GUI</name> <key>wx_gui</key> </option> <option> + <name>QT GUI</name> + <key>qt_gui</key> + </option> + <option> <name>No GUI</name> <key>no_gui</key> </option> @@ -98,7 +105,7 @@ else: self.stop(); self.wait()</callback> <value>True</value> <type>bool</type> <hide> -#if $generate_options() == 'wx_gui' +#if $generate_options() in ('qt_gui', 'wx_gui') #if $run() part #else diff --git a/grc/blocks/probe_function.xml b/grc/blocks/probe_function.xml deleted file mode 100644 index ac0b3dcde..000000000 --- a/grc/blocks/probe_function.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Probe Function -################################################### - --> -<block> - <name>Probe Function</name> - <key>probe_function</key> - <import>from grc_gnuradio import blks2 as grc_blks2</import> - <make>grc_blks2.probe_function( - probe_callback=self.$(block_id()).$(function_name()), - probe_rate=$probe_rate, -)</make> - <callback>set_probe_rate($probe_rate)</callback> - <param> - <name>Block ID</name> - <key>block_id</key> - <value>my_block_0</value> - <type>string</type> - </param> - <param> - <name>Function Name</name> - <key>function_name</key> - <value>get_number</value> - <type>string</type> - </param> - <param> - <name>Probe Rate</name> - <key>probe_rate</key> - <value>10</value> - <type>real</type> - </param> - <source> - <name>out</name> - <type>float</type> - </source> - <doc> -Polls a function of an arbitrary block and writes the value to the output port. \ -The block id is the id of another block in the flow graph. \ -The function name is the name of a function in the said block. \ -The function should take no arguments and return a floating point or integer number. - </doc> -</block> diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml new file mode 100644 index 000000000..269966c70 --- /dev/null +++ b/grc/blocks/variable_function_probe.xml @@ -0,0 +1,70 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable function probe +################################################### + --> +<block> + <name>Function Probe</name> + <key>variable_function_probe</key> + <import>import time</import> + <import>import threading</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>#slurp +def _$(id)_probe(): + while True: + val = self.$(block_id()).$(function_name())($(function_args())) + try: self.set_$(id)(val) + except AttributeError, e: pass + time.sleep(1.0/($poll_rate)) +_$(id)_thread = threading.Thread(target=_$(id)_probe) +_$(id)_thread.daemon = True +_$(id)_thread.start()</make> + <callback>self.set_$(id)($value)</callback> + <param> + <name>Value</name> + <key>value</key> + <value>0</value> + <type>raw</type> + </param> + <param> + <name>Block ID</name> + <key>block_id</key> + <value>my_block_0</value> + <type>string</type> + </param> + <param> + <name>Function Name</name> + <key>function_name</key> + <value>get_number</value> + <type>string</type> + </param> + <param> + <name>Function Args</name> + <key>function_args</key> + <value></value> + <type>string</type> + <hide>#if $function_args() then 'none' else 'part'#</hide> + </param> + <param> + <name>Poll Rate (Hz)</name> + <key>poll_rate</key> + <value>10</value> + <type>real</type> + </param> + <doc> +Periodically probe a function and set its value to this variable. + +Set the values for block ID, function name, and function args appropriately: \ +Block ID should be the ID of another block in this flow graph. \ +Function name should be the name of a class method on that block. \ +Function args are the parameters passed into that function. \ +For a function with no arguments, leave function args blank. \ +When passing a string for the function arguments, quote the string literal: '"arg"'. + +The values will used literally, and generated into the following form: +self.block_id.function_name(function_args) + +To poll a stream for a level, use this with the probe signal block. + </doc> +</block> diff --git a/grc/freedesktop/Makefile.am b/grc/freedesktop/Makefile.am index dd7411bbb..f89a344f7 100644 --- a/grc/freedesktop/Makefile.am +++ b/grc/freedesktop/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -29,9 +29,7 @@ dist_ourdata_DATA = \ grc-icon-48.png \ grc-icon-32.png \ gnuradio-grc.xml \ - gnuradio-grc.desktop \ - gnuradio-usrp2_probe.desktop \ - gnuradio-usrp_probe.desktop + gnuradio-grc.desktop pkglibexecdir = $(libexecdir)/$(PACKAGE) dist_pkglibexec_SCRIPTS = grc_setup_freedesktop @@ -42,6 +40,7 @@ grc_setup_freedesktop: $(srcdir)/grc_setup_freedesktop.in Makefile EXTRA_DIST += $(srcdir)/grc_setup_freedesktop.in BUILT_SOURCES += grc_setup_freedesktop +if XDG_UTILS install-data-hook: @printf "\n*** GRC Post-Install Message ***\ \nTo install icons, mime type, and menu items\ @@ -53,3 +52,4 @@ uninstall-hook: \nTo uninstall icons, mime type, and menu items\ \nfor a freedesktop.org system (Gnome/KDE/Xfce):\ \n >>> sudo $(pkglibexecdir)/grc_setup_freedesktop uninstall\n\n" +endif diff --git a/grc/freedesktop/grc_setup_freedesktop.in b/grc/freedesktop/grc_setup_freedesktop.in index ab4ce82ef..1e3546197 100644 --- a/grc/freedesktop/grc_setup_freedesktop.in +++ b/grc/freedesktop/grc_setup_freedesktop.in @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -28,7 +28,6 @@ ################################################## ICON_SIZES="32 48 64 128 256" -MENU_ITEMS="grc usrp2_probe usrp_probe" if [ -n "$2" ]; then SRCDIR="$2" else @@ -49,9 +48,7 @@ case "$1" in echo "Install mime type" xdg-mime install ${SRCDIR}/gnuradio-grc.xml echo "Install menu items" - for menu_item in ${MENU_ITEMS}; do \ - xdg-desktop-menu install ${SRCDIR}/gnuradio-${menu_item}.desktop; \ - done + xdg-desktop-menu install ${SRCDIR}/*.desktop echo "Done!" echo "" ;; @@ -68,9 +65,7 @@ case "$1" in echo "Uninstall mime type" xdg-mime uninstall ${SRCDIR}/gnuradio-grc.xml echo "Uninstall menu items" - for menu_item in ${MENU_ITEMS}; do \ - xdg-desktop-menu uninstall gnuradio-${menu_item}.desktop; \ - done + xdg-desktop-menu uninstall `ls ${SRCDIR}/*.desktop | xargs -n1 basename` echo "Done!" echo "" ;; diff --git a/grc/grc_gnuradio/Makefile.am b/grc/grc_gnuradio/Makefile.am index 63bb72822..af1d86be9 100644 --- a/grc/grc_gnuradio/Makefile.am +++ b/grc/grc_gnuradio/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -31,20 +31,5 @@ blks2_python_PYTHON = \ blks2/__init__.py \ blks2/error_rate.py \ blks2/packet.py \ - blks2/probe.py \ blks2/selector.py \ - blks2/tcp.py \ - blks2/variable_sink.py - -usrp_pythondir = $(grc_gnuradio_prefix)/usrp -usrp_python_PYTHON = \ - usrp/__init__.py \ - usrp/common.py \ - usrp/dual_usrp.py \ - usrp/simple_usrp.py - -wxgui_pythondir = $(grc_gnuradio_prefix)/wxgui -wxgui_python_PYTHON = \ - wxgui/__init__.py \ - wxgui/panel.py \ - wxgui/top_block_gui.py + blks2/tcp.py diff --git a/grc/grc_gnuradio/blks2/__init__.py b/grc/grc_gnuradio/blks2/__init__.py index cb1196f25..fde76f256 100644 --- a/grc/grc_gnuradio/blks2/__init__.py +++ b/grc/grc_gnuradio/blks2/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,6 +23,4 @@ from packet import options, packet_encoder, packet_decoder, \ packet_mod_b, packet_mod_s, packet_mod_i, packet_mod_f, packet_mod_c, \ packet_demod_b, packet_demod_s, packet_demod_i, packet_demod_f, packet_demod_c from error_rate import error_rate -from probe import probe_function, probe_avg_mag_sqrd_c, probe_avg_mag_sqrd_f, probe_density_b, probe_mpsk_snr_c -from variable_sink import variable_sink_b, variable_sink_s, variable_sink_i, variable_sink_f, variable_sink_c from tcp import tcp_source, tcp_sink diff --git a/grc/grc_gnuradio/blks2/probe.py b/grc/grc_gnuradio/blks2/probe.py deleted file mode 100644 index 8db81f057..000000000 --- a/grc/grc_gnuradio/blks2/probe.py +++ /dev/null @@ -1,123 +0,0 @@ -# -# Copyright 2008 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr -import threading -import numpy -import time - -####################################################################################### -## Probe: Function -####################################################################################### -class probe_function(gr.hier_block2, threading.Thread): - """ - The thread polls the function for values and writes to a message source. - """ - - def __init__(self, probe_callback, probe_rate): - #init hier block - gr.hier_block2.__init__( - self, 'probe_function', - gr.io_signature(0, 0, 0), - gr.io_signature(1, 1, gr.sizeof_float), - ) - self._probe_callback = probe_callback - self.set_probe_rate(probe_rate) - #create message source - message_source = gr.message_source(gr.sizeof_float, 1) - self._msgq = message_source.msgq() - #connect - self.connect(message_source, self) - #setup thread - threading.Thread.__init__(self) - self.setDaemon(True) - self.start() - - def run(self): - """ - Infinite polling loop. - """ - while True: - time.sleep(1.0/self._probe_rate) - arr = numpy.array(self._probe_callback(), numpy.float32) - msg = gr.message_from_string(arr.tostring(), 0, gr.sizeof_float, 1) - self._msgq.insert_tail(msg) - - def set_probe_rate(self, probe_rate): - self._probe_rate = probe_rate - -class _probe_base(gr.hier_block2): - def __init__(self, probe_block, probe_callback, probe_rate): - #init hier block - gr.hier_block2.__init__( - self, 'probe', - gr.io_signature(1, 1, probe_block.input_signature().sizeof_stream_items()[0]), - gr.io_signature(1, 1, gr.sizeof_float), - ) - probe_function_block = probe_function(probe_callback, probe_rate) - #forward callbacks - self.set_probe_rate = probe_function_block.set_probe_rate - #connect - self.connect(self, probe_block) - self.connect(probe_function_block, self) - -####################################################################################### -## Probe: Average Magnitude Squared -####################################################################################### -class _probe_avg_mag_sqrd_base(_probe_base): - def __init__(self, threshold, alpha, probe_rate): - #create block - probe_block = self._probe_block_contructor[0](threshold, alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - self.set_threshold = probe_block.set_threshold - #init - _probe_base.__init__(self, probe_block, probe_block.level, probe_rate) - -class probe_avg_mag_sqrd_c(_probe_avg_mag_sqrd_base): _probe_block_contructor = (gr.probe_avg_mag_sqrd_c,) -class probe_avg_mag_sqrd_f(_probe_avg_mag_sqrd_base): _probe_block_contructor = (gr.probe_avg_mag_sqrd_f,) - -####################################################################################### -## Probe: Density -####################################################################################### -class probe_density_b(_probe_base): - def __init__(self, alpha, probe_rate): - #create block - probe_block = gr.probe_density_b(alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - #init - _probe_base.__init__(self, probe_block, probe_block.density, probe_rate) - -####################################################################################### -## Probe: MPSK SNR -####################################################################################### -class probe_mpsk_snr_c(_probe_base): - def __init__(self, type, alpha, probe_rate): - """ - Type can be "snr", "signal_mean", or "noise_variance" - """ - #create block - probe_block = gr.probe_mpsk_snr_c(alpha) - #forward callbacks - self.set_alpha = probe_block.set_alpha - #init - _probe_base.__init__(self, probe_block, getattr(probe_block, type), probe_rate) diff --git a/grc/grc_gnuradio/blks2/variable_sink.py b/grc/grc_gnuradio/blks2/variable_sink.py deleted file mode 100644 index cad3b8b04..000000000 --- a/grc/grc_gnuradio/blks2/variable_sink.py +++ /dev/null @@ -1,64 +0,0 @@ -# -# Copyright 2009 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr -import threading -import numpy - -class _variable_sink_base(gr.hier_block2, threading.Thread): - """ - The thread polls the message queue for values and writes to a callback. - """ - - def __init__(self, vlen, decim, callback): - self._vlen = vlen - self._callback = callback - self._item_size = self._size*self._vlen - #init hier block - gr.hier_block2.__init__( - self, 'variable_sink', - gr.io_signature(1, 1, self._item_size), - gr.io_signature(0, 0, 0), - ) - #create blocks - self._decimator = gr.keep_one_in_n(self._item_size, decim) - self._msgq = gr.msg_queue(2) - message_sink = gr.message_sink(self._item_size, self._msgq, False) - #connect - self.connect(self, self._decimator, message_sink) - #setup thread - threading.Thread.__init__(self) - self.setDaemon(True) - self.start() - - def set_decim(self, decim): self._decimator.set_n(decim) - - def run(self): - while True: #truncate to item size, convert to array, callback - msg = self._msgq.delete_head().to_string()[-self._item_size:] - arr = map(self._cast, numpy.fromstring(msg, self._numpy)) - self._callback(self._vlen > 1 and arr or arr[0]) - -class variable_sink_b(_variable_sink_base): _numpy, _size, _cast = numpy.int8, gr.sizeof_char, int -class variable_sink_s(_variable_sink_base): _numpy, _size, _cast = numpy.int16, gr.sizeof_short, int -class variable_sink_i(_variable_sink_base): _numpy, _size, _cast = numpy.int32, gr.sizeof_int, int -class variable_sink_f(_variable_sink_base): _numpy, _size, _cast = numpy.float32, gr.sizeof_float, float -class variable_sink_c(_variable_sink_base): _numpy, _size, _cast = numpy.complex64, gr.sizeof_gr_complex, complex diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 108e23a23..350b297bb 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -1,5 +1,5 @@ """ -Copyright 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright 2007, 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -282,7 +282,7 @@ class ActionHandler: # Gen/Exec/Stop ################################################## elif action == Actions.FLOW_GRAPH_GEN: - if not self.get_page().get_pid(): + if not self.get_page().get_proc(): if not self.get_page().get_saved() or not self.get_page().get_file_path(): Actions.FLOW_GRAPH_SAVE() #only save if file path missing or not saved if self.get_page().get_saved() and self.get_page().get_file_path(): @@ -293,14 +293,14 @@ class ActionHandler: except Exception,e: Messages.send_fail_gen(e) else: self.generator = None elif action == Actions.FLOW_GRAPH_EXEC: - if not self.get_page().get_pid(): + if not self.get_page().get_proc(): Actions.FLOW_GRAPH_GEN() if self.get_page().get_saved() and self.get_page().get_file_path(): ExecFlowGraphThread(self) elif action == Actions.FLOW_GRAPH_KILL: - if self.get_page().get_pid(): - try: os.kill(self.get_page().get_pid(), signal.SIGKILL) - except: print "could not kill pid: %s"%self.get_page().get_pid() + if self.get_page().get_proc(): + try: self.get_page().get_proc().kill() + except: print "could not kill process: %d"%self.get_page().get_proc().pid elif action == Actions.PAGE_CHANGE: #pass and run the global actions pass else: print '!!! Action "%s" not handled !!!'%action @@ -340,10 +340,10 @@ class ActionHandler: Update the exec and stop buttons. Lock and unlock the mutex for race conditions with exec flow graph threads. """ - sensitive = self.get_flow_graph().is_valid() and not self.get_page().get_pid() + sensitive = self.get_flow_graph().is_valid() and not self.get_page().get_proc() Actions.FLOW_GRAPH_GEN.set_sensitive(sensitive) Actions.FLOW_GRAPH_EXEC.set_sensitive(sensitive) - Actions.FLOW_GRAPH_KILL.set_sensitive(self.get_page().get_pid() != None) + Actions.FLOW_GRAPH_KILL.set_sensitive(self.get_page().get_proc() != None) class ExecFlowGraphThread(Thread): """Execute the flow graph as a new process and wait on it to finish.""" @@ -362,7 +362,7 @@ class ExecFlowGraphThread(Thread): #get the popen try: self.p = self.page.get_generator().get_popen() - self.page.set_pid(self.p.pid) + self.page.set_proc(self.p) #update self.update_exec_stop() self.start() @@ -385,5 +385,5 @@ class ExecFlowGraphThread(Thread): def done(self): """Perform end of execution tasks.""" Messages.send_end_exec() - self.page.set_pid(None) + self.page.set_proc(None) self.update_exec_stop() diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py index 9fcbe2a6c..2f761df1f 100644 --- a/grc/gui/MainWindow.py +++ b/grc/gui/MainWindow.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -216,7 +216,7 @@ class MainWindow(gtk.Window): """ if not self.page_to_be_closed: self.page_to_be_closed = self.get_page() #show the page if it has an executing flow graph or is unsaved - if self.page_to_be_closed.get_pid() or not self.page_to_be_closed.get_saved(): + if self.page_to_be_closed.get_proc() or not self.page_to_be_closed.get_saved(): self._set_page(self.page_to_be_closed) #unsaved? ask the user if not self.page_to_be_closed.get_saved() and self._save_changes(): @@ -225,7 +225,7 @@ class MainWindow(gtk.Window): self.page_to_be_closed = None #set the page to be closed back to None return #stop the flow graph if executing - if self.page_to_be_closed.get_pid(): Actions.FLOW_GRAPH_KILL() + if self.page_to_be_closed.get_proc(): Actions.FLOW_GRAPH_KILL() #remove the page self.notebook.remove_page(self.notebook.page_num(self.page_to_be_closed)) if ensure and self.notebook.get_n_pages() == 0: self.new_page() #no pages, make a new one diff --git a/grc/gui/NotebookPage.py b/grc/gui/NotebookPage.py index fddfeaf5f..86b6f1513 100644 --- a/grc/gui/NotebookPage.py +++ b/grc/gui/NotebookPage.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009 Free Software Foundation, Inc. +Copyright 2008, 2009, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -40,7 +40,7 @@ class NotebookPage(gtk.HBox): @param file_path path to a flow graph file """ self._flow_graph = flow_graph - self.set_pid(None) + self.set_proc(None) #import the file self.main_window = main_window self.set_file_path(file_path) @@ -119,19 +119,19 @@ class NotebookPage(gtk.HBox): """ return self.tab - def get_pid(self): + def get_proc(self): """ - Get the pid for the flow graph. - @return the pid number + Get the subprocess for the flow graph. + @return the subprocess object """ - return self.pid + return self.process - def set_pid(self, pid): + def set_proc(self, process): """ - Set the pid number. - @param pid the new pid number + Set the subprocess object. + @param process the new subprocess """ - self.pid = pid + self.process = process def get_flow_graph(self): """ diff --git a/grc/python/Generator.py b/grc/python/Generator.py index d53802bef..b669fa65a 100644 --- a/grc/python/Generator.py +++ b/grc/python/Generator.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -90,18 +90,20 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') imports = self._flow_graph.get_imports() variables = self._flow_graph.get_variables() parameters = self._flow_graph.get_parameters() - #list of variables with controls - controls = filter(lambda v: v.get_make(), variables) #list of blocks not including variables and imports and parameters and disabled - blocks = sorted(self._flow_graph.get_enabled_blocks(), lambda x, y: cmp(x.get_id(), y.get_id())) - probes = filter(lambda b: b.get_key().startswith('probe_'), blocks) #ensure probes are last in the block list - #get a list of notebooks and sort them according dependencies - notebooks = expr_utils.sort_objects( - filter(lambda b: b.get_key() == 'notebook', blocks), - lambda n: n.get_id(), lambda n: n.get_param('notebook').get_value(), + def _get_block_sort_text(block): + code = block.get_make().replace(block.get_id(), ' ') + try: code += block.get_param('notebook').get_value() #older gui markup w/ wxgui + except: pass + try: code += block.get_param('gui_hint').get_value() #newer gui markup w/ qtgui + except: pass + return code + blocks = expr_utils.sort_objects( + self._flow_graph.get_enabled_blocks(), + lambda b: b.get_id(), _get_block_sort_text ) #list of regular blocks (all blocks minus the special ones) - blocks = filter(lambda b: b not in (imports + parameters + variables + probes + notebooks), blocks) + probes + blocks = filter(lambda b: b not in (imports + parameters), blocks) #list of connections where each endpoint is enabled connections = filter(lambda c: not c.is_msg(), self._flow_graph.get_enabled_connections()) messages = filter(lambda c: c.is_msg(), self._flow_graph.get_enabled_connections()) @@ -125,8 +127,6 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') 'imports': imports, 'flow_graph': self._flow_graph, 'variables': variables, - 'notebooks': notebooks, - 'controls': controls, 'parameters': parameters, 'blocks': blocks, 'connections': connections, diff --git a/grc/python/Param.py b/grc/python/Param.py index 6dd008d1d..303ab3ed8 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -99,7 +99,7 @@ class Param(_Param, _GUIParam): 'hex', 'string', 'bool', 'file_open', 'file_save', 'id', 'stream_id', - 'grid_pos', 'notebook', + 'grid_pos', 'notebook', 'gui_hint', 'import', ) @@ -354,6 +354,29 @@ class Param(_Param, _GUIParam): except: raise Exception, 'Stream ID "%s" is not found.'%v return v ######################### + # GUI Position/Hint + ######################### + elif t == 'gui_hint': + if ':' in v: tab, pos = v.split(':') + elif '@' in v: tab, pos = v, '' + else: tab, pos = '', v + + if '@' in tab: tab, index = tab.split('@') + else: index = '?' + + widget_str = ({ + (True, True): 'self.%(tab)s_grid_layout_%(index)s.addWidget(%(widget)s, %(pos)s)', + (True, False): 'self.%(tab)s_layout_%(index)s.addWidget(%(widget)s)', + (False, True): 'self.top_grid_layout.addWidget(%(widget)s, %(pos)s)', + (False, False): 'self.top_layout.addWidget(%(widget)s)', + }[bool(tab), bool(pos)])%{'tab': tab, 'index': index, 'widget': '%s', 'pos': pos} + + def gui_hint(ws, w): + if 'layout' in w: ws = ws.replace('addWidget', 'addLayout') + return ws%w + + return lambda w: gui_hint(widget_str, w) + ######################### # Grid Position Type ######################### elif t == 'grid_pos': diff --git a/grc/python/Platform.py b/grc/python/Platform.py index 04db0b9b0..ec3f94096 100644 --- a/grc/python/Platform.py +++ b/grc/python/Platform.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index a1a9308aa..e16e86f5b 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -5,8 +5,6 @@ ##@param imports the import statements ##@param flow_graph the flow_graph ##@param variables the variable blocks -##@param notebooks a list of notebook blocks -##@param controls the variables with gui controls ##@param parameters the paramater blocks ##@param blocks the signal blocks ##@param connections the connections @@ -59,6 +57,17 @@ class $(class_name)(grc_wxgui.top_block_gui): _icon_path = "$icon.get_filename()" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #end if +#elif $generate_options == 'qt_gui' +class $(class_name)(gr.top_block, Qt.QWidget): + + def __init__($param_str): + gr.top_block.__init__(self, "$title") + Qt.QWidget.__init__(self) + self.setWindowTitle("$title") + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + self.top_layout = Qt.QVBoxLayout(self) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) #elif $generate_options == 'no_gui' class $(class_name)(gr.top_block): @@ -112,30 +121,6 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $indent($var.get_var_make()) #end for ######################################################## -##Create Notebooks -######################################################## -#if $notebooks - - $DIVIDER - # Notebooks - $DIVIDER -#end if -#for $notebook in $notebooks - $indent($notebook.get_make()) -#end for -######################################################## -##Create Controls -######################################################## -#if $controls - - $DIVIDER - # Controls - $DIVIDER -#end if -#for $ctrl in $controls - $indent($ctrl.get_make()) -#end for -######################################################## ##Create Message Queues ######################################################## #if $messages @@ -157,7 +142,11 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $DIVIDER #end if #for $blk in filter(lambda b: b.get_make(), $blocks) + #if $blk in $variables + $indent($blk.get_make()) + #else self.$blk.get_id() = $indent($blk.get_make()) + #end if #end for ######################################################## ##Create Connections @@ -196,6 +185,9 @@ self.$port.get_parent().get_id()#slurp ######################################################## #for $var in $parameters + $variables #set $id = $var.get_id() + def get_$(id)(self): + return self.$id + def set_$(id)(self, $id): self.$id = $id #for $callback in $var_id2cbs[$id] @@ -239,10 +231,19 @@ if __name__ == '__main__': if gr.enable_realtime_scheduling() != gr.RT_OK: print "Error: failed to enable realtime scheduling." #end if - tb = $(class_name)($(', '.join($params_eq_list))) #if $generate_options == 'wx_gui' + tb = $(class_name)($(', '.join($params_eq_list))) tb.Run($flow_graph.get_option('run')) + #elif $generate_options == 'qt_gui' + qapp = Qt.QApplication(sys.argv) + tb = $(class_name)($(', '.join($params_eq_list))) + #if $flow_graph.get_option('run') + tb.start() + #end if + tb.show() + qapp.exec_() #elif $generate_options == 'no_gui' + tb = $(class_name)($(', '.join($params_eq_list))) #set $run_options = $flow_graph.get_option('run_options') #if $run_options == 'prompt' tb.start() diff --git a/grc/scripts/Makefile.am b/grc/scripts/Makefile.am index 9019ec5cc..84e2759dc 100644 --- a/grc/scripts/Makefile.am +++ b/grc/scripts/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,4 +21,4 @@ include $(top_srcdir)/Makefile.common -dist_bin_SCRIPTS = gnuradio-companion usrp2_probe usrp_probe +dist_bin_SCRIPTS = gnuradio-companion diff --git a/gruel/src/Makefile.am b/gruel/src/Makefile.am index 71bdd8573..93b17d6db 100644 --- a/gruel/src/Makefile.am +++ b/gruel/src/Makefile.am @@ -19,5 +19,11 @@ # Boston, MA 02110-1301, USA. # -SUBDIRS = lib include scheme +SUBDIRS = lib include scheme + +if PYTHON + +SUBDIRS += . swig python + +endif diff --git a/gruel/src/include/gruel/Makefile.am b/gruel/src/include/gruel/Makefile.am index d7ac3d332..89a9da7f0 100644 --- a/gruel/src/include/gruel/Makefile.am +++ b/gruel/src/include/gruel/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008,2009 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,6 +26,7 @@ EXTRA_DIST += inet.h.in gruelincludedir = $(prefix)/include/gruel gruelinclude_HEADERS = \ + attributes.h \ inet.h \ msg_accepter.h \ msg_accepter_msgq.h \ diff --git a/gruel/src/include/gruel/attributes.h b/gruel/src/include/gruel/attributes.h new file mode 100644 index 000000000..fdf48c977 --- /dev/null +++ b/gruel/src/include/gruel/attributes.h @@ -0,0 +1,56 @@ +/* + * Copyright 2010 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GRUEL_ATTRIBUTES_H +#define INCLUDED_GRUEL_ATTRIBUTES_H + +//////////////////////////////////////////////////////////////////////// +// Cross-platform attribute macros +//////////////////////////////////////////////////////////////////////// +#if defined __GNUC__ +# define __GR_ATTR_ALIGNED(x) __attribute__((aligned(x))) +# define __GR_ATTR_UNUSED __attribute__((unused)) +# define __GR_ATTR_INLINE __attribute__((always_inline)) +# define __GR_ATTR_DEPRECATED __attribute__((deprecated)) +# if __GNUC__ >= 4 +# define __GR_ATTR_EXPORT __attribute__((visibility("default"))) +# define __GR_ATTR_IMPORT __attribute__((visibility("default"))) +# else +# define __GR_ATTR_EXPORT +# define __GR_ATTR_IMPORT +# endif +#elif _MSC_VER +# define __GR_ATTR_ALIGNED(x) __declspec(align(x)) +# define __GR_ATTR_UNUSED +# define __GR_ATTR_INLINE __forceinline +# define __GR_ATTR_DEPRECATED __declspec(deprecated) +# define __GR_ATTR_EXPORT __declspec(dllexport) +# define __GR_ATTR_IMPORT __declspec(dllimport) +#else +# define __GR_ATTR_ALIGNED(x) +# define __GR_ATTR_UNUSED +# define __GR_ATTR_INLINE +# define __GR_ATTR_DEPRECATED +# define __GR_ATTR_EXPORT +# define __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_GRUEL_ATTRIBUTES_H */ diff --git a/gruel/src/include/gruel/pmt.h b/gruel/src/include/gruel/pmt.h index 514b24d8b..2948abb39 100644 --- a/gruel/src/include/gruel/pmt.h +++ b/gruel/src/include/gruel/pmt.h @@ -770,6 +770,11 @@ std::string pmt_write_string(pmt_t obj); std::ostream& operator<<(std::ostream &os, pmt_t obj); +/*! + * \brief Write pmt string representation to stdout. + */ +void pmt_print(pmt_t v); + /* * ------------------------------------------------------------------------ @@ -789,8 +794,17 @@ pmt_t pmt_deserialize(std::streambuf &source); void pmt_dump_sizeof(); // debugging -} /* namespace pmt */ +/*! + * \brief Provide a simple string generating interface to pmt's serialize function + */ +std::string pmt_serialize_str(pmt_t obj); +/*! + * \brief Provide a simple string generating interface to pmt's deserialize function + */ +pmt_t pmt_deserialize_str(std::string str); + +} /* namespace pmt */ #include <gruel/pmt_sugar.h> diff --git a/gruel/src/include/gruel/thread.h b/gruel/src/include/gruel/thread.h index d72e5520c..5a8ab1876 100644 --- a/gruel/src/include/gruel/thread.h +++ b/gruel/src/include/gruel/thread.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2009,2010 Free Software Foundation, Inc. + * Copyright 2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,21 +21,17 @@ #ifndef INCLUDED_THREAD_H #define INCLUDED_THREAD_H -#include <boost/thread.hpp> -#include <boost/date_time/posix_time/posix_time.hpp> +#include <boost/thread/thread.hpp> +#include <boost/thread/mutex.hpp> +#include <boost/thread/locks.hpp> +#include <boost/thread/condition_variable.hpp> namespace gruel { typedef boost::thread thread; typedef boost::mutex mutex; - typedef boost::unique_lock<boost::mutex> scoped_lock; + typedef boost::mutex::scoped_lock scoped_lock; typedef boost::condition_variable condition_variable; - typedef boost::posix_time::time_duration duration; - - /*! - * Returns absolute time 'secs' into the future - */ - boost::system_time get_new_timeout(double secs); } /* namespace gruel */ diff --git a/gruel/src/lib/Makefile.am b/gruel/src/lib/Makefile.am index b9b35ae10..773f3aefd 100644 --- a/gruel/src/lib/Makefile.am +++ b/gruel/src/lib/Makefile.am @@ -45,7 +45,6 @@ MSG_LIB = msg/libmsg.la libgruel_la_SOURCES = \ realtime.cc \ sys_pri.cc \ - thread.cc \ thread_body_wrapper.cc \ thread_group.cc @@ -61,5 +60,9 @@ libgruel_la_LIBADD = \ # ---------------------------------------------------------------- test_gruel_SOURCES = test_gruel.cc -test_gruel_LDADD = pmt/libpmt-qa.la libgruel.la +test_gruel_LDADD = \ + $(BOOST_THREAD_LIB) \ + $(BOOST_SYSTEM_LIB) \ + $(BOOST_FILESYSTEM_LIB) \ + pmt/libpmt-qa.la libgruel.la diff --git a/gruel/src/lib/pmt/pmt_io.cc b/gruel/src/lib/pmt/pmt_io.cc index b909c1b64..1214ff588 100644 --- a/gruel/src/lib/pmt/pmt_io.cc +++ b/gruel/src/lib/pmt/pmt_io.cc @@ -26,6 +26,7 @@ #include <gruel/pmt.h> #include "pmt_int.h" #include <sstream> +#include <iostream> namespace pmt { @@ -156,3 +157,12 @@ pmt_deserialize(std::istream &source) } } /* namespace pmt */ + + +void +pmt::pmt_print(pmt_t v) +{ + std::cout << pmt_write_string(v) << std::endl; +} + + diff --git a/gruel/src/lib/pmt/pmt_serialize.cc b/gruel/src/lib/pmt/pmt_serialize.cc index 937423a93..184a31e6b 100644 --- a/gruel/src/lib/pmt/pmt_serialize.cc +++ b/gruel/src/lib/pmt/pmt_serialize.cc @@ -59,6 +59,26 @@ serialize_untagged_u32(unsigned int i, std::streambuf &sb) return sb.sputc((i >> 0) & 0xff) != std::streambuf::traits_type::eof(); } +static bool +serialize_untagged_f64(double i, std::streambuf &sb) +{ + typedef union { + double id; + uint64_t ii; + } iu_t; + iu_t iu; + iu.id = i; + sb.sputc((iu.ii >> 56) & 0xff); + sb.sputc((iu.ii >> 48) & 0xff); + sb.sputc((iu.ii >> 40) & 0xff); + sb.sputc((iu.ii >> 32) & 0xff); + sb.sputc((iu.ii >> 24) & 0xff); + sb.sputc((iu.ii >> 16) & 0xff); + sb.sputc((iu.ii >> 8) & 0xff); + return sb.sputc((iu.ii >> 0) & 0xff) != std::streambuf::traits_type::eof(); +} + + #if 0 // always writes big-endian static bool @@ -163,6 +183,41 @@ deserialize_untagged_u64(uint64_t *ip, std::streambuf &sb) } #endif +static bool +deserialize_untagged_f64(double *ip, std::streambuf &sb) +{ + std::streambuf::traits_type::int_type t; + + typedef union { + double id; + uint64_t ii; + } iu_t; + + iu_t iu; + + t = sb.sbumpc(); + iu.ii = t & 0xff; + + t = sb.sbumpc(); + iu.ii = (iu.ii<<8) | (t & 0xff); + t = sb.sbumpc(); + iu.ii = (iu.ii<<8) | (t & 0xff); + t = sb.sbumpc(); + iu.ii = (iu.ii<<8) | (t & 0xff); + t = sb.sbumpc(); + iu.ii = (iu.ii<<8) | (t & 0xff); + t = sb.sbumpc(); + iu.ii = (iu.ii<<8) | (t & 0xff); + t = sb.sbumpc(); + iu.ii = (iu.ii<<8) | (t & 0xff); + t = sb.sbumpc(); + iu.ii = (iu.ii<<8) | (t & 0xff); + + *ip = iu.id; + return t != std::streambuf::traits_type::eof(); +} + + /* * Write portable byte-serial representation of \p obj to \p sb * @@ -172,7 +227,7 @@ bool pmt_serialize(pmt_t obj, std::streambuf &sb) { bool ok = true; - + tail_recursion: if (pmt_is_bool(obj)){ @@ -217,11 +272,21 @@ pmt_serialize(pmt_t obj, std::streambuf &sb) return ok; } - if (pmt_is_real(obj)) - throw pmt_notimplemented("pmt_serialize (real)", obj); + if (pmt_is_real(obj)){ + float i = pmt_to_double(obj); + ok = serialize_untagged_u8(PST_DOUBLE, sb); + ok &= serialize_untagged_f64(i, sb); + return ok; + } + + if (pmt_is_complex(obj)){ + std::complex<double> i = pmt_to_complex(obj); + ok = serialize_untagged_u8(PST_COMPLEX, sb); + ok &= serialize_untagged_f64(i.real(), sb); + ok &= serialize_untagged_f64(i.imag(), sb); + return ok; + } - if (pmt_is_complex(obj)) - throw pmt_notimplemented("pmt_serialize (complex)", obj); } if (pmt_is_vector(obj)) @@ -251,6 +316,7 @@ pmt_deserialize(std::streambuf &sb) uint16_t u16; uint32_t u32; //uint32_t u64; + double f64; static char tmpbuf[1024]; if (!deserialize_untagged_u8(&tag, sb)) @@ -285,7 +351,18 @@ pmt_deserialize(std::streambuf &sb) return parse_pair(sb); case PST_DOUBLE: + if(!deserialize_untagged_f64(&f64, sb)) + goto error; + return pmt_from_double( f64 ); + case PST_COMPLEX: + { + double r,i; + if(!deserialize_untagged_f64(&r, sb) && !deserialize_untagged_f64(&i, sb)) + goto error; + return pmt_make_rectangular( r,i ); + } + case PST_VECTOR: case PST_DICT: case PST_UNIFORM_VECTOR: @@ -302,6 +379,26 @@ pmt_deserialize(std::streambuf &sb) throw pmt_exception("pmt_deserialize: malformed input stream", PMT_F); } + +/* + * provide a simple string accessor to the serialized pmt form + */ +std::string pmt_serialize_str(pmt_t obj){ + std::stringbuf sb; + pmt_serialize(obj, sb); + return sb.str(); +} + + +/* + * provide a simple string accessor to the deserialized pmt form + */ +pmt_t pmt_deserialize_str(std::string s){ + std::stringbuf sb(s); + return pmt_deserialize(sb); +} + + /* * This is a mostly non-recursive implementation that allows us to * deserialize very long lists w/o exhausting the evaluation stack. diff --git a/gruel/src/lib/thread.cc b/gruel/src/lib/thread.cc deleted file mode 100644 index d8f77b506..000000000 --- a/gruel/src/lib/thread.cc +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <gruel/thread.h> - -namespace gruel { - - boost::system_time - get_new_timeout(double secs) - { - return boost::get_system_time() + boost::posix_time::milliseconds(long(secs*1e3)); - } - -} diff --git a/gruel/src/python/.gitignore b/gruel/src/python/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gruel/src/python/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gr-audio-portaudio/Makefile.am b/gruel/src/python/Makefile.am index 198d89f87..5a45510d5 100644 --- a/gr-audio-portaudio/Makefile.am +++ b/gruel/src/python/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2006,2009 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,10 +21,19 @@ include $(top_srcdir)/Makefile.common -SUBDIRS = src +TESTS = +EXTRA_DIST += run_tests.in -pkgconfigdir = $(libdir)/pkgconfig -dist_pkgconfig_DATA = gnuradio-audio-portaudio.pc +if PYTHON +TESTS += run_tests + +grueldir = $(pythondir)/gruel + +noinst_PYTHON = \ + qa_pmt.py + +gruel_PYTHON = \ + __init__.py + +endif -etcdir = $(gr_prefsdir) -dist_etc_DATA = gr-audio-portaudio.conf diff --git a/gruel/src/python/__init__.py b/gruel/src/python/__init__.py new file mode 100644 index 000000000..421a9aaa8 --- /dev/null +++ b/gruel/src/python/__init__.py @@ -0,0 +1,25 @@ +# +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +# The presence of this file turns this directory into a Python package + +from pmt_swig import * + diff --git a/gr-audio-alsa/src/qa_audio_alsa.py b/gruel/src/python/qa_pmt.py index 52dbfdc7a..00cdb064e 100755 --- a/gr-audio-alsa/src/qa_audio_alsa.py +++ b/gruel/src/python/qa_pmt.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005,2007,2010 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,21 +20,23 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gr_unittest -import audio_alsa +import unittest +import pmt_swig -class test_audio_alsa (gr_unittest.TestCase): +class test_gruel_pmt(unittest.TestCase): - def setUp (self): - self.tb = gr.top_block () + def test01 (self): + a = pmt_swig.pmt_intern("a") + b = pmt_swig.pmt_from_double(123765) + d1 = pmt_swig.pmt_make_dict() + d2 = pmt_swig.pmt_dict_add(d1, a, b) + pmt_swig.pmt_print(d2) - def tearDown (self): - self.tb = None + def test02 (self): + const = 123765 + x_pmt = pmt_swig.pmt_from_double(const) + x_int = pmt_swig.pmt_to_double(x_pmt) + self.assertEqual(x_int, const) - def test_000_nop (self): - """Just see if we can import the module... - They may not have ALSA drivers, etc. Don't try to run anything""" - pass - if __name__ == '__main__': - gr_unittest.run(test_audio_alsa, "test_audio_alsa.xml") + unittest.main() diff --git a/gruel/src/python/run_tests.in b/gruel/src/python/run_tests.in new file mode 100644 index 000000000..ff399bcc6 --- /dev/null +++ b/gruel/src/python/run_tests.in @@ -0,0 +1,17 @@ +#!/bin/sh + +# 1st parameter is absolute path to component source directory +# 2nd parameter is absolute path to component build directory +# 3rd parameter is path to Python QA directory + +# For OS/X +DYLD_LIBRARY_PATH=@abs_top_builddir@/gruel/src/lib/:@abs_top_builddir@/gruel/src/swig/.libs:$DYLD_LIBRARY_PATH +export DYLD_LIBRARY_PATH + +# For Win32 +PATH=@abs_top_builddir@/gruel/:@abs_top_builddir@/gruel/.libs:$PATH + +@top_builddir@/run_tests.sh \ + @abs_top_srcdir@/gruel/src \ + @abs_top_builddir@/gruel/src \ + @srcdir@ diff --git a/gruel/src/swig/.gitignore b/gruel/src/swig/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/gruel/src/swig/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in diff --git a/gruel/src/swig/Makefile.am b/gruel/src/swig/Makefile.am new file mode 100644 index 000000000..3261e47c2 --- /dev/null +++ b/gruel/src/swig/Makefile.am @@ -0,0 +1,52 @@ +# +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +include $(top_srcdir)/Makefile.common +include $(top_srcdir)/Makefile.swig + +TESTS = + +AM_CPPFLAGS = \ + -I$(top_srcdir)/gruel/src/lib \ + $(STD_DEFINES_AND_INCLUDES) \ + $(PYTHON_CPPFLAGS) \ + $(WITH_INCLUDES) + +############################## +# SWIG interface and library +TOP_SWIG_IFILES = \ + pmt_swig.i + +# Install so that they end up available as: +# import gruel.pmt +# This ends up at: +# ${prefix}/lib/python${python_version}/site-packages/gruel/pmt +pmt_swig_pythondir_category = \ + gruel/pmt + +# additional libraries for linking with the SWIG-generated library +pmt_swig_la_swig_libadd = \ + $(abs_top_builddir)/gruel/src/lib/pmt/libpmt.la + +# additional SWIG files to be installed +pmt_swig_swiginclude_headers = \ + gr_intrusive_ptr.i + diff --git a/gr-audio-osx/src/Makefile.swig.gen b/gruel/src/swig/Makefile.swig.gen index 532433083..c6a2fb956 100644 --- a/gr-audio-osx/src/Makefile.swig.gen +++ b/gruel/src/swig/Makefile.swig.gen @@ -20,37 +20,37 @@ # Boston, MA 02110-1301, USA. # -# Makefile.swig.gen for audio_osx.i +# Makefile.swig.gen for gnuradio_core_runtime.i ## Default install locations for these files: ## ## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/audio_osx +## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_runtime ## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_osx +## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_runtime ## ## The following can be overloaded to change the install location, but ## this has to be done in the including Makefile.am -before- ## Makefile.swig is included. -audio_osx_pythondir_category ?= gnuradio/audio_osx -audio_osx_pylibdir_category ?= $(audio_osx_pythondir_category) -audio_osx_pythondir = $(pythondir)/$(audio_osx_pythondir_category) -audio_osx_pylibdir = $(pyexecdir)/$(audio_osx_pylibdir_category) +pmt_swig_pythondir_category ?= gruel/pmt_swig +pmt_swig_pylibdir_category ?= $(pmt_swig_pythondir_category) +pmt_swig_pythondir = $(pythondir)/$(pmt_swig_pythondir_category) +pmt_swig_pylibdir = $(pyexecdir)/$(pmt_swig_pylibdir_category) # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -audio_osx_scmlibdir = $(libdir) +pmt_swig_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/audio_osx +# is installed, usually /usr/share/guile/site/gnuradio_core_runtime # FIXME: determince whether these should be installed with gnuradio. -audio_osx_scmdir = $(guiledir) +pmt_swig_scmdir = $(guiledir) ## SWIG headers are always installed into the same directory. -audio_osx_swigincludedir = $(swigincludedir) +pmt_swig_swigincludedir = $(swigincludedir) ## This is a template file for a "generated" Makefile addition (in ## this case, "Makefile.swig.gen"). By including the top-level @@ -75,71 +75,41 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## Makefile.am by setting the variable value there, then including ## Makefile.swig . -audio_osx_swiginclude_HEADERS = \ - audio_osx.i \ - $(audio_osx_swiginclude_headers) +pmt_swig_swiginclude_HEADERS = \ + pmt_swig.i \ + $(pmt_swig_swiginclude_headers) if PYTHON -audio_osx_pylib_LTLIBRARIES = \ - _audio_osx.la +pmt_swig_pylib_LTLIBRARIES = \ + _pmt_swig.la -_audio_osx_la_SOURCES = \ - python/audio_osx.cc \ - $(audio_osx_la_swig_sources) +_pmt_swig_la_SOURCES = \ + python/pmt_swig.cc \ + $(pmt_swig_la_swig_sources) -audio_osx_python_PYTHON = \ - audio_osx.py \ - $(audio_osx_python) +pmt_swig_python_PYTHON = \ + pmt_swig.py \ + $(pmt_swig_python) -_audio_osx_la_LIBADD = \ +_pmt_swig_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(audio_osx_la_swig_libadd) + $(pmt_swig_la_swig_libadd) -_audio_osx_la_LDFLAGS = \ +_pmt_swig_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_osx_la_swig_ldflags) + $(pmt_swig_la_swig_ldflags) -_audio_osx_la_CXXFLAGS = \ +_pmt_swig_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(audio_osx_la_swig_cxxflags) + $(pmt_swig_la_swig_cxxflags) -python/audio_osx.cc: audio_osx.py -audio_osx.py: audio_osx.i +python/pmt_swig.cc: pmt_swig.py +pmt_swig.py: pmt_swig.i # Include the python dependencies for this file --include python/audio_osx.d +-include python/pmt_swig.d endif # end of if python -if GUILE - -audio_osx_scmlib_LTLIBRARIES = \ - libguile-gnuradio-audio_osx.la -libguile_gnuradio_audio_osx_la_SOURCES = \ - guile/audio_osx.cc \ - $(audio_osx_la_swig_sources) -nobase_audio_osx_scm_DATA = \ - gnuradio/audio_osx.scm \ - gnuradio/audio_osx-primitive.scm -libguile_gnuradio_audio_osx_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(audio_osx_la_swig_libadd) -libguile_gnuradio_audio_osx_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(audio_osx_la_swig_ldflags) -libguile_gnuradio_audio_osx_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(audio_osx_la_swig_cxxflags) - -guile/audio_osx.cc: gnuradio/audio_osx.scm -gnuradio/audio_osx.scm: audio_osx.i -gnuradio/audio_osx-primitive.scm: gnuradio/audio_osx.scm - -# Include the guile dependencies for this file --include guile/audio_osx.d - -endif # end of GUILE - diff --git a/gr-audio-alsa/build-stamp b/gruel/src/swig/__init__.py index e69de29bb..e69de29bb 100644 --- a/gr-audio-alsa/build-stamp +++ b/gruel/src/swig/__init__.py diff --git a/gruel/src/swig/gr_intrusive_ptr.i b/gruel/src/swig/gr_intrusive_ptr.i new file mode 100644 index 000000000..eef5bc84d --- /dev/null +++ b/gruel/src/swig/gr_intrusive_ptr.i @@ -0,0 +1,102 @@ +// This file was borrowed from the SWIG project to allow use to +// wrap PMTs that use intrusive pointers. This is only necessary +// to support backwards compatability with older distributions of +// Linux that do not natively support a new enough version of SWIG. +// We do this to prevent having to update our dependency on a new +// SWIG. Eventually, the need for this should go away. + +// Allow for different namespaces for shared_ptr / intrusive_ptr - they could be boost or std or std::tr1 +// For example for std::tr1, use: +// #define SWIG_SHARED_PTR_NAMESPACE std +// #define SWIG_SHARED_PTR_SUBNAMESPACE tr1 +// #define SWIG_INTRUSIVE_PTR_NAMESPACE boost +// #define SWIG_INTRUSIVE_PTR_SUBNAMESPACE + +#if !defined(SWIG_INTRUSIVE_PTR_NAMESPACE) +# define SWIG_INTRUSIVE_PTR_NAMESPACE boost +#endif + +#if defined(SWIG_INTRUSIVE_PTR_SUBNAMESPACE) +# define SWIG_INTRUSIVE_PTR_QNAMESPACE SWIG_INTRUSIVE_PTR_NAMESPACE::SWIG_INTRUSIVE_PTR_SUBNAMESPACE +#else +# define SWIG_INTRUSIVE_PTR_QNAMESPACE SWIG_INTRUSIVE_PTR_NAMESPACE +#endif + +namespace SWIG_INTRUSIVE_PTR_NAMESPACE { +#if defined(SWIG_INTRUSIVE_PTR_SUBNAMESPACE) + namespace SWIG_INTRUSIVE_PTR_SUBNAMESPACE { +#endif + template <class T> class intrusive_ptr { + }; +#if defined(SWIG_INTRUSIVE_PTR_SUBNAMESPACE) + } +#endif +} + +%fragment("SWIG_intrusive_deleter", "header") { +template<class T> struct SWIG_intrusive_deleter { + void operator()(T *p) { + if (p) + intrusive_ptr_release(p); + } +}; +} + +%fragment("SWIG_null_deleter", "header") { +struct SWIG_null_deleter { + void operator() (void const *) const { + } +}; +%#define SWIG_NO_NULL_DELETER_0 , SWIG_null_deleter() +%#define SWIG_NO_NULL_DELETER_1 +} + +// Main user macro for defining intrusive_ptr typemaps for both const and non-const pointer types +// For plain classes, do not use for derived classes +%define SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE...) +SWIG_INTRUSIVE_PTR_TYPEMAPS(PROXYCLASS, , TYPE) +SWIG_INTRUSIVE_PTR_TYPEMAPS(PROXYCLASS, const, TYPE) +%enddef + +// Main user macro for defining intrusive_ptr typemaps for both const and non-const pointer types +// For derived classes +%define SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE...) +SWIG_INTRUSIVE_PTR_TYPEMAPS(PROXYCLASS, , TYPE) +SWIG_INTRUSIVE_PTR_TYPEMAPS(PROXYCLASS, const, TYPE) +%types(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > = SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< BASECLASSTYPE >) %{ + *newmemory = SWIG_CAST_NEW_MEMORY; + return (void *) new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< BASECLASSTYPE >(*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *)$from); + %} +%extend TYPE { + static SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< BASECLASSTYPE > SWIGSharedPtrUpcast(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast) { + return swigSharedPtrUpcast; + } +} +%enddef + +// Extra user macro for including classes in intrusive_ptr typemaps for both const and non-const pointer types +// This caters for classes which cannot be wrapped by intrusive_ptrs but are still part of the class hierarchy +// For plain classes, do not use for derived classes +%define SWIG_INTRUSIVE_PTR_NO_WRAP(PROXYCLASS, TYPE...) +SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(PROXYCLASS, , TYPE) +SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(PROXYCLASS, const, TYPE) +%enddef + +// Extra user macro for including classes in intrusive_ptr typemaps for both const and non-const pointer types +// This caters for classes which cannot be wrapped by intrusive_ptrs but are still part of the class hierarchy +// For derived classes +%define SWIG_INTRUSIVE_PTR_DERIVED_NO_WRAP(PROXYCLASS, BASECLASSTYPE, TYPE...) +SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(PROXYCLASS, , TYPE) +SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(PROXYCLASS, const, TYPE) +%types(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > = SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< BASECLASSTYPE >) %{ + *newmemory = SWIG_CAST_NEW_MEMORY; + return (void *) new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< BASECLASSTYPE >(*(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *)$from); +%} +%extend TYPE { + static SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< BASECLASSTYPE > SWIGSharedPtrUpcast(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast) { + return swigSharedPtrUpcast; + } +} +%enddef + + diff --git a/gruel/src/swig/pmt_swig.i b/gruel/src/swig/pmt_swig.i new file mode 100644 index 000000000..3b0eb45c8 --- /dev/null +++ b/gruel/src/swig/pmt_swig.i @@ -0,0 +1,761 @@ +/* -*- c++ -*- */ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +%module pmt +%include "std_string.i" +%include "stdint.i" +%{ +#include <boost/intrusive_ptr.hpp> +#include <boost/shared_ptr.hpp> +#include <boost/any.hpp> +#include <complex> +#include <string> +#include <stdint.h> +#include <iosfwd> +#include <stdexcept> +#include <gruel/pmt.h> +using namespace pmt; +%} + +// Template intrusive_ptr for Swig to avoid dereferencing issues +class pmt_base; +//%import <intrusive_ptr.i> +%import <gr_intrusive_ptr.i> +%template(swig_int_ptr) boost::intrusive_ptr<pmt_base>; + +typedef boost::intrusive_ptr<pmt_base> pmt_t; + +/* + * ------------------------------------------------------------------------ + * Booleans. Two constants, #t and #f. + * + * In predicates, anything that is not #f is considered true. + * I.e., there is a single false value, #f. + * ------------------------------------------------------------------------ + */ +extern const pmt_t PMT_T; +extern const pmt_t PMT_F; + +//! Return true if obj is \#t or \#f, else return false. +bool pmt_is_bool(pmt_t obj); + +//! Return false if obj is \#f, else return true. +bool pmt_is_true(pmt_t obj); + +//! Return true if obj is \#f, else return true. +bool pmt_is_false(pmt_t obj); + +//! Return \#f is val is false, else return \#t. +pmt_t pmt_from_bool(bool val); + +//! Return true if val is PMT_T, return false when val is PMT_F, +// else raise wrong_type exception. +bool pmt_to_bool(pmt_t val); + +/* + * ------------------------------------------------------------------------ + * Symbols + * ------------------------------------------------------------------------ + */ + +//! Return true if obj is a symbol, else false. +bool pmt_is_symbol(const pmt_t& obj); + +//! Return the symbol whose name is \p s. +pmt_t pmt_string_to_symbol(const std::string &s); + +//! Alias for pmt_string_to_symbol +pmt_t pmt_intern(const std::string &s); + + +/*! + * If \p is a symbol, return the name of the symbol as a string. + * Otherwise, raise the wrong_type exception. + */ +const std::string pmt_symbol_to_string(const pmt_t& sym); + +/* + * ------------------------------------------------------------------------ + * Numbers: we support integer, real and complex + * ------------------------------------------------------------------------ + */ + +//! Return true if obj is any kind of number, else false. +bool pmt_is_number(pmt_t obj); + +/* + * ------------------------------------------------------------------------ + * Integers + * ------------------------------------------------------------------------ + */ + +//! Return true if \p x is an integer number, else false +bool pmt_is_integer(pmt_t x); + +//! Return the pmt value that represents the integer \p x. +pmt_t pmt_from_long(long x); + +/*! + * \brief Convert pmt to long if possible. + * + * When \p x represents an exact integer that fits in a long, + * return that integer. Else raise an exception, either wrong_type + * when x is not an exact integer, or out_of_range when it doesn't fit. + */ +long pmt_to_long(pmt_t x); + +/* + * ------------------------------------------------------------------------ + * uint64_t + * ------------------------------------------------------------------------ + */ + +//! Return true if \p x is an uint64 number, else false +bool pmt_is_uint64(pmt_t x); + +//! Return the pmt value that represents the uint64 \p x. +pmt_t pmt_from_uint64(uint64_t x); + +/*! + * \brief Convert pmt to uint64 if possible. + * + * When \p x represents an exact integer that fits in a uint64, + * return that uint64. Else raise an exception, either wrong_type + * when x is not an exact uint64, or out_of_range when it doesn't fit. + */ +uint64_t pmt_to_uint64(pmt_t x); + +/* + * ------------------------------------------------------------------------ + * Reals + * ------------------------------------------------------------------------ + */ + +/* + * \brief Return true if \p obj is a real number, else false. + */ +bool pmt_is_real(pmt_t obj); + +//! Return the pmt value that represents double \p x. +pmt_t pmt_from_double(double x); + +/*! + * \brief Convert pmt to double if possible. + * + * Returns the number closest to \p val that is representable + * as a double. The argument \p val must be a real or integer, otherwise + * a wrong_type exception is raised. + */ +double pmt_to_double(pmt_t x); + +/* + * ------------------------------------------------------------------------ + * Complex + * ------------------------------------------------------------------------ + */ + +/*! + * \brief return true if \p obj is a complex number, false otherwise. + */ +bool pmt_is_complex(pmt_t obj); + +//! Return a complex number constructed of the given real and imaginary parts. +pmt_t pmt_make_rectangular(double re, double im); + +/*! + * If \p z is complex, real or integer, return the closest complex<double>. + * Otherwise, raise the wrong_type exception. + */ +std::complex<double> pmt_to_complex(pmt_t z); + +/* + * ------------------------------------------------------------------------ + * Pairs + * ------------------------------------------------------------------------ + */ + +extern const pmt_t PMT_NIL; //< the empty list + +//! Return true if \p x is the empty list, otherwise return false. +bool pmt_is_null(const pmt_t& x); + +//! Return true if \p obj is a pair, else false. +bool pmt_is_pair(const pmt_t& obj); + +//! Return a newly allocated pair whose car is \p x and whose cdr is \p y. +pmt_t pmt_cons(const pmt_t& x, const pmt_t& y); + +//! If \p pair is a pair, return the car of the \p pair, otherwise raise wrong_type. +pmt_t pmt_car(const pmt_t& pair); + +//! If \p pair is a pair, return the cdr of the \p pair, otherwise raise wrong_type. +pmt_t pmt_cdr(const pmt_t& pair); + +//! Stores \p value in the car field of \p pair. +void pmt_set_car(pmt_t pair, pmt_t value); + +//! Stores \p value in the cdr field of \p pair. +void pmt_set_cdr(pmt_t pair, pmt_t value); + +pmt_t pmt_caar(pmt_t pair); +pmt_t pmt_cadr(pmt_t pair); +pmt_t pmt_cdar(pmt_t pair); +pmt_t pmt_cddr(pmt_t pair); +pmt_t pmt_caddr(pmt_t pair); +pmt_t pmt_cadddr(pmt_t pair); + +/* + * ------------------------------------------------------------------------ + * Tuples + * + * Store a fixed number of objects. Tuples are not modifiable, and thus + * are excellent for use as messages. Indexing is zero based. + * Access time to an element is O(1). + * ------------------------------------------------------------------------ + */ + +//! Return true if \p x is a tuple, othewise false. +bool pmt_is_tuple(pmt_t x); + +pmt_t pmt_make_tuple(); +pmt_t pmt_make_tuple(const pmt_t &e0); +pmt_t pmt_make_tuple(const pmt_t &e0, const pmt_t &e1); +pmt_t pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2); +pmt_t pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3); +pmt_t pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4); +pmt_t pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4, const pmt_t &e5); +pmt_t pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4, const pmt_t &e5, const pmt_t &e6); +pmt_t pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4, const pmt_t &e5, const pmt_t &e6, const pmt_t &e7); +pmt_t pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4, const pmt_t &e5, const pmt_t &e6, const pmt_t &e7, const pmt_t &e8); +pmt_t pmt_make_tuple(const pmt_t &e0, const pmt_t &e1, const pmt_t &e2, const pmt_t &e3, const pmt_t &e4, const pmt_t &e5, const pmt_t &e6, const pmt_t &e7, const pmt_t &e8, const pmt_t &e9); + +/*! + * If \p x is a vector or proper list, return a tuple containing the elements of x + */ +pmt_t pmt_to_tuple(const pmt_t &x); + +/*! + * Return the contents of position \p k of \p tuple. + * \p k must be a valid index of \p tuple. + */ +pmt_t pmt_tuple_ref(const pmt_t &tuple, size_t k); + +/* + * ------------------------------------------------------------------------ + * Vectors + * + * These vectors can hold any kind of objects. Indexing is zero based. + * ------------------------------------------------------------------------ + */ + +//! Return true if \p x is a vector, othewise false. +bool pmt_is_vector(pmt_t x); + +//! Make a vector of length \p k, with initial values set to \p fill +pmt_t pmt_make_vector(size_t k, pmt_t fill); + +/*! + * Return the contents of position \p k of \p vector. + * \p k must be a valid index of \p vector. + */ +pmt_t pmt_vector_ref(pmt_t vector, size_t k); + +//! Store \p obj in position \p k. +void pmt_vector_set(pmt_t vector, size_t k, pmt_t obj); + +//! Store \p fill in every position of \p vector +void pmt_vector_fill(pmt_t vector, pmt_t fill); + +/* + * ------------------------------------------------------------------------ + * Binary Large Objects (BLOBs) + * + * Handy for passing around uninterpreted chunks of memory. + * ------------------------------------------------------------------------ + */ + +//! Return true if \p x is a blob, othewise false. +bool pmt_is_blob(pmt_t x); + +/*! + * \brief Make a blob given a pointer and length in bytes + * + * \param buf is the pointer to data to use to create blob + * \param len is the size of the data in bytes. + * + * The data is copied into the blob. + */ +pmt_t pmt_make_blob(const void *buf, size_t len); + +//! Return a pointer to the blob's data +const void *pmt_blob_data(pmt_t blob); + +//! Return the blob's length in bytes +size_t pmt_blob_length(pmt_t blob); + +/*! + * <pre> + * ------------------------------------------------------------------------ + * Uniform Numeric Vectors + * + * A uniform numeric vector is a vector whose elements are all of single + * numeric type. pmt offers uniform numeric vectors for signed and + * unsigned 8-bit, 16-bit, 32-bit, and 64-bit integers, two sizes of + * floating point values, and complex floating-point numbers of these + * two sizes. Indexing is zero based. + * + * The names of the functions include these tags in their names: + * + * u8 unsigned 8-bit integers + * s8 signed 8-bit integers + * u16 unsigned 16-bit integers + * s16 signed 16-bit integers + * u32 unsigned 32-bit integers + * s32 signed 32-bit integers + * u64 unsigned 64-bit integers + * s64 signed 64-bit integers + * f32 the C++ type float + * f64 the C++ type double + * c32 the C++ type complex<float> + * c64 the C++ type complex<double> + * ------------------------------------------------------------------------ + * </pre> + */ + +//! true if \p x is any kind of uniform numeric vector +bool pmt_is_uniform_vector(pmt_t x); + +bool pmt_is_u8vector(pmt_t x); +bool pmt_is_s8vector(pmt_t x); +bool pmt_is_u16vector(pmt_t x); +bool pmt_is_s16vector(pmt_t x); +bool pmt_is_u32vector(pmt_t x); +bool pmt_is_s32vector(pmt_t x); +bool pmt_is_u64vector(pmt_t x); +bool pmt_is_s64vector(pmt_t x); +bool pmt_is_f32vector(pmt_t x); +bool pmt_is_f64vector(pmt_t x); +bool pmt_is_c32vector(pmt_t x); +bool pmt_is_c64vector(pmt_t x); + +pmt_t pmt_make_u8vector(size_t k, uint8_t fill); +pmt_t pmt_make_s8vector(size_t k, int8_t fill); +pmt_t pmt_make_u16vector(size_t k, uint16_t fill); +pmt_t pmt_make_s16vector(size_t k, int16_t fill); +pmt_t pmt_make_u32vector(size_t k, uint32_t fill); +pmt_t pmt_make_s32vector(size_t k, int32_t fill); +pmt_t pmt_make_u64vector(size_t k, uint64_t fill); +pmt_t pmt_make_s64vector(size_t k, int64_t fill); +pmt_t pmt_make_f32vector(size_t k, float fill); +pmt_t pmt_make_f64vector(size_t k, double fill); +pmt_t pmt_make_c32vector(size_t k, std::complex<float> fill); +pmt_t pmt_make_c64vector(size_t k, std::complex<double> fill); + +pmt_t pmt_init_u8vector(size_t k, const uint8_t *data); +pmt_t pmt_init_s8vector(size_t k, const int8_t *data); +pmt_t pmt_init_u16vector(size_t k, const uint16_t *data); +pmt_t pmt_init_s16vector(size_t k, const int16_t *data); +pmt_t pmt_init_u32vector(size_t k, const uint32_t *data); +pmt_t pmt_init_s32vector(size_t k, const int32_t *data); +pmt_t pmt_init_f32vector(size_t k, const float *data); +pmt_t pmt_init_f64vector(size_t k, const double *data); +pmt_t pmt_init_c32vector(size_t k, const std::complex<float> *data); +pmt_t pmt_init_c64vector(size_t k, const std::complex<double> *data); + +uint8_t pmt_u8vector_ref(pmt_t v, size_t k); +int8_t pmt_s8vector_ref(pmt_t v, size_t k); +uint16_t pmt_u16vector_ref(pmt_t v, size_t k); +int16_t pmt_s16vector_ref(pmt_t v, size_t k); +uint32_t pmt_u32vector_ref(pmt_t v, size_t k); +int32_t pmt_s32vector_ref(pmt_t v, size_t k); +uint64_t pmt_u64vector_ref(pmt_t v, size_t k); +int64_t pmt_s64vector_ref(pmt_t v, size_t k); +float pmt_f32vector_ref(pmt_t v, size_t k); +double pmt_f64vector_ref(pmt_t v, size_t k); +std::complex<float> pmt_c32vector_ref(pmt_t v, size_t k); +std::complex<double> pmt_c64vector_ref(pmt_t v, size_t k); + +void pmt_u8vector_set(pmt_t v, size_t k, uint8_t x); //< v[k] = x +void pmt_s8vector_set(pmt_t v, size_t k, int8_t x); +void pmt_u16vector_set(pmt_t v, size_t k, uint16_t x); +void pmt_s16vector_set(pmt_t v, size_t k, int16_t x); +void pmt_u32vector_set(pmt_t v, size_t k, uint32_t x); +void pmt_s32vector_set(pmt_t v, size_t k, int32_t x); +void pmt_u64vector_set(pmt_t v, size_t k, uint64_t x); +void pmt_s64vector_set(pmt_t v, size_t k, int64_t x); +void pmt_f32vector_set(pmt_t v, size_t k, float x); +void pmt_f64vector_set(pmt_t v, size_t k, double x); +void pmt_c32vector_set(pmt_t v, size_t k, std::complex<float> x); +void pmt_c64vector_set(pmt_t v, size_t k, std::complex<double> x); + +// Return const pointers to the elements + +const void *pmt_uniform_vector_elements(pmt_t v, size_t &len); //< works with any; len is in bytes + +const uint8_t *pmt_u8vector_elements(pmt_t v, size_t &len); //< len is in elements +const int8_t *pmt_s8vector_elements(pmt_t v, size_t &len); //< len is in elements +const uint16_t *pmt_u16vector_elements(pmt_t v, size_t &len); //< len is in elements +const int16_t *pmt_s16vector_elements(pmt_t v, size_t &len); //< len is in elements +const uint32_t *pmt_u32vector_elements(pmt_t v, size_t &len); //< len is in elements +const int32_t *pmt_s32vector_elements(pmt_t v, size_t &len); //< len is in elements +const uint64_t *pmt_u64vector_elements(pmt_t v, size_t &len); //< len is in elements +const int64_t *pmt_s64vector_elements(pmt_t v, size_t &len); //< len is in elements +const float *pmt_f32vector_elements(pmt_t v, size_t &len); //< len is in elements +const double *pmt_f64vector_elements(pmt_t v, size_t &len); //< len is in elements +const std::complex<float> *pmt_c32vector_elements(pmt_t v, size_t &len); //< len is in elements +const std::complex<double> *pmt_c64vector_elements(pmt_t v, size_t &len); //< len is in elements + +// Return non-const pointers to the elements + +void *pmt_uniform_vector_writable_elements(pmt_t v, size_t &len); //< works with any; len is in bytes + +uint8_t *pmt_u8vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +int8_t *pmt_s8vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +uint16_t *pmt_u16vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +int16_t *pmt_s16vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +uint32_t *pmt_u32vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +int32_t *pmt_s32vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +uint64_t *pmt_u64vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +int64_t *pmt_s64vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +float *pmt_f32vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +double *pmt_f64vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +std::complex<float> *pmt_c32vector_writable_elements(pmt_t v, size_t &len); //< len is in elements +std::complex<double> *pmt_c64vector_writable_elements(pmt_t v, size_t &len); //< len is in elements + +/* + * ------------------------------------------------------------------------ + * Dictionary (a.k.a associative array, hash, map) + * + * This is a functional data structure that is persistent. Updating a + * functional data structure does not destroy the existing version, but + * rather creates a new version that coexists with the old. + * ------------------------------------------------------------------------ + */ + +//! Return true if \p obj is a dictionary +bool pmt_is_dict(const pmt_t &obj); + +//! Make an empty dictionary +pmt_t pmt_make_dict(); + +//! Return a new dictionary with \p key associated with \p value. +pmt_t pmt_dict_add(const pmt_t &dict, const pmt_t &key, const pmt_t &value); + +//! Return a new dictionary with \p key removed. +pmt_t pmt_dict_delete(const pmt_t &dict, const pmt_t &key); + +//! Return true if \p key exists in \p dict +bool pmt_dict_has_key(const pmt_t &dict, const pmt_t &key); + +//! If \p key exists in \p dict, return associated value; otherwise return \p not_found. +pmt_t pmt_dict_ref(const pmt_t &dict, const pmt_t &key, const pmt_t ¬_found); + +//! Return list of (key . value) pairs +pmt_t pmt_dict_items(pmt_t dict); + +//! Return list of keys +pmt_t pmt_dict_keys(pmt_t dict); + +//! Return list of values +pmt_t pmt_dict_values(pmt_t dict); + +/* + * ------------------------------------------------------------------------ + * Any (wraps boost::any -- can be used to wrap pretty much anything) + * + * Cannot be serialized or used across process boundaries. + * See http://www.boost.org/doc/html/any.html + * ------------------------------------------------------------------------ + */ + +//! Return true if \p obj is an any +bool pmt_is_any(pmt_t obj); + +//! make an any +pmt_t pmt_make_any(const boost::any &any); + +//! Return underlying boost::any +boost::any pmt_any_ref(pmt_t obj); + +//! Store \p any in \p obj +void pmt_any_set(pmt_t obj, const boost::any &any); + + +/* + * ------------------------------------------------------------------------ + * msg_accepter -- pmt representation of gruel::msg_accepter + * ------------------------------------------------------------------------ + */ +//! Return true if \p obj is a msg_accepter +bool pmt_is_msg_accepter(const pmt_t &obj); + +//! make a msg_accepter +pmt_t pmt_make_msg_accepter(boost::shared_ptr<gruel::msg_accepter> ma); + +//! Return underlying msg_accepter +boost::shared_ptr<gruel::msg_accepter> pmt_msg_accepter_ref(const pmt_t &obj); + +/* + * ------------------------------------------------------------------------ + * General functions + * ------------------------------------------------------------------------ + */ + +//! Return true if x and y are the same object; otherwise return false. +bool pmt_eq(const pmt_t& x, const pmt_t& y); + +/*! + * \brief Return true if x and y should normally be regarded as the same object, else false. + * + * <pre> + * eqv returns true if: + * x and y are the same object. + * x and y are both \#t or both \#f. + * x and y are both symbols and their names are the same. + * x and y are both numbers, and are numerically equal. + * x and y are both the empty list (nil). + * x and y are pairs or vectors that denote same location in store. + * </pre> + */ +bool pmt_eqv(const pmt_t& x, const pmt_t& y); + +/*! + * pmt_equal recursively compares the contents of pairs and vectors, + * applying pmt_eqv on other objects such as numbers and symbols. + * pmt_equal may fail to terminate if its arguments are circular data + * structures. + */ +bool pmt_equal(const pmt_t& x, const pmt_t& y); + + +//! Return the number of elements in v +size_t pmt_length(const pmt_t& v); + +/*! + * \brief Find the first pair in \p alist whose car field is \p obj + * and return that pair. + * + * \p alist (for "association list") must be a list of pairs. If no pair + * in \p alist has \p obj as its car then \#f is returned. + * Uses pmt_eq to compare \p obj with car fields of the pairs in \p alist. + */ +pmt_t pmt_assq(pmt_t obj, pmt_t alist); + +/*! + * \brief Find the first pair in \p alist whose car field is \p obj + * and return that pair. + * + * \p alist (for "association list") must be a list of pairs. If no pair + * in \p alist has \p obj as its car then \#f is returned. + * Uses pmt_eqv to compare \p obj with car fields of the pairs in \p alist. + */ +pmt_t pmt_assv(pmt_t obj, pmt_t alist); + +/*! + * \brief Find the first pair in \p alist whose car field is \p obj + * and return that pair. + * + * \p alist (for "association list") must be a list of pairs. If no pair + * in \p alist has \p obj as its car then \#f is returned. + * Uses pmt_equal to compare \p obj with car fields of the pairs in \p alist. + */ +pmt_t pmt_assoc(pmt_t obj, pmt_t alist); + +/*! + * \brief Apply \p proc element-wise to the elements of list and returns + * a list of the results, in order. + * + * \p list must be a list. The dynamic order in which \p proc is + * applied to the elements of \p list is unspecified. + */ +pmt_t pmt_map(pmt_t proc(const pmt_t&), pmt_t list); + +/*! + * \brief reverse \p list. + * + * \p list must be a proper list. + */ +pmt_t pmt_reverse(pmt_t list); + +/*! + * \brief destructively reverse \p list. + * + * \p list must be a proper list. + */ +pmt_t pmt_reverse_x(pmt_t list); + +/*! + * \brief (acons x y a) == (cons (cons x y) a) + */ +inline static pmt_t +pmt_acons(pmt_t x, pmt_t y, pmt_t a) +{ + return pmt_cons(pmt_cons(x, y), a); +} + +/*! + * \brief locates \p nth element of \n list where the car is the 'zeroth' element. + */ +pmt_t pmt_nth(size_t n, pmt_t list); + +/*! + * \brief returns the tail of \p list that would be obtained by calling + * cdr \p n times in succession. + */ +pmt_t pmt_nthcdr(size_t n, pmt_t list); + +/*! + * \brief Return the first sublist of \p list whose car is \p obj. + * If \p obj does not occur in \p list, then \#f is returned. + * pmt_memq use pmt_eq to compare \p obj with the elements of \p list. + */ +pmt_t pmt_memq(pmt_t obj, pmt_t list); + +/*! + * \brief Return the first sublist of \p list whose car is \p obj. + * If \p obj does not occur in \p list, then \#f is returned. + * pmt_memv use pmt_eqv to compare \p obj with the elements of \p list. + */ +pmt_t pmt_memv(pmt_t obj, pmt_t list); + +/*! + * \brief Return the first sublist of \p list whose car is \p obj. + * If \p obj does not occur in \p list, then \#f is returned. + * pmt_member use pmt_equal to compare \p obj with the elements of \p list. + */ +pmt_t pmt_member(pmt_t obj, pmt_t list); + +/*! + * \brief Return true if every element of \p list1 appears in \p list2, and false otherwise. + * Comparisons are done with pmt_eqv. + */ +bool pmt_subsetp(pmt_t list1, pmt_t list2); + +/*! + * \brief Return a list of length 1 containing \p x1 + */ +pmt_t pmt_list1(const pmt_t& x1); + +/*! + * \brief Return a list of length 2 containing \p x1, \p x2 + */ +pmt_t pmt_list2(const pmt_t& x1, const pmt_t& x2); + +/*! + * \brief Return a list of length 3 containing \p x1, \p x2, \p x3 + */ +pmt_t pmt_list3(const pmt_t& x1, const pmt_t& x2, const pmt_t& x3); + +/*! + * \brief Return a list of length 4 containing \p x1, \p x2, \p x3, \p x4 + */ +pmt_t pmt_list4(const pmt_t& x1, const pmt_t& x2, const pmt_t& x3, const pmt_t& x4); + +/*! + * \brief Return a list of length 5 containing \p x1, \p x2, \p x3, \p x4, \p x5 + */ +pmt_t pmt_list5(const pmt_t& x1, const pmt_t& x2, const pmt_t& x3, const pmt_t& x4, const pmt_t& x5); + +/*! + * \brief Return a list of length 6 containing \p x1, \p x2, \p x3, \p x4, \p + * x5, \p x6 + */ +pmt_t pmt_list6(const pmt_t& x1, const pmt_t& x2, const pmt_t& x3, const pmt_t& x4, const pmt_t& x5, const pmt_t& x6); + +/*! + * \brief Return \p list with \p item added to it. + */ +pmt_t pmt_list_add(pmt_t list, const pmt_t& item); + + +/* + * ------------------------------------------------------------------------ + * read / write + * ------------------------------------------------------------------------ + */ +extern const pmt_t PMT_EOF; //< The end of file object + +//! return true if obj is the EOF object, otherwise return false. +bool pmt_is_eof_object(pmt_t obj); + +/*! + * read converts external representations of pmt objects into the + * objects themselves. Read returns the next object parsable from + * the given input port, updating port to point to the first + * character past the end of the external representation of the + * object. + * + * If an end of file is encountered in the input before any + * characters are found that can begin an object, then an end of file + * object is returned. The port remains open, and further attempts + * to read will also return an end of file object. If an end of file + * is encountered after the beginning of an object's external + * representation, but the external representation is incomplete and + * therefore not parsable, an error is signaled. + */ +pmt_t pmt_read(std::istream &port); + +/*! + * Write a written representation of \p obj to the given \p port. + */ +void pmt_write(pmt_t obj, std::ostream &port); + +/*! + * Return a string representation of \p obj. + * This is the same output as would be generated by pmt_write. + */ +std::string pmt_write_string(pmt_t obj); + + +/*! + * \brief Write pmt string representation to stdout. + */ +void pmt_print(pmt_t v); + + +/* + * ------------------------------------------------------------------------ + * portable byte stream representation + * ------------------------------------------------------------------------ + */ +/*! + * \brief Write portable byte-serial representation of \p obj to \p sink + */ +bool pmt_serialize(pmt_t obj, std::streambuf &sink); + +/*! + * \brief Create obj from portable byte-serial representation + */ +pmt_t pmt_deserialize(std::streambuf &source); + + +void pmt_dump_sizeof(); // debugging + +/*! + * \brief Provide a simple string generating interface to pmt's serialize function + */ +std::string pmt_serialize_str(pmt_t obj); + +/*! + * \brief Provide a simple string generating interface to pmt's deserialize function + */ +pmt_t pmt_deserialize_str(std::string str); diff --git a/usrp/host/lib/db_flexrf.cc b/usrp/host/lib/db_flexrf.cc index 2819c19bd..ddd87012d 100644 --- a/usrp/host/lib/db_flexrf.cc +++ b/usrp/host/lib/db_flexrf.cc @@ -24,6 +24,9 @@ #include <usrp/db_flexrf.h> #include <db_base_impl.h> +#ifdef HAVE_TIME_H +#include <ctime> +#endif // d'board i/o pin defs // Tx and Rx have shared defs, but different i/o regs diff --git a/usrp/host/lib/db_wbxng.cc b/usrp/host/lib/db_wbxng.cc index 89200653e..4d17c72d1 100644 --- a/usrp/host/lib/db_wbxng.cc +++ b/usrp/host/lib/db_wbxng.cc @@ -26,6 +26,9 @@ #include "db_wbxng_adf4350.h" #include <db_base_impl.h> #include <stdio.h> +#ifdef HAVE_TIME_H +#include <ctime> +#endif // d'board i/o pin defs // Tx and Rx have shared defs, but different i/o regs diff --git a/usrp/host/lib/fusb_win32.cc b/usrp/host/lib/fusb_win32.cc index 8900576d9..8c218534b 100644 --- a/usrp/host/lib/fusb_win32.cc +++ b/usrp/host/lib/fusb_win32.cc @@ -29,6 +29,7 @@ #include <assert.h> #include <stdexcept> #include <string.h> +#include <cstdio> static const int MAX_BLOCK_SIZE = fusb_sysconfig::max_block_size(); static const int DEFAULT_BLOCK_SIZE = MAX_BLOCK_SIZE; diff --git a/usrp/host/misc/Makefile.am b/usrp/host/misc/Makefile.am index 935dc74b5..d238311e3 100644 --- a/usrp/host/misc/Makefile.am +++ b/usrp/host/misc/Makefile.am @@ -24,10 +24,8 @@ include $(top_srcdir)/Makefile.common EXTRA_DIST += \ getopt.c getopt.h \ gettimeofday.c \ - tempname.c mkstemp.c \ usleep.c noinst_LTLIBRARIES = libmisc.la libmisc_la_SOURCES = bug_work_around_8.cc -libmisc_la_LIBADD = @LTLIBOBJS@ diff --git a/usrp/host/swig/usrp_prims.i b/usrp/host/swig/usrp_prims.i index 0476858da..a58f8aacf 100644 --- a/usrp/host/swig/usrp_prims.i +++ b/usrp/host/swig/usrp_prims.i @@ -37,6 +37,7 @@ %{ #include <usrp/usrp_prims.h> +#include <stddef.h> // ptrdiff_t %} diff --git a/usrp2/host/lib/control.cc b/usrp2/host/lib/control.cc index 33a95c078..3b5533eb8 100644 --- a/usrp2/host/lib/control.cc +++ b/usrp2/host/lib/control.cc @@ -27,6 +27,9 @@ #include <iostream> #include <gruel/thread.h> +#include <boost/date_time/posix_time/posix_time.hpp> +namespace pt = boost::posix_time; + namespace usrp2 { pending_reply::pending_reply(unsigned int rid, void *buffer, size_t len) @@ -44,10 +47,9 @@ namespace usrp2 { pending_reply::wait_for_completion(double secs) { gruel::scoped_lock l(d_mutex); - boost::system_time to(gruel::get_new_timeout(secs)); while (!d_complete) { - if (!d_cond.timed_wait(l, to)) + if (!d_cond.timed_wait(l, pt::milliseconds(long(secs*1e3)))) return 0; // timed out } diff --git a/usrp2/host/lib/eth_buffer.cc b/usrp2/host/lib/eth_buffer.cc index bd37061fd..e8ca05283 100644 --- a/usrp2/host/lib/eth_buffer.cc +++ b/usrp2/host/lib/eth_buffer.cc @@ -156,8 +156,12 @@ namespace usrp2 { { // if we have background thread, stop it here - if (!d_using_tpring && d_buf) + if(d_buf) { + if (!d_using_tpring) free(d_buf); + else + munmap(d_buf, d_buflen); + } return d_ethernet->close(); } diff --git a/version.sh b/version.sh index 0ae040982..6957e2046 100644 --- a/version.sh +++ b/version.sh @@ -1,4 +1,4 @@ MAJOR_VERSION=3 API_COMPAT=4 -MINOR_VERSION=git -MAINT_VERSION= +MINOR_VERSION=0 +MAINT_VERSION=git diff --git a/volk/Makefile.common b/volk/Makefile.common index e91a55e9c..eca2c6516 100644 --- a/volk/Makefile.common +++ b/volk/Makefile.common @@ -54,7 +54,8 @@ SWIGPYTHONFLAGS = -fvirtual -python -modern SWIGGRFLAGS = -I$(GNURADIO_CORE_INCLUDEDIR)/swig -I$(GNURADIO_CORE_INCLUDEDIR) # standard defins and includes -STD_DEFINES_AND_INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/lib $(GNURADIO_CORE_CPPFLAGS) +STD_DEFINES_AND_INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/lib \ + $(BOOST_CPPFLAGS) $(GNURADIO_CORE_CPPFLAGS) # Don't assume that make predefines $(RM), because BSD make does # not. We define it now in configure.ac using AM_PATH_PROG, but now diff --git a/volk/config.guess b/volk/config.guess index 405bc3235..187cd54ed 120000..100644 --- a/volk/config.guess +++ b/volk/config.guess @@ -1 +1,1511 @@ -/usr/share/automake-1.11/config.guess
\ No newline at end of file +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. + +timestamp='2011-02-02' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to <config-patches@gnu.org> and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-tilera-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 <<EOF +$0: unable to guess system type + +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +and + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to <config-patches@gnu.org> in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/volk/config.sub b/volk/config.sub index 4d47fbcbc..18b17aa46 120000..100644 --- a/volk/config.sub +++ b/volk/config.sub @@ -1 +1,1758 @@ -/usr/share/automake-1.11/config.sub
\ No newline at end of file +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. + +timestamp='2011-03-23' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/volk/config/gcc_version_workaround.m4 b/volk/config/gcc_version_workaround.m4 index b3ba0b6f3..3cd8a0cc7 100644..100755 --- a/volk/config/gcc_version_workaround.m4 +++ b/volk/config/gcc_version_workaround.m4 @@ -1,5 +1,9 @@ AC_DEFUN([LV_GCC_VERSION_WORKAROUND], [ + case "${host_os}" in + *cygwin*) + ;; + *) AC_REQUIRE([LF_CONFIGURE_CXX]) cxx_version=`$CXX --version` @@ -44,6 +48,6 @@ AC_DEFUN([LV_GCC_VERSION_WORKAROUND], fi - + esac ])
\ No newline at end of file diff --git a/volk/config/lv_configure.m4 b/volk/config/lv_configure.m4 index f98b2dc5b..dfa490cdf 100644..100755 --- a/volk/config/lv_configure.m4 +++ b/volk/config/lv_configure.m4 @@ -98,12 +98,13 @@ dnl AM_CONDITIONAL([USE_PYTHON], [test "$with_python" = yes]) dnl Check for Mingw support GR_PWIN32 - GR_LIBGNURADIO_CORE_EXTRA_LDFLAGS + dnl GR_LIBGNURADIO_CORE_EXTRA_LDFLAGS dnl Check for liborc ORC_CHECK - LDFLAGS="$LDFLAGS $LIBGNURADIO_CORE_EXTRA_LDFLAGS" + dnl Following causes test for -lboost_unit_test_framework to fail on Cygwin + dnl LDFLAGS="$LDFLAGS $LIBGNURADIO_CORE_EXTRA_LDFLAGS" AC_CHECK_PROG([XMLTO],[xmlto],[yes],[]) AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes]) diff --git a/volk/lib/.gitignore b/volk/lib/.gitignore index 0f17543ab..6a5fde28f 100644 --- a/volk/lib/.gitignore +++ b/volk/lib/.gitignore @@ -20,3 +20,4 @@ /volk_proccpu_sim.c /volk_runtime.c /test_all +/testqa diff --git a/volk/lib/Makefile.am b/volk/lib/Makefile.am index 3e5502369..473acd2a6 100644 --- a/volk/lib/Makefile.am +++ b/volk/lib/Makefile.am @@ -119,8 +119,9 @@ noinst_PROGRAMS = \ testqa testqa_SOURCES = testqa.cc qa_utils.cc -testqa_CPPFLAGS = -DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN $(AM_CPPFLAGS) -testqa_LDFLAGS = $(BOOST_UNIT_TEST_FRAMEWORK_LIB) +testqa_CPPFLAGS = -DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN $(AM_CPPFLAGS) \ + $(BOOST_CPPFLAGS) +testqa_LDFLAGS = $(BOOST_LDFLAGS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) if LV_HAVE_ORC testqa_LDADD = \ libvolk.la \ diff --git a/volk/lib/qa_utils.cc b/volk/lib/qa_utils.cc index e85e2c1bc..b0f63d2b5 100644 --- a/volk/lib/qa_utils.cc +++ b/volk/lib/qa_utils.cc @@ -1,13 +1,14 @@ #include "qa_utils.h" -#include <stdlib.h> +#include <cstring> #include <boost/foreach.hpp> #include <boost/assign/list_of.hpp> #include <boost/tokenizer.hpp> //#include <boost/test/unit_test.hpp> #include <iostream> #include <vector> -#include <time.h> -#include <math.h> +#include <list> +#include <ctime> +#include <cmath> #include <boost/lexical_cast.hpp> //#include <volk/volk_runtime.h> #include <volk/volk_registry.h> @@ -61,22 +62,6 @@ void load_random_data(void *data, volk_type_t type, unsigned int n) { } } -void *make_aligned_buffer(unsigned int len, unsigned int size) { - void *buf; - int ret; - ret = posix_memalign((void**)&buf, 16, len * size); - assert(ret == 0); - memset(buf, 0x00, len*size); - return buf; -} - -void make_buffer_for_signature(std::vector<void *> &buffs, std::vector<volk_type_t> inputsig, unsigned int vlen) { - BOOST_FOREACH(volk_type_t sig, inputsig) { - if(!sig.is_scalar) //we don't make buffers for scalars - buffs.push_back(make_aligned_buffer(vlen, sig.size*(sig.is_complex ? 2 : 1))); - } -} - static std::vector<std::string> get_arch_list(const int archs[]) { std::vector<std::string> archlist; int num_archs = archs[0]; @@ -282,6 +267,16 @@ bool icompare(t *in1, t *in2, unsigned int vlen, unsigned int tol) { return fail; } +class volk_qa_aligned_mem_pool{ +public: + void *get_new(size_t size, size_t alignment = 16){ + _mems.push_back(std::vector<char>(size + alignment-1, 0)); + size_t ptr = size_t(&_mems.back().front()); + return (void *)((ptr + alignment-1) & ~(alignment-1)); + } +private: std::list<std::vector<char> > _mems; +}; + bool run_volk_tests(const int archs[], void (*manual_func)(), std::string name, float tol, float scalar, int vlen, int iter) { std::cout << "RUN_VOLK_TESTS: " << name << std::endl; @@ -292,7 +287,10 @@ bool run_volk_tests(const int archs[], void (*manual_func)(), std::string name, std::cout << "no architectures to test" << std::endl; return false; } - + + //something that can hang onto memory and cleanup when this function exits + volk_qa_aligned_mem_pool mem_pool; + //now we have to get a function signature by parsing the name std::vector<volk_type_t> inputsig, outputsig; get_signatures_from_name(inputsig, outputsig, name); @@ -309,12 +307,12 @@ bool run_volk_tests(const int archs[], void (*manual_func)(), std::string name, //for(int i=0; i<inputsig.size(); i++) std::cout << "Input: " << inputsig[i].str << std::endl; //for(int i=0; i<outputsig.size(); i++) std::cout << "Output: " << outputsig[i].str << std::endl; std::vector<void *> inbuffs; - std::vector<void *> free_buffs; //this is just a list of void*'s that i'll have to free later. - //we need it because we dupe void*s in test_data below. - make_buffer_for_signature(inbuffs, inputsig, vlen); + BOOST_FOREACH(volk_type_t sig, inputsig) { + if(!sig.is_scalar) //we don't make buffers for scalars + inbuffs.push_back(mem_pool.get_new(vlen*sig.size*(sig.is_complex ? 2 : 1))); + } for(int i=0; i<inbuffs.size(); i++) { - load_random_data(inbuffs[i], inputsig[i], vlen); - free_buffs.push_back(inbuffs[i]); + load_random_data(inbuffs[i], inputsig[i], vlen); } //ok let's make a vector of vector of void buffers, which holds the input/output vectors for each arch @@ -322,8 +320,7 @@ bool run_volk_tests(const int archs[], void (*manual_func)(), std::string name, for(int i=0; i<arch_list.size(); i++) { std::vector<void *> arch_buffs; for(int j=0; j<outputsig.size(); j++) { - arch_buffs.push_back(make_aligned_buffer(vlen, outputsig[j].size*(outputsig[j].is_complex ? 2 : 1))); - free_buffs.push_back(arch_buffs.back()); + arch_buffs.push_back(mem_pool.get_new(vlen*outputsig[j].size*(outputsig[j].is_complex ? 2 : 1))); } for(int j=0; j<inputsig.size(); j++) { arch_buffs.push_back(inbuffs[j]); @@ -437,10 +434,6 @@ bool run_volk_tests(const int archs[], void (*manual_func)(), std::string name, } } - BOOST_FOREACH(void *buf, free_buffs) { - free(buf); - } - return fail_global; } diff --git a/volk/lib/qa_utils.h b/volk/lib/qa_utils.h index e2539060a..1b64bacaa 100644 --- a/volk/lib/qa_utils.h +++ b/volk/lib/qa_utils.h @@ -1,7 +1,7 @@ #ifndef VOLK_QA_UTILS_H #define VOLK_QA_UTILS_H -#include <stdlib.h> +#include <cstdlib> #include <string> struct volk_type_t { diff --git a/volk/orc/.gitignore b/volk/orc/.gitignore new file mode 100644 index 000000000..b336cc7ce --- /dev/null +++ b/volk/orc/.gitignore @@ -0,0 +1,2 @@ +/Makefile +/Makefile.in |