Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to make on OS X #39

Closed
ppeelen opened this issue Oct 17, 2012 · 2 comments
Closed

Unable to make on OS X #39

ppeelen opened this issue Oct 17, 2012 · 2 comments

Comments

@ppeelen
Copy link

ppeelen commented Oct 17, 2012

Followed the readme installation guide, stuck on the "make" command for php-git.
It configured without a problem, however make fails.

[...]
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
paulpeelen:php-git paulp$ make
/bin/sh /Users/paulp/tmp/php-git/libtool --mode=compile cc  -I. -I/Users/paulp/tmp/php-git -DPHP_ATOM_INC -I/Users/paulp/tmp/php-git/include -I/Users/paulp/tmp/php-git/main -I/Users/paulp/tmp/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 -I/Users/paulp/tmp/php-git/libgit2/include  -DHAVE_CONFIG_H  -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement   -c /Users/paulp/tmp/php-git/git2.c -o git2.lo 
mkdir .libs
 cc -I. -I/Users/paulp/tmp/php-git -DPHP_ATOM_INC -I/Users/paulp/tmp/php-git/include -I/Users/paulp/tmp/php-git/main -I/Users/paulp/tmp/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 -I/Users/paulp/tmp/php-git/libgit2/include -DHAVE_CONFIG_H -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -c /Users/paulp/tmp/php-git/git2.c  -fno-common -DPIC -o .libs/git2.o
In file included from /Users/paulp/tmp/php-git/git2.c:25:
./php_git2.h:280:2: warning: implicit declaration of function 'git_oid_tostr' is invalid in C99 [-Wimplicit-function-declaration]
        git_oid_tostr(buf,GIT_OID_HEXSZ+1,oid);
        ^
./php_git2.h:284:43: warning: implicit declaration of function 'git_tree_entry_filemode' is invalid in C99 [-Wimplicit-function-declaration]
        add_property_long(*object, "attributes", git_tree_entry_filemode(entry));
                                                 ^
/opt/local/include/php/Zend/zend_API.h:419:98: note: expanded from macro 'add_property_long'
#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n TSRMLS_CC)
                                                                                                 ^
In file included from /Users/paulp/tmp/php-git/git2.c:25:
./php_git2.h:296:54: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types]
        add_property_string_ex(tmp, "path", sizeof("path"), entry->path, 1 TSRMLS_CC);
                                                            ^~~~~~~~~~~
/opt/local/include/php/Zend/zend_API.h:415:85: note: passing argument to parameter 'str' here
ZEND_API int add_property_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate TSRMLS_DC);
                                                                                    ^
In file included from /Users/paulp/tmp/php-git/git2.c:25:
./php_git2.h:322:68: warning: implicit declaration of function 'giterr_last' is invalid in C99 [-Wimplicit-function-declaration]
                zend_throw_exception_ex(NULL, 0 TSRMLS_CC,"%d\n(error code %d)", giterr_last(), errorcode);
                                                                                 ^
./php_git2.h:323:3: warning: implicit declaration of function 'giterr_clear' is invalid in C99 [-Wimplicit-function-declaration]
                giterr_clear();
                ^
/Users/paulp/tmp/php-git/git2.c:146:62: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types]
                                add_property_stringl_ex(m_entry, "name", sizeof("name"), (const char *)entry_name, strlen(entry_name), 1 TSRMLS_CC);
                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/php/Zend/zend_API.h:416:87: note: passing argument to parameter 'str' here
ZEND_API int add_property_stringl_ex(zval *arg, const char *key, uint key_len,  char *str, uint length, int duplicate TSRMLS_DC);
                                                                                      ^
/Users/paulp/tmp/php-git/git2.c:147:60: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types]
                                add_property_stringl_ex(m_entry, "oid", sizeof("oid"), (const char *)entry_oid, strlen(entry_oid), 1 TSRMLS_CC);
                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/php/Zend/zend_API.h:416:87: note: passing argument to parameter 'str' here
ZEND_API int add_property_stringl_ex(zval *arg, const char *key, uint key_len,  char *str, uint length, int duplicate TSRMLS_DC);
                                                                                      ^
/Users/paulp/tmp/php-git/git2.c:251:2: warning: implicit declaration of function 'git_threads_init' is invalid in C99 [-Wimplicit-function-declaration]
        git_threads_init();
        ^
/Users/paulp/tmp/php-git/git2.c:258:2: warning: implicit declaration of function 'git_threads_shutdown' is invalid in C99 [-Wimplicit-function-declaration]
        git_threads_shutdown();
        ^
9 warnings generated.
/bin/sh /Users/paulp/tmp/php-git/libtool --mode=compile cc  -I. -I/Users/paulp/tmp/php-git -DPHP_ATOM_INC -I/Users/paulp/tmp/php-git/include -I/Users/paulp/tmp/php-git/main -I/Users/paulp/tmp/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 -I/Users/paulp/tmp/php-git/libgit2/include  -DHAVE_CONFIG_H  -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement   -c /Users/paulp/tmp/php-git/repository.c -o repository.lo 
 cc -I. -I/Users/paulp/tmp/php-git -DPHP_ATOM_INC -I/Users/paulp/tmp/php-git/include -I/Users/paulp/tmp/php-git/main -I/Users/paulp/tmp/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 -I/Users/paulp/tmp/php-git/libgit2/include -DHAVE_CONFIG_H -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -c /Users/paulp/tmp/php-git/repository.c  -fno-common -DPIC -o .libs/repository.o
In file included from /Users/paulp/tmp/php-git/repository.c:25:
./php_git2.h:280:2: warning: implicit declaration of function 'git_oid_tostr' is invalid in C99 [-Wimplicit-function-declaration]
        git_oid_tostr(buf,GIT_OID_HEXSZ+1,oid);
        ^
