Updated FSF address in all files. Fixes ticket:51
[debian/gnuradio] / ezdop / src / host / avrdude / ftbb_ftdi.m4
1 #
2 # avrdude - A Downloader/Uploader for AVR device programmers
3 # Copyright (C) 2003-2004  Theodore A. Roth  <troth@openavr.org>
4 # Copyright (C) 2005 Johnathan Corgan <jcorgan@aeinet.com>
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Boston, MA  02110-1301  USA
19
20 AC_DEFUN([FTBB_FTDI],
21 [
22         AC_ARG_ENABLE(
23                 [ftdi-support],
24                 AC_HELP_STRING(
25                         [--enable-ftdi-support],
26                         [support serial programming via FTDI bit-bang mode (default is no)]),
27                 [case "${enableval}" in
28                         yes) ftdi_support=yes ;;
29                         no)  ftdi_support=no ;;
30                         *)   AC_MSG_ERROR(bad value ${enableval} for ftdi-support option) ;;
31                         esac],
32                 [ftdi_support=no])
33         AM_CONDITIONAL(FTDI_SUPPORT, [test "$ftdi_support" = "yes"])
34
35         if test "$ftdi_support" = "yes"; then
36                 AC_REQUIRE([AC_CANONICAL_HOST])
37                 AC_LANG_PUSH(C)
38
39                 AC_CHECK_HEADERS([ftdi.h],
40                   [],
41                   [ AC_MSG_ERROR([FTDI support requires libftdi. ftdi.h not found, stop.]) ]
42                 )
43
44                 save_LIBS="$LIBS"
45                 AC_SEARCH_LIBS(ftdi_init, [ftdi],
46                   [ FTDILIB="$LIBS" ],
47                   [ AC_MSG_ERROR([FTDI support requires libftdi. ftdi_init not found, stop.]) ]
48                 )
49                 LIBS="$save_LIBS"
50
51                 AC_LANG_POP
52                 AC_SUBST(FTDILIB)
53
54                 AC_DEFINE(FTDI_SUPPORT,[1],[Set to 1 to compile in support for FTDI bit-bang mode programming.])
55         fi
56 ])