File: config.m4

package info (click to toggle)
php-yaml 2.2.2%2B2.1.0%2B2.0.4%2B1.3.2-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,784 kB
  • sloc: ansic: 9,085; xml: 1,793; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 1,133 bytes parent folder | download | duplicates (7)
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
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

  AC_MSG_CHECKING([for yaml headers])
  for i in "$PHP_YAML" "$prefix" /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_RESULT([not found])
    AC_MSG_ERROR([Please install libyaml])
  fi

  PHP_ADD_INCLUDE($PHP_YAML_DIR/include)
  dnl recommended flags for compilation with gcc
  dnl CFLAGS="$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/$PHP_LIBDIR, YAML_SHARED_LIBADD)
  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