curl-override.m4 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #***************************************************************************
  2. #***************************************************************************
  3. # File version for 'aclocal' use. Keep it a single number.
  4. # serial 7
  5. dnl CURL_OVERRIDE_AUTOCONF
  6. dnl -------------------------------------------------
  7. dnl Placing a call to this macro in configure.ac after
  8. dnl the one to AC_INIT will make macros in this file
  9. dnl visible to the rest of the compilation overriding
  10. dnl those from Autoconf.
  11. AC_DEFUN([CURL_OVERRIDE_AUTOCONF], [
  12. AC_BEFORE([$0],[AC_PROG_LIBTOOL])
  13. # using curl-override.m4
  14. ])
  15. dnl Override Autoconf's AC_LANG_PROGRAM (C)
  16. dnl -------------------------------------------------
  17. dnl This is done to prevent compiler warning
  18. dnl 'function declaration isn't a prototype'
  19. dnl in function main. This requires at least
  20. dnl a c89 compiler and does not support K&R.
  21. m4_define([AC_LANG_PROGRAM(C)],
  22. [$1
  23. int main (void)
  24. {
  25. $2
  26. ;
  27. return 0;
  28. }])
  29. dnl Override Autoconf's AC_LANG_CALL (C)
  30. dnl -------------------------------------------------
  31. dnl This is a backport of Autoconf's 2.60 with the
  32. dnl embedded comments that hit the resulting script
  33. dnl removed. This is done to reduce configure size
  34. dnl and use fixed macro across Autoconf versions.
  35. m4_define([AC_LANG_CALL(C)],
  36. [AC_LANG_PROGRAM([$1
  37. m4_if([$2], [main], ,
  38. [
  39. #ifdef __cplusplus
  40. extern "C"
  41. #endif
  42. char $2 ();])], [return $2 ();])])
  43. dnl Override Autoconf's AC_LANG_FUNC_LINK_TRY (C)
  44. dnl -------------------------------------------------
  45. dnl This is a backport of Autoconf's 2.60 with the
  46. dnl embedded comments that hit the resulting script
  47. dnl removed. This is done to reduce configure size
  48. dnl and use fixed macro across Autoconf versions.
  49. m4_define([AC_LANG_FUNC_LINK_TRY(C)],
  50. [AC_LANG_PROGRAM(
  51. [
  52. #define $1 innocuous_$1
  53. #ifdef __STDC__
  54. # include <limits.h>
  55. #else
  56. # include <assert.h>
  57. #endif
  58. #undef $1
  59. #ifdef __cplusplus
  60. extern "C"
  61. #endif
  62. char $1 ();
  63. #if defined __stub_$1 || defined __stub___$1
  64. choke me
  65. #endif
  66. ], [return $1 ();])])