home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 November / CPNL0711.ISO / communic / email / Evolution-2.8.2-2.msi / Data1.cab / intltoolize < prev    next >
Text File  |  2007-03-07  |  8KB  |  294 lines

  1. #! /bin/sh
  2. # intltoolize - Prepare a package to use intltool.
  3. # intltoolize.  Generated from intltoolize.in by configure.
  4. # Copyright (C) 1996-1999 Free Software Foundation, Inc.
  5. # Copyright (C) 2001 Eazel, Inc.
  6. #
  7. # Originally based on libtoolize by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  8. #
  9. # Modified for xml-i18n-tools by Maciej Stachowiak <mjs@noisehavoc.org>
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version.
  15. #
  16. # This program is distributed in the hope that it will be useful, but
  17. # WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  19. # General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with this program; if not, write to the Free Software
  23. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  24. #
  25. # As a special exception to the GNU General Public License, if you
  26. # distribute this file as part of a program that contains a
  27. # configuration script generated by Autoconf, you may include it under
  28. # the same distribution terms that you use for the rest of that program.
  29.  
  30. # The name of this program.
  31. progname=`echo "$0" | sed 's%^.*/%%'`
  32.  
  33. # Constants.
  34. PROGRAM=intltoolize
  35. PACKAGE=intltool
  36. VERSION=0.35.5
  37.  
  38. # Directory names.
  39. prefix=c:/devel/target/e65da0246693524f8ac3dc4a68739fef
  40.  
  41. case "`uname`" in
  42. MINGW32*)
  43.   # Assume intltoolize is in $prefix/bin. Strip off the script name and the "bin"
  44.   prefix=`dirname $0`
  45.   prefix=`dirname $prefix`
  46.   ;;
  47. esac
  48.  
  49. datarootdir=${prefix}/share
  50. datadir=${datarootdir}
  51. pkgdatadir=${datadir}/intltool
  52.  
  53. aclocaldir=${datadir}/aclocal
  54. intltool_m4="${aclocaldir}/intltool.m4"
  55.  
  56. dry_run=no
  57. help="Try '$progname --help' for more information."
  58. rm="rm -f"
  59. rm_rec="rm -rf"
  60. ln_s="ln -s"
  61. cp="cp -f"
  62. mkdir="mkdir"
  63. mkinstalldirs="mkinstalldirs"
  64.  
  65. # Global variables.
  66. automake=
  67. copy=
  68. force=
  69. status=0
  70.  
  71. for arg
  72. do
  73.   case "$arg" in
  74.   --help)
  75.     cat <<EOF
  76. Usage: $progname [OPTION]...
  77.  
  78. Prepare a package to use intltool.
  79.  
  80.     --automake        work silently, and assume that Automake is in use
  81. -c, --copy            copy files rather than symlinking them
  82.     --debug           enable verbose shell tracing
  83. -n, --dry-run         print commands rather than running them
  84. -f, --force           replace existing files
  85.     --help            display this message and exit
  86.     --version         print version information and exit
  87.  
  88. You must 'cd' to the top directory of your package before you run
  89. '$progname'.
  90. EOF
  91.     exit 0
  92.     ;;
  93.  
  94.   --version)
  95.     echo "$PROGRAM (GNU $PACKAGE) $VERSION"
  96.     exit 0
  97.     ;;
  98.  
  99.   --automake)
  100.     automake=yes
  101.     ;;
  102.  
  103.   -c | --copy)
  104.     ln_s=
  105.     ;;
  106.  
  107.   --debug)
  108.     echo "$progname: enabling shell trace mode"
  109.     set -x
  110.     ;;
  111.  
  112.   -n | --dry-run)
  113.     if test "$dry_run" != yes; then
  114.       dry_run=yes
  115.       rm="echo $rm"
  116.       rm_rec="echo $rm_rec"
  117.       test -n "$ln_s" && ln_s="echo $ln_s"
  118.       cp="echo $cp"
  119.       mkdir="echo mkdir"
  120.       mkinstalldirs="echo $mkinstalldirs"
  121.     fi
  122.     ;;
  123.  
  124.   -f | --force)
  125.     force=yes
  126.     ;;
  127.  
  128.   -*)
  129.     echo "$progname: unrecognized option '$arg'" 1>&2
  130.     echo "$help" 1>&2
  131.     exit 1
  132.     ;;
  133.  
  134.   *)
  135.     echo "$progname: too many arguments" 1>&2
  136.     echo "$help" 1>&2
  137.     exit 1
  138.     ;;
  139.   esac
  140. done
  141.  
  142. if test -f configure.ac; then
  143.     configure="configure.ac"
  144. else
  145.     if test -f configure.in; then
  146.     configure="configure.in"
  147.     else
  148.     echo "$progname: neither 'configure.ac' nor 'configure.in' exists" 1>&2
  149.     echo "$help" 1>&2
  150.     exit 1
  151.     fi
  152. fi
  153.  
  154.  
  155. files='intltool-extract.in intltool-merge.in intltool-update.in po/Makefile.in.in'
  156.  
  157. auxdir=.
  158. auxdirline=`egrep '^AC_CONFIG_AUX_DIR' $configure 2>/dev/null`
  159. if test -n "$auxdirline"; then
  160.   # Handle explicit AC_CONFIG_AUX_DIR settings.
  161.   auxdir=`echo "$auxdirline" | sed 's/^AC_CONFIG_AUX_DIR(\([^)]*\)).*$/\1/'`
  162.  
  163.   if test "$auxdir" = "$auxdirline"; then
  164.     echo "$progname: invalid AC_CONFIG_AUX_DIR syntax: $auxdirline" 1>&2
  165.     exit 1
  166.   else
  167.     # Strip any quote brackets.
  168.     auxdir=`echo "$auxdir" | sed 's/^\[\(.*\)\]$/\1/g'`
  169.     case "$auxdir" in
  170.     *\$*)
  171.       echo "$progname: cannot handle variables in AC_CONFIG_AUX_DIR" 1>&2
  172.       exit 1
  173.       ;;
  174.     *)
  175.     ;;
  176.     esac
  177.   fi
  178. else
  179.   # Try to discover auxdir the same way it is discovered by configure.
  180.   # Note that we default to the current directory.
  181.   for dir in . .. ../..; do
  182.     if test -f $dir/install-sh; then
  183.       auxdir=$dir
  184.       break
  185.     elif test -f $dir/install.sh; then
  186.       auxdir=$dir
  187.       break
  188.     fi
  189.   done
  190. fi
  191.  
  192. if test -z "$automake"; then
  193.   if egrep '^(AC|IT)_PROG_INTLTOOL' $configure >/dev/null 2>&1; then :
  194.   else
  195.     echo "ERROR: 'IT_PROG_INTLTOOL' must appear in $configure for intltool to work."
  196.     exit 1
  197.   fi
  198.  
  199.   if grep 'generated automatically by aclocal' aclocal.m4 >/dev/null 2>&1; then
  200.     updatemsg="update your 'aclocal.m4' by running aclocal"
  201.   else
  202.     updatemsg="add the contents of '$intltool_m4' to 'aclocal.m4'"
  203.   fi
  204.  
  205.   if egrep '^AC_DEFUN\(IT_PROG_INTLTOOL' aclocal.m4 >/dev/null 2>&1; then
  206.     # Check the version number on intltool.m4 and the one used in aclocal.m4.
  207.     instserial=`grep '^# serial ' $intltool_m4 | grep 'IT_PROG_INTLTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
  208.  
  209.     if test -z "$instserial"; then
  210.       echo "$progname: warning: no serial number on '$intltool_m4'" 1>&2
  211.     else
  212.       # If the local macro has no serial number, we assume it's ancient.
  213.       localserial=`grep '^# serial ' aclocal.m4 | grep 'IT_PROG_INTLTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
  214.  
  215.       test -z "$localserial" && localserial=0
  216.  
  217.       if test "$localserial" -lt "$instserial"; then
  218.     echo "You should $updatemsg."
  219.       elif test "$localserial" -gt "$instserial"; then
  220.     echo "$progname: '$intltool_m4' is serial $instserial, less than $localserial in 'aclocal.m4'" 1>&2
  221.     if test -z "$force"; then
  222.       echo "Use '--force' to replace newer intltool files with this version." 1>&2
  223.       exit 1
  224.     fi
  225.     echo "To remain compatible, you should $updatemsg."
  226.       fi
  227.     fi
  228.   else
  229.     echo "You should $updatemsg."
  230.   fi
  231. fi
  232.  
  233.  
  234.  
  235. # Change to the auxiliary directory.
  236. (
  237. cur=`pwd`
  238. if test "$auxdir" != .; then
  239.   test -z "$automake" && echo "Putting files in AC_CONFIG_AUX_DIR, '$auxdir'."
  240.   cd $auxdir || exit 1
  241. fi
  242.  
  243. for file in $files; do
  244.   if test -f "$file" && test -z "$force"; then
  245.     test -z "$automake" && echo "$progname: '$file' exists: use '--force' to overwrite" 1>&2
  246.     continue
  247.   fi
  248.  
  249.   $rm $file
  250.   if test -n "$ln_s" && $ln_s $pkgdatadir/`basename $file` $file; then :
  251.   elif $cp $pkgdatadir/`basename $file` $file; then :
  252.   else
  253.     echo "$progname: cannot copy '$pkgdatadir/`basename $file`' to '$file'" 1>&2
  254.     status=1
  255.   fi
  256. done
  257.  
  258. exit $status
  259. # make sure this subshell exits with the exit value if it failed
  260. ) || exit $?
  261.  
  262.  
  263. # If the AC_CONFIG_MACRO_DIR() macro is used, copy intltool.m4 from our
  264. # prefix to that directory.  This makes sure that the M4 macro used
  265. # matches the intltool scripts we install.
  266. # If AC_CONFIG_MACRO_DIR is not used, things will behave as before (aclocal
  267. # will be used to pull in the macro.
  268. m4dir=`cat "$configure" | grep '^AC_CONFIG_MACRO_DIR' | sed -n -e 's/AC_CONFIG_MACRO_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
  269. if test -n "$m4dir"; then
  270.   rm -f $m4dir/intltool.m4
  271.   if test -n "$ln_s" && $ln_s $intltool_m4 $m4dir/intltool.m4; then :
  272.   elif $cp $intltool_m4 $m4dir/intltool.m4; then :
  273.   else
  274.     echo "$progname: cannot copy '$intltool_m4' to '$m4dir/intltool.m4'" 1>&2
  275.     exit 1
  276.   fi
  277. fi
  278.  
  279.  
  280. # FIXME: This probably does not work w/ builddir != srcdir because it
  281. # gets at source files relative to the current directory.
  282.  
  283. grep INTLTOOL_MAKEFILE po/Makefile.in.in >/dev/null || {
  284.   echo "$progname: 'po/Makefile.in.in' is out of date: use '--force' to overwrite"
  285.   exit 1
  286. }
  287.  
  288. exit $status
  289.  
  290. # Local Variables:
  291. # mode:shell-script
  292. # sh-indentation:2
  293. # End:
  294.