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.

59 lines
2.1KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_ext_check_header.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_EXT_CHECK_HEADER(<header>, <paths>).
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check for <header> with -I<path> for each path in <paths> if need be.
  12. # The first sucecssful path is chosen (eg if you say
  13. # AX_EXT_CHECK_HEADER(foo.h, bar baz qux) and -Ibaz works then -Iqux will
  14. # not be tested.
  15. #
  16. # Any -I flags that locate a header are added to CFLAGS and CPPFLAGS. AS
  17. # with AC_CHECK_HEADERS it causes HAVE_<header>_H to be defined as 1.
  18. #
  19. # Example:
  20. #
  21. # AX_EXT_HAVE_HEADER(openssl/rsa.h, /usr/local/include /usr/local/ssl/include /usr/local/openssl/include)
  22. #
  23. # LICENSE
  24. #
  25. # Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
  26. #
  27. # Copying and distribution of this file, with or without modification, are
  28. # permitted in any medium without royalty provided the copyright notice
  29. # and this notice are preserved. This file is offered as-is, without any
  30. # warranty.
  31. #serial 8
  32. AC_DEFUN([AX_EXT_HAVE_HEADER],
  33. [AC_LANG_PUSH(C)
  34. AC_CHECK_HEADER($1, [$3 got="yes"], [$4 got="no"], $5)
  35. hdr=`echo $1 | $as_tr_sh`
  36. for dir in $2; do
  37. if test "x${got}" = "xno"; then
  38. ext_hashdr_cvdir=`echo $dir | $as_tr_sh`
  39. AC_CACHE_CHECK([for $1 library with -I$dir],
  40. [ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}],
  41. [ext_have_hdr_save_cflags=${CFLAGS}
  42. CFLAGS="${CFLAGS} -I${dir}"
  43. AC_COMPILE_IFELSE(
  44. [AC_LANG_PROGRAM([#inc[]lude <$1>])],
  45. [got="yes"; eval "ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}"="yes"],
  46. [got="no"; eval "ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}"="no"])
  47. CFLAGS=$ext_have_hdr_save_cflags])
  48. if eval `echo 'test x${'ext_cv${ext_hashdr_cvdir}_hashdr_${hdr}'}' = "xyes"`; then
  49. CFLAGS="${CFLAGS} -I${dir}"
  50. CPPFLAGS="${CPPFLAGS} -I${dir}"
  51. got="yes";
  52. hdr=`echo $1 | $as_tr_cpp`
  53. AC_DEFINE_UNQUOTED(HAVE_${hdr}, 1,
  54. [Define this if you have the $1 header])
  55. fi; fi; done
  56. AC_LANG_POP])