X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Fbootstrap;h=9a85762014de6d765dd61918b846522ab6c8ff26;hb=b792aeb401b00124b3c27c9f1d850d3312e7b849;hp=14b2d4d8e6caf36f9c0a4f050f74bde5fddac84d;hpb=07051aa2e143a0bc761d90f4e90bd2c8906c1df4;p=gnulib.git diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 14b2d4d8e..9a8576201 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -2,7 +2,7 @@ # Bootstrap this package from checked-out sources. -# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2003-2008 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -48,8 +48,6 @@ Options: --force Attempt to bootstrap even if the sources seem not to have been checked out. --skip-po Do not download po files. - --cvs-user=USERNAME Set the username to use when checking out - sources from the gnulib repository. If the file bootstrap.conf exists in the current working directory, its contents are read as shell variables to configure the bootstrap. @@ -79,9 +77,10 @@ po_download_command_format=\ extract_package_name=' /^AC_INIT(/{ - /.*,.*,.*,/{ + /.*,.*,.*, */{ s/// s/[][]//g + s/)$// p q } @@ -97,6 +96,11 @@ package=`sed -n "$extract_package_name" configure.ac` || exit gnulib_name=lib$package build_aux=build-aux +source_base=lib +m4_base=m4 +doc_base=doc +tests_base=tests + # Extra files from gnulib, which override files from other sources. gnulib_extra_files=" $build_aux/install-sh @@ -122,6 +126,9 @@ XGETTEXT_OPTIONS='\\\ --flag=error:3:c-format --flag=error_at_line:5:c-format\\\ ' +# Package bug report address for gettext files +MSGID_BUGS_ADDRESS=bug-$package@gnu.org + # Files we don't want to import. excluded_files= @@ -159,8 +166,6 @@ do exit;; --gnulib-srcdir=*) GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;; - --cvs-user=*) - CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;; --skip-po) SKIP_PO=t;; --force) @@ -226,23 +231,9 @@ case ${GNULIB_SRCDIR--} in if [ ! -d gnulib ]; then echo "$0: getting gnulib files..." - case ${CVS_AUTH-pserver} in - pserver) - CVS_PREFIX=':pserver:anonymous@';; - ssh) - CVS_PREFIX="$CVS_USER${CVS_USER+@}";; - *) - echo "$0: $CVS_AUTH: Unknown CVS access method" >&2 - exit 1;; - esac - - case $CVS_RSH in - '') CVS_RSH=ssh; export CVS_RSH;; - esac - trap cleanup_gnulib 1 2 13 15 - cvs -z3 -q -d ${CVS_PREFIX}cvs.savannah.gnu.org:/cvsroot/gnulib co gnulib || + git clone --depth 2 git://git.sv.gnu.org/gnulib || cleanup_gnulib trap - 1 2 13 15 @@ -280,13 +271,18 @@ update_po_files() { && ls "$ref_po_dir"/*.po 2>/dev/null | sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" + langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'` + test "$langs" = '*' && langs=x for po in `cd $ref_po_dir && echo *.po|sed 's/\.po//g'`; do - new_po="$ref_po_dir/$po.po" - cksum_file="$ref_po_dir/$po.s1" - if ! sha1sum -c --status "$cksum_file" < "$new_po" > /dev/null; then - echo "updated $po_dir/$po.po..." - cp "$new_po" "$po_dir/$po.po" && sha1sum < "$new_po" > "$cksum_file" - fi + case $po in x) continue;; esac + new_po="$ref_po_dir/$po.po" + cksum_file="$ref_po_dir/$po.s1" + if ! test -f "$cksum_file" || + ! test -f "$po_dir/$po.po" || + ! sha1sum -c --status "$cksum_file" < "$new_po" > /dev/null; then + echo "updated $po_dir/$po.po..." + cp "$new_po" "$po_dir/$po.po" && sha1sum < "$new_po" > "$cksum_file" + fi done } @@ -380,6 +376,11 @@ cp_mark_as_generated() *) c1= ; c2= ;; esac + # If the destination directory doesn't exist, create it. + # This is required at least for "lib/uniwidth/cjk.h". + dst_dir=`dirname "$cp_dst"` + test -d "$dst_dir" || mkdir -p "$dst_dir" + if test -z "$c1"; then cmp -s "$cp_src" "$cp_dst" || { echo "$0: cp -f $cp_src $cp_dst" && @@ -413,7 +414,9 @@ version_controlled_file() { grep -F "/$file/" $dir/CVS/Entries 2>/dev/null | grep '^/[^/]*/[0-9]' > /dev/null && found=yes elif test -d .git; then - git-rm -n "$dir/$file" > /dev/null 2>&1 && found=yes + git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes + elif test -d .svn; then + svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes else echo "$0: no version control for $dir/$file?" >&2 fi @@ -468,7 +471,7 @@ slurp() { ig=$dir/$dot_ig if test -n "$copied"; then insert_sorted_if_absent $ig "$copied" - # If an ignored file name ends with _.h, then also add + # If an ignored file name ends with .in.h, then also add # the name with just ".h". Many gnulib headers are generated, # e.g., stdint.in.h -> stdint.h, dirent.in.h ->..., etc. # Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed @@ -495,13 +498,13 @@ gnulib_tool_options="\ --import\ --no-changelog\ --aux-dir $bt/$build_aux\ - --doc-base $bt/doc\ + --doc-base $bt/$doc_base\ --lib $gnulib_name\ - --m4-base $bt/m4/\ - --source-base $bt/lib/\ - --tests-base $bt/tests\ + --m4-base $bt/$m4_base/\ + --source-base $bt/$source_base/\ + --tests-base $bt/$tests_base\ --local-dir $local_gl_dir\ -$gnulib_tool_option_extras\ + $gnulib_tool_option_extras\ " echo "$0: $gnulib_tool $gnulib_tool_options --import ..." $gnulib_tool $gnulib_tool_options --import $gnulib_modules && @@ -545,6 +548,18 @@ if test -f $mam_template; then done fi +# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some +# gnulib-populated directories. Such .m4 files would cause aclocal to fail. +# The following requires GNU find 4.2.3 or newer. Considering the usual +# portability constraints of this script, that may seem a very demanding +# requirement, but it should be ok. Ignore any failure, which is fine, +# since this is only a convenience to help developers avoid the relatively +# unusual case in which a symlinked-to .m4 file is git-removed from gnulib +# between successive runs of this script. +find "$m4_base" "$source_base" \ + -depth \( -name '*.m4' -o -name '*.[ch]' \) \ + -type l -xtype l -delete > /dev/null 2>&1 + # Reconfigure, getting other files. for command in \ @@ -580,7 +595,7 @@ if test $with_gettext = yes; then rm -f po/Makevars sed ' /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/ - /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/ + /^MSGID_BUGS_ADDRESS *=/s/=.*/= '"$MSGID_BUGS_ADDRESS"'/ /^XGETTEXT_OPTIONS *=/{ s/$/ \\/ a\