Xymon Mailing List Archive search

Compiling xymon client on Solaris 5.8

list Richard L. Hamilton
Wed, 6 May 2020 12:26:18 -0400
Message-Id: <user-521404496dca@xymon.invalid>

I see an #ifdef HAVE_SETENV in the code that calls setenv(); if that's not defined, it should work around the absence by using malloc() and putenv(); I think putenv() exists on Solaris 8 (malloc() definitely does).

The scripts (specifically, build/genconfig.sh) run to configure it should have detected that, but if not, look at include/config.h; there should be one of two lines  in there:
either
#define HAVE_SETENV 1
or
#undef HAVE_SETENV

If it has the 1st, change it to the 2nd and run the make again; if it already has the 2nd or doesn't have either one, then I don't have any idea.

The test that build/genconfig.sh uses looks a mite fishy to me, because I think it's only compiling but not linking, and it's the linking that would actually fail if setenv() wasn't available. So if it's not detecting the absence of setenv() and configuring the workaround, that might be why.

One might be able to back-port an actual setenv() to Solaris 8 and link with that, but I haven't compared such Solaris 8 and post-10 library source as I have to figure out whether that would probably be safe and effective, so I wouldn't go there unless I had a lot of time to kill.

On May 6, 2020, at 08:28, KING, KEVIN <user-ca972c0c43a8@xymon.invalid> wrote:

Hopefully some of you old-timers can remember better than I.  I have a solaris 5.8 that I am trying to compile a xymon client for. I have tried the current and 2 older versions. I get the same error. I did go back and check my notes and the issue I saw 10 years ago is commented in the sunOs client build file.
So I am sure something in my environment is wrong.  Can I get a few eyes on this output from the make step and see if you can get me in the right direction?  In all compiling a client should not need anything other than the configure client and make.  Or if someone has a compiled client for sparc on solaris 5.8?  J
 
Thanks xymoners. 
 
 
bash-2.03$ make -s
Checking for socklen_t
Checking for snprintf
Checking for vsnprintf
Checking for rpc/rpcent.h
Checking for sys/select.h
Checking for u_int32_t typedef
Checking for PATH_MAX definition
Checking for SHUT_RD/WR/RDWR definitions
Checking for strtoll()
Checking for uname
Checking for setenv
config.h created
environ.c: In function `xgetenv':
environ.c:180: warning: implicit declaration of function `setenv'
stackio.c: In function `stackfgets':
stackio.c:435: warning: subscript has type `char'
stackio.c:453: warning: subscript has type `char'
In file included from loadhosts.c:348:
loadhosts_file.c: In function `load_hostnames':
loadhosts_file.c:177: warning: subscript has type `char'
Undefined                       first referenced
symbol                             in file
setenv                              ../lib/libxymonclient.a(environ-client.o)
ld: fatal: Symbol referencing errors. No output written to ../client/xymon
collect2: ld returned 1 exit status
make[1]: *** [../client/xymon] Error 1
make: *** [common-client] Error 2
 
Kevin H. King
Senior Advanced Technical Support
Technology Operations, SS7 Signaling
 
 
Xymon at xymon.com <