[SUMMARY - 30 days late] lsof compilation - HELP!

Marcos Assis Silva (assis@npd.uel.br)
Sat, 26 Apr 1997 22:32:35 -0300 (EST)

=============================================================================
ORIGINAL QUESTION
=============================================================================
That's it. I can't get any version of lsof compiled in any of my
Solaris + sparc boxes. Let's talk about just one of them: uname -a = SunOS
npd 5.3 Generic_101674-01 sun4m sparc. GCC 2.7.2.1 properly installed
(compiles everything fine!). The last version of lsof I tried is 3.72 (I
remeber once I tried a 3.8something version - same problem). Got the sources
from ftp://opcom.sun.ca/pub/freeware/SOURCES (a great place BTW). I did
everything the package docs say I should: Configure, Customize, glance at
machine.h, ... make barfs at a sys/proc/prdata.h not found included from
dlsof.h (indeed there's no prdata.h in the machine's /usr/include tree). I go
and comment it out just to watch how far it goes in the next run. Now make
stops when compiling dnode.c: storage size of 'pr' is unknown & 'PNSIZ'
undeclared. I grep'ed all /usr/include header files for those symbols and
nothing came out. They aren't in GCC include tree either. I've read all the
doc files of the package, including a FAQ, and there's no reference to such
problems in there. Can anyone provide me a clue? Casper?? TIA. Regards ...
=============================================================================
SOLUTION
=============================================================================

Go thru the ./Configure process required by the package and after
it's finished edit dialects/sun/machine.h and comment out HASPROFS & HASPINFO
as shown in the example bellow. Points to pay attention at: 1) although doing
this will lead to a clean compilation, I don't know what one will miss in
funcionality from the binary due to the lack of /proc support - nevertheless
the binary works nicely; 2) a question remains to be answered - why is that
some SUN installations have a sys/proc/prdata.h and some (mine included) NOT?
I'm 100% sure I have a full installation and when I looked into Solaris CDs I
found no prdata.h stored in them! Go figure :-((

Excerpt from Lsof 3.72's dialects/sun/machine.h:
/*
* HASPROCFS is defined for those dialects that have a proc file system --
* usually /proc and usually in SYSV4 derivatives.
*
* HASFSTYPE is defined for those systems that have a file system type
* string, st_fstype, in the stat() buffer.
*
* The defined value is the string that names the file system type.
*
* The HASPROCFS definition usually must be accompanied by the HASFSTYPE
* definition and the providing of an fstype element in the local mounts
* structure (defined in dlsof.h).
*
* The HASPROCFS definition may be accompanied by the HASPINFO definition.
* HASPINFO names the subdirectory of HASPROCFS that contains read-only
* information (typically /pinfo).
*/

#if defined(solaris)
/* #define HASPROCFS "proc" */
#define HASFSTYPE 1
/* #define HASPINFO "/pinfo" */
#endif

=============================================================================
WHO REPLIED: 3 messages - Thanks!
=============================================================================
>Date: 30 Mar 1997 17:49:52 -0800
>From: "Lau, Victoria H" <vlau@msmail2.hac.com>

The last time I had problem compiling lsof, I directly contacted
Victor Abell, the author of lsof. He practically worked day AND
night with me to get my problem solved. His email address is
abe@purdue.edu.

By the way, the last version I installed on Solaris 2.5.1 was
lsof v3.77 and that was in October. This can be downloaded from
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof.

=============================================================================
>Date: Sun, 30 Mar 1997 18:56:35 -0700 (MST)
>From: Ric Anderson <ric@rtd.com>

I had no problem with
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/lsof_3.81_W.tar.gz
under solaris with gcc. Just ran
./Configure
follwoed by
make
=============================================================================
>Date: Tue, 1 Apr 1997 16:12:40 -0400 (AST)
>From: Harvey Wamboldt <harvey@iotek.ns.ca>

Hi, I've been meaning to compile lsof, so I just sat down and did it.
lsof -v reports:

lsof version information:
revision: 3.84 -- find the latest revision at:
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof
constructed: Tue Apr 1 14:57:44 AST 1997
constructed by and on: src@orbiter
compiler: gcc
compiler version: 2.7.2
compiler flags: -O -Dsolaris 500
loader flags: -lkvm -lelf -lsocket -lnsl
system info: SunOS orbiter 5.5 Generic_103093-02 sun4m sparc
SUNW,SPARCs

gcc -v reports:

Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/specs
gcc version 2.7.2

mymachine% uname -a
SunOS mymachine 5.5 Generic_103093-02 sun4m sparc SUNW,SPARCstation-20

I did a "Configure solaris" first, then did a manual install following
(roughly) the recommendation printed on the screen when I did "make
install".

> ... make barfs at a sys/proc/prdata.h not found

My 2.5 has /usr/include/sys/proc/prdata.h, I did a full installation,
perhaps your machine has a partial OS installation? Maybe you can get
a copy off of your OS CD?

If you look at the Configure script (version 3.84) you can see that
"solaris" is set to a value, you should check that this value is set
correctly, I notice it is used in some of the sources.
=============================================================================
...
. . . -(o o)-
_.,-*b'`-`'d*-,._.,-*b'`-`'d*-,._.,-*b'`-`'d*-,._/----oOO--(_)--OOo-----
=
UNIVERSIDADE ESTADUAL DE LONDRINA - UEL .:. assis @ npd.uel.br
Nucleo de Processamento de Dados - NPD <*> Marcos Assis Silva
Gerencia de Software Basico - GSB ":" Analista de Suporte
Parana - Brasil o
. . . = .
_.,-*b'`-`'d*-,._.,-*b'`-`'d*-,._.,-*b'`-`'d*-,._.,-*b'`-`'d*-,._.,-*b'`