Commit Graph

338 Commits

Author SHA1 Message Date
riz ca39102762 hpcarm wants earmv4 because some models only have v4 CPUs. 2014-08-03 17:11:44 +00:00
apb 62aca79a71 BUILDINFO part 4: build.sh
Add BUILDINFO to the list of variables saved in the makewrapper script,
and print any non-blank BUILDINFO lines near the beginning of the output
from build.sh.
Index: build.sh
===================================================================
RCS file: /cvsroot/src/build.sh,v
retrieving revision 1.286
diff -d -p -u -r1.286 build.sh
--- build.sh	3 Aug 2014 01:03:41 -0000	1.286
+++ build.sh	3 Aug 2014 09:20:46 -0000
@@ -1299,6 +1299,7 @@ parseoptions()
 	#
 	makeenv="${makeenv} TOOLDIR MACHINE MACHINE_ARCH MAKEFLAGS"
 	[ -z "${BUILDID}" ] || makeenv="${makeenv} BUILDID"
+	[ -z "${BUILDINFO}" ] || makeenv="${makeenv} BUILDINFO"
 	MAKEFLAGS="-de -m ${TOP}/share/mk ${MAKEFLAGS}"
 	MAKEFLAGS="${MAKEFLAGS} MKOBJDIRS=${MKOBJDIRS-yes}"
 	export MAKEFLAGS MACHINE MACHINE_ARCH
@@ -2078,6 +2079,13 @@ main()
 	if [ -n "${BUILDID}" ]; then
 		statusmsg2 "BUILDID:"  "${BUILDID}"
 	fi
+	if [ -n "${BUILDINFO}" ]; then
+		printf "%b\n" "${BUILDINFO}" | \
+		while read -r line ; do
+			[ -s "${line}" ] && continue
+			statusmsg2 "BUILDINFO:"  "${line}"
+		done
+	fi

 	rebuildmake
 	validatemakeparams
2014-08-03 09:22:29 +00:00
riz 8b64a7c094 Make EABI the default for arm ports, as discussed on current-users
and port-arm.
2014-08-03 01:03:41 +00:00
apb cfff08a8a3 Make the makewrapper script robust against variables with
embedded special characters.
* Add a shell_quote function, identical to that in postinstall(1)
  and etcupdate(1).
* In the variable=value lines emitted to the wrapper script,
  quote the values, because they may contain special characters.
* Sort the variable names, not the variable=value lines, in case the
  value contains newlines.
2014-07-06 18:04:44 +00:00
apb 21232f58bc Set USETOOLS and MAKEWRAPPERMACHINE in parseoptions(), where
several other make variables are set, insteadof in special
case code in createmakewrapper().
2014-07-06 17:49:20 +00:00
apb dc4d730583 Fix two incorrect attempts to skip blank lines or comment lines.
They failed to account for the space that is appended to ${line}
before comparison.
2014-07-06 17:35:09 +00:00
apb 1ee6f9f471 Print BUILDID near the beginning of build.sh. 2014-06-14 12:25:00 +00:00
martin be27ff5209 Add a new action kernel.gdb=MYCONF to build a kernel with debuginfo
(and generate netbsd.gdb)
2014-05-05 19:12:19 +00:00
uebayasi f03da5f1d6 Revert previous for now; resolvepath() has to work for file paths too. 2014-04-29 11:52:51 +00:00
uebayasi 601713acc4 resolvepath: Resolve .. in absolute paths. 2014-04-29 06:51:57 +00:00
martin 606e79f9ab Typo 2014-03-31 19:29:21 +00:00
martin aad6ef8bb5 Bring back the playstation2 port - now that a toolchain for it is
available again.
2014-03-31 11:25:47 +00:00
skrll 6d3ceb1d61 Rename NetBSD/hp700 to NetBSD/hppa.
Unfortunately our VCS isn't very helpful here.
2014-02-24 07:23:38 +00:00
apb 5c6a475640 Move the "-U or -E must be set for build as an unprivileged user."
test from sanitycheck() to validatemakeparams().  If MKUNPRIVED is set
in mk.conf (and not on the build.sh command line) then it's not yet
available for use in the sanitycheck function.

