curl-override.m4 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at https://curl.se/docs/copyright.html.
  13. #
  14. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. # copies of the Software, and permit persons to whom the Software is
  16. # furnished to do so, under the terms of the COPYING file.
  17. #
  18. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. # KIND, either express or implied.
  20. #
  21. ###########################################################################
  22. #***************************************************************************
  23. #***************************************************************************
  24. # File version for 'aclocal' use. Keep it a single number.
  25. # serial 7
  26. dnl CURL_OVERRIDE_AUTOCONF
  27. dnl -------------------------------------------------
  28. dnl Placing a call to this macro in configure.ac after
  29. dnl the one to AC_INIT will make macros in this file
  30. dnl visible to the rest of the compilation overriding
  31. dnl those from Autoconf.
  32. AC_DEFUN([CURL_OVERRIDE_AUTOCONF], [
  33. AC_BEFORE([$0],[AC_PROG_LIBTOOL])
  34. # using curl-override.m4
  35. ])
  36. dnl Override Autoconf's AC_LANG_PROGRAM (C)
  37. dnl -------------------------------------------------
  38. dnl This is done to prevent compiler warning
  39. dnl 'function declaration isn't a prototype'
  40. dnl in function main. This requires at least
  41. dnl a c89 compiler and does not support K&R.
  42. m4_define([AC_LANG_PROGRAM(C)],
  43. [$1
  44. int main (void)
  45. {
  46. $2
  47. ;
  48. return 0;
  49. }])
  50. dnl Override Autoconf's AC_LANG_CALL (C)
  51. dnl -------------------------------------------------
  52. dnl This is a backport of Autoconf's 2.60 with the
  53. dnl embedded comments that hit the resulting script
  54. dnl removed. This is done to reduce configure size
  55. dnl and use fixed macro across Autoconf versions.
  56. m4_define([AC_LANG_CALL(C)],
  57. [AC_LANG_PROGRAM([$1
  58. m4_if([$2], [main], ,
  59. [
  60. #ifdef __cplusplus
  61. extern "C"
  62. #endif
  63. char $2 ();])], [return $2 ();])])
  64. dnl Override Autoconf's AC_LANG_FUNC_LINK_TRY (C)
  65. dnl -------------------------------------------------
  66. dnl This is a backport of Autoconf's 2.60 with the
  67. dnl embedded comments that hit the resulting script
  68. dnl removed. This is done to reduce configure size
  69. dnl and use fixed macro across Autoconf versions.
  70. m4_define([AC_LANG_FUNC_LINK_TRY(C)],
  71. [AC_LANG_PROGRAM(
  72. [
  73. #define $1 innocuous_$1
  74. #ifdef __STDC__
  75. # include <limits.h>
  76. #else
  77. # include <assert.h>
  78. #endif
  79. #undef $1
  80. #ifdef __cplusplus
  81. extern "C"
  82. #endif
  83. char $1 ();
  84. #if defined __stub_$1 || defined __stub___$1
  85. choke me
  86. #endif
  87. ], [return $1 ();])])