A new static binary patch

H.J. Lu hjl@lucon.org
Fri Aug 27 19:18:00 GMT 1999


> 
> > Date: Fri, 27 Aug 1999 13:51:30 -0700 (PDT)
> > From: hjl@varesearch.com (H.J. Lu)
> 
> > +ifeq ("",$(tests-static))
> > +built-program-cmd = $(run-built-program-cmd)
> > +else
> > +define built-program-cmd 
> > +	$(shell if [ x$(findstring $(notdir $(built-program-file)), \
> > +			$(tests-static)) = x ]; \
> > +		then echo $(run-built-program-cmd); \
> > +		else echo $(built-program-file); fi)
> > +endef
> > +endif	# tests-static
> 
> No!
> 
> Just create a _new_ rule, which _only_ knows how to run static
> programs.  Don't try to make the existing rule, which is for running
> non-static programs, do both jobs.

I couldn't find a better way. Wrong, the existing rule uses
$(built-program-cmd) which can handle static or dynamic, but not
both.

> 
> Would you try to create a rule which knew how to build a .a library
> and build a .so library?
> 
> I find it particularly ugly that this is going to cause an additional
> shell invocation for every program executed.
> 

I take you will define "tests-static" in every Makefile. Otherwise,
what you said won't happen.


-- 
H.J. Lu (hjl@gnu.org)


More information about the Libc-hacker mailing list