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