Skip to content

Commit 7214c8b

Browse files
R. Diezborneoa
authored andcommitted
configure: show adapter Xilinx XVC/PCIe in the configuration summary
Adapter Xilinx XVC/PCIe was not appearing in the configuration summary because of the wrong variable name: build_xlnx_pcie_xvc instead of enable_xlnx_pcie_xvc. Also build this adapter automatically on Linux. Change-Id: I69ea92f550052b9ce55ce32597ac446a15a87388 Signed-off-by: R. Diez <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8312 Tested-by: jenkins Reviewed-by: R. Diez <[email protected]> Reviewed-by: Antonio Borneo <[email protected]>
1 parent d09ff47 commit 7214c8b

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

configure.ac

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,18 @@ AS_IF([test -x "$srcdir/guess-rev.sh"], [
104104
AC_MSG_RESULT([$build_release])
105105

106106
# Adapter drivers
107-
# 1st column -- configure option
108-
# 2nd column -- description
109-
# 3rd column -- symbol used for both config.h and automake
107+
# 1st column -- Basename for the configure option generated with AC_ARG_ENABLE.
108+
# For example, "buspirate" generates options "--enable-buspirate[=yes/no]"
109+
# and "--disable-buspirate".
110+
# 2nd column -- Description for the configure option. For example, "Bus Pirate"
111+
# generates "Enable building support for the Bus Pirate (default is auto)".
112+
# 3rd column -- Basename for the config.h and Automake symbols.
113+
# For example, basename "BUS_PIRATE" generates "BUILD_BUS_PIRATE" with AC_DEFINE
114+
# for config.h and "BUS_PIRATE" with AM_CONDITIONAL for Automake.
110115
m4_define([ADAPTER_ARG], [m4_argn([1], $1)])
111116
m4_define([ADAPTER_DESC], [m4_argn([2], $1)])
112117
m4_define([ADAPTER_SYM], [m4_argn([3], $1)])
118+
# AC_ARG_ENABLE uses prefix "enable_" to name the corresponding option variable.
113119
m4_define([ADAPTER_VAR], [enable_[]ADAPTER_ARG($1)])
114120
m4_define([ADAPTER_OPT], [m4_translit(ADAPTER_ARG($1), [_], [-])])
115121

@@ -264,6 +270,7 @@ AC_ARG_ADAPTERS([
264270
LIBFTDI_USB1_ADAPTERS
265271
LIBGPIOD_ADAPTERS,
266272
SERIAL_PORT_ADAPTERS,
273+
PCIE_ADAPTERS,
267274
LIBJAYLINK_ADAPTERS
268275
],[auto])
269276

@@ -340,12 +347,10 @@ AC_ARG_ENABLE([sysfsgpio],
340347
AS_HELP_STRING([--enable-sysfsgpio], [Enable building support for programming driven via sysfs gpios.]),
341348
[build_sysfsgpio=$enableval], [build_sysfsgpio=no])
342349

343-
AC_ARG_ENABLE([xlnx_pcie_xvc],
344-
AS_HELP_STRING([--enable-xlnx-pcie-xvc], [Enable building support for Xilinx XVC/PCIe.]),
345-
[build_xlnx_pcie_xvc=$enableval], [build_xlnx_pcie_xvc=no])
346-
347350
AS_CASE([$host_os],
348-
[linux*], [],
351+
[linux*], [
352+
is_linux=yes
353+
],
349354
[
350355
AS_IF([test "x$build_sysfsgpio" = "xyes"], [
351356
AC_MSG_ERROR([sysfsgpio is only available on linux])
@@ -355,10 +360,6 @@ AS_CASE([$host_os],
355360
AC_MSG_ERROR([linuxgpiod is only available on linux])
356361
])
357362
358-
AS_IF([test "x$build_xlnx_pcie_xvc" = "xyes"], [
359-
AC_MSG_ERROR([xlnx_pcie_xvc is only available on linux])
360-
])
361-
362363
AS_CASE([$host_os], [freebsd*], [],
363364
[
364365
AS_IF([test "x$build_rshim" = "xyes"], [
@@ -619,13 +620,6 @@ AS_IF([test "x$build_sysfsgpio" = "xyes"], [
619620
AC_DEFINE([BUILD_SYSFSGPIO], [0], [0 if you don't want SysfsGPIO driver.])
620621
])
621622

622-
AS_IF([test "x$build_xlnx_pcie_xvc" = "xyes"], [
623-
build_xlnx_pcie_xvc=yes
624-
AC_DEFINE([BUILD_XLNX_PCIE_XVC], [1], [1 if you want the Xilinx XVC/PCIe driver.])
625-
], [
626-
AC_DEFINE([BUILD_XLNX_PCIE_XVC], [0], [0 if you don't want Xilinx XVC/PCIe driver.])
627-
])
628-
629623
PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [
630624
use_libusb1=yes
631625
AC_DEFINE([HAVE_LIBUSB1], [1], [Define if you have libusb-1.x])
@@ -687,11 +681,11 @@ PKG_CHECK_MODULES([LIBGPIOD], [libgpiod < 2.0], [
687681
PKG_CHECK_MODULES([LIBJAYLINK], [libjaylink >= 0.2],
688682
[use_libjaylink=yes], [use_libjaylink=no])
689683

690-
# Arg $1: The adapter name, used to derive option and variable names for the adapter.
691-
# Arg $2: Whether the adapter can be enabled, for example, because
692-
# its prerequisites are installed in the system.
684+
# Arg $1: An array of adapter triplets, used to derive option and variable names for each adapter.
685+
# Arg $2: Whether the adapters can be enabled, for example, because
686+
# their prerequisites are installed in the system.
693687
# Arg $3: What prerequisites are missing, to be shown in an error message
694-
# if the adapter was requested but cannot be enabled.
688+
# if an adapter was requested but cannot be enabled.
695689
m4_define([PROCESS_ADAPTERS], [
696690
m4_foreach([adapter], [$1], [
697691
AS_IF([test $2], [
@@ -702,7 +696,7 @@ m4_define([PROCESS_ADAPTERS], [
702696
])
703697
], [
704698
AS_IF([test "x$ADAPTER_VAR([adapter])" = "xyes"], [
705-
AC_MSG_ERROR([$3 is required for the ADAPTER_DESC([adapter])])
699+
AC_MSG_ERROR([$3 is required for [adapter] ADAPTER_DESC([adapter]).])
706700
])
707701
ADAPTER_VAR([adapter])=no
708702
AC_DEFINE([BUILD_]ADAPTER_SYM([adapter]), [0], [0 if you do not want the ]ADAPTER_DESC([adapter]).)
@@ -718,6 +712,7 @@ PROCESS_ADAPTERS([LIBFTDI_ADAPTERS], ["x$use_libftdi" = "xyes"], [libftdi])
718712
PROCESS_ADAPTERS([LIBFTDI_USB1_ADAPTERS], ["x$use_libftdi" = "xyes" -a "x$use_libusb1" = "xyes"], [libftdi and libusb-1.x])
719713
PROCESS_ADAPTERS([LIBGPIOD_ADAPTERS], ["x$use_libgpiod" = "xyes"], [libgpiod])
720714
PROCESS_ADAPTERS([LIBJAYLINK_ADAPTERS], ["x$use_internal_libjaylink" = "xyes" -o "x$use_libjaylink" = "xyes"], [libjaylink-0.2])
715+
PROCESS_ADAPTERS([PCIE_ADAPTERS], ["x$is_linux" = "xyes"], [Linux build])
721716
PROCESS_ADAPTERS([DUMMY_ADAPTER], [true], [unused])
722717

723718
AS_IF([test "x$enable_linuxgpiod" != "xno"], [
@@ -774,7 +769,6 @@ AM_CONDITIONAL([GW16012], [test "x$build_gw16012" = "xyes"])
774769
AM_CONDITIONAL([REMOTE_BITBANG], [test "x$build_remote_bitbang" = "xyes"])
775770
AM_CONDITIONAL([BUSPIRATE], [test "x$enable_buspirate" != "xno"])
776771
AM_CONDITIONAL([SYSFSGPIO], [test "x$build_sysfsgpio" = "xyes"])
777-
AM_CONDITIONAL([XLNX_PCIE_XVC], [test "x$build_xlnx_pcie_xvc" = "xyes"])
778772
AM_CONDITIONAL([USE_LIBUSB1], [test "x$use_libusb1" = "xyes"])
779773
AM_CONDITIONAL([IS_CYGWIN], [test "x$is_cygwin" = "xyes"])
780774
AM_CONDITIONAL([IS_MINGW], [test "x$is_mingw" = "xyes"])

0 commit comments

Comments
 (0)