-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.m4
54 lines (43 loc) · 1.37 KB
/
config.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
dnl
dnl $Id$
dnl
PHP_ARG_WITH(yaml, [whether to enable LibYAML suppot],
[ --with-yaml[[=DIR]] Enable LibYAML support.
DIR is the path to LibYAML install prefix])
if test "$PHP_YAML" != "no"; then
if test -z "$AWK"; then
AC_PATH_PROGS(AWK, awk gawk nawk, [no])
fi
if test -z "$SED"; then
AC_PATH_PROGS(SED, sed gsed, [no])
fi
if test -r "$PHP_YAML/include/yaml.h"; then
PHP_YAML_DIR="$PHP_YAML"
else
AC_MSG_CHECKING([for yaml in default path])
for i in /usr /usr/local; do
if test -r "$i/include/yaml.h"; then
PHP_YAML_DIR=$i
AC_MSG_RESULT([found in $i])
break
fi
done
if test -z "$PHP_YAML_DIR"; then
AC_MSG_ERROR([not found])
fi
fi
PHP_ADD_INCLUDE($PHP_YAML_DIR/include)
CFLAGS="-Wall -fno-strict-aliasing"
export OLD_CPPFLAGS="$CPPFLAGS"
export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_YAML"
AC_CHECK_HEADER([yaml.h], [], AC_MSG_ERROR(['yaml.h' header not found]))
PHP_SUBST(YAML_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(yaml, $PHP_YAML_DIR/lib, YAML_SHARED_LIBADD)
export CPPFLAGS="$OLD_CPPFLAGS"
export OLD_CPPFLAGS="$CPPFLAGS"
export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_YAML"
export CPPFLAGS="$OLD_CPPFLAGS"
PHP_SUBST(YAML_SHARED_LIBADD)
AC_DEFINE(HAVE_YAML, 1, [ ])
PHP_NEW_EXTENSION(yaml, yaml.c parse.c emit.c detect.c , $ext_shared)
fi