forked from libgit2/php-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.m4
57 lines (49 loc) · 1.27 KB
/
config.m4
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
52
53
54
55
56
57
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 \
config.c \
remote.c \
tag.c \
odb.c \
odb_object.c \
backend.c \
, $ext_shared)
ifdef([PHP_ADD_EXTENSION_DEP],
[
PHP_ADD_EXTENSION_DEP(git, spl, true)
])
fi