Q & A

  • GNU/Linux.ro
  • 2 years ago

Autoconf is a set of tools which makes your project configurable and portable for running in Linux distributions. Simply, autoconf will help you to create configure script and Makefile for your code.

Before going to generate configure script using autoconf, we need to define set of rules and dependencies. We are defining that rules and dependencies in two files, configure.in and Makefile.in.

 

Create default Makefile and keep in project directory.We can genarate the configure.in based on the rules specified in Makefile using autoscan.
Refer here for syntax of Makefile

#cd project
#cp Makefile Makefile.orig
#mv Makefile Makefile.in
#autoscan

autoscan will genarate the configure.scan file and rename it into configure.in

#mv configure.scan configure.in

Before going to autoconf, you can do some modifications if you need.

AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)

Here you can specify your project name version and support mail ID.Then save the file.
Now run autoconf to create the configure script for your project.

#autoconf

That’s it. Now you can run install your project also  with   ./configure, make all and make install 
Note: This tutorial is only basic overview.