Commit Graph

191 Commits

Author SHA1 Message Date
Vicent Martí
966fbdcb8e Merge pull request #697 from carlosmn/ssl
Add HTTPS support
2012-06-05 13:53:33 -07:00
Chris Young
cada414a80 OS4 is PPC 2012-06-05 12:07:08 +01:00
U-Poseidon\Chris
bad1505609 Force not to use openssl, as confusing cross-compiler
t to use openssl, as confusing cross-compiler
t to use openssl, as confusing cross-compiler

ss

 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)

	modified:   CMakeLists.txt
2012-06-05 11:41:43 +01:00
Scott J. Goldman
2eb1844990 Refactor CMakeLists.txt for mingw cross-compile
Two things:
1) By default, Linux CMake puts -fPIC on the link line. So we remove that
for MINGW to avoid warnings that it will be ignored.
2) Similarly, move -fvisibility=hidden flag to be for non-mingw
compilation only to avoid warnings that it will be ignored.
2012-05-26 18:37:40 -07:00
Scott J. Goldman
62986ff6de Add CMake build for examples / add them to Travis
By default, they are still not built, but hopefully, now that Travis is
building them, this will help stave off some of the bitrot.
2012-05-20 00:52:49 -07:00
Carlos Martín Nieto
d3e1367f61 ssl: remove GnuTLS support
It's too much work for now to redo everything.

Move the ssl context struct to transport.h
2012-05-19 17:51:53 +02:00
Carlos Martín Nieto
a6f24a5b3a https: make it work with OpenSSL as well
Add specific functions that use OpenSSL instead of GnuTLS
2012-05-19 17:50:52 +02:00
Carlos Martín Nieto
66024c7cbc http: add https support when GnuTLS is available
If it's not available, an error saying so will be returned when trying
to use a https:// URL.

This also unifies a lot of the network code to use git_transport in
many places instead of an socket descriptor.
2012-05-19 17:50:52 +02:00
Russell Belfer
706a9974a2 Basic setup for profiling
This fixes the examples so they will build and adds a PROFILE
option to the CMakeFile that enabled gprof info on non-Windows
2012-05-17 13:05:17 -07:00
Vicent Martí
72bfde9790 Merge pull request #681 from scottjg/solaris-fixes
Fix build/runtime issues on Solaris
2012-05-14 11:01:14 -07:00
Sascha Cunz
b15bef2301 Use -fvisibility=hidden in GCC builds 2012-05-12 11:12:42 +02:00
Scott J. Goldman
ec42eafd4a Hook up Windows compat fnmatch() for Solaris
Since Solaris does not support some of the same flags as glibc fnmatch(),
we just use the implementation we have for Windows.

Now that it's no longer a windows-specific thing, I moved it into compat/
instead of win32/
2012-05-10 09:52:49 -07:00
Scott J. Goldman
901fbdad1b Define explicit _WIN32_WINNT version in makefile
Previously, it was defined in netops.c, but it's also needed in one of the
clar tests, so I figured we might as well just make it global for the
whole project.

Without it, the mingw32 linker won't resolve GetProcessId() (called from
the core/errors.c clar test) because of some conditionals in windows.h.
2012-05-07 00:05:02 -07:00
Vicent Martí
16eaa15059 Merge pull request #606 from benstraub/t04_commit_to_clar
Ported t04_commit.c to Clar.
2012-04-02 17:24:16 -07:00
Ben Straub
fd29cd13b7 Moved testing resources to clar, and removed old tests directory.
Removed the BUILD_CLAR CMake flag, and updated the readme.
2012-03-31 16:10:01 -07:00
Ben Straub
9f75a9ce78 Turning on runtime checks when building debug under MSVC. 2012-03-30 12:05:39 -07:00
Ben Straub
e0799b6cd0 Ported t04_commit.c to Clar.
Created a copy of tests/resources/testrepo.git that is compatible
with the Clar sandboxing helpers.

Restructured commit test suites to use Clar sandbox helpers.

