dnl $Id$ dnl config.m4 for extension ccmath PHP_ARG_WITH(ccmath, for ccmath support, dnl Make sure that the comment is aligned: [ --with-ccmath Include ccmath support]) if test "$PHP_CCMATH" != "no"; then dnl Write more examples of tests here... dnl # --with-ccmath -> check with-path SEARCH_PATH="/usr/local /usr" # you might want to change this SEARCH_FOR="/include/ccmath.h" # you most likely want to change this if test -r $PHP_CCMATH/$SEARCH_FOR; then # path given as parameter CCMATH_DIR=$PHP_CCMATH else # search default path list AC_MSG_CHECKING([for ccmath files in default path]) for i in $SEARCH_PATH ; do if test -r $i/$SEARCH_FOR; then CCMATH_DIR=$i AC_MSG_RESULT(found in $i) fi done fi if test -z "$CCMATH_DIR"; then AC_MSG_RESULT([not found]) AC_MSG_ERROR([Please reinstall the ccmath distribution]) fi dnl # --with-ccmath -> add include path PHP_ADD_INCLUDE($CCMATH_DIR/include) dnl # --with-ccmath -> check for lib and symbol presence LIBNAME=ccm # you may want to change this LIBSYMBOL=minv # you most likely want to change this PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, [ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $CCMATH_DIR/lib, CCMATH_SHARED_LIBADD) AC_DEFINE(HAVE_CCMATHLIB,1,[ ]) ],[ AC_MSG_ERROR([wrong ccmath lib version or lib not found]) ],[ -L$CCMATH_DIR/lib -lm -ldl ]) PHP_SUBST(CCMATH_SHARED_LIBADD) PHP_NEW_EXTENSION(ccmath, ccmath.c, $ext_shared) fi