Commit Graph

191 Commits

Author SHA1 Message Date
Vicent Marti
39cd01779c This is a better name 2013-01-02 22:38:10 +01:00
Vicent Marti
a44f2e9e7b Try it like this... 2013-01-02 22:26:34 +01:00
Vicent Marti
e229c04825 Fuck you CMake 2013-01-02 21:27:00 +01:00
Vicent Marti
0df4167577 Submodule checkout 2013-01-02 21:22:19 +01:00
Vicent Marti
a368fd0f79 Checkout test 2013-01-02 20:08:49 +01:00
Vicent Marti
5c2d3f6d5d Add build dependency for clar. Also, fuck you CMake. Fuck you. 2013-01-02 04:19:13 +01:00
Vicent Marti
b0a4582975 Bump the Clar submodule 2013-01-02 02:05:11 +01:00
Vicent Marti
156cfec096 Cleanup Clar to make it SIMPLER 2013-01-02 02:05:11 +01:00
Sascha Cunz
523a3ae5a3 MSVC: Don't list all source files in an endless list
Instead tell MSVC to group the source files by directory.
2012-12-19 04:57:15 +01:00
Sascha Cunz
94243295b2 DRY: Add function that adds os-specific libraries to our targets 2012-12-19 04:57:14 +01:00
Sascha Cunz
19a766a201 Collect configuration options at the top of the file
- Also document the -DSTDCALL even better.
2012-12-19 04:57:13 +01:00
Sascha Cunz
521479b170 DRY: Don't repeat globs for libgit2's own source files 2012-12-19 04:57:12 +01:00
Sascha Cunz
c5309eb2da Remove special case source globs for Solaris
With the src/compat/*.c glob removed, there is no longer a difference to
the default globs we use for the IF( UNIX ) case.
2012-12-19 04:57:12 +01:00
Sascha Cunz
49b630086e Remove src/compat/*.c from source globs
This directory doesn't exist.
2012-12-19 04:57:11 +01:00
Sascha Cunz
b53671ae85 Search for zlib unconditional
Up to now, on windows we don't even bother to look if the user has a zlib
available somwhere.

In almost all larger commercial projects i've participated in, it was not
at all uncommon to have such a dependency somewhere in the source tree and
use it whereever required.
Searching for it, even if it's unlikely to be present, allows for such a
scenario (i.e. by prefilling the CMake-Cache).
2012-12-19 04:57:11 +01:00
Sascha Cunz
3d007f4f9c DRY: Scan for regex.c only in one place 2012-12-19 04:57:10 +01:00
Sascha Cunz
8d45789167 Only add deps/http-parser to include-dirs if required 2012-12-19 04:57:09 +01:00
Vicent Marti
cfbe4be3fb More external API cleanup
Conflicts:
	src/branch.c
	tests-clar/refs/branches/create.c
2012-11-27 13:18:27 -08:00
Russell Belfer
a9069f6154 Merge pull request #1086 from scunz/vs_warning_level
VS-Build: Append C_FLAGS to the end of the already given ones.
2012-11-19 12:11:01 -08:00
Sascha Cunz
4a03913cfb VS-Build: Disable /W4 parameter, as it is not picked up anyway
My other PR revealed, that the /W4 parameter, we give to MSVC is ignored
because cmake set CMAKE_C_FLAGS already to /W3 and we overwrite it.

The command line tools gave me a D9025 warning for this on every file and
looking into the project properties page on MSVC 2008 tells, that it has
the warning level set to /W3.

However, the warnings introduced by /W4 are far to useless for having
them enabled. So just disable them.
2012-11-19 21:07:13 +01:00
Sascha Cunz
26d9e317db Don't use precompiled headers for command-line based VC builds.
The reason, why libgit2 currently cannot support compiling via the command-line
tools cl/nmake from WinSDK and/or Microsoft Visual Studio, seems to be a
missing dependency on the generated precompiled header file.

The Visual Studio IDE automatically inserts this dependency when it sees the
right combination of "/Y" parameters.

This patch allows to compile using command line tools by disabling precompiled
headers for NON-IDE builds.
2012-11-19 05:00:02 +01:00
Edward Thomson
d6fb092409 Win32 CryptoAPI and CNG support for SHA1 2012-11-13 10:23:05 -06:00
Russell Belfer
dbd6850d06 Hide deprecations on MacOS
Why Apple, why?
2012-11-01 10:57:14 -07:00
Paul Thompson
88149fae9f Leave CMAKE_BUILD_TYPE absent on those generators which don't use it. 2012-10-28 10:21:28 +11:00
Paul Thompson
4a3be934de Removed overwrite of CMAKE_C_FLAGS_DEBUG.
- No overwriting allows control from cmake cache or cmdline
- -g is already the CMake default
- -O0 is already gcc's default
2012-10-28 09:56:18 +11:00
Paul Thompson
54c56d3efd Remove "-O2 -g" from default CMAKE_C_FLAGS.
- Those are the RelWithDebInfo flags.
- They should be controlled from CMAKE_BUILD_TYPE
2012-10-28 09:42:54 +11:00
Paul Thompson
2df7c94490 Remove duplicate CMAKE_C_FLAGS inside CMAKE_C_FLAGS_DEBUG.
- For Debug builds, CMake uses concatenated
  CMAKE_C_FLAGS and CMAKE_C_FLAGS_DEBUG
- This reverts commit 291f712292.
2012-10-28 09:30:08 +11:00
Edward Thomson
94155e2fa2 remove /ZM1000 from msvc builds 2012-10-25 14:51:08 -05:00
Vicent Martí
81e7b10a15 Merge pull request #1012 from carlosmn/libcrypto-sha
Use libcrypto's SHA-1 implementation when linking to it
2012-10-23 13:43:28 -07:00
Carlos Martín Nieto
7205a4d94c Use libcrypto's SHA-1 implementation when linking to it
libcryto's SHA-1 implementation is measurably better than the one that
ships with the library. If we link to it for HTTPS support already,
use that implementation instead.

Testing on a ~600MB of the linux repository, this reduces indexing
time by 40% and removes the hashing from the top spot in the perf
output.
2012-10-23 20:30:16 +02:00
Veeti Paananen
88e0fc05d6 Remove backwards compatibility for INSTALL_LIB 2012-10-20 02:59:40 +03:00
Veeti Paananen
291f712292 Let environment CFLAGS override the debug flags 2012-10-20 02:57:02 +03:00
Veeti Paananen
9795a40f88 Use standard CMake variable names for installation paths
Rename INSTALL_INC and INSTALL_BIN to INCLUDE_INSTALL_DIR and
BIN_INSTALL_DIR, which are more commonly used. This is also
consistent with the variable for the library path which is
already LIB_INSTALL_DIR.
2012-10-20 02:56:35 +03:00
Carlos Martín Nieto
a75770febc tests: add a test for tag autofollow behaviour
Also tell ctest and valgrind to run libgit2_clar with '-iall' so we
run the network tests in travis.
2012-10-11 00:19:54 +02:00
Carlos Martín Nieto
3ce22c7485 http: use WinHTTP on Windows
Wondows has its own HTTP library. Use that one when possible instead of
our own.

As we don't depend on them anymore, remove the http-parser library from
the Windows build, as well as the search for OpenSSL.
2012-09-14 02:13:30 +02:00
Ignacio Casal Quinteiro
b3237ac313 Add support for the more standard LIB_INSTALL_DIR variable 2012-07-13 17:14:08 +02:00
Chris Young
abd6d52c72 revert defaults 2012-06-20 19:27:17 +01:00
Chris Young
17b45d801d Removed hardcoded CMAKE_SYSTEM_NAME 2012-06-13 23:43:25 +01:00
Chris Young
a21bb1aa33 Merge remote-tracking branch 'source/development' into development 2012-06-13 23:28:51 +01:00
Chris Young
96ef3d8462 Make this more generic and mergeable.
Needs AmigaOS.cmake now from CMake package at OS4Depot, or contents below:
--8<--
SET(AMIGA 1)
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
--8<--
2012-06-13 23:16:14 +01:00
Ben Straub
73aaf67439 Precompile headers for MSVC. 2012-06-13 14:28:47 -07:00
Chris Young
c9f79972ba remove errorneous comment 2012-06-09 23:13:21 +01:00
Chris Young
c3fad0ae35 Merge branch 'development' of github.com:chris-y/libgit2 into development 2012-06-09 23:06:32 +01:00
Chris Young
41cbbea8fe Let platform 'Generic' get the regex deps so we don't need to use our external ones 2012-06-09 23:05:59 +01:00
Chris Young
b9bfc7684b pre-compiled sha1ppc.S.obj file with nasty CMake hack instructions as the cross-compile process refuses to build and link this file itself. 2012-06-09 17:33:08 +01:00
Chris Young
4c650c2b80 Don't use the PPC native SHA1 :( CMake is refusing to acknowledge the sha1ppc.S ppc asm code. 2012-06-08 19:55:04 +01:00
Chris Young
c3f7a9386d Re-add the ability to select the PowerPC SHA1 function 2012-06-08 19:37:24 +01:00
Chris Young
fa56478fb8 Generic needs compat files 2012-06-08 19:15:11 +01:00
Chris Young
fb0b1523c4 force disable of openssl, confusing cross-compiler 2012-06-07 20:40:03 +01:00
Chris Young
c3f35902f3 Merge remote-tracking branch 'source/development' into update-test
Merging main libgit2!
Conflicts:
	CMakeLists.txt
	src/unix/map.c
2012-06-07 20:29:22 +01:00
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