Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 182 lines (138 sloc) 7.747 kb
ed4a736 @doudou remove some mentions of github and rubim
doudou authored
1 Copyright (c) 2006-2011 Sylvain Joyeux <sylvain.joyeux@m4x.org> and contributors
4363d31 @doudou [dist] prepare for next release
doudou authored
2
ed4a736 @doudou remove some mentions of github and rubim
doudou authored
3 * http://rock-robotics.org
88a5969 Use Ruby-based scripts to configure the build instead
lapinot authored
4
8dee48f Prepare for next release
lapinot authored
5 This work is licensed under the GPLv2 license. See License.txt for details
88a5969 Use Ruby-based scripts to configure the build instead
lapinot authored
6
2382645 Initial revision
lapinot authored
7 == What's autobuild ?
39ac3c1 Prepare for release
lapinot authored
8 Autobuild imports, configures, builds and installs various kinds of software packages.
9 It can be used in software development to make sure that nothing is broken in the
10 build process of a set of packages, or can be used as an automated installation tool.
2382645 Initial revision
lapinot authored
11
39ac3c1 Prepare for release
lapinot authored
12 Autobuild config files are Ruby scripts which configure rake to
8dee48f Prepare for next release
lapinot authored
13 * imports the package from a SCM or (optionnaly) updates it
14 * configures it. This phase can handle code generation, configuration (for
15 instance for autotools-based packages), ...
ac7edc3 Update configuration to 0.6
lapinot authored
16 * build
17 * install
2382645 Initial revision
lapinot authored
18
8dee48f Prepare for next release
lapinot authored
19 It takes the dependencies between packages into account in its build process,
20 updates the needed environment variables (+PKG_CONFIG_PATH+, +PATH+,
21 +LD_LIBRARY_PATH+, ...)
22
23
24 == WARNING for 0.5 users
25 Old configuration files used with autobuild 0.5 aren't accepted by Autobuild
26 0.6. Since 0.6, Autobuild uses Ruby for configuration (just like rake does)
2382645 Initial revision
lapinot authored
27
ac7edc3 Update configuration to 0.6
lapinot authored
28 == Available packages
29 === Common usage
30 All package objects define the following attributes
31 *importer*:: the importer object (see "Available importers" below)
32 *srcdir*:: where the package sources are located. If it is a relative
33 path, it is relative to the value of Autobuild.srcdir. The default is to
34 use the package name.
35 *prefix*:: the directory where the package should be installed. If it is a relative
36 path, it is relative to the value of Autobuild.prefix. The default is to
37 use the package name.
38
39 Each package method (Autobuild.import, Autobuild.autotools, ...) takes either a package
40 name for first argument, or a <tt>name => dependency_array</tt> hash, and take a block which
41 can be used to configure the package. For instance
42 Autobuild.import :my_package do |pkg|
43 pkg.srcdir = 'my_package_dir'
44 end
45
46 Autobuild.import :my_package => [:depends, :depends_also] do |pkg|
47 end
48
49 === Source only
50 package = Autobuild.import(dependencies) do |pkg|
51 <package configuration>
52 end
2382645 Initial revision
lapinot authored
53
ac7edc3 Update configuration to 0.6
lapinot authored
54 Use +import+ if you need the package sources but don't need to build it. You just need
55 to set +importer+ and +srcdir+. +prefix+ is ignored.
2382645 Initial revision
lapinot authored
56
ac7edc3 Update configuration to 0.6
lapinot authored
57 === Autotools
58 package = Autobuild.autotools(name, dependencies) do |pkg|
59 <package configuration>
60 end
2382645 Initial revision
lapinot authored
61
ac7edc3 Update configuration to 0.6
lapinot authored
62 Use this to build GNU autotools-based packages. This handles autoconf-only packages as
63 well as those using automake
2382645 Initial revision
lapinot authored
64
ac7edc3 Update configuration to 0.6
lapinot authored
65 Options to give the +configure+ script are given in the +configureflags+ array
66 pkg.configureflags = ['--with-blah', 'FOO=bar' ]
2382645 Initial revision
lapinot authored
67
ac7edc3 Update configuration to 0.6
lapinot authored
68 If you want the files produced during the build to be separated from the source files, set the +builddir+ attribute.
69 For now, it has to be a relative path, relative to the source directory.
70 pkg.builddir = 'build'
2382645 Initial revision
lapinot authored
71
ac7edc3 Update configuration to 0.6
lapinot authored
72 The generation of the configure script uses four programs: +autoheader+, +autoconf+, +aclocal+,
73 +automake+. The default program path can be overriden in the Autotools.programs hash. For
74 instance, to be sure that <tt>automake-1.9</tt> is used <bb>for all packages</bb>, you set
2382645 Initial revision
lapinot authored
75
ac7edc3 Update configuration to 0.6
lapinot authored
76 Autotools.programs['automake'] = 'automake-1.9'
3f33d01 Document the patch option
lapinot authored
77
ac7edc3 Update configuration to 0.6
lapinot authored
78 Autobuild tries to detect what tools it should run, but you can override. Autodetection works
79 as follows:
80 * if a script named +autogen+ or +autogen.sh+ exists in the package source directory, it is run
81 and the other tools are not. The name of this kind of script can be set by calling Autotools#use
82 pkg.use :autogen => 'my_autogen_script'
83 * +autoheader+ is never used by default
84 * +autoconf+ is used if there is <tt>configure.ac</tt> or <tt>configure.in</tt> in the source dir
85 * +aclocal+ is used if +autoconf+ is enabled (either explicitely or by autodetection)
86 * +automake+ is used if there is a <tt>Makefile.am</tt> file in the source dir
87 * you can force to enable or disable any of these steps by calling Autotools#use. Set it to +true+
88 to force its usage, +false+ to disable it or to a string to force the usage of a particular program
89 pkg.use :autogen => false
90 pkg.use :automake => false
91 pkg.use :autoheader => true
92 pkg.use :autoconf => 'my_autoconf_program'
2382645 Initial revision
lapinot authored
93
ac7edc3 Update configuration to 0.6
lapinot authored
94 The 'autogen' option cannot be set to +true+.
2382645 Initial revision
lapinot authored
95
ac7edc3 Update configuration to 0.6
lapinot authored
96 The only program used during the build and install phases is +make+. Its path can be overriden
97 in the Autobuild.programs hash
98 Autobuild.programs['make'] = 'gnumake'
2382645 Initial revision
lapinot authored
99
4363d31 @doudou [dist] prepare for next release
doudou authored
100 === CMake
101
102 A cmake package is defined with
103
104 require 'autobuild/packages/cmake'
105 Autobuild.cmake :package_name do |pkg|
106 <package configuration> ...
107 end
108
109 The only configuration attribute available for CMake package is:
110 +builddir+
111 the directory in which to configure and build the package. It is relative to
112 the package sources. A global value can be defined through Autobuild::CMake.builddir
113
114 Additionally, the #define(name, value) method allows to define configuration variables.
115
2382645 Initial revision
lapinot authored
116 == Available importers
ac7edc3 Update configuration to 0.6
lapinot authored
117 You must set an importer object for each package. The package importer is the +importer+ attribute
118 and is set via <tt>package.importer = my_importer</tt>. An importer +foo+ is defined by the class
119 Autobuild::FooImporter and defines a Autobuild.foo method which creates a new importer object.
120 Importer classes files are in <tt>lib/autobuild/import/</tt>
bd5e1ca Moved everything into the Autobuild module, to stop polluting the global
lapinot authored
121
bcfc06d doc update
lapinot authored
122 === Tar
123 package.importer = tar(uri[, options])
124
125 Downloads a tarfile at +uri+ and saves it into a local cache directory.
126 The cache directory can be set in the +options+ hash
127 package.importer = tar(uri, :cachedir = '/tmp')
128
129 It is "#{Autobuild.prefix}/cache" by default. The known URI schemes are file://
130 for local files and http:// or ftp:// for remote files. There is currently no
131 way to set passive mode on FTP, since the standard open-uri library does not
132 allow that.
bd5e1ca Moved everything into the Autobuild module, to stop polluting the global
lapinot authored
133
bcfc06d doc update
lapinot authored
134 === CVS
ac7edc3 Update configuration to 0.6
lapinot authored
135 package.importer = cvs(cvsroot, module[, options])
bd5e1ca Moved everything into the Autobuild module, to stop polluting the global
lapinot authored
136
ac7edc3 Update configuration to 0.6
lapinot authored
137 Where +options+ is an option hash. See also Autobuild::CVSImporter and Autobuild.cvs
2382645 Initial revision
lapinot authored
138
ac7edc3 Update configuration to 0.6
lapinot authored
139 * the default CVS command is +cvs+. It can be changed by
140 Autobuild.programs['cvs'] = 'my_cvs_command'
141 * the default checkout option is <tt>-P</tt>. You can change that by giving a +cvsco+ option
142 cvs cvsroot, module, :cvsco => ['--my', '--cvs', '--options']
143 * the default update option is <tt>-dP</tt>. You can change that by giving a +cvsup+ option
144 cvs cvsroot, module, :cvsup => ['--my', '--cvs', '--options']
2382645 Initial revision
lapinot authored
145
ac7edc3 Update configuration to 0.6
lapinot authored
146 === Subversion
147 package.importer = svn(url[, options])
2382645 Initial revision
lapinot authored
148
ac7edc3 Update configuration to 0.6
lapinot authored
149 Where +options+ is an option hash. See also Autobuild::SVNImporter and Autobuild.svn
2382645 Initial revision
lapinot authored
150
ac7edc3 Update configuration to 0.6
lapinot authored
151 * the default Subversion command is +svn+. It can be changed by
152 Autobuild.programs['svn'] = 'my_svn_command'
153 * by default, no options are given to checkout. You add some by giving a +svnco+ option
154 svn url, :svnco => ['--my', '--svn', '--options']
155 * by default, no options are given to update. You can add some by giving a +svnup+ option
156 svn url, :svnup => ['--my', '--svn', '--options']
2382645 Initial revision
lapinot authored
157
39ac3c1 Prepare for release
lapinot authored
158 === Darcs
ac7edc3 Update configuration to 0.6
lapinot authored
159 package.importer = darcs(url[, options])
2382645 Initial revision
lapinot authored
160
ac7edc3 Update configuration to 0.6
lapinot authored
161 Where +options+ is a hash. See also Autobuild::DarcsImporter and Autobuild.darcs
2382645 Initial revision
lapinot authored
162
ac7edc3 Update configuration to 0.6
lapinot authored
163 * the default Darcs command is +darcs+. It can be changed by
164 Autobuild.programs['darcs'] = 'my_svn_command'
165 * by default, no options are given to get. You add some by giving a +get+ option
166 darcs url, :get => ['--my', '--darcs', '--options']
167 * by default, no options are given to pull. You can add some by giving a +pull+ option
168 darcs url, :pull => ['--my', '--darcs', '--options']
2382645 Initial revision
lapinot authored
169
4363d31 @doudou [dist] prepare for next release
doudou authored
170 === Git
171 package.importer = git(url[, branch])
172
173 Imports the given branch (or master if none is given) of the repository at the
174 given URL. The branch is imported as the 'autobuild' remote and fetched into
175 the master local branch.
176
2382645 Initial revision
lapinot authored
177 = Copyright and license
178 Author:: Sylvain Joyeux <sylvain.joyeux@m4x.org>
4363d31 @doudou [dist] prepare for next release
doudou authored
179 Copyright:: Copyright (c) 2005-2008 Sylvain Joyeux
2382645 Initial revision
lapinot authored
180 License:: GPL
181
Something went wrong with that request. Please try again.