NOTE: These pertain to Solaris 9.
This is what I received on my system. I had no problems compiling check_wtmpx.c, chkdirs.c, or strings(-static).c

  1. # gcc ifpromisc.c
    ifpromisc.c: In function `if_fetch':
    ifpromisc.c:310: error: `SIOCGIFFLAGS' undeclared (first use in this function)
    ifpromisc.c:310: error: (Each undeclared identifier is reported only once
    ifpromisc.c:310: error: for each function it appears in.)
    ifpromisc.c: In function `if_print':
    ifpromisc.c:334: error: `SIOCGIFCONF' undeclared (first use in this function)
    
    Google told me that SIOCGIFFLAGS was related to ioctl.h
    From that I searched my system for ioctl.h and found another header file.
    Editing ifpromisc.c, I changed:
    #include <sys/ioctl.h>
    to
    #include "/usr/ucbinclude/sys/ioctl.h"
    and re-complied.

    Additionally, instead of changing the .c file, just pass -DSOLARIS2 to gcc


  2. # gcc ifpromisc.c
    Undefined                       first referenced
     symbol                             in file
    socket                              /var/tmp//ccmCOAIH.o
    ld: fatal: Symbol referencing errors. No output written to a.out
    collect2: ld returned 1 exit status
    
    Silly me, I forgot to compile as:
    gcc ifpromisc.c -lsocket -lnsl

  1. # gcc chklastlog.c
    chklastlog.c:86: error: parse error before "struct"
    chklastlog.c: In function `main':
    chklastlog.c:98: error: storage size of 'lastlog_ent' isn't known
    chklastlog.c:135: error: `O_RDONLY' undeclared (first use in this function)
    chklastlog.c:135: error: (Each undeclared identifier is reported only once
    chklastlog.c:135: error: for each function it appears in.)
    chklastlog.c:173: error: invalid application of `sizeof' to an incomplete type
    chklastlog.c:174: error: invalid application of `sizeof' to an incomplete type
    chklastlog.c:176: error: invalid application of `sizeof' to an incomplete type
    chklastlog.c: At top level:
    chklastlog.c:207: error: parse error before "struct"
    
  1. # gcc chkwtmp.c
    chkwtmp.c: In function `main':
    chkwtmp.c:69: error: `O_RDONLY' undeclared (first use in this function)
    chkwtmp.c:69: error: (Each undeclared identifier is reported only once
    chkwtmp.c:69: error: for each function it appears in.)
    
If memory serves, O_RDONLY is either from stdio.h, stdlib.h or fcntl.h
I tried to use different versions, but it didnt help.
It seems the answer to this was to pass -DSOLARIS2 to gcc (as mentioned in the Makefile)