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