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_PRINTF_UNIX98
48 dnl Check whether the printf() family supports Unix98 %n$ positional parameters
50 AC_DEFUN([AC_FUNC_PRINTF_UNIX98],
51 [AC_CACHE_CHECK(whether printf supports positional parameters,
52 ac_cv_func_printf_unix98,
61 sprintf (buffer, "%2\$d %3\$d %1\$d", 1, 2, 3);
62 if (strcmp ("2 3 1", buffer) == 0)
65 }], ac_cv_func_printf_unix98=yes, ac_cv_func_printf_unix98=no, ac_cv_func_printf_unix98=no)])
66 dnl Note that the default is to be pessimistic in the case of cross compilation.
67 dnl If you know that the target printf() supports positional parameters, you can get around
68 dnl this by setting ac_func_printf_unix98 to yes, as described in the Autoconf manual.
69 if test $ac_cv_func_printf_unix98 = yes; then
70 AC_DEFINE(HAVE_UNIX98_PRINTF, 1,
71 [Define if your printf function family supports positional parameters
72 as specified by Unix98.])
74 ])# AC_FUNC_PRINTF_UNIX98
76 # Checks the location of the XML Catalog
79 # Defines XMLCATALOG and XML_CATALOG_FILE substitutions
80 AC_DEFUN([JH_PATH_XML_CATALOG],
82 # check for the presence of the XML catalog
83 AC_ARG_WITH([xml-catalog],
84 AC_HELP_STRING([--with-xml-catalog=CATALOG],
85 [path to xml catalog to use]),,
86 [with_xml_catalog=/etc/xml/catalog])
87 XML_CATALOG_FILE="$with_xml_catalog"
88 AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
89 if test -f "$XML_CATALOG_FILE"; then
90 AC_MSG_RESULT([found])
92 AC_MSG_RESULT([not found])
93 AC_MSG_ERROR([XML catalog not found])
95 AC_SUBST([XML_CATALOG_FILE])
97 # check for the xmlcatalog program
98 AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
99 if test "x$XMLCATALOG" = xno; then
100 AC_MSG_ERROR([could not find xmlcatalog program])
104 # Checks if a particular URI appears in the XML catalog
106 # JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
107 AC_DEFUN([JH_CHECK_XML_CATALOG],
109 AC_REQUIRE([JH_PATH_XML_CATALOG])dnl
110 AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
111 if AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
112 AC_MSG_RESULT([found])
116 AC_MSG_RESULT([not found])
118 [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],