Meson

From the project homepage:

Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible.

Here is a simple template (extracted from tcl-blake3 ) that you can use to build a Stubs-enabled Tcl extension:

# meson.build
project(
  'my-extension', 'c',
  version : '1.0',
)

shared_library(
  'my-extension',
  'my-extension.c',
  # meson adds --as-needed by default, so we just need to define the macro
  c_args : get_option('use_tcl_stubs') ? '-DUSE_TCL_STUBS' : [],
  install : true,
  dependencies : dependency('tcl'),
)

configure_file(
  input : 'pkgIndex.tcl.in',
  output : 'pkgIndex.tcl',
  configuration : {'VERSION' : meson.project_version()},
  install_dir : get_option('libdir'),
)

dtplite = find_program('dtplite')

custom_target('manpage',
  output : 'my-extension.n',
  input : 'my-extension.man',
  command : [dtplite, '-o', '@OUTPUT@', 'nroff', '@INPUT@'],
  install : true,
  install_dir : join_paths(get_option('mandir'), 'mann'),
)
# meson.options
option('use_tcl_stubs', type : 'boolean', value : true, description : 'Use the Tcl stubs mechanism')
# pkgIndex.tcl.in
package ifneeded my-extension @VERSION@ [list
  load [file join $dir libmy-extension[info sharedlibextension]] My_extension
]