Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

189 rader
5.4 KiB

  1. #! /bin/sh
  2. #
  3. # Copyright (C) 1995-1998, 2000, 2001 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
  17. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. #
  19. # - Modified in October 2001 by jacob berkman <jacob@ximian.com> to
  20. # work with glib's Makefile.in.in and po2tbl.sed.in, to not copy in
  21. # intl/, and to not add ChangeLog entries to po/ChangeLog
  22. # This file is meant for authors or maintainers which want to
  23. # internationalize their package with the help of GNU gettext. For
  24. # further information how to use it consult the GNU gettext manual.
  25. echo=echo
  26. progname=$0
  27. force=0
  28. configstatus=0
  29. origdir=`pwd`
  30. usage="\
  31. Usage: glib-gettextize [OPTION]... [package-dir]
  32. --help print this help and exit
  33. --version print version information and exit
  34. -c, --copy copy files instead of making symlinks
  35. -f, --force force writing of new files even if old exist
  36. Report bugs to http://bugzilla.gnome.org/."
  37. package=glib
  38. version=2.26.1
  39. try_ln_s=:
  40. # Directory where the sources are stored.
  41. prefix=c:/devel/target/059c48de6b739307c37648aba3005b29
  42. case `uname` in
  43. MINGW32*)
  44. prefix="`dirname $0`/.."
  45. ;;
  46. esac
  47. datadir=${datarootdir}
  48. datarootdir=${prefix}/share
  49. gettext_dir=$prefix/share/glib-2.0/gettext
  50. while test $# -gt 0; do
  51. case "$1" in
  52. -c | --copy | --c* )
  53. shift
  54. try_ln_s=false ;;
  55. -f | --force | --f* )
  56. shift
  57. force=1 ;;
  58. -r | --run | --r* )
  59. shift
  60. configstatus=1 ;;
  61. --help | --h* )
  62. $echo "$usage"; exit 0 ;;
  63. --version | --v* )
  64. echo "$progname (GNU $package) $version"
  65. $echo "Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
  66. This is free software; see the source for copying conditions. There is NO
  67. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  68. $echo "Written by" "Ulrich Drepper"
  69. exit 0 ;;
  70. -- ) # Stop option prcessing
  71. shift; break ;;
  72. -* )
  73. $echo "glib-gettextize: unknown option $1"
  74. $echo "Try \`glib-gettextize --help' for more information."; exit 1 ;;
  75. * )
  76. break ;;
  77. esac
  78. done
  79. if test $# -gt 1; then
  80. $echo "$usage"
  81. exit 1
  82. fi
  83. # Fill in the command line options value.
  84. if test $# -eq 1; then
  85. srcdir=$1
  86. if cd "$srcdir"; then
  87. srcdir=`pwd`
  88. else
  89. $echo "Cannot change directory to \`$srcdir'"
  90. exit 1
  91. fi
  92. else
  93. srcdir=$origdir
  94. fi
  95. test -f configure.in || test -f configure.ac || {
  96. $echo "Missing configure.in or configure.ac, please cd to your package first."
  97. exit 1
  98. }
  99. configure_in=NONE
  100. if test -f configure.in; then
  101. configure_in=configure.in
  102. else
  103. if test -f configure.ac; then
  104. configure_in=configure.ac
  105. fi
  106. fi
  107. # Check in which directory config.rpath, mkinstalldirs etc. belong.
  108. 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`
  109. if test -n "$auxdir"; then
  110. auxdir="$auxdir/"
  111. fi
  112. if test -f po/Makefile.in.in && test $force -eq 0; then
  113. $echo "\
  114. po/Makefile.in.in exists: use option -f if you really want to delete it."
  115. exit 1
  116. fi
  117. test -d po || {
  118. $echo "Creating po/ subdirectory"
  119. mkdir po || {
  120. $echo "failed to create po/ subdirectory"
  121. exit 1
  122. }
  123. }
  124. # For simplicity we changed to the gettext source directory.
  125. cd $gettext_dir || {
  126. $echo "gettext source directory '${gettext_dir}' doesn't exist"
  127. exit 1
  128. }
  129. # Now copy all files. Take care for the destination directories.
  130. for file in *; do
  131. case $file in
  132. intl | po)
  133. ;;
  134. mkinstalldirs)
  135. rm -f "$srcdir/$auxdir$file"
  136. ($try_ln_s && ln -s $gettext_dir/$file "$srcdir/$auxdir$file" && $echo "Symlinking file $file") 2>/dev/null ||
  137. { $echo "Copying file $file"; cp $file "$srcdir/$auxdir$file"; }
  138. ;;
  139. *)
  140. rm -f "$srcdir/$file"
  141. ($try_ln_s && ln -s $gettext_dir/$file "$srcdir/$file" && $echo "Symlinking file $file") 2>/dev/null ||
  142. { $echo "Copying file $file"; cp $file "$srcdir/$file"; }
  143. ;;
  144. esac
  145. done
  146. # Copy files to po/ subdirectory.
  147. cd po
  148. for file in *; do
  149. rm -f "$srcdir/po/$file"
  150. ($try_ln_s && ln -s $gettext_dir/po/$file "$srcdir/po/$file" && $echo "Symlinking file po/$file") 2>/dev/null ||
  151. { $echo "Copying file po/$file"; cp $file "$srcdir/po/$file"; }
  152. done
  153. if test -f "$srcdir/po/cat-id-tbl.c"; then
  154. $echo "Removing po/cat-id-tbl.c"
  155. rm -f "$srcdir/po/cat-id-tbl.c"
  156. fi
  157. if test -f "$srcdir/po/stamp-cat-id"; then
  158. $echo "Removing po/stamp-cat-id"
  159. rm -f "$srcdir/po/stamp-cat-id"
  160. fi
  161. echo
  162. echo "Please add the files"
  163. echo " codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4"
  164. echo " progtest.m4"
  165. echo "from the $datadir/aclocal directory to your autoconf macro directory"
  166. echo "or directly to your aclocal.m4 file."
  167. echo "You will also need config.guess and config.sub, which you can get from"
  168. echo "ftp://ftp.gnu.org/pub/gnu/config/."
  169. echo
  170. exit 0