Providing dprintf
Rob Landley
rob at landley.net
Tue Oct 25 09:33:24 UTC 2005
On Tuesday 25 October 2005 02:30, Bernhard Fischer wrote:
> >Perhaps the makefile run sed against the thing and... No. Go down that
> > path and we're reimplementing autoconf (badly) ourselves.
>
> hm?
> DEP_INCLUDES += include/automagic.h
> nullify_automagic:
> -$(RM_F) include/automagic.h
>
> include/automagic.h: nullify_automagic has_dprint
> has_whatever_additional_func
>
> has_dprint:
> d=/tmp/$$busybox_dprintf.c ; ret=$(shell echo -e "#inc\ndprint(simple);" >
> $d && $(CC) -c $$d ; echo $?) ; if [ "x$ret" = "x0" ] ; then HAVE_DPRINT=1
> ; fi [ $$HAVE_DPRINT -eq 1 ] && echo "#define HAVE_DPRINT 1" >>
> include/automagic.h || echo "#undef HAVE_DPRINT" >> include/automagic.h
>
> and include it somewhere where the applets see the magic later on.
> untested, but should allow us to get away without switching to autotools
> just for dprint..
>
> hth,
> Bernhard
If somebody else wants to handle this, I'm happy to stay far, far away from
the implementation details. :)
Don't use /tmp, by the way. (We have a working directory.)
And we should definitely start to have a plaform.h to consolidate some of this
mess if we go down that path...
Rob
More information about the busybox
mailing list