@@ -187,6 +187,9 @@ m4_define([JTAG_DPI_ADAPTER],
187187m4_define ( [ JTAG_VPI_ADAPTER] ,
188188 [ [ [ jtag_vpi] , [ JTAG VPI Adapter] , [ JTAG_VPI] ] ] )
189189
190+ m4_define ( [ RSHIM_ADAPTER] ,
191+ [ [ [ rshim] , [ BlueField SoC via rshim] , [ RSHIM] ] ] )
192+
190193# The word 'Adapter' in "Dummy Adapter" below must begin with a capital letter
191194# because there is an M4 macro called 'adapter'.
192195m4_define ( [ DUMMY_ADAPTER] ,
@@ -285,10 +288,6 @@ AS_IF([test "x$debug_malloc" = "xyes" -a "x$have_glibc" = "xyes"], [
285288 AC_DEFINE ( [ _DEBUG_FREE_SPACE_] ,[ 1] , [ Include malloc free space in logging] )
286289] )
287290
288- AC_ARG_ENABLE ( [ rshim] ,
289- AS_HELP_STRING ( [ --enable-rshim] , [ Enable building the rshim driver] ) ,
290- [ build_rshim=$enableval] , [ build_rshim=no] )
291-
292291AC_ARG_ENABLE ( [ dmem] ,
293292 AS_HELP_STRING ( [ --enable-dmem] , [ Enable building the dmem driver] ) ,
294293 [ build_dmem=$enableval] , [ build_dmem=no] )
@@ -320,6 +319,7 @@ AC_ARG_ADAPTERS([
320319 VDEBUG_ADAPTER,
321320 JTAG_DPI_ADAPTER,
322321 JTAG_VPI_ADAPTER,
322+ RSHIM_ADAPTER,
323323 PCIE_ADAPTERS,
324324 LIBJAYLINK_ADAPTERS
325325 ] ,[ auto] )
@@ -383,19 +383,24 @@ AC_ARG_ENABLE([sysfsgpio],
383383 AS_HELP_STRING ( [ --enable-sysfsgpio] , [ Enable building support for programming driven via sysfs gpios.] ) ,
384384 [ build_sysfsgpio=$enableval] , [ build_sysfsgpio=no] )
385385
386+ can_build_rshim=no
387+
386388AS_CASE ( [ $host_os] ,
387389 [ linux*] , [
388390 is_linux=yes
391+ can_build_rshim=yes
389392 ] ,
390393 [
391394 AS_IF ( [ test "x$build_sysfsgpio" = "xyes"] , [
392395 AC_MSG_ERROR ( [ sysfsgpio is only available on linux] )
393396 ] )
394397
395- AS_CASE ( [ $host_os] , [ freebsd*] , [ ] ,
398+ AS_CASE ( [ $host_os] , [ freebsd*] , [
399+ can_build_rshim=yes
400+ ] ,
396401 [
397- AS_IF ( [ test "x$build_rshim " = "xyes"] , [
398- AC_MSG_ERROR ( [ build_rshim is only available on linux or freebsd] )
402+ AS_IF ( [ test "x$enable_rshim " = "xyes"] , [
403+ AC_MSG_ERROR ( [ rshim is only available on linux or freebsd] )
399404 ] )
400405 ] )
401406
@@ -514,12 +519,6 @@ AS_IF([test "x$build_parport" = "xyes"], [
514519 AC_DEFINE ( [ BUILD_PARPORT] , [ 0] , [ 0 if you don't want parport.] )
515520] )
516521
517- AS_IF ( [ test "x$build_rshim" = "xyes"] , [
518- AC_DEFINE ( [ BUILD_RSHIM] , [ 1] , [ 1 if you want to debug BlueField SoC via rshim.] )
519- ] , [
520- AC_DEFINE ( [ BUILD_RSHIM] , [ 0] , [ 0 if you don't want to debug BlueField SoC via rshim.] )
521- ] )
522-
523522AS_IF ( [ test "x$build_dmem" = "xyes"] , [
524523 AC_DEFINE ( [ BUILD_DMEM] , [ 1] , [ 1 if you want to debug via Direct Mem.] )
525524] , [
@@ -718,6 +717,8 @@ PROCESS_ADAPTERS([LINUXSPIDEV_ADAPTER], ["x$is_linux" = "xyes"], [Linux spidev])
718717PROCESS_ADAPTERS([ VDEBUG_ADAPTER] , [ true] , [ unused] )
719718PROCESS_ADAPTERS([ JTAG_DPI_ADAPTER] , [ true] , [ unused] )
720719PROCESS_ADAPTERS([ JTAG_VPI_ADAPTER] , [ true] , [ unused] )
720+ PROCESS_ADAPTERS([ RSHIM_ADAPTER] , [ "x$can_build_rshim" = "xyes"] ,
721+ [ internal error: validation should happen beforehand] )
721722PROCESS_ADAPTERS([ DUMMY_ADAPTER] , [ true] , [ unused] )
722723
723724AS_IF ( [ test "x$enable_linuxgpiod" != "xno"] , [
@@ -783,7 +784,6 @@ AM_CONDITIONAL([USE_LIBFTDI], [test "x$use_libftdi" = "xyes"])
783784AM_CONDITIONAL([ USE_LIBGPIOD] , [ test "x$use_libgpiod" = "xyes"] )
784785AM_CONDITIONAL([ USE_HIDAPI] , [ test "x$use_hidapi" = "xyes"] )
785786AM_CONDITIONAL([ USE_LIBJAYLINK] , [ test "x$use_libjaylink" = "xyes"] )
786- AM_CONDITIONAL([ RSHIM] , [ test "x$build_rshim" = "xyes"] )
787787AM_CONDITIONAL([ DMEM] , [ test "x$build_dmem" = "xyes"] )
788788AM_CONDITIONAL([ HAVE_CAPSTONE] , [ test "x$enable_capstone" != "xno"] )
789789
@@ -876,6 +876,7 @@ m4_foreach([adapter], [USB1_ADAPTERS,
876876 VDEBUG_ADAPTER,
877877 JTAG_DPI_ADAPTER,
878878 JTAG_VPI_ADAPTER,
879+ RSHIM_ADAPTER,
879880 DUMMY_ADAPTER,
880881 OPTIONAL_LIBRARIES,
881882 COVERAGE] ,
0 commit comments