summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-03-08 00:23:00 +0100
committerJim Meyering <jim@meyering.net>2007-03-08 00:23:00 +0100
commit551bed87fabb20dab9164a529aeca7d9665c25ff (patch)
treee5d3a890b158961c5f33571cc60f359207e89e71 /bootstrap
parentb7a568ece8e9ae81e1fc444fb1ceb222c9940ea3 (diff)
downloadcoreutils-551bed87fabb20dab9164a529aeca7d9665c25ff.tar.xz
Make bootstrap a little more general.
* bootstrap (build_aux): Factor out/use this definition. Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in configure.ac. (insert_sorted_if_absent): Move function definition "up", to precede new first use. If $build_aux/ doesn't exist initially, create it, and mark it as ignored.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap57
1 files changed, 37 insertions, 20 deletions
diff --git a/bootstrap b/bootstrap
index bf94f9b0f..887ec53c7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -90,17 +90,18 @@ extract_package_name='
'
package=`sed -n "$extract_package_name" configure.ac` || exit
+build_aux=build-aux
# Extra files from gnulib, which override files from other sources.
-gnulib_extra_files='
- build-aux/install-sh
- build-aux/missing
- build-aux/mdate-sh
- build-aux/texinfo.tex
- build-aux/depcomp
- build-aux/config.guess
- build-aux/config.sub
+gnulib_extra_files="
+ $build_aux/install-sh
+ $build_aux/missing
+ $build_aux/mdate-sh
+ $build_aux/texinfo.tex
+ $build_aux/depcomp
+ $build_aux/config.guess
+ $build_aux/config.sub
doc/INSTALL
-'
+"
# Other locale categories that need message catalogs.
EXTRA_LOCALE_CATEGORIES=
@@ -156,6 +157,32 @@ if test -n "$CVS_only_file" && test ! -r "$CVS_only_file"; then
exit 1
fi
+# If $STR is not already on a line by itself in $FILE, insert it,
+# sorting the new contents of the file and replacing $FILE with the result.
+insert_sorted_if_absent() {
+ file=$1
+ str=$2
+ echo "$str" | sort -u - $file | cmp -s - $file \
+ || echo "$str" | sort -u - $file -o $file \
+ || exit 1
+}
+
+# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
+grep '^[ ]*AC_CONFIG_AUX_DIR('$build_aux')' configure.ac >/dev/null ||
+ {
+ echo "$0: expected line not found in configure.ac. Add the following:" >&2
+ echo " AC_CONFIG_AUX_DIR($build_aux)" >&2.
+ }
+
+# If $build_aux doesn't exist, create it now, otherwise some bits
+# below will malfunction. If creating it, also mark it as ignored.
+if test ! -d $build_aux; then
+ mkdir $build_aux
+ for ig in .cvsignore .gitignore; do
+ test -f $ig && insert_sorted_if_absent $ig $build_aux
+ done
+fi
+
echo "$0: Bootstrapping CVS $package..."
cleanup_gnulib() {
@@ -358,16 +385,6 @@ version_controlled_file() {
test $found = yes
}
-# If $STR is not already on a line by itself in $FILE, insert it,
-# sorting the new contents of the file and replacing $FILE with the result.
-insert_sorted_if_absent() {
- file=$1
- str=$2
- echo "$str" | sort -u - $file | cmp -s - $file \
- || echo "$str" | sort -u - $file -o $file \
- || exit
-}
-
slurp() {
for dir in . `(cd $1 && find * -type d -print)`; do
copied=
@@ -431,7 +448,7 @@ mkdir $bt $bt2 || exit
gnulib_tool_options="\
--import\
--no-changelog\
- --aux-dir $bt/build-aux\
+ --aux-dir $bt/$build_aux\
--doc-base $bt/doc\
--lib lib$package\
--m4-base $bt/m4/\