intltool.m4
Upload User: shyika
Upload Date: 2017-11-25
Package Size: 1227k
Code Size: 11k
Category:

Video Capture

Development Platform:

Unix_Linux

  1. ## intltool.m4 - Configure intltool for the target system. -*-Shell-script-*-
  2. ## Copyright (C) 2001 Eazel, Inc.
  3. ## Author: Maciej Stachowiak <mjs@noisehavoc.org>
  4. ##         Kenneth Christiansen <kenneth@gnu.org>
  5. ##
  6. ## This program is free software; you can redistribute it and/or modify
  7. ## it under the terms of the GNU General Public License as published by
  8. ## the Free Software Foundation; either version 2 of the License, or
  9. ## (at your option) any later version.
  10. ##
  11. ## This program is distributed in the hope that it will be useful, but
  12. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14. ## General Public License for more details.
  15. ##
  16. ## You should have received a copy of the GNU General Public License
  17. ## along with this program; if not, write to the Free Software
  18. ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. ##
  20. ## As a special exception to the GNU General Public License, if you
  21. ## distribute this file as part of a program that contains a
  22. ## configuration script generated by Autoconf, you may include it under
  23. ## the same distribution terms that you use for the rest of that program.
  24. dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
  25. # serial 35 IT_PROG_INTLTOOL
  26. AC_DEFUN([IT_PROG_INTLTOOL],
  27. [AC_PREREQ([2.50])dnl
  28. case "$am__api_version" in
  29.     1.[01234])
  30. AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
  31.     ;;
  32.     *)
  33.     ;;
  34. esac
  35. if test -n "$1"; then
  36.     AC_MSG_CHECKING(for intltool >= $1)
  37.     INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
  38.     INTLTOOL_APPLIED_VERSION=`awk -F" '/\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
  39.     [INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F" '/\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 1000 + VERSION[2] * 100 + VERSION[3];}' ${ac_aux_dir}/intltool-update.in`
  40.     ]
  41.     AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
  42.     test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
  43. AC_MSG_ERROR([Your intltool is too old.  You need intltool $1 or later.])
  44. fi
  45.   INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  46. INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  47.      INTLTOOL_KEYS_RULE='%.keys:      %.keys.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  48.      INTLTOOL_PROP_RULE='%.prop:      %.prop.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  49.       INTLTOOL_OAF_RULE='%.oaf:       %.oaf.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
  50.      INTLTOOL_PONG_RULE='%.pong:      %.pong.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  51.    INTLTOOL_SERVER_RULE='%.server:    %.server.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  52.     INTLTOOL_SHEET_RULE='%.sheet:     %.sheet.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  53. INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  54.        INTLTOOL_UI_RULE='%.ui:        %.ui.in        $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  55.       INTLTOOL_XML_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  56.       INTLTOOL_XML_NOMERGE_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' 
  57.       INTLTOOL_XAM_RULE='%.xam:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  58.       INTLTOOL_KBD_RULE='%.kbd:       %.kbd.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  59.     INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  60.   INTLTOOL_SCHEMAS_RULE='%.schemas:   %.schemas.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  61.     INTLTOOL_THEME_RULE='%.theme:     %.theme.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
  62.     INTLTOOL_SERVICE_RULE='%.service: %.service.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
  63. AC_SUBST(INTLTOOL_DESKTOP_RULE)
  64. AC_SUBST(INTLTOOL_DIRECTORY_RULE)
  65. AC_SUBST(INTLTOOL_KEYS_RULE)
  66. AC_SUBST(INTLTOOL_PROP_RULE)
  67. AC_SUBST(INTLTOOL_OAF_RULE)
  68. AC_SUBST(INTLTOOL_PONG_RULE)
  69. AC_SUBST(INTLTOOL_SERVER_RULE)
  70. AC_SUBST(INTLTOOL_SHEET_RULE)
  71. AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
  72. AC_SUBST(INTLTOOL_UI_RULE)
  73. AC_SUBST(INTLTOOL_XAM_RULE)
  74. AC_SUBST(INTLTOOL_KBD_RULE)
  75. AC_SUBST(INTLTOOL_XML_RULE)
  76. AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
  77. AC_SUBST(INTLTOOL_CAVES_RULE)
  78. AC_SUBST(INTLTOOL_SCHEMAS_RULE)
  79. AC_SUBST(INTLTOOL_THEME_RULE)
  80. AC_SUBST(INTLTOOL_SERVICE_RULE)
  81. # Use the tools built into the package, not the ones that are installed.
  82. AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
  83. AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
  84. AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
  85. AC_PATH_PROG(INTLTOOL_PERL, perl)
  86. if test -z "$INTLTOOL_PERL"; then
  87.    AC_MSG_ERROR([perl not found; required for intltool])
  88. fi
  89. if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
  90.    AC_MSG_ERROR([perl 5.x required for intltool])
  91. fi
  92. if test "x$2" != "xno-xml"; then
  93.    AC_MSG_CHECKING([for XML::Parser])
  94.    if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
  95.        AC_MSG_RESULT([ok])
  96.    else
  97.        AC_MSG_ERROR([XML::Parser perl module is required for intltool])
  98.    fi
  99. fi
  100. AC_PATH_PROG(INTLTOOL_ICONV, iconv, iconv)
  101. AC_PATH_PROG(INTLTOOL_MSGFMT, msgfmt, msgfmt)
  102. AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
  103. AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
  104. # Substitute ALL_LINGUAS so we can use it in po/Makefile
  105. AC_SUBST(ALL_LINGUAS)
  106. # Set DATADIRNAME correctly if it is not set yet
  107. # (copied from glib-gettext.m4)
  108. if test -z "$DATADIRNAME"; then
  109.   AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
  110.                  return _nl_msg_cat_cntr],
  111.     [DATADIRNAME=share],
  112.     [case $host in
  113.     *-*-solaris*)
  114.     dnl On Solaris, if bind_textdomain_codeset is in libc,
  115.     dnl GNU format message catalog is always supported,
  116.     dnl since both are added to the libc all together.
  117.     dnl Hence, we'd like to go with DATADIRNAME=share
  118.     dnl in this case.
  119.     AC_CHECK_FUNC(bind_textdomain_codeset,
  120.       [DATADIRNAME=share], [DATADIRNAME=lib])
  121.     ;;
  122.     *)
  123.     [DATADIRNAME=lib]
  124.     ;;
  125.     esac])
  126. fi
  127. AC_SUBST(DATADIRNAME)
  128. IT_PO_SUBDIR([po])
  129. dnl The following is very similar to
  130. dnl
  131. dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
  132. dnl
  133. dnl with the following slight differences:
  134. dnl  - the *.in files are in ac_aux_dir,
  135. dnl  - if the file haven't changed upon reconfigure, it's not touched,
  136. dnl  - the evaluation of the third parameter enables a hack which computes
  137. dnl    the actual value of $libdir,
  138. dnl  - the user sees "executing intltool commands", instead of
  139. dnl    "creating intltool-extract" and such.
  140. dnl
  141. dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
  142. dnl a reason for it.
  143. AC_CONFIG_COMMANDS([intltool], [
  144. for file in intltool-extract intltool-merge intltool-update; do
  145.   sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" 
  146.       -e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" 
  147.       -e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" 
  148.       -e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" 
  149.       -e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" 
  150.       -e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" 
  151.       -e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" 
  152. < ${ac_aux_dir}/${file}.in > ${file}.out
  153.   if cmp -s ${file} ${file}.out 2>/dev/null; then
  154.     rm -f ${file}.out
  155.   else
  156.     mv -f ${file}.out ${file}
  157.   fi
  158.   chmod ugo+x ${file}
  159.   chmod u+w ${file}
  160. done
  161. ],
  162. [INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
  163. prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir" 
  164. INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
  165. INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
  166. INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])
  167. ])
  168. # IT_PO_SUBDIR(DIRNAME)
  169. # ---------------------
  170. # All po subdirs have to be declared with this macro; the subdir "po" is
  171. # declared by IT_PROG_INTLTOOL.
  172. #
  173. AC_DEFUN([IT_PO_SUBDIR],
  174. [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
  175. dnl
  176. dnl The following CONFIG_COMMANDS should be exetuted at the very end
  177. dnl of config.status.
  178. AC_CONFIG_COMMANDS_PRE([
  179.   AC_CONFIG_COMMANDS([$1/stamp-it], [
  180.     rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
  181.     >"$1/stamp-it.tmp"
  182.     [sed '/^#/d
  183.  s/^[[].*] *//
  184.  /^[  ]*$/d
  185. '"s|^| $ac_top_srcdir/|" 
  186.       "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \/' >"$1/POTFILES"
  187.     ]
  188.     if test ! -f "$1/Makefile"; then
  189.       AC_MSG_ERROR([$1/Makefile is not ready.])
  190.     fi
  191.     mv "$1/Makefile" "$1/Makefile.tmp"
  192.     [sed '/^POTFILES =/,/[^\]$/ {
  193. /^POTFILES =/!d
  194. r $1/POTFILES
  195.   }
  196.  ' "$1/Makefile.tmp" >"$1/Makefile"]
  197.     rm -f "$1/Makefile.tmp"
  198.     mv "$1/stamp-it.tmp" "$1/stamp-it"
  199.   ])
  200. ])dnl
  201. ])
  202. # deprecated macros
  203. AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
  204. # A hint is needed for aclocal from Automake <= 1.9.4:
  205. # AC_DEFUN([AC_PROG_INTLTOOL], ...)