Support setting CFLAGS and CXXFLAGS for libraries/programs
Add a function for looking up programs in $PATH
More GNU Make 3.81 compatibility
Make it work on GNU Make > 3.81 again
Add variable GLOBAL_COMMON_DEPS

This is a list of dependencies on which all C/C++ object files depend.
Primarily useful for global precompiled headers.
Add a variable GLOBAL_CXXFLAGS_PCH for use by precompiled headers

You don't want to use GLOBAL_CXXFLAGS for passing flags like
"-include-pch" (clang), because that means you cannot use
GLOBAL_CXXFLAGS when generating the PCH.
Add support for making relocatable packages using $ORIGIN
Don't set an absolute soname
restoreSIGPIPE(): Fill in sa_mask

Issue #231.
Fix potential segfault in waitForInput()

Since the addition of build-max-log-size, a call to
handleChildOutput() can result in cancellation of a goal.  This
invalidated the "j" iterator in the waitForInput() loop, even though
it was still used afterwards.  Likewise for the maxSilentTime
handling.

Probably fixes #231.  At least it gets rid of the valgrind warnings.
Drop pointless #include
boost::shared_ptr -> std::shared_ptr
Fix nix-shell for derivation with multiple outputs

If derivation declares multiple outputs and first (default) output
if not "out", then "nix-instantiate" calls return path with output
names appended after "!". Than suffix must be stripped before
ant path checks are done.
nix-env: Add support for --delete-generations 15d

It will delete all generations older than the specified number of days.
nix-collect-garbage: Add --delete-older-than option
Fix potential segfault

The newEnv variable was accessed (via the dynamicEnv) pointer after it
had gone out of scope.

Fixes #234.
Make sure /dev/pts/ptmx is world-writable

While running Python 3’s test suite, we noticed that on some systems
/dev/pts/ptmx is created with permissions 0 (that’s the case with my
Nixpkgs-originating 3.0.43 kernel, but someone with a Debian-originating
3.10-3 reported not having this problem.)

There’s still the problem that people without
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y are screwed (as noted in build.cc),
but I don’t see how we could work around it.
Tweak error message
Support Illumos

From https://github.com/NixOS/nix/pull/236
Sync with make-rules repo