Blame m4/search_h.m4

Packit 875988
# search_h.m4 serial 9
Packit 875988
dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
Packit 875988
dnl This file is free software; the Free Software Foundation
Packit 875988
dnl gives unlimited permission to copy and/or distribute it,
Packit 875988
dnl with or without modifications, as long as this notice is preserved.
Packit 875988
Packit 875988
AC_DEFUN([gl_SEARCH_H],
Packit 875988
[
Packit 875988
  AC_REQUIRE([gl_SEARCH_H_DEFAULTS])
Packit 875988
  gl_CHECK_NEXT_HEADERS([search.h])
Packit 875988
  if test $ac_cv_header_search_h = yes; then
Packit 875988
    HAVE_SEARCH_H=1
Packit 875988
  else
Packit 875988
    HAVE_SEARCH_H=0
Packit 875988
  fi
Packit 875988
  AC_SUBST([HAVE_SEARCH_H])
Packit 875988
Packit 875988
  if test $HAVE_SEARCH_H = 1; then
Packit 875988
    AC_CACHE_CHECK([for type VISIT], [gl_cv_type_VISIT],
Packit 875988
      [AC_COMPILE_IFELSE(
Packit 875988
         [AC_LANG_PROGRAM(
Packit 875988
            [[#if HAVE_SEARCH_H
Packit 875988
               #include <search.h>
Packit 875988
              #endif
Packit 875988
            ]],
Packit 875988
            [[static VISIT x; x = postorder;]])],
Packit 875988
         [gl_cv_type_VISIT=yes],
Packit 875988
         [gl_cv_type_VISIT=no])])
Packit 875988
  else
Packit 875988
    gl_cv_type_VISIT=no
Packit 875988
  fi
Packit 875988
  if test $gl_cv_type_VISIT = yes; then
Packit 875988
    HAVE_TYPE_VISIT=1
Packit 875988
  else
Packit 875988
    HAVE_TYPE_VISIT=0
Packit 875988
  fi
Packit 875988
  AC_SUBST([HAVE_TYPE_VISIT])
Packit 875988
Packit 875988
  dnl Check for declarations of anything we want to poison if the
Packit 875988
  dnl corresponding gnulib module is not in use.
Packit 875988
  gl_WARN_ON_USE_PREPARE([[#include <search.h>
Packit 875988
    ]], [tdelete tfind tsearch twalk])
Packit 875988
])
Packit 875988
Packit 875988
AC_DEFUN([gl_SEARCH_MODULE_INDICATOR],
Packit 875988
[
Packit 875988
  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
Packit 875988
  AC_REQUIRE([gl_SEARCH_H_DEFAULTS])
Packit 875988
  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
Packit 875988
  dnl Define it also as a C macro, for the benefit of the unit tests.
Packit 875988
  gl_MODULE_INDICATOR_FOR_TESTS([$1])
Packit 875988
])
Packit 875988
Packit 875988
AC_DEFUN([gl_SEARCH_H_DEFAULTS],
Packit 875988
[
Packit 875988
  GNULIB_TSEARCH=0; AC_SUBST([GNULIB_TSEARCH])
Packit 875988
  dnl Assume proper GNU behavior unless another module says otherwise.
Packit 875988
  HAVE_TSEARCH=1;    AC_SUBST([HAVE_TSEARCH])
Packit 875988
  REPLACE_TSEARCH=0; AC_SUBST([REPLACE_TSEARCH])
Packit 875988
])