xc-am-iface.m4 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #---------------------------------------------------------------------------
  2. #
  3. # xc-am-iface.m4
  4. #
  5. # Copyright (C) Daniel Stenberg <daniel@haxx.se>
  6. #
  7. # Permission to use, copy, modify, and distribute this software for any
  8. # purpose with or without fee is hereby granted, provided that the above
  9. # copyright notice and this permission notice appear in all copies.
  10. #
  11. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  12. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  13. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  14. # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  15. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  16. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  17. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  18. #
  19. # SPDX-License-Identifier: ISC
  20. #
  21. #---------------------------------------------------------------------------
  22. # serial 1
  23. dnl _XC_AUTOMAKE_BODY
  24. dnl -------------------------------------------------
  25. dnl Private macro.
  26. dnl
  27. dnl This macro performs embedding of automake initialization
  28. dnl code into configure script. When automake version 1.14 or
  29. dnl newer is used at configure script generation time, this
  30. dnl results in 'subdir-objects' automake option being used.
  31. dnl When using automake versions older than 1.14 this option
  32. dnl is not used when generating configure script.
  33. dnl
  34. dnl Existence of automake _AM_PROG_CC_C_O m4 private macro
  35. dnl is used to differentiate automake version 1.14 from older
  36. dnl ones which lack this macro.
  37. m4_define([_XC_AUTOMAKE_BODY],
  38. [dnl
  39. ## --------------------------------------- ##
  40. ## Start of automake initialization code ##
  41. ## --------------------------------------- ##
  42. m4_ifdef([_AM_PROG_CC_C_O],
  43. [
  44. AM_INIT_AUTOMAKE([subdir-objects])
  45. ],[
  46. AM_INIT_AUTOMAKE
  47. ])dnl
  48. ## ------------------------------------- ##
  49. ## End of automake initialization code ##
  50. ## ------------------------------------- ##
  51. dnl
  52. m4_define([$0], [])[]dnl
  53. ])
  54. dnl XC_AUTOMAKE
  55. dnl -------------------------------------------------
  56. dnl Public macro.
  57. dnl
  58. dnl This macro embeds automake machinery into configure
  59. dnl script regardless of automake version used in order
  60. dnl to generate configure script.
  61. dnl
  62. dnl When using automake version 1.14 or newer, automake
  63. dnl initialization option 'subdir-objects' is used to
  64. dnl generate the configure script, otherwise this option
  65. dnl is not used.
  66. AC_DEFUN([XC_AUTOMAKE],
  67. [dnl
  68. AC_PREREQ([2.50])dnl
  69. dnl
  70. AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
  71. dnl
  72. _XC_AUTOMAKE_BODY
  73. dnl
  74. m4_ifdef([AM_INIT_AUTOMAKE],
  75. [m4_undefine([AM_INIT_AUTOMAKE])])dnl
  76. dnl
  77. m4_define([$0], [])[]dnl
  78. ])