@@ -4,40 +4,35 @@ PHP_ARG_WITH([tidy],
4
4
[ Include TIDY support] ) ] )
5
5
6
6
if test "$PHP_TIDY" != "no"; then
7
-
8
- if test "$PHP_TIDY" != "yes"; then
9
- TIDY_SEARCH_DIRS=$PHP_TIDY
10
- else
11
- TIDY_SEARCH_DIRS="/usr/local /usr"
12
- fi
7
+ AS_VAR_IF ( [ PHP_TIDY] , [ yes] ,
8
+ [ TIDY_SEARCH_DIRS="/usr/local /usr"] ,
9
+ [ TIDY_SEARCH_DIRS=$PHP_TIDY] )
13
10
14
11
for i in $TIDY_SEARCH_DIRS; do
15
12
for j in tidy tidyp; do
16
- if test -f $i/include/$j/$j.h; then
17
- TIDY_DIR=$i
18
- TIDY_INCDIR=$i/include/$j
19
- TIDY_LIB_NAME=$j
20
- break
21
- elif test -f $i/include/$j.h; then
22
- TIDY_DIR=$i
23
- TIDY_INCDIR=$i/include
24
- TIDY_LIB_NAME=$j
25
- break
26
- fi
13
+ AS_IF ( [ test -f $i/include/$j/$j.h] , [
14
+ TIDY_DIR=$i
15
+ TIDY_INCDIR=$i/include/$j
16
+ TIDY_LIB_NAME=$j
17
+ break 2
18
+ ] ,
19
+ [ test -f $i/include/$j.h] , [
20
+ TIDY_DIR=$i
21
+ TIDY_INCDIR=$i/include
22
+ TIDY_LIB_NAME=$j
23
+ break 2
24
+ ] )
27
25
done
28
26
done
29
27
30
- if test -z "$TIDY_DIR"; then
31
- AC_MSG_ERROR ( [ Cannot find libtidy] )
32
- else
33
- dnl Check for tidybuffio.h (as opposed to simply buffio.h) which indicates
34
- dnl that we are building against tidy-html5 and not the legacy htmltidy. The
35
- dnl two are compatible, except for with regard to this header file.
36
- if test -f "$TIDY_INCDIR/tidybuffio.h"; then
37
- AC_DEFINE ( [ HAVE_TIDYBUFFIO_H] , [ 1] ,
38
- [ Define to 1 if you have the <tidybuffio.h> header file.] )
39
- fi
40
- fi
28
+ AS_VAR_IF ( [ TIDY_DIR] ,, [ AC_MSG_ERROR ( [ Cannot find libtidy] ) ] )
29
+
30
+ dnl Check for tidybuffio.h (as opposed to simply buffio.h) which indicates
31
+ dnl that we are building against tidy-html5 and not the legacy htmltidy. The
32
+ dnl two are compatible, except for with regard to this header file.
33
+ AS_IF ( [ test -f "$TIDY_INCDIR/tidybuffio.h"] ,
34
+ [ AC_DEFINE ( [ HAVE_TIDYBUFFIO_H] , [ 1] ,
35
+ [ Define to 1 if you have the <tidybuffio.h> header file.] ) ] )
41
36
42
37
TIDY_LIBDIR=$TIDY_DIR/$PHP_LIBDIR
43
38
AS_VAR_IF ( [ TIDY_LIB_NAME] , [ tidyp] ,
0 commit comments