parameters: (env)
docstring: Add Builders and construction variables for m4 to an Environment.
docstring_summary: Add Builders and construction variables for m4 to an Environment.
docstring_tokens: Add Builders and construction variables for m4 to an Environment .
function: def generate(env):
      """Add Builders and construction variables for m4 to an Environment."""
      M4Action = SCons.Action.Action('$M4COM', '$M4COMSTR')
      bld = SCons.Builder.Builder(action = M4Action, src_suffix = '.m4')
  
      env['BUILDERS']['M4'] = bld
  
      # .m4 files might include other files, and it would be pretty hard
      # to write a scanner for it, so let's just cd to the dir of the m4
      # file and run from there.
      # The src_suffix setup is like so: file.c.m4 -> file.c,
      # file.cpp.m4 -> file.cpp etc.
      env['M4']      = 'm4'
      env['M4FLAGS'] = SCons.Util.CLVar('-E')
      env['M4COM']   = 'cd ${SOURCE.rsrcdir} && $M4 $M4FLAGS < ${SOURCE.file} > ${TARGET.abspath}'
function_tokens: def generate ( env ) : M4Action = SCons . Action . Action ( '$M4COM' , '$M4COMSTR' ) bld = SCons . Builder . Builder ( action = M4Action , src_suffix = '.m4' ) env [ 'BUILDERS' ] [ 'M4' ] = bld # .m4 files might include other files, and it would be pretty hard # to write a scanner for it, so let's just cd to the dir of the m4 # file and run from there. # The src_suffix setup is like so: file.c.m4 -> file.c, # file.cpp.m4 -> file.cpp etc. env [ 'M4' ] = 'm4' env [ 'M4FLAGS' ] = SCons . Util . CLVar ( '-E' ) env [ 'M4COM' ] = 'cd ${SOURCE.rsrcdir} && $M4 $M4FLAGS < ${SOURCE.file} > ${TARGET.abspath}'