semihosting: fix return value of SYS_READ and SYS_WRITE
[openocd.git] / configure.ac
1 AC_PREREQ([2.69])
2 AC_INIT([openocd], [0.11.0+dev],
3 [OpenOCD Mailing List <openocd-devel@lists.sourceforge.net>])
4 AC_CONFIG_SRCDIR([src/openocd.c])
5 AC_CONFIG_AUX_DIR([build-aux])
6
7 m4_include([config_subdir.m4])dnl
8
9 # check for makeinfo before calling AM_INIT_AUTOMAKE
10 AC_CHECK_PROG([MAKEINFO], [makeinfo], [makeinfo])
11 AS_IF([test "x$MAKEINFO" = "x"], [
12 MAKEINFO='echo makeinfo missing; true'
13 AC_MSG_WARN([Info documentation will not be built.])
14 ])
15 AC_SUBST([MAKEINFO])
16
17 AM_INIT_AUTOMAKE([-Wall -Wno-portability dist-bzip2 dist-zip subdir-objects])
18
19 AC_CONFIG_HEADERS([config.h])
20
21 AC_LANG([C])
22 AC_PROG_CC
23 # autoconf 2.70 obsoletes AC_PROG_CC_C99 and includes it in AC_PROG_CC
24 m4_version_prereq([2.70],[],[AC_PROG_CC_C99])
25 AM_PROG_CC_C_O
26 AC_PROG_RANLIB
27 PKG_PROG_PKG_CONFIG([0.23])
28
29 dnl disable checks for C++, Fortran and GNU Java Compiler
30 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
31 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
32 m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:])
33 AC_DISABLE_SHARED
34 LT_INIT
35 AC_SUBST([LIBTOOL_DEPS])
36
37 dnl configure checks required for Jim files (these are obsolete w/ C99)
38 AC_C_CONST
39 AC_TYPE_LONG_LONG_INT
40
41 AC_SEARCH_LIBS([ioperm], [ioperm])
42 AC_SEARCH_LIBS([dlopen], [dl])
43 AC_SEARCH_LIBS([openpty], [util])
44
45 AC_CHECK_HEADERS([sys/socket.h])
46 AC_CHECK_HEADERS([elf.h])
47 AC_EGREP_HEADER(Elf64_Ehdr, [elf.h], [
48 AC_DEFINE([HAVE_ELF64], [1], [Define to 1 if the system has the type `Elf64_Ehdr'.])
49 ])
50 AC_CHECK_HEADERS([dirent.h])
51 AC_CHECK_HEADERS([fcntl.h])
52 AC_CHECK_HEADERS([malloc.h])
53 AC_CHECK_HEADERS([netdb.h])
54 AC_CHECK_HEADERS([poll.h])
55 AC_CHECK_HEADERS([pthread.h])
56 AC_CHECK_HEADERS([strings.h])
57 AC_CHECK_HEADERS([sys/ioctl.h])
58 AC_CHECK_HEADERS([sys/param.h])
59 AC_CHECK_HEADERS([sys/select.h])
60 AC_CHECK_HEADERS([sys/stat.h])
61 AC_CHECK_HEADERS([sys/sysctl.h])
62 AC_CHECK_HEADERS([sys/time.h])
63 AC_CHECK_HEADERS([sys/types.h])
64 AC_CHECK_HEADERS([unistd.h])
65 AC_CHECK_HEADERS([arpa/inet.h ifaddrs.h netinet/in.h netinet/tcp.h net/if.h], [], [], [dnl
66 #include <stdio.h>
67 #ifdef STDC_HEADERS
68 # include <stdlib.h>
69 # include <stddef.h>
70 #else
71 # ifdef HAVE_STDLIB_H
72 # include <stdlib.h>
73 # endif
74 #endif
75 #ifdef HAVE_SYS_SOCKET_H
76 # include <sys/socket.h>
77 #endif
78 ])
79
80 AC_HEADER_ASSERT
81 AC_HEADER_STDBOOL
82
83 AC_C_BIGENDIAN
84
85 AC_CHECK_FUNCS([strndup])
86 AC_CHECK_FUNCS([strnlen])
87 AC_CHECK_FUNCS([gettimeofday])
88 AC_CHECK_FUNCS([usleep])
89 AC_CHECK_FUNCS([vasprintf])
90 AC_CHECK_FUNCS([realpath])
91
92 # guess-rev.sh only exists in the repository, not in the released archives
93 AC_MSG_CHECKING([whether to build a release])
94 AS_IF([test -x "$srcdir/guess-rev.sh"], [
95 build_release=no
96 ], [
97 build_release=yes
98 ])
99 AC_MSG_RESULT([$build_release])
100
101 # Adapter drivers
102 # 1st column -- configure option
103 # 2nd column -- description
104 # 3rd column -- symbol used for both config.h and automake
105 m4_define([ADAPTER_ARG], [m4_argn([1], $1)])
106 m4_define([ADAPTER_DESC], [m4_argn([2], $1)])
107 m4_define([ADAPTER_SYM], [m4_argn([3], $1)])
108 m4_define([ADAPTER_VAR], [enable_[]ADAPTER_ARG($1)])
109 m4_define([ADAPTER_OPT], [m4_translit(ADAPTER_ARG($1), [_], [-])])
110
111 m4_define([USB1_ADAPTERS],
112 [[[ftdi], [MPSSE mode of FTDI based devices], [FTDI]],
113 [[stlink], [ST-Link Programmer], [HLADAPTER_STLINK]],
114 [[ti_icdi], [TI ICDI JTAG Programmer], [HLADAPTER_ICDI]],
115 [[ulink], [Keil ULINK JTAG Programmer], [ULINK]],
116 [[usb_blaster_2], [Altera USB-Blaster II Compatible], [USB_BLASTER_2]],
117 [[ft232r], [Bitbang mode of FT232R based devices], [FT232R]],
118 [[vsllink], [Versaloon-Link JTAG Programmer], [VSLLINK]],
119 [[xds110], [TI XDS110 Debug Probe], [XDS110]],
120 [[cmsis_dap_v2], [CMSIS-DAP v2 Compliant Debugger], [CMSIS_DAP_USB]],
121 [[osbdm], [OSBDM (JTAG only) Programmer], [OSBDM]],
122 [[opendous], [eStick/opendous JTAG Programmer], [OPENDOUS]],
123 [[armjtagew], [Olimex ARM-JTAG-EW Programmer], [ARMJTAGEW]],
124 [[rlink], [Raisonance RLink JTAG Programmer], [RLINK]],
125 [[usbprog], [USBProg JTAG Programmer], [USBPROG]]])
126
127 m4_define([DEPRECATED_USB1_ADAPTERS],
128 [[[aice], [Andes JTAG Programmer (deprecated)], [AICE]]])
129
130 m4_define([HIDAPI_ADAPTERS],
131 [[[cmsis_dap], [CMSIS-DAP Compliant Debugger], [CMSIS_DAP_HID]],
132 [[nulink], [Nu-Link Programmer], [HLADAPTER_NULINK]]])
133
134 m4_define([HIDAPI_USB1_ADAPTERS],
135 [[[kitprog], [Cypress KitProg Programmer], [KITPROG]]])
136
137 m4_define([LIBFTDI_ADAPTERS],
138 [[[usb_blaster], [Altera USB-Blaster Compatible], [USB_BLASTER]],
139 [[presto], [ASIX Presto Adapter], [PRESTO]]])
140
141 m4_define([LIBFTDI_USB1_ADAPTERS],
142 [[[openjtag], [OpenJTAG Adapter], [OPENJTAG]]])
143
144 m4_define([LIBGPIOD_ADAPTERS],
145 [[[linuxgpiod], [Linux GPIO bitbang through libgpiod], [LINUXGPIOD]]])
146
147 m4_define([LIBJAYLINK_ADAPTERS],
148 [[[jlink], [SEGGER J-Link Programmer], [JLINK]]])
149
150 m4_define([PCIE_ADAPTERS],
151 [[[xlnx_pcie_xvc], [Xilinx XVC/PCIe], [XLNX_PCIE_XVC]]])
152
153 m4_define([SERIAL_PORT_ADAPTERS],
154 [[[buspirate], [Bus Pirate], [BUS_PIRATE]]])
155
156 m4_define([OPTIONAL_LIBRARIES],
157 [[[capstone], [Use Capstone disassembly framework], []]])
158
159 AC_ARG_ENABLE([doxygen-html],
160 AS_HELP_STRING([--disable-doxygen-html],
161 [Disable building Doxygen manual as HTML.]),
162 [doxygen_as_html=$enableval], [doxygen_as_html=yes])
163 AC_SUBST([doxygen_as_html])
164 AC_MSG_CHECKING([whether to build Doxygen as HTML])
165 AC_MSG_RESULT([$doxygen_as_html])
166
167 AC_ARG_ENABLE([doxygen-pdf],
168 AS_HELP_STRING([--enable-doxygen-pdf],
169 [Enable building Doxygen manual as PDF.]),
170 [doxygen_as_pdf=$enableval], [doxygen_as_pdf=no])
171 AC_SUBST([doxygen_as_pdf])
172 AC_MSG_CHECKING([whether to build Doxygen as PDF])
173 AC_MSG_RESULT([$doxygen_as_pdf])
174
175 AC_ARG_ENABLE([gccwarnings],
176 AS_HELP_STRING([--disable-gccwarnings], [Disable compiler warnings]),
177 [gcc_warnings=$enableval], [gcc_warnings=yes])
178
179 AC_ARG_ENABLE([wextra],
180 AS_HELP_STRING([--disable-wextra], [Disable extra compiler warnings]),
181 [gcc_wextra=$enableval], [gcc_wextra=$gcc_warnings])
182
183 AC_ARG_ENABLE([werror],
184 AS_HELP_STRING([--disable-werror], [Do not treat warnings as errors]),
185 [gcc_werror=$enableval], [gcc_werror=$gcc_warnings])
186
187 # set default verbose options, overridden by following options
188 debug_usb_io=no
189 debug_usb_comms=no
190
191 AC_ARG_ENABLE([verbose],
192 AS_HELP_STRING([--enable-verbose],
193 [Enable verbose JTAG I/O messages (for debugging).]),
194 [
195 debug_usb_io=$enableval
196 debug_usb_comms=$enableval
197 ], [])
198
199 AC_ARG_ENABLE([verbose_usb_io],
200 AS_HELP_STRING([--enable-verbose-usb-io],
201 [Enable verbose USB I/O messages (for debugging)]),
202 [debug_usb_io=$enableval], [])
203
204 AC_ARG_ENABLE([verbose_usb_comms],
205 AS_HELP_STRING([--enable-verbose-usb-comms],
206 [Enable verbose USB communication messages (for debugging)]),
207 [debug_usb_comms=$enableval], [])
208
209 AC_MSG_CHECKING([whether to enable verbose USB I/O messages]);
210 AC_MSG_RESULT([$debug_usb_io])
211 AS_IF([test "x$debug_usb_io" = "xyes"], [
212 AC_DEFINE([_DEBUG_USB_IO_],[1], [Print verbose USB I/O messages])
213 ])
214
215 AC_MSG_CHECKING([whether to enable verbose USB communication messages]);
216 AC_MSG_RESULT([$debug_usb_comms])
217 AS_IF([test "x$debug_usb_comms" = "xyes"], [
218 AC_DEFINE([_DEBUG_USB_COMMS_],[1], [Print verbose USB communication messages])
219 ])
220
221 debug_malloc=no
222 AC_ARG_ENABLE([malloc_logging],
223 AS_HELP_STRING([--enable-malloc-logging],
224 [Include free space in logging messages (requires malloc.h).]),
225 [debug_malloc=$enableval], [])
226
227 AC_MSG_CHECKING([whether to enable malloc free space logging]);
228 AC_MSG_RESULT([$debug_malloc])
229 AS_IF([test "x$debug_malloc" = "xyes"], [
230 AC_DEFINE([_DEBUG_FREE_SPACE_],[1], [Include malloc free space in logging])
231 ])
232
233 AC_ARG_ENABLE([dummy],
234 AS_HELP_STRING([--enable-dummy], [Enable building the dummy port driver]),
235 [build_dummy=$enableval], [build_dummy=no])
236
237 AC_ARG_ENABLE([rshim],
238 AS_HELP_STRING([--enable-rshim], [Enable building the rshim driver]),
239 [build_rshim=$enableval], [build_rshim=no])
240
241 m4_define([AC_ARG_ADAPTERS], [
242 m4_foreach([adapter], [$1],
243 [AC_ARG_ENABLE(ADAPTER_OPT([adapter]),
244 AS_HELP_STRING([--enable-ADAPTER_OPT([adapter])],
245 [Enable building support for the ]ADAPTER_DESC([adapter])[ (default is $2)]),
246 [], [ADAPTER_VAR([adapter])=$2])
247 ])
248 ])
249
250 AC_ARG_ADAPTERS([
251 USB1_ADAPTERS,
252 HIDAPI_ADAPTERS,
253 HIDAPI_USB1_ADAPTERS,
254 LIBFTDI_ADAPTERS,
255 LIBFTDI_USB1_ADAPTERS
256 LIBGPIOD_ADAPTERS,
257 SERIAL_PORT_ADAPTERS,
258 LIBJAYLINK_ADAPTERS
259 ],[auto])
260
261 AC_ARG_ADAPTERS([DEPRECATED_USB1_ADAPTERS],[no])
262
263 AC_ARG_ENABLE([parport],
264 AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]),
265 [build_parport=$enableval], [build_parport=no])
266
267 AC_ARG_ENABLE([parport_ppdev],
268 AS_HELP_STRING([--disable-parport-ppdev],
269 [Disable use of ppdev (/dev/parportN) for parport (for x86 only)]),
270 [parport_use_ppdev=$enableval], [parport_use_ppdev=yes])
271
272 AC_ARG_ENABLE([parport_giveio],
273 AS_HELP_STRING([--enable-parport-giveio],
274 [Enable use of giveio for parport (for CygWin only)]),
275 [parport_use_giveio=$enableval], [parport_use_giveio=])
276
277 AC_ARG_ENABLE([jtag_vpi],
278 AS_HELP_STRING([--enable-jtag_vpi], [Enable building support for JTAG VPI]),
279 [build_jtag_vpi=$enableval], [build_jtag_vpi=no])
280
281 AC_ARG_ENABLE([vdebug],
282 AS_HELP_STRING([--enable-vdebug], [Enable building support for Cadence Virtual Debug Interface]),
283 [build_vdebug=$enableval], [build_vdebug=no])
284
285 AC_ARG_ENABLE([jtag_dpi],
286 AS_HELP_STRING([--enable-jtag_dpi], [Enable building support for JTAG DPI]),
287 [build_jtag_dpi=$enableval], [build_jtag_dpi=no])
288
289 AC_ARG_ENABLE([amtjtagaccel],
290 AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]),
291 [build_amtjtagaccel=$enableval], [build_amtjtagaccel=no])
292
293 AS_CASE(["${host_cpu}"],
294 [arm*|aarch64], [
295 AC_ARG_ENABLE([bcm2835gpio],
296 AS_HELP_STRING([--enable-bcm2835gpio], [Enable building support for bitbanging on BCM2835 (as found in Raspberry Pi)]),
297 [build_bcm2835gpio=$enableval], [build_bcm2835gpio=no])
298 AC_ARG_ENABLE([imx_gpio],
299 AS_HELP_STRING([--enable-imx_gpio], [Enable building support for bitbanging on NXP IMX processors]),
300 [build_imx_gpio=$enableval], [build_imx_gpio=no])
301 AC_ARG_ENABLE([am335xgpio],
302 AS_HELP_STRING([--enable-am335xgpio], [Enable building support for bitbanging on AM335x (as found in Beaglebones)]),
303 [build_am335xgpio=$enableval], [build_am335xgpio=no])
304 ],
305 [
306 build_bcm2835gpio=no
307 build_imx_gpio=no
308 build_am335xgpio=no
309 ])
310
311 AS_CASE(["${host_cpu}"],
312 [arm*], [
313 AC_ARG_ENABLE([ep93xx],
314 AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]),
315 [build_ep93xx=$enableval], [build_ep93xx=no])
316
317 AC_ARG_ENABLE([at91rm9200],
318 AS_HELP_STRING([--enable-at91rm9200], [Enable building support for AT91RM9200 based SBCs]),
319 [build_at91rm9200=$enableval], [build_at91rm9200=no])
320 ],
321 [
322 build_ep93xx=no
323 build_at91rm9200=no
324 ])
325
326 AC_ARG_ENABLE([gw16012],
327 AS_HELP_STRING([--enable-gw16012], [Enable building support for the Gateworks GW16012 JTAG Programmer]),
328 [build_gw16012=$enableval], [build_gw16012=no])
329
330 AC_ARG_ENABLE([sysfsgpio],
331 AS_HELP_STRING([--enable-sysfsgpio], [Enable building support for programming driven via sysfs gpios.]),
332 [build_sysfsgpio=$enableval], [build_sysfsgpio=no])
333
334 AC_ARG_ENABLE([xlnx_pcie_xvc],
335 AS_HELP_STRING([--enable-xlnx-pcie-xvc], [Enable building support for Xilinx XVC/PCIe.]),
336 [build_xlnx_pcie_xvc=$enableval], [build_xlnx_pcie_xvc=no])
337
338 AS_CASE([$host_os],
339 [linux*], [],
340 [
341 AS_IF([test "x$build_sysfsgpio" = "xyes"], [
342 AC_MSG_ERROR([sysfsgpio is only available on linux])
343 ])
344
345 AS_IF([test "x$enable_linuxgpiod" = "xyes"], [
346 AC_MSG_ERROR([linuxgpiod is only available on linux])
347 ])
348
349 AS_IF([test "x$build_xlnx_pcie_xvc" = "xyes"], [
350 AC_MSG_ERROR([xlnx_pcie_xvc is only available on linux])
351 ])
352
353 AS_CASE([$host_os], [freebsd*], [],
354 [
355 AS_IF([test "x$build_rshim" = "xyes"], [
356 AC_MSG_ERROR([build_rshim is only available on linux or freebsd])
357 ])
358 ])
359 ])
360
361 AC_ARG_ENABLE([internal-jimtcl],
362 AS_HELP_STRING([--disable-internal-jimtcl], [Disable building internal jimtcl]),
363 [use_internal_jimtcl=$enableval], [use_internal_jimtcl=yes])
364
365 AC_ARG_ENABLE([jimtcl-maintainer],
366 AS_HELP_STRING([--enable-jimtcl-maintainer], [Enable maintainer mode when building internal jimtcl]),
367 [use_internal_jimtcl_maintainer=$enableval], [use_internal_jimtcl_maintainer=no])
368
369 AC_ARG_ENABLE([internal-libjaylink],
370 AS_HELP_STRING([--disable-internal-libjaylink],
371 [Disable building internal libjaylink]),
372 [use_internal_libjaylink=$enableval], [use_internal_libjaylink=yes])
373
374 AC_ARG_ENABLE([remote-bitbang],
375 AS_HELP_STRING([--enable-remote-bitbang], [Enable building support for the Remote Bitbang jtag driver]),
376 [build_remote_bitbang=$enableval], [build_remote_bitbang=no])
377
378 AS_CASE(["${host_cpu}"],
379 [i?86|x86*], [],
380 [
381 AS_IF([test "x$parport_use_ppdev" = "xno"], [
382 AC_MSG_WARN([--disable-parport-ppdev is not supported by the host CPU])
383 ])
384 parport_use_ppdev=yes
385 ])
386
387 AS_CASE([$host],
388 [*-cygwin*], [
389 is_win32=yes
390 parport_use_ppdev=no
391
392 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[return __MINGW32__;]])],
393 [is_mingw=yes],[is_mingw=no])
394 AS_IF([test "x$is_mingw" = "xyes"], [
395 AS_IF([test "x$parport_use_giveio" = "xno"], [
396 AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts])
397 ])
398 parport_use_giveio=yes
399 is_cygwin=no
400 ], [
401 is_cygwin=yes
402 # sys/io.h needed under cygwin for parport access
403 AS_IF([test "x$build_parport" = "xyes"], [
404 AC_CHECK_HEADERS([sys/io.h],[],AC_MSG_ERROR([Please install the cygwin ioperm package]))
405 ])
406 ])
407 ],
408 [*-mingw* | *-msys*], [
409 is_mingw=yes
410 is_win32=yes
411 parport_use_ppdev=no
412
413 AS_IF([test "x$parport_use_giveio" = "xno"], [
414 AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts])
415 ])
416 parport_use_giveio=yes
417
418 AS_IF([test "x$enable_buspirate" = "xyes"], [
419 AC_MSG_ERROR([buspirate currently not supported by MinGW32 hosts])
420 ])
421
422 # In case enable_buspirate=auto, make sure it will not be built.
423 enable_buspirate=no
424
425 AC_SUBST([HOST_CPPFLAGS], [-D__USE_MINGW_ANSI_STDIO])
426 ],
427 [*darwin*], [
428 is_darwin=yes
429
430 AS_IF([test "x$parport_use_giveio" = "xyes"], [
431 AC_MSG_WARN([--enable-parport-giveio cannot be used by Darwin hosts])
432 ])
433 parport_use_giveio=no
434 ],
435 [
436 AS_IF([test "x$parport_use_giveio" = "xyes"], [
437 AC_MSG_WARN([--enable-parport-giveio cannot be used by ]$host[ hosts])
438 ])
439 parport_use_giveio=no
440 ])
441
442 AS_IF([test "x$is_cygwin" = "xyes"], [
443 AC_DEFINE([IS_CYGWIN], [1], [1 if building for Cygwin.])
444 ], [
445 AC_DEFINE([IS_CYGWIN], [0], [0 if not building for Cygwin.])
446 ])
447
448 AS_IF([test "x$is_mingw" = "xyes"], [
449 AC_DEFINE([IS_MINGW], [1], [1 if building for Mingw.])
450 ], [
451 AC_DEFINE([IS_MINGW], [0], [0 if not building for Mingw.])
452 ])
453
454 AS_IF([test "x$is_win32" = "xyes"], [
455 AC_DEFINE([IS_WIN32], [1], [1 if building for Win32.])
456 ], [
457 AC_DEFINE([IS_WIN32], [0], [0 if not building for Win32.])
458 ])
459
460 AS_IF([test "x$is_darwin" = "xyes"], [
461 AC_DEFINE([IS_DARWIN], [1], [1 if building for Darwin.])
462 ], [
463 AC_DEFINE([IS_DARWIN], [0], [0 if not building for Darwin.])
464 ])
465
466 AS_IF([test "x$build_parport" = "xyes"], [
467 build_bitbang=yes
468 AC_DEFINE([BUILD_PARPORT], [1], [1 if you want parport.])
469 ], [
470 AC_DEFINE([BUILD_PARPORT], [0], [0 if you don't want parport.])
471 ])
472
473 AS_IF([test "x$build_rshim" = "xyes"], [
474 AC_DEFINE([BUILD_RSHIM], [1], [1 if you want to debug BlueField SoC via rshim.])
475 ], [
476 AC_DEFINE([BUILD_RSHIM], [0], [0 if you don't want to debug BlueField SoC via rshim.])
477 ])
478
479 AS_IF([test "x$build_dummy" = "xyes"], [
480 build_bitbang=yes
481 AC_DEFINE([BUILD_DUMMY], [1], [1 if you want dummy driver.])
482 ], [
483 AC_DEFINE([BUILD_DUMMY], [0], [0 if you don't want dummy driver.])
484 ])
485
486 AS_IF([test "x$build_ep93xx" = "xyes"], [
487 build_bitbang=yes
488 AC_DEFINE([BUILD_EP93XX], [1], [1 if you want ep93xx.])
489 ], [
490 AC_DEFINE([BUILD_EP93XX], [0], [0 if you don't want ep93xx.])
491 ])
492
493 AS_IF([test "x$build_at91rm9200" = "xyes"], [
494 build_bitbang=yes
495 AC_DEFINE([BUILD_AT91RM9200], [1], [1 if you want at91rm9200.])
496 ], [
497 AC_DEFINE([BUILD_AT91RM9200], [0], [0 if you don't want at91rm9200.])
498 ])
499
500 AS_IF([test "x$build_bcm2835gpio" = "xyes"], [
501 build_bitbang=yes
502 AC_DEFINE([BUILD_BCM2835GPIO], [1], [1 if you want bcm2835gpio.])
503 ], [
504 AC_DEFINE([BUILD_BCM2835GPIO], [0], [0 if you don't want bcm2835gpio.])
505 ])
506
507 AS_IF([test "x$build_imx_gpio" = "xyes"], [
508 build_bitbang=yes
509 AC_DEFINE([BUILD_IMX_GPIO], [1], [1 if you want imx_gpio.])
510 ], [
511 AC_DEFINE([BUILD_IMX_GPIO], [0], [0 if you don't want imx_gpio.])
512 ])
513
514 AS_IF([test "x$build_am335xgpio" = "xyes"], [
515 build_bitbang=yes
516 AC_DEFINE([BUILD_AM335XGPIO], [1], [1 if you want am335xgpio.])
517 ], [
518 AC_DEFINE([BUILD_AM335XGPIO], [0], [0 if you don't want am335xgpio.])
519 ])
520
521 AS_IF([test "x$parport_use_ppdev" = "xyes"], [
522 AC_DEFINE([PARPORT_USE_PPDEV], [1], [1 if you want parport to use ppdev.])
523 ], [
524 AC_DEFINE([PARPORT_USE_PPDEV], [0], [0 if you don't want parport to use ppdev.])
525 ])
526
527 AS_IF([test "x$parport_use_giveio" = "xyes"], [
528 AC_DEFINE([PARPORT_USE_GIVEIO], [1], [1 if you want parport to use giveio.])
529 ], [
530 AC_DEFINE([PARPORT_USE_GIVEIO], [0], [0 if you don't want parport to use giveio.])
531 ])
532
533 AS_IF([test "x$build_jtag_vpi" = "xyes"], [
534 AC_DEFINE([BUILD_JTAG_VPI], [1], [1 if you want JTAG VPI.])
535 ], [
536 AC_DEFINE([BUILD_JTAG_VPI], [0], [0 if you don't want JTAG VPI.])
537 ])
538
539 AS_IF([test "x$build_vdebug" = "xyes"], [
540 AC_DEFINE([BUILD_VDEBUG], [1], [1 if you want Cadence vdebug interface.])
541 ], [
542 AC_DEFINE([BUILD_VDEBUG], [0], [0 if you don't want Cadence vdebug interface.])
543 ])
544
545 AS_IF([test "x$build_jtag_dpi" = "xyes"], [
546 AC_DEFINE([BUILD_JTAG_DPI], [1], [1 if you want JTAG DPI.])
547 ], [
548 AC_DEFINE([BUILD_JTAG_DPI], [0], [0 if you don't want JTAG DPI.])
549 ])
550
551
552 AS_IF([test "x$build_amtjtagaccel" = "xyes"], [
553 AC_DEFINE([BUILD_AMTJTAGACCEL], [1], [1 if you want the Amontec JTAG-Accelerator driver.])
554 ], [
555 AC_DEFINE([BUILD_AMTJTAGACCEL], [0], [0 if you don't want the Amontec JTAG-Accelerator driver.])
556 ])
557
558 AS_IF([test "x$build_gw16012" = "xyes"], [
559 AC_DEFINE([BUILD_GW16012], [1], [1 if you want the Gateworks GW16012 driver.])
560 ], [
561 AC_DEFINE([BUILD_GW16012], [0], [0 if you don't want the Gateworks GW16012 driver.])
562 ])
563
564 AS_IF([test "x$enable_buspirate" != "xno"], [
565 AC_DEFINE([BUILD_BUSPIRATE], [1], [1 if you want the Buspirate JTAG driver.])
566 ], [
567 AC_DEFINE([BUILD_BUSPIRATE], [0], [0 if you don't want the Buspirate JTAG driver.])
568 ])
569
570 AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
571 AS_IF([test -f "$srcdir/jimtcl/configure.ac"], [
572 AS_IF([test "x$use_internal_jimtcl_maintainer" = "xyes"], [
573 jimtcl_config_options="--disable-install-jim --with-ext=json --maintainer"
574 ], [
575 jimtcl_config_options="--disable-install-jim --with-ext=json"
576 ])
577 AX_CONFIG_SUBDIR_OPTION([jimtcl], [$jimtcl_config_options])
578 ], [
579 AC_MSG_ERROR([jimtcl not found, run git submodule init and git submodule update.])
580 ])
581 ])
582
583 AS_IF([test "x$build_remote_bitbang" = "xyes"], [
584 build_bitbang=yes
585 AC_DEFINE([BUILD_REMOTE_BITBANG], [1], [1 if you want the Remote Bitbang JTAG driver.])
586 ], [
587 AC_DEFINE([BUILD_REMOTE_BITBANG], [0], [0 if you don't want the Remote Bitbang JTAG driver.])
588 ])
589
590 AS_IF([test "x$build_sysfsgpio" = "xyes"], [
591 build_bitbang=yes
592 AC_DEFINE([BUILD_SYSFSGPIO], [1], [1 if you want the SysfsGPIO driver.])
593 ], [
594 AC_DEFINE([BUILD_SYSFSGPIO], [0], [0 if you don't want SysfsGPIO driver.])
595 ])
596
597 AS_IF([test "x$build_xlnx_pcie_xvc" = "xyes"], [
598 build_xlnx_pcie_xvc=yes
599 AC_DEFINE([BUILD_XLNX_PCIE_XVC], [1], [1 if you want the Xilinx XVC/PCIe driver.])
600 ], [
601 AC_DEFINE([BUILD_XLNX_PCIE_XVC], [0], [0 if you don't want Xilinx XVC/PCIe driver.])
602 ])
603
604 PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [
605 use_libusb1=yes
606 AC_DEFINE([HAVE_LIBUSB1], [1], [Define if you have libusb-1.x])
607 LIBUSB1_CFLAGS=`echo $LIBUSB1_CFLAGS | sed 's/-I/-isystem /'`
608 AC_MSG_NOTICE([libusb-1.0 header bug workaround: LIBUSB1_CFLAGS changed to "$LIBUSB1_CFLAGS"])
609 PKG_CHECK_EXISTS([libusb-1.0 >= 1.0.16],
610 [AC_DEFINE([HAVE_LIBUSB_GET_PORT_NUMBERS], [1], [Define if your libusb has libusb_get_port_numbers()])])
611 ], [
612 use_libusb1=no
613 AC_MSG_WARN([libusb-1.x not found, trying legacy libusb-0.1 as a fallback; consider installing libusb-1.x instead])
614 ])
615
616 AC_ARG_WITH([capstone],
617 AS_HELP_STRING([--with-capstone], [Use Capstone disassembly library (default=auto)])
618 , [
619 enable_capstone=$withval
620 ], [
621 enable_capstone=auto
622 ])
623
624 AS_IF([test "x$enable_capstone" != xno], [
625 PKG_CHECK_MODULES([CAPSTONE], [capstone], [
626 AC_DEFINE([HAVE_CAPSTONE], [1], [1 if you have Capstone disassembly framework.])
627 ], [
628 AC_DEFINE([HAVE_CAPSTONE], [0], [0 if you don't have Capstone disassembly framework.])
629 if test "x$enable_capstone" != xauto; then
630 AC_MSG_ERROR([--with-capstone was given, but test for Capstone failed])
631 fi
632 enable_capstone=no
633 ])
634 ])
635
636 for hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
637 PKG_CHECK_MODULES([HIDAPI],[$hidapi_lib],[
638 use_hidapi=yes
639 break
640 ],[
641 use_hidapi=no
642 ])
643 done
644
645 PKG_CHECK_MODULES([LIBFTDI], [libftdi1], [
646 use_libftdi=yes
647 PKG_CHECK_EXISTS([libftdi1 >= 1.5],
648 [AC_DEFINE([HAVE_LIBFTDI_TCIOFLUSH], [1], [Define if your libftdi has ftdi_tcioflush()])])
649 ], [
650 PKG_CHECK_MODULES([LIBFTDI], [libftdi], [use_libftdi=yes], [use_libftdi=no])
651 ])
652
653 PKG_CHECK_MODULES([LIBGPIOD], [libgpiod], [use_libgpiod=yes], [use_libgpiod=no])
654
655 PKG_CHECK_MODULES([LIBJAYLINK], [libjaylink >= 0.2],
656 [use_libjaylink=yes], [use_libjaylink=no])
657
658 m4_define([PROCESS_ADAPTERS], [
659 m4_foreach([adapter], [$1], [
660 AS_IF([test $2], [
661 AS_IF([test "x$ADAPTER_VAR([adapter])" != "xno"], [
662 AC_DEFINE([BUILD_]ADAPTER_SYM([adapter]), [1], [1 if you want the ]ADAPTER_DESC([adapter]).)
663 ], [
664 AC_DEFINE([BUILD_]ADAPTER_SYM([adapter]), [0], [0 if you do not want the ]ADAPTER_DESC([adapter]).)
665 ])
666 ], [
667 AS_IF([test "x$ADAPTER_VAR([adapter])" = "xyes"], [
668 AC_MSG_ERROR([$3 is required for the ADAPTER_DESC([adapter])])
669 ])
670 ADAPTER_VAR([adapter])=no
671 AC_DEFINE([BUILD_]ADAPTER_SYM([adapter]), [0], [0 if you do not want the ]ADAPTER_DESC([adapter]).)
672 ])
673 AM_CONDITIONAL(ADAPTER_SYM([adapter]), [test "x$ADAPTER_VAR([adapter])" != "xno"])
674 ])
675 ])
676
677 PROCESS_ADAPTERS([USB1_ADAPTERS], ["x$use_libusb1" = "xyes"], [libusb-1.x])
678 PROCESS_ADAPTERS([DEPRECATED_USB1_ADAPTERS], ["x$use_libusb1" = "xyes"], [libusb-1.x])
679 PROCESS_ADAPTERS([HIDAPI_ADAPTERS], ["x$use_hidapi" = "xyes"], [hidapi])
680 PROCESS_ADAPTERS([HIDAPI_USB1_ADAPTERS], ["x$use_hidapi" = "xyes" -a "x$use_libusb1" = "xyes"], [hidapi and libusb-1.x])
681 PROCESS_ADAPTERS([LIBFTDI_ADAPTERS], ["x$use_libftdi" = "xyes"], [libftdi])
682 PROCESS_ADAPTERS([LIBFTDI_USB1_ADAPTERS], ["x$use_libftdi" = "xyes" -a "x$use_libusb1" = "xyes"], [libftdi and libusb-1.x])
683 PROCESS_ADAPTERS([LIBGPIOD_ADAPTERS], ["x$use_libgpiod" = "xyes"], [libgpiod])
684 PROCESS_ADAPTERS([LIBJAYLINK_ADAPTERS], ["x$use_internal_libjaylink" = "xyes" -o "x$use_libjaylink" = "xyes"], [libjaylink-0.2])
685
686 AS_IF([test "x$enable_linuxgpiod" != "xno"], [
687 build_bitbang=yes
688 ])
689
690 AS_IF([test "x$enable_stlink" != "xno" -o "x$enable_ti_icdi" != "xno" -o "x$enable_nulink" != "xno"], [
691 AC_DEFINE([BUILD_HLADAPTER], [1], [1 if you want the High Level JTAG driver.])
692 AM_CONDITIONAL([HLADAPTER], [true])
693 ], [
694 AC_DEFINE([BUILD_HLADAPTER], [0], [0 if you want the High Level JTAG driver.])
695 AM_CONDITIONAL([HLADAPTER], [false])
696 ])
697 AM_CONDITIONAL([HLADAPTER_STLINK], [test "x$enable_stlink" != "xno"])
698 AM_CONDITIONAL([HLADAPTER_ICDI], [test "x$enable_ti_icdi" != "xno"])
699 AM_CONDITIONAL([HLADAPTER_NULINK], [test "x$enable_nulink" != "xno"])
700
701 AS_IF([test "x$enable_jlink" != "xno"], [
702 AS_IF([test "x$use_internal_libjaylink" = "xyes"], [
703 AS_IF([test -f "$srcdir/src/jtag/drivers/libjaylink/configure.ac"], [
704 AX_CONFIG_SUBDIR_OPTION([src/jtag/drivers/libjaylink],
705 [--enable-subproject-build])
706 ], [
707 AC_MSG_ERROR([Internal libjaylink not found, run either 'git submodule init' and 'git submodule update' or disable internal libjaylink with --disable-internal-libjaylink.])
708 ])
709 ])
710 ])
711
712 # Presto needs the bitq module
713 AS_IF([test "x$enable_presto" != "xno"], [
714 build_bitq=yes
715 ])
716
717 AM_CONDITIONAL([RELEASE], [test "x$build_release" = "xyes"])
718 AM_CONDITIONAL([PARPORT], [test "x$build_parport" = "xyes"])
719 AM_CONDITIONAL([DUMMY], [test "x$build_dummy" = "xyes"])
720 AM_CONDITIONAL([GIVEIO], [test "x$parport_use_giveio" = "xyes"])
721 AM_CONDITIONAL([EP93XX], [test "x$build_ep93xx" = "xyes"])
722 AM_CONDITIONAL([AT91RM9200], [test "x$build_at91rm9200" = "xyes"])
723 AM_CONDITIONAL([BCM2835GPIO], [test "x$build_bcm2835gpio" = "xyes"])
724 AM_CONDITIONAL([IMX_GPIO], [test "x$build_imx_gpio" = "xyes"])
725 AM_CONDITIONAL([AM335XGPIO], [test "x$build_am335xgpio" = "xyes"])
726 AM_CONDITIONAL([BITBANG], [test "x$build_bitbang" = "xyes"])
727 AM_CONDITIONAL([JTAG_VPI], [test "x$build_jtag_vpi" = "xyes"])
728 AM_CONDITIONAL([VDEBUG], [test "x$build_vdebug" = "xyes"])
729 AM_CONDITIONAL([JTAG_DPI], [test "x$build_jtag_dpi" = "xyes"])
730 AM_CONDITIONAL([USB_BLASTER_DRIVER], [test "x$enable_usb_blaster" != "xno" -o "x$enable_usb_blaster_2" != "xno"])
731 AM_CONDITIONAL([AMTJTAGACCEL], [test "x$build_amtjtagaccel" = "xyes"])
732 AM_CONDITIONAL([GW16012], [test "x$build_gw16012" = "xyes"])
733 AM_CONDITIONAL([REMOTE_BITBANG], [test "x$build_remote_bitbang" = "xyes"])
734 AM_CONDITIONAL([BUSPIRATE], [test "x$enable_buspirate" != "xno"])
735 AM_CONDITIONAL([SYSFSGPIO], [test "x$build_sysfsgpio" = "xyes"])
736 AM_CONDITIONAL([XLNX_PCIE_XVC], [test "x$build_xlnx_pcie_xvc" = "xyes"])
737 AM_CONDITIONAL([USE_LIBUSB1], [test "x$use_libusb1" = "xyes"])
738 AM_CONDITIONAL([IS_CYGWIN], [test "x$is_cygwin" = "xyes"])
739 AM_CONDITIONAL([IS_MINGW], [test "x$is_mingw" = "xyes"])
740 AM_CONDITIONAL([IS_WIN32], [test "x$is_win32" = "xyes"])
741 AM_CONDITIONAL([IS_DARWIN], [test "x$is_darwin" = "xyes"])
742 AM_CONDITIONAL([BITQ], [test "x$build_bitq" = "xyes"])
743 AM_CONDITIONAL([USE_LIBFTDI], [test "x$use_libftdi" = "xyes"])
744 AM_CONDITIONAL([USE_LIBGPIOD], [test "x$use_libgpiod" = "xyes"])
745 AM_CONDITIONAL([USE_HIDAPI], [test "x$use_hidapi" = "xyes"])
746 AM_CONDITIONAL([USE_LIBJAYLINK], [test "x$use_libjaylink" = "xyes"])
747 AM_CONDITIONAL([RSHIM], [test "x$build_rshim" = "xyes"])
748 AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$enable_capstone" != "xno"])
749
750 AM_CONDITIONAL([INTERNAL_JIMTCL], [test "x$use_internal_jimtcl" = "xyes"])
751 AM_CONDITIONAL([INTERNAL_LIBJAYLINK], [test "x$use_internal_libjaylink" = "xyes"])
752
753 # Look for environ alternatives. Possibility #1: is environ in unistd.h or stdlib.h?
754 AC_MSG_CHECKING([for environ in unistd.h and stdlib.h])
755 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
756 #define _GNU_SOURCE
757 #include <unistd.h>
758 #include <stdlib.h>
759 ]], [[char **ep = environ;]]
760 )], [
761 AC_MSG_RESULT([yes])
762 has_environ=yes
763 ], [
764 AC_MSG_RESULT([no])
765
766 # Possibility #2: can environ be found in an available library?
767 AC_MSG_CHECKING([for extern environ])
768 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
769 extern char **environ;
770 ]], [[char **ep = environ;]]
771 )], [
772 AC_DEFINE(NEED_ENVIRON_EXTERN, [1], [Must declare 'environ' to use it.])
773 has_environ=yes
774 ], [
775 has_environ=no
776 ])
777 AC_MSG_RESULT([${has_environ}])
778 ])
779
780 AS_IF([test "x${has_environ}" != "xyes" ], [
781 AC_MSG_FAILURE([Could not find 'environ' in unistd.h or available libraries.])
782 ])
783
784 AC_DEFINE([_GNU_SOURCE],[1],[Use GNU C library extensions (e.g. stdndup).])
785
786 # set default gcc warnings
787 GCC_WARNINGS="-Wall -Wstrict-prototypes -Wformat-security -Wshadow"
788 AS_IF([test "x${gcc_wextra}" = "xyes"], [
789 GCC_WARNINGS="${GCC_WARNINGS} -Wextra -Wno-unused-parameter"
790 GCC_WARNINGS="${GCC_WARNINGS} -Wbad-function-cast"
791 GCC_WARNINGS="${GCC_WARNINGS} -Wcast-align"
792 GCC_WARNINGS="${GCC_WARNINGS} -Wredundant-decls"
793 GCC_WARNINGS="${GCC_WARNINGS} -Wpointer-arith"
794 GCC_WARNINGS="${GCC_WARNINGS} -Wundef"
795 GCC_WARNINGS="${GCC_WARNINGS} -Wno-error=deprecated-declarations"
796 ])
797 AS_IF([test "x${gcc_werror}" = "xyes"], [
798 GCC_WARNINGS="${GCC_WARNINGS} -Werror"
799 ])
800
801 # override default gcc cflags
802 AS_IF([test "x$gcc_warnings" = "xyes"], [
803 AC_SUBST([GCC_WARNINGS], [$GCC_WARNINGS])
804 ])
805
806 AC_SUBST(EXTRA_DIST_NEWS, ["$(echo $srcdir/NEWS-*)"])
807
808 AC_CONFIG_FILES([
809 Makefile
810 ])
811 AC_OUTPUT
812
813 echo
814 echo
815 echo OpenOCD configuration summary
816 echo --------------------------------------------------
817 m4_foreach([adapter], [USB1_ADAPTERS,
818 DEPRECATED_USB1_ADAPTERS,
819 HIDAPI_ADAPTERS, HIDAPI_USB1_ADAPTERS, LIBFTDI_ADAPTERS,
820 LIBFTDI_USB1_ADAPTERS,
821 LIBGPIOD_ADAPTERS,
822 LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS, SERIAL_PORT_ADAPTERS,
823 OPTIONAL_LIBRARIES],
824 [s=m4_format(["%-40s"], ADAPTER_DESC([adapter]))
825 AS_CASE([$ADAPTER_VAR([adapter])],
826 [auto], [
827 echo "$s"yes '(auto)'
828 ],
829 [yes], [
830 echo "$s"yes
831 ],
832 [no], [
833 echo "$s"no
834 ])
835 ])
836 echo

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)