Commit Graph

236 Commits

Author SHA1 Message Date
Yury G. Kudryashov
e15a0849eb Tell user if libssh was not found
Fixes #2665
2015-02-04 00:29:09 +03:00
Leo Yang
7641327c8b Add option to turn off OpenSSL 2015-01-13 16:53:07 -05:00
Edward Thomson
6e1205ef62 cmake: include FindPkgConfig for windows
Apparently FindPkgConfig is not included by default on VS builds,
only Unix and Unix-like (mingw) builds.
2014-12-22 12:40:04 -06:00
Carlos Martín Nieto
4f91bfa32b Find libssh2 via pkg-config
We don't really need our own module to find libssh2. Using pkg-config
lets the standard tool do the work for us and let us fit more naturally
in the workflow as we respect the pkg-config search paths.
2014-12-05 10:41:54 +01:00
Carlos Martín Nieto
79b0ae4e24 Flip THREADSAFE's default to ON
Threads are here to stay; and for a while now, users have had to call
the initialization function which sets up threads and crypto regardless
of whether the library was built threadsafe or not.
2014-10-27 10:30:57 +01:00
Edward Thomson
a747ea49c9 Merge pull request #2647 from ethomson/clar_tmpname
clar: use a custom temp directory name
2014-10-24 14:01:13 -07:00
Edward Thomson
29eed1c74d clar: use a custom temp directory name 2014-10-24 10:50:57 -04:00
Carlos Martín Nieto
d9c0dbb042 hash: use CommonCrypto on OSX for SHA-1
OSX has its own cryptographic library, let's make use of it instead of
calling out to OpenSSL.
2014-10-24 13:31:18 +02:00
Carlos Martín Nieto
3753110aed Provide option to embed libssh2 2014-10-05 12:13:40 +02:00
Edward Thomson
23135afa6f Introduce proper http authentication API 2014-08-15 14:11:56 -04:00
Edward Thomson
315cb38e1e Add GSSAPI support for SPNEGO/Kerberos auth over HTTP 2014-08-15 11:12:42 -04:00
Carlos Martín Nieto
9980767205 Change SOVERSION at API breaks
Since the SOVERSION doesn't need to follow the library's version and
simply needs to be monotonically increasing whenever we release
something that breaks the ABI, we can set some number and allow multiple
versions of the library to be installed side-by-side.

We start here with the minor version as that's what we release for now,
and it allows to backport this change to earlier versions.
2014-06-08 19:42:54 +02:00
Jeff King
6bcb098755 cmake: s/ICONV/Iconv/ in FIND_PACKAGE
The cmake module we provide is in the file FindIconv.cmake,
so we must match the case correctly. It happens to work in
practice because we only turn on ICONV on Darwin, and people
generally have case-insensitive filesystems there.

Note that we only need to update the package name here. The
package itself still sets the all-uppercase ICONV_FOUND
flag, so we continue to use uppercase in the rest of cmake.
2014-05-08 15:48:49 -04:00
Vicent Marti
9d878fc420 Merge pull request #2304 from jacquesg/solaris
Solaris!
2014-05-01 01:23:10 -07:00
Jacques Germishuys
98b8fcff4f Build regex.c for Solaris. Added required defines for Solaris 2014-04-30 17:05:13 +02:00
Carlos Martín Nieto
f5fc63bc0c Don't exclude libssh2 from MinGW
It reportedly works. It does not however work when cross-compiling on
Travis, so let's disable it there.

