Sunday, March 6, 2011

Building a GNU Autotools Project(automatically create )

1. autoscan

automatically generate a configure.scan file

2. rename the configure.scan file to configure.ac file
and edit it as below

AC_PREREQ([2.65])
AC_INIT([hello],[1.0])
AM_INIT_AUTOMAKE([1.10 no-define])

AC_CONFIG_SRCDIR([functions.h])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES([makefile])
AC_OUTPUT

*******************************************************************************************
Please note that configure.in is no longer valid so that the postfix is ac
*******************************************************************************************

3. execute aclocal to create aclocal.4m file
*******************************************************************************************
Make sure to apt-get build-essentials to install 4m file. It
was not successful to generate aclocal.4m file probably due to the
fact that I was creating configure.in rather than configure.ac file
ADDITION: apt-get install libtool
******************************************************************************************

4. autoconf to create configure file

********************************************************************************
Maybe require autoreconf
********************************************************************************

5. create makefile.am file

AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=hello
hello_SOURCES=hello.cpp functions.h factorial.cpp main.cpp

6. automake to create make.in from make.in

***********************************************************
automake --add-missing
**********************************************************

7. configure to generate makefile


http://www.openismus.com/documents/linux/automake/automake.shtml

http://inti.sourceforge.net/tutorial/libinti/autotoolsproject.html

No comments:

Post a Comment