ldd prints the full transitive dependency closure, so the check fails when a
dependency of a dependency links C++ (for example cairo -> fontconfig ->
libxml2 -> ICU), even though HarfBuzz itself has no libstdc++/libc++ NEEDED
entry. When readelf (or llvm-readelf) is available, inspect the library's own
(NEEDED) entries and check every exported library, including harfbuzz-cairo
and harfbuzz-icu. Without either tool, keep the ldd/otool closure check but
skip those two, whose closure is known to contain libstdc++.
Instead of passing source dir and build dir to as envvars, pass
them directly as script arguments. The scripts also were supposed to be
able to run outsize of the build scripts, but this was broken since the
fallback when the envvars were not set was wrong.
The HBSOURCES and HBHEADERS are still passed as envvars since they are
long lists and might hit command line length limitation on some systems.