This fixes #2311.
2014-04-30 11:15:41 +02:00
Ting-Wei Lan
096ac799a3 Workaround missing .pc files on FreeBSD
This fixes #2118
2014-04-30 10:51:44 +02:00
Carlos Martín Nieto
04739e9f4a Unquiet CMake output
The point of this phase is to know what we have and not. Show the user a
clear indication of what we have.
2014-04-30 10:15:44 +02:00
Marcin Sawicki
7f0de93a0d Make the build CMake 2.6 compatible 2014-04-28 15:24:36 +01:00
Jacques Germishuys
5c8d5eac35 Introduce AddCFlagIfSupported CMake macro 2014-04-19 23:07:50 +02:00
Jacques Germishuys
364ef52881 Only disable deprecation warnings on Apple for OpenSSL 2014-04-18 19:13:18 +02:00
Jacques Germishuys
c6cd3f8bde Use CHECK_C_COMPILER_FLAG to determine if the compiler supports a flag
This simplifies platform/compiler dependent checks where we optionally
enable features or disable warnings.
2014-04-18 19:09:47 +02:00
Jacques Germishuys
48ce93e08f Fix inconsistent use of lower-case and upper-case names for macros 2014-04-18 19:09:47 +02:00
Russell Belfer
823c0e9cc1 Fix broken logic for attr cache invalidation
The checks to see if files were out of date in the attibute cache
was wrong because the cache-breaker data wasn't getting stored
correctly.  Additionally, when the cache-breaker triggered, the
old file data was being leaked.
2014-04-17 15:04:41 -07:00
Linquize
9e1ed9f2c0 Add CFLAGS -Wdeclaration-after-statement
This warns local variables declarations after statement, which helps not to break MSVC
2014-04-01 23:01:40 +08:00
Miha
6874cafd84 cmake examples change so that general.c is off by default 2014-03-03 12:08:17 +01:00
Miha
058956ce7f - CMakeLists.txt small fix 2014-03-03 11:47:06 +01:00
Miha
300f44125a - BUGFIX #2133 (@fourplusone) in smart_protocol.c
- added MSVC cmake definitions to disable warnings
- general.c is rewritten so it is ansi-c compatible and compiles ok on microsoft windows
- some MSVC reported warning fixes
2014-02-25 11:56:11 +01:00
Tobias Marquardt
5bda607c37 Check if librt exists independent of OS, to be able to exclude librt on Android builds, even though it is a 'Linux'. 2014-02-21 01:20:31 +01:00
Sascha Cunz
4bc94eb5f0 We never search for libiconv via pkg-config
So we actually also never know that we can set a dependency on it in
pkg-config. Instead always give it the -L and -l options.
2014-01-30 03:01:46 +00:00
Sascha Cunz
6e0ff093fb Find and use a MacPorts version of libiconv. Fixes #2017.
- Add correct -I, -L and -l flags
- Search for libiconv in /opt/local/[include|lib] before in the
  system path. See #2017 for details.
- Give splitted -L and -l arguments to pkg-config
2014-01-30 02:35:09 +00:00
Sascha Cunz
60306450b7 Use relative path to set cmake module path
This has actually no effect on a "normal" build, but allows to use
libgit2 as a part of a larger project via CMake's ADD_SUBDIRECTORY()

Closes #2087
2014-01-30 02:33:51 +00:00
Sascha Cunz
86f92b7431 Show informational messages during cmake run as informational 2014-01-13 12:49:54 +00:00
Russell Belfer
7697e54176 Test cancel from indexer progress callback
This adds tests that try canceling an indexer operation from
within the progress callback.

After writing the tests, I wanted to run this under valgrind and
had a number of errors in that situation because mmap wasn't
working.  I added a CMake option to force emulation of mmap and
consolidated the Amiga-specific code into that new place (so we
don't actually need separate Amiga code now, just have to turn on
-DNO_MMAP).

Additionally, I made the indexer code propagate error codes more
reliably than it used to.
2013-12-11 15:02:20 -08:00
Russell Belfer
726b75d1b8 Improve iconv finding for cmake
* add FindIconv helper for CMake iconv detection
* only default using iconv to ON for MacOS
* update pkg-config generation to include iconv dependency better
2013-12-02 11:32:37 -08:00
Ben Straub
83e1efbf46 Update files that reference tests-clar 2013-11-14 14:10:32 -08:00
Vicent Martí
0df96f2b05 Merge pull request #1936 from libgit2/better-url-parsing
Streamline url-parsing logic.
2013-11-10 07:31:21 -08:00
Vicent Marti
73291aff6e cmake: Add USE_SSH option 2013-11-05 22:08:38 +01:00
Ben Straub
2d1feaa2c7 Compile HTTP parser on win32 (for url parsing) 2013-11-04 15:03:44 -08:00
Edward Thomson
1bfe7133e0 Allow -DWINHTTP=OFF to disable WinHTTP 2013-10-25 13:23:46 -04:00
Carlos Martín Nieto
474c8cf832 Really fix the pc file
It turns out that variables have function scope by default. Let's
really set -liconv and add a few libraries that were forgotten in
the previous commit.

