xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/misc/gettextize.in (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#! /bin/sh
2#
3# Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2, or (at your option)
8# any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software Foundation,
17# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18#
19
20# This file is meant for authors or maintainers which want to
21# internationalize their package with the help of GNU gettext.  For
22# further information how to use it consult the GNU gettext manual.
23
24progname=$0
25package=@PACKAGE@
26version=@VERSION@
27
28# Set variables
29# - gettext_dir     directory where the sources are stored.
30prefix="@prefix@"
31datarootdir="@datarootdir@"
32gettext_dir="@datadir@/gettext"
33
34# func_tmpdir
35# creates a temporary directory.
36# Sets variable
37# - tmp             pathname of freshly created temporary directory
38func_tmpdir ()
39{
40  # Use the environment variable TMPDIR, falling back to /tmp. This allows
41  # users to specify a different temporary directory, for example, if their
42  # /tmp is filled up or too small.
43  : ${TMPDIR=/tmp}
44  {
45    # Use the mktemp program if available. If not available, hide the error
46    # message.
47    tmp=`(umask 077 && mktemp -d "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
48    test -n "$tmp" && test -d "$tmp"
49  } ||
50  {
51    # Use a simple mkdir command. It is guaranteed to fail if the directory
52    # already exists.  $RANDOM is bash specific and expands to empty in shells
53    # other than bash, ksh and zsh.  Its use does not increase security;
54    # rather, it minimizes the probability of failure in a very cluttered /tmp
55    # directory.
56    tmp=$TMPDIR/gt$$-$RANDOM
57    (umask 077 && mkdir "$tmp")
58  } ||
59  {
60    echo "$0: cannot create a temporary directory in $TMPDIR" >&2
61    { (exit 1); exit 1; }
62  }
63}
64
65# Support for relocatability.
66func_find_curr_installdir ()
67{
68  # Determine curr_installdir, even taking into account symlinks.
69  curr_executable="$0"
70  case "$curr_executable" in
71    */* | *\\*) ;;
72    *) # Need to look in the PATH.
73      if test "${PATH_SEPARATOR+set}" != set; then
74        func_tmpdir
75        { echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh
76        chmod +x "$tmp"/conf.sh
77        if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then
78          PATH_SEPARATOR=';'
79        else
80          PATH_SEPARATOR=:
81        fi
82        rm -rf "$tmp"
83      fi
84      save_IFS="$IFS"; IFS="$PATH_SEPARATOR"
85      for dir in $PATH; do
86        IFS="$save_IFS"
87        test -z "$dir" && dir=.
88        for exec_ext in ''; do
89          if test -f "$dir/$curr_executable$exec_ext"; then
90            curr_executable="$dir/$curr_executable$exec_ext"
91            break 2
92          fi
93        done
94      done
95      IFS="$save_IFS"
96      ;;
97  esac
98  # Make absolute.
99  case "$curr_executable" in
100    /* | ?:/* | ?:\\*) ;;
101    *) curr_executable=`pwd`/"$curr_executable" ;;
102  esac
103  # Resolve symlinks.
104  sed_dirname='s,/[^/]*$,,'
105  sed_linkdest='s,^.* -> \(.*\),\1,p'
106  while : ; do
107    lsline=`LC_ALL=C ls -l "$curr_executable"`
108    case "$lsline" in
109      *" -> "*)
110        linkdest=`echo "$lsline" | sed -n -e "$sed_linkdest"`
111        case "$linkdest" in
112          /* | ?:/* | ?:\\*) curr_executable="$linkdest" ;;
113          *) curr_executable=`echo "$curr_executable" | sed -e "$sed_dirname"`/"$linkdest" ;;
114        esac ;;
115      *) break ;;
116    esac
117  done
118  curr_installdir=`echo "$curr_executable" | sed -e 's,/[^/]*$,,'`
119  # Canonicalize.
120  curr_installdir=`cd "$curr_installdir" && pwd`
121}
122func_find_prefixes ()
123{
124  # Compute the original/current installation prefixes by stripping the
125  # trailing directories off the original/current installation directories.
126  orig_installprefix="$orig_installdir"
127  curr_installprefix="$curr_installdir"
128  while true; do
129    orig_last=`echo "$orig_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
130    curr_last=`echo "$curr_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
131    if test -z "$orig_last" || test -z "$curr_last"; then
132      break
133    fi
134    if test "$orig_last" != "$curr_last"; then
135      break
136    fi
137    orig_installprefix=`echo "$orig_installprefix" | sed -e 's,/[^/]*$,,'`
138    curr_installprefix=`echo "$curr_installprefix" | sed -e 's,/[^/]*$,,'`
139  done
140}
141if test "@RELOCATABLE@" = yes; then
142  exec_prefix="@exec_prefix@"
143  bindir="@bindir@"
144  orig_installdir="$bindir" # see Makefile.am's *_SCRIPTS variables
145  func_find_curr_installdir # determine curr_installdir
146  func_find_prefixes
147  # Relocate the directory variables that we use.
148  gettext_dir=`echo "$gettext_dir/" | sed -e "s%^${orig_installprefix}/%${curr_installprefix}/%" | sed -e 's,/$,,'`
149fi
150
151# func_usage
152# outputs to stdout the --help usage message.
153func_usage ()
154{
155  echo "\
156Usage: gettextize [OPTION]... [package-dir]
157
158Prepares a source package to use gettext.
159
160Options:
161      --help           print this help and exit
162      --version        print version information and exit
163  -f, --force          force writing of new files even if old exist
164      --intl           install libintl in a subdirectory
165      --no-changelog   don't update or create ChangeLog files
166      --symlink        make symbolic links instead of copying files
167  -n, --dry-run        print modifications but don't perform them
168
169Report bugs to <bug-gnu-gettext@gnu.org>."
170}
171
172# func_version
173# outputs to stdout the --version message.
174func_version ()
175{
176  echo "$progname (GNU $package) $version"
177  echo "Copyright (C) 1995-1998, 2000-2006 Free Software Foundation, Inc.
178This is free software; see the source for copying conditions.  There is NO
179warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
180  echo "Written by" "Ulrich Drepper"
181}
182
183# func_fatal_error message
184# outputs to stderr a fatal error message, and terminates the program.
185func_fatal_error ()
186{
187  echo "gettextize: *** $1" 1>&2
188  echo "gettextize: *** Stop." 1>&2
189  exit 1
190}
191
192# Nuisances.
193(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
194
195# Command-line option processing.
196# Removes the OPTIONS from the arguments. Sets the variables:
197# - force           1 if --force was given, 0 otherwise
198# - intldir         yes if --intl was given, empty otherwise
199# - try_ln_s        : if --symlink was given, false otherwise
200# - do_changelog    false if --no-changelog was given, : otherwise
201# - doit            false if --dry-run was given, : otherwise
202{
203  force=0
204  intldir=
205  try_ln_s=false
206  do_changelog=:
207  doit=:
208
209  while test $# -gt 0; do
210    case "$1" in
211      -c | --copy | --cop | --co | --c ) # accepted for backward compatibility
212        shift ;;
213      -n | --dry-run | --dry-ru | --dry-r | --dry- | --dry | --dr | --d )
214        shift
215        doit=false ;;
216      -f | --force | --forc | --for | --fo | --f )
217        shift
218        force=1 ;;
219      --help | --hel | --he | --h )
220        func_usage; exit 0 ;;
221      --intl | --int | --in | --i )
222        shift
223        intldir=yes ;;
224      --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch | --no-c )
225        shift
226        do_changelog=false ;;
227      --symlink | --symlin | --symli | --syml | --sym | --sy | --s )
228        shift
229        try_ln_s=: ;;
230      --version | --versio | --versi | --vers | --ver | --ve | --v )
231        func_version
232        exit 0 ;;
233      -- )	# Stop option prcessing
234        shift; break ;;
235      -* )
236        echo "gettextize: unknown option $1" 1>&2
237        echo "Try 'gettextize --help' for more information." 1>&2
238        exit 1 ;;
239      * )
240        break ;;
241    esac
242  done
243}
244
245# Command-line argument processing.
246# Analyzes the remaining arguments.
247# Sets the variables
248# - origdir         to the original directory,
249# - srcdir          to the package directory, and cd-s into it.
250{
251  if test $# -gt 1; then
252    func_usage 1>&2
253    exit 1
254  fi
255  origdir=`pwd`
256  if test $# -eq 1; then
257    srcdir=$1
258    if cd "$srcdir"; then
259      srcdir=`pwd`
260    else
261      func_fatal_error "Cannot change directory to '$srcdir'."
262    fi
263  else
264    srcdir=$origdir
265  fi
266}
267
268# The current directory is now $srcdir.
269
270# Check integrity of package: A configure.in/ac must be present. Sets variable
271# - configure_in    name of configure.in/ac file.
272test -f configure.in || test -f configure.ac ||
273  func_fatal_error "Missing configure.in or configure.ac, please cd to your package first."
274configure_in=NONE
275if test -f configure.in; then
276  configure_in=configure.in
277else
278  if test -f configure.ac; then
279    configure_in=configure.ac
280  fi
281fi
282
283# Check whether the --force option is needed but has not been specified.
284if test $force -eq 0; then
285  if test -d intl; then
286    func_fatal_error "intl/ subdirectory exists: use option -f if you really want to delete it."
287  fi
288  if test -f po/Makefile.in.in; then
289    func_fatal_error "po/Makefile.in.in exists: use option -f if you really want to delete it."
290  fi
291  if test -f ABOUT-NLS; then
292    func_fatal_error "ABOUT-NLS exists: use option -f if you really want to delete it."
293  fi
294fi
295
296# Check in which directory config.rpath etc. belong.
297auxdir=`cat "$configure_in" | grep '^AC_CONFIG_AUX_DIR' | sed -n -e 's/AC_CONFIG_AUX_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
298if test -n "$auxdir"; then
299  auxdir="$auxdir/"
300fi
301
302# For simplicity we change to the gettext source directory.
303cd $gettext_dir ||
304  func_fatal_error "gettext source directory '${gettext_dir}' doesn't exist"
305
306# Variables which keep track what has been modified.
307added_directories=
308removed_directory=
309added_extradist=
310added_acoutput=
311removed_acoutput=" intl/intlh.inst"
312
313# Variable:
314# - please          accumulates instructions for the user.
315please=
316
317# Variable:
318# - date            current date, for use in ChangeLog entries.
319date=`date +%Y-%m-%d`
320
321# func_copy from to
322# copies a file.
323# 'from' is a relative pathname, relative to the current directory.
324# 'to' is a relative pathname, relative to $srcdir.
325func_copy ()
326{
327  if $doit; then
328    rm -f "$srcdir/$2"
329    echo "Copying file $2"
330    cp "$1" "$srcdir/$2"
331  else
332    echo "Copy file $2"
333  fi
334}
335
336# func_linkorcopy from absfrom to
337# links or copies a file.
338# 'from' is a relative pathname, relative to the current directory.
339# 'absfrom' is the corresponding absolute pathname.
340# 'to' is a relative pathname, relative to $srcdir.
341func_linkorcopy ()
342{
343  if $doit; then
344    rm -f "$srcdir/$3"
345    ($try_ln_s && ln -s "$2" "$srcdir/$3" && echo "Symlinking file $3") 2>/dev/null ||
346    { echo "Copying file $3"; cp "$1" "$srcdir/$3"; }
347  else
348    if $try_ln_s; then
349      echo "Symlink file $3"
350    else
351      echo "Copy file $3"
352    fi
353  fi
354}
355
356# func_backup to
357# makes a backup of a file that is about to be overwritten or replaced.
358# 'to' is a relative pathname, relative to $srcdir.
359func_backup ()
360{
361  if $doit; then
362    if test -f "$srcdir/$1"; then
363      rm -f "$srcdir/$1~"
364      cp -p "$srcdir/$1" "$srcdir/$1~"
365    fi
366  fi
367}
368
369# func_remove to
370# removes a file.
371# 'to' is a relative pathname, relative to $srcdir.
372func_remove ()
373{
374  if $doit; then
375    echo "Removing $1"
376    rm -f "$srcdir/$1"
377  else
378    echo "Remove $1"
379  fi
380}
381
382# func_ChangeLog_init
383# func_ChangeLog_add_entry line
384# func_ChangeLog_finish
385# manage the ChangeLog file, relative to $srcdir.
386func_ChangeLog_init ()
387{
388  modified_ChangeLog=
389}
390func_ChangeLog_add_entry ()
391{
392  if $doit; then
393    if test -z "$modified_ChangeLog"; then
394      echo "$date  gettextize  <bug-gnu-gettext@gnu.org>" > "$srcdir/ChangeLog.tmp"
395      echo >> "$srcdir/ChangeLog.tmp"
396      modified_ChangeLog=yes
397    fi
398    echo "$1" >> "$srcdir/ChangeLog.tmp"
399  else
400    modified_ChangeLog=yes
401  fi
402}
403func_ChangeLog_finish ()
404{
405  if test -n "$modified_ChangeLog"; then
406    if $doit; then
407      echo >> "$srcdir/ChangeLog.tmp"
408      if test -f "$srcdir/ChangeLog"; then
409        echo "Adding an entry to ChangeLog (backup is in ChangeLog~)"
410        cat "$srcdir/ChangeLog" >> "$srcdir/ChangeLog.tmp"
411        rm -f "$srcdir/ChangeLog~"
412        cp -p "$srcdir/ChangeLog" "$srcdir/ChangeLog~"
413      else
414        echo "Creating ChangeLog"
415      fi
416      cp "$srcdir/ChangeLog.tmp" "$srcdir/ChangeLog"
417      rm -f "$srcdir/ChangeLog.tmp"
418    else
419      if test -f "$srcdir/ChangeLog"; then
420        echo "Add an entry to ChangeLog"
421      else
422        echo "Create ChangeLog"
423      fi
424    fi
425  fi
426}
427
428# func_poChangeLog_init
429# func_poChangeLog_add_entry line
430# func_poChangeLog_finish
431# manage the po/ChangeLog file, relative to $srcdir.
432func_poChangeLog_init ()
433{
434  modified_poChangeLog=
435}
436func_poChangeLog_add_entry ()
437{
438  if $doit; then
439    if test -z "$modified_poChangeLog"; then
440      echo "$date  gettextize  <bug-gnu-gettext@gnu.org>" > "$srcdir/po/ChangeLog.tmp"
441      echo >> "$srcdir/po/ChangeLog.tmp"
442      modified_poChangeLog=yes
443    fi
444    echo "$1" >> "$srcdir/po/ChangeLog.tmp"
445  else
446    modified_poChangeLog=yes
447  fi
448}
449func_poChangeLog_finish ()
450{
451  if test -n "$modified_poChangeLog"; then
452    if $doit; then
453      echo >> "$srcdir/po/ChangeLog.tmp"
454      if test -f "$srcdir/po/ChangeLog"; then
455        echo "Adding an entry to po/ChangeLog (backup is in po/ChangeLog~)"
456        cat "$srcdir/po/ChangeLog" >> "$srcdir/po/ChangeLog.tmp"
457        rm -f "$srcdir/po/ChangeLog~"
458        cp -p "$srcdir/po/ChangeLog" "$srcdir/po/ChangeLog~"
459      else
460        echo "Creating po/ChangeLog"
461      fi
462      cp "$srcdir/po/ChangeLog.tmp" "$srcdir/po/ChangeLog"
463      rm -f "$srcdir/po/ChangeLog.tmp"
464    else
465      if test -f "$srcdir/po/ChangeLog"; then
466        echo "Add an entry to po/ChangeLog"
467      else
468        echo "Create po/ChangeLog"
469      fi
470    fi
471  fi
472}
473
474# func_m4ChangeLog_init
475# func_m4ChangeLog_add_entry line
476# func_m4ChangeLog_finish
477# manage the $m4dir/ChangeLog file, relative to $srcdir.
478func_m4ChangeLog_init ()
479{
480  if test -n "$using_m4ChangeLog"; then
481    modified_m4ChangeLog=
482    created_m4ChangeLog=
483  fi
484}
485func_m4ChangeLog_add_entry ()
486{
487  if test -n "$using_m4ChangeLog"; then
488    if $doit; then
489      if test -z "$modified_m4ChangeLog"; then
490        echo "$date  gettextize  <bug-gnu-gettext@gnu.org>" > "$srcdir/$m4dir/ChangeLog.tmp"
491        echo >> "$srcdir/$m4dir/ChangeLog.tmp"
492        modified_m4ChangeLog=yes
493      fi
494      echo "$1" >> "$srcdir/$m4dir/ChangeLog.tmp"
495    else
496      modified_m4ChangeLog=yes
497    fi
498  else
499    line="$1"
500    line=`echo "$line" | sed -e "s%^	\\* %	* $m4dir/%"`
501    func_ChangeLog_add_entry "$line"
502  fi
503}
504func_m4ChangeLog_finish ()
505{
506  if test -n "$using_m4ChangeLog"; then
507    if test -n "$modified_m4ChangeLog"; then
508      if $doit; then
509        echo >> "$srcdir/$m4dir/ChangeLog.tmp"
510        if test -f "$srcdir/$m4dir/ChangeLog"; then
511          echo "Adding an entry to $m4dir/ChangeLog (backup is in $m4dir/ChangeLog~)"
512          cat "$srcdir/$m4dir/ChangeLog" >> "$srcdir/$m4dir/ChangeLog.tmp"
513          rm -f "$srcdir/$m4dir/ChangeLog~"
514          cp -p "$srcdir/$m4dir/ChangeLog" "$srcdir/$m4dir/ChangeLog~"
515        else
516          echo "Creating $m4dir/ChangeLog"
517          created_m4ChangeLog=yes
518        fi
519        cp "$srcdir/$m4dir/ChangeLog.tmp" "$srcdir/$m4dir/ChangeLog"
520        rm -f "$srcdir/$m4dir/ChangeLog.tmp"
521      else
522        if test -f "$srcdir/$m4dir/ChangeLog"; then
523          echo "Add an entry to $m4dir/ChangeLog"
524        else
525          echo "Create $m4dir/ChangeLog"
526          created_m4ChangeLog=yes
527        fi
528      fi
529    fi
530  fi
531}
532using_m4ChangeLog=yes
533
534if test ! -f "$srcdir/intl/Makefile.in" && test -n "$intldir"; then
535  added_acoutput="$added_acoutput intl/Makefile"
536fi
537if test -f "$srcdir/intl/Makefile.in" && test -z "$intldir"; then
538  removed_acoutput="$removed_acoutput intl/Makefile"
539fi
540if test -d "$srcdir/intl"; then
541  # Remove everything inside intl except for RCS and CVS subdirs and invisible
542  # files.
543  if $doit; then
544    echo "Wiping out intl/ subdirectory"
545    (cd "$srcdir/intl" &&
546     for f in *; do
547       if test CVS != "$f" && test RCS != "$f"; then
548         rm -rf "$f"
549       fi
550     done)
551  else
552    echo "Wipe out intl/ subdirectory"
553  fi
554  if test -z "$intldir"; then
555    removed_directory=intl
556  fi
557else
558  if test -n "$intldir"; then
559    if $doit; then
560      echo "Creating intl/ subdirectory"
561      mkdir "$srcdir/intl" || func_fatal_error "failed to create intl/ subdirectory"
562    else
563      echo "Create intl/ subdirectory"
564    fi
565    added_directories="$added_directories intl"
566  fi
567fi
568
569$do_changelog && func_ChangeLog_init
570
571test -d "$srcdir/po" || {
572  if $doit; then
573    echo "Creating po/ subdirectory"
574    mkdir "$srcdir/po" || func_fatal_error "failed to create po/ subdirectory"
575  else
576    echo "Create po/ subdirectory"
577  fi
578  added_directories="$added_directories po"
579}
580
581# Create the directory for config.rpath, if needed.
582# This is for consistency with autoreconf and automake.
583# Note that $auxdir is either empty or ends in a slash.
584test -d "$srcdir/$auxdir" || {
585  if $doit; then
586    echo "Creating $auxdir subdirectory"
587    mkdir "$srcdir/$auxdir" || func_fatal_error "failed to create $auxdir subdirectory"
588  else
589    echo "Create $auxdir subdirectory"
590  fi
591}
592
593# Now copy all files.  Take care for the destination directories.
594for file in *; do
595  case $file in
596    ABOUT-NLS)
597      func_linkorcopy $file "$gettext_dir/$file" $file
598      ;;
599    config.rpath)
600      if test -f "$srcdir/$auxdir$file"; then
601        :
602      else
603        added_extradist="$added_extradist $auxdir$file"
604      fi
605      func_linkorcopy $file "$gettext_dir/$file" "$auxdir$file"
606      ;;
607  esac
608done
609
610# Copy files to intl/ subdirectory.
611if test -n "$intldir"; then
612  cd intl
613  for file in *; do
614    if test $file != COPYING.LIB-2.0 && test $file != COPYING.LIB-2.1; then
615      if test $file != plural.c; then
616        func_linkorcopy $file "$gettext_dir/intl/$file" intl/$file
617      else
618        # plural.c is a generated file; it must be copied and touched.
619        func_copy $file intl/$file
620        if $doit; then
621          (sleep 2; touch "$srcdir/intl/$file") &
622        fi
623      fi
624    fi
625  done
626  cd ..
627else
628  echo "Not copying intl/ directory."
629  # Tell the user what to put into configure.ac, if it is not already there.
630  if grep '^AM_GNU_GETTEXT([[]\?external[]]\?[ 	]*[,)]' "$srcdir/$configure_in" > /dev/null; then
631    :
632  else
633    please="$please
634Please use AM_GNU_GETTEXT([external]) in order to cause autoconfiguration
635to look for an external libintl.
636"
637  fi
638fi
639
640# Copy files to po/ subdirectory.
641$do_changelog && func_poChangeLog_init
642cd po
643for file in Makefile.in.in; do
644  same=no
645  if test -f "$srcdir/po/$file"; then
646    if cmp -s $file "$srcdir/po/$file"; then
647      same=yes
648    fi
649  else
650    added_acoutput="$added_acoutput po/Makefile.in"
651  fi
652  if $do_changelog && test $same = no; then
653    if test -f "$srcdir/po/$file"; then
654      func_poChangeLog_add_entry "	* $file: Upgrade to gettext-${version}."
655    else
656      func_poChangeLog_add_entry "	* $file: New file, from gettext-${version}."
657    fi
658  fi
659  func_backup po/$file
660  func_linkorcopy $file "$gettext_dir/po/$file" po/$file
661done
662for file in *; do
663  case $file in
664    Makefile.in.in)
665      # Already handled above.
666      ;;
667    Makevars.template)
668      func_linkorcopy Makevars.template "$gettext_dir/po/Makevars.template" po/Makevars.template
669      if test -f "$srcdir/po/Makevars"; then
670        LC_ALL=C sed -n -e 's/[ 	]*\([A-Za-z0-9_]*\)[ 	]*=.*/\1/p' < "$srcdir/po/Makevars" | LC_ALL=C sort > "$srcdir/po/Makevars.tmp1"
671        LC_ALL=C sed -n -e 's/[ 	]*\([A-Za-z0-9_]*\)[ 	]*=.*/\1/p' < "$srcdir/po/Makevars.template" | LC_ALL=C sort > "$srcdir/po/Makevars.tmp2"
672        missingvars=`LC_ALL=C comm -13 "$srcdir/po/Makevars.tmp1" "$srcdir/po/Makevars.tmp2"`
673        rm -f "$srcdir/po/Makevars.tmp1" "$srcdir/po/Makevars.tmp2"
674        if test -n "$missingvars"; then
675          please="$please
676Please update po/Makevars so that it defines all the variables mentioned
677in po/Makevars.template.
678You can then remove po/Makevars.template.
679"
680        fi
681      else
682        please="$please
683Please create po/Makevars from the template in po/Makevars.template.
684You can then remove po/Makevars.template.
685"
686      fi
687      ;;
688    *)
689      same=no
690      if test -f "$srcdir/po/$file"; then
691        if cmp -s $file "$srcdir/po/$file"; then
692          same=yes
693        fi
694      fi
695      if $do_changelog && test $same = no; then
696        if test -f "$srcdir/po/$file"; then
697          func_poChangeLog_add_entry "	* $file: Upgrade to gettext-${version}."
698        else
699          func_poChangeLog_add_entry "	* $file: New file, from gettext-${version}."
700        fi
701      fi
702      func_backup po/$file
703      func_linkorcopy $file $gettext_dir/po/$file po/$file
704      ;;
705  esac
706done
707if test -f "$srcdir/po/cat-id-tbl.c"; then
708  func_remove po/cat-id-tbl.c
709  $do_changelog && func_poChangeLog_add_entry "	* cat-id-tbl.c: Remove file."
710fi
711if test -f "$srcdir/po/stamp-cat-id"; then
712  func_remove po/stamp-cat-id
713  $do_changelog && func_poChangeLog_add_entry "	* stamp-cat-id: Remove file."
714fi
715if test ! -f "$srcdir/po/POTFILES.in"; then
716  if $doit; then
717    echo "Creating initial po/POTFILES.in"
718    echo '# List of source files which contain translatable strings.' > "$srcdir/po/POTFILES.in"
719  else
720    echo "Create initial po/POTFILES.in"
721  fi
722  $do_changelog && func_poChangeLog_add_entry "	* POTFILES.in: New file."
723  please="$please
724Please fill po/POTFILES.in as described in the documentation.
725"
726fi
727$do_changelog && func_poChangeLog_finish
728
729# Determine whether we can assume automake 1.9 or newer.
730have_automake19=
731if (aclocal --version) >/dev/null 2>/dev/null; then
732  aclocal_version=`aclocal --version | sed -n -e 1p | sed -e 's/^[^0-9]*//'`
733  case $aclocal_version in
734    1.9* | 1.[1-9][0-9]* | [2-9]*) have_automake19=yes ;;
735  esac
736fi
737
738m4filelist='gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4
739 po.m4 progtest.m4'
740# With aclocal versions < 1.9 we need all m4 files, otherwise "aclocal -I m4"
741# might give an error. (aclocal < 1.9 didn't know which macros are really
742# needed, it looked which macros are potentially needed.)
743min_automake_version=1.9
744if test -n "$intldir" || test -z "$have_automake19"; then
745  # Add intldir.m4, intl.m4 and its dependencies.
746  m4filelist=$m4filelist' codeset.m4 glibc2.m4 glibc21.m4 intdiv0.m4 intl.m4
747   intldir.m4 intmax.m4 inttypes_h.m4 inttypes-pri.m4 lcmessage.m4 lock.m4
748   longdouble.m4 longlong.m4 printf-posix.m4 size_max.m4 stdint_h.m4
749   uintmax_t.m4 ulonglong.m4 visibility.m4 wchar_t.m4 wint_t.m4 xsize.m4'
750  min_automake_version=1.8
751fi
752
753# All sorts of bugs could occur if the configure file was remade with the wrong
754# version of gettext.m4 et al. (because then the configure and the po/Makefile.in.in
755# don't fit together). It is therefore important that the package carries the
756# right versions of gettext.m4 et al. with it.
757if test -f "$srcdir/Makefile.am"; then
758  # A package using automake.
759
760  # Determine whether it's using automake 1.8 or newer.
761  have_automake18=
762  if (aclocal --version) >/dev/null 2>/dev/null; then
763    aclocal_version=`aclocal --version | sed -n -e 1p | sed -e 's/^[^0-9]*//'`
764    case $aclocal_version in
765      1.[8-9]* | 1.[1-9][0-9]* | [2-9]*) have_automake18=yes ;;
766    esac
767  fi
768
769  # Extract the macro directory name from Makefile.am.
770  aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ 	]*=' "$srcdir/Makefile.am" | sed -e 's/^ACLOCAL_AMFLAGS[ 	]*=\(.*\)$/\1/'`
771  m4dir=m4
772  m4dir_defaulted=yes
773  m4dir_is_next=
774  for arg in $aclocal_amflags; do
775    if test -n "$m4dir_is_next"; then
776      # Ignore absolute directory pathnames, like /usr/local/share/aclocal.
777      case "$arg" in
778        /*) ;;
779        *)
780          m4dir="$arg"
781          m4dir_defaulted=
782          break
783          ;;
784      esac
785      m4dir_is_next=
786    else
787      if test "X$arg" = "X-I"; then
788        m4dir_is_next=yes
789      else
790        m4dir_is_next=
791      fi
792    fi
793  done
794
795  # Decide whether to use $m4dir/ChangeLog, or to use ChangeLog instead.
796  if test -d "$srcdir/$m4dir" && test -f "$srcdir/ChangeLog" && test ! -f "$srcdir/$m4dir/ChangeLog"; then
797    # The programmer has no $m4dir/ChangeLog so far. Don't introduce one.
798    using_m4ChangeLog=
799  fi
800
801  # Update the *.m4 files and the corresponding Makefile.am.
802  $do_changelog && func_m4ChangeLog_init
803  added_m4dir=
804  added_m4files=
805  if test -d "$srcdir/$m4dir"; then
806    :
807  else
808    if $doit; then
809      echo "Creating directory $m4dir"
810      mkdir "$srcdir/$m4dir"
811    else
812      echo "Create directory $m4dir"
813    fi
814    added_m4dir=yes
815  fi
816  for file in $m4filelist; do
817    same=no
818    if test -f "$srcdir/$m4dir/$file"; then
819      if cmp -s "@datadir@/aclocal/$file" "$srcdir/$m4dir/$file"; then
820        same=yes
821      fi
822    else
823      added_m4files="$added_m4files $file"
824    fi
825    if $do_changelog && test $same = no; then
826      if test -f "$srcdir/$m4dir/$file"; then
827        func_m4ChangeLog_add_entry "	* $file: Upgrade to gettext-${version}."
828      else
829        func_m4ChangeLog_add_entry "	* $file: New file, from gettext-${version}."
830      fi
831    fi
832    func_backup "$m4dir/$file"
833    func_linkorcopy "@datadir@/aclocal/$file" "@datadir@/aclocal/$file" "$m4dir/$file"
834  done
835  missing_m4Makefileam=
836  if test -n "$added_m4files"; then
837    if test -f "$srcdir/$m4dir/Makefile.am"; then
838      if $doit; then
839        echo "Updating EXTRA_DIST in $m4dir/Makefile.am (backup is in $m4dir/Makefile.am~)"
840        func_backup "$m4dir/Makefile.am"
841        rm -f "$srcdir/$m4dir/Makefile.am"
842        if grep '^EXTRA_DIST[ 	]*=' "$srcdir/$m4dir/Makefile.am~" > /dev/null; then
843          sed -e "s%^\(EXTRA_DIST[ 	]*=\) \\?%\\1$added_m4files %" < "$srcdir/$m4dir/Makefile.am~" > "$srcdir/$m4dir/Makefile.am"
844          $do_changelog && func_m4ChangeLog_add_entry "	* Makefile.am (EXTRA_DIST): Add the new files."
845        else
846          (cat "$srcdir/$m4dir/Makefile.am~"; echo; echo "EXTRA_DIST =$added_m4files") > "$srcdir/$m4dir/Makefile.am"
847          $do_changelog && func_m4ChangeLog_add_entry "	* Makefile.am (EXTRA_DIST): New variable."
848        fi
849      else
850        echo "Update EXTRA_DIST in $m4dir/Makefile.am"
851        $do_changelog && func_m4ChangeLog_add_entry "	* Makefile.am (EXTRA_DIST)."
852      fi
853    else
854      # $m4dir/Makefile.am is not needed any more when aclocal 1.8 or newer
855      # is used.
856      if test -z "$have_automake18"; then
857        if $doit; then
858          echo "Creating $m4dir/Makefile.am"
859          echo "EXTRA_DIST =$added_m4files" > "$srcdir/$m4dir/Makefile.am"
860        else
861          echo "Create $m4dir/Makefile.am"
862        fi
863        $do_changelog && func_m4ChangeLog_add_entry "	* Makefile.am: New file."
864        added_acoutput="$added_acoutput $m4dir/Makefile"
865      else
866        missing_m4Makefileam=yes
867      fi
868    fi
869  fi
870  if test -n "$added_m4dir" && test -z "$missing_m4Makefileam"; then
871    added_directories="$added_directories $m4dir"
872  fi
873  $do_changelog && func_m4ChangeLog_finish
874  # automake will arrange for $m4dir/ChangeLog to be distributed if a
875  # $m4dir/Makefile.am exists. If not, we need to add it to Makefile.am's
876  # EXTRA_DIST explicitly.
877  if test -n "$created_m4ChangeLog" && test -n "$missing_m4Makefileam"; then
878    added_extradist="$added_extradist $m4dir/ChangeLog"
879  fi
880
881  # Update the top-level Makefile.am.
882  modified_Makefile_am=
883  # func_modify_Makefile_am changelog_comment
884  # assumes a modified copy of $srcdir/Makefile.am in $srcdir/Makefile.am.tmp
885  # and replaces the original Makefile.am file with the modified one if
886  # the two files differ. Then it removes the modified copy.
887  func_modify_Makefile_am ()
888  {
889    if cmp -s "$srcdir/Makefile.am" "$srcdir/Makefile.am.tmp"; then
890      :
891    else
892      if test -z "$modified_Makefile_am"; then
893        if $doit; then
894          echo "Updating Makefile.am (backup is in Makefile.am~)"
895          func_backup Makefile.am
896        else
897          echo "Update Makefile.am"
898        fi
899      fi
900      if $doit; then
901        rm -f "$srcdir/Makefile.am"
902        cp "$srcdir/Makefile.am.tmp" "$srcdir/Makefile.am"
903      fi
904      if $do_changelog; then
905        if test -z "$modified_Makefile_am"; then
906          func_ChangeLog_add_entry "	* Makefile.am $1"
907        else
908          func_ChangeLog_add_entry "	$1"
909        fi
910      fi
911      modified_Makefile_am=yes
912    fi
913    rm -f "$srcdir/Makefile.am.tmp"
914  }
915
916  if test -n "$added_directories"; then
917    if grep '^SUBDIRS[ 	]*=' "$srcdir/Makefile.am" > /dev/null; then
918      sed -e "s%^\(SUBDIRS[ 	]*=\) \\?%\\1$added_directories %" < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
919      added_directories_pretty=`echo $added_directories | sed -e 's/ /, /g'`
920      func_modify_Makefile_am "(SUBDIRS): Add $added_directories_pretty."
921    else
922      (cat "$srcdir/Makefile.am"; echo; echo "SUBDIRS =$added_directories") > "$srcdir/Makefile.am.tmp"
923      func_modify_Makefile_am "(SUBDIRS): New variable."
924    fi
925  fi
926  if test -n "$removed_directory"; then
927    sed -e '/^SUBDIRS[ 	]*=/ {
928        :a
929        s%\([ 	]\)'"$removed_directory"'[ 	]%\1%
930        s%[ 	]'"$removed_directory"'$%%
931        tb
932        :b
933        s%\\$%\\%
934        tc
935        bd
936        :c
937        n
938        ba
939      :d
940    }' < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
941    func_modify_Makefile_am "(SUBDIRS): Remove $removed_directory."
942  fi
943  if test -n "$added_directories"; then
944    if grep '^DIST_SUBDIRS[ 	]*=' "$srcdir/Makefile.am" > /dev/null; then
945      sed -e "s%^\(DIST_SUBDIRS[ 	]*=\) \\?%\\1$added_directories %" < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
946      added_directories_pretty=`echo $added_directories | sed -e 's/ /, /g'`
947      func_modify_Makefile_am "(DIST_SUBDIRS): Add $added_directories_pretty."
948    fi
949  fi
950  if test -n "$removed_directory"; then
951    sed -e '/^DIST_SUBDIRS[ 	]*=/ {
952        :a
953        s%\([ 	]\)'"$removed_directory"'[ 	]%\1%
954        s%[ 	]'"$removed_directory"'$%%
955        tb
956        :b
957        s%\\$%\\%
958        tc
959        bd
960        :c
961        n
962        ba
963      :d
964    }' < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
965    func_modify_Makefile_am "(DIST_SUBDIRS): Remove $removed_directory."
966  fi
967  if test -n "$m4dir_defaulted"; then
968    if grep '^ACLOCAL_AMFLAGS[ 	]*=' "$srcdir/Makefile.am" > /dev/null; then
969      sed -e "s%^\(ACLOCAL_AMFLAGS[ 	]*=\) \\?%\\1 -I $m4dir %" < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
970      func_modify_Makefile_am "(ACLOCAL_AMFLAGS): Add -I $m4dir."
971    else
972      (cat "$srcdir/Makefile.am"; echo; echo "ACLOCAL_AMFLAGS = -I $m4dir") > "$srcdir/Makefile.am.tmp"
973      func_modify_Makefile_am "(ACLOCAL_AMFLAGS): New variable."
974    fi
975    # Also update Makefile.in and, if existent, Makefile. Otherwise they
976    # would take into account the new flags only after a few rounds of
977    # "./configure", "make", "touch configure.in", "make distclean".
978    if $doit; then
979      for file in Makefile.in Makefile; do
980        if test -f "$srcdir/$file"; then
981          func_backup $file
982          rm -f "$srcdir/$file"
983          sed -e "s%(ACLOCAL)%(ACLOCAL) -I $m4dir%" < "$srcdir/$file~" > "$srcdir/$file"
984        fi
985      done
986    fi
987  fi
988  if test -n "$added_extradist"; then
989    if grep '^EXTRA_DIST[ 	]*=' "$srcdir/Makefile.am" > /dev/null; then
990      sed -e "s%^\(EXTRA_DIST[ 	]*=\)%\\1$added_extradist %" < "$srcdir/Makefile.am" > "$srcdir/Makefile.am.tmp"
991      added_extradist_pretty=`echo $added_extradist | sed -e 's/ /, /g'`
992      func_modify_Makefile_am "(EXTRA_DIST): Add $added_extradist_pretty."
993    else
994      (cat "$srcdir/Makefile.am"; echo; echo "EXTRA_DIST =$added_extradist") > "$srcdir/Makefile.am.tmp"
995      func_modify_Makefile_am "(EXTRA_DIST): New variable."
996    fi
997  fi
998  # Extract the aclocal options name from Makefile.am.
999  aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ 	]*=' "$srcdir/Makefile.am" | sed -e 's/^ACLOCAL_AMFLAGS[ 	]*=\(.*\)$/\1/'`
1000  aclocal_options=
1001  m4dir_is_next=
1002  for arg in $aclocal_amflags; do
1003    if test -n "$m4dir_is_next"; then
1004      aclocal_options="$aclocal_options -I $arg"
1005      m4dir_is_next=
1006    else
1007      if test "X$arg" = "X-I"; then
1008        m4dir_is_next=yes
1009      else
1010        m4dir_is_next=
1011      fi
1012    fi
1013  done
1014  please="$please
1015Please run 'aclocal$aclocal_options' to regenerate the aclocal.m4 file.
1016You need aclocal from GNU automake $min_automake_version (or newer) to do this.
1017Then run 'autoconf' to regenerate the configure file.
1018"
1019
1020  # Also create $m4dir/Makefile.in from $m4dir/Makefile.am, because automake
1021  # doesn't do it by itself.
1022  if $doit; then
1023    case "$added_acoutput" in
1024      *" $m4dir/Makefile")
1025        (cd "$srcdir" && automake "$m4dir/Makefile") 2>/dev/null ||
1026        please="$please
1027Please run 'automake $m4dir/Makefile' to create $m4dir/Makefile.in
1028"
1029        ;;
1030    esac
1031  fi
1032else
1033  please="$please
1034Please add the files
1035$m4filelist
1036from the @datadir@/aclocal directory to your aclocal.m4 file.
1037"
1038fi
1039
1040modified_configure_in=
1041# func_modify_configure_in changelog_comment
1042# assumes a modified copy of $srcdir/$configure_in in $srcdir/$configure_in.tmp
1043# and replaces the original configure.in/ac file with the modified one if
1044# the two files differ. Then it removes the modified copy.
1045func_modify_configure_in ()
1046{
1047  if cmp -s "$srcdir/$configure_in" "$srcdir/$configure_in.tmp"; then
1048    :
1049  else
1050    if test -z "$modified_configure_in"; then
1051      if $doit; then
1052        echo "Updating $configure_in (backup is in $configure_in~)"
1053        func_backup $configure_in
1054      else
1055        echo "Update $configure_in"
1056      fi
1057    fi
1058    if $doit; then
1059      rm -f "$srcdir/$configure_in"
1060      cp "$srcdir/$configure_in.tmp" "$srcdir/$configure_in"
1061    fi
1062    if $do_changelog; then
1063      if test -z "$modified_configure_in"; then
1064        func_ChangeLog_add_entry "	* $configure_in $1"
1065      else
1066        func_ChangeLog_add_entry "	$1"
1067      fi
1068    fi
1069    modified_configure_in=yes
1070  fi
1071  rm -f "$srcdir/$configure_in.tmp"
1072}
1073
1074if test -n "$added_acoutput"; then
1075  if grep '^AC_CONFIG_FILES(' "$srcdir/$configure_in" > /dev/null; then
1076    sedprog='
1077ta
1078b
1079:a
1080n
1081ba'
1082    sed -e "s%^\\(AC_CONFIG_FILES([^])\\,]*\\)%\\1$added_acoutput%$sedprog" < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
1083    added_acoutput_pretty=`echo $added_acoutput | sed -e 's/ /, /g'`
1084    func_modify_configure_in "(AC_CONFIG_FILES): Add $added_acoutput_pretty."
1085  else
1086    if grep '^AC_OUTPUT(' "$srcdir/$configure_in" > /dev/null; then
1087      sed -e "s%^\\(AC_OUTPUT([^])\\,]*\\)%\\1$added_acoutput%" < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
1088      added_acoutput_pretty=`echo $added_acoutput | sed -e 's/ /, /g'`
1089      func_modify_configure_in "(AC_OUTPUT): Add $added_acoutput_pretty."
1090    else
1091      please="$please
1092Please add$added_acoutput to the AC_OUTPUT or AC_CONFIG_FILES invocation in the $configure_in file.
1093"
1094    fi
1095  fi
1096fi
1097if test -n "$removed_acoutput"; then
1098  for file in $removed_acoutput; do
1099    tag=
1100    sedprog='{
1101      s%\([[ 	]\)'"$file"'[ 	]%\1%
1102      s%\([[ 	]\)'"$file"'\([]),]\)%\1\2%
1103      s%[[ 	]'"$file"'$%%
1104        :a
1105        tb
1106        :b
1107        s%\\$%\\%
1108        tc
1109        bd
1110        :c
1111        n
1112        s%\([ 	]\)'"$file"'[ 	]%\1%
1113        s%\([ 	]\)'"$file"'\([]),]\)%\1\2%
1114        s%[ 	]'"$file"'$%%
1115        ba
1116      :d
1117    }'
1118    sed -e '/^AC_CONFIG_FILES(/'"$sedprog" < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
1119    if cmp -s "$srcdir/$configure_in" "$srcdir/$configure_in.tmp"; then
1120      sed -e '/^AC_OUTPUT(/'"$sedprog" < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
1121      if cmp -s "$srcdir/$configure_in" "$srcdir/$configure_in.tmp"; then
1122        :
1123      else
1124        tag=AC_OUTPUT
1125      fi
1126    else
1127      tag=AC_CONFIG_FILES
1128    fi
1129    if test -n "$tag"; then
1130      func_modify_configure_in "($tag): Remove $file."
1131    else
1132      rm -f "$srcdir/$configure_in.tmp"
1133      if test "$file" != intl/intlh.inst; then
1134        please="$please
1135Please remove $file from the AC_OUTPUT or AC_CONFIG_FILES invocation
1136in the $configure_in file.
1137"
1138      fi
1139    fi
1140  done
1141fi
1142sed -e 's%sed -e "/POTFILES =/r po/POTFILES" po/Makefile\.in > po/Makefile *;* *%%' < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
1143func_modify_configure_in "(AC_OUTPUT): Remove command that created po/Makefile."
1144sed -e '/^\(dnl \|\)AC_LINK_FILES(\$nls_cv_header_libgt, \$nls_cv_header_intl)$/d' < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
1145func_modify_configure_in "(AC_LINK_FILES): Remove invocation."
1146sed -e 's/^AM_GNU_GETTEXT_VERSION([^()]*)/AM_GNU_GETTEXT_VERSION(['"$version"'])/' < "$srcdir/$configure_in" > "$srcdir/$configure_in.tmp"
1147func_modify_configure_in "(AM_GNU_GETTEXT_VERSION): Bump to $version."
1148$do_changelog && func_ChangeLog_finish
1149
1150# Recommend replacement for deprecated Makefile variables.
1151use_libtool=`cat "$srcdir/$configure_in" | grep '^A[CM]_PROG_LIBTOOL'`
1152for file in `(cd "$srcdir"; find . -name Makefile.am -print; find . -name Makefile.in -print) | sed -e 's,^\./,,'`; do
1153  if test -f "$srcdir/$file"; then
1154    if test `echo "$file" | sed -e 's,^.*/,,'` = Makefile.in && grep automake "$srcdir/$file" >/dev/null 2>&1; then
1155      continue;
1156    fi
1157    # INTLLIBS is deprecated because it doesn't distinguish the two
1158    # cases: with libtool, without libtool.
1159    if grep '@''INTLLIBS''@' "$srcdir/$file" >/dev/null 2>&1; then
1160      if test -n "$use_libtool"; then
1161        please="$please
1162Please change $file to use @""LTLIBINTL""@ or @""LIBINTL""@ instead of
1163@""INTLLIBS""@. Which one, depends whether it is used with libtool or not.
1164@""INTLLIBS""@ will go away.
1165"
1166      else
1167        please="$please
1168Please change $file to use @""LIBINTL""@ instead of @""INTLLIBS""@.
1169@""INTLLIBS""@ will go away.
1170"
1171      fi
1172    fi
1173    # DATADIRNAME is deprecated because we install only .gmo files nowadays,
1174    # which can be stored in the platform independent $prefix/share hierarchy.
1175    if grep '@''DATADIRNAME''@' "$srcdir/$file" >/dev/null 2>&1; then
1176      please="$please
1177Please change $file to use the constant string \"share\" instead of
1178@""DATADIRNAME""@. @""DATADIRNAME""@ will go away.
1179"
1180    fi
1181    # INSTOBJEXT is deprecated because we install only .gmo files nowadays,
1182    # no catgets .cat catalogs.
1183    if grep '@''INSTOBJEXT''@' "$srcdir/$file" >/dev/null 2>&1; then
1184      please="$please
1185Please change $file to use the constant string \".mo\" instead of
1186@""INSTOBJEXT""@. @""INSTOBJEXT""@ will go away.
1187"
1188    fi
1189    # GENCAT is deprecated because we install no catgets catalogs anymore.
1190    if grep '@''GENCAT''@' "$srcdir/$file" >/dev/null 2>&1; then
1191      please="$please
1192Please change $file to use the constant string \"gencat\" instead of
1193@""GENCAT""@. @""GENCAT""@ will go away. Maybe you don't even need it any more?
1194"
1195    fi
1196    # POSUB is deprecated because it causes "./configure --disable-nls", "make",
1197    # "make dist" to create a buggy tarfile.
1198    if grep '@''POSUB''@' "$srcdir/$file" >/dev/null 2>&1; then
1199      please="$please
1200Please change $file to use the constant string \"po\" instead of
1201@""POSUB""@. @""POSUB""@ will go away.
1202"
1203    fi
1204  fi
1205done
1206
1207# Recommend replacement for deprecated configure variables.
1208if grep '\$nls_cv_header_' "$srcdir/$configure_in" >/dev/null 2>&1; then
1209  please="$please
1210Please stop using \$nls_cv_header_intl or \$nls_cv_header_libgt in the
1211$configure_in file. Both will go away. Use <libintl.h> or \"gettext.h\" instead.
1212"
1213fi
1214
1215# Recommend fetching config.guess and config.sub.
1216if test -f "$srcdir/$auxdir"config.guess && test -f "$srcdir/$auxdir"config.sub; then
1217  :
1218else
1219  please="$please
1220You will also need config.guess and config.sub, which you can get from the CVS
1221of the 'config' project at http://savannah.gnu.org/. The commands to fetch them
1222are
1223\$ wget 'http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess'
1224\$ wget 'http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub'
1225"
1226fi
1227
1228if $doit; then
1229  echo "$please"
1230  echo "You might also want to copy the convenience header file gettext.h"
1231  echo "from the $gettext_dir directory into your package."
1232  echo "It is a wrapper around <libintl.h> that implements the configure --disable-nls"
1233  echo "option."
1234  echo
1235  count=`echo "$please" | grep '^$' | wc -l`
1236  count=`echo "$count" | sed -e 's/[ 	]//g'`
1237  case "$count" in
1238    1) count="paragraph";;
1239    2) count="two paragraphs";;
1240    3) count="three paragraphs";;
1241    4) count="four paragraphs";;
1242    5) count="five paragraphs";;
1243    *) count="$count paragraphs";;
1244  esac
1245  echo "Press Return to acknowledge the previous $count."
1246  # Read from /dev/tty, not stdin, so that gettextize cannot be abused by
1247  # non-interactive tools.
1248  read dummy < /dev/tty
1249fi
1250
1251exit 0
1252