-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.m4
executable file
·83 lines (70 loc) · 2.99 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
dnl $Id$
dnl config.m4 for extension rsync
dnl Comments in this file start with the string 'dnl'.
PHP_ARG_WITH(rsync, for rsync support,
[ --with-rsync Include rsync support])
if test "$PHP_RSYNC" != "no"; then
dnl # --with-rsync -> check with-path
SEARCH_PATH="/usr/local /usr"
SEARCH_FOR="include/librsync.h"
if test -r $PHP_RSYNC/$SEARCH_FOR; then # path given as parameter
RSYNC_DIR=$PHP_RSYNC
else
AC_MSG_CHECKING([for rsync library to use])
AC_MSG_RESULT([bundled])
if test -d librsync; then
dnl doing the bundled librsync config
cd librsync
./configure
cd ..
librsync_sources="librsync/prototab.c librsync/base64.c librsync/buf.c \
librsync/checksum.c librsync/command.c librsync/delta.c librsync/emit.c \
librsync/fileutil.c librsync/hex.c librsync/job.c librsync/mdfour.c \
librsync/mksum.c librsync/msg.c librsync/netint.c \
librsync/patch.c librsync/readsums.c \
librsync/rollsum.c librsync/scoop.c librsync/search.c librsync/stats.c \
librsync/stream.c librsync/sumset.c librsync/trace.c librsync/tube.c \
librsync/util.c librsync/version.c librsync/whole.c"
PHP_NEW_EXTENSION(rsync, $librsync_sources rsync.c, $ext_shared,,-I./librsync)
PHP_ADD_BUILD_DIR($ext_builddir/librsync)
dnl PHP_INSTALL_HEADERS([ext/rsync], [php_rsync.h rsync/])
AC_DEFINE(HAVE_BUNDLED_RSYNC, 1, [ ])
AC_CHECK_FUNCS([snprintf vsnprintf], [], [])
dnl AC_CHECK_HEADERS([librsync/prototab.h librsync/buf.h librsync/checksum.h librsync/command.h librsync/emit.h librsync/fileutil.h librsync/job.h librsync/mdfour.h librsync/netint.h librsync/protocol.h librsync/librsync.h librsync/librsync-config.h librsync/rollsum.h librsync/search.h librsync/stream.h librsync/sumset.h librsync/trace.h librsync/types.h librsync/util.h librsync/whole.h librsync/snprintf.h], [], [])
else
AC_MSG_RESULT([not found])
# search default path list
AC_MSG_CHECKING([for librsync files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
RSYNC_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
if test -z "$RSYNC_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please install librsync or put source unter librsync directory here])
fi
fi
fi
if ! test -z "$RSYNC_DIR"; then
dnl set the infos to the externel lib
dnl # --with-rsync -> check for lib and symbol presence
LIBNAME=rsync
LIBSYMBOL=rs_librsync_version
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $RSYNC_DIR/lib, RSYNC_SHARED_LIBADD)
AC_DEFINE(HAVE_RSYNCLIB,1,[ ])
],[
AC_MSG_ERROR([wrong librsync version or lib not found])
],[
-L$RSYNC_DIR/lib -lm
])
PHP_NEW_EXTENSION(rsync, rsync.c, $ext_shared)
fi
dnl # --with-rsync -> add include path
PHP_ADD_INCLUDE($RSYNC_DIR/include)
dnl
PHP_SUBST(RSYNC_SHARED_LIBADD)
fi