autoconf & automake

1、Function of these two tools:

Generate shell script file "configure" for our source code, which can help to configure our source code in different unix-like system and generate file "Makefile".Then we can use instructions such as "./configure"、"make"、"make install" to install program in linux.

2、Steps:

1)、edit "helloworld.c"(our source code).

2)、edit "configure.in"(use autoscan to generate a template for configure.in)

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

AC_INIT(helloworld.c)
AM_INIT_AUTOMAKE(helloworld,1.0)

# Checks for programs.
AC_PROG_CC

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_OUTPUT(Makefile)

3)、aclocal(generate "aclocal.m4")    autoconf(generate "configure")

4)、edit "Makefile.am"

Makefile.am
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=helloworld
helloworld_SOURCES=helloworld.c

5)、automake --add-missing ; ./configure  ; make

3、Introduction in details:

      http://www.laruence.com/2009/11/18/1154.html

 

posted on 2013-04-18 17:14  siszqsqx  阅读(165)  评论(0编辑  收藏  举报

导航