Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

configure script

From Wikipedia, the free encyclopedia
Shell script for generating build configuration files on a Unix-like environment

When installing a package on aUnix orUnix-like environment, aconfigure script is ashell script that generatesbuild configuration files for acodebase to facilitate cross-platform support. It generates files tailoring for the host system – the environment on which the codebase is built and run.

Even though there are no standards for such a script, the pattern is so ubiquitous that many developers are familiar with and even expect a script namedconfigure that has this functionality. The script can be and originally was hand-coded. Today, multiple tools are available for generating a configure script based on special configuration files. One commonly used tool isAutotools which generates aBash script.

Obtaining a software package assource code andcompiling it locally is a common scenario onUnix andUnix-like environments. Typically, this process involves the following steps:

  1. Generate build configuration files
  2. Build the code
  3. Install the result to an accessible location

A configure script accomplishes the first step by generating amakefile that is configured for the host system. This includes using thelibraries of the host as required by the codebase.

Use

[edit]

After navigating a command-lineshell to the directory that contains the source code, the following commands are typically executed:[1]

./configuremakemakeinstall

For the Autotools, the configure script logs status and errors to fileconfig.log, and the command./configure --help outputs command line help information.

Often, a document with instructions is included with the codebase (usually in a file namedINSTALL). It can be helpful if the configure script fails.

Generating

[edit]

Autotools simplifies some of the challenges ofcross-platform software development.[2] These tools query the host system for environment settings, platform architecture, and the existence and location of required build and runtime dependencies. They store the gathered information inconfigure.ac to be read byconfigure during the installation phase.

In new development, library dependency checking can be accomplished viapkg-config via them4 macro, PKG_CHECK_MODULES. Before pkg-config gained popularity, separate m4 macros were created to locate files known to be included in the distribution of libraries depended upon.

History

[edit]

The first program to come with a configure script wasrn byLarry Wall in 1984. The script was written by hand and produced a jocular running commentary when executed. It still survives as part of the build system of thetrn program.[3]

Since then, an ecosystem of tools have been developed to automate the creation of configure scripts, of which the most common isAutoconf.

References

[edit]
  1. ^"Compiling Linux Software from Source Code". Control-Escape's Linux Help Engine. Retrieved20 November 2010.
  2. ^"Autoconf - GNU Project - Free Software Foundation (FSF)". GNU Operating System. Retrieved20 November 2010.
  3. ^"Configure script of trn". GitHub. Retrieved10 December 2020.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Configure_script&oldid=1328454455"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp