-
Notifications
You must be signed in to change notification settings - Fork 147
/
config.m4
49 lines (37 loc) · 1.47 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
dnl $Id$
dnl config.m4 for extension mosquitto
dnl Comments in this file start with the string 'dnl'.
dnl Remove where necessary. This file will not work
dnl without editing.
PHP_ARG_WITH(mosquitto, for mosquitto support,
[ --with-mosquitto Include mosquitto support])
if test "$PHP_MOSQUITTO" != "no"; then
dnl Write more examples of tests here...
# --with-mosquitto -> check with-path
SEARCH_PATH="/usr/local /usr" # you might want to change this
SEARCH_FOR="/include/mosquitto.h" # you most likely want to change this
if test -r $PHP_MOSQUITTO/$SEARCH_FOR; then # path given as parameter
MOSQUITTO_DIR=$PHP_MOSQUITTO
else # search default path list
AC_MSG_CHECKING([for mosquitto files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
MOSQUITTO_DIR=$i
AC_MSG_CHECKING($MOSQUITTO_DIR)
AC_MSG_RESULT(found in $i)
fi
done
fi
if test -z "$MOSQUITTO_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the mosquitto distribution])
fi
# --with-mosquitto -> add include path
PHP_ADD_INCLUDE($MOSQUITTO_DIR/include)
# --with-mosquitto -> check for lib and symbol presence
LIBNAME=mosquitto # you may want to change this
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $MOSQUITTO_DIR/$PHP_LIBDIR, MOSQUITTO_SHARED_LIBADD)
PHP_SUBST(MOSQUITTO_SHARED_LIBADD)
PHP_NEW_EXTENSION(mosquitto, mosquitto.c mosquitto_message.c, $ext_shared)
AC_FUNC_STRERROR_R
fi