蕲春人的博客

About Blog Email GitHub

15 Aug 2016
Get started with autotools

Follow this tutorial to get started with autotools.

configure.ac文件

使用autoconf工具生成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

Create files:

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

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

An Introduction to the Autotools

Resources


蕲春人 at 15:20

scribble

About Blog Email GitHub