1dnl config.m4 for extension pspell 2 3PHP_ARG_WITH(pspell,for PSPELL support, 4[ --with-pspell[=DIR] Include PSPELL support. 5 GNU Aspell version 0.50.0 or higher required]) 6 7if test "$PHP_PSPELL" != "no"; then 8 PHP_NEW_EXTENSION(pspell, pspell.c, $ext_shared) 9 if test "$PHP_PSPELL" != "yes"; then 10 PSPELL_SEARCH_DIRS=$PHP_PSPELL 11 else 12 PSPELL_SEARCH_DIRS="/usr/local /usr" 13 fi 14 for i in $PSPELL_SEARCH_DIRS; do 15 if test -f $i/include/pspell/pspell.h; then 16 PSPELL_DIR=$i 17 PSPELL_INCDIR=$i/include/pspell 18 elif test -f $i/include/pspell.h; then 19 PSPELL_DIR=$i 20 PSPELL_INCDIR=$i/include 21 fi 22 done 23 24 if test -z "$PSPELL_DIR"; then 25 AC_MSG_ERROR(Cannot find pspell) 26 fi 27 28 PSPELL_LIBDIR=$PSPELL_DIR/$PHP_LIBDIR 29 30 PHP_ADD_LIBRARY_WITH_PATH(pspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD) 31 32 dnl Add -laspell to LIBS if it exists 33 PHP_CHECK_LIBRARY(aspell,new_aspell_config, 34 [ 35 PHP_ADD_LIBRARY_WITH_PATH(aspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD) 36 ], [], [ 37 -L$PSPELL_LIBDIR 38 ]) 39 40 PHP_ADD_INCLUDE($PSPELL_INCDIR) 41 PHP_SUBST(PSPELL_SHARED_LIBADD) 42 AC_DEFINE(HAVE_PSPELL,1,[ ]) 43fi 44