config.m4 1.1 KB

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