Include unix_dir.c when compiling under cygwin.
Fix missing type declaration.
Fix poor promiser form for commands promise
Spaces in commands type promisers cause warnings about binary not
existing. Any spaces in the promiser should be in the args attribute.
Closes Redmine 1277
Implement $(sys.cpus) on HP-UX platform

Uses the HP-UX mpctl() function to query the number of processors
available system-wide (as opposed to within a processor set) in order
to populate the $(sys.cpus) variable.

In HP-UX running on Intel Itanium Hyper-Thread Technology processors,
where each CPU core has two virtual cores, the total number of virtual
- rather than physical - cores is provided, which corresponds to the
behavior of the Linux scan of the /proc/stat file with HTT is enabled
on x86 platforms.

On a PA-RISC system, the total number of physical cores is set. The
PA-8900 processor has two physical cores per CPU socket, so an rp8420
with 16 PA-8900 processors will set $(sys.cpus) to 32, as expected.

It may be worthwhile to implement a $(sys.cpusockets) variable too,
in light of things like Oracle and Red Hat licensing.

The mpctl() function is documented at this page:
http://h20000.www2.hp.com/bc/docs/support/SupportManual/c02264569/c02264569.pdf
Replace date +%s in testall with more widely compatible code (Mantis #1254)

In order to calculate the total run time of acceptance tests, the
testall script needs the UNIX seconds - a time() call - of the start
and end times of the test runs. It currently uses the command
"date +%s" to get these times.

Many older OS platforms - such as HP-UX 11.11, Solaris 8 and 9, and
others - do not support the "%s" format for the date command.

This patch creates a unix_seconds() subroutine which uses the modern
"date +%s" command if available, falls back to a Perl "print time()"
call, and failing that it falls back to pulling the octal date out of
a pax-created cpio header for an empty temporary file and converting
it to decimal using "bc."

This code will work on every POSIX-compliant platform (since the
pax/cpio/bc approach is strictly POSIX) as well as any platorm that
has a copy of Perl in the path.
Fixed syntax error in use of regcmp function.
Fix unit tests under OS X
Link libxml2, libpq and libmysqlclient to cf-agent, not to cf-promises

The following link sequence causes problems if system-provided libxml2 is not
binary compatible with the one CFEngine links against:

apache2 -> php -> xml.so -> libxml2.so.1
              \-> cfmod.so -> libpromises.so.1 -> libxml2.so.1

So in order to avoid conflicts between OS-provided and CFEngine-built libraries,
libxml2, libpq and libmysqlclient has been made dependencies of cf-agent, not
libpromises.so.

This change involved moving file promise functionality to the cf-agent, where it
logically belongs anyway.
Remove unused variable
Avoid empty format string in printf
Change recurson rules to right to avoid memory problems when parsing
Merge pull request #200 from markburgess/master

Adapt parser to right recursion to avoid memory exhaustion in bison parser
Fix incorrect comparison for package manager verify status
Improve user feedback during package installation
Add detection of Joyent SmartOS - a variant of solaris 10
Merge pull request #201 from markburgess/master

Add support for smartos
Prevent adding NaN and infinite real values to JSON by setting to 0

We treat this silently by setting the value to 0.0 when a caller
attempts to add a NaN or infinite value, maintaining the invariant
that no such values should ever exist in a JSON structure.

The JSON standard does not support NaN or inifinity so this is a
pragmatic compromise.
check for BN_new() failure
Allow arbitrary shell command in cfruncommand (Mantis #1268)

cfruncommand may contain arbirtrary shell command, but was validated as an
absolute path. Relax the constraint to match the semantics.
Sanely reimplement splayclasses() (Mantis #1307)

Previously due to miscalculation in CFEngine, daily splayclass was actually
triggered every hour on ~4.17% of all computers.

Existing logic was very opaque, reimplement it sanely.