Xymon Mailing List Archive search

Compiling xymon client on Solaris 5.8

6 messages in this thread

list Kevin King · Wed, 6 May 2020 12:28:11 +0000 ·
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
list Richard L. Hamilton · Wed, 6 May 2020 12:26:18 -0400 ·
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.
quoted from Kevin King

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
quoted from Kevin King
 
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 <
list Kevin King · Wed, 6 May 2020 17:57:52 +0000 ·
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
quoted from Richard L. Hamilton
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
quoted from Richard L. Hamilton


From: Richard L. Hamilton [mailto:user-af55987f6d56@xymon.invalid]
Sent: Wednesday, May 6, 2020 12:26 PM
To: KING, KEVIN <user-ca972c0c43a8@xymon.invalid>
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 <user-ca972c0c43a8@xymon.invalid<mailto: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?  :)

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
list Richard L. Hamilton · Wed, 6 May 2020 14:17:04 -0400 ·
That should be

#undef HAVE_SETENV

and NOT

#define HAVE_SETENV

I also forgot  - you have to run

make clean

before you run make (because it's already compiled wrong).
quoted from Kevin King

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

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:user-af55987f6d56@xymon.invalid <mailto:user-af55987f6d56@xymon.invalid>] 
Sent: Wednesday, May 6, 2020 12:26 PM
To: KING, KEVIN <user-ca972c0c43a8@xymon.invalid <mailto:user-ca972c0c43a8@xymon.invalid>>
Cc: Xymon at xymon.com <mailto: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 <user-ca972c0c43a8@xymon.invalid <mailto: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 <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=>;
list Kevin King · Wed, 6 May 2020 14:49:10 -0400 ·

Thank you!  I changed the if statement in build/genconfig.sh to set undefine. And it worked just fine. So I suppose this could be setup to check for solaris version and. No I have to be the only nut with a 5.8 box to work with all normal admins have replaced the old crap long ago.. 😊   I now have a work around and more for my notes.


Thanks again !


Sent from Mail for Windows 10


quoted from Richard L. Hamilton

From: Richard L. Hamilton
Sent: Wednesday, May 6, 2020 2:17 PM
To: KING, KEVIN
Cc: Xymon@xymon.com
Subject: Re: [Xymon] Compiling xymon client on Solaris 5.8


That should be


#undef HAVE_SETENV


and NOT


#define HAVE_SETENV


I also forgot - you have to run


make clean


before you run make (because it's already compiled wrong).



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


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:user-af55987f6d56@xymon.invalid]
Sent: Wednesday, May 6, 2020 12:26 PM
To: KING, KEVIN <user-ca972c0c43a8@xymon.invalid>
Cc: Xymon@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 <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




list Kevin King · Wed, 6 May 2020 19:09:25 +0000 ·
ok so that make the 4.3.28 compile. So with that victory I went and tried to compile the 4.3.30 client. And it got past that error but then it barfed on some other stuff.

environ.c:185:50: macro "SBUF_MALLOC" requires 2 arguments, but only 1 given
environ.c: In function `xgetenv':
environ.c:185: error: `SBUF_MALLOC' undeclared (first use in this function)
environ.c:185: error: (Each undeclared identifier is reported only once
environ.c:185: error: for each function it appears in.)
make[1]: *** [environ-client.o] Error 1
make[1]: Leaving directory `/export/home/m98021/xymon-4.3.30/lib'
make: *** [lib-client] Error 2
quoted from Kevin King

?

From: Kevin King [mailto:user-4c6c31ddcab2@xymon.invalid]
Sent: Wednesday, May 6, 2020 2:49 PM
To: Richard L. Hamilton <user-af55987f6d56@xymon.invalid>; KING, KEVIN <user-ca972c0c43a8@xymon.invalid>
Cc: Xymon at xymon.com
Subject: RE: Re: [Xymon] Compiling xymon client on Solaris 5.8

Thank you!  I changed the if statement in build/genconfig.sh to set undefine. And it worked just fine. So I suppose this could be setup to check for solaris version and. No I have to be the only nut with a 5.8 box to work with all normal admins have replaced the old crap long ago.. ?   I now have a work around and more for my notes.

Thanks again !

Sent from Mail<https://urldefense.proofpoint.com/v2/url?u=https-3A__go.microsoft.com_fwlink_-3FLinkId-3D550986&d=DwMFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=YrQwgVpuG1VvCC276Z-o-g&m=7AmWlOceV1mZuLuNsD8MKb6ezk7BA_79lSlvoY7Ct3k&s=AV0rFqcFulVBkSCi63c-NCAc8iPteazwXHlbtg2mwwA&e=>; for Windows 10
quoted from Kevin King

From: Richard L. Hamilton<mailto:user-af55987f6d56@xymon.invalid>
Sent: Wednesday, May 6, 2020 2:17 PM
To: KING, KEVIN<mailto:user-ca972c0c43a8@xymon.invalid>
Cc: Xymon at xymon.com<mailto:Xymon at xymon.com>
Subject: Re: [Xymon] Compiling xymon client on Solaris 5.8

That should be

#undef HAVE_SETENV

and NOT

#define HAVE_SETENV

I also forgot  - you have to run

make clean

before you run make (because it's already compiled wrong).


On May 6, 2020, at 13:57, KING, KEVIN <user-ca972c0c43a8@xymon.invalid<mailto:user-ca972c0c43a8@xymon.invalid>> wrote:

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:user-af55987f6d56@xymon.invalid]
Sent: Wednesday, May 6, 2020 12:26 PM
To: KING, KEVIN <user-ca972c0c43a8@xymon.invalid<mailto:user-ca972c0c43a8@xymon.invalid>>
Cc: Xymon at xymon.com<mailto: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 <user-ca972c0c43a8@xymon.invalid<mailto: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?  ?

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