Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a configure script?

This may sound like a very generic question but here it goes.

I have a requirement to create a configure script for my application, the result of this configure would be a generated makefile (basic configure, make, make install). My question is, where do I start in building this? Is there an example I can follow?

like image 555
godzilla Avatar asked Jun 12 '12 15:06

godzilla


People also ask

How do I create a configuration script?

To produce a configure script for a software package, create a file called `configure.ac' that contains invocations of the Autoconf macros that test the system features your package needs or can use. Autoconf macros already exist to check for many features; see Existing Tests, for their descriptions.

Where is configure script?

The configure Bourne shell script is found at the top level of the VMD working directory. This script has three purposes: To adapt the Makefile to use the proper libraries and compiler options for the type of operating system being used.

What does the configure script do?

A configure script is an executable script designed to aid in developing a program to be run on a wide number of different computers. It matches the libraries on the user's computer, with those required by the program before compiling it from its source code.

How do I make my own Makefile?

Creating a Makefile.in. To create all the Makefile.in s for a package, run the automake program in the top level directory, with no arguments. automake will automatically find each appropriate Makefile.am (by scanning configure.in ; see configure) and generate the corresponding Makefile.in .


2 Answers

To create the standard "configure" script you need GNU autoconf. You may need GNU automake and libtool too.

There are tons of documentation and howtos. Google for something like "autoconf automake howto". The good documentation is in the official manual pages:

  • Autoconf: http://www.gnu.org/software/autoconf/
  • Automake: http://www.gnu.org/software/automake/automake.html
  • Libtool: http://www.gnu.org/software/libtool/libtool.html

Autoconf will create your configure script starting from the "configure.ac" file. The "Makefile.am" file will instruct automake on how to create your makefile by the configure string. Libtool is needed to simplify libraries handling around your code.

You can start creating a configure.ac file by hand or you may use the "autoscan" helper that may help you to create something semi-automatic for you.

Then, when you are ready, this one will do the magic:

autoreconf -i 
like image 190
dAm2K Avatar answered Sep 21 '22 22:09

dAm2K


there is build flow in linux
enter image description here and there is a very good tutorial
https://thoughtbot.com/blog/the-magic-behind-configure-make-make-install

like image 45
hamSh Avatar answered Sep 24 '22 22:09

hamSh