We also need to special-case OSX, as they ship zlib but do not provide
a pkg-config file for it.
2013-10-23 22:49:52 +02:00
Carlos Martín Nieto
1ecda61ec5 Set the correct dependencies in the pkg-config file
When linking statically, the including project needs to know what the
current library build depends on so they can link to it. Store this
information in the pkg-config file.

While here, remove claims that users need to link to zlib or libcrypto.
2013-10-23 13:46:31 +02:00
Russell Belfer
92dac97586 Make reference lookups apply precomposeunicode
Before these changes, looking up a reference would return the
same precomposed or decomposed form of the reference name that
was used to look it up, so on MacOS which ignores the difference
between the two, a single reference could be looked up either way
and git_reference_name would return the form of the name that was
used to look it up!  This change makes lookup always return the
precomposed name if core.precomposeunicode is set regardless of
which version was used to look it up.  The reference iterator was
already returning the precomposed form from earlier work.

This also updates the CMakeLists.txt rules for enabling iconv
usage because the clar tests for this code were actually not being
activated properly with the old version.

Finally, this moves git_repository_reset_filesystem from include/
git2/repository.h to include/git2/sys/repository.h since it is not
really a function that normal library users should have to think
about very often.
2013-10-08 16:35:57 -07:00
Russell Belfer
219d345732 Initial iconv hookup for precomposed unicode
This hooks up git_path_direach and git_path_dirload so that they
will take a flag indicating if directory entry names should be
tested and converted from decomposed unicode to precomposed form.
This code will only come into play on the Apple platform and even
then, only when certain types of filesystems are used.

This involved adding a flag to these functions which involved
changing a lot of places in the code.

This was an opportunity to do a bit of code cleanup here and there,
for example, getting rid of the git_futils_cleanupdir_r function in
favor of a simple flag to git_futils_rmdir_r to not remove the top
level entry.  That ended up adding depth tracking during rmdir_r
which led to a safety check for infinite directory recursion.  Yay.

This hasn't actually been tested on the Mac filesystems where the
issue occurs.  I still need to get test environment for that.
2013-10-03 10:44:13 -07:00
Jameson Miller
b176ededb7 Initial Implementation of progress reports during push
This adds the basics of progress reporting during push. While progress
for all aspects of a push operation are not reported with this change,
it lays the foundation to add these later. Push progress reporting
can be improved in the future - and consumers of the API should
just get more accurate information at that point.

The main areas where this is lacking are:

1) packbuilding progress: does not report progress during deltafication,
   as this involves coordinating progress from multiple threads.

2) network progress: reports progress as objects and bytes are going
   to be written to the subtransport (instead of as client gets
   confirmation that they have been received by the server) and leaves
   out some of the bytes that are transfered as part of the push protocol.
   Basically, this reports the pack bytes that are written to the
   subtransport. It does not report the bytes sent on the wire that
   are received by the server. This should be a good estimate of
   progress (and an improvement over no progress).
2013-09-30 13:22:28 -04:00
Russell Belfer
60ee53dfce Split examples CMakeLists.txt
Also, this converts the examples/CMakeLists.txt from explicitly
listing to just globbing for all the individual C files.
2013-09-03 15:20:16 -07:00
Vicent Martí
c46fe0c651 Merge pull request #1823 from kadamski/building4android
Small changes enabling compiling libgit2 for Android.
2013-09-02 03:01:40 -07:00
Krzysztof Adamski
5c37f00505 Build all example files if BUILD_EXAMPLES used. 2013-09-01 19:00:16 +02:00
Krzysztof Adamski
82b2fc2c83 Create ANDROID build option
CMake seems not to support Android as a target and this option
lets us test this in CMakeLists.txt.
2013-09-01 18:45:36 +02:00
Carlos Martín Nieto
5be622fb56 Test SSH in travis
Set up the ssh credentials so we are able to talk to localhost and
issue git commands. Move to use a script, as the command list is
getting somewhat long.

While here, delay installing valgrind until we need it, as it and its
dependencies are by far the largest downloads and this allows us to
start compiling (and failing) faster and we only incur this cost when
the test suite runs successfully.
2013-08-14 10:49:10 +02:00