autoconfig和autoreconfig详解

来源:互联网 发布:肯特州立大学知乎 编辑:程序博客网 时间:2024/06/06 07:31

根据文件configure.ac  或者 configure.in 

1 AC_INIT

<strong>AC_INIT</strong>(package, version, [bug-report], [tar-name])
AC_INIT和AC_OUTPUT是configure命令必要的2个宏。AC_INIT可以生成如下M4宏指
  • [AC_]PACKAGE_NAME
  • [AC_]PACKAGE_TARNAME
  • [AC_]PACKAGE_VERSION
  • [AC_]PACKAGE_STRING
  • [AC_]PACKAGE_BUGREPORT

2 AC_PREREQ

<strong>AC_PREREQ</strong>(version)
  指出需要的autoconf最低版本号

3 AM_INIT_AUTOMAKE

<span style="font-family: Arial; font-size: 14px; ">AM_INIT_AUTOMAKE(package, version [, no-define])</span>
This macro is always needed for automake

4 AC_DEFINE

Defines a c preprocessor macro
定义C代码中的宏定义
For example AC_DEFINE(DEBUG) or AC_DEFINE(VERSION, "2.3")

AC_DEFINE_UNQUOTED

Defines a preprocessor macro with shell expansion AC_DEFINE_UNQUOTED(FOO, "${some_variable}")
 定义没用引号的宏,可以在shell中替换变量

6 AC_CHECK_LIB

Checks for a symbol within a library

7  AC_OUTPUT

<strong>AC_OUTPUT</strong>(Makefile foo_config)
There should be an AC_OUTPUT for each Makefile.am in the project.
AC_INIT and AC_OUTPUT are the two only required macros by the configure script.
AC_OUTPUT generates the files that are required for the building process.
Lists the names of the files that will be output by the ./configure script.

8 AM_CONFIG_HEADER

<strong>AM_CONFIG_HEADER</strong>(config.h)<strong>AM_CONFIG_HEADER</strong>(config.h:config.in)
It may optionally name the input file for the output file, by default this is config.h.in, however, this works poorly on dos.
Names the header file which will hold the preprocessor macro definitions for compile time. Normally, this isconfig.h. The source files will then #include "config.h".
Generates a portability header file, requires a accconfig.h file.


   
0 0
原创粉丝点击