bootstrap 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. # Parse options.
  18. for option
  19. do
  20. case $option in
  21. --help)
  22. echo "$0: usage: $0 [--gnulib-srcdir=DIR][--cvs-auth=AUTH-METHOD][--cvs-user=USERNAME]"
  23. exit;;
  24. --gnulib-srcdir=*)
  25. GNULIB_SRCDIR=`expr "$1" : '--gnulib-srcdir=\(.*\)'`;;
  26. --cvs-auth=*)
  27. CVS_AUTH=`expr "$1" : '--cvs-auth=\(.*\)'`;;
  28. --cvs-user=*)
  29. CVS_USER=`expr "$1" : '--cvs-user=\(.*\)'`;;
  30. *)
  31. echo >&2 "$0: $option: unknown option"
  32. exit 1;;
  33. esac
  34. done
  35. echo "$0: Bootstrapping CVS tar..."
  36. build_cvs_prefix() {
  37. CVS_PREFIX=:${1}:
  38. if [ "${2}" != - ]; then
  39. CVS_PREFIX=${CVS_PREFIX}${2}@
  40. fi
  41. }
  42. # Get gnulib files.
  43. case ${GNULIB_SRCDIR--} in
  44. -)
  45. if [ ! -d gnulib ]; then
  46. echo "$0: getting gnulib files..."
  47. trap exit 1 2 13 15
  48. trap 'rm -fr gnulib; exit 1' 0
  49. case "${CVS_AUTH--}" in
  50. -) : ${CVS_RSH:?}
  51. CVS_PREFIX="";;
  52. pserver) build_cvs_prefix $CVS_AUTH ${CVS_USER:-anoncvs};;
  53. gserver|server)
  54. build_cvs_prefix $CVS_AUTH ${CVS_USER--};;
  55. ext) : ${CVS_RSH:?}
  56. build_cvs_prefix $CVS_AUTH ${CVS_USER--};;
  57. *) echo "$0: Unknown CVS access method" >&2
  58. exit 1;;
  59. esac
  60. if [ "${CVS_AUTH--}" = "pserver" ]; then
  61. cvs -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib login || exit
  62. fi
  63. cvs -q -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib co gnulib || exit
  64. trap 0
  65. fi
  66. GNULIB_SRCDIR=gnulib
  67. esac
  68. <$GNULIB_SRCDIR/gnulib-tool || exit
  69. gnulib_modules='
  70. alloca
  71. argmatch
  72. backupfile
  73. dirname
  74. error
  75. exclude
  76. fileblocks
  77. fnmatch-gnu
  78. ftruncate
  79. full-write
  80. getdate
  81. getline
  82. getopt
  83. gettext
  84. hash
  85. human
  86. lchown
  87. memset
  88. modechange
  89. obstack
  90. quote
  91. quotearg
  92. rmdir
  93. safe-read
  94. save-cwd
  95. savedir
  96. stdbool
  97. strtol
  98. strtoul
  99. unlocked-io
  100. utime
  101. xalloc
  102. xgetcwd
  103. xstrtoumax
  104. '
  105. previous_gnulib_modules=
  106. while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
  107. previous_gnulib_modules=$gnulib_modules
  108. gnulib_modules=`
  109. (echo "$gnulib_modules"
  110. for gnulib_module in $gnulib_modules; do
  111. $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
  112. done) | sort -u
  113. `
  114. done
  115. gnulib_files=`
  116. (for gnulib_module in $gnulib_modules; do
  117. $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
  118. done) | sort -u
  119. `
  120. gnulib_dirs=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
  121. mkdir -p $gnulib_dirs || exit
  122. for gnulib_file in $gnulib_files; do
  123. dest=$gnulib_file
  124. case $gnulib_file in
  125. m4/codeset.m4) continue;;
  126. m4/glibc21.m4) continue;;
  127. m4/intdiv0.m4) continue;;
  128. m4/inttypes_h.m4) continue;;
  129. m4/inttypes.m4) continue;;
  130. m4/inttypes-pri.m4) continue;;
  131. m4/isc-posix.m4) continue;;
  132. m4/lcmessage.m4) continue;;
  133. m4/onceonly_2_57.m4) dest=m4/onceonly.m4;;
  134. esac
  135. rm -f $dest &&
  136. echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
  137. cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
  138. done
  139. # Get translations.
  140. echo "$0: getting translations into po..."
  141. (cd po &&
  142. rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'` &&
  143. wget -nv -nd -r -l 1 -A .po -C off \
  144. http://www.iro.umontreal.ca/contrib/po/maint/tar/ &&
  145. ls *.po | sed 's/\.po$//' >LINGUAS
  146. ) || exit
  147. # Reconfigure, getting other files.
  148. echo "$0: autoreconf --verbose --install --force ..."
  149. autoreconf --verbose --install --force
  150. echo "$0: done. Now you can run './configure'."