Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 51 lines (43 sloc) 1.211 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
PHP_ARG_ENABLE(git2, Whether to enable the "git2" extension,
[ --enable-git2 Enable "php-git2" extension support])

PHP_ARG_WITH(libgit2-dir, for libgit2,
[ --with-libgit2-dir[=DIR] Set the path to libgit2 install prefix.], yes)

if test $PHP_GIT2 != "no"; then
if test "$PHP_LIBGIT2_DIR" != "no" && test "$PHP_LIBGIT2_DIR" != "yes"; then
LIBGIT2_SEARCH_DIRS=$PHP_LIBGIT2_DIR
else
LIBGIT2_SEARCH_DIRS="/usr/local /usr"
fi

for i in $LIBGIT2_SEARCH_DIRS; do
if test -f $i/include/libgit2/git2.h; then
LIBGIT2_DIR=$i
LIBGIT2_INCDIR=$i/include/libgit2
elif test -f $i/include/git2.h; then
LIBGIT2_DIR=$i
LIBGIT2_INCDIR=$i/include
fi
done

if test -z "$LIBGIT2_DIR"; then
AC_MSG_ERROR(Cannot find libgit2)
fi

LIBGIT2_LIBDIR=$LIBGIT2_DIR/$PHP_LIBDIR
PHP_ADD_LIBRARY_WITH_PATH(git2, $LIBGIT2_LIBDIR, GIT2_SHARED_LIBADD)

PHP_SUBST(GIT2_SHARED_LIBADD)
PHP_NEW_EXTENSION(git2, git2.c \
repository.c \
commit.c \
blob.c \
tree.c \
tree_builder.c \
tree_entry.c \
signature.c \
walker.c \
reference.c \
index.c \
index_entry.c \
, $ext_shared)

ifdef([PHP_ADD_EXTENSION_DEP],
[
PHP_ADD_EXTENSION_DEP(git, spl, true)
])

fi
Something went wrong with that request. Please try again.