This document describes how to configure and build the open source XFS
commands and utilites ("xfsprogs") from source, and how to install and
run them.

See the README file in the top level directory for details about how
to contribute to the XFS project.


Linux Instructions
==================

0. If you have the binary rpm, simply install it and skip to step 2 (below).
   The rpm command to do this is:
	# rpm -Uvh xfsprogs-*.rpm
	[and optionally, for the development libraries and headers]
	# rpm -Uvh xfsprogs-devel-*.rpm

   The Debian command to do this is:
	# apt-get install xfsprogs
	[and optionally, for the development libraries and headers]
	# apt-get install xfslibs-dev

1. Configure, build and install the package

   The xfsprogs package uses autoconf/configure and expects a GNU build
   environment (your platform must at least have both autoconf and gmake). 
   You will also need to have installed either the e2fsprogs-devel package
   (on an RPM based system) or the uuid-dev package (on a Debian system)
   as some of the commands make use of the UUID library provided by these.

   To build the package and install it manually, use the following steps:

	# make
	# su root
	# make install
	[and optionally, for the development libraries and headers]
	# make install-dev

   Note that there are so many "install" variants out there that we
   wrote our own script (see "install-sh" in the top level directory).

   If you wish to turn off debugging asserts in the command build and
   turn on the optimizer then set the shell environment variables:

	OPTIMIZER=-O1
	DEBUG=-DNDEBUG

   before running make or Makepkgs.


Mac OS X Instructions
=====================

0. Note:  since there is no XFS implementation on Mac OS X, you are
   severely limited in what you can do.  mkfs.xfs(8), xfs_db(8) and
   xfs_repair(8) are the only functional tools on this platform, as
   they do not interact with the XFS kernel code at all.  Still, it
   can be useful to have access to these utilities from Mac OS X in
   a dual boot configuration, for example.

   However, keep on mind that mkfs.xfs on Mac OS X has disabled
   device access, although you can create a filesystem in a file.
   Also note that existing filesystem detection is disabled.

1. Configure, build and install the package

   The xfsprogs package uses autoconf/configure and expects a GNU build
   environment (your platform must at least have both autoconf, make,
   and glibtool). 

   You will also need to have built and installed the UUID library which
   is provided by the e2fsprogs source package. (Or use Homebrew, Macports
   or any other 3rd party package manager.)

   Building libuuid:

	[download; unzip/untar e2fsprogs; cd e2fsprogs]
	$ ./configure --prefix=/usr --mandir=/usr/share/man
	$ make lib/ext2fs/ext2_types.h
	$ cd lib/uuid
	$ make
	$ su root
	# make install
	[verify that you now have a /usr/lib/libuuid.a]

   Building xfsprogs:

	[firstly set these environment variables to these values]
	TAR=/usr/bin/gnutar
	LIBTOOL=/usr/bin/glibtool
	INSTALL_GROUP=wheel
	LOCAL_CONFIGURE_OPTIONS="\
				 --enable-gettext=no\
				 --enable-blkid=no\
				 --enable-librt=no\
				 "

	$ make
	$ su root
	# make install
	[and optionally, for the development libraries and headers]
	# make install-dev