Now using typed data arrays rather than lots of macros to define test
cases.
2012-03-20 23:11:24 -07:00
Ben Straub
06c081e1bc Adding multi-cpu compile option when generating MSVC projects. 2012-03-20 20:47:17 -07:00
Russell Belfer
3a5ad90a0d Import xdiff library from git
This is the initial import of the xdiff code (LGPL) from
core git as of rev f349b562086e2b7595d8a977d2734ab2ef9e71ef
2012-03-02 15:49:28 -08:00
Carlos Martín Nieto
4a1ecba6d9 regex: Move the defines to a config header and include it unconditionally 2012-02-18 01:31:43 +01:00
Carlos Martín Nieto
c17b1d0052 Add POSIX regex sources when needed
Windows doesn't support POSIX regex, so we need to include it
ourselves. The sources come from git, which in turn took them from
gawk.
2012-02-17 22:00:17 +01:00
Russell Belfer
38691ffc67 Compile with _GNU_SOURCE when appropriate
On non-Windows builds, we will now use _GNU_SOURCE so header
files will include modern API extensions.  This should resolve
issue #547.
2012-02-01 13:20:47 -08:00
Vicent Martí
3fd1520cd4 Rename the Clay test suite to Clar
Clay is the name of a programming language on the makings, and we want
to avoid confusions. Sorry for the huge diff!
2012-01-24 20:35:15 -08:00
Clemens Buchacher
e632f68789 cmake: generate tags 2011-12-29 15:40:09 +01:00
Clemens Buchacher
86a459a843 cmake: generate clay main
The clay test suite files clay.h and clay_main.c are generated by
the clay python script. Teach CMake about this dependency and
remove the generated files from the repository.
2011-12-29 15:40:09 +01:00
Russell Belfer
b762e576c6 filebuf: add GIT_FILEBUF_INIT and protect multiple opens and cleanups
Update all stack allocations of git_filebuf to use GIT_FILEBUF_INIT
and make git_filebuf_open and git_filebuf_cleanup safe to be called
multiple times on the same buffer.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-11-22 01:53:56 +01:00
Carlos Martín Nieto
4ce16ed82f CMake: use -O0 in debug mode
Otherwise, GCC optimizes variables away and gdb can't tell us what's
in them.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-22 12:26:56 +02:00
Carlos Martín Nieto
dfafb03bdc Move the transports to their own directory 2011-10-12 21:34:25 +02:00
Vicent Marti
502dd2dadb msvc: Fix resourc embedding 2011-10-12 12:09:56 -07:00
Vicent Martí
92e2081f40 Merge pull request #449 from csware/include-win-version-information
Include windows version information in git2.dll
2011-10-12 11:03:58 -07:00
Carlos Martín Nieto
5b216d1a6f CMake: don't overwrite the user's CFLAGS
If either CFLAGS is defined or the user passes -DCMAKE_C_FLAGS to
cmake, the variable already contains flags. Don't overwrite them, but
append them to our settings.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-11 18:08:54 +02:00
Carlos Martín Nieto
dcd62cb2e9 CMake: Only add the STDCALL option when using MSVC
This option is only ever used with MSVC.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-11 17:57:00 +02:00
Sven Strickroth
cf9bf6b787 include version information in git2.dll on Windows
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2011-10-09 18:55:28 +02:00
Sven Strickroth
96fab093e3 put version information in separate file
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2011-10-09 18:39:52 +02:00
Sven Strickroth
da2281c7c0 libgit2 doesn't use -LIB define
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2011-10-09 18:35:42 +02:00
Vicent Marti
d3fb6a81c3 cmake: Set the old test suite as default for the release 2011-10-05 16:46:34 -04:00
Vicent Marti
5888860d2a msvc: Disable warnings in header file
Remove clutter from the CMakeLists file by disabling the warnings
programatically.
2011-09-28 23:49:55 +02:00
Carlos Martín Nieto
887eaf4dc9 Fix dev branch under MSVC
In libgit2: Move an enum out of an int bitfield in the HTTP transport.

In the parser: Use int bitfields and change some variable sizes to
better fit thir use. Variables that count the size of the data chunk
can only ever be as large as off_t. Warning 4127 can be ignored, as
nobody takes it seriously anyway.

From Emeric: change some variable declarations to keep MSVC happy.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-27 15:02:36 +02:00
Vicent Marti
87a26ad55e Add HTTP sources to Clay suite 2011-09-22 20:23:42 +03:00
Vicent Martí
8114ee4c95 Merge pull request #405 from carlosmn/http-ls
Implement ls-remote over HTTP
2011-09-22 10:17:43 -07:00
Vicent Martí
71a4c1f16f Merge pull request #384 from kiryl/warnings
Add more -W flags to CFLAGS
2011-09-18 20:07:59 -07:00
Vicent Marti
48e97ed1f0 Rename Clay target in CMakeLists
This allows to build both test suites at the same time
2011-09-16 05:48:50 +02:00
Vicent Marti
11385c3c4b Add sample "Status" clay tests 2011-09-16 05:13:44 +02:00
Vicent Marti
f1558d9bca Come out and Clay 2011-09-15 01:12:46 +02:00
Carlos Martín Nieto
b8a8191fed http: add http-parser
The code is under the MIT lincense

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-09 13:12:12 +02:00
Kirill A. Shutemov
d568d5856b CMakefile: add -Wmissing-prototypes and fix warnings
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-30 23:55:22 +03:00
Kirill A. Shutemov
51d0044629 CMakefile: add -Wstrict-prototypes and fix warnings
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-30 23:33:59 +03:00
Kirill A. Shutemov
0b2c406187 CMakefile: add -Wstrict-aliasing=2 and fix warnings
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-30 23:06:04 +03:00
Kirill A. Shutemov
0d5aa7d7b8 CMakeLists: no need in split debug/release build
With GNU toolchain there's no need to split debug/release build.

