Commit Graph

303 Commits

Author SHA1 Message Date
Elliot Saba
e56e4c76b9 CMakeLists: Move http-parser block down by zlib, update error message 2016-12-30 17:59:47 -08:00
Elliot Saba
236a690ce4 Allow Windows with WinHTTP to use external http-parser 2016-11-20 22:46:01 -08:00
Arthur Schreiber
361179786d Fix the existence check for regcomp_l.
`xlocale.h` only defines `regcomp_l` if `regex.h` was included as well.

Also change the test cases to actually test `p_regcomp` works with
a multibyte locale.
2016-10-07 12:47:04 -07:00
Arthur Schreiber
ab96ca5572 Make sure we use the C locale for regcomp on macOS. 2016-10-06 13:15:31 +02:00
Patrick Steinhardt
528b2f7df8 cmake: add curl library path
The `PKG_CHECK_MODULES` function searches a pkg-config module and
then proceeds to set various variables containing information on
how to link to the library. In contrast to the `FIND_PACKAGE`
function, the library path set by `PKG_CHECK_MODULES` will not
necessarily contain linking instructions with a complete path to
the library, though. So when a library is not installed in a
standard location, the linker might later fail due to being
unable to locate it.

While we already honor this when configuring libssh2 by adding
`LIBSSH2_LIBRARY_DIRS` to the link directories, we fail to do so
for libcurl, preventing us to build libgit2 on e.g. FreeBSD. Fix
the issue by adding the curl library directory to the linker
search path.
2016-09-05 13:24:07 +02:00
Patrick Steinhardt
b6a2fd0e0d cmake: do not use -fPIC for MSYS2
The MSYS2 build system automatically compiles all code with position-independent
code. When we manually add the -fPIC flag to the compiler flags, MSYS2 will
loudly complain about PIC being the default and thus not required.

Fix the annoyance by stripping -fPIC in MSYS2 enviroments like it is already
done for MinGW.
2016-06-21 07:50:02 +02:00
Edward Thomson
0aaba44593 Merge pull request #3796 from mmuman/haiku
Preliminary Haiku port
2016-06-01 11:33:58 -05:00
Elan Ruusamäe
13b0b7d520 Update CMakeLists.txt
typo fix
2016-05-27 10:20:35 +03:00
François Revol
d94f503729 CMakeLists: Add libnetwork for Haiku 2016-05-22 23:24:30 +02:00
Edward Thomson
097b0761f1 cmake: include threading libraries in pkg-config
Include any required threading libraries in our `libgit2.pc`.
2016-04-29 10:19:11 -04:00
Carlos Martín Nieto
b8353236bc CI: run proxy tests with ctest
Running clar directly on appveyor makes it think the command returned
failure, so it stops the tests. Running it via ctest lets it go through.
2016-04-19 13:54:27 +02:00
Sebastian Schuberth
035430b7f3 CMakeLists: Further improve the error messages regarding CMAKE_SIZEOF_VOID_P 2016-03-24 14:10:29 +01:00
Sebastian Schuberth
f9601e6f32 CMakeLists: Show the pointer size for an unsupported architecture
Showing the pointer size gives a hint as to why we think this is an
unsupported architecture.
2016-03-23 20:37:39 +01:00
Edward Thomson
3a43677ec6 Merge pull request #3660 from mstrap/mingw
MinGW builds should optionally create DLLs without "lib" prefix
2016-03-18 06:37:04 -07:00
Marc Strapetz
059f33bf75 Option "LIBGIT2_PREFIX" to set the CMAKE's TARGET_PROPERTIES PREFIX
This is especially useful in combination with MinGW to yield the
Windows-compliant DLL name "git2.dll" instead of "libgit2.dll"
2016-03-15 18:32:37 +01:00
Marc Strapetz
08f030ced7 CMake: do not overwrite but only append to CMAKE_C_FLAGS_DEBUG
This is useful to force "smart" IDEs (like CLIon) to use debug
flag -g even it may have decided that "-D_DEBUG" (which is
already present) is sufficient.
2016-03-15 18:23:54 +01:00
Edward Thomson
2d8807126b Enable nanosecond resolution by default
Nanosecond resolution is now the default in git itself.  Enable this
as our default as well.
2016-03-03 15:08:12 -05:00
Carlos Martín Nieto
ba9bb664f3 tests: create a ctest target for cred_callback 2016-03-03 19:31:02 +01:00
Edward Thomson
6cc4bac894 Merge pull request #3577 from rossdylan/rossdylan/pooldebug
Add a new build flag to disable the pool allocator
2016-02-28 11:31:10 -05:00
Edward Thomson
3d6a42d1e1 nsec: support NDK's crazy nanoseconds
Android NDK does not have a `struct timespec` in its `struct stat`
for nanosecond support, instead it has a single nanosecond member inside
the struct stat itself.  We will use that and use a macro to expand to
the `st_mtim` / `st_mtimespec` definition on other systems (much like
the existing `st_mtime` backcompat definition).
2016-02-25 11:40:48 -05:00
Ross Delinger
ed0571f895 Add a new build flag to disable the pool allocator and pass all git_pool_malloc calls straight to git__malloc 2016-01-12 16:08:38 -05:00
Arthur Schreiber
8a0133c030 Add winhttp dependencies to pc file. 2016-01-09 02:43:03 +01:00
Sebastian Schuberth
0878ca9b7c CMakeLists: Compare CMAKE_SIZEOF_VOID_P as a number, not as a string 2015-12-02 14:50:25 +01:00
Jacques Germishuys
eb11fac629 Detect stat's structure 2015-11-20 21:05:38 +02:00
Carlos Martín Nieto
75a0ccf52f Merge pull request #3170 from CmdrMoozy/nsec_fix
git_index_entry__init_from_stat: set nsec fields in entry stats
2015-11-12 19:53:09 +01:00
Edward Thomson
7208ff4d7d cmake: split sources into original paths for Xcode and MSVC
The MSVC_SPLIT_SOURCES function is helpful for other IDEs, like Xcode,
and will split the source files up into their target directories,
instead of merely placing them all in a "Sources" directory.