Also move some other code for consistency.
2014-02-10 08:20:05 +00:00
apb d67dc8a5dd In the sanitycheck function, treat undefined MKUNPRIVED like "no".
Other uses of MKUNPRIVED should not need this treatment, because
bsd.own.mk sets it to "no" by default, and build.sh uses getmakevar to
pick up that default (but that happens too late for the sanitycheck
function to take advantage of it).
2014-01-13 20:00:20 +00:00
pooka 74f1a93841 Rename RUMPTEST_BUILDSH to RUMPKERN_ONLY. Turns out not building any
POSIX implementations of hypercalls is useful beyond the build.sh test,
such as when building rump kernels for non-POSIX hosts.
2013-08-30 10:29:06 +00:00
matt ebaa4f9b26 Use earmv4 for ecats enetwinder eshark
Add evbearm variants for earmv{4,5}{,eb} earmv7{,hf} earmv6{,hf}{,eb}
2013-08-06 05:47:58 +00:00
matt d97935c873 Add evbearmv7-eb and evbearmv7hf-eb aliases for evbarm.
These are because cortex (armv7a) cores uses a different big-endian binary
format that previous big-endian arm systems.
2013-08-05 00:28:52 +00:00
matt c9855651f8 Add stub port for evbcf which has enough to do a distribution build. 2013-07-18 22:08:59 +00:00
msaitoh 6c7aa7e063 The default of hpcarm's MACHINE_ARCH is arm. 2013-06-28 06:17:37 +00:00
matt 0daafbf5e0 Add earm aliases for various arm ports (ecats, hpcearm, eshark, etc.) 2013-06-27 01:02:13 +00:00
kiyohara 4aba7d3a0d Support to build for epoc32 userland. 2013-05-01 13:11:59 +00:00
pooka e0ab611267 fix "build.sh rumptest" wrt private hypercalls 2013-04-28 12:54:39 +00:00
oki 227f9e0fe5 fixed typo on comment. 2013-03-07 04:51:58 +00:00
christos d6c020d518 add a disk-image=target option 2013-02-13 02:17:54 +00:00
matt 29bcadd648 Add
MACHINE=evbarm		MACHINE_ARCH=earmhf	ALIAS=evbearmhf-el
MACHINE=evbarm		MACHINE_ARCH=earmhfeb	ALIAS=evbearmhf-eb
2013-02-03 05:37:43 +00:00
hubertf 1f03a12d0f If the initial build of nbmake fails, make the configure logfile
available (and tell where it is).
2013-02-02 02:08:37 +00:00
pooka 9df40f0e83 Scrub TERMINFO from host env lest it leaks into libterminfo build. 2013-01-14 13:02:59 +00:00
apb 381c3917c4 Move some tests from validatemakeparams() to sanitycheck(), so the
related error messages can be printed before build.sh builds
a new version of make.

Also make some sanity tests unconditional, instead of conditional on
${do_build} || ${do_distribution} || ${do_release} || ${do_install}.
2012-12-02 19:19:36 +00:00
joerg 54f191bfce Move the build_install logic from lib/Makefile into share/mk and re-use
it for tools. The existing logic broke for the LLVM build with the
recent .ORDER changes in make.
2012-11-15 23:51:53 +00:00
apb 9c5c1c9f13 Replace getarch and validatearch with table-driven implementations. 2012-10-31 13:05:09 +00:00
apb 22c6226401 Print the value of MAKECONF. 2012-10-18 16:15:29 +00:00
tsutsui 8a5f2d79df Fix build.sh "modules" target build which has been broken since
do-sys-modules target was removed from src/Makefile in rev 1.299.
Fixes PR/46994.
Also remove a redundant bomb message which is already handled by
make_in_dir().
2012-09-29 04:02:42 +00:00
matt 7d3aca317e Add support for MACHINE_ARCH matching earm or earmeb
Make evbearm-e[bl] a shortcut for evbarm and earmeb or earm.
Allow cats, iyonic, netwiner, shark, zaurus to specify earm though they
still default to arm.
2012-08-05 04:39:09 +00:00
tsutsui c6db16971c Add sanity checks for live-image and install-image targets
(which require mtree spec files built with MKUNPRIVED=yes)
to avoid unexpected makefs(8) error during image builds:
 - if release op is specified with live-image or install-image
   at the same time, make sure -U is also specified for the image builds
 - before perform live-image and install-image ops check METALOG file
   in DESTDIR to see if the build have been performed with MKUNPRIVED

XXX: Probably toolchain should create consistent spec files in
XXX: DESTDIR/etc/mtree dir regardless of MKUNPRIVED settings.
2012-02-26 20:32:40 +00:00
tsutsui 3cf69f27e2 Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
 msdosfs or partitioning MD label structures) support this target.

"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.

For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html

No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.

Closes PR toolchain/45153 and PR misc/45155.
2012-01-22 03:53:29 +00:00
jym ae1d24749f do_sys_sync() is part of vfs, hence rumpvfs. Used by pmf(9) during
device suspend, so explicitly link against rumpvfs to resolve that
symbol when linking rumpdev.

Unbreaks "rumptest" target.
2011-12-05 23:04:39 +00:00
mbalmer 0013a6a6ba wheher -> whether 2011-10-17 16:22:12 +00:00
apb 0d2b74d766 When using random versions of make to try to find the TOOLDIR,
redirect 2>/dev/null.  This should hide error messages like
"*** missing separator.  Stop." when GNU make doesn't
understand ".include".
2011-09-14 17:35:44 +00:00
apb 37b9b22e26 Add tests for the shell under which build.sh is run. If the
shell fails the tests, then build.sh tries to re-exec itself
under a more suitable shell.
2011-09-09 18:48:34 +00:00
apb a4d065775d Allow MAKEFLAGS to be set via build.sh -V. Somebody asked for this
in 2008.

Also add comments above a few functions in build.sh, and bump copyright
dates.
2011-09-09 13:29:23 +00:00
apb c82b114043 Escape '$' in double quotes. 2011-08-30 12:04:12 +00:00
wiz 281ac0460b Add `-h' and `-y' to `Usage' (which were missing there);
synchronize the options list from `Usage' with its own summary,
 and re-outline that list;
two corrections in the order of the options in (parseoptions) list;
a small punctuation change;
remove trailing whitespace in one line.

From Snader_LB.
2011-08-15 14:48:00 +00:00
jmcneill b415fa375b add an installmodules=<dir> command to build.sh 2011-08-08 22:15:42 +00:00
pooka 5f7e80a834 Add support for the Extensible MIPS ("eMIPS") platform. The
NetBSD/emips port runs on Xilinx and Beecube FPGA systems and the
Giano system simulator.

eMIPS is a platform developed at Microsoft Research for researching
reconfigurable computing.  eMIPS allows dynamic loading and scheduling
of application-specific circuits for the purpose of accelerating
computations based on the current workload.

NetBSD eMIPS support for NetBSD 4.x was written at Microsoft Research
by Alessandro Forin and Neil Pittman.  Microsoft Corporation has
donated full copyright to The NetBSD Foundation.

Platform support for eMIPS is the first part of Microsoft's
contribution.  The second part includes the hardware accelerator
framework and will be proposed on tech-kern soon.
2011-01-26 01:18:43 +00:00
matt 86a4a3ea17 Add arc64 alias 2011-01-23 06:50:53 +00:00
pooka 0269a0ac61 * test librumpdev_dm
* update rumpcrypto name
2010-12-06 09:08:39 +00:00
pooka e105cd79ed ld wants to create a 0-byte file before it starts linking, with
the default being ./a.out.  If we run build.sh rumptest from a r/o
fs, linking fails before it gets to the parts that interest us and
the whole test silently fails.

So:
1) use -o /tmp/rumptest.$$ (objdir might be better, but I couldn't
   determine with a high confidence how to obtain the definite one
   in build.sh)
2) catch "cannot open output file" error from ld
2010-11-23 18:30:26 +00:00
pgoyette 658930c423 Replace a couple uses of '$@' with '$*'
In statusmsg2() make the msg variable local.

More thanks to Robert Elz.
2010-08-24 20:52:31 +00:00
pgoyette d4e0edae35 Quote the $msg variable to ensure that leading/trailing spaces get counted.
Thanks to Robert Elz.
2010-08-24 15:28:22 +00:00
pgoyette 0285d73f87 Improve formatting of column-aligned output, as discussed on current-users. 2010-08-24 13:35:32 +00:00
pooka 4728ba3a1b add tty to rumptest 2010-06-17 08:19:02 +00:00
pgoyette af152ef2f0 Minor grammar improvement in status message. 2010-05-27 05:41:54 +00:00
pooka af6d218fe8 Test for barebones rump network config (i.e. just rumpnet and kernel base). 2010-05-11 20:36:04 +00:00
morr 3a05a00830 Don't try to build xldscripts during build.sh modules 2010-05-09 18:53:03 +00:00
cegger 4e1acfb483 move change from rev 1.232 to the initialization part.
This fixes the problem 'nbconfig: cannot create /GENERIC'
when KERNOBJDIR has a relative path and is defined as env variable.
Problem reported and fix proposed on tech-toolchain@.

'commit it then' christos@
2010-03-30 13:17:47 +00:00
christos b1d42d353c make kernobjdir absolute. 2010-03-26 18:02:14 +00:00
hans 9bd962ee1f Make build.sh work again with /usr/xpg4/bin/sh on Solaris. Ok by pooka. 2010-03-07 17:34:25 +00:00
pooka c141020cc8 * detect missing libraries (such as -lrumpfs_msdosfs)
* fix spelling of -lrumpfs_msdos
* update linklists
2010-03-07 16:57:41 +00:00
pooka f3ca69bb04 Don't need to set NORUMPUSER since rumpuser isn't built from sys
anymore.
2010-02-26 18:57:06 +00:00
pooka 49d3a570e6 need object directory for etc/mtree to run distrib-dirs 2010-01-13 02:24:06 +00:00
pooka 2fdef1b4e0 In rumptest, create obj dirs before distrib dirs. Fail if distrib dir
creation fails.

per clue-by-4 from mrg
2010-01-13 02:18:25 +00:00
mbalmer 2940930ee5 'build.sh ... modules' only builds modules, but does not install them,
reflect that in the scripts output.  While here, fix the past form of build.
2009-12-26 14:13:08 +00:00
matt 3a2430f436 Add cobalt64 alias and indicte cobalt can be mips64el too. 2009-12-17 15:30:37 +00:00
matt 1819481222 Merge from matt-nb5-mips64 2009-12-14 01:11:02 +00:00
pooka d6224f4507 Remove support for NetBSD/playstation2. 2009-12-05 16:29:10 +00:00
uebayasi d166c4bf28 Support "extsrc", externally added programs and libraries. Users can write
their own reach-overs, cross-build, install, and get set files just like base
and X11 / X.org.  (These sets are not included as TNF releases.)
2009-11-30 16:13:22 +00:00
pooka 3fb11d6b4c For rumptest, ignore unresolved symbols which are in the
toolchain namespace:
  1) anything starting with __
  2) MD quirks as defined by sys/rump/Makefile.rump
2009-11-24 13:39:07 +00:00
pooka a874bbf6dc Add more rumpdev configurations to rumptest. 2009-11-23 14:07:45 +00:00
pooka 3f3cc8c2db Add rumptest command for testing rump linkage. 2009-11-18 18:05:19 +00:00
apb dea834c0d8 Set LC_ALL=C before we try to parse the output from any command.
This will ensure that awk is not invoked in a way that tickles
the bug described in PR 42320.
2009-11-17 20:49:34 +00:00
apb 61d1f4a9a4 If do_expertmode is false, then add DESTDIR and RELEASEDIR to makeenv.
This reinstates behaviour that was accidentally lost in revision 1.215.
2009-11-04 12:58:01 +00:00
enami e91a07076b There is no variable called __SRC_TOP_OBJ__. Use the correct one instead. 2009-10-15 03:21:45 +00:00
apb ab1c404393 Bomb if TOOLDIR, DESTDIR, or RELEASEDIR changes after we have created the
top level object directory.  This can happen if /etc/mk.conf overrides
values passed to build.sh in the environment or on the command line.
2009-10-14 19:03:12 +00:00
apb c8cd35993a Add an additional check for whether to rebuild make. This fixes a problem
I saw where building first without and then with OBJMACHINE confused
build.sh into not building a new nbmake in the new TOOLDIR.
2009-10-03 19:19:59 +00:00
apb cfa3cdb026 Replace try_set_TOOLDIR with a new function, print_tooldir_make,
which does much of the same work but prints a result instead of
setting a global variable.  Adjust the rebuildmake function to suit.
Improve the comments describing how we try to figure out whether
the existing tooldir make needs to be rebuilt.
2009-09-27 22:02:41 +00:00
apb 828252228e * Use a more robust method of creating the top level object directory.
Use getmakevar to expand MAKEOBJDIRPREFIX or MAKEOBJDIR, or (if
  neither of those variables is set) use a non-recursive "make obj" in
  the top level source directory.

* Do not let TOP_objdir default to ${TOP}.  It's now set only by the
  -M or -O command line options, or after using getmakevar to expand
  MAKEOBJDIRPREFIX or MAKEOBJDIR.

* Make try_set_TOOLDIR handle MAKEOBJDIRPERFIX passed from the
  environment.  It runs too early to use getmakevar, so it will not work
  if the value contains embedded '${...}' variable references.

* Use '$TOOLDIR' (with a literal '$') instead of 'nonexistent' in
  a message when rebuilding make when TOOLDIR is not yet known.
2009-09-27 18:08:24 +00:00
apb 9cdf728a90 Introduce a done_rebuildmake variable, instead of abusing do_rebuildmake
to mean both "must rebuild make" and "have already rebuilt make".
2009-09-27 17:55:53 +00:00
apb d1373a044c Rename raw_getmakevar to bomb_getmakevar. It wasn't "raw" at all; it
was (and is) a wrapper around nobomb_getmakevar.
2009-09-27 17:48:19 +00:00
apb f1ead22021 Allow build.sh "-C cdextra" option to be specified multiple times. 2009-09-27 17:28:38 +00:00
apb b4f381c612 Make resolvepath and resolvepaths slightly less magic. They now take
a variable name as an arg unstead of always working on $OPTARG,
and resolveepaths is now a wrapper around resolvepath instead of
duplicating code.
2009-09-27 17:25:01 +00:00
jnemeth d57c8fa8c6 Add a modules operation to build.sh, which builds and installs kernel modules
into DESTDIR.

This is based on the patch provided by tsutsui@ on tech-toolchain@.
2009-09-07 04:14:17 +00:00
perry 1fd3f53afd Add a MKARZERO flag, which invokes ar(1) with the new D flag when it
is set to "yes" -- defaults to "no" except for build.sh builds. This
results in a deterministic .a file rather than one that reflects
timestamps and permissions on the source files.

Also, clean up the ar flags we're using, and remove a redundant use of
ranlib that on a modern POSIX ar can be done with the "s" flag.

Discussed on tech-toolchain
2009-03-13 16:23:31 +00:00
apb a599e86f4b Add "-", "_", and "A-Z" to the set of allowed characters in the
result from `uname -p`.  We already have a platform with an underline
("x86_64"), and the other chars seem harmless.
2009-03-09 06:25:51 +00:00
apb 5ebdda3e89 In build.sh and bsd.own.mk, if uname -p fails, or prints "unknown", or
prints something that does not look like an identifier, then use uname
-m instead.  (Cygwin prints "unknown", and OpenBSD prints a long string
containing several spaces; this code should handle both.)
2009-03-06 16:29:40 +00:00
lukem 5bad8e7d9c Implement make_in_dir <dir> <op> to simplify various operations 2009-02-25 23:34:10 +00:00
sketch 7ce9d1c8ea Make 'build.sh tools' work with the Sun Studio compiler, although bugs in
some of the generated tools still prevent building a full release using them.
2009-02-24 22:25:24 +00:00
plunky e93c5d3dce update usage message for -x to "build X11" rather than "build X11R6" 2009-02-21 22:04:35 +00:00
apb e746baefad "\t" does not represent a tab in sed regular expressions,
so use a ${tab} variable instead.  This bug was found by
Jeremy C. Reed.
2009-01-03 08:23:00 +00:00
apb c89f08d79b Add support for new MAKEVERBOSE levels 3 and 4. The complete list is now:
0   Minimal output ("quiet")
 1   Describe what is occurring
 2   Describe what is occurring and echo the actual command
 3   Ignore the effect of the "@" prefix in make commands
 4   Trace shell commands using the shell's -x flag

The default remains MAKEVERBOSE=2.
2008-11-13 20:40:11 +00:00
apb 9af4e3ff5b Try harder to guess the correct TOOLDIR.
Adapted from a proposal by Izumi Tsutsui in tech-toolchain.
2008-10-26 23:40:06 +00:00
lukem 36e7d1970c Remove support for printing "'-x' has been replaced by 'xxxxx'".
The old option hasn't worked since 2003/01/23 (before NetBSD 2.0.)
2008-08-22 23:41:24 +00:00
lukem 8ee8058e34 Fix "-n releasekernel=..."
Patch from Jukka Salmi in PR 33096.
2008-08-18 06:40:09 +00:00
lukem e8d2dcc221 Implement "cleandir". Inspired by PR 39362.
Consistently expand tabs in the usage.
2008-08-18 05:26:05 +00:00
lukem e33cf6cb97 Determine top-level objdir from the environment $MAKEOBJDIRPREFIX early on,
and store in the (non-exported) $TOP_objdir.
(We can't do the same for the environment $MAKEOBJDIR since it may contain
make(1) expressions that aren't easily parseable by sh(1))
Remember appropriate variations of '-M modp' and '-O mod' in $TOP_objdir
(replacing $makeobjdir misuse).
Use $TOP_objdir when trying to guess the TOOLDIR,
and when detecting if the top-level objdir needs to be created.
Fixes problems observed when testing fixes for PR 39360 and 39361.

Fix the TOOLDIR path used when guessing the TOOLDIR.
PR 39360 from Andrew Cagney <cagney@gnu.org>

Use stricter result checking from make(1) when guessing the TOOLDIR.
PR 39361 from Andrew Cagney <cagney@gnu.org>
2008-08-16 00:10:04 +00:00
lukem 095e5fa04c crank copyright 2008-08-15 22:22:15 +00:00
apb 553ee2109e Don't bomb if we can't detect the top level obj directory name.
Apparently there are things you can do in the environment or mk.conf
to set your object directory in a way that the previous code couldn't
detect.  (This is an interim measure until we can properly detect and
create the top level object directory in all cases.)
2008-08-08 07:30:42 +00:00
apb 1b101ece85 If neither -M nor -O was specified, but the source directory is
/usr/src, then try to figure out what object directory would be chosen
by bsd.obj.mk, and pre-create it.
2008-08-05 22:35:32 +00:00
perry b1d7b7c21a Builds now use "BUILDSEED" so that c++ binaries are reproduceable.
By default BUILDSEED is set to NetBSD-{majorversion} -- a -S flag may
be used to change it.

Discussed on tech-toolchain.
2008-08-05 19:43:33 +00:00
dyoung a475a8844f Make build.sh -C work as advertised. 2008-06-27 21:38:36 +00:00