# Building, Installing, and Packaging Mini-XML

This chapter describes how to build, install, and package Mini-XML on your system from the source archive. You will need an ANSI/ISO-C compatible compiler to build Mini-XML - GCC works, as do most vendors' C compilers. If you are building Mini-XML on Windows, we recommend using the Visual C++ environment with the supplied solution file. For other operating systems, you'll need a POSIX-compatible shell and `make` program in addition to the C compiler.

## Compiling Mini-XML

Mini-XML comes with both an autoconf-based configure script and a Visual C++ solution that can be used to compile the library and associated tools.

### Compiling with Visual C++

Open the mxml.sln solution in the vcnet folder. Choose the desired build configuration, "Debug" (the default) or "Release", and then choose Build Solution from the Build menu.

### Compiling with Command-Line Tools

Type the following command to configure the Mini-XML source code for your system:

        ./configure ENTER

The default install prefix is /usr/local, which can be overridden using the `--prefix` option:

        ./configure --prefix=/foo ENTER

Other configure options can be found using the `--help` option:

        ./configure --help ENTER

Once you have configured the software, use the `make(1)` program to do the build and run the test program to verify that things are working, as follows:

        make ENTER

## Installing Mini-XML

If you are using Visual C++, copy the mxml.lib and and mxml.h files to the Visual C++ lib and include directories, respectively.

Otherwise, use the `make` command with the `install` target to install Mini-XML in the configured directories:

        make install ENTER

## Creating Mini-XML Packages

Mini-XML includes two files that can be used to create binary packages. The first file is mxml.spec which is used by the `rpmbuild(8)` software to create Red Hat Package Manager ("RPM") packages which are commonly used on Linux. Since `rpmbuild` wants to compile the software on its own, you can provide it with the Mini-XML tar file to build the package:

        rpmbuild -ta mxml-version.tar.gz ENTER

The second file is mxml.list which is used by the `epm(1)` program to create software packages in a variety of formats. The `epm` program is available from the following URL:

        http://www.easysw.com/epm/

Use the `make` command with the `epm` target to create portable and native packages for your system:

        make epm ENTER

The packages are stored in a subdirectory named dist for your convenience. The portable packages utilize scripts and tar files to install the software on the target system. After extracting the package archive, use the mxml.install script to install the software.

The native packages will be in the local OS's native format: RPM for Red Hat Linux, DPKG for Debian Linux, PKG for Solaris, and so forth. Use the corresponding commands to install the native packages.