build: Source 'localenv' in top-level Makefile.

Also document 'local*' files.
This commit is contained in:
Richard W.M. Jones
2012-10-30 13:19:53 +00:00
parent f5194e6b0a
commit de129a1363
2 changed files with 37 additions and 0 deletions

View File

@@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-include $(top_builddir)/localenv
include $(top_srcdir)/subdir-rules.mk
ACLOCAL_AMFLAGS = -I m4

View File

@@ -3267,6 +3267,41 @@ functions in files under C<daemon>.
To build from source, first read the C<README> file.
=head2 C<local*> FILES
Files in the top source directory that begin with the prefix C<local*>
are ignored by git. These files can contain local configuration or
scripts that you need to build libguestfs.
By convention, I have a file called C<localconfigure> which is a
simple wrapper around C<autogen.sh> containing local configure
customizations that I need:
. localenv
./autogen.sh \
--with-default-attach-method=libvirt \
--enable-gcc-warnings \
--enable-gtk-doc \
-C \
"$@"
So I can use this to build libguestfs:
./localconfigure && make
If there is a file in the top build directory called C<localenv>, then
it will be sourced by C<make>. This file can contain any local
environment variables needed, eg. for skipping tests:
# Use an alternate python binary.
export PYTHON=python3
# Skip this test, it is broken.
export SKIP_TEST_BTRFS_FSCK=1
Note that C<localenv> is included by the top Makefile (so it's a
Makefile fragment). But if it is also sourced by your
C<localconfigure> script then it is used as a shell script.
=head2 ADDING A NEW API ACTION
Because large amounts of boilerplate code in libguestfs are generated,