a2p
accept
access
acct
addftinfo
addr2line
adjtime
afmtodit
after
aio_cancel
aio_error
aio_read
aio_return
aio_suspend
aio_waitcomplete
aio_write
alias
aliases
alloc
anvil
append
apply
apropos
ar
array
as
asa
asn1parse
at
atq
atrm
attemptckalloc
attemptckrealloc
authlib
authtest
autopoint
awk
b64decode
b64encode
basename
batch
bc
bdes
bell
bg
bgerror
biff
big5
binary
bind
bindkey
bindtags
bindtextdomain
bio
bitmap
blowfish
bn
bootparams
bootptab
bounce
brandelf
break
breaksw
brk
bsdiff
bsdtar
bsnmpd
bspatch
bthost
btsockstat
buffer
builtin
builtins
bunzip2
button
byacc
bzcat
bzegrep
bzfgrep
bzgrep
bzip2
c2ph
c89
c99
ca
cal
calendar
canvas
cap_mkdb
case
cat
catch
catman
cc
cd
cdcontrol
chdir
checkbutton
checknr
chflags
chfn
chgrp
chio
chkey
chmod
chown
chpass
chroot
chsh
ci
ciphers
ckalloc
ckdist
ckfree
ckrealloc
cksum
cleanup
clear
clipboard
clock
clock_getres
clock_gettime
clock_settime
close
cmp
co
col
colcrt
colldef
colors
colrm
column
comm
command
compile_et
complete
compress
concat
config
connect
console
continue
core
courierlogger
couriertcpd
cp
cpan
cpio
cpp
creat
crl
crontab
crunchgen
crunchide
crypt
crypto
csh
csplit
ctags
ctm
ctm_dequeue
ctm_rmail
ctm_smail
cu
cursor
cursors
cut
cvs
date
dbiprof
dbiproxy
dc
dcgettext
dcngettext
dd
dde
default
defer
deliverquota
des
destroy
devfs
df
dgettext
dgst
dh
dhparam
dialog
diff
diff3
dig
dir
dirent
dirname
dirs
discard
disktab
dngettext
do
domainname
done
dprofpp
dsa
dsaparam
dtmfdecode
du
dup
dup2
eaccess
ec
ecdsa
echo
echotc
ecparam
ed
edit
editrc
ee
egrep
elf
elfdump
elif
else
enc
enc2xs
encoding
end
endif
endsw
engine
enigma
entry
env
envsubst
eof
eqn
err
errno
error
errstr
esac
ethers
euc
eui64
eval
event
evp
ex
exec
execve
exit
expand
export
exports
expr
extattr
extattr_delete_fd
extattr_delete_file
extattr_get_fd
extattr_get_file
extattr_set_fd
extattr_set_file
f77
false
famm
famx
fblocked
fbtab
fc
fchdir
fchflags
fchmod
fchown
fcntl
fconfigure
fcopy
fdescfs
fdformat
fdread
fdwrite
fetch
fg
fgrep
fhopen
fhstat
fhstatfs
fi
file
file2c
fileevent
filename
filetest
find
find2perl
finger
flex
flock
flush
fmt
focus
fold
font
fontedit
for
foreach
fork
format
forward
fpathconf
frame
from
fs
fstab
fstat
fstatfs
fsync
ftp
ftpchroot
ftpusers
ftruncate
futimes
g711conv
gb2312
gb18030
gbk
gcc
gcore
gcov
gdb
gencat
gendsa
genrsa
gensnmptree
getconf
getdents
getdirentries
getdtablesize
getegid
geteuid
getfacl
getfh
getfsstat
getgid
getgroups
getitimer
getlogin
getopt
getopts
getpeername
getpgid
getpgrp
getpid
getppid
getpriority
getresgid
getresuid
getrlimit
getrusage
gets
getsid
getsockname
getsockopt
gettext
gettextize
gettimeofday
gettytab
getuid
glob
global
gmake
goto
gperf
gprof
grab
grep
grid
grn
grodvi
groff
groff_font
groff_out
groff_tmac
grog
grolbp
grolj4
grops
grotty
group
groups
gunzip
gzcat
gzexe
gzip
h2ph
h2xs
hash
hashstat
hd
head
help2man
hesinfo
hexdump
history
host
hostname
hosts
hosts_access
hosts_options
hpftodit
http
hup
i386_get_ioperm
i386_get_ldt
i386_set_ioperm
i386_set_ldt
i386_vm86
iconv
id
ident
idprio
if
ifnames253
ifnames259
image
imapd
incr
indent
indxbib
info
infokey
inode
install
instmodsh
interp
intro
introduction
ioctl
ipcrm
ipcs
ipf
ipftest
ipnat
ippool
ipresend
issetugid
jail
jail_attach
jobid
jobs
join
jot
kbdcontrol
kbdmap
kcon
kdestroy
kdump
kenv
kevent
keycap
keylogin
keylogout
keymap
keysyms
kgdb
kill
killall
killpg
kinit
kldfind
kldfirstmod
kldload
kldnext
kldstat
kldsym
kldunload
klist
kpasswd
kqueue
kse
kse_create
kse_exit
kse_release
kse_switchin
kse_thr_interrupt
kse_wakeup
ktrace
label
labelframe
lam
lappend
last
lastcomm
lastlog
lchflags
lchmod
lchown
ld
ldap
ldapadd
ldapcompare
ldapdelete
ldapmodify
ldapmodrdn
ldappasswd
ldapsearch
ldapwhoami
ldd
leave
less
lesskey
lex
lgetfh
lhash
libnetcfg
library
limit
limits
lindex
link
linprocfs
linsert
lint
lio_listio
list
listbox
listen
lj4_font
lkbib
llength
lmtp
ln
load
loadfont
local
locale
locate
lock
lockf
log
logger
login
logins
logname
logout
look
lookbib
lorder
lower
lp
lpq
lpr
lprm
lptest
lrange
lreplace
ls
lsearch
lseek
lset
lsort
lstat
lsvfs
lutimes
lynx
m4
madvise
magic
mail
maildiracl
maildirkw
maildirmake
mailq
mailx
make
makeinfo
makewhatis
man
manpath
master
mc
mcedit
mcview
md2
md4
md5
mdc2
memory
menu
menubar
menubutton
merge
mesg
message
mincore
minherit
minigzip
mkdep
mkdir
mkfifo
mkimapdcert
mklocale
mknod
mkpop3dcert
mkstr
mktemp
mlock
mlockall
mmap
mmroff
modfind
modfnext
modnext
modstat
moduli
more
motd
mount
mprotect
mptable
msdos
msdosfs
msgattrib
msgcat
msgcmp
msgcomm
msgconv
msgen
msgexec
msgfilter
msgfmt
msggrep
msginit
msgmerge
msgs
msgunfmt
msguniq
mskanji
msql2mysql
msync
mt
munlock
munlockall
munmap
mv
myisamchk
myisamlog
myisampack
mysql
mysqlaccess
mysqladmin
mysqlbinlog
mysqlcheck
mysqld
mysqldump
mysqld_multi
mysqld_safe
mysqlhotcopy
mysqlimport
mysqlshow
mysql_config
mysql_fix_privilege_tables
mysql_zap
namespace
nanosleep
nawk
nc
ncal
ncplist
ncplogin
ncplogout
neqn
netconfig
netgroup
netid
netstat
networks
newaliases
newgrp
nex
nfsstat
nfssvc
ngettext
nice
nl
nm
nmount
nohup
nologin
notify
nroff
nseq
nslookup
ntp_adjtime
ntp_gettime
nvi
nview
objcopy
objdump
objformat
ocsp
od
onintr
open
openssl
opieaccess
opieinfo
opiekey
opiekeys
opiepasswd
option
options
oqmgr
pack
package
packagens
pagesize
palette
pam_auth
panedwindow
parray
passwd
paste
patch
pathchk
pathconf
pawd
pax
pbm
pcre
pcreapi
pcrebuild
pcrecallout
pcrecompat
pcrecpp
pcregrep
pcrematching
pcrepartial
pcrepattern
pcreperform
pcreposix
pcreprecompile
pcresample
pcretest
perl
perl56delta
perl58delta
perl561delta
perl570delta
perl571delta
perl572delta
perl573delta
perl581delta
perl582delta
perl583delta
perl584delta
perl585delta
perl586delta
perl587delta
perl588delta
perl5004delta
perl5005delta
perlaix
perlamiga
perlapi
perlapio
perlapollo
perlartistic
perlbeos
perlbook
perlboot
perlbot
perlbs2000
perlbug
perlcall
perlcc
perlce
perlcheat
perlclib
perlcn
perlcompile
perlcygwin
perldata
perldbmfilter
perldebguts
perldebtut
perldebug
perldelta
perldgux
perldiag
perldoc
perldos
perldsc
perlebcdic
perlembed
perlepoc
perlfaq
perlfaq1
perlfaq2
perlfaq3
perlfaq4
perlfaq5
perlfaq6
perlfaq7
perlfaq8
perlfaq9
perlfilter
perlfork
perlform
perlfreebsd
perlfunc
perlglossary
perlgpl
perlguts
perlhack
perlhist
perlhpux
perlhurd
perlintern
perlintro
perliol
perlipc
perlirix
perlivp
perljp
perlko
perllexwarn
perllinux
perllocale
perllol
perlmachten
perlmacos
perlmacosx
perlmint
perlmod
perlmodinstall
perlmodlib
perlmodstyle
perlmpeix
perlnetware
perlnewmod
perlnumber
perlobj
perlop
perlopenbsd
perlopentut
perlos2
perlos390
perlos400
perlothrtut
perlpacktut
perlplan9
perlpod
perlpodspec
perlport
perlqnx
perlre
perlref
perlreftut
perlrequick
perlreref
perlretut
perlrun
perlsec
perlsolaris
perlstyle
perlsub
perlsyn
perlthrtut
perltie
perltoc
perltodo
perltooc
perltoot
perltrap
perltru64
perltw
perlunicode
perluniintro
perlutil
perluts
perlvar
perlvmesa
perlvms
perlvos
perlwin32
perlxs
perlxstut
perror
pfbtops
pftp
pgrep
phones
photo
pic
pickup
piconv
pid
pipe
pkcs7
pkcs8
pkcs12
pkg_add
pkg_check
pkg_create
pkg_delete
pkg_info
pkg_sign
pkg_version
pkill
pl2pm
place
pod2html
pod2latex
pod2man
pod2text
pod2usage
podchecker
podselect
poll
popd
popup
posix_madvise
postalias
postcat
postconf
postdrop
postfix
postkick
postlock
postlog
postmap
postqueue
postsuper
pr
pread
preadv
printcap
printenv
printf
proc
procfs
profil
protocols
prove
proxymap
ps
psed
psroff
pstruct
ptrace
publickey
pushd
puts
pwd
pwrite
pwritev
qmgr
qmqpd
quota
quotactl
radiobutton
raise
rand
ranlib
rcp
rcs
rcsclean
rcsdiff
rcsfile
rcsfreeze
rcsintro
rcsmerge
read
readelf
readlink
readonly
readv
realpath
reboot
recv
recvfrom
recvmsg
red
ree
refer
regexp
registry
regsub
rehash
remote
rename
repeat
replace
req
reset
resolver
resource
return
rev
revoke
rfcomm_sppd
rfork
rhosts
ripemd
ripemd160
rlog
rlogin
rm
rmd160
rmdir
rpc
rpcgen
rs
rsa
rsautl
rsh
rtld
rtprio
rup
ruptime
rusers
rwall
rwho
s2p
safe
sasl
sasldblistusers2
saslpasswd2
sbrk
scache
scale
scan
sched
sched_getparam
sched_getscheduler
sched_get_priority_max
sched_get_priority_min
sched_rr_get_interval
sched_setparam
sched_setscheduler
sched_yield
scon
scp
script
scrollbar
sdiff
sed
seek
select
selection
semctl
semget
semop
send
sendbug
sendfile
sendmail
sendmsg
sendto
services
sess_id
set
setegid
setenv
seteuid
setfacl
setgid
setgroups
setitimer
setlogin
setpgid
setpgrp
setpriority
setregid
setresgid
setresuid
setreuid
setrlimit
setsid
setsockopt
settc
settimeofday
setty
setuid
setvar
sftp
sh
sha
sha1
sha256
shar
shells
shift
shmat
shmctl
shmdt
shmget
showq
shutdown
sigaction
sigaltstack
sigblock
sigmask
sigpause
sigpending
sigprocmask
sigreturn
sigsetmask
sigstack
sigsuspend
sigvec
sigwait
size
slapadd
slapcat
slapd
slapdn
slapindex
slappasswd
slaptest
sleep
slogin
slurpd
smbutil
smime
smtp
smtpd
socket
socketpair
sockstat
soelim
sort
source
spawn
speed
spinbox
spkac
splain
split
squid
squid_ldap_auth
squid_ldap_group
squid_unix_group
sscop
ssh
sshd_config
ssh_config
stab
startslip
stat
statfs
stop
string
strings
strip
stty
su
subst
sum
suspend
swapoff
swapon
switch
symlink
sync
sysarch
syscall
sysconftool
sysconftoolcheck
systat
s_client
s_server
s_time
tabs
tail
talk
tar
tbl
tclsh
tcltest
tclvars
tcopy
tcpdump
tcpslice
tcsh
tee
tell
telltc
telnet
term
termcap
terminfo
test
texindex
texinfo
text
textdomain
tfmtodit
tftp
then
threads
time
tip
tk
tkerror
tkvars
tkwait
tlsmgr
tmac
top
toplevel
touch
tput
tr
trace
trafshow
trap
troff
true
truncate
truss
tset
tsort
tty
ttys
type
tzfile
ui
ul
ulimit
umask
unalias
uname
uncomplete
uncompress
undelete
unexpand
unhash
unifdef
unifdefall
uniq
units
unknown
unlimit
unlink
unmount
unset
unsetenv
until
unvis
update
uplevel
uptime
upvar
usbhidaction
usbhidctl
users
utf8
utimes
utmp
utrace
uudecode
uuencode
uuidgen
vacation
variable
verify
version
vfork
vgrind
vgrindefs
vi
vidcontrol
vidfont
view
virtual
vis
vt220keys
vwait
w
wait
wait3
wait4
waitpid
wall
wc
wget
what
whatis
where
whereis
which
while
who
whoami
whois
window
winfo
wish
wm
write
writev
wtmp
x509
xargs
xgettext
xmlwf
xstr
xsubpp
yacc
yes
ypcat
ypchfn
ypchpass
ypchsh
ypmatch
yppasswd
ypwhich
yyfix
zcat
zcmp
zdiff
zegrep
zfgrep
zforce
zgrep
zmore
znew
_exit
__syscall
 
