Chinaunix首页 | 论坛 | 博客
  • 博客访问: 10706726
  • 博文数量: 2905
  • 博客积分: 20098
  • 博客等级: 上将
  • 技术积分: 36298
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-23 05:00
文章存档

2012年(1)

2011年(3)

2009年(2901)

分类: LINUX

2009-03-23 11:11:09

M4 (1.4):

M4 是一个宏处理器.将输入拷贝到输出,同时将宏展开. 宏可以是内嵌的也可以是用户定义的. 除了可以展开宏,m4还有一些内建的函数,用来引用文件,执行Unix命令,整数运算,文本操作,循环等. m4既可以作为编译器的前端也可以单独作为一个宏处理器.
安装下列程序: m4

m4 将输入拷贝到输出,同时将宏展开. 宏可以是内嵌的也可以是用户定义的. 除了可以展开宏,m4还有一些内建的函数,用来引用文件,执行Unix命令,整数运算,文本操作,循环等. m4既可以作为编译器的前端也可以单独作为一个宏处理器。

M4 依赖于: Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Grep, Make, Perl, Sed.

m4手册
man m4:

NAME
       m4 - macro processor

SYNOPSIS
       m4 [OPTION]... [FILE]...

DESCRIPTION
       Process  macros in FILEs.  If no FILE or if FILE is ‘-’, standard input
       is read.

       Mandatory or optional  arguments  to  long  options  are  mandatory  or
       optional for short options too.

   Operation modes:
       --help display this help and exit

       --version
              output version information and exit

       -E, --fatal-warnings
              once:  warnings  become  errors,  twice: stop execution at first
              error

       -i, --interactive
              unbuffer output, ignore interrupts

       -P, --prefix-builtins
              force a ‘m4_’ prefix to all builtins

       -Q, --quiet, --silent
              suppress some warnings for builtins

       --warn-macro-sequence[=REGEXP]
              warn   if   macro    definition    matches    REGEXP,    default
              \$\({[^}]*}\|[0-9][0-9]+\)

   Preprocessor features:
       -D, --define=NAME[=VALUE]
              define NAME as having VALUE, or empty

       -I, --include=DIRECTORY
              append DIRECTORY to include path

       -s, --synclines
              generate ‘#line NUM "FILE"’ lines

       -U, --undefine=NAME
              undefine NAME

   Limits control:
       -G, --traditional
              suppress all GNU extensions

       -H, --hashsize=PRIME
              set symbol lookup hash table size [509]

       -L, --nesting-limit=NUMBER
              change artificial nesting limit [1024]

   Frozen state files:
       -F, --freeze-state=FILE
              produce a frozen state on FILE at end

       -R, --reload-state=FILE
              reload a frozen state from FILE at start

   Debugging:
       -d, --debug[=FLAGS]
              set debug level (no FLAGS implies ‘aeq’)

       --debugfile=FILE
              redirect debug and trace output

       -l, --arglength=NUM
              restrict macro tracing size

       -t, --trace=NAME
              trace NAME when it is defined

   FLAGS is any of:
       a      show actual arguments

       c      show before collect, after collect and after call

       e      show expansion

       f      say current input file name

       i      show changes in input files

       l      say current input line number

       p      show results of path searches

       q      quote values as necessary, with a or e flag

       t      trace for all macro calls, not only traceon’ed

       x      add a unique macro call id, useful with c flag

       V      shorthand for all of the above flags

       If defined, the environment variable ‘M4PATH’ is a colon-separated list
       of directories included after any specified by ‘-I’.

       Exit status is 0 for success, 1 for failure, 63 for frozen file version
       mismatch, or whatever value was passed to the m4exit macro.

AUTHOR
       Written by Rene’ Seindal.

REPORTING BUGS
       Report bugs to <>.

COPYRIGHT
       Copyright  ©  2007  Free Software Foundation, Inc.  License GPLv3+: GNU
       GPL version 3 or later <
       This is free software: you are free  to  change  and  redistribute  it.
       There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
       The  full  documentation  for m4 is maintained as a Texinfo manual.  If
       the info and m4 programs are properly installed at your site, the  com-
       mand

              info m4

       should give you access to the complete manual.



FSF                                July 2007                             M4(1)

阅读(2767) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~