X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=acinclude.m4;h=cac7f218af87907aa481b590d6796e8384aea22a;hb=2e5bd8cf47f9e1559ccc44823a2f321b8ff8c1ea;hp=4d0180163bb0b63c6041b37d9f2503424e0f6bcf;hpb=4d2921959eb1c3c44809089d238cdc831c746ab2;p=platform%2Fupstream%2Fglib.git diff --git a/acinclude.m4 b/acinclude.m4 index 4d01801..cac7f21 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -23,6 +23,16 @@ doit(char * s, ...) if (r != 7) exit(1); + /* AIX 5.1 and Solaris seems to have a half-baked vsnprintf() + implementation. The above will return 7 but if you replace + the size of the buffer with 0, it borks! */ + va_start(args, s); + r = vsnprintf(buffer, 0, s, args); + va_end(args); + + if (r != 7) + exit(1); + exit(0); } @@ -126,19 +136,50 @@ if test $ac_cv_func_printf_unix98 = yes; then fi ])# AC_FUNC_PRINTF_UNIX98 +# Checks the location of the XML Catalog +# Usage: +# JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# Defines XMLCATALOG and XML_CATALOG_FILE substitutions +AC_DEFUN([JH_PATH_XML_CATALOG], +[ + # check for the presence of the XML catalog + AC_ARG_WITH([xml-catalog], + AC_HELP_STRING([--with-xml-catalog=CATALOG], + [path to xml catalog to use]),, + [with_xml_catalog=/etc/xml/catalog]) + jh_found_xmlcatalog=true + XML_CATALOG_FILE="$with_xml_catalog" + AC_SUBST([XML_CATALOG_FILE]) + AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)]) + if test -f "$XML_CATALOG_FILE"; then + AC_MSG_RESULT([found]) + else + jh_found_xmlcatalog=false + AC_MSG_RESULT([not found]) + fi + + # check for the xmlcatalog program + AC_PATH_PROG(XMLCATALOG, xmlcatalog, no) + if test "x$XMLCATALOG" = xno; then + jh_found_xmlcatalog=false + fi + + if $jh_found_xmlcatalog; then + ifelse([$1],,[:],[$1]) + else + ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2]) + fi +]) + # Checks if a particular URI appears in the XML catalog # Usage: # JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) AC_DEFUN([JH_CHECK_XML_CATALOG], [ - AC_ARG_WITH([xml-catalog], - AC_HELP_STRING([--with-xml-catalog=CATALOG], - [path to xml catalog to use]),, - [with_xml_catalog=/etc/xml/catalog]) - XML_CATALOG_FILE="$with_xml_catalog" - AC_PATH_PROG(XMLCATALOG, xmlcatalog, /bin/false) + AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog]) - if AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then + if $jh_found_xmlcatalog && \ + AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then AC_MSG_RESULT([found]) ifelse([$3],,,[$3 ])dnl @@ -405,3 +446,7 @@ AC_DEFUN([jm_AC_HEADER_INTTYPES_H], ]) +m4_include(acglib.m4)dnl +m4_include(glib/libcharset/codeset.m4)dnl +m4_include(glib/libcharset/glibc21.m4)dnl +m4_include(m4macros/glib-gettext.m4)dnl