Brad King [Tue, 30 Jul 2013 15:37:11 +0000 (11:37 -0400)]
Simplify passing of linker flags to try_compile calls
In commit d7bd02b6 (Modify CHECK_C_SOURCE_* checks to fix builds using
Visual Studio 12, 2013-02-01), commit e3d14342 (Set use of /SAFESEH linker
flag for all LIBARCHIVE_CHECK_C_SOURCE_* checks, 2013-02-01), and commit 58dc42aa (Fix checks for crypto algorithms in Visual Studio builds,
2013-02-01) we introduced and used custom copies of the CMake
CheckCSource(Compiles|Runs) modules in order to pass linker flags to
try_compile calls. CMake has an issue tracker entry about passing
CMAKE_*_LINKER_FLAGS to try_compile calls:
http://www.cmake.org/Bug/view.php?id=14066
Discussion there suggests a much simpler workaround: pass the flags
through the LDFLAGS environment variable. Remove our custom check
macros and use the simpler workaround instead.
Pavel Raiskup [Thu, 27 Jun 2013 14:01:30 +0000 (16:01 +0200)]
Use ustar format in the test_option_b test
.. because the ustar archive does not store SELinux context. As the default
format for bsdtar is "restricted pax" (trying to store xattrs and other
things by default), the test failed on Fedora because our files have by
default SELinux context set. This results in additional data in tested
archive ~> and the test failed because the archive was unexpectedly big:
tar/test/test_option_b.c:41: File archive1.tar has size 3072, expected 2048
Reviewed by Konrad Kleine <konrad.wilhelm.kleine@gmail.com>
Tim Kientzle [Thu, 11 Apr 2013 04:52:15 +0000 (21:52 -0700)]
Issue 314: A tar archive containing only a single 'g' record
should be treated as a valid empty tar archive.
(Such archives are generated by 'git archive' from an empty
repository.)
Tim Kientzle [Sat, 23 Mar 2013 06:48:41 +0000 (23:48 -0700)]
Limit write requests to at most INT_MAX.
This prevents a certain common programming error (passing -1 to write)
from leading to other problems deeper in the library.
Xi Wang [Sun, 20 Jan 2013 23:17:20 +0000 (18:17 -0500)]
Fix overflow checking in archive_entry_sparse_add_entry()
gcc will optimize the overflow check x + y < 0 (assuming x, y >= 0)
into false, since signed integer overflow is undefined behavior in C.
Use a safe precondition check instead.
Andres Mejia [Sun, 24 Feb 2013 18:06:28 +0000 (13:06 -0500)]
Fix test_archive_write_add_filter_by_name_lrzip test case.
There's some bug in lrzip where small files cannot use 2nd stage
compression.
See http://ck-hack.blogspot.com/2012/03/lrzip-0612.html?showComment=1337356929450#c3154145708572533571
Andres Mejia [Sun, 24 Feb 2013 16:54:26 +0000 (11:54 -0500)]
Fix test cases for LZO write support.
Some architectures would produce a bigger archive for compression
level 9 than with the default level, possibly due to memory
limitations.
Fixes #303
Andres Mejia [Fri, 8 Feb 2013 20:00:05 +0000 (15:00 -0500)]
Change crypto checks, find necessary library before corresponding checks are done.
LIBS are set back to original value if all crypto checks for that implementation
fail.
Andres Mejia [Tue, 5 Feb 2013 22:51:15 +0000 (17:51 -0500)]
Provide better check for when libpcreposix is to be used for regex support.
On Windows, if the static libraries for PCRE are to be used and the PCRE static libs were built
using the mingw toolchain, libgcc must also be linked for resolving the symbol ___chkstk_ms.
Dave Reisner [Fri, 6 Jul 2012 03:31:49 +0000 (23:31 -0400)]
build-sys: install all library manpages
A number of manpages were curiously omitted from the installation
process, but are referred to in installed manpages. To avoid developers
spontaneously combusting, ship all available manpages.
Andres Mejia [Mon, 4 Feb 2013 03:05:34 +0000 (22:05 -0500)]
Fix crypto check failures on Windows.
Checks will now be similar to checks done with autotools, where all defines are passed into a source file
along with the append source code to be checked. Also, once a library that support a crypto function is
found, all other checks for that crypto function will be skipped.
Andres Mejia [Fri, 1 Feb 2013 21:52:19 +0000 (16:52 -0500)]
Modify CHECK_C_SOURCE_* checks to fix builds using Visual Studio 12.
This is needed to fix build failures using Visual Studio 12 and using libraries such as liblzma which
have been built without the "/SAFESEH" linker flag (which is the usual case for libraries built using
the mingw toolchain).
Andres Mejia [Fri, 1 Feb 2013 00:20:34 +0000 (19:20 -0500)]
Add CMake option to explicitly enable/disable /SAFESEH linker flag for Visual Studio builds.
Visual Studio 12 enables this option by default. Enabling /SAFESEH will produce build failures when
attempting to link other libraries which were not built with /SAFESEH. This would typically be
the case for libraries built using the mingw toolchain, where the option to use structured exception
handling is not yet available.
The option is used as follows.
Setting to "YES" sets "/SAFESEH" linker flag
Setting to "NO" sets "/SAFESEH:NO" linker flag
Setting to any other value such as "AUTO" won't do anything (set the default linker flag from Visual Studio)
Andres Mejia [Thu, 31 Jan 2013 23:39:39 +0000 (18:39 -0500)]
Support POSIX regular expression support using PCRE in CMake builds.
This change is mainly meant for Windows regex support, where PCRE Windows development is much
more active than development of the regex library found in the GNUWin32 packages. I found that
the latest release of PCRE built right out of the box, unlike the GNUWin32 regex library released
6 years ago which failed to build from source for me using the mingw toolchain.
Andres Mejia [Sat, 26 Jan 2013 03:43:17 +0000 (22:43 -0500)]
Fix build failure when doing normal builds.
These are builds done running a standard './configure && make'. This
will also fix a corner case where the whence is set to anything other than
SEEK_SET, SEEK_CUR, or SEEK_END. The behavior is to use SEEK_SET by default.
Andres Mejia [Sat, 26 Jan 2013 01:57:48 +0000 (20:57 -0500)]
Fix broken RAR seek support.
Using SEEK_CUR or SEEK_END produced the wrong results, SEEK_SET was
fine however. Note that archive_read_data() doesn't function exactly
as POSIX read. Currently, downstreams will have to check the current
file position after after call to archive_read_data() if they are
to use SEEK_CUR afterwards.