It's useful to have -O2 in debug envitonment since GCC show more
warnings in this case. -O2 -g works fine.

For release purpose, debug information can be stripted on later stage.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-25 14:31:19 +03:00
Carlos Martín Nieto
4fd486e0c2 Really fix pkg-config
Without the @ONLY option, CONFIGURE_FILE would replace the variables
that are meant to be used to pkg-config at configure time.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-12 23:57:44 +02:00
Lambert CLARA
71e08b330c Fix installation of libgit2.pc file
configure_file outputs by default to binary dir,
and install(files) search from source dir.
2011-08-09 08:52:59 +02:00
Vicent Martí
a41bf61222 Merge pull request #357 from carlosmn/calling-convention
Use __stdcall by default on Windows
2011-08-08 11:10:16 -07:00
Carlos Martín Nieto
2327a7cc10 Create and install pkg-config file
This hasn't been working since the switch away from waf.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-07 18:44:08 +02:00
Carlos Martín Nieto
1b5078f6b1 Use __stdcall by default on Windows
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-06 18:18:12 +02:00
Carlos Martín Nieto
e944cfa949 net: link necessary libraries in Solaris
Solaris needs programs to link to socket and nsl in order to use BSD
sockets. Tell CMake to do so, this time for real.

Thanks to boyski for bearing with me through the various iterations of
this patch.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-07-17 20:50:59 +02:00
Carlos Martín Nieto
39cdf27280 Fix network MSYS compilation
MSYS/MinGW uses winsock but obviously doesn't set _MSC_VER. Use _WIN32
to decide whether to use winsock or BSD headers. Also remove these
headers from src/transport_git.c altogether, as they are not needed.

MSYS is very conservative, so we have to tell it that we don't care
about versions of Windows lower than WindowsXP. We also need to tell
CMake to add ws2_32 to the libraries list and we shouldn't add the
-fPIC option, to MSYS because it complains that it does it anyway.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-07-06 12:48:23 +02:00
Vicent Marti
678e9e045b build: Move OS-specific compat to their own folders 2011-07-03 13:33:43 +02:00
Kirill A. Shutemov
932d1baf29 cleanup: remove trailing spaces
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-07-01 18:02:56 +02:00
Tim Harder
1f4f4d1704 cmake: Use system zlib if found on non-Windows systems 2011-07-01 17:41:46 +02:00
Vicent Marti
ec62685345 zlib: Declare preprocessor directives at build time 2011-07-01 17:34:27 +02:00
Vicent Marti
17d523041d build: Simplify build structure
This will make libgit2 more suitable for embedding.
2011-07-01 17:26:23 +02:00
Vicent Marti
b2cef77ccf common: Force 64 bit fileops at compile time 2011-06-30 22:28:19 +02:00
Carlos Martín Nieto
e233fa6f17 Bring back GCC flags
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-06-26 16:37:04 +02:00
Vicent Marti
8172dd4383 cmake: Do not pass /Tc to MSVC 2011-06-23 22:45:09 +02:00
Vicent Marti
f0890fccf9 cmake: Build shared library by default 2011-06-17 19:40:51 +02:00
Vicent Marti
e01f7f642c windows: Disable Runtime checks
Runtime checks are asserting on the embedded ZLib code because of
truncation (see zlib/trees.c:218). This is not good or pretty, but I'm
wary about patching the ZLib code even more.

There are two ways to fix this:

	- Patch the ZLib code, and start storing a diff/patchset on
	how does our version of ZLib differ from the original one, so we can
	be more or less on sync when new version of ZLib.

	- Go back to ZLib as an external dependency, which is np for *NIX
	users but annoying as dicks for Windows users.

THINK HARD
2011-06-17 19:40:06 +02:00
3d96996da6 Fix misleading comment in CMake build script 2011-06-16 08:10:25 -07:00
Vicent Marti
f64586fab6 Add CTest support for CI 2011-06-14 20:00:06 +02:00
Em
904125075e Port MSVC specific Waf compilation flags to CMake and remove dynamic dependence to msvcr100.dll on Windows
The '/MT' and '/MTd' flags replace the dynamic link to 'msvcr100.dll' with a static link to 'libcmt.lib'. This has the nice effect to ease the deployment of libgit2 by removing the dependence on 'msvcr100.dll' which is not deployed by default on Windows.
2011-06-14 17:40:18 +02:00
Vicent Marti
953e1f9366 build: Cleanup CMake 2011-06-14 17:40:18 +02:00
Vicent Marti
1a7b52dcc9 build: Drop waf support
Goodbye Waf. It's been a long ride.
2011-06-14 17:40:17 +02:00
Vicent Marti
b023321669 Remove custom backends
All the custom backend code will be moved to a separate project,
	together with the new MySQL backend.
