您的位置:首页 > 产品设计 > UI/UE

The GNU configure and build system-configure的详细介绍

2015-08-21 12:22 633 查看

第一篇:The GNU configure and build system

Ian Lance Taylor

Introduction

Goals
Tools
History
Building

Getting Started

Write configure.in
Write Makefile.am
Write acconfig.h
Generate files
Example

First Try
Second Try
Third Try
Generate Files

Files

Developer Files

Developer Files Picture
Written Developer Files
Generated Developer Files

Build Files

Build Files Picture
Build Files Description

Support Files

Configuration Names

Configuration Name Definition
Using Configuration Names

Cross Compilation Tools

Cross Compilation Concepts
Host and Target
Using the Host Type
Specifying the Target
Using the Target Type
Cross Tools in the Cygnus Tree

Host and Target Libraries
Target Library Configure Scripts
Make Targets in Cygnus Tree
Target libiberty

Canadian Cross

Canadian Cross Example
Canadian Cross Concepts
Build Cross Host Tools
Build and Host Options
Canadian Cross not in Cygnus Tree.
Canadian Cross in Cygnus Tree

Building a Normal Program
Building a Cross Program

Supporting Canadian Cross

Supporting Canadian Cross in Configure Scripts
Supporting Canadian Cross in Makefiles.

Cygnus Configure

Cygnus Configure Basics
Cygnus Configure in C++ Libraries

Multilibs

Multilibs in gcc
Multilibs in Target Libraries

Frequently Asked Questions
Index

This document was generated on 1 July 1998 using the texi2html translator version 1.52.

第二篇:Autoconf

www.delorie.com/gnu/docs/autoconf/autoconf_toc.html search



Buy the book!

Autoconf

[Top][Contents][Index][ ? ]

Table of Contents

1. Introduction

2. The GNU Build System

2.1 Automake

2.2 Libtool

2.3 Pointers

3. Making
configure
Scripts


3.1 Writing `configure.ac'

3.1.1 A Shell Script Compiler

3.1.2 The Autoconf Language

3.1.3 Standard `configure.ac' Layout

3.2 Using
autoscan
to Create `configure.ac'


3.3 Using
ifnames
to List Conditionals


3.4 Using
autoconf
to Create
configure


3.5 Using
autoreconf
to Update
configure
Scripts


4. Initialization and Output Files

4.1 Initializing
configure


4.2 Notices in
configure


4.3 Finding
configure
Input


4.4 Outputting Files

4.5 Performing Configuration Actions

4.6 Creating Configuration Files

4.7 Substitutions in Makefiles

4.7.1 Preset Output Variables

4.7.2 Installation Directory Variables

4.7.3 Build Directories

4.7.4 Automatic Remaking

4.8 Configuration Header Files

4.8.1 Configuration Header Templates

4.8.2 Using
autoheader
to Create `config.h.in'


4.8.3 Autoheader Macros

4.9 Running Arbitrary Configuration Commands

4.10 Creating Configuration Links

4.11 Configuring Other Packages in Subdirectories

4.12 Default Prefix

5. Existing Tests

5.1 Common Behavior

5.1.1 Standard Symbols

5.1.2 Default Includes

5.2 Alternative Programs

5.2.1 Particular Program Checks

5.2.2 Generic Program and File Checks

5.3 Files

5.4 Library Files

5.5 Library Functions

5.5.1 Portability of C Functions

5.5.2 Particular Function Checks

5.5.3 Generic Function Checks

5.6 Header Files

5.6.1 Portability of Headers

5.6.2 Particular Header Checks

5.6.3 Generic Header Checks

5.7 Declarations

5.7.1 Particular Declaration Checks

5.7.2 Generic Declaration Checks

5.8 Structures

5.8.1 Particular Structure Checks

5.8.2 Generic Structure Checks

5.9 Types

5.9.1 Particular Type Checks

5.9.2 Generic Type Checks

5.10 Compilers and Preprocessors

5.10.1 Specific Compiler Characteristics

5.10.2 Generic Compiler Characteristics

5.10.3 C Compiler Characteristics

5.10.4 C++ Compiler Characteristics

5.10.5 Fortran 77 Compiler Characteristics

5.11 System Services

5.12 UNIX Variants

6. Writing Tests

6.1 Language Choice

6.2 Writing Test Programs

6.2.1 Guidelines for Test Programs

6.2.2 Test Functions

6.2.3 Generating Sources

6.3 Running the Preprocessor

6.4 Running the Compiler

6.5 Running the Linker

6.6 Checking Run Time Behavior

6.7 Systemology

6.8 Multiple Cases

7. Results of Tests

7.1 Defining C Preprocessor Symbols

7.2 Setting Output Variables

7.3 Caching Results

7.3.1 Cache Variable Names

7.3.2 Cache Files

7.3.3 Cache Checkpointing

7.4 Printing Messages

8. Programming in M4

8.1 M4 Quotation

8.1.1 Active Characters

