2 AC_INIT([openocd], [0.9.0-dev],
3 [OpenOCD Mailing List <openocd-devel@lists.sourceforge.net>])
4 AC_CONFIG_SRCDIR([src/openocd.c])
6 m4_include([config_subdir.m4])dnl
8 # check for makeinfo before calling AM_INIT_AUTOMAKE
9 AC_CHECK_PROG([MAKEINFO], [makeinfo], [makeinfo])
10 if test "x$MAKEINFO" = "x"; then
11 MAKEINFO='echo makeinfo missing; true'
12 AC_MSG_WARN([Info documentation will not be built.])
16 AM_INIT_AUTOMAKE([-Wall -Wno-portability dist-bzip2 dist-zip subdir-objects])
18 AC_CONFIG_HEADERS([config.h])
20 #include <helper/system.h>
21 #include <helper/types.h>
22 #include <helper/replacements.h>
30 PKG_PROG_PKG_CONFIG([0.23])
32 dnl disable checks for C++, Fortran and GNU Java Compiler
33 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
34 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
35 m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:])
38 AC_SUBST([LIBTOOL_DEPS])
40 dnl configure checks required for Jim files (these are obsolete w/ C99)
44 AC_SEARCH_LIBS([ioperm], [ioperm])
45 AC_SEARCH_LIBS([dlopen], [dl])
47 AC_CHECK_HEADERS([sys/socket.h])
48 AC_CHECK_HEADERS([arpa/inet.h], [], [], [dnl
58 #ifdef HAVE_SYS_SOCKET_H
59 # include <sys/socket.h>
62 AC_CHECK_HEADERS([elf.h])
63 AC_CHECK_HEADERS([dirent.h])
64 AC_CHECK_HEADERS([fcntl.h])
65 AC_CHECK_HEADERS([ifaddrs.h], [], [], [dnl
75 #ifdef HAVE_SYS_SOCKET_H
76 # include <sys/socket.h>
79 AC_CHECK_HEADERS([malloc.h])
80 AC_CHECK_HEADERS([netdb.h])
81 AC_CHECK_HEADERS([netinet/in.h], [], [], [dnl
91 #ifdef HAVE_SYS_SOCKET_H
92 # include <sys/socket.h>
95 AC_CHECK_HEADERS([netinet/tcp.h], [], [], [dnl
101 # ifdef HAVE_STDLIB_H
105 #ifdef HAVE_SYS_SOCKET_H
106 # include <sys/socket.h>
109 AC_CHECK_HEADERS([pthread.h])
110 AC_CHECK_HEADERS([strings.h])
111 AC_CHECK_HEADERS([sys/ioctl.h])
112 AC_CHECK_HEADERS([sys/param.h])
113 AC_CHECK_HEADERS([sys/poll.h])
114 AC_CHECK_HEADERS([sys/select.h])
115 AC_CHECK_HEADERS([sys/stat.h])
116 AC_CHECK_HEADERS([sys/time.h])
117 AC_CHECK_HEADERS([sys/types.h])
118 AC_CHECK_HEADERS([unistd.h])
119 AC_CHECK_HEADERS([net/if.h], [], [], [dnl
125 # ifdef HAVE_STDLIB_H
129 #ifdef HAVE_SYS_SOCKET_H
130 # include <sys/socket.h>
140 AC_CHECK_FUNCS([strndup])
141 AC_CHECK_FUNCS([strnlen])
142 AC_CHECK_FUNCS([gettimeofday])
143 AC_CHECK_FUNCS([usleep])
144 AC_CHECK_FUNCS([vasprintf])
153 # guess-rev.sh only exists in the repository, not in the released archives
154 AC_MSG_CHECKING([whether to build a release])
155 if test -x $srcdir/guess-rev.sh ; then
160 AC_MSG_RESULT([$build_release])
163 AS_HELP_STRING([--with-ftd2xx=<PATH>],[This option has been removed.]),
168 The option: --with-ftd2xx=<PATH> has been removed.
169 On Linux, the new option is:
171 --with-ftd2xx-linux-tardir=/path/to/files
173 Where <path> is the path the the directory where the "tar.gz" file
174 from FTDICHIP.COM was unpacked, for example:
176 --with-ftd2xx-linux-tardir=${HOME}/libftd2xx0.4.16
178 On Cygwin/MingW32, the new option is:
180 --with-ftd2xx-win32-zipdir=/path/to/files
182 Where <path> is the path to the directory where the "zip" file from
183 FTDICHIP.COM was unpacked, for example:
185 --with-ftd2xx-win32-zipdir=${HOME}/ftd2xx.cdm.files
189 AC_MSG_ERROR([Sorry Cannot continue])
193 # 1st column -- configure option
194 # 2nd column -- description
195 # 3rd column -- symbol used for both config.h and automake
196 m4_define([ADAPTER_ARG], [m4_argn([1], $1)])
197 m4_define([ADAPTER_DESC], [m4_argn([2], $1)])
198 m4_define([ADAPTER_SYM], [m4_argn([3], $1)])
199 m4_define([ADAPTER_VAR], [enable_[]ADAPTER_ARG($1)])
200 m4_define([ADAPTER_OPT], [m4_translit(ADAPTER_ARG($1), [_], [-])])
202 m4_define([USB1_ADAPTERS],
203 [[[ftdi], [MPSSE mode of FTDI based devices], [FTDI]],
204 [[stlink], [ST-Link JTAG Programmer], [HLADAPTER_STLINK]],
205 [[ti_icdi], [TI ICDI JTAG Programmer], [HLADAPTER_ICDI]],
206 [[ulink], [Keil ULINK JTAG Programmer], [ULINK]],
207 [[usb_blaster_2], [Altera USB-Blaster II Compatible], [USB_BLASTER_2]],
208 [[vsllink], [Versaloon-Link JTAG Programmer], [VSLLINK]]])
210 m4_define([USB_ADAPTERS],
211 [[[jlink], [Segger J-Link JTAG Programmer], [JLINK]],
212 [[osbdm], [OSBDM (JTAG only) Programmer], [OSBDM]],
213 [[opendous], [eStick/opendous JTAG Programmer], [OPENDOUS]],
214 [[aice], [Andes JTAG Programmer], [AICE]]])
216 m4_define([USB0_ADAPTERS],
217 [[[usbprog], [USBProg JTAG Programmer], [USBPROG]],
218 [[rlink], [Raisonance RLink JTAG Programmer], [RLINK]],
219 [[armjtagew], [Olimex ARM-JTAG-EW Programmer], [ARMJTAGEW]]])
221 m4_define([HIDAPI_ADAPTERS],
222 [[[cmsis_dap], [CMSIS-DAP Compliant Debugger], [CMSIS_DAP]]])
224 #========================================
225 # FTD2XXX support comes in 4 forms.
226 # (1) win32 - via a zip file
227 # (2) linux - via a tar file
228 # (3) linux/cygwin/mingw - via libftdi
229 # (4) darwin - installed under /usr/local
231 # In case (1) and (2) we need to know where the package was unpacked.
233 AC_ARG_WITH(ftd2xx-win32-zipdir,
234 AS_HELP_STRING([--with-ftd2xx-win32-zipdir],[Where (CYGWIN/MINGW) the zip file from ftdichip.com was unpacked (default=search)]),
237 if test -d $with_ftd2xx_win32_zipdir
239 with_ftd2xx_win32_zipdir=`cd $with_ftd2xx_win32_zipdir && pwd`
240 AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_win32_zipdir])
242 AC_MSG_ERROR([Parameter to --with-ftd2xx-win32-zipdir is not a dir: $with_ftd2xx_win32_zipdir])
246 AC_ARG_WITH(ftd2xx-linux-tardir,
247 AS_HELP_STRING([--with-ftd2xx-linux-tardir], [Where (Linux/Unix) the tar file from ftdichip.com was unpacked (default=search)]),
250 if test $is_win32 = yes ; then
251 AC_MSG_ERROR([The option: --with-ftd2xx-linux-tardir is only usable on linux])
253 if test -d $with_ftd2xx_linux_tardir
255 with_ftd2xx_linux_tardir=`cd $with_ftd2xx_linux_tardir && pwd`
256 AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_linux_tardir])
258 AC_MSG_ERROR([Parameter to --with-ftd2xx-linux-tardir is not a dir: $with_ftd2xx_linux_tardir])
262 AC_ARG_WITH(ftd2xx-lib,
263 AS_HELP_STRING([--with-ftd2xx-lib],
264 [Use static or shared ftd2xx libs (default=static)]),
268 with_ftd2xx_lib=$withval
271 with_ftd2xx_lib=$withval
274 AC_MSG_ERROR([Option: --with-ftd2xx-lib=static or --with-ftd2xx-lib=shared not, $withval])
278 # Default is static - it is simpler :-(
279 with_ftd2xx_lib=static
282 AC_ARG_ENABLE([doxygen-html],
283 AS_HELP_STRING([--disable-doxygen-html],
284 [Disable building Doxygen manual as HTML.]),
285 [doxygen_as_html=$enableval], [doxygen_as_html=yes])
286 AC_SUBST([doxygen_as_html])
287 AC_MSG_CHECKING([whether to build Doxygen as HTML])
288 AC_MSG_RESULT([$doxygen_as_html])
290 AC_ARG_ENABLE([doxygen-pdf],
291 AS_HELP_STRING([--enable-doxygen-pdf],
292 [Enable building Doxygen manual as PDF.]),
293 [doxygen_as_pdf=$enableval], [doxygen_as_pdf=no])
294 AC_SUBST([doxygen_as_pdf])
295 AC_MSG_CHECKING([whether to build Doxygen as PDF])
296 AC_MSG_RESULT([$doxygen_as_pdf])
298 AC_ARG_ENABLE([gccwarnings],
299 AS_HELP_STRING([--disable-gccwarnings], [Disable compiler warnings]),
300 [gcc_warnings=$enableval], [gcc_warnings=yes])
302 AC_ARG_ENABLE([wextra],
303 AS_HELP_STRING([--disable-wextra], [Disable extra compiler warnings]),
304 [gcc_wextra=$enableval], [gcc_wextra=$gcc_warnings])
306 AC_ARG_ENABLE([werror],
307 AS_HELP_STRING([--disable-werror], [Do not treat warnings as errors]),
308 [gcc_werror=$enableval], [gcc_werror=$gcc_warnings])
310 # set default verbose options, overridden by following options
315 AC_ARG_ENABLE([verbose],
316 AS_HELP_STRING([--enable-verbose],
317 [Enable verbose JTAG I/O messages (for debugging).]),
319 debug_jtag_io=$enableval
320 debug_usb_io=$enableval
321 debug_usb_comms=$enableval
324 AC_ARG_ENABLE([verbose_jtag_io],
325 AS_HELP_STRING([--enable-verbose-jtag-io],
326 [Enable verbose JTAG I/O messages (for debugging).]),
327 [debug_jtag_io=$enableval], [])
329 AC_ARG_ENABLE([verbose_usb_io],
330 AS_HELP_STRING([--enable-verbose-usb-io],
331 [Enable verbose USB I/O messages (for debugging)]),
332 [debug_usb_io=$enableval], [])
334 AC_ARG_ENABLE([verbose_usb_comms],
335 AS_HELP_STRING([--enable-verbose-usb-comms],
336 [Enable verbose USB communication messages (for debugging)]),
337 [debug_usb_comms=$enableval], [])
339 AC_MSG_CHECKING([whether to enable verbose JTAG I/O messages]);
340 AC_MSG_RESULT([$debug_jtag_io])
341 if test $debug_jtag_io = yes; then
342 AC_DEFINE([_DEBUG_JTAG_IO_],[1], [Print verbose JTAG I/O messages])
345 AC_MSG_CHECKING([whether to enable verbose USB I/O messages]);
346 AC_MSG_RESULT([$debug_usb_io])
347 if test $debug_usb_io = yes; then
348 AC_DEFINE([_DEBUG_USB_IO_],[1], [Print verbose USB I/O messages])
351 AC_MSG_CHECKING([whether to enable verbose USB communication messages]);
352 AC_MSG_RESULT([$debug_usb_comms])
353 if test $debug_usb_comms = yes; then
354 AC_DEFINE([_DEBUG_USB_COMMS_],[1], [Print verbose USB communication messages])
358 AC_ARG_ENABLE([malloc_logging],
359 AS_HELP_STRING([--enable-malloc-logging],
360 [Include free space in logging messages (requires malloc.h).]),
361 [debug_malloc=$enableval], [])
363 AC_MSG_CHECKING([whether to enable malloc free space logging]);
364 AC_MSG_RESULT([$debug_malloc])
365 if test $debug_malloc = yes; then
366 AC_DEFINE([_DEBUG_FREE_SPACE_],[1], [Include malloc free space in logging])
369 AC_ARG_ENABLE([dummy],
370 AS_HELP_STRING([--enable-dummy], [Enable building the dummy port driver]),
371 [build_dummy=$enableval], [build_dummy=no])
373 m4_define([AC_ARG_ADAPTERS], [
374 m4_foreach([adapter], [$1],
375 [AC_ARG_ENABLE(ADAPTER_OPT([adapter]),
376 AS_HELP_STRING([--enable-ADAPTER_OPT([adapter])],
377 [Enable building support for the ]ADAPTER_DESC([adapter])[ (default is $2)]),
378 [], [ADAPTER_VAR([adapter])=$2])
382 AC_ARG_ADAPTERS([USB1_ADAPTERS, USB_ADAPTERS, USB0_ADAPTERS, HIDAPI_ADAPTERS], [auto])
384 AC_ARG_ENABLE([parport],
385 AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]),
386 [build_parport=$enableval], [build_parport=no])
388 AC_ARG_ENABLE([parport_ppdev],
389 AS_HELP_STRING([--disable-parport-ppdev],
390 [Disable use of ppdev (/dev/parportN) for parport (for x86 only)]),
391 [parport_use_ppdev=$enableval], [parport_use_ppdev=yes])
393 AC_ARG_ENABLE([parport_giveio],
394 AS_HELP_STRING([--enable-parport-giveio],
395 [Enable use of giveio for parport (for CygWin only)]),
396 [parport_use_giveio=$enableval], [parport_use_giveio=])
398 AC_ARG_ENABLE([ft2232_libftdi], [], [
399 if test $enableval = yes; then
400 AC_MSG_ERROR([The ft2232 driver is deprecated, use --enable-ftdi to build its replacement, or force the old driver with --enable-legacy-ft2232_libftdi])
404 AC_ARG_ENABLE([ft2232_ftd2xx], [], [
405 if test $enableval = yes; then
406 AC_MSG_ERROR([The ft2232 driver is deprecated, use --enable-ftdi to build its replacement, or force the old driver with --enable-legacy-ft2232_ftd2xx])
410 AC_ARG_ENABLE([legacy-ft2232_libftdi],
411 AS_HELP_STRING([--enable-legacy-ft2232_libftdi], [(DEPRECATED) Enable building support for FT2232 based devices using the libftdi library]),
412 [build_ft2232_libftdi=$enableval], [build_ft2232_libftdi=no])
414 AC_ARG_ENABLE([legacy-ft2232_ftd2xx],
415 AS_HELP_STRING([--enable-legacy-ft2232_ftd2xx], [(DEPRECATED) Enable building support for FT2232 based devices using the D2XX library from ftdichip.com]),
416 [build_ft2232_ftd2xx=$enableval], [build_ft2232_ftd2xx=no])
418 AC_ARG_ENABLE([jtag_vpi],
419 AS_HELP_STRING([--enable-jtag_vpi], [Enable building support for JTAG VPI]),
420 [build_jtag_vpi=$enableval], [build_jtag_vpi=no])
422 AC_ARG_ENABLE([usb_blaster_libftdi],
423 AS_HELP_STRING([--enable-usb_blaster_libftdi], [Enable building support for the Altera USB-Blaster using the libftdi driver, opensource alternate of FTD2XX]),
424 [build_usb_blaster_libftdi=$enableval], [build_usb_blaster_libftdi=no])
426 AC_ARG_ENABLE([usb_blaster_ftd2xx],
427 AS_HELP_STRING([--enable-usb_blaster_ftd2xx], [Enable building support for the Altera USB-Blaster using the FTD2XX driver from ftdichip.com]),
428 [build_usb_blaster_ftd2xx=$enableval], [build_usb_blaster_ftd2xx=no])
430 AC_ARG_ENABLE([amtjtagaccel],
431 AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]),
432 [build_amtjtagaccel=$enableval], [build_amtjtagaccel=no])
434 AC_ARG_ENABLE([zy1000_master],
435 AS_HELP_STRING([--enable-zy1000-master], [Use ZY1000 JTAG master registers]),
436 [build_zy1000_master=$enableval], [build_zy1000_master=no])
438 AC_ARG_ENABLE([zy1000],
439 AS_HELP_STRING([--enable-zy1000], [Enable ZY1000 interface]),
440 [build_zy1000=$enableval], [build_zy1000=no])
442 AC_ARG_ENABLE([ioutil],
443 AS_HELP_STRING([--enable-ioutil], [Enable ioutil functions - useful for standalone OpenOCD implementations]),
444 [build_ioutil=$enableval], [build_ioutil=no])
446 case "${host_cpu}" in
448 AC_ARG_ENABLE([ep93xx],
449 AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]),
450 [build_ep93xx=$enableval], [build_ep93xx=no])
452 AC_ARG_ENABLE([at91rm9200],
453 AS_HELP_STRING([--enable-at91rm9200], [Enable building support for AT91RM9200 based SBCs]),
454 [build_at91rm9200=$enableval], [build_at91rm9200=no])
456 AC_ARG_ENABLE([bcm2835gpio],
457 AS_HELP_STRING([--enable-bcm2835gpio], [Enable building support for bitbanging on BCM2835 (as found in Raspberry Pi)]),
458 [build_bcm2835gpio=$enableval], [build_bcm2835gpio=no])
468 AC_ARG_ENABLE([gw16012],
469 AS_HELP_STRING([--enable-gw16012], [Enable building support for the Gateworks GW16012 JTAG Programmer]),
470 [build_gw16012=$enableval], [build_gw16012=no])
472 AC_ARG_ENABLE([presto_libftdi],
473 AS_HELP_STRING([--enable-presto_libftdi], [Enable building support for ASIX Presto Programmer using the libftdi driver]),
474 [build_presto_libftdi=$enableval], [build_presto_libftdi=no])
476 AC_ARG_ENABLE([presto_ftd2xx],
477 AS_HELP_STRING([--enable-presto_ftd2xx], [Enable building support for ASIX Presto Programmer using the FTD2XX driver]),
478 [build_presto_ftd2xx=$enableval], [build_presto_ftd2xx=no])
480 AC_ARG_ENABLE([openjtag_ftd2xx],
481 AS_HELP_STRING([--enable-openjtag_ftd2xx], [Enable building support for the OpenJTAG Programmer with ftd2xx driver]),
482 [build_openjtag_ftd2xx=$enableval], [build_openjtag_ftd2xx=no])
484 AC_ARG_ENABLE([openjtag_ftdi],
485 AS_HELP_STRING([--enable-openjtag_ftdi], [Enable building support for the OpenJTAG Programmer with ftdi driver]),
486 [build_openjtag_ftdi=$enableval], [build_openjtag_ftdi=no])
488 AC_ARG_ENABLE([oocd_trace],
489 AS_HELP_STRING([--enable-oocd_trace],
490 [Enable building support for some prototype OpenOCD+trace ETM capture hardware]),
491 [build_oocd_trace=$enableval], [build_oocd_trace=no])
493 AC_ARG_ENABLE([buspirate],
494 AS_HELP_STRING([--enable-buspirate], [Enable building support for the Buspirate]),
495 [build_buspirate=$enableval], [build_buspirate=no])
497 AC_ARG_ENABLE([sysfsgpio],
498 AS_HELP_STRING([--enable-sysfsgpio], [Enable building support for programming driven via sysfs gpios.]),
499 [build_sysfsgpio=$enableval], [build_sysfsgpio=no])
501 AC_ARG_ENABLE([minidriver_dummy],
502 AS_HELP_STRING([--enable-minidriver-dummy], [Enable the dummy minidriver.]),
503 [build_minidriver_dummy=$enableval], [build_minidriver_dummy=no])
505 AC_ARG_ENABLE([internal-jimtcl],
506 AS_HELP_STRING([--disable-internal-jimtcl], [Disable building internal jimtcl]),
507 [use_internal_jimtcl=$enableval], [use_internal_jimtcl=yes])
510 AC_MSG_CHECKING([whether to enable ZY1000 minidriver])
511 if test $build_zy1000 = yes; then
512 if test $build_minidriver = yes; then
513 AC_MSG_ERROR([Multiple minidriver options have been enabled.])
515 AC_DEFINE([HAVE_JTAG_MINIDRIVER_H], [1],
516 [Define to 1 if you have the <jtag_minidriver.h> header file.])
519 AC_MSG_RESULT([$build_zy1000])
521 AC_ARG_ENABLE([remote-bitbang],
522 AS_HELP_STRING([--enable-remote-bitbang], [Enable building support for the Remote Bitbang jtag driver]),
523 [build_remote_bitbang=$enableval], [build_remote_bitbang=no])
525 AC_MSG_CHECKING([whether to enable dummy minidriver])
526 if test $build_minidriver_dummy = yes; then
527 if test $build_minidriver = yes; then
528 AC_MSG_ERROR([Multiple minidriver options have been enabled.])
531 AC_DEFINE([BUILD_MINIDRIVER_DUMMY], [1], [Use the dummy minidriver.])
532 AC_DEFINE([HAVE_JTAG_MINIDRIVER_H], [1],
533 [Define to 1 if you have the <jtag_minidriver.h> header file.])
535 AC_MSG_RESULT([$build_minidriver_dummy])
537 AC_MSG_CHECKING([whether standard drivers can be built])
538 if test "$build_minidriver" = yes; then
540 AC_MSG_WARN([Using the minidriver disables all other drivers.])
546 case "${host_cpu}" in
550 if test x$parport_use_ppdev = xno; then
551 AC_MSG_WARN([--disable-parport-ppdev is not supported by the host CPU])
553 parport_use_ppdev=yes
562 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[return __MINGW32__;]])],
563 [is_mingw=yes],[is_mingw=no])
564 if test $is_mingw = yes; then
565 AC_DEFINE([IS_MINGW], [1], [1 if building for MinGW.])
566 if test x$parport_use_giveio = xno; then
567 AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts])
569 parport_use_giveio=yes
573 AC_DEFINE([IS_CYGWIN], [1], [1 if building for Cygwin.])
574 # sys/io.h needed under cygwin for parport access
575 if test $build_parport = yes; then
576 AC_CHECK_HEADERS([sys/io.h],[],AC_MSG_ERROR([Please install the cygwin ioperm package]))
580 AC_DEFINE([IS_WIN32], [1], [1 if building for Win32.])
581 AC_DEFINE([IS_DARWIN], [0], [0 if not building for Darwin.])
588 if test x$parport_use_giveio = xno; then
589 AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts])
591 parport_use_giveio=yes
593 if test x$build_buspirate = xyes; then
594 AC_MSG_ERROR([buspirate currently not supported by MinGW32 hosts])
597 CFLAGS="$CFLAGS -D__USE_MINGW_ANSI_STDIO"
599 AC_DEFINE([IS_MINGW], [1], [1 if building for MinGW.])
600 AC_DEFINE([IS_WIN32], [1], [1 if building for Win32.])
601 AC_DEFINE([IS_DARWIN], [0], [0 if not building for Darwin.])
606 if test x$parport_use_giveio = xyes; then
607 AC_MSG_WARN([--enable-parport-giveio cannot be used by Darwin hosts])
609 parport_use_giveio=no
611 AC_DEFINE([IS_CYGWIN], [0], [0 if not building for Cygwin.])
612 AC_DEFINE([IS_WIN32], [0], [0 if not building for Win32.])
613 AC_DEFINE([IS_DARWIN], [1], [1 if building for Darwin.])
616 if test x$parport_use_giveio = xyes; then
617 AC_MSG_WARN([--enable-parport-giveio cannot be used by ]$host[ hosts])
619 parport_use_giveio=no
620 AC_DEFINE([IS_CYGWIN], [0], [0 if not building for Cygwin.])
621 AC_DEFINE([IS_WIN32], [0], [0 if not building for Win32.])
622 AC_DEFINE([IS_DARWIN], [0], [0 if not building for Darwin.])
626 if test $is_win32 = yes; then
627 AC_DEFINE([WIN32_LEAN_AND_MEAN], [1], [1 to exclude old conflicting definitions when building on Windows])
630 if test $build_parport = yes; then
632 AC_DEFINE([BUILD_PARPORT], [1], [1 if you want parport.])
634 AC_DEFINE([BUILD_PARPORT], [0], [0 if you don't want parport.])
637 if test $build_dummy = yes; then
639 AC_DEFINE([BUILD_DUMMY], [1], [1 if you want dummy driver.])
641 AC_DEFINE([BUILD_DUMMY], [0], [0 if you don't want dummy driver.])
644 if test $build_ep93xx = yes; then
646 AC_DEFINE([BUILD_EP93XX], [1], [1 if you want ep93xx.])
648 AC_DEFINE([BUILD_EP93XX], [0], [0 if you don't want ep93xx.])
651 if test $build_zy1000 = yes; then
652 AC_DEFINE([BUILD_ZY1000], [1], [1 if you want ZY1000.])
654 AC_DEFINE([BUILD_ZY1000], [0], [0 if you don't want ZY1000.])
657 if test $build_zy1000_master = yes; then
658 AC_DEFINE([BUILD_ZY1000_MASTER], [1], [1 if you want ZY1000 JTAG master registers.])
660 AC_DEFINE([BUILD_ZY1000_MASTER], [0], [0 if you don't want ZY1000 JTAG master registers.])
663 if test $build_at91rm9200 = yes; then
665 AC_DEFINE([BUILD_AT91RM9200], [1], [1 if you want at91rm9200.])
667 AC_DEFINE([BUILD_AT91RM9200], [0], [0 if you don't want at91rm9200.])
670 if test $build_bcm2835gpio = yes; then
672 AC_DEFINE([BUILD_BCM2835GPIO], [1], [1 if you want bcm2835gpio.])
674 AC_DEFINE([BUILD_BCM2835GPIO], [0], [0 if you don't want bcm2835gpio.])
677 if test x$parport_use_ppdev = xyes; then
678 AC_DEFINE([PARPORT_USE_PPDEV], [1], [1 if you want parport to use ppdev.])
680 AC_DEFINE([PARPORT_USE_PPDEV], [0], [0 if you don't want parport to use ppdev.])
683 if test x$parport_use_giveio = xyes; then
684 AC_DEFINE([PARPORT_USE_GIVEIO], [1], [1 if you want parport to use giveio.])
686 AC_DEFINE([PARPORT_USE_GIVEIO], [0], [0 if you don't want parport to use giveio.])
689 if test $build_bitbang = yes; then
690 AC_DEFINE([BUILD_BITBANG], [1], [1 if you want a bitbang interface.])
692 AC_DEFINE([BUILD_BITBANG], [0], [0 if you don't want a bitbang interface.])
695 if test $build_ft2232_libftdi = yes; then
696 AC_DEFINE([BUILD_FT2232_LIBFTDI], [1], [1 if you want libftdi ft2232.])
698 AC_DEFINE([BUILD_FT2232_LIBFTDI], [0], [0 if you don't want libftdi ft2232.])
701 if test $build_ft2232_ftd2xx = yes; then
702 AC_DEFINE([BUILD_FT2232_FTD2XX], [1], [1 if you want ftd2xx ft2232.])
704 AC_DEFINE([BUILD_FT2232_FTD2XX], [0], [0 if you don't want ftd2xx ft2232.])
707 if test $build_usb_blaster_libftdi = yes; then
708 AC_DEFINE([BUILD_USB_BLASTER_LIBFTDI], [1], [1 if you want libftdi usb_blaster.])
710 AC_DEFINE([BUILD_USB_BLASTER_LIBFTDI], [0], [0 if you don't want libftdi usb_blaster.])
713 if test $build_jtag_vpi = yes; then
714 AC_DEFINE([BUILD_JTAG_VPI], [1], [1 if you want JTAG VPI.])
716 AC_DEFINE([BUILD_JTAG_VPI], [0], [0 if you don't want JTAG VPI.])
719 if test $build_usb_blaster_ftd2xx = yes; then
720 AC_DEFINE([BUILD_USB_BLASTER_FTD2XX], [1], [1 if you want ftd2xx usb_blaster.])
722 AC_DEFINE([BUILD_USB_BLASTER_FTD2XX], [0], [0 if you don't want ftd2xx usb_blaster.])
725 if test $build_amtjtagaccel = yes; then
726 AC_DEFINE([BUILD_AMTJTAGACCEL], [1], [1 if you want the Amontec JTAG-Accelerator driver.])
728 AC_DEFINE([BUILD_AMTJTAGACCEL], [0], [0 if you don't want the Amontec JTAG-Accelerator driver.])
731 if test $build_gw16012 = yes; then
732 AC_DEFINE([BUILD_GW16012], [1], [1 if you want the Gateworks GW16012 driver.])
734 AC_DEFINE([BUILD_GW16012], [0], [0 if you don't want the Gateworks GW16012 driver.])
737 if test $build_presto_libftdi = yes; then
739 AC_DEFINE([BUILD_PRESTO_LIBFTDI], [1], [1 if you want the ASIX PRESTO driver using libftdi.])
741 AC_DEFINE([BUILD_PRESTO_LIBFTDI], [0], [0 if you don't want the ASIX PRESTO driver using libftdi.])
744 if test $build_presto_ftd2xx = yes; then
746 AC_DEFINE([BUILD_PRESTO_FTD2XX], [1], [1 if you want the ASIX PRESTO driver using FTD2XX.])
748 AC_DEFINE([BUILD_PRESTO_FTD2XX], [0], [0 if you don't want the ASIX PRESTO driver using FTD2XX.])
751 if test $build_bitq = yes; then
752 AC_DEFINE([BUILD_BITQ], [1], [1 if you want a bitq interface.])
754 AC_DEFINE([BUILD_BITQ], [0], [0 if you don't want a bitq interface.])
757 AC_DEFINE([BUILD_OPENJTAG], [0], [0 if you don't want the OpenJTAG driver.])
758 AC_DEFINE([BUILD_OPENJTAG_FTD2XX], [0], [0 if you don't want the OpenJTAG driver with FTD2XX driver.])
759 AC_DEFINE([BUILD_OPENJTAG_LIBFTDI], [0], [0 if you don't want to build OpenJTAG driver with libftdi.])
761 if test $build_openjtag_ftd2xx = yes; then
762 AC_DEFINE([BUILD_OPENJTAG], [1], [1 if you want the OpenJTAG driver.])
763 AC_DEFINE([BUILD_OPENJTAG_FTD2XX], [1], [1 if you want the OpenJTAG driver with FTD2XX driver.])
765 if test $build_openjtag_ftdi = yes; then
766 AC_DEFINE([BUILD_OPENJTAG], [1], [1 if you want the OpenJTAG drvier.])
767 AC_DEFINE([BUILD_OPENJTAG_LIBFTDI], [1], [1 if you want to build OpenJTAG with FTDI driver.])
770 if test $build_oocd_trace = yes; then
771 AC_DEFINE([BUILD_OOCD_TRACE], [1], [1 if you want the OpenOCD+trace ETM capture driver.])
773 AC_DEFINE([BUILD_OOCD_TRACE], [0], [0 if you don't want the OpenOCD+trace ETM capture driver.])
776 if test $build_buspirate = yes; then
777 AC_DEFINE([BUILD_BUSPIRATE], [1], [1 if you want the Buspirate JTAG driver.])
779 AC_DEFINE([BUILD_BUSPIRATE], [0], [0 if you don't want the Buspirate JTAG driver.])
782 if test $use_internal_jimtcl = yes; then
783 if test -f "$srcdir/jimtcl/configure.ac"; then
784 AX_CONFIG_SUBDIR_OPTION([jimtcl], [--disable-install-jim])
786 AC_MSG_ERROR([jimtcl not found, run git submodule init and git submodule update.])
790 if test $build_remote_bitbang = yes; then
792 AC_DEFINE([BUILD_REMOTE_BITBANG], [1], [1 if you want the Remote Bitbang JTAG driver.])
794 AC_DEFINE([BUILD_REMOTE_BITBANG], [0], [0 if you don't want the Remote Bitbang JTAG driver.])
797 if test $build_sysfsgpio = yes; then
799 AC_DEFINE([BUILD_SYSFSGPIO], [1], [1 if you want the SysfsGPIO driver.])
801 AC_DEFINE([BUILD_SYSFSGPIO], [0], [0 if you don't want SysfsGPIO driver.])
803 #-- Deal with MingW/Cygwin FTD2XX issues
805 if test $is_win32 = yes; then
806 if test "${with_ftd2xx_linux_tardir+set}" = set
808 AC_MSG_ERROR([The option: with_ftd2xx_linux_tardir is for LINUX only.])
811 if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes -o $build_usb_blaster_ftd2xx = yes -o $build_openjtag_ftd2xx = yes; then
812 AC_MSG_CHECKING([for ftd2xx.lib exists (win32)])
814 # if we are given a zipdir...
815 if test "${with_ftd2xx_win32_zipdir+set}" = set
817 # Set the CFLAGS for "ftd2xx.h"
818 f=$with_ftd2xx_win32_zipdir/ftd2xx.h
819 if test ! -f $f ; then
820 AC_MSG_ERROR([File: $f cannot be found])
822 CFLAGS="$CFLAGS -I$with_ftd2xx_win32_zipdir"
824 # And calculate the LDFLAGS for the machine
827 LDFLAGS="$LDFLAGS -L$with_ftd2xx_win32_zipdir/i386"
828 LIBS="$LIBS -lftd2xx"
829 f=$with_ftd2xx_win32_zipdir/i386/ftd2xx.lib
832 LDFLAGS="$LDFLAGS -L$with_ftd2xx_win32_zipdir/amd64"
833 LIBS="$LIBS -lftd2xx"
834 f=$with_ftd2xx_win32_zipdir/amd64/ftd2xx.lib
837 AC_MSG_ERROR([Unknown Win32 host cpu: $host_cpu])
840 if test ! -f $f ; then
841 AC_MSG_ERROR([Library: $f not found])
844 LIBS="$LIBS -lftd2xx"
845 AC_MSG_WARN([ASSUMPTION: The (win32) FTDICHIP.COM files: ftd2xx.h and ftd2xx.lib are in a proper place])
850 if test $is_darwin = yes ; then
851 if test "${with_ftd2xx_win32_zipdir+set}" = set
853 AC_MSG_ERROR([The option: --with-ftd2xx-win32-zipdir is for win32 only])
855 if test "${with_ftd2xx_linux_tardir+set}" = set
857 AC_MSG_ERROR([The option: with_ftd2xx_linux_tardir is for LINUX only.])
860 if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes -o $build_usb_blaster_ftd2xx = yes ; then
861 AC_MSG_CHECKING([for libftd2xx.a (darwin)])
863 if test ! -f /usr/local/include/ftd2xx.h ; then
864 AC_MSG_ERROR([ftd2xx library from FTDICHIP.com seems to be missing, cannot find: /usr/local/include/ftd2xx.h])
867 CFLAGS="$CFLAGS -I/usr/local/include"
868 LDFLAGS="$LDFLAGS -L/usr/local/lib"
869 LIBS="$LIBS -lftd2xx"
870 AC_MSG_RESULT([-L/usr/local/lib -lftd2xx])
874 if test $is_win32 = no && test $is_darwin = no ; then
876 if test "${with_ftd2xx_win32_zipdir+set}" = set
878 AC_MSG_ERROR([The option: --with-ftd2xx-win32-zipdir is for win32 only])
881 if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes -o $build_usb_blaster_ftd2xx = yes -o $build_openjtag_ftd2xx = yes; then
883 if test $host_os != linux-gnu && test $host_os != linux ; then
884 AC_MSG_ERROR([The (linux) ftd2xx library from FTDICHIP.com is linux only. Try --enable-ft2232-libftdi instead])
886 # Are we given a TAR directory?
887 if test "${with_ftd2xx_linux_tardir+set}" = set
889 AC_MSG_CHECKING([uninstalled ftd2xx distribution])
890 # The .H file is simple..
891 FTD2XX_H=$with_ftd2xx_linux_tardir/ftd2xx.h
892 if test ! -f "${FTD2XX_H}"; then
893 AC_MSG_ERROR([Option: --with-ftd2xx-linux-tardir appears wrong, cannot find: ${FTD2XX_H}])
895 CFLAGS="$CFLAGS -I$with_ftd2xx_linux_tardir"
896 if test $with_ftd2xx_lib = shared; then
897 FTD2XX_LDFLAGS="-L$with_ftd2xx_linux_tardir"
898 FTD2XX_LIB="-lftd2xx"
909 if test -f "$with_ftd2xx_linux_tardir/$dir/libftd2xx.a"; then
910 FTD2XX_LDFLAGS="-L$with_ftd2xx_linux_tardir/$dir"
912 FTD2XX_LIB="-lftd2xx -lrt"
915 # Grr.. perhaps it exists as a version number?
916 FTD2XX_LIB="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a.*.*.*"
917 count=`ls ${FTD2XX_LIB} | wc -l`
918 if test $count -gt 1 ; then
919 AC_MSG_ERROR([Multiple libftd2xx.a files found in: $with_ftd2xx_linux_tardir/static_lib sorry cannot handle this yet])
921 if test $count -ne 1 ; then
922 AC_MSG_ERROR([Not found: $f, option: --with-ftd2xx-linux-tardir appears to be wrong])
924 # Because the "-l" rules do not understand version numbers...
925 # we will just stuff the absolute path onto the LIBS variable
926 FTD2XX_LIB="`ls ${FTD2XX_LIB}` -lpthread"
930 LDFLAGS="${LDFLAGS} ${FTD2XX_LDFLAGS}"
931 LIBS="${FTD2XX_LIB} ${LIBS}"
932 AC_MSG_RESULT([${FTD2XX_LDFLAGS} ${FTD2XX_LIB}])
934 AC_CHECK_HEADER([ftd2xx.h],[],[
935 AC_MSG_ERROR([You seem to be missing the FTD2xx driver header file.])
937 AC_SEARCH_LIBS([FT_GetLibraryVersion],[ftd2xx],,[
938 AC_MSG_ERROR([You appear to be missing the FTD2xx driver library.])
944 if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes -o $build_usb_blaster_ftd2xx = yes ; then
946 # Before we go any further - make sure we can *BUILD* and *RUN*
947 # a simple app with the "ftd2xx.lib" file - in what ever form we where given
948 # We should be able to compile, link and run this test program now
949 AC_MSG_CHECKING([whether ftd2xx library works])
952 # Save the LDFLAGS for later..
953 LDFLAGS_SAVE=$LDFLAGS
955 _LDFLAGS=`eval echo $LDFLAGS`
956 _CFLAGS=`eval echo $CFLAGS`
960 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
961 #include "confdefs.h"
969 FT_GetLibraryVersion( &x );
971 AC_MSG_RESULT([Success!])
973 AC_MSG_ERROR([Cannot build & run test program using ftd2xx.lib])
975 AC_MSG_RESULT([Skipping as we are cross-compiling])
978 AC_MSG_CHECKING([for ftd2xx highspeed device support])
979 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
980 #include "confdefs.h"
987 DWORD x = FT_DEVICE_4232H;
989 AC_DEFINE([BUILD_FT2232_HIGHSPEED], [1],
990 [Support FT2232H/FT4232HS with FTD2XX or libftdi.])
991 build_ft2232_highspeed=yes
993 build_ft2232_highspeed=no
995 AC_MSG_RESULT([$build_ft2232_highspeed])
997 if test $build_ft2232_highspeed = no; then
998 AC_MSG_WARN([You need a newer FTD2XX driver (version 2.04.16 or later).])
1001 AC_MSG_CHECKING([for ftd2xx FT232H device support])
1002 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1003 #include "confdefs.h"
1005 #include "windows.h"
1010 DWORD x = FT_DEVICE_232H;
1012 AC_DEFINE([HAS_ENUM_FT232H], [1],
1013 [Support FT232H with FTD2XX or libftdi.])
1018 AC_MSG_RESULT([$has_enum_ft232h])
1020 if test $has_enum_ft232h = no; then
1021 AC_MSG_WARN([You need a newer FTD2XX driver (version 2.08.12 or later).])
1024 LDFLAGS=$LDFLAGS_SAVE
1028 if test $build_ft2232_libftdi = yes -o $build_usb_blaster_libftdi = yes -o \
1029 $build_openjtag_ftdi = yes -o $build_presto_libftdi = yes; then
1031 # we can have libftdi or libftdi1, so check it and use the latest one
1032 PKG_CHECK_MODULES([LIBFTDI], [libftdi1], [use_libftdi=yes], [use_libftdi=no])
1033 if test $use_libftdi = no; then
1034 PKG_CHECK_MODULES([LIBFTDI], [libftdi], [use_libftdi=yes], [use_libftdi=no])
1036 if test $use_libftdi = no; then
1037 AC_MSG_ERROR([The libftdi driver is not present on your system.])
1041 # Try to build a small program.
1042 AC_MSG_CHECKING([Build & Link with libftdi...])
1044 LDFLAGS_SAVE=$LDFLAGS
1047 _LDFLAGS=`eval echo $LDFLAGS`
1048 _CFLAGS=`eval echo $CFLAGS`
1049 _LIBS=`eval echo $LIBS`
1051 CFLAGS="$_CFLAGS $LIBFTDI_CFLAGS"
1052 LIBS="$_LIBS $LIBFTDI_LIBS"
1054 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1058 struct ftdi_context *p;
1063 fprintf( stderr, "calling ftdi_new() failed\n");
1067 AC_MSG_RESULT([Success])
1069 AC_MSG_ERROR([Cannot build & run test program using libftdi])
1071 AC_MSG_RESULT([Skipping as we are cross-compiling, trying build only])
1072 AC_SEARCH_LIBS([ftdi_new], [], [], [AC_MSG_ERROR([Cannot link with libftdi])])
1075 AC_MSG_CHECKING([for libftdi highspeed device support])
1076 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1080 enum ftdi_chip_type x = TYPE_2232H;
1082 AC_DEFINE([BUILD_FT2232_HIGHSPEED], [1],
1083 [Support FT2232H/FT4232HS with FTD2XX or libftdi.])
1084 build_ft2232_highspeed=yes
1086 build_ft2232_highspeed=no
1088 AC_MSG_RESULT([$build_ft2232_highspeed])
1090 if test $build_ft2232_highspeed = no; then
1091 AC_MSG_WARN([You need a newer libftdi version (0.16 or later).])
1094 AC_MSG_CHECKING([for libftdi FT232H device support])
1095 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1099 enum ftdi_chip_type x = TYPE_232H;
1101 AC_DEFINE([HAS_ENUM_FT232H], [1],
1102 [Support FT232H with FTD2XX or libftdi.])
1107 AC_MSG_RESULT([$has_enum_ft232h])
1109 if test $has_enum_ft232h = no; then
1110 AC_MSG_WARN([You need a newer libftdi version (0.20 or later).])
1113 # Restore the 'unexpanded ldflags'
1114 LDFLAGS=$LDFLAGS_SAVE
1119 PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [
1121 AC_DEFINE([HAVE_LIBUSB1], [1], [Define if you have libusb-1.x])
1122 PKG_CHECK_EXISTS([libusb-1.0 >= 1.0.9],
1123 [AC_DEFINE([HAVE_LIBUSB_ERROR_NAME], [1], [Define if your libusb has libusb_error_name()])],
1124 [AC_MSG_WARN([libusb-1.x older than 1.0.9 detected, consider updating])])
1125 LIBUSB1_CFLAGS=`echo $LIBUSB1_CFLAGS | sed 's/-I/-isystem /'`
1126 AC_MSG_NOTICE([libusb-1.0 header bug workaround: LIBUSB1_CFLAGS changed to "$LIBUSB1_CFLAGS"])
1129 AC_MSG_WARN([libusb-1.x not found, trying legacy libusb-0.1 as a fallback; consider installing libusb-1.x instead])
1132 PKG_CHECK_MODULES([LIBUSB0], [libusb], [use_libusb0=yes], [use_libusb0=no])
1134 for hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
1135 PKG_CHECK_MODULES([HIDAPI],[$hidapi_lib],[
1143 m4_define([PROCESS_ADAPTERS], [
1144 m4_foreach([adapter], [$1], [
1146 if test $ADAPTER_VAR([adapter]) != no; then
1147 AC_DEFINE([BUILD_]ADAPTER_SYM([adapter]), [1], [1 if you want the ]ADAPTER_DESC([adapter]).)
1149 AC_DEFINE([BUILD_]ADAPTER_SYM([adapter]), [0], [0 if you do not want the ]ADAPTER_DESC([adapter]).)
1152 if test $ADAPTER_VAR([adapter]) = yes; then
1153 AC_MSG_ERROR([$3 is required for the ADAPTER_DESC([adapter])])
1155 ADAPTER_VAR([adapter])=no
1157 AM_CONDITIONAL(ADAPTER_SYM([adapter]), [test $ADAPTER_VAR([adapter]) != no])
1161 PROCESS_ADAPTERS([USB1_ADAPTERS], [$use_libusb1 = yes], [libusb-1.x])
1162 PROCESS_ADAPTERS([USB_ADAPTERS], [$use_libusb1 = yes -o $use_libusb0 = yes], [libusb-1.x or libusb-0.1])
1163 PROCESS_ADAPTERS([USB0_ADAPTERS], [$use_libusb0 = yes], [libusb-0.1])
1164 PROCESS_ADAPTERS([HIDAPI_ADAPTERS], [$use_hidapi = yes], [hidapi])
1166 if test $enable_stlink != no -o $enable_ti_icdi != no; then
1167 AC_DEFINE([BUILD_HLADAPTER], [1], [1 if you want the High Level JTAG driver.])
1169 AC_DEFINE([BUILD_HLADAPTER], [0], [0 if you want the High Level JTAG driver.])
1171 AM_CONDITIONAL([HLADAPTER], [test $enable_stlink != no -o $enable_ti_icdi != no])
1173 AM_CONDITIONAL([RELEASE], [test $build_release = yes])
1174 AM_CONDITIONAL([PARPORT], [test $build_parport = yes])
1175 AM_CONDITIONAL([DUMMY], [test $build_dummy = yes])
1176 AM_CONDITIONAL([GIVEIO], [test x$parport_use_giveio = xyes])
1177 AM_CONDITIONAL([EP93XX], [test $build_ep93xx = yes])
1178 AM_CONDITIONAL([ZY1000], [test $build_zy1000 = yes])
1179 AM_CONDITIONAL([ZY1000_MASTER], [test $build_zy1000_master = yes])
1180 AM_CONDITIONAL([IOUTIL], [test $build_ioutil = yes])
1181 AM_CONDITIONAL([AT91RM9200], [test $build_at91rm9200 = yes])
1182 AM_CONDITIONAL([BCM2835GPIO], [test $build_bcm2835gpio = yes])
1183 AM_CONDITIONAL([BITBANG], [test $build_bitbang = yes])
1184 AM_CONDITIONAL([FT2232_LIBFTDI], [test $build_ft2232_libftdi = yes])
1185 AM_CONDITIONAL([FT2232_DRIVER], [test $build_ft2232_ftd2xx = yes -o $build_ft2232_libftdi = yes])
1186 AM_CONDITIONAL([USB_BLASTER_LIBFTDI], [test $build_usb_blaster_libftdi = yes])
1187 AM_CONDITIONAL([USB_BLASTER_FTD2XX], [test $build_usb_blaster_ftd2xx = yes])
1188 AM_CONDITIONAL([JTAG_VPI], [test $build_jtag_vpi = yes -o $build_jtag_vpi = yes])
1189 AM_CONDITIONAL([USB_BLASTER_DRIVER], [test $build_usb_blaster_ftd2xx = yes -o $build_usb_blaster_libftdi = yes -o $enable_usb_blaster_2 != no])
1190 AM_CONDITIONAL([AMTJTAGACCEL], [test $build_amtjtagaccel = yes])
1191 AM_CONDITIONAL([GW16012], [test $build_gw16012 = yes])
1192 AM_CONDITIONAL([PRESTO_LIBFTDI], [test $build_presto_libftdi = yes])
1193 AM_CONDITIONAL([PRESTO_DRIVER], [test $build_presto_ftd2xx = yes -o $build_presto_libftdi = yes])
1194 AM_CONDITIONAL([OPENJTAG], [test $build_openjtag_ftd2xx = yes -o $build_openjtag_ftdi = yes])
1195 AM_CONDITIONAL([OOCD_TRACE], [test $build_oocd_trace = yes])
1196 AM_CONDITIONAL([REMOTE_BITBANG], [test $build_remote_bitbang = yes])
1197 AM_CONDITIONAL([BUSPIRATE], [test $build_buspirate = yes])
1198 AM_CONDITIONAL([SYSFSGPIO], [test $build_sysfsgpio = yes])
1199 AM_CONDITIONAL([USE_LIBUSB0], [test $use_libusb0 = yes])
1200 AM_CONDITIONAL([USE_LIBUSB1], [test $use_libusb1 = yes])
1201 AM_CONDITIONAL([IS_CYGWIN], [test $is_cygwin = yes])
1202 AM_CONDITIONAL([IS_MINGW], [test $is_mingw = yes])
1203 AM_CONDITIONAL([IS_WIN32], [test $is_win32 = yes])
1204 AM_CONDITIONAL([IS_DARWIN], [test $is_darwin = yes])
1205 AM_CONDITIONAL([BITQ], [test $build_bitq = yes])
1206 AM_CONDITIONAL([CMSIS_DAP], [test $use_hidapi = yes])
1208 AM_CONDITIONAL([MINIDRIVER], [test $build_minidriver = yes])
1209 AM_CONDITIONAL([MINIDRIVER_DUMMY], [test $build_minidriver_dummy = yes])
1211 AM_CONDITIONAL([INTERNAL_JIMTCL], [test $use_internal_jimtcl = yes])
1213 # Look for environ alternatives. Possibility #1: is environ in unistd.h or stdlib.h?
1214 AC_MSG_CHECKING([for environ in unistd.h and stdlib.h])
1215 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1219 ]], [[char **ep = environ;]]
1221 AC_MSG_RESULT([yes])
1226 # Possibility #2: can environ be found in an available library?
1227 AC_MSG_CHECKING([for extern environ])
1228 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1229 extern char **environ;
1230 ]], [[char **ep = environ;]]
1232 AC_DEFINE(NEED_ENVIRON_EXTERN, [1], [Must declare 'environ' to use it.])
1237 AC_MSG_RESULT([${has_environ}])
1240 if test "${has_environ}" != "yes" ; then
1241 AC_MSG_FAILURE([Could not find 'environ' in unistd.h or available libraries.])
1244 AC_DEFINE([_GNU_SOURCE],[1],[Use GNU C library extensions (e.g. stdndup).])
1246 # set default gcc warnings
1247 GCC_WARNINGS="-Wall -Wstrict-prototypes -Wformat-security -Wshadow"
1248 if test "${gcc_wextra}" = yes; then
1249 GCC_WARNINGS="${GCC_WARNINGS} -Wextra -Wno-unused-parameter"
1250 GCC_WARNINGS="${GCC_WARNINGS} -Wbad-function-cast"
1251 GCC_WARNINGS="${GCC_WARNINGS} -Wcast-align"
1252 GCC_WARNINGS="${GCC_WARNINGS} -Wredundant-decls"
1254 if test "${gcc_werror}" = yes; then
1255 GCC_WARNINGS="${GCC_WARNINGS} -Werror"
1258 # overide default gcc cflags
1259 if test $gcc_warnings = yes; then
1260 CFLAGS="$CFLAGS $GCC_WARNINGS"
1268 src/jtag/drivers/Makefile
1269 src/jtag/drivers/usb_blaster/Makefile
1270 src/jtag/hla/Makefile
1271 src/jtag/aice/Makefile
1272 src/transport/Makefile
1273 src/target/openrisc/Makefile
1280 src/flash/nor/Makefile
1281 src/flash/nand/Makefile
1289 echo OpenOCD configuration summary
1290 echo --------------------------------------------------
1291 m4_foreach([adapter], [USB1_ADAPTERS, USB_ADAPTERS, USB0_ADAPTERS, HIDAPI_ADAPTERS],
1292 [s=m4_format(["%-40s"], ADAPTER_DESC([adapter]))
1293 case $ADAPTER_VAR([adapter]) in
1295 echo "$s"yes '(auto)'
1307 if test $build_ft2232_libftdi = yes -o $build_ft2232_ftd2xx = yes; then
1308 if test $enable_ftdi = no; then
1309 AC_MSG_WARN([Building the deprecated 'ft2232' adapter driver but not its replacement!])
1310 AC_MSG_WARN([Please consider using --enable-ftdi instead.])
1312 AC_MSG_WARN([Building the deprecated 'ft2232' adapter driver.])