diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index a2d522a5..ba798e0c 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -86,6 +86,60 @@ MHD_LIBDEPS="" | |||
86 | MHD_REQ_PRIVATE='' | 86 | MHD_REQ_PRIVATE='' |
87 | MHD_LIBDEPS_PKGCFG='' | 87 | MHD_LIBDEPS_PKGCFG='' |
88 | 88 | ||
89 | AC_CHECK_TYPE([_Bool], | ||
90 | [ AC_DEFINE([_MHD_bool],[_Bool],[Define to type which will be used as boolean type.]) ], | ||
91 | [ | ||
92 | AC_CHECK_HEADER([stdbool.h], [ AC_DEFINE([HAVE_STDBOOL_H],[1],[Define to 1 if you have the <stdbool.h> header file and it's required for _MHD_bool.]) ]) | ||
93 | AC_CHECK_TYPE([bool], | ||
94 | [ AC_DEFINE([_MHD_bool],[bool]) ], | ||
95 | [ AC_DEFINE([_MHD_bool],[int]) ], | ||
96 | [[ | ||
97 | #ifdef HAVE_STDBOOL_H | ||
98 | #include <stdbool.h> | ||
99 | #endif | ||
100 | ]]) | ||
101 | ]) | ||
102 | |||
103 | AC_MSG_CHECKING([[for function inline keywords suppoted by $CC]]) | ||
104 | save_CFLAGS="$CFLAGS" | ||
105 | AX_APPEND_FLAG([[-Werror=attributes]]) | ||
106 | inln_prfx="none" | ||
107 | # Prefer always inline functions | ||
108 | for inln_prfx_chk in "inline __attribute__((always_inline))" __forceinline inline __inline__ __inline _inline _Inline; do | ||
109 | # Try to link to avoid "symbol undefined" problems at build time | ||
110 | AC_LINK_IFELSE( | ||
111 | [ | ||
112 | AC_LANG_PROGRAM( | ||
113 | [[ | ||
114 | #ifdef __cplusplus | ||
115 | choke me | ||
116 | #endif | ||
117 | #ifdef HAVE_STDBOOL_H | ||
118 | #include <stdbool.h> | ||
119 | #endif | ||
120 | static $inln_prfx_chk _MHD_bool cmpfn(int x, int y) | ||
121 | { return x > y; } | ||
122 | static $inln_prfx_chk int sumfn(int x, int y) | ||
123 | { return x + y; } | ||
124 | ]],[[ | ||
125 | int a = 1, b = 100, c; | ||
126 | if (cmpfn(a, b)) | ||
127 | c = sumfn(a, b); | ||
128 | else | ||
129 | c = 0 - sumfn(a, b); | ||
130 | ]]) | ||
131 | ], | ||
132 | [[ inln_prfx="$inln_prfx_chk" ]]) | ||
133 | test "x$inln_prfx" != "xnone" && break | ||
134 | done | ||
135 | AS_IF([[test "x$ac_cv_c_inline" != "xnone"]], | ||
136 | [ | ||
137 | AC_DEFINE([INLINE_FUNC],[1],[Define to 1 if your C compiler supports inline functions.]) | ||
138 | AC_DEFINE_UNQUOTED([_MHD_inline],[static $inln_prfx],[Define to prefix which will be used with MHD inline functions.]) | ||
139 | ]) | ||
140 | AC_MSG_RESULT([[$inln_prfx]]) | ||
141 | CFLAGS="$save_CFLAGS" | ||
142 | |||
89 | # Check system type | 143 | # Check system type |
90 | AC_MSG_CHECKING([[for target host OS]]) | 144 | AC_MSG_CHECKING([[for target host OS]]) |
91 | case "$host_os" in | 145 | case "$host_os" in |