1 dnl @synopsis AC_FUNC_VSNPRINTF_C99
3 dnl Check whether there is a vsnprintf() function with C99 semantics installed.
5 AC_DEFUN([AC_FUNC_VSNPRINTF_C99],
6 [AC_CACHE_CHECK(for C99 vsnprintf,
7 ac_cv_func_vsnprintf_c99,
20 r = vsnprintf(buffer, 5, s, args);
34 }], ac_cv_func_vsnprintf_c99=yes, ac_cv_func_vsnprintf_c99=no, ac_cv_func_vsnprintf_c99=no)])
35 dnl Note that the default is to be pessimistic in the case of cross compilation.
36 dnl If you know that the target has a C99 vsnprintf(), you can get around this
37 dnl by setting ac_func_vsnprintf_c99 to yes, as described in the Autoconf manual.
38 if test $ac_cv_func_vsnprintf_c99 = yes; then
39 AC_DEFINE(HAVE_C99_VSNPRINTF, 1,
40 [Define if you have a version of the vsnprintf function
41 with semantics as specified by the ISO C99 standard.])
43 ])# AC_FUNC_VSNPRINTF_C99
46 dnl @synopsis AC_FUNC_SNPRINTF_C99
48 dnl Check whether there is a snprintf() function with C99 semantics installed.
50 AC_DEFUN([AC_FUNC_SNPRINTF_C99],
51 [AC_CACHE_CHECK(for C99 snprintf,
52 ac_cv_func_snprintf_c99,
64 r = snprintf(buffer, 5, "1234567");
69 r = snprintf(buffer, 0, "1234567");
74 r = snprintf(NULL, 0, "1234567");
87 }], ac_cv_func_snprintf_c99=yes, ac_cv_func_snprintf_c99=no, ac_cv_func_snprintf_c99=no)])
88 dnl Note that the default is to be pessimistic in the case of cross compilation.
89 dnl If you know that the target has a C99 snprintf(), you can get around this
90 dnl by setting ac_func_snprintf_c99 to yes, as described in the Autoconf manual.
91 if test $ac_cv_func_snprintf_c99 = yes; then
92 AC_DEFINE(HAVE_C99_SNPRINTF, 1,
93 [Define if you have a version of the snprintf function
94 with semantics as specified by the ISO C99 standard.])
96 ])# AC_FUNC_SNPRINTF_C99
99 dnl @synopsis AC_FUNC_PRINTF_UNIX98
101 dnl Check whether the printf() family supports Unix98 %n$ positional parameters
103 AC_DEFUN([AC_FUNC_PRINTF_UNIX98],
104 [AC_CACHE_CHECK(whether printf supports positional parameters,
105 ac_cv_func_printf_unix98,
114 sprintf (buffer, "%2\$d %3\$d %1\$d", 1, 2, 3);
115 if (strcmp ("2 3 1", buffer) == 0)
118 }], ac_cv_func_printf_unix98=yes, ac_cv_func_printf_unix98=no, ac_cv_func_printf_unix98=no)])
119 dnl Note that the default is to be pessimistic in the case of cross compilation.
120 dnl If you know that the target printf() supports positional parameters, you can get around
121 dnl this by setting ac_func_printf_unix98 to yes, as described in the Autoconf manual.
122 if test $ac_cv_func_printf_unix98 = yes; then
123 AC_DEFINE(HAVE_UNIX98_PRINTF, 1,
124 [Define if your printf function family supports positional parameters
125 as specified by Unix98.])
127 ])# AC_FUNC_PRINTF_UNIX98
129 # Checks if a particular URI appears in the XML catalog
131 # JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
132 AC_DEFUN([JH_CHECK_XML_CATALOG],
134 AC_ARG_WITH([xml-catalog],
135 AC_HELP_STRING([--with-xml-catalog=CATALOG],
136 [path to xml catalog to use]),,
137 [with_xml_catalog=/etc/xml/catalog])
138 XML_CATALOG_FILE="$with_xml_catalog"
139 AC_PATH_PROG(XMLCATALOG, xmlcatalog, /bin/false)
140 AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
141 if AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
142 AC_MSG_RESULT([found])
146 AC_MSG_RESULT([not found])
148 [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],
154 # signed.m4 serial 1 (gettext-0.10.40)
155 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
156 dnl This file is free software, distributed under the terms of the GNU
157 dnl General Public License. As a special exception to the GNU General
158 dnl Public License, this file may be distributed as part of a program
159 dnl that contains a configuration script generated by Autoconf, under
160 dnl the same distribution terms as the rest of that program.
162 dnl From Bruno Haible.
164 AC_DEFUN([bh_C_SIGNED],
166 AC_CACHE_CHECK([for signed], bh_cv_c_signed,
167 [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
168 if test $bh_cv_c_signed = no; then
170 [Define to empty if the C compiler doesn't support this keyword.])
175 # longlong.m4 serial 4
176 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
177 dnl This file is free software, distributed under the terms of the GNU
178 dnl General Public License. As a special exception to the GNU General
179 dnl Public License, this file may be distributed as part of a program
180 dnl that contains a configuration script generated by Autoconf, under
181 dnl the same distribution terms as the rest of that program.
183 dnl From Paul Eggert.
185 # Define HAVE_LONG_LONG if 'long long' works.
187 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
189 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
190 [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
191 [long long llmax = (long long) -1;
192 return ll << i | ll >> i | llmax / ll | llmax % ll;],
193 ac_cv_type_long_long=yes,
194 ac_cv_type_long_long=no)])
195 if test $ac_cv_type_long_long = yes; then
196 AC_DEFINE(HAVE_LONG_LONG, 1,
197 [Define if you have the 'long long' type.])
202 # longdouble.m4 serial 1 (gettext-0.11.6)
203 dnl Copyright (C) 2002 Free Software Foundation, Inc.
204 dnl This file is free software, distributed under the terms of the GNU
205 dnl General Public License. As a special exception to the GNU General
206 dnl Public License, this file may be distributed as part of a program
207 dnl that contains a configuration script generated by Autoconf, under
208 dnl the same distribution terms as the rest of that program.
210 dnl From Bruno Haible.
211 dnl Test whether the compiler supports the 'long double' type.
212 dnl Prerequisite: AC_PROG_CC
214 AC_DEFUN([gt_TYPE_LONGDOUBLE],
216 AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
217 [if test "$GCC" = yes; then
218 gt_cv_c_long_double=yes
221 /* The Stardent Vistra knows sizeof(long double), but does not support it. */
222 long double foo = 0.0;
223 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
224 int array [2*(sizeof(long double) >= sizeof(double)) - 1];
226 gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
228 if test $gt_cv_c_long_double = yes; then
229 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
235 # wchar_t.m4 serial 1 (gettext-0.11.6)
236 dnl Copyright (C) 2002 Free Software Foundation, Inc.
237 dnl This file is free software, distributed under the terms of the GNU
238 dnl General Public License. As a special exception to the GNU General
239 dnl Public License, this file may be distributed as part of a program
240 dnl that contains a configuration script generated by Autoconf, under
241 dnl the same distribution terms as the rest of that program.
243 dnl From Bruno Haible.
244 dnl Test whether <stddef.h> has the 'wchar_t' type.
245 dnl Prerequisite: AC_PROG_CC
247 AC_DEFUN([gt_TYPE_WCHAR_T],
249 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
250 [AC_TRY_COMPILE([#include <stddef.h>
251 wchar_t foo = (wchar_t)'\0';], ,
252 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
253 if test $gt_cv_c_wchar_t = yes; then
254 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
260 dnl Copyright (C) 2003 Free Software Foundation, Inc.
261 dnl This file is free software, distributed under the terms of the GNU
262 dnl General Public License. As a special exception to the GNU General
263 dnl Public License, this file may be distributed as part of a program
264 dnl that contains a configuration script generated by Autoconf, under
265 dnl the same distribution terms as the rest of that program.
267 dnl From Bruno Haible.
268 dnl Test whether <wchar.h> has the 'wint_t' type.
269 dnl Prerequisite: AC_PROG_CC
271 AC_DEFUN([gt_TYPE_WINT_T],
273 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
274 [AC_TRY_COMPILE([#include <wchar.h>
275 wint_t foo = (wchar_t)'\0';], ,
276 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
277 if test $gt_cv_c_wint_t = yes; then
278 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
283 # intmax_t.m4 serial 1
284 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
285 dnl This file is free software, distributed under the terms of the GNU
286 dnl General Public License. As a special exception to the GNU General
287 dnl Public License, this file may be distributed as part of a program
288 dnl that contains a configuration script generated by Autoconf, under
289 dnl the same distribution terms as the rest of that program.
291 dnl From Paul Eggert.
295 # Define intmax_t to 'long' or 'long long'
296 # if it is not already defined in <stdint.h> or <inttypes.h>.
298 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
300 dnl For simplicity, we assume that a header file defines 'intmax_t' if and
301 dnl only if it defines 'uintmax_t'.
302 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
303 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
304 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
305 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
306 test $ac_cv_type_long_long = yes \
307 && ac_type='long long' \
309 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
310 [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
312 AC_DEFINE(HAVE_INTMAX_T, 1,
313 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
317 dnl An alternative would be to explicitly test for 'intmax_t'.
319 AC_DEFUN([gt_AC_TYPE_INTMAX_T],
321 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
322 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
323 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
327 #if HAVE_STDINT_H_WITH_UINTMAX
330 #if HAVE_INTTYPES_H_WITH_UINTMAX
331 #include <inttypes.h>
333 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
334 if test $gt_cv_c_intmax_t = yes; then
335 AC_DEFINE(HAVE_INTMAX_T, 1,
336 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
338 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
339 test $ac_cv_type_long_long = yes \
340 && ac_type='long long' \
342 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
343 [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
348 # stdint_h.m4 serial 3 (gettext-0.11.6)
349 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
350 dnl This file is free software, distributed under the terms of the GNU
351 dnl General Public License. As a special exception to the GNU General
352 dnl Public License, this file may be distributed as part of a program
353 dnl that contains a configuration script generated by Autoconf, under
354 dnl the same distribution terms as the rest of that program.
356 dnl From Paul Eggert.
358 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
359 # doesn't clash with <sys/types.h>, and declares uintmax_t.
361 AC_DEFUN([jm_AC_HEADER_STDINT_H],
363 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
365 [#include <sys/types.h>
366 #include <stdint.h>],
367 [uintmax_t i = (uintmax_t) -1;],
368 jm_ac_cv_header_stdint_h=yes,
369 jm_ac_cv_header_stdint_h=no)])
370 if test $jm_ac_cv_header_stdint_h = yes; then
371 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
372 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
373 and declares uintmax_t. ])
378 # inttypes_h.m4 serial 5 (gettext-0.11.6)
379 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
380 dnl This file is free software, distributed under the terms of the GNU
381 dnl General Public License. As a special exception to the GNU General
382 dnl Public License, this file may be distributed as part of a program
383 dnl that contains a configuration script generated by Autoconf, under
384 dnl the same distribution terms as the rest of that program.
386 dnl From Paul Eggert.
388 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
389 # doesn't clash with <sys/types.h>, and declares uintmax_t.
391 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
393 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
395 [#include <sys/types.h>
396 #include <inttypes.h>],
397 [uintmax_t i = (uintmax_t) -1;],
398 jm_ac_cv_header_inttypes_h=yes,
399 jm_ac_cv_header_inttypes_h=no)])
400 if test $jm_ac_cv_header_inttypes_h = yes; then
401 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
402 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
403 and declares uintmax_t. ])