This is an automated email from Gerrit. Mathias Küster ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/1759
-- gerrit commit 0767a3afed4d6c803b687b50501ef0e6b5dc431f Author: Mathias K <[email protected]> Date: Thu Oct 24 11:32:39 2013 +0200 BUILD: remove hard coded ftdi and usb libraries This patch remove the hardcoded libraries and add a check for libftdi1 installations. This check fix an issue with gentoo systems. Change-Id: Ieff9ec4d66ee0f3e6b22261a10e4cab9f26b6b51 Signed-off-by: Mathias K <[email protected]> diff --git a/configure.ac b/configure.ac index a5abdfd..ccc0b89 100644 --- a/configure.ac +++ b/configure.ac @@ -774,6 +774,21 @@ else fi #-- Deal with MingW/Cygwin FTD2XX issues +PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [ + use_libusb1=yes + AC_DEFINE([HAVE_LIBUSB1], [1], [Define if you have libusb-1.x]) + PKG_CHECK_EXISTS([libusb-1.0 >= 1.0.9], + [AC_DEFINE([HAVE_LIBUSB_ERROR_NAME], [1], [Define if your libusb has libusb_error_name()])], + [AC_MSG_WARN([libusb-1.x older than 1.0.9 detected, consider updating])]) + LIBUSB1_CFLAGS=`echo $LIBUSB1_CFLAGS | sed 's/-I/-isystem /'` + AC_MSG_NOTICE([libusb-1.0 header bug workaround: LIBUSB1_CFLAGS changed to "$LIBUSB1_CFLAGS"]) + ], [ + use_libusb1=no + AC_MSG_WARN([libusb-1.x not found, trying legacy libusb-0.1 as a fallback; consider installing libusb-1.x instead]) +]) + +PKG_CHECK_MODULES([LIBUSB0], [libusb], [use_libusb0=yes], [use_libusb0=no]) + if test $is_win32 = yes; then if test "${with_ftd2xx_linux_tardir+set}" = set then @@ -1000,8 +1015,13 @@ fi if test $build_ft2232_libftdi = yes -o $build_usb_blaster_libftdi = yes -o \ $build_openjtag_ftdi = yes; then # We assume: the package is preinstalled in the proper place - # these present as 2 libraries.. - LIBS="$LIBS -lftdi -lusb" + + # we can have libftdi or libftdi1, so check it and use the latest one + PKG_CHECK_MODULES([LIBFTDI1], [libftdi1], [use_libftdi1=yes LIBS="$LIBS -lftdi1"], [use_libftdi1=no]) + if test $use_libftdi1 = no; then + PKG_CHECK_MODULES([LIBFTDI0], [libftdi], [use_libftdi0=yes LIBS="$LIBS -lftdi"], [use_libftdi0=no]) + fi + # # Try to build a small program. AC_MSG_CHECKING([Build & Link with libftdi...]) @@ -1010,7 +1030,7 @@ if test $build_ft2232_libftdi = yes -o $build_usb_blaster_libftdi = yes -o \ CFLAGS_SAVE=$CFLAGS _LDFLAGS=`eval echo $LDFLAGS` _CFLAGS=`eval echo $CFLAGS` - LDFLAGS=$_LDFLAGS + LDFLAGS=$_LDFLAGS $LIBUSB0_LIBS $LIBUSB1_LIBS CFLAGS=$_CFLAGS AC_RUN_IFELSE([AC_LANG_PROGRAM([[ @@ -1077,21 +1097,6 @@ enum ftdi_chip_type x = TYPE_232H; CFLAGS=$CFLAGS_SAVE fi -PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [ - use_libusb1=yes - AC_DEFINE([HAVE_LIBUSB1], [1], [Define if you have libusb-1.x]) - PKG_CHECK_EXISTS([libusb-1.0 >= 1.0.9], - [AC_DEFINE([HAVE_LIBUSB_ERROR_NAME], [1], [Define if your libusb has libusb_error_name()])], - [AC_MSG_WARN([libusb-1.x older than 1.0.9 detected, consider updating])]) - LIBUSB1_CFLAGS=`echo $LIBUSB1_CFLAGS | sed 's/-I/-isystem /'` - AC_MSG_NOTICE([libusb-1.0 header bug workaround: LIBUSB1_CFLAGS changed to "$LIBUSB1_CFLAGS"]) - ], [ - use_libusb1=no - AC_MSG_WARN([libusb-1.x not found, trying legacy libusb-0.1 as a fallback; consider installing libusb-1.x instead]) -]) - -PKG_CHECK_MODULES([LIBUSB0], [libusb], [use_libusb0=yes], [use_libusb0=no]) - m4_define([PROCESS_ADAPTERS], [ m4_foreach([adapter], [$1], [ if test $2; then diff --git a/src/Makefile.am b/src/Makefile.am index 3413ba9..68a9ecf 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -63,25 +63,6 @@ else MINGWLDADD = endif -if FT2232_LIBFTDI -FTDI2232LIB = -lftdi -lusb -else -if PRESTO_LIBFTDI -FTDI2232LIB = -lftdi -lusb -else -FTDI2232LIB = -endif -endif - -LIBUSB = -if USE_LIBUSB1 -LIBUSB += $(LIBUSB1_LIBS) -endif - -if USE_LIBUSB0 -LIBUSB += $(LIBUSB0_LIBS) -endif - libopenocd_la_LIBADD = \ $(top_builddir)/src/xsvf/libxsvf.la \ $(top_builddir)/src/svf/libsvf.la \ @@ -93,7 +74,8 @@ libopenocd_la_LIBADD = \ $(top_builddir)/src/server/libserver.la \ $(top_builddir)/src/rtos/librtos.la \ $(top_builddir)/src/helper/libhelper.la \ - $(FTDI2232LIB) $(MINGWLDADD) $(LIBUSB) + $(LIBFTDI1_LIBS) $(LIBFTDI0_LIBS) $(MINGWLDADD) \ + $(LIBUSB1_LIBS) $(LIBUSB0_LIBS) STARTUP_TCL_SRCS = \ $(srcdir)/helper/startup.tcl \ -- ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
