Configure script

Configure script
Flow diagram including configure, autoconf and automake, three tools in the GNU build system

Developing a program to be run on a wide number of different computers is a complex task. A Configure script matches the libraries on the user's computer, with those required by the program, just before compiling it from its source code.

Obtaining software directly from the source code (a standard procedure on Unix computers) involves the following steps: configuring the makefile, compiling the code, and finally installing the executable in the appropriate place. A configure script accomplishes the first of these steps.

Contents

How to use them

Using configure scripts (hereafter configure) is an automated method of generating makefiles before compilation to tailor the software to the system on which the executable is to be compiled and run. Using configure is the first of three straightforward steps in creating an executable from its source code.

./configure
make
make install

One must type ./configure (dot slash configure) rather than configure for the "dot slash" indicates the script is in the current directory ".". By default, for security reasons, unix operating systems do not search the current directory for executables so one must give the full path explicitly to avoid the following error:

"bash: configure: command not found"[1]

Upon its completion, configure prints a report to config.log. Running ./configure --help gives a list of command line arguments, for enabling or disabling additional features such as:

./configure --libs="-lmpfr -lgmp"
./configure --prefix=/home/myname/apps

The first line includes the mpfr and gmp libraries. The second line tells make to install the final version in /home/myname/apps. Note that if you have a space character in your argument, you will need to enclose the text in quotation marks as shown on the first line. The INSTALL file contains instructions should the prescribed steps fail.

Generating configure

Software developers simplify the challenge of cross-platform software development by using GNU's Autotools.[2] These scripts query the system on which they run for: environment settings, platform architecture, and the existence and location of required build and runtime dependencies. They store the gathered information in configure.in or configure.ac to be read by configure during the installation phase.

Dependency checking

In new development, library dependency checking has been done in great part using pkg-config via the m4 macro, PKG_CHECK_MODULES. Before pkg-config's gained popularity, separate m4 macros were created to locate files known to be included in the distribution of libraries depended upon.

See also

References

  1. ^ "Compiling Linux Software from Source Code". Control-Escape's Linux Help Engine. http://www.control-escape.com/linux/lx-swinstall-tar.html. Retrieved 20 November 2010. 
  2. ^ "Autoconf - GNU Project - Free Software Foundation (FSF)". GNU Operator System. http://www.gnu.org/software/autoconf/. Retrieved 20 November 2010. 
  3. ^ Neelakanth Nadgir (June 2001). "Introduction to GNU Build Tools". Oracle. http://developers.sun.com/solaris/articles/gnu.html. Retrieved 20 November 2010. 
  4. ^ Taylor, Ian Lance. "The GNU configure and build system". airs.com. http://www.airs.com/ian/configure/. Retrieved 20 November 2010. 

Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Configure script (computing) — Configure scripts are an automated method of modifying source code before compilation in order to produce code tailored to the system on which a binary executable is to be compiled and run. Configure scripts are typically run immediately before… …   Wikipedia

  • Configure — Programmablaufplan von autoconf und automake, zwei Tools im GNU Build System Das GNU Build System, auch bekannt als Autotools, ist eine Sammlung von Tools für die Computerprogrammierung, die vom GNU Projekt entwickelt wurden. Diese Tools sind für …   Deutsch Wikipedia

  • script — Synonyms and related words: IPA, ITA, Initial Teaching Alphabet, International Phonetic Alphabet, alphabet, alphabetics, arrange, art, article, ascender, autograph, autography, back, bastard type, beard, belly, bevel, black letter, blank,… …   Moby Thesaurus

  • Langage De Script — Un langage de script est un langage de programmation qui permet de manipuler les fonctionnalités d un système informatique configuré pour fournir à l interpréteur de ce langage un environnement et une interface qui déterminent les possibilités de …   Wikipédia en Français

  • Langages de script — Langage de script Un langage de script est un langage de programmation qui permet de manipuler les fonctionnalités d un système informatique configuré pour fournir à l interpréteur de ce langage un environnement et une interface qui déterminent… …   Wikipédia en Français

  • Langage de script — Un langage de script est un langage de programmation qui permet de manipuler les fonctionnalités d un système informatique configuré pour fournir à l interpréteur de ce langage un environnement et une interface qui déterminent les possibilités de …   Wikipédia en Français

  • GNU build system — GNU logo The GNU build system, also known as the Autotools, is a suite of programming tools designed to assist in making source code packages portable to many Unix like systems. It can be difficult to make a software program portable: the C… …   Wikipedia

  • Autoconf — Infobox Software name = Autoconf developer = The GNU Project latest release version = 2.62 latest release date = April 8, 2008 operating system = Cross platform genre = Programming tool license = GPL website =… …   Wikipedia

  • Portage (software) — Infobox Software name = Portage logo = caption = Portage in action author = developer = released = latest release version = [http://packages.gentoo.org/package/sys apps/portage 2.1.4.5] latest release date = latest preview version =… …   Wikipedia

  • Cross compiler — A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is run. Cross compiler tools are used to generate executables for embedded system or multiple platforms. It is used to… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”