Use correct gzcat tool where it is available.

Pure zcat tends to fail on the "difficult" Unices.

(cherry picked from commit a433e736cfc02f6dbdf821befcdff1835de4bc64)
Use gtar tool where it is available.

Regular tar tends to fail on Solaris.

(cherry picked from commit 6645accda7dffe7d9ed89a8343382a955ccc068b)
Don't let the POSIX shell test output anything.

It interferes with scripts that we need to run without producing any
output.

(cherry picked from commit f81f0c81a1483ba3dc73cdbdcd19811aedfac6e9)
Include functions script in order to get a compliant shell on Solaris.

(cherry picked from commit ff298e3b299cc9cf65a9aa6ec8cbfac69c76f6b0)
Delete bogus file created by tar before comparison.

(cherry picked from commit 50f80d543501343c99861cdd7a41887bee1ef838)
Use rsync instead of cp, since GNU and AIX cp are incompatible.

(cherry picked from commit 8879039a5d3e0f7c552f040b212fff514200a8ee)
Remove redundant specification of package file.

(cherry picked from commit 2ea9f3ba7aefddea8a85047fc82024bfef6b8fd1)
Remove useless AIX specific section.

They apparently tried to solve some problem on AIX, but all they did
was make it harder to build.

Also introduce one AIX specific flag that we *do* need, since the ELF
way of building libraries (.so files) is not the default there.

(cherry picked from commit 57930944d42a3442d6d6fb7bcad66ccbbb1c574c)
Make libgcc build script less sensitive to gcc version.

Also remove libstdc++ from the package, which no dependee actually
uses.

(cherry picked from commit 134f0b54b9ad6ce97621dc83edf7b294495093a2)