@@ -104,12 +104,18 @@ AS_IF([test -x "$srcdir/guess-rev.sh"], [
104104AC_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.
110115m4_define ( [ ADAPTER_ARG] , [ m4_argn ( [ 1] , $1 ) ] )
111116m4_define ( [ ADAPTER_DESC] , [ m4_argn ( [ 2] , $1 ) ] )
112117m4_define ( [ ADAPTER_SYM] , [ m4_argn ( [ 3] , $1 ) ] )
118+ # AC_ARG_ENABLE uses prefix "enable_" to name the corresponding option variable.
113119m4_define ( [ ADAPTER_VAR] , [ enable_[ ] ADAPTER_ARG($1 )] )
114120m4_define ( [ ADAPTER_OPT] , [ m4_translit ( ADAPTER_ARG ( $1 ) , [ _] , [ -] ) ] )
115121
@@ -265,6 +271,7 @@ AC_ARG_ADAPTERS([
265271 LIBFTDI_USB1_ADAPTERS
266272 LIBGPIOD_ADAPTERS,
267273 SERIAL_PORT_ADAPTERS,
274+ PCIE_ADAPTERS,
268275 LIBJAYLINK_ADAPTERS
269276 ] ,[ auto] )
270277
@@ -341,12 +348,10 @@ AC_ARG_ENABLE([sysfsgpio],
341348 AS_HELP_STRING ( [ --enable-sysfsgpio] , [ Enable building support for programming driven via sysfs gpios.] ) ,
342349 [ build_sysfsgpio=$enableval] , [ build_sysfsgpio=no] )
343350
344- AC_ARG_ENABLE ( [ xlnx_pcie_xvc] ,
345- AS_HELP_STRING ( [ --enable-xlnx-pcie-xvc] , [ Enable building support for Xilinx XVC/PCIe.] ) ,
346- [ build_xlnx_pcie_xvc=$enableval] , [ build_xlnx_pcie_xvc=no] )
347-
348351AS_CASE ( [ $host_os] ,
349- [ linux*] , [ ] ,
352+ [ linux*] , [
353+ is_linux=yes
354+ ] ,
350355 [
351356 AS_IF ( [ test "x$build_sysfsgpio" = "xyes"] , [
352357 AC_MSG_ERROR ( [ sysfsgpio is only available on linux] )
@@ -356,10 +361,6 @@ AS_CASE([$host_os],
356361 AC_MSG_ERROR ( [ linuxgpiod is only available on linux] )
357362 ] )
358363
359- AS_IF ( [ test "x$build_xlnx_pcie_xvc" = "xyes"] , [
360- AC_MSG_ERROR ( [ xlnx_pcie_xvc is only available on linux] )
361- ] )
362-
363364 AS_CASE ( [ $host_os] , [ freebsd*] , [ ] ,
364365 [
365366 AS_IF ( [ test "x$build_rshim" = "xyes"] , [
@@ -620,13 +621,6 @@ AS_IF([test "x$build_sysfsgpio" = "xyes"], [
620621 AC_DEFINE ( [ BUILD_SYSFSGPIO] , [ 0] , [ 0 if you don't want SysfsGPIO driver.] )
621622] )
622623
623- AS_IF ( [ test "x$build_xlnx_pcie_xvc" = "xyes"] , [
624- build_xlnx_pcie_xvc=yes
625- AC_DEFINE ( [ BUILD_XLNX_PCIE_XVC] , [ 1] , [ 1 if you want the Xilinx XVC/PCIe driver.] )
626- ] , [
627- AC_DEFINE ( [ BUILD_XLNX_PCIE_XVC] , [ 0] , [ 0 if you don't want Xilinx XVC/PCIe driver.] )
628- ] )
629-
630624PKG_CHECK_MODULES([ LIBUSB1] , [ libusb-1.0] , [
631625 use_libusb1=yes
632626 AC_DEFINE ( [ HAVE_LIBUSB1] , [ 1] , [ Define if you have libusb-1.x] )
@@ -688,11 +682,11 @@ PKG_CHECK_MODULES([LIBGPIOD], [libgpiod < 2.0], [
688682PKG_CHECK_MODULES([ LIBJAYLINK] , [ libjaylink >= 0.2] ,
689683 [ use_libjaylink=yes] , [ use_libjaylink=no] )
690684
691- # Arg $1: The adapter name , used to derive option and variable names for the adapter.
692- # Arg $2: Whether the adapter can be enabled, for example, because
693- # its prerequisites are installed in the system.
685+ # Arg $1: An array of adapter triplets , used to derive option and variable names for each adapter.
686+ # Arg $2: Whether the adapters can be enabled, for example, because
687+ # their prerequisites are installed in the system.
694688# Arg $3: What prerequisites are missing, to be shown in an error message
695- # if the adapter was requested but cannot be enabled.
689+ # if an adapter was requested but cannot be enabled.
696690m4_define ( [ PROCESS_ADAPTERS] , [
697691 m4_foreach ( [ adapter] , [ $1 ] , [
698692 AS_IF ( [ test $2 ] , [
@@ -703,7 +697,7 @@ m4_define([PROCESS_ADAPTERS], [
703697 ] )
704698 ] , [
705699 AS_IF ( [ test "x$ADAPTER_VAR([ adapter] )" = "xyes"] , [
706- AC_MSG_ERROR ( [ $3 is required for the ADAPTER_DESC([ adapter] )] )
700+ AC_MSG_ERROR ( [ $3 is required for [ adapter ] ADAPTER_DESC([ adapter] ). ] )
707701 ] )
708702 ADAPTER_VAR([ adapter] )=no
709703 AC_DEFINE ( [ BUILD_] ADAPTER_SYM ( [ adapter] ) , [ 0] , [ 0 if you do not want the ] ADAPTER_DESC ( [ adapter] ) . )
@@ -719,6 +713,7 @@ PROCESS_ADAPTERS([LIBFTDI_ADAPTERS], ["x$use_libftdi" = "xyes"], [libftdi])
719713PROCESS_ADAPTERS([ LIBFTDI_USB1_ADAPTERS] , [ "x$use_libftdi" = "xyes" -a "x$use_libusb1" = "xyes"] , [ libftdi and libusb-1.x] )
720714PROCESS_ADAPTERS([ LIBGPIOD_ADAPTERS] , [ "x$use_libgpiod" = "xyes"] , [ libgpiod] )
721715PROCESS_ADAPTERS([ LIBJAYLINK_ADAPTERS] , [ "x$use_internal_libjaylink" = "xyes" -o "x$use_libjaylink" = "xyes"] , [ libjaylink-0.2] )
716+ PROCESS_ADAPTERS([ PCIE_ADAPTERS] , [ "x$is_linux" = "xyes"] , [ Linux build] )
722717PROCESS_ADAPTERS([ DUMMY_ADAPTER] , [ true] , [ unused] )
723718
724719AS_IF ( [ test "x$enable_linuxgpiod" != "xno"] , [
@@ -775,7 +770,6 @@ AM_CONDITIONAL([GW16012], [test "x$build_gw16012" = "xyes"])
775770AM_CONDITIONAL([ REMOTE_BITBANG] , [ test "x$build_remote_bitbang" = "xyes"] )
776771AM_CONDITIONAL([ BUSPIRATE] , [ test "x$enable_buspirate" != "xno"] )
777772AM_CONDITIONAL([ SYSFSGPIO] , [ test "x$build_sysfsgpio" = "xyes"] )
778- AM_CONDITIONAL([ XLNX_PCIE_XVC] , [ test "x$build_xlnx_pcie_xvc" = "xyes"] )
779773AM_CONDITIONAL([ USE_LIBUSB1] , [ test "x$use_libusb1" = "xyes"] )
780774AM_CONDITIONAL([ IS_CYGWIN] , [ test "x$is_cygwin" = "xyes"] )
781775AM_CONDITIONAL([ IS_MINGW] , [ test "x$is_mingw" = "xyes"] )
0 commit comments