xref: /PHP-8.0/ext/pspell/config.m4 (revision 75fb7486)
1PHP_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
6if test "$PHP_PSPELL" != "no"; then
7	PHP_NEW_EXTENSION(pspell, pspell.c, $ext_shared)
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
23	if test -z "$PSPELL_DIR"; then
24		AC_MSG_ERROR(Cannot find pspell)
25	fi
26
27	PSPELL_LIBDIR=$PSPELL_DIR/$PHP_LIBDIR
28
29	PHP_ADD_LIBRARY_WITH_PATH(pspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD)
30
31	dnl Add -laspell to LIBS if it exists
32	PHP_CHECK_LIBRARY(aspell,new_aspell_config,
33	[
34		PHP_ADD_LIBRARY_WITH_PATH(aspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD)
35	], [], [
36		-L$PSPELL_LIBDIR
37	])
38
39	PHP_ADD_INCLUDE($PSPELL_INCDIR)
40	PHP_SUBST(PSPELL_SHARED_LIBADD)
41	AC_DEFINE(HAVE_PSPELL,1,[ ])
42fi
43