40336c0e963a4bfa6a809d8a4c79b40501581895
[debian/gnuradio] / config / grc_ezdop.m4
1 dnl Copyright 2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
2 dnl 
3 dnl This file is part of GNU Radio
4 dnl 
5 dnl GNU Radio is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 2, or (at your option)
8 dnl any later version.
9 dnl 
10 dnl GNU Radio is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 dnl GNU General Public License for more details.
14 dnl 
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with GNU Radio; see the file COPYING.  If not, write to
17 dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 dnl Boston, MA 02111-1307, USA.
19
20 AC_DEFUN([GRC_EZDOP],[
21     AC_CONFIG_SRCDIR([ezdop/src/host/ezdop/ezdop.h])
22
23     AC_CONFIG_FILES([ \
24         ezdop/Makefile \
25         ezdop/ezdop.pc \
26         ezdop/src/Makefile \
27         ezdop/src/firmware/Makefile \
28         ezdop/src/host/Makefile \
29         ezdop/src/host/avrdude/Makefile \
30         ezdop/src/host/ezdop/Makefile \
31         ezdop/src/host/tests/Makefile \
32     ])
33
34     succeeded=yes
35
36     # Firmware build requires Atmel AVR microcontroller port of GCC
37     AC_PATH_PROG([AVRGCC], [avr-gcc -v], [no])
38     if test x$AVRGCC = xno; then
39         succeeded=no
40     fi
41     
42     # ...and binutils
43     AC_PATH_PROG([AVROBJCOPY], [avr-objcopy], [no])
44     if test x$AVROBJCOPY = xno; then
45         succeeded=no
46     fi
47     
48     # ...and standard library (test not working yet)
49     #AC_CHECK_HEADERS([avr/io.h],[],[succeeded=no])
50
51     # Device access is via libftdi
52     AC_LANG_PUSH(C)
53     AC_CHECK_HEADERS([ftdi.h],[],[succeeded=no])
54     save_LIBS="$LIBS"
55     AC_SEARCH_LIBS([ftdi_init], [ftdi],[FTDI_LIBS="$LIBS"],[succeeded=no])
56     LIBS="$save_LIBS"
57     AC_LANG_POP
58     
59     if test x$succeeded = xyes; then
60         EZDOP_INCLUDES='-I$(top_srcdir)/ezdop/src/host/ezdop/ -I$(top_srcdir)/ezdop/src/firmware/'
61         EZDOP_LIBS='-lezdop'
62         AC_SUBST(FTDI_LIBS)
63         AC_SUBST(EZDOP_INCLUDES)
64         AC_SUBST(EZDOP_LIBS)
65         AC_SUBST(AVRGCC)
66         AC_SUBST(AVROBJCOPY)
67
68         subdirs="$subdirs ezdop"
69     else
70         failed="$failed ezdop"
71     fi
72 ])