glib-gettextize 5.5 KB

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