Date: Wed, 17 Nov 2010 06:12:53 +0800 From: Adrian Chadd <adrian@freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r215226 - in head: rescue/rescue share/mk Message-ID: <AANLkTi=paRjas_=2j3NCKYuO=G==FURS20sWZrSRrxUv@mail.gmail.com> In-Reply-To: <201011130311.oAD3BSxX033195@svn.freebsd.org> References: <201011130311.oAD3BSxX033195@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This has apparently broken symlink generation. I thought I had tested that locally. Grr. In any case, I'll investigate this over the weekend. I have an exam tomorro= w. Thanks, Adrian On 13 November 2010 11:11, Adrian Chadd <adrian@freebsd.org> wrote: > > Author: adrian > Date: Sat Nov 13 03:11:27 2010 > New Revision: 215226 > URL: http://svn.freebsd.org/changeset/base/215226 > > Log: > =A0Break out the rules which generate crunchgen'ed binaries into a separa= te > =A0.mk file so they can be reused. > > =A0Introduce a new option, CRUNCH_BUILDTOOLS, which lists the binaries th= at > =A0require tools built in the local architecture. sh and csh both require= this. > =A0It was previously hardcoded in rescue/rescue/Makefile . > > =A0Introduce a new option, CRUNCH_SHLIBS, which lists the shared librarie= s > =A0to link against. These override the static libraries listed in CRUNCH_= LIBS. > =A0Some build environments may wish to use a handful of shared libraries > =A0(eg libc.so) so other small, dynamic binaries can be run in the enviro= nment. > > =A0Remove the now-shared code from rescue/rescue/Makefile and introduce t= he > =A0CRUNCH_BUILDTOOLS option for the above shells. > > Added: > =A0head/share/mk/bsd.crunchgen.mk =A0 (contents, props changed) > Modified: > =A0head/rescue/rescue/Makefile > > Modified: head/rescue/rescue/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/rescue/rescue/Makefile Sat Nov 13 01:28:56 2010 =A0 =A0 =A0 =A0(= r215225) > +++ head/rescue/rescue/Makefile Sat Nov 13 03:11:27 2010 =A0 =A0 =A0 =A0(= r215226) > @@ -22,27 +22,7 @@ dhclient_FIXED: ../../sbin/dhclient/dhcl > =A0 =A0 =A0 =A0sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET} > =A0CLEANFILES+=3D dhclient_FIXED > > -################################################################# > -# > -# General notes: > -# > -# A number of Make variables are used to generate the crunchgen config f= ile. > -# > -# =A0CRUNCH_SRCDIRS: lists directories to search for included programs > -# =A0CRUNCH_PROGS: =A0lists programs to be included > -# =A0CRUNCH_LIBS: =A0libraries to link with > -# =A0CRUNCH_BUILDOPTS: generic build options to be added to every progra= m > -# > -# Special options can be specified for individual programs > -# =A0CRUNCH_SRCDIR_$(P): base source directory for program $(P) > -# =A0CRUNCH_BUILDOPTS_$(P): additional build options for $(P) > -# =A0CRUNCH_ALIAS_$(P): additional names to be used for $(P) > -# > -# By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} > -# will be used to generate a hard link to the resulting binary. > -# Specific links can be suppressed by setting > -# CRUNCH_SUPPRESS_LINK_$(NAME) to 1. > -# > +# The help which used to be here is now in mk/bsd.crunchgen.mk > > =A0# Define Makefile variable RESCUE > =A0CRUNCH_BUILDOPTS+=3D -DRESCUE > @@ -73,6 +53,7 @@ CRUNCH_PROGS_bin=3D cat chflags chio chmod > =A0 =A0 =A0 =A0 ed expr getfacl hostname kenv kill ln ls mkdir mv =A0 =A0= =A0\ > =A0 =A0 =A0 =A0 pkill ps pwd realpath rm rmdir setfacl sh stty sync test > =A0CRUNCH_LIBS+=3D -lcrypt -ledit -lkvm -ll -ltermcap -lutil > +CRUNCH_BUILDTOOLS+=3D bin/sh > > =A0# Additional options for specific programs > =A0CRUNCH_ALIAS_test=3D [ > @@ -91,6 +72,7 @@ CRUNCH_PROGS_bin+=3D rcp > =A0.if ${MK_TCSH} !=3D "no" > =A0CRUNCH_PROGS_bin+=3D csh > =A0CRUNCH_ALIAS_csh=3D -csh tcsh -tcsh > +CRUNCH_BUILDTOOLS+=3D bin/csh > =A0CRUNCH_SUPPRESS_LINK_-csh=3D 1 > =A0CRUNCH_SUPPRESS_LINK_-tcsh=3D 1 > =A0.endif > @@ -236,132 +218,5 @@ CRUNCH_ALIAS_chown=3D chgrp > =A0################################################################## > =A0CRUNCH_LIBS+=3D -lm > > -################################################################## > -# =A0The following is pretty nearly a generic crunchgen-handling makefil= e > -# > - > -CONF=3D =A0$(PROG).conf > -OUTMK=3D $(PROG).mk > -OUTC=3D =A0 $(PROG).c > -OUTPUTS=3D$(OUTMK) $(OUTC) $(PROG).cache > -CRUNCHOBJS=3D ${.OBJDIR} > -.if defined(MAKEOBJDIRPREFIX) > -CANONICALOBJDIR:=3D ${MAKEOBJDIRPREFIX}${.CURDIR} > -.else > -CANONICALOBJDIR:=3D /usr/obj${.CURDIR} > -.endif > - > -CLEANFILES+=3D $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h > - > -# Program names and their aliases contribute hardlinks to 'rescue' execu= table, > -# except for those that get suppressed. > -.for D in $(CRUNCH_SRCDIRS) > -.for P in $(CRUNCH_PROGS_$(D)) > -.ifdef CRUNCH_SRCDIR_${P} > -$(OUTPUTS): $(CRUNCH_SRCDIR_${P})/Makefile > -.else > -$(OUTPUTS): $(.CURDIR)/../../$(D)/$(P)/Makefile > -.endif > -.ifndef CRUNCH_SUPPRESS_LINK_${P} > -LINKS+=3D $(BINDIR)/$(PROG) $(BINDIR)/$(P) > -.endif > -.for A in $(CRUNCH_ALIAS_$(P)) > -.ifndef CRUNCH_SUPPRESS_LINK_${A} > -LINKS+=3D $(BINDIR)/$(PROG) $(BINDIR)/$(A) > -.endif > -.endfor > -.endfor > -.endfor > - > -all: $(PROG) > -exe: $(PROG) > - > -$(CONF): Makefile > - =A0 =A0 =A0 echo \# Auto-generated, do not edit >$(.TARGET) > -.ifdef CRUNCH_BUILDOPTS > - =A0 =A0 =A0 echo buildopts $(CRUNCH_BUILDOPTS) >>$(.TARGET) > -.endif > -.ifdef CRUNCH_LIBS > - =A0 =A0 =A0 echo libs $(CRUNCH_LIBS) >>$(.TARGET) > -.endif > -.for D in $(CRUNCH_SRCDIRS) > -.for P in $(CRUNCH_PROGS_$(D)) > - =A0 =A0 =A0 echo progs $(P) >>$(.TARGET) > -.ifdef CRUNCH_SRCDIR_${P} > - =A0 =A0 =A0 echo special $(P) srcdir $(CRUNCH_SRCDIR_${P}) >>$(.TARGET) > -.else > - =A0 =A0 =A0 echo special $(P) srcdir $(.CURDIR)/../../$(D)/$(P) >>$(.TA= RGET) > -.endif > -.ifdef CRUNCH_BUILDOPTS_${P} > - =A0 =A0 =A0 echo special $(P) buildopts DIRPRFX=3D${DIRPRFX}${P}/ \ > - =A0 =A0 =A0 =A0 =A0 $(CRUNCH_BUILDOPTS_${P}) >>$(.TARGET) > -.else > - =A0 =A0 =A0 echo special $(P) buildopts DIRPRFX=3D${DIRPRFX}${P}/ >>$(.= TARGET) > -.endif > -.for A in $(CRUNCH_ALIAS_$(P)) > - =A0 =A0 =A0 echo ln $(P) $(A) >>$(.TARGET) > -.endfor > -.endfor > -.endfor > - > -# XXX Make sure we don't pass -P to crunchgen(1). > -.MAKEFLAGS:=3D ${.MAKEFLAGS:N-P} > -.ORDER: $(OUTPUTS) objs > -$(OUTPUTS): $(CONF) > - =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} crunchgen -fq -m $(OUTMK) = \ > - =A0 =A0 =A0 =A0 =A0 -c $(OUTC) $(CONF) > - > -$(PROG): $(OUTPUTS) objs > - =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe > - > -objs: $(OUTMK) > - =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs > - > -# <sigh> Someone should replace the bin/csh and bin/sh build-tools with > -# shell scripts so we can remove this nonsense. > -build-tools: > -.for _tool in bin/csh bin/sh > - =A0 =A0 =A0 cd $(.CURDIR)/../../${_tool}; \ > - =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} ${MAKE} obj; \ > - =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} ${MAKE} build-tools > -.endfor > - > -# Use a separate build tree to hold files compiled for this crunchgen bi= nary > -# Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't > -# get that to cooperate with bsd.prog.mk. =A0Besides, many of the standa= rd > -# targets should NOT be propagated into the components. > -cleandepend cleandir obj objlink: > -.for D in $(CRUNCH_SRCDIRS) > -.for P in $(CRUNCH_PROGS_$(D)) > -.ifdef CRUNCH_SRCDIR_${P} > - =A0 =A0 =A0 cd ${CRUNCH_SRCDIR_$(P)} && \ > - =A0 =A0 =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} ${MAKE} \ > - =A0 =A0 =A0 =A0 =A0 DIRPRFX=3D${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TA= RGET} > -.else > - =A0 =A0 =A0 cd $(.CURDIR)/../../${D}/${P} && \ > - =A0 =A0 =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} ${MAKE} \ > - =A0 =A0 =A0 =A0 =A0 DIRPRFX=3D${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TA= RGET} > -.endif > -.endfor > -.endfor > - > -clean: > - =A0 =A0 =A0 rm -f ${CLEANFILES} > - =A0 =A0 =A0 if [ -e ${.OBJDIR}/$(OUTMK) ]; then =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} ${MAKE} -f= $(OUTMK) clean; =A0 =A0 =A0 \ > - =A0 =A0 =A0 fi > -.for D in $(CRUNCH_SRCDIRS) > -.for P in $(CRUNCH_PROGS_$(D)) > -.ifdef CRUNCH_SRCDIR_${P} > - =A0 =A0 =A0 cd ${CRUNCH_SRCDIR_$(P)} && \ > - =A0 =A0 =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} ${MAKE} \ > - =A0 =A0 =A0 =A0 =A0 DIRPRFX=3D${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TA= RGET} > -.else > - =A0 =A0 =A0 cd $(.CURDIR)/../../${D}/${P} && \ > - =A0 =A0 =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} ${MAKE} \ > - =A0 =A0 =A0 =A0 =A0 DIRPRFX=3D${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TA= RGET} > -.endif > -.endfor > -.endfor > - > +.include <bsd.crunchgen.mk> > =A0.include <bsd.prog.mk> > > Added: head/share/mk/bsd.crunchgen.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null =A0 00:00:00 1970 =A0 (empty, because file is newly added) > +++ head/share/mk/bsd.crunchgen.mk =A0 =A0 =A0Sat Nov 13 03:11:27 2010 = =A0 =A0 =A0 =A0(r215226) > @@ -0,0 +1,160 @@ > +################################################################# > +# > +# General notes: > +# > +# A number of Make variables are used to generate the crunchgen config f= ile. > +# > +# =A0CRUNCH_SRCDIRS: lists directories to search for included programs > +# =A0CRUNCH_PROGS: =A0lists programs to be included > +# =A0CRUNCH_LIBS: =A0libraries to statically link with > +# =A0CRUNCH_SHLIBS: =A0libraries to dynamically link with > +# =A0CRUNCH_BUILDOPTS: generic build options to be added to every progra= m > +# =A0CRUNCH_BUILDTOOLS: lists programs that need build tools built in th= e > +# =A0 =A0 =A0 local architecture. > +# > +# Special options can be specified for individual programs > +# =A0CRUNCH_SRCDIR_$(P): base source directory for program $(P) > +# =A0CRUNCH_BUILDOPTS_$(P): additional build options for $(P) > +# =A0CRUNCH_ALIAS_$(P): additional names to be used for $(P) > +# > +# By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} > +# will be used to generate a hard link to the resulting binary. > +# Specific links can be suppressed by setting > +# CRUNCH_SUPPRESS_LINK_$(NAME) to 1. > +# > + > +# $FreeBSD$ > + > +################################################################## > +# =A0The following is pretty nearly a generic crunchgen-handling makefil= e > +# > + > +CONF=3D =A0$(PROG).conf > +OUTMK=3D $(PROG).mk > +OUTC=3D =A0 $(PROG).c > +OUTPUTS=3D$(OUTMK) $(OUTC) $(PROG).cache > +CRUNCHOBJS=3D ${.OBJDIR} > +.if defined(MAKEOBJDIRPREFIX) > +CANONICALOBJDIR:=3D ${MAKEOBJDIRPREFIX}${.CURDIR} > +.else > +CANONICALOBJDIR:=3D /usr/obj${.CURDIR} > +.endif > + > +CLEANFILES+=3D $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h > + > +# Program names and their aliases contribute hardlinks to 'rescue' execu= table, > +# except for those that get suppressed. > +.for D in $(CRUNCH_SRCDIRS) > +.for P in $(CRUNCH_PROGS_$(D)) > +.ifdef CRUNCH_SRCDIR_${P} > +$(OUTPUTS): $(CRUNCH_SRCDIR_${P})/Makefile > +.else > +$(OUTPUTS): $(.CURDIR)/../../$(D)/$(P)/Makefile > +.endif > +# Disable building links for bsdbox - whatever is installing the binarie= s into > +# the embedded system should (for now) do the linking there. This may ch= ange > +# in the future. -adrian > +#.ifndef CRUNCH_SUPPRESS_LINK_${P} > +#LINKS+=3D $(BINDIR)/$(PROG) $(BINDIR)/$(P) > +#.endif > +#.for A in $(CRUNCH_ALIAS_$(P)) > +#.ifndef CRUNCH_SUPPRESS_LINK_${A} > +#LINKS+=3D $(BINDIR)/$(PROG) $(BINDIR)/$(A) > +#.endif > +#.endfor > +.endfor > +.endfor > + > +all: $(PROG) > +exe: $(PROG) > + > +$(CONF): Makefile > + =A0 =A0 =A0 echo \# Auto-generated, do not edit >$(.TARGET) > +.ifdef CRUNCH_BUILDOPTS > + =A0 =A0 =A0 echo buildopts $(CRUNCH_BUILDOPTS) >>$(.TARGET) > +.endif > +.ifdef CRUNCH_LIBS > + =A0 =A0 =A0 echo libs $(CRUNCH_LIBS) >>$(.TARGET) > +.endif > +.ifdef CRUNCH_SHLIBS > + =A0 =A0 =A0 echo libs_so $(CRUNCH_SHLIBS) >>$(.TARGET) > +.endif > +.for D in $(CRUNCH_SRCDIRS) > +.for P in $(CRUNCH_PROGS_$(D)) > + =A0 =A0 =A0 echo progs $(P) >>$(.TARGET) > +.ifdef CRUNCH_SRCDIR_${P} > + =A0 =A0 =A0 echo special $(P) srcdir $(CRUNCH_SRCDIR_${P}) >>$(.TARGET) > +.else > + =A0 =A0 =A0 echo special $(P) srcdir $(.CURDIR)/../../$(D)/$(P) >>$(.TA= RGET) > +.endif > +.ifdef CRUNCH_BUILDOPTS_${P} > + =A0 =A0 =A0 echo special $(P) buildopts DIRPRFX=3D${DIRPRFX}${P}/ \ > + =A0 =A0 =A0 =A0 =A0 $(CRUNCH_BUILDOPTS_${P}) >>$(.TARGET) > +.else > + =A0 =A0 =A0 echo special $(P) buildopts DIRPRFX=3D${DIRPRFX}${P}/ >>$(.= TARGET) > +.endif > +.for A in $(CRUNCH_ALIAS_$(P)) > + =A0 =A0 =A0 echo ln $(P) $(A) >>$(.TARGET) > +.endfor > +.endfor > +.endfor > + > +# XXX Make sure we don't pass -P to crunchgen(1). > +.MAKEFLAGS:=3D ${.MAKEFLAGS:N-P} > +.ORDER: $(OUTPUTS) objs > +$(OUTPUTS): $(CONF) > + =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} crunchgen -fq -m $(OUTMK) = \ > + =A0 =A0 =A0 =A0 =A0 -c $(OUTC) $(CONF) > + > +$(PROG): $(OUTPUTS) objs > + =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe > + > +objs: $(OUTMK) > + =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs > + > +# <sigh> Someone should replace the bin/csh and bin/sh build-tools with > +# shell scripts so we can remove this nonsense. > +build-tools: > +.for _tool in $(CRUNCH_BUILDTOOLS) > + =A0 =A0 =A0 cd $(.CURDIR)/../../${_tool}; \ > + =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} ${MAKE} obj; \ > + =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} ${MAKE} build-tools > +.endfor > + > +# Use a separate build tree to hold files compiled for this crunchgen bi= nary > +# Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't > +# get that to cooperate with bsd.prog.mk. =A0Besides, many of the standa= rd > +# targets should NOT be propagated into the components. > +cleandepend cleandir obj objlink: > +.for D in $(CRUNCH_SRCDIRS) > +.for P in $(CRUNCH_PROGS_$(D)) > +.ifdef CRUNCH_SRCDIR_${P} > + =A0 =A0 =A0 cd ${CRUNCH_SRCDIR_$(P)} && \ > + =A0 =A0 =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} ${MAKE} \ > + =A0 =A0 =A0 =A0 =A0 DIRPRFX=3D${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TA= RGET} > +.else > + =A0 =A0 =A0 cd $(.CURDIR)/../../${D}/${P} && \ > + =A0 =A0 =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} ${MAKE} \ > + =A0 =A0 =A0 =A0 =A0 DIRPRFX=3D${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TA= RGET} > +.endif > +.endfor > +.endfor > + > +clean: > + =A0 =A0 =A0 rm -f ${CLEANFILES} > + =A0 =A0 =A0 if [ -e ${.OBJDIR}/$(OUTMK) ]; then =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CRUNCHOBJS} ${MAKE} -f= $(OUTMK) clean; =A0 =A0 =A0 \ > + =A0 =A0 =A0 fi > +.for D in $(CRUNCH_SRCDIRS) > +.for P in $(CRUNCH_PROGS_$(D)) > +.ifdef CRUNCH_SRCDIR_${P} > + =A0 =A0 =A0 cd ${CRUNCH_SRCDIR_$(P)} && \ > + =A0 =A0 =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} ${MAKE} \ > + =A0 =A0 =A0 =A0 =A0 DIRPRFX=3D${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TA= RGET} > +.else > + =A0 =A0 =A0 cd $(.CURDIR)/../../${D}/${P} && \ > + =A0 =A0 =A0 =A0 =A0 MAKEOBJDIRPREFIX=3D${CANONICALOBJDIR} ${MAKE} \ > + =A0 =A0 =A0 =A0 =A0 DIRPRFX=3D${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TA= RGET} > +.endif > +.endfor > +.endfor
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=paRjas_=2j3NCKYuO=G==FURS20sWZrSRrxUv>