8.1.2 One Macro Call

8.1.3 Quotation and Nested Macros

8.1.4
changequote
is Evil


8.1.5 Quadrigraphs

8.1.6 Quotation Rule Of Thumb

8.2 Using
autom4te


8.2.1 Invoking
autom4te


8.2.2 Customizing
autom4te


8.3 Programming in M4sugar

8.3.1 Redefined M4 Macros

8.3.2 Evaluation Macros

8.3.3 Forbidden Patterns

8.4 Programming in M4sh

9. Writing Autoconf Macros

9.1 Macro Definitions

9.2 Macro Names

9.3 Reporting Messages

9.4 Dependencies Between Macros

9.4.1 Prerequisite Macros

9.4.2 Suggested Ordering

9.5 Obsoleting Macros

9.6 Coding Style

10. Portable Shell Programming

10.1 Shellology

10.2 Here-Documents

10.3 File Descriptors

10.4 File System Conventions

10.5 Shell Substitutions

10.6 Assignments

10.7 Special Shell Variables

10.8 Limitations of Shell Builtins

10.9 Limitations of Usual Tools

10.10 Limitations of Make

11. Manual Configuration

11.1 Specifying the System Type

11.2 Getting the Canonical System Type

11.3 Using the System Type

12. Site Configuration

12.1 Working With External Software

12.2 Choosing Package Options

12.3 Making Your Help Strings Look Pretty

12.4 Configuring Site Details

12.5 Transforming Program Names When Installing

12.5.1 Transformation Options

12.5.2 Transformation Examples

12.5.3 Transformation Rules

12.6 Setting Site Defaults

13. Running
configure
Scripts


13.1 Basic Installation

13.2 Compilers and Options

13.3 Compiling For Multiple Architectures

13.4 Installation Names

13.5 Optional Features

13.6 Specifying the System Type

13.7 Sharing Defaults

13.8 Defining Variables

13.9
configure
Invocation


14. Recreating a Configuration

15. Obsolete Constructs

15.1 Obsolete `config.status' Invocation

15.2 `acconfig.h'

15.3 Using
autoupdate
to Modernize `configure.ac'


15.4 Obsolete Macros

15.5 Upgrading From Version 1

15.5.1 Changed File Names

15.5.2 Changed Makefiles

15.5.3 Changed Macros

15.5.4 Changed Results

15.5.5 Changed Macro Writing

15.6 Upgrading From Version 2.13

15.6.1 Changed Quotation

15.6.2 New Macros

15.6.3 Hosts and Cross-Compilation

15.6.4
AC_LIBOBJ
vs.
LIBOBJS


15.6.5
AC_FOO_IFELSE
vs.
AC_TRY_FOO


16. Generating Test Suites with Autotest

16.1 Using an Autotest Test Suite

16.1.1
testsuite
Scripts


16.1.2 Autotest Logs

16.2 Writing `testsuite.at'

16.3 Running
testsuite
Scripts


16.4 Making
testsuite
Scripts


17. Frequent Autoconf Questions, with answers

17.1 Distributing
configure
Scripts


17.2 Why Require GNU M4?

17.3 How Can I Bootstrap?

17.4 Why Not Imake?

17.5 How Do I
#define
Installation Directories?


17.6 What is `autom4te.cache'?

18. History of Autoconf

18.1 Genesis

18.2 Exodus

18.3 Leviticus

18.4 Numbers

18.5 Deuteronomy

A. Copying This Manual

A.1 GNU Free Documentation License

A.1.1 ADDENDUM: How to use this License for your documents

B. Indices

B.1 Environment Variable Index

B.2 Output Variable Index

B.3 Preprocessor Symbol Index

B.4 Autoconf Macro Index

B.5 M4 Macro Index

B.6 Autotest Macro Index

B.7 Program and Function Index

B.8 Concept Index


webmaster donations bookstore delorie software privacy
Copyright � 2003 by
The Free Software Foundation
Updated Jun 2003
第3篇 automake
automake

[Top][Contents][Index][ ? ]

Table of Contents

1. Introduction

2. General ideas

2.1 General Operation

2.2 Strictness

2.3 The Uniform Naming Scheme

2.4 How derived variables are named

2.5 Variables reserved for the user

2.6 Programs automake might require

3. Some example packages

3.1 A simple example, start to finish

3.2 A classic program

3.3 Building true and false

4. Creating a `Makefile.in'

5. Scanning `configure.in'

5.1 Configuration requirements

5.2 Other things Automake recognizes

5.3 Auto-generating aclocal.m4

5.4 aclocal options

5.5 Macro search path

5.5.1 Modifying the macro search path:
--acdir


5.5.2 Modifying the macro search path:
-I dir


5.5.3 Modifying the macro search path: `dirlist'

5.6 Autoconf macros supplied with Automake

5.6.1 Public macros

5.6.2 Private macros

5.7 Writing your own aclocal macros

