curl-override.m4 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 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. # SPDX-License-Identifier: curl
  22. #
  23. ###########################################################################
  24. #***************************************************************************
  25. #***************************************************************************
  26. # File version for 'aclocal' use. Keep it a single number.
  27. # serial 7
  28. dnl CURL_OVERRIDE_AUTOCONF
  29. dnl -------------------------------------------------
  30. dnl Placing a call to this macro in configure.ac after
  31. dnl the one to AC_INIT will make macros in this file
  32. dnl visible to the rest of the compilation overriding
  33. dnl those from Autoconf.
  34. AC_DEFUN([CURL_OVERRIDE_AUTOCONF], [
  35. AC_BEFORE([$0],[AC_PROG_LIBTOOL])
  36. # using curl-override.m4
  37. ])
  38. dnl Override Autoconf's AC_LANG_PROGRAM (C)
  39. dnl -------------------------------------------------
  40. dnl This is done to prevent compiler warning
  41. dnl 'function declaration isn't a prototype'
  42. dnl in function main. This requires at least
  43. dnl a c89 compiler and does not support K&R.
  44. m4_define([AC_LANG_PROGRAM(C)],
  45. [$1
  46. int main (void)
  47. {
  48. $2
  49. ;
  50. return 0;
  51. }])
  52. dnl Override Autoconf's AC_LANG_CALL (C)
  53. dnl -------------------------------------------------
  54. dnl This is a backport of Autoconf's 2.60 with the
  55. dnl embedded comments that hit the resulting script
  56. dnl removed. This is done to reduce configure size
  57. dnl and use fixed macro across Autoconf versions.
  58. m4_define([AC_LANG_CALL(C)],
  59. [AC_LANG_PROGRAM([$1
  60. m4_if([$2], [main], ,
  61. [
  62. #ifdef __cplusplus
  63. extern "C"
  64. #endif
  65. char $2 ();])], [return $2 ();])])
  66. dnl Override Autoconf's AC_LANG_FUNC_LINK_TRY (C)
  67. dnl -------------------------------------------------
  68. dnl This is a backport of Autoconf's 2.60 with the
  69. dnl embedded comments that hit the resulting script
  70. dnl removed. This is done to reduce configure size
  71. dnl and use fixed macro across Autoconf versions.
  72. m4_define([AC_LANG_FUNC_LINK_TRY(C)],
  73. [AC_LANG_PROGRAM(
  74. [
  75. #define $1 innocuous_$1
  76. #ifdef __STDC__
  77. # include <limits.h>
  78. #else
  79. # include <assert.h>
  80. #endif
  81. #undef $1
  82. #ifdef __cplusplus
  83. extern "C"
  84. #endif
  85. char $1 ();
  86. #if defined __stub_$1 || defined __stub___$1
  87. choke me
  88. #endif
  89. ], [return $1 ();])])