2013年9月20日 星期五

Git2 lib for Win32 and Linux

///////////Win32/////////////
1. git2 source
https://github.com/libgit2/libgit2
Revision: eb5f03461fbcaa3fef8e63d1b0f7c682708fadd2 / Date: 2014/7/11 下午 06:22:48
installed

2. download cmake
http://www.cmake.org/cmake/resources/software.html
installed

3. install zlib - Complete package, except sources
http://gnuwin32.sourceforge.net/packages/zlib.htm
installed

4. Python26
installed

5.
ready sepcial zlib vc version
http://www.pudn.com/downloads271/sourcecode/zip/detail1238013.html#

6. (option can skip) install OpenSSL
http://code.google.com/p/openssl-for-windows/downloads/list
extract to
C:\Program Files\GnuWin32\include
C:\Program Files\GnuWin32\lib
C:\Program Files\GnuWin32\bin

7. (option can skip) install libss2 and build
http://www.libssh2.org/
build it, out binary and import libary setting to C:\AlphaProject\libssh2-1.4.3\bin

8. run cmake
where is source code -> C:/AlphaProject/libgit2
where to build binaries -> C:/AlphaProject/libgit2

9. Configure - visual studio 9 2008
when build vs2005 will error -> fatal error C1083: Cannot open include file: 'winhttp.h': No such file or directory

10. static lib
[STDCALL] Windows set to OFF
[BUILD_SHARED_LIBS] enable use dll, disable use lib by your choice
[USE_SSH] disable check

11.
(option can skip)
LIBSSH2_INCLUDE_DIR -> C:\AlphaProject\libssh2-1.4.3\include
LIBSSH2_LIBRARY -> C:\AlphaProject\libssh2-1.4.3\bin

12. Select [Generate]

13.
set zlib for vc
C:\AlphaProject\libgit2\zlib\include
C:\AlphaProject\libgit2\zlib\lib
set to your include and lib path

///////////Linux/////////////
1. cd xxx\libgit2
   
2. mkdir build
cd build

3.
(a)Ubuntu
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/git2

(b)Red hat
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/git2 -DBUILD_CLAR=OFF

4. make & make install

5. gedit #Home#/.bashrc
last line of .bashrc add
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/git2/lib
then reopen terminal to run

沒有留言:

張貼留言