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");
77 }], ac_cv_func_snprintf_c99=yes, ac_cv_func_snprintf_c99=no, ac_cv_func_snprintf_c99=no)])
78 dnl Note that the default is to be pessimistic in the case of cross compilation.
79 dnl If you know that the target has a C99 snprintf(), you can get around this
80 dnl by setting ac_func_snprintf_c99 to yes, as described in the Autoconf manual.
81 if test $ac_cv_func_snprintf_c99 = yes; then
82 AC_DEFINE(HAVE_C99_SNPRINTF, 1,
83 [Define if you have a version of the snprintf function
84 with semantics as specified by the ISO C99 standard.])
86 ])# AC_FUNC_SNPRINTF_C99
89 dnl @synopsis AC_FUNC_PRINTF_UNIX98
91 dnl Check whether the printf() family supports Unix98 %n$ positional parameters
93 AC_DEFUN([AC_FUNC_PRINTF_UNIX98],
94 [AC_CACHE_CHECK(whether printf supports positional parameters,
95 ac_cv_func_printf_unix98,
104 sprintf (buffer, "%2\$d %3\$d %1\$d", 1, 2, 3);
105 if (strcmp ("2 3 1", buffer) == 0)
108 }], ac_cv_func_printf_unix98=yes, ac_cv_func_printf_unix98=no, ac_cv_func_printf_unix98=no)])
109 dnl Note that the default is to be pessimistic in the case of cross compilation.
110 dnl If you know that the target printf() supports positional parameters, you can get around
111 dnl this by setting ac_func_printf_unix98 to yes, as described in the Autoconf manual.
112 if test $ac_cv_func_printf_unix98 = yes; then
113 AC_DEFINE(HAVE_UNIX98_PRINTF, 1,
114 [Define if your printf function family supports positional parameters
115 as specified by Unix98.])
117 ])# AC_FUNC_PRINTF_UNIX98
119 # Checks the location of the XML Catalog
121 # JH_PATH_XML_CATALOG
122 # Defines XMLCATALOG and XML_CATALOG_FILE substitutions
123 AC_DEFUN([JH_PATH_XML_CATALOG],
125 # check for the presence of the XML catalog
126 AC_ARG_WITH([xml-catalog],
127 AC_HELP_STRING([--with-xml-catalog=CATALOG],
128 [path to xml catalog to use]),,
129 [with_xml_catalog=/etc/xml/catalog])
130 XML_CATALOG_FILE="$with_xml_catalog"
131 AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
132 if test -f "$XML_CATALOG_FILE"; then
133 AC_MSG_RESULT([found])
135 AC_MSG_RESULT([not found])
136 AC_MSG_ERROR([XML catalog not found])
138 AC_SUBST([XML_CATALOG_FILE])
140 # check for the xmlcatalog program
141 AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
142 if test "x$XMLCATALOG" = xno; then
143 AC_MSG_ERROR([could not find xmlcatalog program])
147 # Checks if a particular URI appears in the XML catalog
149 # JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
150 AC_DEFUN([JH_CHECK_XML_CATALOG],
152 AC_REQUIRE([JH_PATH_XML_CATALOG])dnl
153 AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
154 if AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
155 AC_MSG_RESULT([found])
159 AC_MSG_RESULT([not found])
161 [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],
167 # signed.m4 serial 1 (gettext-0.10.40)
168 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
169 dnl This file is free software, distributed under the terms of the GNU
170 dnl General Public License. As a special exception to the GNU General
171 dnl Public License, this file may be distributed as part of a program
172 dnl that contains a configuration script generated by Autoconf, under
173 dnl the same distribution terms as the rest of that program.
175 dnl From Bruno Haible.
177 AC_DEFUN([bh_C_SIGNED],
179 AC_CACHE_CHECK([for signed], bh_cv_c_signed,
180 [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
181 if test $bh_cv_c_signed = no; then
183 [Define to empty if the C compiler doesn't support this keyword.])
188 # longlong.m4 serial 4
189 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
190 dnl This file is free software, distributed under the terms of the GNU
191 dnl General Public License. As a special exception to the GNU General
192 dnl Public License, this file may be distributed as part of a program
193 dnl that contains a configuration script generated by Autoconf, under
194 dnl the same distribution terms as the rest of that program.
196 dnl From Paul Eggert.
198 # Define HAVE_LONG_LONG if 'long long' works.
200 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
202 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
203 [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
204 [long long llmax = (long long) -1;
205 return ll << i | ll >> i | llmax / ll | llmax % ll;],
206 ac_cv_type_long_long=yes,
207 ac_cv_type_long_long=no)])
208 if test $ac_cv_type_long_long = yes; then
209 AC_DEFINE(HAVE_LONG_LONG, 1,
210 [Define if you have the 'long long' type.])
215 # longdouble.m4 serial 1 (gettext-0.11.6)
216 dnl Copyright (C) 2002 Free Software Foundation, Inc.
217 dnl This file is free software, distributed under the terms of the GNU
218 dnl General Public License. As a special exception to the GNU General
219 dnl Public License, this file may be distributed as part of a program
220 dnl that contains a configuration script generated by Autoconf, under
221 dnl the same distribution terms as the rest of that program.
223 dnl From Bruno Haible.
224 dnl Test whether the compiler supports the 'long double' type.
225 dnl Prerequisite: AC_PROG_CC
227 AC_DEFUN([gt_TYPE_LONGDOUBLE],
229 AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
230 [if test "$GCC" = yes; then
231 gt_cv_c_long_double=yes
234 /* The Stardent Vistra knows sizeof(long double), but does not support it. */
235 long double foo = 0.0;
236 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
237 int array [2*(sizeof(long double) >= sizeof(double)) - 1];
239 gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
241 if test $gt_cv_c_long_double = yes; then
242 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
248 # wchar_t.m4 serial 1 (gettext-0.11.6)
249 dnl Copyright (C) 2002 Free Software Foundation, Inc.
250 dnl This file is free software, distributed under the terms of the GNU
251 dnl General Public License. As a special exception to the GNU General
252 dnl Public License, this file may be distributed as part of a program
253 dnl that contains a configuration script generated by Autoconf, under
254 dnl the same distribution terms as the rest of that program.
256 dnl From Bruno Haible.
257 dnl Test whether <stddef.h> has the 'wchar_t' type.
258 dnl Prerequisite: AC_PROG_CC
260 AC_DEFUN([gt_TYPE_WCHAR_T],
262 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
263 [AC_TRY_COMPILE([#include <stddef.h>
264 wchar_t foo = (wchar_t)'\0';], ,
265 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
266 if test $gt_cv_c_wchar_t = yes; then
267 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
273 dnl Copyright (C) 2003 Free Software Foundation, Inc.
274 dnl This file is free software, distributed under the terms of the GNU
275 dnl General Public License. As a special exception to the GNU General
276 dnl Public License, this file may be distributed as part of a program
277 dnl that contains a configuration script generated by Autoconf, under
278 dnl the same distribution terms as the rest of that program.
280 dnl From Bruno Haible.
281 dnl Test whether <wchar.h> has the 'wint_t' type.
282 dnl Prerequisite: AC_PROG_CC
284 AC_DEFUN([gt_TYPE_WINT_T],
286 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
287 [AC_TRY_COMPILE([#include <wchar.h>
288 wint_t foo = (wchar_t)'\0';], ,
289 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
290 if test $gt_cv_c_wint_t = yes; then
291 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
296 # intmax_t.m4 serial 1
297 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
298 dnl This file is free software, distributed under the terms of the GNU
299 dnl General Public License. As a special exception to the GNU General
300 dnl Public License, this file may be distributed as part of a program
301 dnl that contains a configuration script generated by Autoconf, under
302 dnl the same distribution terms as the rest of that program.
304 dnl From Paul Eggert.
308 # Define intmax_t to 'long' or 'long long'
309 # if it is not already defined in <stdint.h> or <inttypes.h>.
311 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
313 dnl For simplicity, we assume that a header file defines 'intmax_t' if and
314 dnl only if it defines 'uintmax_t'.
315 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
316 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
317 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
318 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
319 test $ac_cv_type_long_long = yes \
320 && ac_type='long long' \
322 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
323 [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
325 AC_DEFINE(HAVE_INTMAX_T, 1,
326 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
330 dnl An alternative would be to explicitly test for 'intmax_t'.
332 AC_DEFUN([gt_AC_TYPE_INTMAX_T],
334 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
335 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
336 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
340 #if HAVE_STDINT_H_WITH_UINTMAX
343 #if HAVE_INTTYPES_H_WITH_UINTMAX
344 #include <inttypes.h>
346 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
347 if test $gt_cv_c_intmax_t = yes; then
348 AC_DEFINE(HAVE_INTMAX_T, 1,
349 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
351 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
352 test $ac_cv_type_long_long = yes \
353 && ac_type='long long' \
355 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
356 [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
361 # stdint_h.m4 serial 3 (gettext-0.11.6)
362 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
363 dnl This file is free software, distributed under the terms of the GNU
364 dnl General Public License. As a special exception to the GNU General
365 dnl Public License, this file may be distributed as part of a program
366 dnl that contains a configuration script generated by Autoconf, under
367 dnl the same distribution terms as the rest of that program.
369 dnl From Paul Eggert.
371 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
372 # doesn't clash with <sys/types.h>, and declares uintmax_t.
374 AC_DEFUN([jm_AC_HEADER_STDINT_H],
376 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
378 [#include <sys/types.h>
379 #include <stdint.h>],
380 [uintmax_t i = (uintmax_t) -1;],
381 jm_ac_cv_header_stdint_h=yes,
382 jm_ac_cv_header_stdint_h=no)])
383 if test $jm_ac_cv_header_stdint_h = yes; then
384 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
385 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
386 and declares uintmax_t. ])
391 # inttypes_h.m4 serial 5 (gettext-0.11.6)
392 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
393 dnl This file is free software, distributed under the terms of the GNU
394 dnl General Public License. As a special exception to the GNU General
395 dnl Public License, this file may be distributed as part of a program
396 dnl that contains a configuration script generated by Autoconf, under
397 dnl the same distribution terms as the rest of that program.
399 dnl From Paul Eggert.
401 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
402 # doesn't clash with <sys/types.h>, and declares uintmax_t.
404 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
406 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
408 [#include <sys/types.h>
409 #include <inttypes.h>],
410 [uintmax_t i = (uintmax_t) -1;],
411 jm_ac_cv_header_inttypes_h=yes,
412 jm_ac_cv_header_inttypes_h=no)])
413 if test $jm_ac_cv_header_inttypes_h = yes; then
414 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
415 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
416 and declares uintmax_t. ])