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