# Copyright (C) 2001-2025 Zabbix SIA
# This program is free software: you can redistribute it and/or modify it under the terms of
# the GNU Affero General Public License as published by the Free Software Foundation, version 3.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
AC_DEFUN([YAML_TRY_LINK],
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
assert(yaml_parser_initialize(&parser));
]])],[found_yaml="yes"],[AC_MSG_FAILURE([error])])
AC_DEFUN([LIBYAML_CHECK_CONFIG],
If you want to specify YAML installation directories:
AS_HELP_STRING([--with-libyaml@<:@=DIR@:>@],[use specific YAML library @<:@default=yes@:>@, DIR is the YAML library install directory.])],
if test "$withval" = "no"; then
elif test "$withval" = "yes"; then
want_yaml=ifelse([$1],,[yes],[$1])
if test "x$want_yaml" = "xyes"; then
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG()], [:])
AC_MSG_CHECKING(for yaml-0.1 support)
if test "x$_libyaml_dir" = "xno"; then
if test -x "$PKG_CONFIG" && `$PKG_CONFIG --exists yaml-0.1`; then
YAML_CFLAGS="`$PKG_CONFIG --cflags yaml-0.1`"
YAML_LDFLAGS="`$PKG_CONFIG --libs yaml-0.1`"
YAML_LIBS="`$PKG_CONFIG --libs yaml-0.1`"