History log of /freebsd-10.0-release/usr.sbin/crunch/crunchgen/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


246346 05-Feb-2013 pfg

crunchgen: Permit use of alternative linkers.

Submitted by: Pete Chou
MFC after: 1 week


246261 02-Feb-2013 pfg

crunch: Sync some NetBSD changes

Revert a comment that was not supposed to go away.

Obtained from: NetBSD


246256 02-Feb-2013 pfg

crunch: Sync some NetBSD changes.

crunchide:
Apr 11, 2009: fix some -Wsign-compare issues.
Sep 20, 1999: Free the right thing.

crunchgen:
Apr 14, 2009: Fix some WARNS=4 issues (-Wshadow -Wcast-qual)
Oct 30, 2004: Add (unsigned char) cast to ctype functions
Feb 5, 2001: fix nested extern.

examples:
Aug 30, 2007: NetBSD 36867 - trsp references are deprecated

Obtained from: NetBSD
MFC after: 1 week


237625 27-Jun-2012 obrien

Some amount of style(9)
-- function definitions, header ordering, and $FreeBSD$.


237574 25-Jun-2012 obrien

Ensure crunchen uses the same make binary as the rest of the build.

Submitted by: Simon Gerraty <sjg@juniper.net>


213573 08-Oct-2010 uqs

mdoc: drop redundant .Pp and .LP calls

They have no effect when coming in pairs, or before .Bl/.Bd


208027 13-May-2010 uqs

mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by: mdocml lint run
Reviewed by: ru


187943 31-Jan-2009 obrien

Run with -B and just .POSIX.


187131 13-Jan-2009 obrien

Set .POSIX mode, along with disable parallel mode. Crunchgen parses the
output from make(1) and its picky what it should look like.
Also use make's conditional assignment operator rather than test and set.


173067 27-Oct-2007 yar

Include <stdlib.h> for the right prototype for exit(3).


173065 27-Oct-2007 yar

Set the program name if the crunched program is selected through
argv[1] to mimic crt0 behaviour. Do the job by a direct assignment
to __progname in order to stay compatible with NetBSD, whose
setprogname() is a deliberate no-op.

The reason for this change is that some programs (usually those
imported from NetBSD) use getprogname() to distinguish between their
aliases. (See pkill aka pgrep for example.)

This change can be useful, and applicable, to NetBSD, too.


164654 27-Nov-2006 jb

Back out half of my previous change to support parallel makes.
The generated Makefile clashes with the src/bin/sh/Makefile, causing
it to try to use a rule to build something it doesn't need to.


164571 24-Nov-2006 jb

Fix another parallel make problem with the generated make file.

Define the xxx_OBJPATHS earlier and then use it in the xxx_make
target because each obj is actually made through that.

This allows the crunch to work with -j32 on sun4v.

The makefile generated is still poor, though. It really shouldn't use
the general 'make all' to do the submakes in the app directories being
crunched because each of those objects is listed as a dependency in
the generated crunch makefile. Doing that really requires a unique rule
to generate them.


164504 22-Nov-2006 jb

Add the SUBMAKE_TARGETS (like ppp_make) to the dependency list
for linking the crunched app so that when a parallel make is run
(like -j32 on sun4v), the link waits for the sub-make processes
to complete.


162806 29-Sep-2006 ru

Markup fixes.


153688 23-Dec-2005 ceri

Bump .Dd before I get told off.


153687 23-Dec-2005 ceri

Commands like gmirror, graid3, ... and others which use dlopen() to load
classes from say, /lib/geom, cannot be statically linked completely.
Moreover, those shared objects may require other shared objects (i.e.
for geom, libraries like -lmd, -lcrypto).

The libs_so extension to crunchgen fixes this by allowing some libraries
to be linked in dynamically. This requires that a copy of rtld and the
shared libraries be made available to the crunched binary, and so is not
suitable for all environments. Crunchgen configurations which do not
use the 'libs_so' keyword are unaffected and produce identical binaries
with and without this commit.

Approved by: murray (mentor, in spirit), jhb
In collaboration with: Adrian Steinmann <ast at marabu dot ch>
MFC After: 6 weeks


140509 20-Jan-2005 ru

In crunchgen(1), when calling make(1), don't redirect stderr to stdout,
just rely on the exit status to detect an error. This makes crunchgen(1)
safe to use with certain make(1) debugging flags.

MFC after: 1 week


133399 09-Aug-2004 harti

Fix a 4.X -> 5.X upgrade problem: crunchgen used to emit a line 'MAKE=make'
or 'env MAKEOBJDIRPREFIX=... make' depending on the setting of
MAKEOBJDIRPREFIX in the environment. In any case this line kills the
original value of ${MAKE}. When during buildworld a new make is built (as
is the case during the upgrade) this causes a wrong make to be picked up
(the first one in the path). Use the same technique as Makefile.inc1:
create a MAKEENV variable and a CRUNCHMAKE that calls ${MAKE} with that
MAKEENV prefixed. Use CRUNCHMAKE instead of MAKE throughout the generated
makefile. This leaves the original ${MAKE} undisturbed.


113886 23-Apr-2003 ru

The second chdir(1) that I trimmed is needed too
if the program has an object directory.

Explained by: Tim Kientzle <kientzle@acm.org>


113855 22-Apr-2003 ru

chdir(1) into a source directory before attempting to determine the
OBJS list. This is needed to crunch any program that relies on the
correct .CURDIR setting, e.g. src/bin/csh.

Submitted by: Tim Kientzle <kientzle@acm.org>


101550 09-Aug-2002 gshapiro

Apply the envp fix to the other call to main() as well.

Submitted by: Peter Edwards <pmedwards@eircom.net>


101341 04-Aug-2002 gshapiro

Pass envp to crunched program's main() routines as some depend on it.
Note that crunchgen's stub .c programs already have the code to use it:

"int _crunched_%s_stub(int argc, char **argv, char **envp)"
"{return main(argc,argv,envp);}\" >%s_stub.c\n",

Add $FreeBSD$ to allow the commit.

Reviewed by: luigi
MFC after: 3 days


97559 30-May-2002 ru

mdoc(7) police: markup nit.


95127 20-Apr-2002 charnier

Use `The .Nm utility'


93435 30-Mar-2002 luigi

Add a "special progname lib xxx ..." command to crunchgen
so the .lo files can be partially linked against libraries
which redefine symbols in the standard libs, or which reference
symbols in the objects.

Submitted by: Sam Leffler
MFC After: 3 days


81823 17-Aug-2001 joe

Make source crunches work as well as object crunches; broken in the
last commit that fixed object crunches.

Repeat after me, "no excuses for not testing".


81700 15-Aug-2001 joe

Make crunchgen crunch pre-built object files again, i.e.:

progs prog1
special prog1 objdir ../../prog1/obj
special prog1 objs prog1.o

This fixes a bug that I introduced around the time of 4.2-release.

Reported by: Larry Baird <lab@gta.com>


81622 14-Aug-2001 ru

mdoc(7) police: s/BSD/.Bx/ where appropriate.


80029 20-Jul-2001 obrien

Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.


80022 20-Jul-2001 obrien

Remove GCC'isms in CFLAGS.


79537 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


78520 20-Jun-2001 joe

Use 'LIBS+= ...' instead of 'LIBS= ...' in the generated makefile
so that the user can override libraries at build time. This is
makes it easier to cross-compile crunch builds.

Suggested by: luigi
MFC after: 3 days


75153 04-Apr-2001 ru

Document ``special <progname> ident <identifier>'' command.


75152 04-Apr-2001 ru

- Call `subclean' after `clean' for each program.
- Eliminate compiler warning.


75016 30-Mar-2001 ru

`buildopts' may affect the selection of object files.
Make sure we pass $(BUILDOPTS) to the `clean' target
so that `make clean' works on the same set of object
files. Otherwise, we may end up with an incorrectly
built and up-to-date object file.


70884 10-Jan-2001 joe

Liberal application of style(9).


70880 10-Jan-2001 joe

Flag an error and remove the program from the list if there is
no source directory or no objects can be determined.

Initialise a structure variable.


70331 24-Dec-2000 joe

Clean up the source directory finding code, and in the process fix a
problem that occurs when a program's source isn't found.


70124 17-Dec-2000 joe

Use one of the TMPDIR env variable or _PATH_TMP instead of hardcoding
/tmp.

Submitted by: jedgar


70115 17-Dec-2000 joe

Avoid potential problems with the existance of a shadow obj directory
confusing the 'make -f tmpfile' in the tmpfile, by creating it in /tmp.


70114 17-Dec-2000 joe

Clarify an ambiguous 'else' introduced by a recent commit.


70113 17-Dec-2000 joe

o check strdup() return values
o strcpy() -> strlcpy()
o sprintf() -> snprintf()
o mktemp() -> mkstemp()
o use err() instead of errx() in out_of_memory() function since
errno will probably be set

Submitted by: jedgar


70112 17-Dec-2000 joe

Hopefully the last patch in a series to try and teach crunchgen to
handle MAKEOBJDIRPREFIX better, in conjunction with the -o and -p
flags.


69446 01-Dec-2000 ru

mdoc(7) police: fixed errors from the previous revision, keep
the synopsis in a nice form, and a few more cosmetic changes.


69413 30-Nov-2000 luigi

Make crunchgen aware of obj directories. Formerly it had
/usr/obj hardwired in the code, now you can override it
with a command line option or MAKEOBJDIRPREFIX env. variable.
The above is useful to build picobsd-specific objects in some other
place than /usr/obj

While at it, fix documentation and change a few sprintf -> snprintf.


68965 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68854 17-Nov-2000 ru

mdoc(7) police: use certified section headers wherever possible.


68824 16-Nov-2000 ru

mdoc(7)ify.


68750 15-Nov-2000 joe

Add and document a new configuration command: buildopts.
This allows global make options to be specified within the crunch
configuration file.


68575 10-Nov-2000 ru

Avoid use of direct troff requests in mdoc(7) manual pages.


68569 10-Nov-2000 joe

Define a new special type: buildopts.

This allows build flags to be specified for a particular program from
within the crunch.conf file, eg:

prog ppp
special ppp buildopts -DNOKLDLOAD -DNOINET6 -DNONAT -DNOATM

This adds '-DNOKLDLOAD -DNOINET6 -DNONAT -DNOATM' to make targets
related to ppp when determining which object files to build and
when calculating dependencies and building the targets.


68512 09-Nov-2000 steve

Since the 'when built' phrase is talking about the 'source file' we
should be using the word 'creates' instead.


68286 03-Nov-2000 joe

Cause prog_make targets to include a ``make obj'' rule if the -o flag
is given to crunchgen.
[ This fixes the previous commit which silently added ``make obj'' ]


68285 03-Nov-2000 joe

A missing feature of crunchgen was the ability to supply make options on
a per program basis.

This has now been added in the following way:

* Harness the make header file that's specified with the -h argument:
- Allow the user to define $(OPTS) to specify make arguments that should
be added to every program target.
- Allow the user to define $(prog_OPTS) to specify make arguments that
should just be added to the build of 'prog'.

* Make sure that $(OPTS) and $(prog_OPTS) are defined when looking through
each program's make file to determine which object files to crunch.

* When building the crunchgen makefile add $(OPTS) and $(prog_OPTS)
to the depend and build rules for $(prog_OBJS).


65148 28-Aug-2000 grog

Add the description of some hard-learnt restrictions and a workaround.


57673 01-Mar-2000 sheldonh

Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.


56995 05-Feb-2000 luigi

Add a few features to crunchgen to simplify the use of existing
makefiles (for use with picobsd among other things).
See the manpage for details, but:

* -h makefile-include-name
can be used to specify a file to include in the makefiles
generated by crunchgen . This is a good place to specify make
variables such as RELEASE_CRUNCH, NOTHIS, NOTHAT and the like.

* special progname objvar variable_name
in the crunch config file declares a different variable than
OBJS to be used to get the list of objects.

* crunchgen now looks first for Makefile.<progname> in the current
directory to override the makefile in <progname> source dir.
This in many cases avoids the need to patch the original makefile
if the above two features are still not enough.

Approved-By: jordan


50479 28-Aug-1999 peter

$Id$ -> $FreeBSD$


48791 12-Jul-1999 nik

Add $Id$, to make it simpler for members of the translation teams to
track.

The Id line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

.\" $Id$
.\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by: bde


39171 14-Sep-1998 jkh

Assume ELF-style symbol names now.
Submitted by: jhay


34809 23-Mar-1998 charnier

.Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq.


32704 22-Jan-1998 sos

Use /bin/pwd instead of a potentially shell builtin that does
not return the "real" path.
This makes it possible to have the .o files put in the /usr/obj
hierachy instead of in the /usr/src one.


32589 17-Jan-1998 brian

Remove the necessity of -ldes and -lalias etc from release/Makefile.
When building a release, RELEASE_CRUNCH is defined for a `make' of
the objects required by the crunch of each program. The object list
is still obtained in the same way, so you must make sure that all
objects are built (empty if necessary) by this make. ppp/Makefile
provides an example.

Reviewed by: jkh


30120 05-Oct-1997 joerg

Add a new special called `keep' to the list of special options. It
provides for a means to specify an argument for crunchide's -k option.
(This is required by ntpdate.)

Submitted by: peter@rhiannon.clari.net.au (Peter Hawkins)


29453 15-Sep-1997 charnier

Use err(3).


29329 13-Sep-1997 wosch

spelling corrections.

PR: docs/4450
Submitted by: josh@quick.net


28925 30-Aug-1997 jmg

fix misspelling

Submitted-by: Josh Gilliam

Closes PR:4423


19822 16-Nov-1996 joerg

Initialize memory obtained by malloc().

Detected by: phkmalloc -AJ


17430 04-Aug-1996 phk

Enhance crunchgens understanding of our new /usr/obj/`pwd` strategy.


17176 15-Jul-1996 phk

Make crunchgen match the new obj/ convention.


16613 23-Jun-1996 bde

Removed -g from CFLAGS.


13123 30-Dec-1995 peter

This commit was generated by cvs2svn to compensate for changes in r13122,
which included commits to RCS files with non-trunk default branches.


8857 30-May-1995 rgrimes

Remove trailing whitespace.


8664 21-May-1995 phk

Added a crunched_here(char *path) function so crunched programs can find out
who they share bed and breakfast with.


6696 25-Feb-1995 phk

Add a '-l' option, which lists the argv[0]'s we will respond to. This will
simplify the src/release Makefile quite a bit.


4847 28-Nov-1994 ats

Add the automatically generated crunched_skel.c file to the CLEANFILES.


3345 03-Oct-1994 phk

Make sure mkskel.sh bails out if it finds trouble. Use "sh -e" to run it.


1771 24-Jun-1994 jkh

Just talked with James - there's another, better way to go about this.
Back out my earlier change. Note that this is just for the 1.1.5R floppies;
the 1.1.5A ones still have the work-around method (which works fine and
doesn't hurt anything, it's just kludge!).


1770 24-Jun-1994 jkh

This is a kludge. Unless I make a link from sh to - (which would leave a file
called `-' lying around on the users system forever) login shells will fail.
Just special-case the handling of `-' for now until/unless I find a more
palatable solution.


1723 15-Jun-1994 jkh

This commit was generated by cvs2svn to compensate for changes in r1722,
which included commits to RCS files with non-trunk default branches.