Commit Graph

107 Commits

Author SHA1 Message Date
thorpej 3b08abd277 * Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:

  TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
  no working in-tree toolchain (hppa, ns32k, sh5, x86_64).

  EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
  an external toolchain (e.g. /usr/local/gnu).  This enables the cross-build
  framework even for TOOLCHAIN_MISSING platforms.

  If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
  unconditionally set to "no", since the bits are not there to build.

  If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
  since the external toolchain's compiler is not in-sync with the
  in-tree compiler support components (e.g. libgcc).

* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
  that file can use it.
2002-09-17 23:18:25 +00:00
lukem 951972b555 - move LDSTATIC=-static to the bottom, so that "LDSTATIC=" in /etc/mk.conf
doesn't cause lossage
- set NOMAN= at the top (rather than MKMAN=no)
2002-08-20 01:52:58 +00:00
scw 4c8e482124 Add SH5 support. (Missed these during the last sweep of my local tree) 2002-07-11 21:46:21 +00:00
pooka ade9640026 Add -o, -D, and -L to usage() to get it in sync with reality. 2002-07-09 12:49:10 +00:00
pooka d395d11df0 Add envp argument support to crunchgen.
Even though envp is not the POSIX way of crawling through the environment,
this will hopefully save someone from having to scratch their head
really hard with a crunched program using envp.

from henric@aimnet.com, via OpenBSD
2002-07-03 12:45:06 +00:00
tsutsui 490896d4c4 Include <limits.h> for SIZE_T_MAX since time.h no longer
includes <machine/limits.h>.
2002-06-30 03:26:59 +00:00
pooka b31cb5dea9 add -o to synopsis 2002-06-12 11:22:41 +00:00
lukem f5aa03d2fa revert revision 1.37; it causes problems when running make(1) on a
crunchgen-created makefile with a partiallly complete build
(a situation which is more common than you think...)

solving the "parallel build" problem for crunchgen-created makefiles
needs to be done a different way...

fixes [toolchain/17012] from me.
2002-05-29 09:41:51 +00:00
sommerfeld 508e207b01 Some tweaks to (hopefully) make the crunchgen-generated makefile
parallel-build-safe.
2002-05-02 21:18:31 +00:00
sommerfeld 128f7ba0f7 Invoke the "make crunchgen_objs" submake with -B so we aren't confused
if we're being invoked in the context of a parallel build.
2002-04-29 04:20:56 +00:00
tv b0f4369532 Move check of USE_NEW_TOOLCHAIN so it'll actually be *defined* for a native
crunchgen binary where appropriate.
2002-04-10 17:29:25 +00:00
tsutsui aed1e4e07e Note -d flag in SYNOPSIS. 2002-04-06 18:30:02 +00:00
lukem 9aa4b4fe5d Move tempfname[] to fillin_program_objs() (the only place that calls it),
and assign it before each use of mkstemp(3).
Problem noted by Ben Harris <bjh21@netbsd.org> in [toolchain/16140].
2002-03-31 08:02:08 +00:00
lukem 1cdb82d0a7 Use "r" instead of "r+" to popen(3), since the latter is not portable
and the I/O stream is only read from in any case. Problem noted and fix
suggested by Ben Harris <bjh21@netbsd.org> in [toolchain/16139].
2002-03-31 07:48:15 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
lukem 2321ad750f CRUNCHEDPROG=1 is a bit more useful if it's also defined when
determining prog_OBJPATHS ...
2002-02-02 12:25:35 +00:00
lukem ab2c3dcd21 pass CRUNCHEDPROG=1 to make(1) when building progs from their Makefiles.
allows different options for programs that are being crunchgen(3)ed.
2002-02-02 12:14:41 +00:00
tv 554a73a4ce Include config.h for host tool; protect __RCSID. 2002-01-31 19:24:47 +00:00
ragge a8858d3140 Add special command "keepsymbols", allows the specified external symbols
not to be hidden. From Jens Nilsson, jens@rockstorm.se.
2002-01-25 12:05:00 +00:00
fredette a01e8e37b1 Define both NLIST_AOUT and NLIST_ELF32 for m68000. 2001-12-12 22:14:46 +00:00
tv 8e6f7afb5b MKfoo=no -> NOfoo 2001-12-12 01:48:43 +00:00
wiz a48cf1293d Use .Bd -literal. 2001-12-01 19:02:07 +00:00
tv 5da3f37a1c Use .PATH to find mkskel.sh; formatting cleanup. 2001-11-12 18:53:40 +00:00
jmc edf781f5fc Oops...don't nuke the global symbols with objcopy. Just keep the crunched stub
and revert the others to locals
2001-11-08 07:35:00 +00:00
drochner ae7b2f469f remove superflouos arguments to fprintf() 2001-11-07 18:22:39 +00:00
christos 3058ad6190 make sure that we ramdiskbin is static. By the numbscull! Nobody tested this?
BTW. it seems that only make working floppies with USETOOLS=no. Will
investigate more.
2001-11-07 04:48:07 +00:00
thorpej 32928fda0d When adding something to CPPFLAGS, use +=, not = 2001-10-25 01:47:11 +00:00
jmc 0fbad14c98 Check for MAKEFLAGS in the env and pass those to the test make's run for
finding obj files. Otherwise -m <new mk files> won't get passed and can
cause problems on some cross builds.
2001-10-21 23:06:59 +00:00
jmc 6addac288f If USE_NEW_TOOLCHAIN is defined use objcopy instead of crunchide as it works now. 2001-10-05 22:52:56 +00:00
wiz fc7396be3d Whitespace, punctuation, section header fixes, sort sections. 2001-10-04 11:20:39 +00:00
wiz c0de7313ab Whitespace fixes. 2001-10-04 11:20:17 +00:00
jmc ab4dcdab07 Convert makefile to use bsd.prog.mk. Makes linking work since the .mk file
takes care of it and this will handle a DESTDIR build setup then.
2001-10-04 07:34:47 +00:00
jmc 03648a201b Add a -d option to set the DBG flag to whatever flags the builder wants. If
it's not set, default to -Os (so it's not hard coded into the binary.)

