config.m4 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. dnl
  2. dnl $Id$
  3. dnl
  4. PHP_ARG_WITH(pspell,for PSPELL support,
  5. [ --with-pspell[=DIR] Include PSPELL support.
  6. GNU Aspell version 0.50.0 or higher required])
  7. if 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. if test -z "$PSPELL_DIR"; then
  24. AC_MSG_ERROR(Cannot find pspell)
  25. fi
  26. PSPELL_LIBDIR=$PSPELL_DIR/$PHP_LIBDIR
  27. PHP_ADD_LIBRARY_WITH_PATH(pspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD)
  28. dnl Add -laspell to LIBS if it exists
  29. PHP_CHECK_LIBRARY(aspell,new_aspell_config,
  30. [
  31. PHP_ADD_LIBRARY_WITH_PATH(aspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD)
  32. ], [], [
  33. -L$PSPELL_LIBDIR
  34. ])
  35. PHP_ADD_INCLUDE($PSPELL_INCDIR)
  36. PHP_SUBST(PSPELL_SHARED_LIBADD)
  37. AC_DEFINE(HAVE_PSPELL,1,[ ])
  38. fi