The LSB header files define major() as a macro but if it is ever called
the macro references symbols not available at link time. Improve the
test for major() to actually call the macro and try to link. This
approach is based on upstream libarchive SVN commit 2866 which fixed
libarchive issue 125, submitted in response to CMake issue #11648.
Inspired-by: Tim Kientzle <kientzle@freebsd.org>
We use CHECK_TYPE_SIZE in libarchive to check for the existence of some
types. For universal binary builds on the Mac, the size check can fail
if it is inconsistent across architectures. However, we do not actually
need the size so it is safe to do the checks for only one architecture.
See issue #9913.
In libarchive we configure an internal header file called 'config.h'.
This commits moves the include directory containing the file to the
beginning of the include path to avoid conflicts from system headers.
The commit "Fix libarchive linker errors on SunOS for mkdev/major/minor"
hard-coded #include lines for getting mkdev/major/minor on the Sun.
Instead we add missing try-compile tests to make sure the proper headers
get included through the standard mechanism.
Most of the integer type defaults needed for MSVC and Borland actually
work with all Windows compilers. This commit generalizes the defaults
to avoid compiler-specific tests.
This allows for a built in bzip and zip capability, so external tools
will not be needed for these packagers. The cmake -E tar xf should be
able to handle all compression types now as well.