aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/boot-strap
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/boot-strap')
-rwxr-xr-xcontrib/bmake/boot-strap46
1 files changed, 31 insertions, 15 deletions
diff --git a/contrib/bmake/boot-strap b/contrib/bmake/boot-strap
index d251649db670..b025de52a82b 100755
--- a/contrib/bmake/boot-strap
+++ b/contrib/bmake/boot-strap
@@ -82,9 +82,23 @@
#
# Possibly useful configure_args:
#
+# --without-makefile
+# do not generate 'makefile'.
+#
+# 'makefile' is used to enable the classic
+# './configure; make; make install' dance, but on
+# systems with case insensitive filesystems it can lead
+# to infinite recursion.
+#
+# It is disabled by default on Darwin, and Cygwin.
+#
# --without-meta
# disable use of meta mode.
#
+# Even without filemon(9) meta mode is very useful
+# both for debugging build and improving reliability of
+# update builds.
+#
# --without-filemon
# disable use of filemon(9) which is currently only
# available for NetBSD and FreeBSD.
@@ -119,7 +133,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# RCSid:
-# $Id: boot-strap,v 1.54 2020/11/13 21:47:25 sjg Exp $
+# $Id: boot-strap,v 1.61 2024/03/10 17:51:10 sjg Exp $
#
# @(#) Copyright (c) 2001 Simon J. Gerraty
#
@@ -315,6 +329,14 @@ FindHereOrAbove() {
)
}
+# is $1 newer than $2 ...
+is_newer() {
+ case `'ls' -1td "$@" 2> /dev/null | head -1` in
+ $1) return 0;;
+ esac
+ return 1
+}
+
# is $1 missing from $2 (or PATH) ?
no_path() {
eval "__p=\$${2:-PATH}"
@@ -405,17 +427,6 @@ Bmake() {
)
}
-# there is actually a shell where type is not a builtin
-# if type is missing, which(1) had better exists!
-if (type cat) > /dev/null 2>&1; then
-which() {
- type "$@" | sed 's,[()],,g;s,^[^/][^/]*,,;q'
-}
-fi
-# make sure test below uses the same diff that configure did
-TOOL_DIFF=`which diff`
-export TOOL_DIFF
-
op_configure() {
$srcdir/configure $CONFIGURE_ARGS || exit 1
}
@@ -425,13 +436,18 @@ op_build() {
chmod 755 make-bootstrap.sh || exit 1
./make-bootstrap.sh || exit 1
case "$op" in
- build) op_test;;
+ build) rm -f tested; op_test;;
esac
}
op_test() {
[ -x bmake ] || op_build
- Bmake test || exit 1
+ case "$op" in
+ test) ;;
+ *) is_newer bmake tested || return;;
+ esac
+ Bmake test TEST_MAKE=$objdir/bmake "$@" || exit 1
+ touch tested
}
op_clean() {
@@ -483,5 +499,5 @@ You may need the -r or -R option to more/less to view it correctly.
EOM
}
-op_$op
+op_$op "$@"
exit 0