Generate a makefile by default that does all object file builds in local
subdirs by binary (i.e. bad144 gets built in $OBJDIR/bad144) via a reach over
make. (Sets .PATH and .CURDIR and does a make for the objects needed in that
dir).

Add a -o option that does the old behavior of searching for obj files by
querying the various object environment vars and searching. Without this
option none of the objdir special options, environment vars, etc will have
effect.

Document all the changes in the man page (and specificly note that without -o
none of the objdir functions take effect).
2001-10-04 04:17:04 +00:00
tls 5cb98b6cb9 Fix some lossage in previous commit: don't remove everything when cleaning
in a source directory, just the object files.  This is a _very temporary_
fix; I will untangle the meaning of UPDATE, etc. in this context presently.
2001-09-24 01:05:47 +00:00
tls 0b6a2936aa Changes to the emitted makefiles that actually build the objects:
1) Always do a make clean before building objects in any directory.  This
   is wasteful, but there's really no other simple way to cope with the
   fact that the compilation settings (e.g. CFLAGS) appropriate for the
   non-crunched build of a program may not be appropriate for the crunched
   build.  If the objdir magic in make didn't rely upon the presence of an
   "obj" or "obj.${MACHINE}" symlink, we could abuse it to handle this but
   unfortunately, it does.

2) Override $DBG to cause object files to be built with -Os.  We can't emit
   "DBG?=" into the generated makefile because of order-of-inclusion issues
   with the system Makefiles; the result would be that the default setting
   (currently -O2) would always be used instead of -Os.  If you're crunching,
   you almost certainly are doing it to get a smaller executable (!) so -Os
   is almost certainly appropriate for you.
2001-09-24 00:40:35 +00:00
bjh21 b7abea421d Build in ELF32 support on all ARM platforms. 2001-06-30 14:52:42 +00:00
tsutsui de539bb089 Define both NLIST_AOUT and NLIST_ELF32 on all m68k
rather than checking ${MACHINE}.
2001-02-18 05:22:46 +00:00
christos 35d2e40e99 fix nested extern 2001-02-05 01:39:27 +00:00
itojun 92ee339d1c sh3 split 2001-01-04 09:43:05 +00:00
simonb 0a76fbb1e6 Another object file format reference for hp300. 2001-01-02 12:30:14 +00:00
mrg ad2b8edf8a fix oversight in previous: also look for $MACHINE_ARCH of mipse[bl]. 2000-12-23 09:06:06 +00:00
scw 9bb48d10db Pick the supported object formats in the Makefile instead of extern.h.
This gives more control of which platforms support which formats.
(Basically because __%{MACHINE}__ is not pre-defined by the compiler)
2000-12-18 08:51:39 +00:00
lukem 279552d3db fix up various .Nm abuses:
- keep the case consistent between the actual name and what's referenced.
  e.g, if it's `foo', don't use '.Nm Foo' at the start of a sentence.
- remove unnecessary `.Nm foo' after the first occurrence (except for
  using `.Nm ""' if there's stuff following, or for the 2nd and so on
  occurrences in a SYNOPSIS
- use Sx, Ic, Li, Em, Sq, and Xr as appropriate
2000-11-07 06:43:24 +00:00
garbled 35e9659b6d change the direct call to crunchide to ${CRUNCHIDE} 2000-11-01 07:16:02 +00:00
garbled 3cc7cf211a While I'm here.. document the rest of the environment variables I found in
this program.
2000-10-30 10:16:15 +00:00
garbled 4c2d830e97 Document the MAKE environment variable. 2000-10-30 10:02:39 +00:00
garbled 331c044669 Modify this to obey $MAKE in the environment, instead of allways calling
"make" hardcoded.  This should cause my cross-ramdisk-builds to stop
blowing a gasket.
2000-10-30 09:55:09 +00:00
matt a28f4d4751 Teach crunchgen.c about MAKEOBJDIRPREFIX. 2000-09-08 17:20:47 +00:00
jhawk a022cf9d37 Use
${MAKE}
instead of
  make
2000-08-30 23:51:46 +00:00
mrg 14e83027c8 add sparc64 support. 2000-08-09 14:22:15 +00:00