GithubHelp home page GithubHelp logo

autotools's Introduction

Introduction

Normally, autotools is the name for the combination of different tools used for the development of C/c++ based projects.

Autotools = common name for autoconf+automake+ libtool+ ...

Autotool is a very handy tool creating/managing and distributing the source code in various unix-line OS.

This project provides a template which can be used to the jump start your project. This is basically taken from the https://github.com/byuksel/Automake-Autoconf-Template-Project and modified little bit.

Developers normally write configure.ac on root directory and Makefile.am in each of the subdirectories where the generation of Makefile is expected.

Autotools provides common build facilities:

  • select tools (e.g .CC= ..)
  • select destinations(e.g. prefix=.._
  • DESTDIR(vital for packaging)
  • VPATH builds
  • cross compilation etc.

Steps:

  • Clone the repository and run:
  • autoreconf -i

If it does not work you have to run the following commands:

  • aclocal
  • autoconf
  • automake --add-missing

This generates the configure file and Makefile.in. If libtools has not been installed then:

  • sudo apt-get install libtools

Then run the configure script:

  • ./configure

(Written in a special language processed by m4 macro, probes the system and generates Makefile)

  • make

(compiles the project and generates executables and libraries)

  • make install

(installs the library and header files in predefined path

Out-of-source build

$ mkdir build

$cd build

$autoreconf -i -v ..

$../configure

$make

Trying out some auto-generated capabilities

DESTDIR="$t" make install

DESTDIR="$t" make uninstall

make dist # Create distribution tarball

make distcheck # CHECK BEFORE RELEASE

Installation and removal

t="$(mktemp -d)"

DESTDIR="$t" make install

DESTDIR="$t" make uninstall

Checking

find "$t"

Making tarball

make dist

This will create my_program-0.01.tar.gz

Checking

tar tvzf *.tar.gz

make distcheck

this makes sure that other recipiennts will able to use it /unzip it

You can seee the following message:

=================================================
my_program-0.01 archives ready for distribution: 
my_program-0.01.tar.gz
=================================================

Useful commands

$ list="LICENSE INSTALL README.md AUTHORS COPYING"

$ touch $list

$ autoscan

(generates the templates for the configure.ac under configure.scan name)

$make distclean

(Cleans most of the generated files)

autotools's People

Contributors

mrpoudel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.