Rename MSVC_SPLIT_SOURCES to IDE_SPLIT_SOURCES and enable it for Xcode.
2015-10-22 20:17:19 -05:00
Edward Thomson
ac7e50dd37 Merge pull request #3453 from libgit2/cmn/warn-python
CMake: be more explicit with python errors
2015-10-14 08:30:51 -07:00
Carlos Martín Nieto
e3f94c71c3 CMake: be more explicit with python errors
There's been a few reports of users not understanding what the python
error means, so spell out the options they have.
2015-10-06 13:35:45 +02:00
Axel Rasmussen
c7b17fb5cd Merge branch 'master' into nsec_fix_next 2015-10-01 18:01:32 -07:00
Carlos Martín Nieto
ba1a5553e4 Merge pull request #3446 from ethomson/portability
portability: use `CHECK_FUNCTION_EXISTS` for checking whether functions exist...
2015-09-30 17:44:10 +02:00
Edward Thomson
e683d15247 qsort_r/qsort_s: detect their support 2015-09-30 05:49:04 -04:00
Edward Thomson
8649dfd8df p_futimes: support using futimens when available 2015-09-30 05:37:20 -04:00
Axel Rasmussen
360dd4dafd win32: define our own POSIX struct stat, and support USE_NSEC 2015-09-18 23:33:56 -07:00
Axel Rasmussen
c963fe1d3d cmake: fix CMake code organization problem 2015-09-18 23:33:56 -07:00
Axel Rasmussen
e9e6df2c8f cmake: Only provide USE_NSEC if struct stat members are avilable.
This allows us to remove OS checks from source code, instead relying
on CMake to detect whether or not `struct stat` has the nanoseconds
members we rely on.
2015-09-18 23:33:56 -07:00
Axel Rasmussen
e7de893ef8 cmake: add USE_NSEC, and only check nanosec m/ctime if enabled 2015-09-18 23:33:55 -07:00
Dominique Leuenberger
5540d9db20 pkg-config: fix directory references in libgit2.pc
Before:
libdir=/usr//usr/lib64
includedir=/usr//usr/include

After:
libdir=/usr/lib64
includedir=/usr/include

(note the duplication of /usr in the before case)
2015-09-18 11:05:57 +02:00
Carlos Martín Nieto
01fe83741a Revert "Get rid of libssh2 embedding"
The embedding was removed as a libssh2 release with Windows crypto
support became available, but dependencies are still annoying so this
ahs been requested again.

This reverts commit 20dcb7315c.
2015-09-03 13:35:15 +02:00
Carlos Martín Nieto
b445940e2d CMake: fall back to OpenSSL on older OS X
Starting at OS X 10.8, the Security framework offers some functions
which are unified across OS X and iOS. These are the functions that we
use.

Older versions of OS X do not have these functions and we fail to
compile. In these situations, fall back to using OpenSSL for our TLS
stream instead.
2015-08-19 12:53:31 +02:00
Slava Karpenko
c27b4afcdd Forcing libssh2 lib location
OS X may have libssh2 in diff locations, so CHECK_LIBRARY_EXISTS may check the wrong lib; forcing it to use a found directory.
2015-08-06 11:06:17 +03:00
Ben Chatelain
2da64edb80 Add -Wdocumentation flag if supported 2015-07-27 18:28:29 -06:00
Edward Thomson
a522d8c1e7 Merge pull request #3292 from tkelman/patch-1
Increase required version of cmake to 2.8
2015-07-11 17:35:59 -05:00
Tony Kelman
37c84dc58f Increase required version of cmake to 2.8 2015-07-10 12:10:47 -07:00
Jeff Hostetler
93b4272895 Include stacktrace summary in memory leak output. 2015-06-29 16:39:11 -04:00
Carlos Martín Nieto
fd2d11a178 CMake: treat the ld flags as a list
These are treated as a list by CMake itself, which means that treating
them as a simple string can put semicolons in our ld command-line if we
have libraries which are not installed on the standard locations.

Treat the variable as a CMake list and replace it with the space-delimited
list just before writing it out to our pc file.
2015-06-28 13:57:06 +02:00
Carlos Martín Nieto
790cabf06a pc: Put libcurl and libssh2 in Libs.private
Pass on to whoever wants to link to libgit2 statically the flags that we
would have used for these libraries.

Putting them in Requires.private as we do now makes pkg-config put their
dependencies in the linker arguments as well, which is not what we want.
2015-06-26 13:51:41 +02:00
Arthur Schreiber
65f2d15561 List libcurl in the generated libgit2.pc 2015-06-25 21:49:48 +02:00
Carlos Martín Nieto
cf9d5f7602 curl: find and link with the library if it's available by default 2015-06-24 17:25:05 +02:00
Marius Ungureanu
e488bef42c Quote LIBSSH2_LIBRARIES call
Credits to @directhex

It is possible for PKG_CHECK_MODULES(LIBSSH2 libssh2) to LIBSSH2_LIBRARIES to a string with more than one library in it - e.g. if your libssh2 was built against libgcrypt, it will be "ssh2;gcrypt"

Quoting the string is needed, or CHECK_LIBRARY_EXISTS will fail.
2015-06-19 12:54:51 +03:00
Michał Górny
1679ec1204 cmake: Add CMake check for libssh2 memory credential passing support 2015-05-27 20:36:53 +02:00