libgit2/php-git

Error compile on MacOS X

Crash-- opened this issue · 4 comments

The compilation of libgit2 works fine, but when I try to compile the PHP-GIT extension, I've this error during the make step.

I use the PHP 5.3.10 version compiled from macport repo:

php -v
PHP 5.3.10 (cli) (built: Mar 4 2012 12:36:34)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans

Any ideas?

/bin/sh /Users/Quentin/Sites/Boulot/PHPGIT/php-git/libtool --mode=compile cc  -I. -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git -DPHP_ATOM_INC -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git/include -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git/main -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib -I/opt/local/include  -DHAVE_CONFIG_H  -g -O2   -c /Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c -o repository.lo 
 cc -I. -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git -DPHP_ATOM_INC -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git/include -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git/main -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib -I/opt/local/include -DHAVE_CONFIG_H -g -O2 -c /Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c  -fno-common -DPIC -o .libs/repository.o
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c: In function ‘php_git2_repository_initialize’:
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:98: warning: passing argument 4 of ‘add_property_string_ex’ discards qualifiers from pointer target type
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c: In function ‘zim_git2_repository_init’:
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:237: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:237: error: (Each undeclared identifier is reported only once
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:237: error: for each function it appears in.)
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c: In function ‘zim_git2_repository_discover’:
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:313: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c: In function ‘zim_git2_repository_exists’:
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:341: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c: In function ‘zim_git2_repository_lookup’:
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:377: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
make: *** [repository.lo] Error 1

Thank you,

sorry, please try #26.

The link indicated into the #26 doesn't work anymore. (2218fd5)

Which commit should I use?

@Crash- oops, missed link. you have to use this libgit2 commit and current php-git2 dev branch.
libgit2/libgit2@2218fd5

I'll plan to use libgit2 static lib for next php-git2 version as it's hard to support several libgit2 version.

@chobie Thank you very much for your help. You can close this issue :)