Matt's DOM Utils Matt's DOM Utils (Utils)

HOWTO: Customisation

Table of Contents

  1. Introduction
  2. Configuration
    1. autoconf
    2. ./configure
  3. Makefile
    1. Complete Build
    2. Minification
  4. Building
    1. Command-line Builder
    2. Server-side Builder
  5. Footnotes

Introduction

Once the development package for Utils has been downloaded, options arise to fully customise a build. They are outlined below.

Configuration

Utils is designed to work under a variable name. This is implemented via the autoconf utility, which is part of the GNU Autotools build system[0]. This step is optional, but optimal for demanding scenarios.

autoconf

In order to generate text in a dynamic fashion, autoconf is used to plug in templates and strings as Bash variables. These variables can be found in a file[1] entitled “configure.ac”. Once the variables are modified, a command such as:

autoconf

must be called to generate a fresh configure shell script.

./configure

Once a ./configure shell script has been generated, it can be executed. Execution of the script will replace special placeholders (demarcated by @ characters). For example, the Bash variable LIBRARY_NAME will replace placeholders of: “@LIBRARY_NAME@”. This particular variable is used heavily in Utils to facilitate fully customised builds.

Makefile

If Utils has been configured, the Makefile is the next logical step for pre-defined builds. A build is provided for the “core”; builds are also provided for each independent module (prefixed with the “core”). Finally, a build with every module is provided. Each of these categories are listed below.

Complete Build

In the “complete” build, all modules are concatenated in defined order (though independent modules are order-independent ). The build is then formed into a file[2]. When in a terminal navigated to the directory in which Makefile is housed, a command of:

make complete

will create such a build.

Minification

Hard-coded builds can be minified via the Makefile through the YUI Compressor. A command of:

make compress

will run a shell script[3] that minifies the builds.


Building

Utils can be built from a multitude of sources for fully customised builds. Because each module is optional and order-independent, a multiplicity of permutations exist.

Command-line Builder

For those that prefer a terminal, a builder[4] written in Bash exists. A command such as:

./build.sh [module name] [module name] [module name]

will create a build with three modules.

Server-side Builder

For those that prefer a hands-off approach, a builder[5] written in PHP exists. Once the form is submitted, the script will concatenate modules, and then serve the result.


Footnotes

[0]
GNU Autotools
[1]
configure.ac
[2]
Complete Build
[3]
compress.sh
[4]
Command-line Builder
[5]
Server-side Builder