From 715abd1fed200421246bd644b036522979e41fe7 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 1 May 2008 22:55:03 +0000 Subject: [PATCH] move libusb checks before libftdi checks as libftdi needs libusb git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1186 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 5 ++++ jtag/configure.ac | 63 +++++++++++++++++++++++++---------------------- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index cfb624dd..8d192dd2 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2008-05-01 Mike Frysinger + + * configure.ac: Check for libusb before libftdi since the latter needs + the former. + 2008-04-26 Kolja Waschk * src/flash/amd.c: Separate Chip name by Manufacturer (Andrey F. Ilchuk) diff --git a/jtag/configure.ac b/jtag/configure.ac index 92ac2e93..a4f80edc 100644 --- a/jtag/configure.ac +++ b/jtag/configure.ac @@ -113,36 +113,6 @@ AC_CHECK_HEADERS(wchar.h) VL_LIB_READLINE -AC_ARG_WITH([libftdi], - [AS_HELP_STRING([--with-libftdi], - [use libftdi for FTDI-based cables])], - [], [with_libftdi=check]) - -AS_IF([test "x$with_libftdi" != xno], [ - AS_IF([test "x$with_libftdi" != xyes -a "x$with_libftdi" != xcheck], [ - CFLAGS="$CFLAGS -I$with_libftdi -L$with_libftdi" - LIBS="$LIBS -lftdi" - ],[ - AC_PATH_PROG(LIBFTDI_CONFIG, libftdi-config, no) - AS_IF([test "$LIBFTDI_CONFIG" != "no"],[ - LIBS="$LIBS `$LIBFTDI_CONFIG --libs`" - CFLAGS="$CFLAGS `$LIBFTDI_CONFIG --cflags`" - ],) - ]) - AC_CHECK_FUNC([ftdi_usb_open], [ - AC_DEFINE(HAVE_LIBFTDI, 1, [Define if you have libftdi]) - HAVELIBFTDI=yes - ],[ - AC_MSG_WARN([*** libftdi not detected. No support for FTDI-based USB JTAG cables via libftdi.]) - ]) -],) - -AS_IF([test "x$HAVELIBFTDI" == "xyes"],[ - AM_CONDITIONAL(HAVE_LIBFTDI, true) -],[ - AM_CONDITIONAL(HAVE_LIBFTDI, false) -]) - dnl check for libusb-config @@ -190,6 +160,39 @@ AS_IF([test "x$HAVELIBUSB" == "xyes"],[ ]) +dnl Use FTDI library? + +AC_ARG_WITH([libftdi], + [AS_HELP_STRING([--with-libftdi], + [use libftdi for FTDI-based cables])], + [], [with_libftdi=check]) + +AS_IF([test "x$with_libftdi" != xno], [ + AS_IF([test "x$with_libftdi" != xyes -a "x$with_libftdi" != xcheck], [ + CFLAGS="$CFLAGS -I$with_libftdi -L$with_libftdi" + LIBS="$LIBS -lftdi" + ],[ + AC_PATH_PROG(LIBFTDI_CONFIG, libftdi-config, no) + AS_IF([test "$LIBFTDI_CONFIG" != "no"],[ + LIBS="$LIBS `$LIBFTDI_CONFIG --libs`" + CFLAGS="$CFLAGS `$LIBFTDI_CONFIG --cflags`" + ],) + ]) + AC_CHECK_FUNC([ftdi_usb_open], [ + AC_DEFINE(HAVE_LIBFTDI, 1, [Define if you have libftdi]) + HAVELIBFTDI=yes + ],[ + AC_MSG_WARN([*** libftdi not detected. No support for FTDI-based USB JTAG cables via libftdi.]) + ]) +],) + +AS_IF([test "x$HAVELIBFTDI" == "xyes"],[ + AM_CONDITIONAL(HAVE_LIBFTDI, true) +],[ + AM_CONDITIONAL(HAVE_LIBFTDI, false) +]) + + dnl Use FTDI ftd2xx library? AC_ARG_WITH([ftd2xx],