config.m4 1.1 KB

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