蕲春人的博客

About Blog Email GitHub

15 Aug 2016
Get started with autotools

Follow this tutorial to get started with autotools.

configure.ac文件

使用 autoscan 工具生成configure.scan文件,将它重命名为configure.ac,默认的文件内容如下:

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])

# Checks for programs.

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_OUTPUT

然后创建如下的项目目录结构:

src/main.c
README
configure.ac
Makefile.am
src/Makefile.am

Command autoreconf --install parse configure.ac into configure file. Command automake generate Makefile.in files. Command ./configure generate Makefie and src/Makefile from Makefile.in files.

我这里有一个基础的使用autotools工具的项目,展示了其中最基本的用法。

An Introduction to the Autotools

Resources


蕲春人 at 15:20

scribble

About Blog Email GitHub