[Xymon] Compiling xymon client on Solaris 5.8

KING, KEVIN KK1051 at att.com
Wed May 6 19:57:52 CEST 2020


Checking for clock_gettime() requiring librt ...
clock_gettime() not present, but this should be OK

only bark from the configure.client step.

config.h does get set to #define HAVE_SETENV 1


/* This file is auto-generated */
#ifndef __CONFIG_H__
#define __CONFIG_H__ 1
#define HAVE_SOCKLEN_T 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_RPCENT_H 1
#define HAVE_SYS_SELECT_H 1
#undef HAVE_UINT32_TYPEDEF
#define HAVE_STRTOLL_H 1
#define HAVE_UNAME 1
#define HAVE_SETENV 1
#undef HAVE_BINARY_TREE
#endif


make change to config.h set #define HAVE_SETENV   and run make again.  Same error.

bash-2.03$ make
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSunOS -I`pwd`/include -DCLIENTONLY=1" LDFLAGS="" OSDEF="-DSunOS" RPATHOPT="" PCREINCDIR="" ZLIBINCDIR="" SSLFLAGS="" SSLINCDIR="" SSLLIBS="" NETLIBS="-lresolv -lsocket -lnsl" LIBRTDEF="" XYMONTOPDIR="/export/home/m98021" XYMONHOME="/export/home/m98021" XYMONCLIENTHOME=/export/home/m98021 XYMONLOGDIR="" XYMONHOSTNAME="" XYMONHOSTIP="10.36.54.169" XYMONHOSTOS="" LOCALCLIENT="no" make -C lib client
make[1]: Entering directory `/export/home/m98021/xymon-4.3.28/lib'
make[1]: Nothing to be done for `client'.
make[1]: Leaving directory `/export/home/m98021/xymon-4.3.28/lib'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSunOS -I`pwd`/include -DCLIENTONLY=1" LDFLAGS="" RPATHOPT="" SSLFLAGS="" SSLINCDIR="" SSLLIBS="" NETLIBS="-lresolv -lsocket -lnsl"  ZLIBLIBS="" LIBRTDEF="" XYMONHOME="/export/home/m98021" make -C common client
make[1]: Entering directory `/export/home/m98021/xymon-4.3.28/common'
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSunOS -I/export/home/m98021/xymon-4.3.28/include -DCLIENTONLY=1 -o ../client/xymon xymon.o ../lib/libxymonclientcomm.a  -lresolv -lsocket -lnsl  ../lib/libxymonclient.a
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[1]: Leaving directory `/export/home/m98021/xymon-4.3.28/common'
make: *** [common-client] Error 2


From: Richard L. Hamilton [mailto:rlhamil2 at gmail.com]
Sent: Wednesday, May 6, 2020 12:26 PM
To: KING, KEVIN <KK1051 at att.com>
Cc: Xymon at xymon.com
Subject: Re: [Xymon] Compiling xymon client on Solaris 5.8

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 <KK1051 at att.com<mailto:KK1051 at att.com>> 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?  :)

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 mailing list
Xymon at xymon.com<mailto:Xymon at xymon.com>
http://lists.xymon.com/mailman/listinfo/xymon<https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.xymon.com_mailman_listinfo_xymon&d=DwMFAg&c=LFYZ-o9_HUMeMTSQicvjIg&r=YrQwgVpuG1VvCC276Z-o-g&m=i7-AOftDnEwSGEwO7pQBaBXVxwZa2uWSLU7kURFqNtk&s=UOrfEEPv-aE1UrhSnnElx6jl6vs12IQJDZxs0WsAQEc&e=>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20200506/0628eeea/attachment.htm>


More information about the Xymon mailing list