Fix for ticket:104, huge initial value plotted.
[debian/gnuradio] / config / grc_ezdop.m4
index 2fd93286163607b0af2b6c49fd851b937f6349ef..33d036834d70db66fe8cc91e8360ff7b92f0ee3d 100644 (file)
@@ -14,11 +14,11 @@ 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., 59 Temple Place - Suite 330,
-dnl Boston, MA 02111-1307, USA.
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
 
 AC_DEFUN([GRC_EZDOP],[
-    AC_CONFIG_SRCDIR([ezdop/src/host/ezdop/ezdop.h])
+    GRC_ENABLE([ezdop])
 
     AC_CONFIG_FILES([ \
        ezdop/Makefile \
@@ -31,26 +31,40 @@ AC_DEFUN([GRC_EZDOP],[
        ezdop/src/host/tests/Makefile \
     ])
 
-    succeeded=yes
+    passed=yes
 
-    AC_PATH_PROG(AVRGCC, [avr-gcc -v], no)
-    if test $AVRGCC = no; then
-       succeeded = no
+    # See ticket:96 in trac
+    AM_PROG_CC_C_O
+
+    # Firmware build requires Atmel AVR microcontroller port of GCC
+    AC_PATH_PROG([AVRGCC], [avr-gcc -v], [no])
+    if test x$AVRGCC = xno; then
+       passed=no
+       AC_MSG_RESULT([ezdop requires avr-gcc, not found.])
     fi
     
-    AC_PATH_PROG(AVROBJCOPY, [avr-objcopy], no)
-    if test $AVROBJCOPY = no; then
-       succeeded = no
+    # ...and binutils
+    AC_PATH_PROG([AVROBJCOPY], [avr-objcopy], [no])
+    if test x$AVROBJCOPY = xno; then
+       passed=no
+       AC_MSG_RESULT([ezdop requires avr binutils, not found.])
     fi
     
+    # ...and standard library (test not working yet)
+    #AC_CHECK_HEADERS([avr/io.h],[],
+    #   [passed=no;AC_MSG_RESULT([ezdop requires avr glibc, not found.])])
+
+    # Device access is via libftdi
     AC_LANG_PUSH(C)
-    AC_CHECK_HEADERS([ftdi.h],[],[succeeded=no])
+    AC_CHECK_HEADERS([ftdi.h],[],
+        [passed=no;AC_MSG_RESULT([ezdop requires ftdi.h, not found.])])
     save_LIBS="$LIBS"
-    AC_SEARCH_LIBS(ftdi_init, [ftdi],[FTDI_LIBS="$LIBS"],[succeeded=no])
+    AC_SEARCH_LIBS([ftdi_init], [ftdi],[FTDI_LIBS="$LIBS"],
+        [passed=no;AC_MSG_RESULT([ezdop requires libftdi, not found.])])
     LIBS="$save_LIBS"
     AC_LANG_POP
-    
-    if test $succeeded = yes; then
+
+    GRC_BUILD_CONDITIONAL([ezdop],[
        EZDOP_INCLUDES='-I$(top_srcdir)/ezdop/src/host/ezdop/ -I$(top_srcdir)/ezdop/src/firmware/'
        EZDOP_LIBS='-lezdop'
        AC_SUBST(FTDI_LIBS)
@@ -58,9 +72,5 @@ AC_DEFUN([GRC_EZDOP],[
        AC_SUBST(EZDOP_LIBS)
        AC_SUBST(AVRGCC)
        AC_SUBST(AVROBJCOPY)
-
-        subdirs="$subdirs ezdop"
-    else
-       failed="$failed ezdop"
-    fi
+    ])
 ])