Blame SOURCES/libsodium-1.0.18/m4/ax_check_define.m4

ca16be
# ===========================================================================
ca16be
#     https://www.gnu.org/software/autoconf-archive/ax_check_define.html
ca16be
# ===========================================================================
ca16be
#
ca16be
# SYNOPSIS
ca16be
#
ca16be
#   AC_CHECK_DEFINE([symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
ca16be
#   AX_CHECK_DEFINE([includes],[symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
ca16be
#
ca16be
# DESCRIPTION
ca16be
#
ca16be
#   Complements AC_CHECK_FUNC but it does not check for a function but for a
ca16be
#   define to exist. Consider a usage like:
ca16be
#
ca16be
#    AC_CHECK_DEFINE(__STRICT_ANSI__, CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500")
ca16be
#
ca16be
# LICENSE
ca16be
#
ca16be
#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
ca16be
#
ca16be
#   This program is free software; you can redistribute it and/or modify it
ca16be
#   under the terms of the GNU General Public License as published by the
ca16be
#   Free Software Foundation; either version 3 of the License, or (at your
ca16be
#   option) any later version.
ca16be
#
ca16be
#   This program is distributed in the hope that it will be useful, but
ca16be
#   WITHOUT ANY WARRANTY; without even the implied warranty of
ca16be
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
ca16be
#   Public License for more details.
ca16be
#
ca16be
#   You should have received a copy of the GNU General Public License along
ca16be
#   with this program. If not, see <https://www.gnu.org/licenses/>.
ca16be
#
ca16be
#   As a special exception, the respective Autoconf Macro's copyright owner
ca16be
#   gives unlimited permission to copy, distribute and modify the configure
ca16be
#   scripts that are the output of Autoconf when processing the Macro. You
ca16be
#   need not follow the terms of the GNU General Public License when using
ca16be
#   or distributing such scripts, even though portions of the text of the
ca16be
#   Macro appear in them. The GNU General Public License (GPL) does govern
ca16be
#   all other use of the material that constitutes the Autoconf Macro.
ca16be
#
ca16be
#   This special exception to the GPL applies to versions of the Autoconf
ca16be
#   Macro released by the Autoconf Archive. When you make and distribute a
ca16be
#   modified version of the Autoconf Macro, you may extend this special
ca16be
#   exception to the GPL to apply to your modified version as well.
ca16be
ca16be
#serial 9
ca16be
ca16be
AU_ALIAS([AC_CHECK_DEFINED], [AC_CHECK_DEFINE])
ca16be
AC_DEFUN([AC_CHECK_DEFINE],[
ca16be
AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1])dnl
ca16be
AC_CACHE_CHECK([for $1 defined], ac_var,
ca16be
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
ca16be
  #ifdef $1
ca16be
  int ok;
ca16be
  #else
ca16be
  choke me
ca16be
  #endif
ca16be
]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
ca16be
AS_IF([test AS_VAR_GET(ac_var) != "no"], [$2], [$3])dnl
ca16be
AS_VAR_POPDEF([ac_var])dnl
ca16be
])
ca16be
ca16be
AU_ALIAS([AX_CHECK_DEFINED], [AX_CHECK_DEFINE])
ca16be
AC_DEFUN([AX_CHECK_DEFINE],[
ca16be
AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$2_$1])dnl
ca16be
AC_CACHE_CHECK([for $2 defined in $1], ac_var,
ca16be
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$1>]], [[
ca16be
  #ifdef $2
ca16be
  int ok;
ca16be
  #else
ca16be
  choke me
ca16be
  #endif
ca16be
]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
ca16be
AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl
ca16be
AS_VAR_POPDEF([ac_var])dnl
ca16be
])
ca16be
ca16be
AC_DEFUN([AX_CHECK_FUNC],
ca16be
[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$2])dnl
ca16be
AC_CACHE_CHECK([for $2], ac_var,
ca16be
dnl AC_LANG_FUNC_LINK_TRY
ca16be
[AC_LINK_IFELSE([AC_LANG_PROGRAM([$1
ca16be
                #undef $2
ca16be
                char $2 ();],[
ca16be
                char (*f) () = $2;
ca16be
                return f != $2; ])],
ca16be
                [AS_VAR_SET(ac_var, yes)],
ca16be
                [AS_VAR_SET(ac_var, no)])])
ca16be
AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl
ca16be
AS_VAR_POPDEF([ac_var])dnl
ca16be
])# AC_CHECK_FUNC