bootstrap 4.1 KB

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