150 likes | 306 Views
INTRODUCTION TO AUTOCONF AND AUTOMAKE. GNU BUILD SYSTEM 1)GNU AUTOCONF 2)GNU AUTOMAKE 3)GNU LIBTOOL 4)GNU GETTEXT. WHY AUTOTOOLS?.
E N D
INTRODUCTION TO AUTOCONF AND AUTOMAKE
GNU BUILD SYSTEM 1)GNU AUTOCONF 2)GNU AUTOMAKE 3)GNU LIBTOOL 4)GNU GETTEXT
WHY AUTOTOOLS? • to produce portable packages. ... some C functions will have 1)different names 2)different prototypes 3)might not exist every where 4)might require specific libraries
Developers need autoconf and automake software. Requirments • Users dont need automake or autoconf. They must have a shell and appropriate compilers to compile the package.
Step involved in installing a software • tar -zxvpf software_01.tar.gz • cd software_01 • ./configure • make • make check • make install
steps involved in creating a software • create source • create configure.ac • create makefile.am • aclocal • autoconf • automake -a //to add missing files
Directory Structure • software name is software_01 • root of software is software_01 • software_01 will have lib, src, man, doc makefile.am, configure.ac
To go • we will make a source tar ball of hello world program • we will make a source tar ball of experience hello world program
src/hello.c #include<cstdio> main (void) { prinft(“Hello GNU Users\n”); return 0; }
Makefile.am SUBDIRS=src doc data man1 EXTRA_DIST=doc/documentation.sxw EXTRA_DIST +=doc/analysis.sxw
configure.ac AC_INIT(hello,0.01,bugs@bugs.org) AM_INIT_AUTOMAKE(dist-bzip2) #check for programs AC_PROG_CXX AC_PROG_INSTALL #check for libraries #check for header files #check for typedefs #check for structures #check for compiler characteristics #check for library functions #check for system services AC_OUTPUT(Makefile\ src/Makefile\ )
Now run `autoconf': % aclocal % autoconf % automake -a % touch NEWS README AUTHORS ChangeLog % automake -a % configure % make % src/hello % su and make install; make uninstall % make distcheck
% rm -f configure % automake % make distcheck You will notice that the `distcheck' target fails.