./php_git2.h:284:43: warning: implicit declaration of function 'git_tree_entry_filemode' is invalid in C99 [-Wimplicit-function-declaration]
        add_property_long(*object, "attributes", git_tree_entry_filemode(entry));
                                                 ^
/opt/local/include/php/Zend/zend_API.h:419:98: note: expanded from macro 'add_property_long'
#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n TSRMLS_CC)
                                                                                                 ^
In file included from /Users/paulp/tmp/php-git/repository.c:25:
./php_git2.h:296:54: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types]
        add_property_string_ex(tmp, "path", sizeof("path"), entry->path, 1 TSRMLS_CC);
                                                            ^~~~~~~~~~~
/opt/local/include/php/Zend/zend_API.h:415:85: note: passing argument to parameter 'str' here
ZEND_API int add_property_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate TSRMLS_DC);
                                                                                    ^
In file included from /Users/paulp/tmp/php-git/repository.c:25:
./php_git2.h:322:68: warning: implicit declaration of function 'giterr_last' is invalid in C99 [-Wimplicit-function-declaration]
                zend_throw_exception_ex(NULL, 0 TSRMLS_CC,"%d\n(error code %d)", giterr_last(), errorcode);
                                                                                 ^
./php_git2.h:323:3: warning: implicit declaration of function 'giterr_clear' is invalid in C99 [-Wimplicit-function-declaration]
                giterr_clear();
                ^
/Users/paulp/tmp/php-git/repository.c:104:2: warning: implicit declaration of function 'git_repository_odb' is invalid in C99 [-Wimplicit-function-declaration]
        git_repository_odb(&m_odb->odb,repository);
        ^
/Users/paulp/tmp/php-git/repository.c:106:68: error: too few arguments to function call, expected 2, have 1
        add_property_string(object, "path", git_repository_path(repository),1);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/opt/local/include/php/Zend/zend_API.h:424:117: note: expanded from macro 'add_property_string'
#define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
                                                                                                                    ^
/opt/local/include/git2/repository.h:282:1: note: 'git_repository_path' declared here
GIT_EXTERN(const char *) git_repository_path(git_repository *repo, git_repository_pathid id);
^
/opt/local/include/git2/common.h:44:27: note: expanded from macro 'GIT_EXTERN'
# define GIT_EXTERN(type) extern \
                          ^
/Users/paulp/tmp/php-git/repository.c:190:54: error: too few arguments to function call, expected 2, have 1
                path = git_repository_path(m_repository->repository);
                       ~~~~~~~~~~~~~~~~~~~                         ^
/opt/local/include/git2/repository.h:282:1: note: 'git_repository_path' declared here
GIT_EXTERN(const char *) git_repository_path(git_repository *repo, git_repository_pathid id);
^
/opt/local/include/git2/common.h:44:27: note: expanded from macro 'GIT_EXTERN'
# define GIT_EXTERN(type) extern \
                          ^
/Users/paulp/tmp/php-git/repository.c:213:10: warning: implicit declaration of function 'git_repository_workdir' is invalid in C99 [-Wimplicit-function-declaration]
                path = git_repository_workdir(m_repository->repository);
                       ^
/Users/paulp/tmp/php-git/repository.c:213:8: warning: incompatible integer to pointer conversion assigning to 'const char *' from 'int';
                path = git_repository_workdir(m_repository->repository);
                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/paulp/tmp/php-git/repository.c:242:13: error: use of undeclared identifier 'GIT_OK'
        if (ret == GIT_OK) {
                   ^
/Users/paulp/tmp/php-git/repository.c:316:124: error: use of undeclared identifier 'GIT_OK'
        if (git_repository_discover(path_buffer,path_size,(const char *)start_path,(int)across_fs, (const char *)ceiling_dirs) == GIT_OK) {
                                                                                                                                  ^
/Users/paulp/tmp/php-git/repository.c:344:36: error: use of undeclared identifier 'GIT_OK'
        if (git_oid_fromstr(&id, hash) != GIT_OK) {
                                          ^
/Users/paulp/tmp/php-git/repository.c:374:49: error: use of undeclared identifier 'GIT_OK'
        if (git_oid_fromstrn(&one_id, one, one_len) != GIT_OK) {
                                                       ^
/Users/paulp/tmp/php-git/repository.c:378:49: error: use of undeclared identifier 'GIT_OK'
        if (git_oid_fromstrn(&two_id, two, two_len) != GIT_OK) {
                                                       ^
/Users/paulp/tmp/php-git/repository.c:382:10: warning: implicit declaration of function 'git_merge_base' is invalid in C99 [-Wimplicit-function-declaration]
        error = git_merge_base(&out, m_repository->repository, &one_id, &two_id);
                ^
/Users/paulp/tmp/php-git/repository.c:383:15: error: use of undeclared identifier 'GIT_OK'
        if (error == GIT_OK) {
                     ^
/Users/paulp/tmp/php-git/repository.c:418:47: error: use of undeclared identifier 'GIT_OK'
        if (git_oid_fromstrn(&id, hash, hash_len) != GIT_OK) {
                                                     ^
/Users/paulp/tmp/php-git/repository.c:550:9: warning: macro is not used [-Wunused-macros]
#define lookup php_lookup
        ^
10 warnings and 9 errors generated.
make: *** [repository.lo] Error 1

How can I resolve this issue?

@ppeelen
Copy link
Author

ppeelen commented Oct 17, 2012

Nevermind.. just found out I also install libgit2 using MacPorts which was outdated. Removed the libgit2 installation from MacPorts and cleand and it worked fine.

@chobie
Copy link
Member

chobie commented Oct 18, 2012

yea, it should use libgit2 submodule instead of MacPorts. have fun

@chobie chobie closed this as completed Oct 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants