Compiling on Solaris?

Shane Hickey <[email protected]>
Newsgroups gmane.linux.pld.shadow.general
Organization How's your network
Message-ID <[email protected]>
I'm trying to get shadow installed on a Solaris 8 box (mainly because
Sun's user management sucks).  Anyway, I found a post in this list's
archives talking about the following error:

lastlog.c:63:20: getopt.h: No such file or directory

The list response suggested
http://molpopgen.org/krthornt/GCCSolaris.html as a possible solution.
[1] 

I think the main problem is that Solaris has getopt(3c) which is
declared in stdlib.h.  I found this post that gave me this information:

http://www.sunhelp.org/pipermail/sunhelp/2001-January/007961.html [2]

So, I downloaded getopt.c getopt.h getopt1.c and getoptFix.h from [1]
and I copied them to lib. Then I edited lastlog.c and changed

#include <getopt.h>
to
#include <getoptFix.h>

Now I get this error when compiling:

lastlog.c:64: elements of array `longopts' have incomplete type
lastlog.c:65: warning: excess elements in struct initializer
lastlog.c:65: warning: (near initialization for `longopts[0]')
lastlog.c:65: `required_argument' undeclared here (not in a function)
lastlog.c:65: warning: excess elements in struct initializer
lastlog.c:65: warning: (near initialization for `longopts[0]')
lastlog.c:65: warning: excess elements in struct initializer
lastlog.c:65: warning: (near initialization for `longopts[0]')
lastlog.c:65: warning: excess elements in struct initializer
lastlog.c:65: warning: (near initialization for `longopts[0]')
lastlog.c:66: warning: excess elements in struct initializer
lastlog.c:66: warning: (near initialization for `longopts[1]')
lastlog.c:66: `required_argument' undeclared here (not in a function)
lastlog.c:66: warning: excess elements in struct initializer
lastlog.c:66: warning: (near initialization for `longopts[1]')
lastlog.c:66: warning: excess elements in struct initializer
lastlog.c:66: warning: (near initialization for `longopts[1]')
lastlog.c:66: warning: excess elements in struct initializer
lastlog.c:66: warning: (near initialization for `longopts[1]')
lastlog.c:67: warning: excess elements in struct initializer
lastlog.c:67: warning: (near initialization for `longopts[2]')
lastlog.c:67: `no_argument' undeclared here (not in a function)
lastlog.c:67: warning: excess elements in struct initializer
lastlog.c:67: warning: (near initialization for `longopts[2]')
lastlog.c:67: warning: excess elements in struct initializer
lastlog.c:67: warning: (near initialization for `longopts[2]')
lastlog.c:67: warning: excess elements in struct initializer
lastlog.c:67: warning: (near initialization for `longopts[2]')
lastlog.c:68: warning: excess elements in struct initializer
lastlog.c:68: warning: (near initialization for `longopts[3]')
lastlog.c:68: warning: excess elements in struct initializer
lastlog.c:68: warning: (near initialization for `longopts[3]')
lastlog.c:68: warning: excess elements in struct initializer
lastlog.c:68: warning: (near initialization for `longopts[3]')
lastlog.c:68: warning: excess elements in struct initializer
lastlog.c:68: warning: (near initialization for `longopts[3]')
make[2]: *** [lastlog.o] Error 1
make[2]: Leaving directory `/usr/local/src/shadow-4.0.4.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/shadow-4.0.4.1'
make: *** [all] Error 2

Am I SOL?  Do I just need to install Linux on this friggin' box?  Has
anyone gotten shadow to compile on Solaris?  I am really wanting the
ability to use "chpasswd -e".  I don't believe there is a way in Solaris
to set a user's password with an encrypted string.

Thanks,

Shane

-- 
Shane Hickey <[email protected]>: Network/System Consultant
GPG KeyID: 777CBF3F
Key fingerprint: 254F B2AC 9939 C715 278C  DA95 4109 9F69 777C BF3F
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.