6. The top-level `Makefile.am'

6.1 Recursing subdirectories

6.2 Conditional subdirectories

6.2.1 Conditional subdirectories with
AM_CONDITIONAL


6.2.2 Conditional subdirectories with
AC_SUBST


6.2.3 How
DIST_SUBDIRS
is used


7. An Alternative Approach to Subdirectories

8. Rebuilding Makefiles

9. Building Programs and Libraries

9.1 Building a program

9.1.1 Defining program sources

9.1.2 Linking the program

9.1.3 Conditional compilation of sources

9.1.3.1 Conditional compilation using
_LDADD
substitutions


9.1.3.2 Conditional compilation using Automake conditionals

9.1.4 Conditional compilation of programs

9.2 Building a library

9.3 Building a Shared Library

9.4 Program and Library Variables

9.5 Special handling for LIBOBJS and ALLOCA

9.6 Variables used when building a program

9.7 Yacc and Lex support

9.8 C++ Support

9.9 Assembly Support

9.10 Fortran 77 Support

9.10.1 Preprocessing Fortran 77

9.10.2 Compiling Fortran 77 Files

9.10.3 Mixing Fortran 77 With C and C++

9.10.3.1 How the Linker is Chosen

9.10.4 Fortran 77 and Autoconf

9.11 Java Support

9.12 Support for Other Languages

9.13 Automatic de-ANSI-fication

9.14 Automatic dependency tracking

9.15 Support for executable extensions

10. Other Derived Objects

10.1 Executable Scripts

10.2 Header files

10.3 Architecture-independent data files

10.4 Built sources

10.4.1 Built sources example

First try

Using
BUILT_SOURCES


Recording dependencies manually

Build `bindir.h' from `configure'

Build `bindir.c', not `bindir.h'.

Which is best?

11. Other GNU Tools

11.1 Emacs Lisp

11.2 Gettext

11.3 Libtool

11.4 Java

11.5 Python

12. Building documentation

12.1 Texinfo

12.2 Man pages

13. What Gets Installed

13.1 Basics of installation

13.2 The two parts of install

13.3 Extending installation

13.4 Staged installs

13.5 Rules for the user

14. What Gets Cleaned

15. What Goes in a Distribution

15.1 Basics of distribution

15.2 Fine-grained distribution control

15.3 The dist hook

15.4 Checking the distribution

15.5 The types of distributions

16. Support for test suites

16.1 Simple Tests

16.2 DejaGNU Tests

16.3 Install Tests

17. Changing Automake's Behavior

18. Miscellaneous Rules

18.1 Interfacing to
etags


18.2 Handling new file extensions

18.3 Support for Multilibs

19. Include

20. Conditionals

21. The effect of
--gnu
and
--gnits


22. The effect of
--cygnus


23. When Automake Isn't Enough

24. Distributing `Makefile.in's

25. Automake API versioning

Macro and Variable Index

General Index


webmaster donations bookstore delorie software privacy
Copyright � 2003 by
The Free Software Foundation
Updated Jun 2003
第4篇
弄懂autoscan, autoconf, automake, Makefile.am


弄懂autoscan, autoconf, automake, Makefile.am

发表于 2011
年 08 月 22 日 由 admin

之前一直把所有的h文件和c文件都放在同一个目录下,用的是通用Makefile,现在觉得需要现代化一点,于是进行了一些改造,分多个目录,多级目录,因此,学习一下autoscan,aclocal,autoconf,automake这些工具的使用。

本文不是讲解这些工具用法的,只是列出网上较好的文章。如果这些链接失效了,请通知我。

通用Makefile:http://bbs.chinaunix.net/viewthread.php?tid=909275&extra=&page=6

autoscan,autoconf,automake讲解,首先是这两篇文章,写的比较详细:

http://www.ibm.com/developerworks/cn/linux/l-makefile/

http://bbs.chinaunix.net/viewthread.php?tid=727270

然后,一个典型的实例,可以参考:

http://basiccoder.com/automake-introduction.html

最后,关于核心的Makefile.am,多级目录下Makefile.am的写法,可以参考这两篇文章:

http://bigwhite.blogbus.com/logs/80924710.html

http://jianlee.ylinux.org/Computer/C%E5%92%8CGNU%E5%BC%80%E5%8F%91/makefile-am.html

读懂这些,应该就足够了。总结一下,基本步骤如下:

1、autoscan ./

2、修改生成的configure.scan文件,增加AM_INIT_AUTOMAKE ,AC_CONFIG_FILES([Makefile])

3、aclocal

4、核心步骤:根据情况,编写Makefile.am

5、autoheader

6、touch NEWS README AUTHORS ChangeLog

7、automake -a

8、autoconf

注:运行autoscan时,会出现以下提示:

[shell]

autom4te: configure.ac: no such file or directory

autoscan: /usr/bin/autom4te failed with exit status: 1

[/shell]

这个提示不影响下面的步骤,因为configure.scan文件已经生成了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: