[uClibc]use of `id' program in uClibc Makefile

Miles Bader miles at lsi.nec.co.jp
Fri Feb 8 01:02:48 UTC 2002


I recently compiled and installed uClibc on solaris, and it barfed on the
install target's use of the `id' program -- solaris's id didn't support
either the `-u' or the `-g' switches.  Here's the line in the Makefile:

	(NAME=`id -u`; GROUP=`id -g`; chown -R $$NAME.$$GROUP $(PREFIX)$(DEVEL_PREFIX))

I worked around it by having make ignore the error, but perhaps there's a
more portable way to get this information.

For instance, the following works on both linux and several different
versions of solaris (I believe the basic output format of `id' is
standardized):

        chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$/\1.\2/'` $(PREFIX)$(DEVEL_PREFIX)

Anyway, you get the idea.

I think the Makefile should also ignore any errors (with a `-' prefix)
from this command, as chown's generally not very reliable.  For instance,
at least on some versions of solaris, chown can only be used by root, even
when the change is innocuous (e.g. only changes the group to another group
you're in).

Thanks,

-Miles
-- 
[|nurgle|]  ddt- demonic? so quake will have an evil kinda setting? one that 
            will  make every christian in the world foamm at the mouth? 
[iddt]      nurg, that's the goal 



More information about the uClibc mailing list