@@ -22,6 +22,7 @@ AC_CANONICAL_HOST
2222AC_CANONICAL_TARGET
2323AC_CONFIG_MACRO_DIR ( [ m4] )
2424
25+
2526AM_INIT_AUTOMAKE ( [ 1.11 -Wall -Werror -Wno-portability foreign tar-ustar subdir-objects no-define color-tests] )
2627
2728AC_ARG_PROGRAM
@@ -332,6 +333,17 @@ then
332333 AM_CFLAGS="$AM_CFLAGS -DWOLFTPM_NUVOTON"
333334fi
334335
336+ # Nations Technology NS350
337+ AC_ARG_ENABLE ( [ nations] ,
338+ [ AS_HELP_STRING ( [ --enable-nations] ,[ Enable Nations Technology NS350 TPM Support (default: disabled)] ) ] ,
339+ [ ENABLED_NATIONS=$enableval ] ,
340+ [ ENABLED_NATIONS=no ]
341+ )
342+ if test "x$ENABLED_NATIONS" = "xyes"
343+ then
344+ AM_CFLAGS="$AM_CFLAGS -DWOLFTPM_NATIONS"
345+ fi
346+
335347# Infineon SLB9670/SLB9672/SLB9673
336348AC_ARG_ENABLE ( [ infineon] ,
337349 [ AS_HELP_STRING ( [ --enable-infineon] ,[ Enable Infineon SLB9670/SLB9672 TPM Support (default: disabled)] ) ] ,
@@ -407,7 +419,8 @@ if test "x$ENABLED_AUTODETECT" = "xtest"
407419then
408420 # If a module hasn't been selected then enable auto-detection
409421 if test "x$ENABLED_INFINEON" = "xno" && test "x$ENABLED_MCHP" = "xno" && test "x$ENABLED_MICROCHIP" = "xno" && \
410- test "x$ENABLED_ST" = "xno" && test "x$ENABLED_ST33" = "xno" && test "x$ENABLED_NUVOTON" = "xno"
422+ test "x$ENABLED_ST" = "xno" && test "x$ENABLED_ST33" = "xno" && test "x$ENABLED_NUVOTON" = "xno" && \
423+ test "x$ENABLED_NATIONS" = "xno"
411424 then
412425 ENABLED_AUTODETECT=yes
413426 fi
@@ -462,6 +475,40 @@ then
462475 AM_CFLAGS="$AM_CFLAGS -DWOLFTPM_PROVISIONING"
463476fi
464477
478+ # SPDM Support
479+ AC_ARG_ENABLE ( [ spdm] ,
480+ [ AS_HELP_STRING ( [ --enable-spdm] ,[ Enable SPDM support (default: disabled)] ) ] ,
481+ [ ENABLED_SPDM=$enableval ] ,
482+ [ ENABLED_SPDM=no ]
483+ )
484+
485+ AC_ARG_WITH ( [ wolfspdm] ,
486+ [ AS_HELP_STRING ( [ --with-wolfspdm=PATH] ,[ DEPRECATED: Use --enable-spdm instead.] ) ] ,
487+ [ AC_MSG_ERROR ( [ --with-wolfspdm is no longer needed. Use --enable-spdm instead.] ) ] )
488+
489+ if test "x$ENABLED_SPDM" = "xyes"
490+ then
491+ AC_DEFINE ( [ WOLFTPM_SPDM] , [ 1] , [ Enable SPDM support] )
492+
493+ # Nuvoton SPDM support (required for SPDM in wolfTPM)
494+ if test "x$ENABLED_NUVOTON" = "xyes"
495+ then
496+ AC_DEFINE ( [ WOLFSPDM_NUVOTON] , [ 1] , [ Enable SPDM Nuvoton TPM support] )
497+ AC_MSG_NOTICE ( [ Nuvoton SPDM vendor commands enabled] )
498+ fi
499+
500+ # Nations Technology SPDM support
501+ if test "x$ENABLED_NATIONS" = "xyes"
502+ then
503+ AC_DEFINE ( [ WOLFSPDM_NATIONS] , [ 1] , [ Enable SPDM Nations Technology support] )
504+ AC_MSG_NOTICE ( [ Nations Technology SPDM vendor commands enabled] )
505+ fi
506+
507+ if test "x$ax_enable_debug" != "xno"
508+ then
509+ AC_DEFINE ( [ WOLFSPDM_DEBUG] , [ 1] , [ SPDM: Enable debug output] )
510+ fi
511+ fi
465512
466513# HARDEN FLAGS
467514AX_HARDEN_CC_COMPILER_FLAGS
@@ -489,10 +536,12 @@ AM_CONDITIONAL([BUILD_DEVTPM], [test "x$ENABLED_DEVTPM" = "xyes"])
489536AM_CONDITIONAL([ BUILD_SWTPM] , [ test "x$ENABLED_SWTPM" = "xyes"] )
490537AM_CONDITIONAL([ BUILD_WINAPI] , [ test "x$ENABLED_WINAPI" = "xyes"] )
491538AM_CONDITIONAL([ BUILD_NUVOTON] , [ test "x$ENABLED_NUVOTON" = "xyes"] )
539+ AM_CONDITIONAL([ BUILD_NATIONS] , [ test "x$ENABLED_NATIONS" = "xyes"] )
492540AM_CONDITIONAL([ BUILD_CHECKWAITSTATE] , [ test "x$ENABLED_CHECKWAITSTATE" = "xyes"] )
493541AM_CONDITIONAL([ BUILD_AUTODETECT] , [ test "x$ENABLED_AUTODETECT" = "xyes"] )
494542AM_CONDITIONAL([ BUILD_FIRMWARE] , [ test "x$ENABLED_FIRMWARE" = "xyes"] )
495543AM_CONDITIONAL([ BUILD_HAL] , [ test "x$ENABLED_EXAMPLE_HAL" = "xyes" || test "x$ENABLED_MMIO" = "xyes"] )
544+ AM_CONDITIONAL([ BUILD_SPDM] , [ test "x$ENABLED_SPDM" = "xyes"] )
496545
497546
498547CREATE_HEX_VERSION
@@ -578,6 +627,10 @@ for option in $OPTION_FLAGS; do
578627 fi
579628done
580629
630+ # Also capture SPDM defines from config.h (set via AC_DEFINE, not AM_CFLAGS)
631+ grep '^# define WOLFSPDM_' src/config.h >> $OPTION_FILE 2>/dev/null || true
632+ grep '^# define WOLFTPM_SPDM' src/config.h >> $OPTION_FILE 2>/dev/null || true
633+
581634echo "" >> $OPTION_FILE
582635echo "# ifdef __cplusplus" >> $OPTION_FILE
583636echo "}" >> $OPTION_FILE
@@ -619,6 +672,8 @@ echo " * Infineon SLB967X $ENABLED_INFINEON"
619672echo " * STM ST33: $ENABLED_ST"
620673echo " * Microchip ATTPM20: $ENABLED_MICROCHIP"
621674echo " * Nuvoton NPCT75x: $ENABLED_NUVOTON"
675+ echo " * Nations Tech NS350: $ENABLED_NATIONS"
622676
623677echo " * Runtime Module Detection: $ENABLED_AUTODETECT"
624678echo " * Firmware Upgrade Support: $ENABLED_FIRMWARE"
679+ echo " * SPDM Support: $ENABLED_SPDM"
0 commit comments