-
Notifications
You must be signed in to change notification settings - Fork 19
/
index.html
277 lines (204 loc) · 9.57 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>autosetup - Running autosetup</title>
<link rel="stylesheet" type="text/css" href="../css/style.css" media="screen">
<link rel="stylesheet" type="text/css" href="../css/sh_style.css" media="screen">
<script src="../javascript/sh_main.min.js" type="text/javascript"></script>
<script src="../javascript/sh_lang.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-23178588-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<meta name="generator" content="nanoc 3.1.6">
</head>
<body>
<div id="header">
<h1 id="blog-title">autosetup</h1>
<p id="description">A build environment "autoconfigurator"</p>
</div>
<div id="content">
<div class="breadcrumbs">
<a href="../">Overview</a>
»
<a href="./">Running autosetup</a>
</div>
<div class="main" id="main">
<h1 id="building-an-autosetup-enabled-project">Building an autosetup-enabled Project</h1>
<h2 id="introduction">Introduction</h2>
<p>The purpose of <strong>autosetup</strong> is to adapt a project build to
the local development environment, including compilers, libraries,
and selected user options.</p>
<p>Building an <strong>autosetup</strong>-enabled project is almost identical to building
an <strong>autoconf</strong>-enabled project except it is faster and simpler.</p>
<p>Your project will include an <strong>autosetup</strong> wrapper, <code>configure</code>, and
an <strong>autosetup</strong> control file, <code>auto.def</code> at the top level. <strong>autosetup</strong> is invoked
via the <code>configure</code> script.</p>
<pre class="sh_unix">
$ ./configure
</pre>
<p>A more complex example might be:</p>
<pre class="sh_unix">
$ ./configure --host=arm-linux --utf8 --with-ext="regexp tree" --prefix=/usr CFLAGS="-g -Os"
</pre>
<h2 id="configuring">Configuring</h2>
<p><strong>autosetup</strong>-enabled projects support various command-line options to
control the configuration process. These options include both
standard <strong>autosetup</strong> options and project-specific options.</p>
<p>Use <code>configure --help</code> for a full list of the supported options.</p>
<pre><code>Usage: configure [options] [settings]
This is autosetup, a faster, better alternative to autoconf.
Use the --manual option for the full autosetup manual.
--help?=local? display help and options. Optionally specify a module name, such
as --help=system
--version display the version of autosetup
--manual?=text? display the autosetup manual. Other formats: 'wiki', 'asciidoc',
'markdown'
--debug display debugging output as autosetup runs
--install install autosetup to the current directory (in the 'autosetup/'
subdirectory)
--init create an initial 'configure' script if none exists
--host=host-alias a complete or partial cpu-vendor-opsys for the system where the
application will run (defaults to the same value as --build)
--build=build-alias a complete or partial cpu-vendor-opsys for the system where the
application will be built (defaults to the result of running
config.guess)
--prefix=dir the target directory for the build (defaults to /usr/local)
Local Options:
--shared Create a shared library
--disable-utf8 Disable utf8 support
--disable-largefile Disable large file support
</code></pre>
<p>In many cases, <code>configure</code> can be run without any arguments to select the default
options. Once the configuration process is complete, <code>make</code> is typically used to build
the project. Thus the typical configuration and build process is:</p>
<pre class="sh_unix">
$ ./configure
...output...
$ make
...output...
</pre>
<p>Note that <code>configure</code> need only be run once unless the compiler or environment changes,
or different options need to selected.</p>
<h2 id="options">Options</h2>
<p>There two types of options, <strong>boolean</strong> options and <strong>string</strong> options. <strong>boolean</strong> options simply
enable or disable a feature, while <strong>string</strong> options take an additional parameter.</p>
<h3 id="boolean-options">Boolean Options</h3>
<p>Boolean options are either enabled or disabled by default. The following output from
<code>configure --help</code> shows two boolean options.</p>
<pre><code>--shared Create a shared library
--disable-utf8 Disable utf8 support
</code></pre>
<p>Here, <code>shared</code> is an option which is disabled by default, while <code>utf8</code> is an option
which is enabled by default.</p>
<p>For convenience, boolean options may be enabled or disabled in various ways.
To <strong>enable</strong> an option:</p>
<pre><code>--boolopt
--enable-boolopt
--boolopt=1
--boolopt=yes
</code></pre>
<p>To <strong>disable</strong> an option:</p>
<pre><code>--disable-boolopt
--boolopt=0
--boolopt=no
</code></pre>
<h3 id="string-options">String Options</h3>
<p>String options take a parameter, however a default value <em>may</em> be provided for the the parameter.
The following output from <code>configure --help</code> shows two string options.</p>
<pre><code>--manual?=text? display the autosetup manual. Other formats: 'wiki', 'asciidoc',
'markdown'
--host=host-alias a complete or partial cpu-vendor-opsys for the system where the
application will run (defaults to the same value as --build)
</code></pre>
<p>Here, <code>manual</code> is a string option with a default parameter value
(<strong>text</strong>), while <code>host</code> is a string option which requires a
parameter.</p>
<h2 id="environment-variables">Environment Variables</h2>
<p>The <code>configure</code> command line may specify additional environment
variable settings after any options.</p>
<p>From example, consider the following:</p>
<pre class="sh_unix">
$ ./configure --utf8 CFLAGS="-Os"
</pre>
<p>In this case, the setting for CFLAGS overrides the default (-g -O2).</p>
<p>Environment variables are checked in the following priority order:</p>
<ol>
<li>Values specified on the command line</li>
<li>Values from the environment</li>
<li>System defaults, possibly derived from other settings</li>
</ol>
<p>In addition to project-specific environment variables (which should be documented
with the project), some modules have environment variables which can be changed.
For example, from the <strong>cc</strong> module reference:</p>
<pre><code>The following environment variables are used if set:
CC - C compiler
CXX - C++ compiler
CCACHE - Set to "none" to disable automatic use of ccache
CFLAGS - Additional C compiler flags
CXXFLAGS - Additional C++ compiler flags
LDFLAGS - Additional compiler flags during linking
LIBS - Additional libraries to use (for all tests)
CROSS - Tool prefix for cross compilation
The following variables are defined from the corresponding
environment variables if set.
CPPFLAGS
LINKFLAGS
CC_FOR_BUILD
LD
</code></pre>
<h2 id="related-topics">Related Topics</h2>
<ul>
<li><a href="outoftree/">Build Out-of-Tree</a></li>
<li><a href="crosscompiling/">Cross Compiling</a></li>
<li><a href="installing/">Installing</a></li>
</ul>
</div>
</div>
<div id="sidebar">
<h2>About autosetup</h2>
<ul>
<li><a href="../">Overview</a></li>
<li><a href="../news/">News</a></li>
<li><a href="../download/">Download</a></li>
<li><span class="active" title="You're here.">Running autosetup</span></li>
<li><a href="../developer/">Developing</a></li>
<li><a href="../developer/examples/">Examples</a></li>
<li><a href="../license/">License</a></li>
<li><a href="../why/">Motivation</a></li>
</ul>
<h2>Community</h2>
<ul>
<li><a href="https://github.com/msteveb/autosetup">autosetup on github</a></li>
<li><a href="https://github.com/msteveb/autosetup/commits/master">» commit history</a></li>
<li><a href="https://github.com/msteveb/autosetup/issues">» open issues</a></li>
</ul>
</div>
<div href="#" id="related" onmouseover="show_related(1)" onmouseout="show_related(0)">
<h2>
<img id="star" width="16" height="18" src="../img/star16.png"> Related Topics</h2>
<div id="related_menu" style="display: none">
<ul>
<li><a href="outoftree/">Build Out-of-Tree</a></li>
<li><a href="crosscompiling/">Cross Compiling</a></li>
<li><a href="installing/">Installing</a></li>
</ul>
</div>
</div>
<script language="javascript">
function show_related(on)
{
document.getElementById('related_menu').style.display = on ? 'block' : 'none';
}
</script>
<script language="javascript">sh_highlightDocument();</script>
</body>
</html>