FreeBSD/Linux/UNIX General Commands Manual
Hypertext Man Pages
crunchgen
 
CRUNCHGEN(1)		FreeBSD General Commands Manual 	  CRUNCHGEN(1)

NAME
     crunchgen -- generates build environment for a crunched binary

SYNOPSIS
     crunchgen [-foql] [-h makefile-header-name] [-m makefile-name]
	       [-p obj-prefix] [-c c-file-name] [-e exec-file-name]
	       [conf-file]

DESCRIPTION
     A crunched binary is a program made up of many other programs linked
     together into a single executable.  The crunched binary main() function
     determines which component program to run by the contents of argv[0].
     The main reason to crunch programs together is for fitting as many pro-
     grams as possible onto an installation or system recovery floppy.

     The crunchgen utility reads in the specifications in conf-file for a
     crunched binary, and generates a Makefile and accompanying top-level C
     source file that when built creates the crunched executable file from the
     component programs.  For each component program, crunchgen can optionally
     attempt to determine the object (.o) files that make up the program from
     its source directory Makefile.  This information is cached between runs.
     The crunchgen utility uses the companion program crunchide(1) to elimi-
     nate link-time conflicts between the component programs by hiding all
     unnecessary symbols.

     The crunchgen utility places specific requirements on package Makefiles
     which make it unsuitable for use with non-BSD sources.  In particular,
     the Makefile must contain the target depend, and it must define all
     object files in the variable OBJS.  In some cases, you can use a fake
     Makefile: before looking for Makefile in the source directory foo,
     crunchgen looks for the file Makefile.foo in the current directory.

     After crunchgen is run, the crunched binary can be built by running
     ``make -f .mk''.  The component programs' object files must
     already be built.	An objs target, included in the output makefile, will
     run make(1) in each component program's source dir to build the object
     files for the user.  This is not done automatically since in release
     engineering circumstances it is generally not desirable to be modifying
     objects in other directories.

     The options are as follows:

     -c c-file-name
	     Set output C file name to c-file-name.  The default name is
	     .c.

     -e exec-file-name
	     Set crunched binary executable file name to exec-file-name.  The
	     default name is .

     -f      Flush cache.  Forces the recalculation of cached parameters.

     -l      List names.  Lists the names this binary will respond to.

     -h makefile-header-name
	     Set the name of a file to be included at the beginning of the
	     Makefiles generated by crunchgen.	This is useful to define some
	     make variables such as RELEASE_CRUNCH or similar, which might
	     affect the behaviour of make(1) and are annoying to pass through
	     environment variables.

     -m makefile-name
	     Set output Makefile name to makefile-name.  The default name is
	     .mk.

     -o      Add ``make obj'' rules to each program make target.

     -p obj-prefix
	     Set the pathname to be prepended to the srcdir when computing the
	     objdir.  If this option is not present, then the prefix used is
	     the content of the MAKEOBJDIRPREFIX environment variable, or
	     /usr/obj.

     -q      Quiet operation.  Status messages are suppressed.