2011-06-14 17:40:17 +02:00
Vicent Marti
70236bab2d Update CMakeLists.txt to support threadsafe 2011-03-21 19:39:06 +02:00
Vicent Marti
9f81a37aa4 Define NO_GZIP in zconf.h instead of at compile time 2011-03-16 23:02:31 +02:00
Vicent Marti
ab6a3d3de5 Add ZLib as a built-in dependency
I don't know if this is good or bad. This lets libgit2 compile cleanly
on any platforms without any external dependencies, but adds a little
bit of bloat...

Let's test this out and see what happens.
2011-03-15 03:29:20 +02:00
Vicent Marti
c3a41e5f14 Fix compilation when using CMake in Windows
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-03-03 22:01:15 +02:00
Vicent Marti
71d33382a7 Move the external includes folder from src to include
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-03-03 20:23:53 +02:00
Przemyslaw Pawelczyk
20e83aa4ef Further improve SQLite support for CMake users.
Unfortunately previous commit was only a partial fix, because it broke
SQLite support on platforms w/o pkg-config, e.g. Windows. To be honest
I just forgot about messy Windows.

Now if there is no pkg-config, then user must provide two variables:
SQLITE3_INCLUDE_DIRS and SQLITE3_LIBRARIES if (s)he wants to use SQLite
backend. These variables are added to cmake-gui for her/his convenience
unless they are set by FindPkgConfig module.

pkg-config should work also now in Cygwin.
2011-02-08 13:14:19 +01:00
Przemyslaw Pawelczyk
911fd45792 Fix SQLite support for CMake users.
FindPkgConfig obviously uses pkg-config's output for setting convenient
variables such as <PREFIX>_LIBRARIES or <PREFIX>_INCLUDE_DIRS. It also
sets <PREFIX>_FOUND to 1 if <PREFIX> module exists.

So why checking for SQLITE3_FOUND is better than (SQLITE3_LIBRARIES AND
SQLITE3_INCLUDE_DIRS)? Apart from obvious readability factor, latter
condition has strong assumption that both variables are filled with
appropriate paths, which is unjustifiable unless you add another
assumptions...

pkg-config by default strips -I/usr/include from Cflags and -L/usr/lib
from Libs if some environment variables are not set,
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS and PKG_CONFIG_ALLOW_SYSTEM_LIBS
respectively. This behavior is sane, because it prevents polluting the
compilation and linking commands with superfluous entries.

In debian SQLITE3_INCLUDE_DIRS is empty for instance.

Remark for developers:
Always check commands invoked by CMake after changing CMakeLists.txt.

    VERBOSE=1 cmake --build .
2011-02-08 00:30:08 +01:00
Vicent Marti
9d1dcca229 Add proper version management
We now have proper sonames in Mac OS X and Linux, proper versioning on
the pkg-config file and proper DLL naming in Windows.

The version of the library is defined exclusively in 'src/git2.h'; the build scripts
read it from there automatically.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-02-07 10:35:58 +02:00
Vicent Marti
7a689719bd Merge branch 'master' of https://github.com/saschpe/libgit2 into saschpe-master
Conflicts:
	CMakeLists.txt
2011-02-07 09:14:45 +02:00
Vicent Marti
f443a8793f Compile the SQLite backend with CMake too
Use pkg-config to find the library in Unix systems. In Win32, just set
manually the path to your libraries.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-02-07 08:47:50 +02:00
Vicent Marti
b02c371ee9 Build the new test file with CMake too
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-02-02 02:31:58 +02:00
Sascha Peilicke
2d5ef6ad0d Set proper shared library soname. 2011-01-18 21:35:57 +01:00
Peter Drahoš
bfe0658ec6 Update install info and test resource path handling 2010-12-12 00:20:43 +02:00
Peter Drahoš
032db4d015 Reflect the recent changes in header organization (CMake) 2010-12-12 00:20:31 +02:00
Peter Drahos
5b8bb8e7c6 Minor modifications for MinGW/Cygwin compatibility. 2010-12-12 00:20:31 +02:00
Peter Drahoš
6484008297 Fix case sensitivity issue. 2010-12-12 00:20:31 +02:00
Peter Drahoš
73c46d539f Add basic testing support and options to specify install paths 2010-12-12 00:20:17 +02:00
Peter Drahoš
7cbdaf7ffa Add option to select sha1 type in CMake build 2010-12-12 00:20:08 +02:00
Peter Drahoš
583cf1696a Add optional CMake build script. 2010-12-12 00:19:49 +02:00