[Toybox] [PATCH] Support HOSTCFLAGS on musl

orc orc at sibserver.ru
Thu Jun 14 02:04:36 PDT 2012


On Thu, 14 Jun 2012 00:04:23 -0500
Rob Landley <rob at landley.net> wrote:

> On 06/13/2012 09:58 AM, orc wrote:
> > This patch adds support for specifying HOSTCFLAGS, for
> > something like "make menuconfig HOSTCFLAGS=-D_GNU_SOURCE" on
> > musl systems.
> 
> Seems reasonable.
> 
> > There is one issue remain on musl systems. musl has no crypt.h,
> 
> But it has shadow.h?  Weird.
> 
> > but I don't know where to put crypt.h in lib/portability.h (maybe
> > musl will add crypt.h in future).
> 
> dig, dig, dig...
> 
> According to
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/crypt.html
> you get the function from unistd.h in susv4.
> 
> And crypt.h exists because you only get crypt() defined out of that if
> you #define a feature test macro nobody ever uses. (Feature test
> macros in standard C headers: still an EPICALLY STUPID IDEA.)

I agree. Btw "sed -i '/<crypt.h>/d' ..." recursively on other projects
solves this. Or I can create crypt.h with one line: "#include
<unistd.h>"? (This can be stupid, I know)

> 
> Sigh.  It's too bad we don't have an #ifndef variant for function
> prototypes or I'd just prototype the darn functions right there in
> toys.h myself since the standard _says_ what they are.
> 
> I'm going to assume shadow.h/getspnam isn't causing you a problem?

Nope. That crypt.h was one.

> 
> > Also, no lex and yacc sources for pregenerated *_shipped in kconf
> > (this is not so necessary, but even busybox and linux kernel has
> > *.l and *.y on their places :-) ).
> 
> As far as I'm concerned those are the preferred sources for
> modification. If I wind up changing them, I'll hack the shipped
> directly. I still vaguely plan to write a replacement for all the
> gplv2 kconfig stuff at some point, but "in awk" (while clever) isn't
> something I feel I can maintain or extend. :)

Nevermind that previous request - if I really wanna hack them in
future, I will take sources from busybox-1.20.1. And you better replace
them as you said.

misc: sorry for my bad English.

 1339664676.0


More information about the Toybox mailing list