xref: /PHP-5.4/ext/tidy/config.m4 (revision 7180422f)
1dnl
2dnl $Id$
3dnl
4
5PHP_ARG_WITH(tidy,for TIDY support,
6[  --with-tidy[=DIR]       Include TIDY support])
7
8if test "$PHP_TIDY" != "no"; then
9
10  if test "$PHP_TIDY" != "yes"; then
11    TIDY_SEARCH_DIRS=$PHP_TIDY
12  else
13    TIDY_SEARCH_DIRS="/usr/local /usr"
14  fi
15
16  for i in $TIDY_SEARCH_DIRS; do
17    if test -f $i/include/tidy/tidy.h; then
18      TIDY_DIR=$i
19      TIDY_INCDIR=$i/include/tidy
20    elif test -f $i/include/tidy.h; then
21      TIDY_DIR=$i
22      TIDY_INCDIR=$i/include
23    fi
24  done
25
26  if test -z "$TIDY_DIR"; then
27    AC_MSG_ERROR(Cannot find libtidy)
28  fi
29
30  TIDY_LIBDIR=$TIDY_DIR/$PHP_LIBDIR
31
32  PHP_ADD_LIBRARY_WITH_PATH(tidy, $TIDY_LIBDIR, TIDY_SHARED_LIBADD)
33  PHP_ADD_INCLUDE($TIDY_INCDIR)
34
35  PHP_CHECK_LIBRARY(tidy,tidyOptGetDoc,
36  [
37  AC_DEFINE(HAVE_TIDYOPTGETDOC,1,[ ])
38  ],[],[])
39
40
41  PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared)
42  PHP_SUBST(TIDY_SHARED_LIBADD)
43  AC_DEFINE(HAVE_TIDY,1,[ ])
44fi
45