CRUNCHGEN CONFIGURATION FILE COMMANDS
     The crunchgen utility reads specifications from the conf-file that
     describe the components of the crunched binary.  In its simplest use, the
     component program names are merely listed along with the top-level source
     directories in which their sources can be found.  The crunchgen utility
     then calculates (via the source makefiles) and caches the list of object
     files and their locations.  For more specialized situations, the user can
     specify by hand all the parameters that crunchgen needs.

     The conf-file commands are as follows:

     srcdirs dirname ...
	     A list of source trees in which the source directories of the
	     component programs can be found.  These dirs are searched using
	     the BSD ``//'' convention.  Multiple
	     srcdirs lines can be specified.  The directories are searched in
	     the order they are given.

     progs progname ...
	     A list of programs that make up the crunched binary.  Multiple
	     progs lines can be specified.

     libs libspec ...
	     A list of library specifications to be included in the crunched
	     binary link.  Multiple libs lines can be specified.

     buildopts buildopts ...
	     A list of build options to be added to every make target.

     ln progname linkname
	     Causes the crunched binary to invoke progname whenever linkname
	     appears in argv[0].  This allows programs that change their
	     behavior when run under different names to operate correctly.

     To handle specialized situations, such as when the source is not avail-
     able or not built via a conventional Makefile, the following special com-
     mands can be used to set crunchgen parameters for a component program.

     special progname srcdir pathname
	     Set the source directory for progname.  This is normally calcu-
	     lated by searching the specified srcdirs for a directory named
	     progname.

     special progname objdir pathname
	     Set the obj directory for progname.  The obj directory is nor-
	     mally calculated by looking for a directory whose name is that of
	     the source directory prepended by one of the following compo-
	     nents, in order of priority: the -p argument passed to the com-
	     mand line; or, the value of the MAKEOBJDIRPREFIX environment
	     variable, or /usr/obj.  If the directory is not found, the srcdir
	     itself becomes the objdir.

     special progname buildopts buildopts
	     Define a set of build options that should be added to make(1)
	     targets in addition to those specified using buildopts when pro-
	     cessing progname.

     special progname objs object-file-name ...
	     Set the list of object files for program progname.  This is nor-
	     mally calculated by constructing a temporary makefile that
	     includes ``srcdir/Makefile'' and outputs the value of $(OBJS).

     special progname objpaths full-pathname-to-object-file ...
	     Sets the pathnames of the object files for program progname.
	     This is normally calculated by prepending the objdir pathname to
	     each file in the objs list.

     special progname objvar variable_name
	     Sets the name of the make(1) variable which holds the list of
	     object files for program progname.  This is normally OBJS but
	     some Makefiles might like to use other conventions or prepend the
	     program's name to the variable, e.g. SSHD_OBJS.

     special progname lib library-name ...
	     Specifies libraries to be linked with object files to produce
	     progname.lo.  This can be useful with libraries which redefine
	     routines in the standard libraries, or poorly written libraries
	     which reference symbols in the object files.

     special progname keep symbol-name ...
	     Add specified list of symbols to the keep list for program
	     progname.	An underscore (`_') is prepended to each symbol and it
	     becomes the argument to a -k option for the crunchide(1) phase.
	     This option is to be used as a last resort as its use can cause a
	     symbol conflict, however in certain instances it may be the only
	     way to have a symbol resolve.

     special progname ident identifier
	     Set the Makefile/C identifier for progname.  This is normally
	     generated from a progname, mapping `-' to `_' and ignoring all
	     other non-identifier characters.  This leads to programs named
	     "foo.bar" and "foobar" to map to the same identifier.

     Only the objpaths parameter is actually needed by crunchgen, but it is
     calculated from objdir and objs, which are in turn calculated from
     srcdir, so is sometimes convenient to specify the earlier parameters and
     let crunchgen calculate forward from there if it can.

     The makefile produced by crunchgen contains an optional objs target that
     will build the object files for each component program by running make(1)
     inside that program's source directory.  For this to work the srcdir and
     objs parameters must also be valid.  If they are not valid for a particu-
     lar program, that program is skipped in the objs target.

EXAMPLES
     Here is an example crunchgen input conf file, named ``kcopy.conf'':

	   srcdirs /usr/src/bin /usr/src/sbin

	   progs test cp echo sh fsck halt init mount umount myinstall
	   progs anotherprog
	   ln test [	   # test can be invoked via [
	   ln sh -sh	   # init invokes the shell with "-sh" in argv[0]

	   special myprog objpaths /homes/leroy/src/myinstall.o # no sources

	   special anotherprog -DNO_FOO WITHOUT_BAR=YES

	   libs -lutil -lcrypt

     This conf file specifies a small crunched binary consisting of some basic
     system utilities plus a homegrown install program ``myinstall'', for
     which no source directory is specified, but its object file is specified
     directly with the special line.

     Additionally when ``anotherprog'' is built the arguments

	   -DNO_FOO WITHOUT_BAR=YES

     are added to all build targets.

     The crunched binary ``kcopy'' can be built as follows:

	   % crunchgen -m Makefile kcopy.conf	 # gen Makefile and kcopy.c
	   % make objs		   # build the component programs' .o files
	   % make		   # build the crunched binary kcopy
	   % kcopy sh		   # test that this invokes a sh shell
	   $			   # it works!

     At this point the binary ``kcopy'' can be copied onto an install floppy
     and hard-linked to the names of the component programs.

SEE ALSO
     crunchide(1), make(1)

CAVEATS
     While crunchgen takes care to eliminate link conflicts between the compo-
     nent programs of a crunched binary, conflicts are still possible between
     the libraries that are linked in.	Some shuffling in the order of
     libraries may be required, and in some rare cases two libraries may have
     an unresolvable conflict and thus cannot be crunched together.

     Some versions of the BSD build environment do not by default build the
     intermediate object file for single-source file programs.	The ``make
     objs'' must then be used to get those object files built, or some other
     arrangements made.

AUTHORS
     The crunchgen utility was written by James da Silva .

     Copyright (c) 1994 University of Maryland.  All Rights Reserved.

FreeBSD 6.1		       November 16, 2000		   FreeBSD 6.1
=21023
+2342
(91)