Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
3.0KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_symbol.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_SYMBOL(SYMBOL, HEADER... [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
  8. #
  9. # DESCRIPTION
  10. #
  11. # A wrapper around AC_EGREP_HEADER. The shellvar $ac_found will hold the
  12. # HEADER-name that had been containing the symbol. This value is shown to
  13. # the user.
  14. #
  15. # LICENSE
  16. #
  17. # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  18. #
  19. # This program is free software; you can redistribute it and/or modify it
  20. # under the terms of the GNU General Public License as published by the
  21. # Free Software Foundation; either version 3 of the License, or (at your
  22. # option) any later version.
  23. #
  24. # This program is distributed in the hope that it will be useful, but
  25. # WITHOUT ANY WARRANTY; without even the implied warranty of
  26. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  27. # Public License for more details.
  28. #
  29. # You should have received a copy of the GNU General Public License along
  30. # with this program. If not, see <https://www.gnu.org/licenses/>.
  31. #
  32. # As a special exception, the respective Autoconf Macro's copyright owner
  33. # gives unlimited permission to copy, distribute and modify the configure
  34. # scripts that are the output of Autoconf when processing the Macro. You
  35. # need not follow the terms of the GNU General Public License when using
  36. # or distributing such scripts, even though portions of the text of the
  37. # Macro appear in them. The GNU General Public License (GPL) does govern
  38. # all other use of the material that constitutes the Autoconf Macro.
  39. #
  40. # This special exception to the GPL applies to versions of the Autoconf
  41. # Macro released by the Autoconf Archive. When you make and distribute a
  42. # modified version of the Autoconf Macro, you may extend this special
  43. # exception to the GPL to apply to your modified version as well.
  44. #serial 6
  45. AU_ALIAS([AC_CHECK_SYMBOL], [AX_CHECK_SYMBOL])
  46. AC_DEFUN([AX_CHECK_SYMBOL],
  47. [AC_MSG_CHECKING([for $1 in $2])
  48. AC_CACHE_VAL(ac_cv_func_$1,
  49. [AC_REQUIRE_CPP()dnl
  50. changequote(, )dnl
  51. symbol="[^a-zA-Z_0-9]$1[^a-zA-Z_0-9]"
  52. changequote([, ])dnl
  53. ac_found=no
  54. for ac_header in $2 ; do
  55. ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%' `
  56. if test $ac_found != "yes" ; then
  57. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  58. AC_EGREP_HEADER( $symbol, $ac_header, [ac_found="$ac_header"] )
  59. fi
  60. fi
  61. done
  62. if test "$ac_found" != "no" ; then
  63. AC_MSG_RESULT($ac_found)
  64. ifelse([$3], , :, [$3])
  65. else
  66. AC_MSG_RESULT(no)
  67. ifelse([$4], , , [$4
  68. ])dnl
  69. fi
  70. ])])
  71. dnl AX_CHECK_SYMBOLS( symbol..., header... [, action-if-found [, action-if-not-found]])
  72. AC_DEFUN([AX_CHECK_SYMBOLS],
  73. [for ac_func in $1
  74. do
  75. P4_CHECK_SYMBOL($ac_func, $2,
  76. [changequote(, )dnl
  77. ac_tr_func=HAVE_`echo $ac_func | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:' -e 's:[[^A-Z0-9]]:_:'`
  78. changequote([, ])dnl
  79. AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl
  80. done
  81. ])