Skip to content

Instantly share code, notes, and snippets.

Created December 6, 2012 15:29
Show Gist options
  • Save anonymous/4225340 to your computer and use it in GitHub Desktop.
Save anonymous/4225340 to your computer and use it in GitHub Desktop.
dnl $Id$
PHP_ARG_WITH(signal, for signal support,
[ --with-signal Include signal support])
if test "$PHP_SIGNAL" != "no"; then
SEARCH_PATH="/usr /usr/local"
SEARCH_FOR="/include/mespro.h"
if test "$PHP_SIGNAL" = "yes"; then
AC_MSG_CHECKING([for signal headers in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
SIGNAL_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
else
AC_MSG_CHECKING([for signal headers in $PHP_SIGNAL])
if test -r $PHP_SIGNAL/$SEARCH_FOR; then
SIGNAL_DIR=$PHP_SIGNAL
AC_MSG_RESULT([found])
fi
fi
if test -z "$SIGNAL_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Cannot find signal headers])
fi
PHP_ADD_INCLUDE($SIGNAL_DIR/include)
LIBNAME=mesprox
LIBSYMBOL=AddSinger
if test "x$PHP_LIBDIR" = "x"; then
PHP_LIBDIR=lib64
fi
old_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -L$SIGNAL_DIR/$PHP_LIBDIR"
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SIGNAL_DIR/$PHP_LIBDIR, SIGNAL_SHARED_LIBADD)
],[
AC_MSG_ERROR([wrong signal version {1.4.+ is required} or lib not found])
],[
-L$SIGNAL_DIR/$PHP_LIBDIR
])
LDFLAGS=$old_LDFLAGS
PHP_ADD_EXTENSION_DEP(signal, sockets, true)
PHP_SUBST(SIGNAL_SHARED_LIBADD)
PHP_NEW_EXTENSION(signal, php_signal.c, $ext_shared)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment