diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 9f2d9e04..a72df1a5 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -126,6 +126,63 @@ AC_CHECK_HEADER([stdbool.h], | |||
126 | [AC_INCLUDES_DEFAULT] | 126 | [AC_INCLUDES_DEFAULT] |
127 | ) | 127 | ) |
128 | 128 | ||
129 | AC_CACHE_CHECK([[whether "true" is defined or builtin]], [[mhd_cv_macro_true_defined]], | ||
130 | [AC_COMPILE_IFELSE( | ||
131 | [AC_LANG_PROGRAM( | ||
132 | [[ | ||
133 | #ifdef HAVE_STDBOOL_H | ||
134 | #include <stdbool.h> | ||
135 | #endif | ||
136 | ]], [[ | ||
137 | #if defined(true) | ||
138 | /* dummy */ | ||
139 | #else | ||
140 | (void)true; | ||
141 | #endif | ||
142 | ]]) | ||
143 | ], [[mhd_cv_macro_true_defined='yes']], [[mhd_cv_macro_true_defined='no']]) | ||
144 | ]) | ||
145 | AS_VAR_IF([[mhd_cv_macro_true_defined]], [["yes"]], [[:]], | ||
146 | [AC_DEFINE([[true]],[[(!0)]], [Define to value interpreted by compiler as boolean "true", if "true" is not defined by system headers.])]) | ||
147 | |||
148 | AC_CACHE_CHECK([[whether "false" is defined or builtin]], [[mhd_cv_macro_false_defined]], | ||
149 | [AC_COMPILE_IFELSE( | ||
150 | [AC_LANG_PROGRAM( | ||
151 | [[ | ||
152 | #ifdef HAVE_STDBOOL_H | ||
153 | #include <stdbool.h> | ||
154 | #endif | ||
155 | ]], [[ | ||
156 | #if !defined(false) | ||
157 | (void)false; | ||
158 | #else | ||
159 | /* dummy */ | ||
160 | #endif | ||
161 | ]]) | ||
162 | ], [[mhd_cv_macro_false_defined='yes']], [[mhd_cv_macro_false_defined='no']]) | ||
163 | ]) | ||
164 | AS_VAR_IF([[mhd_cv_macro_false_defined]], [["yes"]], [[:]], | ||
165 | [AC_DEFINE([[false]],[[0]], [Define to value interpreted by compiler as boolean "false", if "false" is not defined by system headers.])]) | ||
166 | |||
167 | AC_CACHE_CHECK([[whether "true" and "false" could be used]], [[mhd_cv_macro_true_false_valid]], | ||
168 | [AC_COMPILE_IFELSE( | ||
169 | [AC_LANG_PROGRAM( | ||
170 | [[ | ||
171 | #ifdef HAVE_STDBOOL_H | ||
172 | #include <stdbool.h> | ||
173 | #endif | ||
174 | ]], [[ | ||
175 | int var1[true ? 1 : -1] = { 1 }; | ||
176 | int var2[false ? -1 : 1] = { 2 }; | ||
177 | if (var1[0] == var2[0]) | ||
178 | return 1; | ||
179 | ]]) | ||
180 | ], [[mhd_cv_macro_true_false_valid='yes']], [[mhd_cv_macro_true_false_valid='no']]) | ||
181 | ]) | ||
182 | AS_VAR_IF([[mhd_cv_macro_true_false_valid]], [["yes"]], [[:]], | ||
183 | [AC_MSG_ERROR([[Value of "true" or value of "false" is not valid. Check config.log for details.]])]) | ||
184 | |||
185 | |||
129 | AX_CHECK_COMPILE_FLAG([[-Werror=attributes]], | 186 | AX_CHECK_COMPILE_FLAG([[-Werror=attributes]], |
130 | [[errattr_CFLAGS="-Werror=attributes"]], | 187 | [[errattr_CFLAGS="-Werror=attributes"]], |
131 | [[errattr_CFLAGS=""]], [], []) | 188 | [[errattr_CFLAGS=""]], [], []) |