Skip to content

Commit

Permalink
That's enough config.m4 for OSX, at least...
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdm committed Sep 12, 2013
1 parent f44e97f commit 92f5878
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ if test "$PHP_LIBMOSQUITTO" != "no"; then

# --with-libmosquitto -> check with-path
SEARCH_PATH="/usr/local /usr" # you might want to change this
SEARCH_FOR="/include/libmosquitto.h" # you most likely want to change this
SEARCH_FOR="/include/mosquitto.h" # you most likely want to change this
if test -r $PHP_LIBMOSQUITTO/$SEARCH_FOR; then # path given as parameter
LIBMOSQUITTO_DIR=$PHP_LIBMOSQUITTO
else # search default path list
AC_MSG_CHECKING([for libmosquitto files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
LIBMOSQUITTO_DIR=$i
AC_MSG_CHECKING($LIBMOSQUITTO_DIR)
AC_MSG_RESULT(found in $i)
fi
done
Expand All @@ -36,18 +37,9 @@ if test "$PHP_LIBMOSQUITTO" != "no"; then
PHP_ADD_INCLUDE($LIBMOSQUITTO_DIR/include)

# --with-libmosquitto -> check for lib and symbol presence
LIBNAME=libmosquitto # you may want to change this
LIBSYMBOL=mosquitto_init # you most likely want to change this

PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $LIBMOSQUITTO_DIR/lib, LIBMOSQUITTO_SHARED_LIBADD)
AC_DEFINE(HAVE_LIBMOSQUITTOLIB,1,[ ])
],[
AC_MSG_ERROR([wrong libmosquitto lib version or lib not found])
],[
-L$LIBMOSQUITTO_DIR/lib -lm
])
LIBNAME=mosquitto # you may want to change this

PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $LIBMOSQUITTO_DIR/lib, LIBMOSQUITTO_SHARED_LIBADD)

PHP_SUBST(LIBMOSQUITTO_SHARED_LIBADD)

Expand Down

0 comments on commit 92f5878

Please sign in to comment.