This repository was archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathconfig.m4
69 lines (55 loc) · 2.06 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
dnl config.m4 for extension apush
PHP_ARG_WITH(apn, for apn support, [ --with-apn=[DIR] Include Apple Push Notification Service support])
if test "$PHP_APN" != "no"; then
AC_DEFINE(HAVE_CAPN,1,[whether to enable Apple Push Notification Service support])
PHP_CONFIG="php-config"
AC_MSG_CHECKING(for PHP 5.3.0 or greater)
PHP_VER_NUM=`$PHP_CONFIG --vernum`
if test "$PHP_VER_NUM" -ge 50300; then
AC_MSG_RESULT($PHP_VER_NUM)
else
AC_MSG_ERROR(PHP version 5.3.0 or later is required)
fi
SEARCH_HEADERS_PATH="/usr/local /usr /opt/local"
SEARCH_HEADER_FILE="apn.h"
if test -r $PHP_APN/include/capn/$SEARCH_HEADER_FILE; then
APN_DIR=$PHP_APN
else
AC_MSG_CHECKING([for $SEARCH_HEADER_FILE in default path])
for i in $SEARCH_HEADERS_PATH; do
if test -r $i/include/capn/$SEARCH_HEADER_FILE; then
APN_DIR=$i
AC_MSG_RESULT(found in $i)
break
fi
done
fi
if test -z "$APN_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([libcapn is not found. Please visit to http://www.libcapn.org/php-apn for more information])
fi
APN_INCDIR=$APN_DIR/include/capn
SEARCH_LIBS_PATH="/usr/local/lib /usr/lib /usr/lib64 /usr/local/lib64"
SEARCH_LIB_FILE=libcapn.$SHLIB_SUFFIX_NAME
if test -r $PHP_APN/capn/$SEARCH_LIB_FILE; then
APN_LIBDIR=$PHP_APN
else
AC_MSG_CHECKING([for $SEARCH_LIB_FILE in default path])
for i in $SEARCH_LIBS_PATH; do
if test -r $i/capn/$SEARCH_LIB_FILE; then
APN_LIBDIR=$i
AC_MSG_RESULT(found in $i)
break
fi
done
fi
if test -z "$APN_LIBDIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([libcapn is not found. Please visit to http://www.libcapn.org/php-apn for more information])
fi
APN_LIBDIR=$APN_LIBDIR/capn
PHP_ADD_INCLUDE($APN_INCDIR)
PHP_ADD_LIBRARY_WITH_PATH(capn, $APN_LIBDIR, APN_SHARED_LIBADD)
PHP_SUBST(APN_SHARED_LIBADD)
PHP_NEW_EXTENSION(apn, php_apn.c, $ext_shared)
fi