Difference between revisions of "Autotools"

From HCL
Jump to: navigation, search
(Script for downloading & installing recent versions of m4, libtool, autoconf, automake)
Line 38: Line 38:
  
 
== Script for downloading & installing recent versions of m4, libtool, autoconf, automake==
 
== Script for downloading & installing recent versions of m4, libtool, autoconf, automake==
 +
 +
#!/bin/bash
 +
parent_dir=$PWD
 +
wget http://ftp.gnu.org/gnu/libtool/libtool-2.2.6b.tar.gz
 +
tar xzf libtool-2.2.6b.tar.gz
 +
cd libtool-2.2.6b
 +
./configure --prefix=$HOME/$ARCH
 +
make install
 +
cd $parent_dir
 +
wget http://ftp.gnu.org/gnu/m4/m4-1.4.14.tar.gz
 +
tar xfz m4-1.4.14.tar.gz
 +
cd m4-1.4.14
 +
./configure --prefix=$HOME/$ARCH
 +
make install
 +
cd $parent_dir
 +
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.65.tar.bz2
 +
tar xjf autoconf-2.65.tar.bz2
 +
cd autoconf-2.65
 +
./configure --prefix=$HOME/$ARCH
 +
make install
 +
cd $parent_dir
 +
wget http://ftp.gnu.org/gnu/automake/automake-1.10.3.tar.bz2
 +
tar xjf automake-1.10.3.tar.bz2
 +
cd automake-1.10.3
 +
./configure --prefix=$HOME/$ARCH
 +
make install
 +
cd $parent_dir

Revision as of 12:25, 16 March 2010

http://en.wikipedia.org/wiki/Autoconf

http://sourceware.org/autobook/autobook/autobook_toc.html

Manuals

Libraries

  • includes (for the include directory): include_HEADERS = ...
  • library: static lib_LIBRARIES = library.a or dynamic lib_LTLIBRARIES = library.la
  • sources (internal C data structures and C++ template classes): library_X_SOURCES = library.h ..., where X = a or la
    • library.h is like a precompiled header (contains common headers and symbols), which is to be included in most of source files of the library (there is no need in real precompiled headers for small projects in C)

For example, http://hcl.ucd.ie/repos/CPM/trunk/MPIBlib/benchmarks/Makefile.am

Configured headers

Configured headers (created from *.h.in) must not be included into the package, that is include_HEADERS or *_SOURCES

  • nodist_include_HEADERS = *.h for the configured headers as includes
  • nodist_*_SOURCES = *.h or BUILT_SOURCES = *.h for the configured headers as sources

For example, http://hcl.ucd.ie/repos/CPM/trunk/MPIBlib/collectives/Makefile.am

Extra files

To add extra files into package, use EXTRA_DIST = *.

For example, http://hcl.ucd.ie/repos/CPM/trunk/MPIBlib/tools/Makefile.am

Conditional building

#ifdef SYMBOL
...
#endif

Script for downloading & installing recent versions of m4, libtool, autoconf, automake

#!/bin/bash
parent_dir=$PWD
wget http://ftp.gnu.org/gnu/libtool/libtool-2.2.6b.tar.gz
tar xzf libtool-2.2.6b.tar.gz
cd libtool-2.2.6b
./configure --prefix=$HOME/$ARCH
make install
cd $parent_dir
wget http://ftp.gnu.org/gnu/m4/m4-1.4.14.tar.gz
tar xfz m4-1.4.14.tar.gz
cd m4-1.4.14
./configure --prefix=$HOME/$ARCH
make install
cd $parent_dir
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.65.tar.bz2
tar xjf autoconf-2.65.tar.bz2
cd autoconf-2.65
./configure --prefix=$HOME/$ARCH
make install
cd $parent_dir
wget http://ftp.gnu.org/gnu/automake/automake-1.10.3.tar.bz2
tar xjf automake-1.10.3.tar.bz2
cd automake-1.10.3
./configure --prefix=$HOME/$ARCH
make install
cd $parent_dir