-# We are not *ALWAYS* being installed in the standard place.
-# We may be installed in a "tool-build" specific location.
-# Normally with other packages - as part of a tool distro.
-# Thus - we should search that 'libdir' also.
-#
-# And - if we are being installed there - the odds are
-# The libraries unique to what we are are there too.
-#
-
-# Expand nd deal with NONE - just like configure will do later
-OCDprefix=$prefix
-OCDxprefix=$exec_prefix
-test x"$OCDprefix" = xNONE && OCDprefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test x"$OCDxprefix" = xNONE && OCDxprefix="$OCDprefix"
-
-# what matters is the "exec-prefix"
-if test "$OCDxprefix" != "$ac_default_prefix"
-then
- # We are installing in a non-standard place
- # Nonstandard --prefix and/or --exec-prefix
- # We have an override of some sort.
- # use build specific install library dir
-
- LDFLAGS="$LDFLAGS -L$OCDxprefix/lib"
- # RPATH becomes an issue on Linux only
- if test $host_os = linux-gnu || test $host_os = linux ; then
- LDFLAGS="$LDFLAGS -Wl,-rpath,$OCDxprefix/lib"
- fi
- # The "INCDIR" is also usable
- CFLAGS="$CFLAGS -I$includedir"
-fi
-
-AC_ARG_WITH(ftd2xx,
- AS_HELP_STRING([--with-ftd2xx=<PATH>],[This option has been removed.]),
- [
-# Option Given.
-cat << __EOF__
-
-The option: --with-ftd2xx=<PATH> has been removed.
-On Linux, the new option is:
-
- --with-ftd2xx-linux-tardir=/path/to/files
-
-Where <path> is the path the the directory where the "tar.gz" file
-from FTDICHIP.COM was unpacked, for example:
-
- --with-ftd2xx-linux-tardir=${HOME}/libftd2xx0.4.16
-
-On Cygwin/MingW32, the new option is:
-
- --with-ftd2xx-win32-zipdir=/path/to/files
-
-Where <path> is the path to the directory where the "zip" file from
-FTDICHIP.COM was unpacked, for example:
-
- --with-ftd2xx-win32-zipdir=${HOME}/ftd2xx.cdm.files
-
-__EOF__
-
- AC_MSG_ERROR([Sorry Cannot continue])
- ], [true])
-
-#========================================
-# FTD2XXX support comes in 4 forms.
-# (1) win32 - via a zip file
-# (2) linux - via a tar file
-# (3) linux/cygwin/mingw - via libftdi
-# (4) darwin - installed under /usr/local
-#
-# In case (1) and (2) we need to know where the package was unpacked.
-
-AC_ARG_WITH(ftd2xx-win32-zipdir,
- AS_HELP_STRING([--with-ftd2xx-win32-zipdir],[Where (CYGWIN/MINGW) the zip file from ftdichip.com was unpacked <default=search>]),
- [
- # option present
- if test -d $with_ftd2xx_win32_zipdir
- then
- with_ftd2xx_win32_zipdir=`cd $with_ftd2xx_win32_zipdir && pwd`
- AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_win32_zipdir])
- else
- AC_MSG_ERROR([Parameter to --with-ftd2xx-win32-zipdir is not a dir: $with_ftd2xx_win32_zipdir])
- fi
- ], [true])
-
-AC_ARG_WITH(ftd2xx-linux-tardir,
- AS_HELP_STRING([--with-ftd2xx-linux-tardir], [Where (Linux/Unix) the tar file from ftdichip.com was unpacked <default=search>]),
- [
- # Option present
- if test $is_win32 = yes ; then
- AC_MSG_ERROR([The option: --with-ftd2xx-linux-tardir is only usable on linux])
- fi
- if test -d $with_ftd2xx_linux_tardir
- then
- with_ftd2xx_linux_tardir=`cd $with_ftd2xx_linux_tardir && pwd`
- AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_linux_tardir])
- else
- AC_MSG_ERROR([Parameter to --with-ftd2xx-linux-tardir is not a dir: $with_ftd2xx_linux_tardir])
- fi
- ], [true])
+# Adapter drivers
+# 1st column -- configure option
+# 2nd column -- description
+# 3rd column -- symbol used for both config.h and automake
+m4_define([ADAPTER_ARG], [m4_argn([1], $1)])
+m4_define([ADAPTER_DESC], [m4_argn([2], $1)])
+m4_define([ADAPTER_SYM], [m4_argn([3], $1)])
+m4_define([ADAPTER_VAR], [enable_[]ADAPTER_ARG($1)])
+m4_define([ADAPTER_OPT], [m4_translit(ADAPTER_ARG($1), [_], [-])])
+
+m4_define([USB1_ADAPTERS],
+ [[[ftdi], [MPSSE mode of FTDI based devices], [FTDI]],
+ [[stlink], [ST-Link JTAG Programmer], [HLADAPTER_STLINK]],
+ [[ti_icdi], [TI ICDI JTAG Programmer], [HLADAPTER_ICDI]],
+ [[ulink], [Keil ULINK JTAG Programmer], [ULINK]],
+ [[usb_blaster_2], [Altera USB-Blaster II Compatible], [USB_BLASTER_2]],
+ [[vsllink], [Versaloon-Link JTAG Programmer], [VSLLINK]]])
+
+m4_define([USB_ADAPTERS],
+ [[[osbdm], [OSBDM (JTAG only) Programmer], [OSBDM]],
+ [[opendous], [eStick/opendous JTAG Programmer], [OPENDOUS]],
+ [[aice], [Andes JTAG Programmer], [AICE]]])
+
+m4_define([USB0_ADAPTERS],
+ [[[usbprog], [USBProg JTAG Programmer], [USBPROG]],
+ [[rlink], [Raisonance RLink JTAG Programmer], [RLINK]],
+ [[armjtagew], [Olimex ARM-JTAG-EW Programmer], [ARMJTAGEW]]])
+
+m4_define([HIDAPI_ADAPTERS],
+ [[[cmsis_dap], [CMSIS-DAP Compliant Debugger], [CMSIS_DAP]]])
+
+m4_define([LIBJAYLINK_ADAPTERS],
+ [[[jlink], [SEGGER J-Link Programmer], [JLINK]]])