2012-06-08 21:57:36 +00:00
|
|
|
:
|
|
|
|
# NAME:
|
|
|
|
# boot-strap
|
|
|
|
#
|
|
|
|
# SYNOPSIS:
|
2013-01-31 16:44:23 +00:00
|
|
|
# boot-strap ["options"]
|
|
|
|
# boot-strap --prefix=/opt --install
|
|
|
|
# boot-strap --prefix=$HOME --install-host-target -DWITH_PROG_VERSION
|
|
|
|
# boot-strap ["options"] op=build
|
|
|
|
# boot-strap ["options"] op=install
|
2012-06-08 21:57:36 +00:00
|
|
|
#
|
|
|
|
# DESCRIPTION:
|
|
|
|
# This script is used to configure/build bmake it builds for
|
2013-01-31 16:44:23 +00:00
|
|
|
# each host-target in a different subdir to keep the src clean.
|
|
|
|
# There is no requirement for an existing make(1).
|
2012-06-08 21:57:36 +00:00
|
|
|
#
|
2013-01-31 16:44:23 +00:00
|
|
|
# On successful completion if no '--install' flag is given,
|
|
|
|
# it echos a command to do installation.
|
|
|
|
#
|
|
|
|
# The variable "op" defaults to 'all', and is affected by
|
|
|
|
# '--install' flag as above.
|
|
|
|
# Other values include:
|
|
|
|
#
|
|
|
|
# configure
|
|
|
|
# Just run 'configure'
|
|
|
|
#
|
|
|
|
# build
|
|
|
|
# If 'configure' has not been done, do it, then
|
|
|
|
# run the build script, and finally 'test'.
|
|
|
|
#
|
|
|
|
# install
|
|
|
|
# If 'build' has not been done, do it, 'test' then
|
|
|
|
# install.
|
|
|
|
#
|
|
|
|
# clean
|
|
|
|
# attempt to clean up
|
|
|
|
#
|
|
|
|
# test
|
|
|
|
# run the unit-tests. Done automatically after 'build'
|
|
|
|
# and before 'install'.
|
|
|
|
#
|
|
|
|
# The above are leveraged by a trivial makefile for the benefit
|
|
|
|
# of those that have './configure; make; make install' baked
|
|
|
|
# into them.
|
|
|
|
#
|
2012-06-08 21:57:36 +00:00
|
|
|
# Options:
|
|
|
|
#
|
|
|
|
# -c "rc"
|
|
|
|
# Pick up settings from "rc".
|
|
|
|
# We look for '.bmake-boot-strap.rc' before processing
|
2013-01-31 16:44:23 +00:00
|
|
|
# options (unless SKIP_RC is set in environment).
|
2012-06-08 21:57:36 +00:00
|
|
|
#
|
|
|
|
# --share "share_dir"
|
|
|
|
# Where to put man pages and mk files.
|
|
|
|
# If $prefix ends in $HOST_TARGET, and $prefix/../share
|
|
|
|
# exits, the default will be that rather than $prefix/share.
|
|
|
|
#
|
|
|
|
# --mksrc "mksrc"
|
|
|
|
# Indicate where the mk files can be found.
|
2013-01-31 16:44:23 +00:00
|
|
|
# Default is $Mydir/mk
|
|
|
|
#
|
|
|
|
# --install
|
|
|
|
# If build and test work, run bmake install.
|
|
|
|
# BINDIR=$prefix/bin
|
|
|
|
# SHAREDIR=$prefix/share
|
|
|
|
#
|
|
|
|
# --install-host-target
|
|
|
|
# As for '--install' but BINDIR=$prefix/$HOST_TARGET/bin
|
|
|
|
# This is useful when $prefix/ is shared by multiple
|
|
|
|
# machines.
|
|
|
|
#
|
|
|
|
# Flags relevant when installing:
|
|
|
|
#
|
|
|
|
# -DWITHOUT_INSTALL_MK
|
|
|
|
# Skip installing mk files.
|
|
|
|
# By default they will be installed to $prefix/share/mk
|
|
|
|
#
|
|
|
|
# -DWITH_PROG_VERSION
|
|
|
|
# Install 'bmake' as 'bmake-$MAKE_VERSION'
|
|
|
|
# A symlink will be made as 'bmake' unless
|
|
|
|
# -DWITHOUT_PROG_LINK is set.
|
2012-06-08 21:57:36 +00:00
|
|
|
#
|
|
|
|
# Possibly useful configure_args:
|
|
|
|
#
|
|
|
|
# --without-meta
|
|
|
|
# disable use of meta mode.
|
|
|
|
#
|
|
|
|
# --without-filemon
|
|
|
|
# disable use of filemon(9) which is currently only
|
|
|
|
# available for NetBSD and FreeBSD.
|
|
|
|
#
|
2020-05-20 19:34:48 +00:00
|
|
|
# --with-filemon=ktrace
|
|
|
|
# on NetBSD or others with fktrace(2), use ktrace
|
|
|
|
# version of filemon.
|
|
|
|
#
|
2012-06-08 21:57:36 +00:00
|
|
|
# --with-filemon="path/to/filemon.h"
|
|
|
|
# enables use of filemon(9) by meta mode.
|
|
|
|
#
|
|
|
|
# --with-machine="machine"
|
|
|
|
# set "machine" to override that determined by
|
|
|
|
# machine.sh
|
|
|
|
#
|
|
|
|
# --with-force-machine="machine"
|
|
|
|
# force "machine" even if uname(3) provides a value.
|
|
|
|
#
|
|
|
|
# --with-machine_arch="machine_arch"
|
|
|
|
# set "machine_arch" to override that determined by
|
|
|
|
# machine.sh
|
|
|
|
#
|
2020-11-20 03:54:37 +00:00
|
|
|
# --with-force_machine_arch="machine_arch"
|
|
|
|
# force "machine_arch" to override that determined by
|
|
|
|
# machine.sh
|
|
|
|
#
|
2012-06-08 21:57:36 +00:00
|
|
|
# --with-default-sys-path="syspath"
|
|
|
|
# set an explicit default "syspath" which is where bmake
|
|
|
|
# will look for sys.mk and friends.
|
|
|
|
#
|
|
|
|
# AUTHOR:
|
|
|
|
# Simon J. Gerraty <sjg@crufty.net>
|
|
|
|
|
|
|
|
# RCSid:
|
Import bmake-20230909
Update import.sh to generate below
ChangeLog since bmake-20230622
2023-09-09 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230909
Merge with NetBSD make, pick up
o main.c: allow -j to compute a multiple of ncpu
If _SC_NPROCESSORS_ONLN is supported; and -j arg is a floating
point number or ends in 'C' compute .MAKE.JOBS as a multiple of
_SC_NPROCESSORS_ONLN
.MAKE.JOBS.C will be "yes" if -jC is supported
2023-08-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230820
Merge with NetBSD make, pick up
o make.1: note that :localtime is better for %s
o parse.c: improve error messages for invalid input.
o var.c: fix for %s:L:gmtime - set TZ=UTC and use localtime to get
correct result, it is still better to use %s:L:localtime.
2023-08-18 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230818
Merge with NetBSD make, pick up
o meta.c: meta_ignore - check raw path against metaIgnorePaths
to potentially skip call to realpath.
o var.c: be strict when parsing the argument of the ':mtime' modifier
o unit-tests/varmod-mtime.mk: document why '${%s:L:localtime}'
should be used to get an equivalent value to time(3).
2023-08-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230816
Merge with NetBSD make, pick up
o cond.c: clean up multiple-inclusion guards
2023-07-25 Simon J Gerraty <sjg@beast.crufty.net>
* unit-tests/Makefile: addd varmod-localtime to BROKEN_TESTS
if configure cannot work out how to control TZ.
Remove varmod-localtime from BROKEN_TESTS for IRIX*
2023-07-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230723
* configure.in: fix the test for wether TZ=Europe/Berlin works.
Depending on the time of year, if run between 22:00 and 00:00 UTC
the check in configure would fail incorrectly.
Take the day into account as well.
2023-07-18 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230711
Merge with NetBSD make, pick up
o make.1: clean up wording, clarify scope of '!' in conditions
2023-07-15 Simon J Gerraty <sjg@beast.crufty.net>
* make-bootstrap.sh.in: set prefix
If configure is run using ksh we get unexpanded ${prefix} in
DEFAULT_SYS_PATH, by ensuring prefix is set we should still get
correct result.
2023-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230711
bump version for IRIX tweaks
* make.h: undef OP_NONE if defined
* unit-tests/Makefile: set BROKEN_TESTS for IRIX
* configure.in: override INSTALL on IRIX
2023-06-27 Simon J Gerraty <sjg@beast.crufty.net>
* boot-strap op_test: ensure we set TEST_MAKE as we want it.
mk/ChangeLog since bmake-20230622
2023-09-09 Simon J Gerraty <sjg@beast.crufty.net>
* jobs.mk (JOB_MAX): use -jC if we can
we actually use JOB_MAX_C which defaults to 1.33C
2023-08-18 Simon J Gerraty <sjg@beast.crufty.net>
* now_utc: %s only works with :localtime
2023-07-14 Simon J Gerraty <sjg@beast.crufty.net>
* install-sh: ignore -c as claimed and only insist on
a directory for destination when more than one file to copy.
* sys.mk: when looking for SYS_OS_MK try ${.MAKE.OS} and
${.MAKE.OS:S,64,,} early (so we find sys/IRIX.mk for IRIX64)
2023-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20230711
* sys.mk: set SYS_MK and INSTALL_SH for systems with incompatible
install(1)
* sys/IRIX.mk: when setting ROOT_GROUP only match the first :0:
set INSTALL to install-sh rather than pathname that may not exist
(yet).
2023-07-07 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: pass DIRDEP_TARGETS to DIRDEP_MAKE
normally this is empty - for the default target, but there are
use-cases where we might set it to something else.
2023-07-04 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20230704
* dirdeps.mk: apply DEBUG_DIRDEPS_LIST_FILTER to lists we output
when DEBUG_DIRDEPS is in effect.
Eg. DEBUG_DIRDEPS_LIST_FILTER=ts\n
can greatly improve readability.
2023-09-17 17:03:11 +00:00
|
|
|
# $Id: boot-strap,v 1.58 2023/06/27 21:02:19 sjg Exp $
|
2012-06-08 21:57:36 +00:00
|
|
|
#
|
|
|
|
# @(#) Copyright (c) 2001 Simon J. Gerraty
|
|
|
|
#
|
|
|
|
# This file is provided in the hope that it will
|
|
|
|
# be of use. There is absolutely NO WARRANTY.
|
|
|
|
# Permission to copy, redistribute or otherwise
|
|
|
|
# use this file is hereby granted provided that
|
|
|
|
# the above copyright notice and this notice are
|
|
|
|
# left intact.
|
|
|
|
#
|
|
|
|
# Please send copies of changes and bug-fixes to:
|
|
|
|
# sjg@crufty.net
|
|
|
|
#
|
|
|
|
|
|
|
|
Mydir=`dirname $0`
|
|
|
|
. "$Mydir/os.sh"
|
|
|
|
case "$Mydir" in
|
|
|
|
/*) ;;
|
|
|
|
*) Mydir=`cd "$Mydir" && 'pwd'`;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
Usage() {
|
|
|
|
[ "$1" ] && echo "ERROR: $@" >&2
|
|
|
|
echo "Usage:" >&2
|
2013-01-31 16:44:23 +00:00
|
|
|
echo "$0 [--<configure_arg> ...][<prefix>][--install]" >&2
|
2012-06-08 21:57:36 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
Error() {
|
|
|
|
echo "ERROR: $@" >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
source_rc() {
|
|
|
|
rc="$1"; shift
|
|
|
|
for d in ${*:-""}
|
|
|
|
do
|
|
|
|
r="${d:+$d/}$rc"
|
|
|
|
[ -f "$r" -a -s "$r" ] || continue
|
|
|
|
echo "NOTE: reading $r"
|
|
|
|
. "$r"
|
|
|
|
break
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2013-01-31 16:44:23 +00:00
|
|
|
cmd_args="$@"
|
|
|
|
|
2013-04-01 21:12:55 +00:00
|
|
|
# clear some things from the environment that we care about
|
|
|
|
unset MAKEOBJDIR MAKEOBJDIRPREFIX
|
2020-05-20 19:34:48 +00:00
|
|
|
# or that might be incompatible
|
|
|
|
unset MAKE MAKEFLAGS
|
2013-04-01 21:12:55 +00:00
|
|
|
|
2013-01-31 16:44:23 +00:00
|
|
|
# --install[-host-target] will set this
|
|
|
|
INSTALL_PREFIX=
|
|
|
|
# other things we pass to install step
|
|
|
|
INSTALL_ARGS=
|
2012-06-08 21:57:36 +00:00
|
|
|
CONFIGURE_ARGS=
|
|
|
|
MAKESYSPATH=
|
|
|
|
# pick a useful default prefix (for me at least ;-)
|
|
|
|
for prefix in /opt/$HOST_TARGET "$HOME/$HOST_TARGET" /usr/pkg /usr/local ""
|
|
|
|
do
|
2013-01-31 16:44:23 +00:00
|
|
|
[ -d "${prefix:-.}" ] || continue
|
|
|
|
case "$prefix" in
|
|
|
|
*/$HOST_TARGET)
|
|
|
|
p=`dirname $prefix`
|
|
|
|
if [ -d $p/share ]; then
|
|
|
|
INSTALL_BIN=$HOST_TARGET/bin
|
|
|
|
prefix=$p
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
echo "NOTE: default prefix=$prefix ${INSTALL_BIN:+INSTALL_BIN=$INSTALL_BIN}"
|
|
|
|
break
|
2012-06-08 21:57:36 +00:00
|
|
|
done
|
2013-01-31 16:44:23 +00:00
|
|
|
srcdir=$Mydir
|
|
|
|
mksrc=$Mydir/mk
|
2012-06-08 21:57:36 +00:00
|
|
|
objdir=
|
|
|
|
quiet=:
|
|
|
|
|
2013-01-31 16:44:23 +00:00
|
|
|
${SKIP_RC:+:} source_rc .bmake-boot-strap.rc . "$Mydir/.." "$HOME"
|
2012-06-08 21:57:36 +00:00
|
|
|
|
|
|
|
get_optarg() {
|
|
|
|
expr "x$1" : "x[^=]*=\\(.*\\)"
|
|
|
|
}
|
|
|
|
|
2013-01-31 16:44:23 +00:00
|
|
|
here=`'pwd'`
|
|
|
|
if [ $here = $Mydir ]; then
|
2014-07-02 21:24:54 +00:00
|
|
|
# avoid pollution
|
2013-01-31 16:44:23 +00:00
|
|
|
OBJROOT=../
|
|
|
|
fi
|
|
|
|
|
|
|
|
op=all
|
|
|
|
BMAKE=
|
|
|
|
|
2012-06-08 21:57:36 +00:00
|
|
|
while :
|
|
|
|
do
|
|
|
|
case "$1" in
|
|
|
|
--) shift; break;;
|
2013-01-31 16:44:23 +00:00
|
|
|
--help) sed -n -e "1d;/RCSid/,\$d" -e '/^#\.[a-z]/d' -e '/^#/s,^# *,,p' $0; exit 0;;
|
2012-06-08 21:57:36 +00:00
|
|
|
--prefix) prefix="$2"; shift;;
|
|
|
|
--prefix=*) prefix=`get_optarg "$1"`;;
|
|
|
|
--src=*) srcdir=`get_optarg "$1"`;;
|
|
|
|
--with-mksrc=*|--mksrc=*) mksrc=`get_optarg "$1"`;;
|
|
|
|
--share=*) share_dir=`get_optarg "$1"`;;
|
|
|
|
--share) share_dir="$2"; shift;;
|
|
|
|
--with-default-sys-path=*)
|
2014-01-26 07:40:17 +00:00
|
|
|
CONFIGURE_ARGS="$1";;
|
2012-06-08 21:57:36 +00:00
|
|
|
--with-default-sys-path)
|
2014-01-26 07:40:17 +00:00
|
|
|
CONFIGURE_ARGS="$1 $2";;
|
2013-01-31 16:44:23 +00:00
|
|
|
--install) INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix};;
|
|
|
|
--install-host-target)
|
|
|
|
INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix}
|
|
|
|
INSTALL_BIN=$HOST_TARGET/bin;;
|
|
|
|
--install-destdir=*) INSTALL_DESTDIR=`get_optarg "$1"`;;
|
|
|
|
--install-prefix=*) INSTALL_PREFIX=`get_optarg "$1"`;;
|
|
|
|
-DWITH*) INSTALL_ARGS="$INSTALL_ARGS $1";;
|
2012-06-08 21:57:36 +00:00
|
|
|
-s|--src) srcdir="$2"; shift;;
|
|
|
|
-m|--mksrc) mksrc="$2"; shift;;
|
|
|
|
-o|--objdir) objdir="$2"; shift;;
|
|
|
|
-q) quiet=;;
|
|
|
|
-c) source_rc "$2"; shift;;
|
|
|
|
--*) CONFIGURE_ARGS="$CONFIGURE_ARGS $1";;
|
|
|
|
*=*) eval "$1"; export `expr "x$1" : "x\\(.[^=]*\\)=.*"`;;
|
|
|
|
*) break;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
AddConfigure() {
|
|
|
|
case " $CONFIGURE_ARGS " in
|
|
|
|
*" $1"*) ;;
|
|
|
|
*) CONFIGURE_ARGS="$CONFIGURE_ARGS $1$2";;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
GetDir() {
|
|
|
|
match="$1"
|
|
|
|
shift
|
|
|
|
fmatch="$1"
|
|
|
|
shift
|
|
|
|
for dir in $*
|
|
|
|
do
|
|
|
|
[ -d "$dir" ] || continue
|
|
|
|
case "/$dir/" in
|
|
|
|
*$match*) ;;
|
|
|
|
*) continue;;
|
|
|
|
esac
|
|
|
|
case "$fmatch" in
|
|
|
|
.) ;;
|
|
|
|
*) [ -s $dir/$fmatch ] || continue;;
|
|
|
|
esac
|
|
|
|
case "$dir/" in
|
|
|
|
*./*) cd "$dir" && 'pwd';;
|
|
|
|
/*) echo $dir;;
|
|
|
|
*) cd "$dir" && 'pwd';;
|
|
|
|
esac
|
|
|
|
break
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
FindHereOrAbove() {
|
|
|
|
(
|
|
|
|
_t=-s
|
|
|
|
while :
|
|
|
|
do
|
|
|
|
case "$1" in
|
|
|
|
-C) cd "$2"; shift; shift;;
|
|
|
|
-?) _t=$1; shift;;
|
|
|
|
*) break;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
case "$1" in
|
|
|
|
/*) # we shouldn't be here
|
|
|
|
[ $_t "$1" ] && echo "$1"
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
.../*) want=`echo "$1" | sed 's,^.../*,,'`;;
|
|
|
|
*) want="$1";;
|
|
|
|
esac
|
|
|
|
here=`'pwd'`
|
|
|
|
while :
|
|
|
|
do
|
|
|
|
if [ $_t "./$want" ]; then
|
|
|
|
echo "$here/$want"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
cd ..
|
|
|
|
here=`'pwd'`
|
|
|
|
case "$here" in
|
|
|
|
/) return;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
# is $1 missing from $2 (or PATH) ?
|
|
|
|
no_path() {
|
|
|
|
eval "__p=\$${2:-PATH}"
|
|
|
|
case ":$__p:" in *:"$1":*) return 1;; *) return 0;; esac
|
|
|
|
}
|
|
|
|
|
|
|
|
# if $1 exists and is not in path, append it
|
|
|
|
add_path () {
|
|
|
|
case "$1" in
|
|
|
|
-?) t=$1; shift;;
|
|
|
|
*) t=-d;;
|
|
|
|
esac
|
|
|
|
case "$2,$1" in
|
|
|
|
MAKESYSPATH,.../*) ;;
|
|
|
|
*) [ $t ${1:-.} ] || return;;
|
|
|
|
esac
|
|
|
|
no_path $* && eval ${2:-PATH}="$__p${__p:+:}$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
srcdir=`GetDir /bmake make-bootstrap.sh.in "$srcdir" "$2" "$Mydir" ./bmake* "$Mydir"/../bmake*`
|
|
|
|
[ -d "${srcdir:-/dev/null}" ] || Usage
|
|
|
|
case "$mksrc" in
|
2014-01-26 07:40:17 +00:00
|
|
|
none|-) # we ignore this now
|
|
|
|
mksrc=$Mydir/mk
|
2012-06-08 21:57:36 +00:00
|
|
|
;;
|
|
|
|
.../*) # find here or above
|
|
|
|
mksrc=`FindHereOrAbove -C "$Mydir" -s "$mksrc/sys.mk"`
|
|
|
|
# that found a file
|
|
|
|
mksrc=`dirname $mksrc`
|
|
|
|
;;
|
|
|
|
*) # guess we want mksrc...
|
|
|
|
mksrc=`GetDir /mk sys.mk "$mksrc" "$3" ./mk* "$srcdir"/mk* "$srcdir"/../mk*`
|
|
|
|
[ -d "${mksrc:-/dev/null}" ] || Usage "Use '-m none' to build without mksrc"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Ok, get to work...
|
2013-01-31 16:44:23 +00:00
|
|
|
objdir="${objdir:-$OBJROOT$HOST_TARGET}"
|
2012-06-08 21:57:36 +00:00
|
|
|
[ -d "$objdir" ] || mkdir -p "$objdir"
|
|
|
|
[ -d "$objdir" ] || mkdir "$objdir"
|
|
|
|
cd "$objdir" || exit 1
|
|
|
|
# make it absolute
|
|
|
|
objdir=`'pwd'`
|
|
|
|
|
|
|
|
ShareDir() {
|
|
|
|
case "/$1" in
|
|
|
|
/) [ -d /share ] || return;;
|
|
|
|
*/$HOST_TARGET)
|
|
|
|
if [ -d "$1/../share" ]; then
|
|
|
|
echo `dirname "$1"`/share
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
echo $1/share
|
|
|
|
}
|
|
|
|
|
|
|
|
# make it easy to force prefix to use $HOST_TARGET
|
|
|
|
: looking at "$prefix"
|
|
|
|
case "$prefix" in
|
|
|
|
*/host?target) prefix=`echo "$prefix" | sed "s,host.target,${HOST_TARGET},"`;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
share_dir="${share_dir:-`ShareDir $prefix`}"
|
|
|
|
|
|
|
|
AddConfigure --prefix= "$prefix"
|
|
|
|
case "$CONFIGURE_ARGS" in
|
|
|
|
*--with-*-sys-path*) ;; # skip
|
|
|
|
*) [ "$share_dir" ] && AddConfigure --with-default-sys-path= "$share_dir/mk";;
|
|
|
|
esac
|
|
|
|
if [ "$mksrc" ]; then
|
|
|
|
AddConfigure --with-mksrc= "$mksrc"
|
|
|
|
# not all cc's support this
|
|
|
|
CFLAGS_MF= CFLAGS_MD=
|
|
|
|
export CFLAGS_MF CFLAGS_MD
|
|
|
|
fi
|
|
|
|
|
2013-01-31 16:44:23 +00:00
|
|
|
# this makes it easy to run the bmake we just built
|
|
|
|
# the :tA dance is needed because 'pwd' and even /bin/pwd
|
|
|
|
# may not give the same result as realpath().
|
|
|
|
Bmake() {
|
|
|
|
(
|
|
|
|
cd $Mydir &&
|
|
|
|
MAKESYSPATH=$mksrc SRCTOP=$Mydir OBJTOP=$objdir \
|
|
|
|
MAKEOBJDIR='${.CURDIR:S,${SRCTOP:tA},${OBJTOP:tA},}' \
|
|
|
|
${BMAKE:-$objdir/bmake} -f $Mydir/Makefile "$@"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
op_configure() {
|
|
|
|
$srcdir/configure $CONFIGURE_ARGS || exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
op_build() {
|
|
|
|
[ -s make-bootstrap.sh ] || op_configure
|
|
|
|
chmod 755 make-bootstrap.sh || exit 1
|
|
|
|
./make-bootstrap.sh || exit 1
|
|
|
|
case "$op" in
|
|
|
|
build) op_test;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
op_test() {
|
|
|
|
[ -x bmake ] || op_build
|
Import bmake-20230909
Update import.sh to generate below
ChangeLog since bmake-20230622
2023-09-09 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230909
Merge with NetBSD make, pick up
o main.c: allow -j to compute a multiple of ncpu
If _SC_NPROCESSORS_ONLN is supported; and -j arg is a floating
point number or ends in 'C' compute .MAKE.JOBS as a multiple of
_SC_NPROCESSORS_ONLN
.MAKE.JOBS.C will be "yes" if -jC is supported
2023-08-20 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230820
Merge with NetBSD make, pick up
o make.1: note that :localtime is better for %s
o parse.c: improve error messages for invalid input.
o var.c: fix for %s:L:gmtime - set TZ=UTC and use localtime to get
correct result, it is still better to use %s:L:localtime.
2023-08-18 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230818
Merge with NetBSD make, pick up
o meta.c: meta_ignore - check raw path against metaIgnorePaths
to potentially skip call to realpath.
o var.c: be strict when parsing the argument of the ':mtime' modifier
o unit-tests/varmod-mtime.mk: document why '${%s:L:localtime}'
should be used to get an equivalent value to time(3).
2023-08-16 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230816
Merge with NetBSD make, pick up
o cond.c: clean up multiple-inclusion guards
2023-07-25 Simon J Gerraty <sjg@beast.crufty.net>
* unit-tests/Makefile: addd varmod-localtime to BROKEN_TESTS
if configure cannot work out how to control TZ.
Remove varmod-localtime from BROKEN_TESTS for IRIX*
2023-07-24 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230723
* configure.in: fix the test for wether TZ=Europe/Berlin works.
Depending on the time of year, if run between 22:00 and 00:00 UTC
the check in configure would fail incorrectly.
Take the day into account as well.
2023-07-18 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230711
Merge with NetBSD make, pick up
o make.1: clean up wording, clarify scope of '!' in conditions
2023-07-15 Simon J Gerraty <sjg@beast.crufty.net>
* make-bootstrap.sh.in: set prefix
If configure is run using ksh we get unexpanded ${prefix} in
DEFAULT_SYS_PATH, by ensuring prefix is set we should still get
correct result.
2023-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20230711
bump version for IRIX tweaks
* make.h: undef OP_NONE if defined
* unit-tests/Makefile: set BROKEN_TESTS for IRIX
* configure.in: override INSTALL on IRIX
2023-06-27 Simon J Gerraty <sjg@beast.crufty.net>
* boot-strap op_test: ensure we set TEST_MAKE as we want it.
mk/ChangeLog since bmake-20230622
2023-09-09 Simon J Gerraty <sjg@beast.crufty.net>
* jobs.mk (JOB_MAX): use -jC if we can
we actually use JOB_MAX_C which defaults to 1.33C
2023-08-18 Simon J Gerraty <sjg@beast.crufty.net>
* now_utc: %s only works with :localtime
2023-07-14 Simon J Gerraty <sjg@beast.crufty.net>
* install-sh: ignore -c as claimed and only insist on
a directory for destination when more than one file to copy.
* sys.mk: when looking for SYS_OS_MK try ${.MAKE.OS} and
${.MAKE.OS:S,64,,} early (so we find sys/IRIX.mk for IRIX64)
2023-07-13 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20230711
* sys.mk: set SYS_MK and INSTALL_SH for systems with incompatible
install(1)
* sys/IRIX.mk: when setting ROOT_GROUP only match the first :0:
set INSTALL to install-sh rather than pathname that may not exist
(yet).
2023-07-07 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: pass DIRDEP_TARGETS to DIRDEP_MAKE
normally this is empty - for the default target, but there are
use-cases where we might set it to something else.
2023-07-04 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20230704
* dirdeps.mk: apply DEBUG_DIRDEPS_LIST_FILTER to lists we output
when DEBUG_DIRDEPS is in effect.
Eg. DEBUG_DIRDEPS_LIST_FILTER=ts\n
can greatly improve readability.
2023-09-17 17:03:11 +00:00
|
|
|
Bmake test TEST_MAKE=$objdir/bmake "$@" || exit 1
|
2013-01-31 16:44:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
op_clean() {
|
|
|
|
if [ -x bmake ]; then
|
|
|
|
ln bmake bmake$$
|
|
|
|
BMAKE=$objdir/bmake$$ Bmake clean
|
|
|
|
rm -f bmake$$
|
|
|
|
elif [ $objdir != $srcdir ]; then
|
|
|
|
rm -rf *
|
2012-06-08 21:57:36 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-01-31 16:44:23 +00:00
|
|
|
op_install() {
|
|
|
|
op_test
|
|
|
|
case "$INSTALL_PREFIX,$INSTALL_BIN,$prefix" in
|
|
|
|
,$HOST_TARGET/bin,*/$HOST_TARGET)
|
|
|
|
INSTALL_PREFIX=`dirname $prefix`
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
INSTALL_PREFIX=${INSTALL_PREFIX:-$prefix}
|
|
|
|
Bmake install prefix=$INSTALL_PREFIX BINDIR=$INSTALL_PREFIX/${INSTALL_BIN:-bin} ${INSTALL_DESTDIR:+DESTDIR=$INSTALL_DESTDIR} $INSTALL_ARGS || exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
op_all() {
|
|
|
|
rm -f make-bootstrap.sh bmake *.o
|
|
|
|
if [ -n "$INSTALL_PREFIX" ]; then
|
|
|
|
op_install
|
|
|
|
else
|
|
|
|
op_test
|
2016-06-05 15:57:18 +00:00
|
|
|
MAKE_VERSION=`sed -n '/^_MAKE_VERSION/ { s,.*= *,,;p; }' $srcdir/Makefile`
|
2020-11-07 19:39:21 +00:00
|
|
|
cat << EOM
|
|
|
|
You can install by running:
|
|
|
|
|
|
|
|
$0 $cmd_args op=install
|
|
|
|
|
|
|
|
Use --install-prefix=/something to install somewhere other than $prefix
|
|
|
|
Use --install-destdir=/somewhere to set DESTDIR during install
|
|
|
|
Use --install-host-target to use INSTALL_BIN=$HOST_TARGET/bin
|
|
|
|
Use -DWITH_PROG_VERSION to install as bmake-$MAKE_VERSION
|
|
|
|
Use -DWITHOUT_PROG_LINK to suppress bmake -> bmake-$MAKE_VERSION symlink
|
|
|
|
Use -DWITHOUT_INSTALL_MK to skip installing files to $prefix/share/mk
|
|
|
|
EOM
|
2013-01-31 16:44:23 +00:00
|
|
|
fi
|
2020-11-07 19:39:21 +00:00
|
|
|
cat << EOM
|
|
|
|
|
|
|
|
Note: bmake.cat1 contains ANSI escape sequences.
|
|
|
|
You may need the -r or -R option to more/less to view it correctly.
|
|
|
|
|
|
|
|
EOM
|
2013-01-31 16:44:23 +00:00
|
|
|
}
|
2012-06-08 21:57:36 +00:00
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
op_$op "$@"
|
2013-01-31 16:44:23 +00:00
|
|
|
exit 0
|