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.

64 lines
2.1KB

  1. # ============================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_auto_include_headers.html
  3. # ============================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_AUTO_INCLUDE_HEADERS(INCLUDE-FILE ...)
  8. #
  9. # DESCRIPTION
  10. #
  11. # Given a space-separated list of INCLUDE-FILEs, AX_AUTO_INCLUDE_HEADERS
  12. # will output a conditional #include for each INCLUDE-FILE. The following
  13. # example demonstrates how AX_AUTO_INCLUDE_HEADERS's might be used in a
  14. # configure.ac script:
  15. #
  16. # AH_BOTTOM([
  17. # AX_AUTO_INCLUDE_HEADERS([sys/resource.h invent.h sys/sysinfo.h])dnl
  18. # ])
  19. #
  20. # The preceding invocation instructs autoheader to put the following code
  21. # at the bottom of the config.h file:
  22. #
  23. # #ifdef HAVE_SYS_RESOURCE_H
  24. # # include <sys/resource.h>
  25. # #endif
  26. # #ifdef HAVE_INVENT_H
  27. # # include <invent.h>
  28. # #endif
  29. # #ifdef HAVE_SYS_SYSINFO_H
  30. # # include <sys/sysinfo.h>
  31. # #endif
  32. #
  33. # Note that AX_AUTO_INCLUDE_HEADERS merely outputs #ifdef/#include/#endif
  34. # blocks. The configure.ac script still needs to invoke AC_CHECK_HEADERS
  35. # to #define the various HAVE_*_H preprocessor macros.
  36. #
  37. # Here's an easy way to get from config.h a complete list of header files
  38. # who existence is tested by the configure script:
  39. #
  40. # cat config.h | perl -ane '/ HAVE_\S+_H / && do {$_=$F[$#F-1]; s/^HAVE_//; s/_H/.h/; s|_|/|g; tr/A-Z/a-z/; print "$_ "}'
  41. #
  42. # You can then manually edit the resulting list and incorporate it into
  43. # one or more calls to AX_AUTO_INCLUDE_HEADERS.
  44. #
  45. # LICENSE
  46. #
  47. # Copyright (c) 2008 Scott Pakin <pakin@uiuc.edu>
  48. #
  49. # Copying and distribution of this file, with or without modification, are
  50. # permitted in any medium without royalty provided the copyright notice
  51. # and this notice are preserved. This file is offered as-is, without any
  52. # warranty.
  53. #serial 9
  54. AC_DEFUN([AX_AUTO_INCLUDE_HEADERS], [dnl
  55. AC_FOREACH([AX_Header], [$1], [dnl
  56. m4_pushdef([AX_IfDef], AS_TR_CPP(HAVE_[]AX_Header))dnl
  57. [#]ifdef AX_IfDef
  58. [#] include <AX_Header>
  59. [#]endif
  60. m4_popdef([AX_IfDef])dnl
  61. ])])