xref: /PHP-7.0/ext/enchant/config.m4 (revision 5f80da29)
1dnl
2dnl $Id$
3dnl
4
5PHP_ARG_WITH(enchant,for ENCHANT support,
6[  --with-enchant[=DIR]      Include enchant support.
7                          GNU Aspell version 1.1.3 or higher required.])
8
9if test "$PHP_ENCHANT" != "no"; then
10	PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared)
11	if test "$PHP_ENCHANT" != "yes"; then
12	    ENCHANT_SEARCH_DIRS=$PHP_ENCHANT
13	else
14	    ENCHANT_SEARCH_DIRS="/usr/local /usr"
15	fi
16	for i in $ENCHANT_SEARCH_DIRS; do
17		if test -f $i/include/enchant/enchant.h; then
18			ENCHANT_DIR=$i
19			ENCHANT_INCDIR=$i/include/enchant
20		elif test -f $i/include/enchant.h; then
21			ENCHANT_DIR=$i
22			ENCHANT_INCDIR=$i/include
23		fi
24	done
25
26	if test -z "$ENCHANT_DIR"; then
27		AC_MSG_ERROR(Cannot find enchant)
28	fi
29
30	ENCHANT_LIBDIR=$ENCHANT_DIR/lib
31
32	AC_DEFINE(HAVE_ENCHANT,1,[ ])
33	PHP_SUBST(ENCHANT_SHARED_LIBADD)
34	PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR, ENCHANT_SHARED_LIBADD)
35	PHP_ADD_INCLUDE($ENCHANT_INCDIR)
36	PHP_CHECK_LIBRARY(enchant, enchant_broker_set_param,
37	[
38	  AC_DEFINE(HAVE_ENCHANT_BROKER_SET_PARAM,             1, [ ])
39	  AC_DEFINE(ENCHANT_VERSION_STRING,             "1.5.x", [ ])
40	], [], [ -L$ENCHANT_LIBDIR $ENCHANT_SHARED_LIBADD])
41
42fi
43