3 # Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
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)
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.
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
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # - Modified in October 2001 by jacob berkman <jacob@ximian.com> to
21 # work with glib's Makefile.in.in and po2tbl.sed.in, to not copy in
22 # intl/, and to not add ChangeLog entries to po/ChangeLog
24 # This file is meant for authors or maintainers which want to
25 # internationalize their package with the help of GNU gettext. For
26 # further information how to use it consult the GNU gettext manual.
34 Usage: glib-gettextize [OPTION]... [package-dir]
35 --help print this help and exit
36 --version print version information and exit
37 -c, --copy copy files instead of making symlinks
38 -f, --force force writing of new files even if old exist
39 Report bugs to http://bugzilla.gnome.org/."
44 # Directory where the sources are stored.
46 gettext_dir=@prefix@/share/glib-2.0/gettext
48 while test $# -gt 0; do
60 $echo "$usage"; exit 0 ;;
62 echo "$progname (GNU $package) $version"
63 $echo "Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
64 This is free software; see the source for copying conditions. There is NO
65 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
66 $echo "Written by" "Ulrich Drepper"
68 -- ) # Stop option prcessing
71 $echo "glib-gettextize: unknown option $1"
72 $echo "Try \`glib-gettextize --help' for more information."; exit 1 ;;
78 if test $# -gt 1; then
83 # Fill in the command line options value.
84 if test $# -eq 1; then
89 $echo "Cannot change directory to \`$srcdir'"
96 test -f configure.in || test -f configure.ac || {
97 $echo "Missing configure.in or configure.ac, please cd to your package first."
102 if test -f configure.in; then
103 configure_in=configure.in
105 if test -f configure.ac; then
106 configure_in=configure.ac
109 # Check in which directory config.rpath, mkinstalldirs etc. belong.
110 auxdir=`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`
111 if test -n "$auxdir"; then
115 if test -f po/Makefile.in.in && test $force -eq 0; then
117 po/Makefile.in.in exists: use option -f if you really want to delete it."
122 $echo "Creating po/ subdirectory"
124 $echo "failed to create po/ subdirectory"
129 # For simplicity we changed to the gettext source directory.
131 $echo "gettext source directory '${gettext_dir}' doesn't exist"
135 # Now copy all files. Take care for the destination directories.
141 rm -f "$srcdir/$auxdir$file"
142 ($try_ln_s && ln -s $gettext_dir/$file "$srcdir/$auxdir$file" && $echo "Symlinking file $file") 2>/dev/null ||
143 { $echo "Copying file $file"; cp $file "$srcdir/$auxdir$file"; }
146 rm -f "$srcdir/$file"
147 ($try_ln_s && ln -s $gettext_dir/$file "$srcdir/$file" && $echo "Symlinking file $file") 2>/dev/null ||
148 { $echo "Copying file $file"; cp $file "$srcdir/$file"; }
153 # Copy files to po/ subdirectory.
156 rm -f "$srcdir/po/$file"
157 ($try_ln_s && ln -s $gettext_dir/po/$file "$srcdir/po/$file" && $echo "Symlinking file po/$file") 2>/dev/null ||
158 { $echo "Copying file po/$file"; cp $file "$srcdir/po/$file"; }
160 if test -f "$srcdir/po/cat-id-tbl.c"; then
161 $echo "Removing po/cat-id-tbl.c"
162 rm -f "$srcdir/po/cat-id-tbl.c"
164 if test -f "$srcdir/po/stamp-cat-id"; then
165 $echo "Removing po/stamp-cat-id"
166 rm -f "$srcdir/po/stamp-cat-id"
170 echo "Please add the files"
171 echo " codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4"
173 echo "from the @datadir@/aclocal directory to your autoconf macro directory"
174 echo "or directly to your aclocal.m4 file."
175 echo "You will also need config.guess and config.sub, which you can get from"
176 echo "ftp://ftp.gnu.org/pub/gnu/config/."