Updated license from GPL version 2 or later to GPL version 3 or later.
[debian/gnuradio] / gr-howto-write-a-block / config / usrp_fusb_tech.m4
1 dnl
2 dnl Copyright 2003 Free Software Foundation, Inc.
3 dnl 
4 dnl This file is part of GNU Radio
5 dnl 
6 dnl GNU Radio is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 3, or (at your option)
9 dnl any later version.
10 dnl 
11 dnl GNU Radio is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 dnl GNU General Public License for more details.
15 dnl 
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with GNU Radio; see the file COPYING.  If not, write to
18 dnl the Free Software Foundation, Inc., 51 Franklin Street,
19 dnl Boston, MA 02110-1301, USA.
20 dnl 
21
22 AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[
23   AC_REQUIRE([AC_CANONICAL_HOST])
24   AC_ARG_WITH(fusb-tech,
25         [  --with-fusb-tech=OS     set fast usb technique (auto)],
26                 [cf_with_fusb_tech="$withval"],
27                 [cf_with_fusb_tech="$host_os"])
28         
29
30   AC_CHECK_HEADER([linux/usbdevice_fs.h],
31         [x_have_usbdevice_fs_h=yes],
32         [x_have_usbdevice_fs_h=no])
33
34   AC_MSG_CHECKING([for fast usb technique to use])
35   case "$cf_with_fusb_tech" in
36     linux*)     if test x${x_have_usbdevice_fs_h} = xyes;
37                 then
38                   FUSB_TECH=linux
39                 else
40                   FUSB_TECH=generic
41                 fi                      ;;
42
43     darwin*)    FUSB_TECH=darwin        ;;
44     cygwin*|win*|mingw*)        FUSB_TECH=win32         ;;
45     *)          FUSB_TECH=generic       ;;
46   esac  
47
48   AC_MSG_RESULT($FUSB_TECH)
49   AC_SUBST(FUSB_TECH)
50
51   AM_CONDITIONAL(FUSB_TECH_darwin,   test $FUSB_TECH = darwin)
52   AM_CONDITIONAL(FUSB_TECH_win32,    test $FUSB_TECH = win32)
53   AM_CONDITIONAL(FUSB_TECH_generic,  test $FUSB_TECH = generic)
54   AM_CONDITIONAL(FUSB_TECH_linux,    test $FUSB_TECH = linux)
55 ])
56