bootstrap 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. #! /bin/sh
  2. # Bootstrap 'tar' from CVS.
  3. # Copyright (C) 2003 Free Software Foundation, Inc.
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  15. # 02111-1307, USA.
  16. # Written by Paul Eggert.
  17. # URL of our text domain page in Translation Project
  18. TP_URL="http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/"
  19. usage() {
  20. cat <<EOF
  21. usage: $0 [--gnulib-srcdir=DIR][--cvs-auth=AUTH-METHOD][--cvs-user=USERNAME][--no-po]
  22. Options are:
  23. --gnulib-srcdir=DIRNAME Specify the local directory where gnulib
  24. sources reside. Use this if you already
  25. have gnulib sources on your machine, and
  26. do not want to waste your bandwidth dowloading
  27. them again.
  28. --cvs-auth=METHOD Set the CVS access method used for downloading
  29. gnulib files. METHOD is one of the keywords
  30. accepted by cvs -d option (see info cvs
  31. repository).
  32. --cvs-user=USERNAME Set the CVS username to be used when accessing
  33. the gnulib repository.
  34. --no-po Do not download po files.
  35. Running without arguments will suffice in most cases. It is equivalent
  36. to
  37. ./bootstrap --cvs-auth=ext --cvs-user=anoncvs
  38. EOF
  39. }
  40. # Parse options.
  41. DOWNLOAD_PO=yes
  42. for option
  43. do
  44. case $option in
  45. --help)
  46. usage
  47. exit;;
  48. --gnulib-srcdir=*)
  49. GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
  50. --cvs-auth=*)
  51. CVS_AUTH=`expr "$option" : '--cvs-auth=\(.*\)'`;;
  52. --cvs-user=*)
  53. CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;;
  54. --no-po)
  55. DOWNLOAD_PO=no;;
  56. *)
  57. echo >&2 "$0: $option: unknown option"
  58. exit 1;;
  59. esac
  60. done
  61. echo "$0: Bootstrapping CVS tar..."
  62. build_cvs_prefix() {
  63. CVS_PREFIX=:${1}:
  64. if [ "${2}" != - ]; then
  65. CVS_PREFIX=${CVS_PREFIX}${2}@
  66. fi
  67. if [ "$1" = "ext" ]; then
  68. if [ -z "${CVS_RSH}" ]; then
  69. CVS_RSH=ssh
  70. export CVS_RSH
  71. fi
  72. fi
  73. }
  74. # Get gnulib files.
  75. case ${GNULIB_SRCDIR--} in
  76. -)
  77. if [ ! -d gnulib ]; then
  78. echo "$0: getting gnulib files..."
  79. trap exit 1 2 13 15
  80. trap 'rm -fr gnulib; exit 1' 0
  81. case "${CVS_AUTH--}" in
  82. -) build_cvs_prefix ext anoncvs;;
  83. pserver) build_cvs_prefix $CVS_AUTH ${CVS_USER:-anoncvs};;
  84. gserver|server)
  85. build_cvs_prefix $CVS_AUTH ${CVS_USER--};;
  86. ext) build_cvs_prefix $CVS_AUTH ${CVS_USER--};;
  87. *) echo "$0: Unknown CVS access method" >&2
  88. exit 1;;
  89. esac
  90. if [ "${CVS_AUTH--}" = "pserver" ]; then
  91. cvs -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib login || exit
  92. fi
  93. cvs -q -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib co gnulib || exit
  94. trap 0
  95. fi
  96. GNULIB_SRCDIR=gnulib
  97. esac
  98. <$GNULIB_SRCDIR/gnulib-tool || exit
  99. gnulib_modules='
  100. alloca
  101. argmatch
  102. backupfile
  103. dirname
  104. error
  105. exclude
  106. fileblocks
  107. fnmatch-gnu
  108. ftruncate
  109. full-write
  110. getdate
  111. getline
  112. getopt
  113. gettext
  114. hash
  115. human
  116. lchown
  117. memset
  118. modechange
  119. obstack
  120. quote
  121. quotearg
  122. rmdir
  123. safe-read
  124. save-cwd
  125. savedir
  126. stdbool
  127. stpcpy
  128. strtol
  129. strtoul
  130. unlocked-io
  131. utime
  132. xalloc
  133. xgetcwd
  134. xstrtoumax
  135. '
  136. previous_gnulib_modules=
  137. while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
  138. previous_gnulib_modules=$gnulib_modules
  139. gnulib_modules=`
  140. (echo "$gnulib_modules"
  141. for gnulib_module in $gnulib_modules; do
  142. $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
  143. done) | sort -u
  144. `
  145. done
  146. gnulib_files=`
  147. (for gnulib_module in $gnulib_modules; do
  148. $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
  149. done) | sort -u
  150. `
  151. gnulib_dirs=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
  152. mkdir -p $gnulib_dirs || exit
  153. for gnulib_file in $gnulib_files; do
  154. dest=$gnulib_file
  155. case $gnulib_file in
  156. m4/codeset.m4) continue;;
  157. m4/glibc21.m4) continue;;
  158. m4/intdiv0.m4) continue;;
  159. m4/inttypes_h.m4) continue;;
  160. m4/inttypes.m4) continue;;
  161. m4/inttypes-pri.m4) continue;;
  162. m4/isc-posix.m4) continue;;
  163. m4/lcmessage.m4) continue;;
  164. m4/onceonly_2_57.m4) dest=m4/onceonly.m4;;
  165. esac
  166. rm -f $dest &&
  167. echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
  168. cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
  169. done
  170. # Get translations.
  171. if test "$DOWNLOAD_PO" = "yes"; then
  172. echo "$0: getting translations into po..."
  173. (cd po &&
  174. rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'` &&
  175. wget -nv -nd -r -l 1 -A .po -C off $TP_URL &&
  176. ls *.po | sed 's/\.po$//' >LINGUAS
  177. ) || exit
  178. fi
  179. # Reconfigure, getting other files.
  180. echo "$0: autoreconf --verbose --install --force ..."
  181. autoreconf --verbose --install --force
  182. echo "$0: done. Now you can run './configure'."