Xymon Mailing List Archive search

4.3.0 beta3 compile problem on solaris 10 sparc

12 messages in this thread

list Roland Soderstrom · Wed, 17 Nov 2010 12:32:58 +1100 ·
Hi,

Can't compile on Solaris 10 sparc with LDAP disabled.
I disable LDAP test, SSL tests as I have no ldap server or SSL services.

If I enable SSL and LDAP test I get another problem with ld, see further 
down.
It uses /usr/ccs/bin/ld, I changed to "LD = /usr/local/bin/ld" in 
xymonnet/c-ares/Makefile.
Same same...

I get this ldap compile error

LDAP, SSL enabled:
-bash-3.00$ ./configure
<snip>
Checking for OpenSSL ...
Found OpenSSL include files in /usr/local/ssl/include
Found OpenSSL libraries in /opt/csw/lib

Xymon can use the OpenSSL library to test SSL-enabled services
like POP3S, IMAPS, NNTPS and TELNETS. If you have the OpenSSL
library installed, I recommend that you enable this.

Do you want to be able to test SSL-enabled services (y) ?
n


Checking for LDAP ...
test-ldap.c: In function `main':
test-ldap.c:25: warning: implicit declaration of function `ldap_init'
test-ldap.c:25: warning: assignment makes pointer from integer without a 
cast
Found LDAP include files in /usr/include
Found LDAP libraries in /usr/lib

Xymon can use your OpenLDAP LDAP client library to test LDAP servers.

Do you want to be able to test LDAP servers (y) ?
n
<snip>
-bash-3.00$ make
<snip>
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I. 
-I/var/tmp/xymon-4.3.0.beta3/include -I/usr/local/include   -c -o 
ldaptest.o ldaptest.c
ldaptest.c: In function `add_ldap_test':
ldaptest.c:99: error: `badurl' undeclared (first use in this function)
ldaptest.c:99: error: (Each undeclared identifier is reported only once
ldaptest.c:99: error: for each function it appears in.)
ldaptest.c:101: error: `req' undeclared (first use in this function)
ldaptest.c:112: error: `basecheck' undeclared (first use in this function)
make[1]: *** [ldaptest.o] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/xymonnet'
make: *** [xymonnet-build] Error 2
-bash-3.00$

ld error:
LDAP and SSL enabled
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I. 
-I/var/tmp/xymon-4.3.0.beta3/include -I/usr/local/include -o xymonnet 
-Wl,--rpath,/opt/csw/lib -Wl,--rpath,/usr/local/lib 
-Wl,--rpath,/opt/csw/lib -Wl,--rpath,/usr/lib xymonnet.o contest.o 
httptest.o httpresult.o ldaptest.o dns.o dns2.o httpcookies.o 
../lib/libxymon.a libcares.a -L/usr/lib -lldap  -L/opt/csw/lib -lssl 
-lcrypto -L/usr/local/lib -lpcre -lresolv -lsocket -lnsl -lrt
/usr/ccs/bin/ld: illegal option -- rpath
/usr/ccs/bin/ld: illegal option -- rpath
/usr/ccs/bin/ld: illegal option -- rpath
/usr/ccs/bin/ld: illegal option -- rpath
usage: ld [-6:abc:d:e:f:h:il:mo:p:rstu:z:B:CD:F:GI:L:M:N:P:Q:R:S:VY:?] 
file(s)
         [-64]           enforce a 64-bit link-edit
         [-a]            create an absolute file
         [-b]            do not do special PIC relocations in a.out
         [-B direct | nodirect]
                         establish direct bindings, or inhibit direct 
binding
                         to, the object being created
         [-B dynamic | static]
                         search for shared libraries|archives
         [-B eliminate]  eliminate unqualified global symbols from the
                         symbol table
         [-B group]      relocate object from within group
         [-B local]      reduce unqualified global symbols to local
         [-B reduce]     process symbol reductions
         [-B symbolic]   bind external references to definitions when 
creating
                         shared objects
         [-c name]       record configuration file `name'
         [-C]            demangle C++ symbol name diagnostics
         [-d y | n]      operate in dynamic|static mode
         [-D token,...]  print diagnostic messages
         [-e epsym]      use `epsym' as entry point address
         [-f name]       specify library for which this file is an auxiliary
                         filter
         [-F name]       specify library for which this file is a filter
         [-G]            create a shared object
         [-h name]       use `name' as internal shared object identifier
         [-i]            ignore LD_LIBRARY_PATH setting
         [-I name]       use `name' as path of interpreter
         [-l x]          search for libx.so or libx.a
         [-L path]       search for libraries in directory `path'
         [-m]            print memory map
         [-M mapfile]    use processing directives contained in `mapfile'
         [-N string]     create a dynamic dependency for `string'
         [-o outfile]    name the output file `outfile'
         [-p auditlib]   identify audit library to accompany this object
         [-P auditlib]   identify audit library for processing the 
dependencies
                         of this object
         [-Q y | n]      do|do not place version information in output file
         [-r]            create a relocatable object
         [-R path]       specify a library search path to be used at run 
time
         [-s]            strip any symbol and debugging information
         [-S supportlib]
                         specify a link-edit support library
         [-t]            do not warn of multiply-defined symbols that have
                         different sizes or alignments
         [-u symname]    create an undefined symbol `symname'
         [-V]            print version information
         [-Y P,dirlist]  use `dirlist' as a default path when searching for
                         libraries
         [-z absexec]    when building an executable absolute symbols
                         referenced in dynamic objects are promoted to
                         the executable
         [-z allextract | defaultextract | weakextract]
                         extract all member files, only members that resolve
                         undefined tor tentative symbols, or allow 
extraction of
                         archive members to resolvetweak references from
                         archive files
         [-z altexec64]  execute the 64-bit link-editor
         [-z combreloc]  combine multiple relocation sections
         [-z defs]       disallow undefined symbol references
         [-z direct | nodirect]
                         enable|disable direct binding to shared object
                         dependencies
         [-z endfiltee]  marks a filtee such that it will terminate a 
filters
                         search
         [-z finiarray=function]
                         name of function to be appended to the .finiarray
         [-z groupperm | nogroupperm]
                         enable|disable setting of group permissions
                         on dynamic dependencies
         [-z help ]      print this usage message
         [-z ignore | record]
                         ignore|record unused dynamic dependencies
         [-z initarray=function]
                         name of function to be appended to the .initarray
         [-z initfirst]  mark object to indicate that its .init section 
should
                         be executed before the .init section of any other
                         objects
         [-z interpose]  dynamic object is to be an `interposer' on direct
                         bindings
         [-z lazyload | nolazyload]
                         enable|disable delayed loading of shared object
                         dependencies
         [-z ld32=arg1,arg2,...]
                         define arguments applicable to the 32-bit class 
of ld(1)
         [-z ld64=arg1,arg2,...]
                         define arguments applicable to the 64-bit class 
of ld(1)
         [-z loadfltr]   mark filter as requiring immediate loading of its
                         filtees at runtime
         [-z muldefs]    allow multiply-defined symbols
         [-z nocompstrtab]
                         disable compression of string tables
         [-z nodefs]     allow undefined symbol references
         [-z nodefaultlib]
                         mark object to ignore any default library 
search path
         [-z nodelete]   mark object as non-deletable
         [-z nodlopen]   mark object as non-dlopen()'able
         [-z nodump]     mark object as non-dldump()'able
         [-z now]        mark object as requiring non-lazy binding
         [-z nopartial]  expand any partially initialized symbols
         [-z noversion]  don't record any version sections
         [-z origin]     mark object as requiring $ORIGIN processing
         [-z preinitarray=function]
                         name of function to be appended to the 
.preinitarray
         [-z redlocsym]  reduce local syms in .symtab to a minimum
         [-z rescan]     rescan archive list until no further member
                         extraction occurs
         [-z text]       disallow output relocations against text
         [-z textoff]    allow output relocations against text
         [-z textwarn]   warn if there are relocations against text
         [-z verbose]    generate warnings for suspicious processings
collect2: ld returned 1 exit status
make[1]: *** [xymonnet] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/xymonnet'
make: *** [xymonnet-build] Error 2
-bash-3.00$ /usr/local/bin/ld -V
GNU ld (GNU Binutils) 2.20.1.20100303
   Supported emulations:
    elf32_sparc
    elf64_sparc
-bash-3.00$
list Ralph Mitchell · Tue, 16 Nov 2010 21:11:40 -0500 ·
On Tue, Nov 16, 2010 at 8:32 PM, Roland Soderstrom <
quoted from Roland Soderstrom
user-0cec9512a49f@xymon.invalid> wrote:
Hi,

Can't compile on Solaris 10 sparc with LDAP disabled.
I disable LDAP test, SSL tests as I have no ldap server or SSL services.

If I enable SSL and LDAP test I get another problem with ld, see further
down.
It uses /usr/ccs/bin/ld, I changed to "LD = /usr/local/bin/ld" in
xymonnet/c-ares/Makefile.
Same same...

I get this ldap compile error

LDAP, SSL enabled:
-bash-3.00$ ./configure
<snip>
Checking for OpenSSL ...
Found OpenSSL include files in /usr/local/ssl/include
Found OpenSSL libraries in /opt/csw/lib

Xymon can use the OpenSSL library to test SSL-enabled services
like POP3S, IMAPS, NNTPS and TELNETS. If you have the OpenSSL
library installed, I recommend that you enable this.

Do you want to be able to test SSL-enabled services (y) ?
n


Checking for LDAP ...
test-ldap.c: In function `main':
test-ldap.c:25: warning: implicit declaration of function `ldap_init'
test-ldap.c:25: warning: assignment makes pointer from integer without a
cast
Found LDAP include files in /usr/include
Found LDAP libraries in /usr/lib

Xymon can use your OpenLDAP LDAP client library to test LDAP servers.

Do you want to be able to test LDAP servers (y) ?
n
<snip>
-bash-3.00$ make
<snip>
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I.
-I/var/tmp/xymon-4.3.0.beta3/include -I/usr/local/include   -c -o ldaptest.o
ldaptest.c
ldaptest.c: In function `add_ldap_test':
ldaptest.c:99: error: `badurl' undeclared (first use in this function)
ldaptest.c:99: error: (Each undeclared identifier is reported only once
ldaptest.c:99: error: for each function it appears in.)
ldaptest.c:101: error: `req' undeclared (first use in this function)
ldaptest.c:112: error: `basecheck' undeclared (first use in this function)
make[1]: *** [ldaptest.o] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/xymonnet'
make: *** [xymonnet-build] Error 2
-bash-3.00$
I get the same thing in Gentoo Linux on x86_64 laptop.  Those undeclared
variables are declared *inside* the #ifdef at line 62:

        #ifdef XYMON_LDAP
              testitem_t *basecheck;
              ldap_data_t *req;
              LDAPURLDesc *ludp;
              char *urltotest;
              int badurl;

Line 99 is outside the closing #ifdef.  Moving the #endif  down to line 118
effectively comments out the entire function body.  I don't know if that's
the correct fix., but at least it compiles...

Ralph Mitchell
list Henrik Størner · Wed, 17 Nov 2010 11:03:15 +0000 (UTC) ·
quoted from Ralph Mitchell
In <AANLkTimHMG282n=user-819948e26dc9@xymon.invalid> Ralph Mitchell <user-00a5e44c48c0@xymon.invalid> writes:
On Tue, Nov 16, 2010 at 8:32 PM, Roland Soderstrom <
user-0cec9512a49f@xymon.invalid> wrote:
Can't compile on Solaris 10 sparc with LDAP disabled.
I disable LDAP test, SSL tests as I have no ldap server or SSL services.
<snip>
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I.
-I/var/tmp/xymon-4.3.0.beta3/include -I/usr/local/include   -c -o ldaptest.o
ldaptest.c
ldaptest.c: In function `add_ldap_test':
ldaptest.c:99: error: `badurl' undeclared (first use in this function)
ldaptest.c:99: error: (Each undeclared identifier is reported only once
ldaptest.c:99: error: for each function it appears in.)
ldaptest.c:101: error: `req' undeclared (first use in this function)
ldaptest.c:112: error: `basecheck' undeclared (first use in this function)
make[1]: *** [ldaptest.o] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/xymonnet'
make: *** [xymonnet-build] Error 2
Line 99 is outside the closing #ifdef.  Moving the #endif  down to line 118
effectively comments out the entire function body.  I don't know if that's
the correct fix., but at least it compiles...
It looks like the right fix.

Index: xymonnet/ldaptest.c
===================================================================
--- xymonnet/ldaptest.c	(revision 6590)
+++ xymonnet/ldaptest.c	(working copy)
@@ -94,7 +94,6 @@
 	req->certinfo = NULL;
 	req->certexpires = 0;
 	req->skiptest = 0;
-#endif
 
 	if (badurl) {
 		errprintf("Invalid LDAP URL %s\n", t->testspec);
@@ -116,6 +115,8 @@
 		req->output = "Cannot connect to server";
 	}
 
+#endif
• return 0;
 }
 

Regards,
Henrik
list Roland Soderstrom · Thu, 18 Nov 2010 07:13:32 +1100 ·
Hi,

I tried replying to this thread 3 times but it just disappears, trying a 
new mail with the same subject.


Thanx,
That fixed the first problem.

Now I have the ld problem as described.
How do I tell the compilation to use /usr/local/bin/ld?
It seems embedded in the c-ares tar.gz file

I made a dirty fix by linking /usr/ccs/bin/ld to /usr/local/bin/ld.
Then it compiles nicely.

- Roland

make[1]: Entering directory `/var/tmp/xymon-4.3.0.beta3/xymongen'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/xymongen'
CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I. 
-I`pwd`/include -I/usr/local/include" LDFLAGS="" 
RPATHOPT="-Wl,--rpath,/opt/csw/lib -Wl,--rpath,/usr/local/lib" 
SSLFLAGS="" SSLINCDIR="" SSLLIBS="" LDAPFLAGS="" LDAPINCDIR="" 
LDAPLIBS="" DOSNMP="no" NETLIBS="-lresolv -lsocket -lnsl" 
XYMONHOME="/usr/local/xymon/server" ARESVER="1.7.3" RUNTIMEDEFS="" 
PCREINCDIR="-I/usr/local/include" PCRELIBS="-L/usr/local/lib -lpcre" 
LIBRTDEF="-lrt" make -C xymonnet all
make[1]: Entering directory `/var/tmp/xymon-4.3.0.beta3/xymonnet'
quoted from Roland Soderstrom
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I. 
-I/var/tmp/xymon-4.3.0.beta3/include -I/usr/local/include -o xymonnet 
-Wl,--rpath,/opt/csw/lib -Wl,--rpath,/usr/local/lib xymonnet.o contest.o 
httptest.o httpresult.o ldaptest.o dns.o dns2.o httpcookies.o 
../lib/libxymon.a libcares.a   -L/usr/local/lib -lpcre -lresolv -lsocket 
-lnsl -lrt
/usr/ccs/bin/ld: illegal option -- rpath
/usr/ccs/bin/ld: illegal option -- rpath
usage: ld [-6:abc:d:e:f:h:il:mo:p:rstu:z:B:CD:F:GI:L:M:N:P:Q:R:S:VY:?] 
file(s)
         [-64]           enforce a 64-bit link-edit
         [-a]            create an absolute file
         [-b]            do not do special PIC relocations in a.out
         [-B direct | nodirect]
                         establish direct bindings, or inhibit direct 
binding
                         to, the object being created
         [-B dynamic | static]
                         search for shared libraries|archives
         [-B eliminate]  eliminate unqualified global symbols from the
                         symbol table
         [-B group]      relocate object from within group
         [-B local]      reduce unqualified global symbols to local
         [-B reduce]     process symbol reductions
         [-B symbolic]   bind external references to definitions when 
creating
                         shared objects
         [-c name]       record configuration file `name'
         [-C]            demangle C++ symbol name diagnostics
         [-d y | n]      operate in dynamic|static mode
         [-D token,...]  print diagnostic messages
         [-e epsym]      use `epsym' as entry point address
         [-f name]       specify library for which this file is an 
auxiliary
                         filter
         [-F name]       specify library for which this file is a filter
         [-G]            create a shared object
         [-h name]       use `name' as internal shared object identifier
         [-i]            ignore LD_LIBRARY_PATH setting
         [-I name]       use `name' as path of interpreter
         [-l x]          search for libx.so or libx.a
         [-L path]       search for libraries in directory `path'
         [-m]            print memory map
         [-M mapfile]    use processing directives contained in `mapfile'
         [-N string]     create a dynamic dependency for `string'
         [-o outfile]    name the output file `outfile'
         [-p auditlib]   identify audit library to accompany this object
         [-P auditlib]   identify audit library for processing the 
dependencies
                         of this object
         [-Q y | n]      do|do not place version information in output file
         [-r]            create a relocatable object
         [-R path]       specify a library search path to be used at run 
time
         [-s]            strip any symbol and debugging information
         [-S supportlib]
                         specify a link-edit support library
         [-t]            do not warn of multiply-defined symbols that have
                         different sizes or alignments
         [-u symname]    create an undefined symbol `symname'
         [-V]            print version information
         [-Y P,dirlist]  use `dirlist' as a default path when searching for
                         libraries
         [-z absexec]    when building an executable absolute symbols
                         referenced in dynamic objects are promoted to
                         the executable
         [-z allextract | defaultextract | weakextract]
                         extract all member files, only members that 
resolve
                         undefined tor tentative symbols, or allow 
extraction of
                         archive members to resolvetweak references from
                         archive files
         [-z altexec64]  execute the 64-bit link-editor
         [-z combreloc]  combine multiple relocation sections
         [-z defs]       disallow undefined symbol references
         [-z direct | nodirect]
                         enable|disable direct binding to shared object
                         dependencies
         [-z endfiltee]  marks a filtee such that it will terminate a 
filters
                         search
         [-z finiarray=function]
                         name of function to be appended to the .finiarray
         [-z groupperm | nogroupperm]
                         enable|disable setting of group permissions
                         on dynamic dependencies
         [-z help ]      print this usage message
         [-z ignore | record]
                         ignore|record unused dynamic dependencies
         [-z initarray=function]
                         name of function to be appended to the .initarray
         [-z initfirst]  mark object to indicate that its .init section 
should
                         be executed before the .init section of any other
                         objects
         [-z interpose]  dynamic object is to be an `interposer' on direct
                         bindings
         [-z lazyload | nolazyload]
                         enable|disable delayed loading of shared object
                         dependencies
         [-z ld32=arg1,arg2,...]
                         define arguments applicable to the 32-bit class 
of ld(1)
         [-z ld64=arg1,arg2,...]
                         define arguments applicable to the 64-bit class 
of ld(1)
         [-z loadfltr]   mark filter as requiring immediate loading of its
                         filtees at runtime
         [-z muldefs]    allow multiply-defined symbols
         [-z nocompstrtab]
                         disable compression of string tables
         [-z nodefs]     allow undefined symbol references
         [-z nodefaultlib]
                         mark object to ignore any default library 
search path
         [-z nodelete]   mark object as non-deletable
         [-z nodlopen]   mark object as non-dlopen()'able
         [-z nodump]     mark object as non-dldump()'able
         [-z now]        mark object as requiring non-lazy binding
         [-z nopartial]  expand any partially initialized symbols
         [-z noversion]  don't record any version sections
         [-z origin]     mark object as requiring $ORIGIN processing
         [-z preinitarray=function]
                         name of function to be appended to the 
.preinitarray
         [-z redlocsym]  reduce local syms in .symtab to a minimum
         [-z rescan]     rescan archive list until no further member
                         extraction occurs
         [-z text]       disallow output relocations against text
         [-z textoff]    allow output relocations against text
         [-z textwarn]   warn if there are relocations against text
         [-z verbose]    generate warnings for suspicious processings
collect2: ld returned 1 exit status
make[1]: *** [xymonnet] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/xymonnet'
make: *** [xymonnet-build] Error 2
list Henrik Størner · Wed, 17 Nov 2010 20:34:55 +0000 (UTC) ·
quoted from Roland Soderstrom
In <user-d6679e54e744@xymon.invalid> Roland Soderstrom <user-0cec9512a49f@xymon.invalid> writes:
Now I have the ld problem as described.
How do I tell the compilation to use /usr/local/bin/ld?
It seems embedded in the c-ares tar.gz file
It's really a problem with the C-ARES configure-script. I think you can
set the LD environment-variable to point to your preferred linker, so
something like

   LD=/usr/local/bin/ld
   export LD
   ./configure
   make

might solve it.


Regards,
Henrik
list Henrik Størner · Wed, 17 Nov 2010 20:40:13 +0000 (UTC) ·
quoted from Roland Soderstrom
In <user-d6679e54e744@xymon.invalid> Roland Soderstrom <user-0cec9512a49f@xymon.invalid> writes:
make[1]: Entering directory `/var/tmp/xymon-4.3.0.beta3/xymonnet'
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I. -I/var/tmp/xymon-4.3.0.beta3/include -I/usr/local/include -o xymonnet -Wl,--rpath,/opt/csw/lib -Wl,--rpath,/usr/local/lib xymonnet.o contest.o httptest.o httpresult.o ldaptest.o dns.o dns2.o httpcookies.o ../lib/libxymon.a libcares.a   -L/usr/local/lib -lpcre -lresolv -lsocket -lnsl -lrt
/usr/ccs/bin/ld: illegal option -- rpath
I just now noticed that the problem probably isn't with C-ARES, but
with the "--rpath" options that Xymon uses for the linker command.

If you look at the build/Makefile.SunOS file, you'll find the linker
setup there. Xymon tries to figure out if you are using the GNU ld
program:

   LDTYPE := $(shell ld -V 2>&1|head -1|cut -d' ' -f1)
   ifeq ($(LDTYPE),GNU)
      RPATH=-Wl,--rpath,
   else
      RPATH=-Wl,-R
   endif

Try deleting those lines, and see if it helps.


Regards,
Henrik
list Roland Soderstrom · Thu, 18 Nov 2010 09:02:00 +1100 ·
Hi,

That seems like a dirty fix, I relinked /usr/ccs/bin/ld which is as dirty.
Wouldn't the proper solution be that if it could find the Gnu ld it will 
use it?
In my case it is in the path but /usr/ccs/bin is not.
Still /usr/ccs/bin/ld is found first and used.
I tried setting LD= but it doesn't help.
As in that statement:
-bash-3.00$ ld -V 2>&1|head -1|cut -d' ' -f1
GNU
-bash-3.00$ ld -V
GNU ld version 2.15
   Supported emulations:
    elf32_sparc
    elf64_sparc
So Makefile.SunOS finds the Gnu linker, but later it is using 
/usr/ccs/bin/ld. Where? and Why?


Another problem:
I'm trying to compile the client on Solaris 9 SPARC and get this error.
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -DSunOS -I. -I/var/tmp/xymon-4.3.0.beta3/include 
-DCLIENTONLY=1 -I. -I../include    -c -o misc.o misc.c
In file included from /var/tmp/xymon-4.3.0.beta3/include/libxymon.h:56,
                  from misc.c:34:
/var/tmp/xymon-4.3.0.beta3/include/../lib/eventlog.h:38: error: syntax 
error before numeric constant
make[1]: *** [misc.o] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/lib'
make: *** [lib-client] Error 2

Next up is Solaris 10 x86, well see if that works.

- Roland
quoted from Henrik Størner

On 18/11/10 07:40 AM, Henrik Størner wrote:
In<user-d6679e54e744@xymon.invalid>  Roland Soderstrom<user-0cec9512a49f@xymon.invalid>  writes:

   
make[1]: Entering directory `/var/tmp/xymon-4.3.0.beta3/xymonnet'
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I.
-I/var/tmp/xymon-4.3.0.beta3/include -I/usr/local/include -o xymonnet
-Wl,--rpath,/opt/csw/lib -Wl,--rpath,/usr/local/lib xymonnet.o contest.o
httptest.o httpresult.o ldaptest.o dns.o dns2.o httpcookies.o
../lib/libxymon.a libcares.a   -L/usr/local/lib -lpcre -lresolv -lsocket
-lnsl -lrt
/usr/ccs/bin/ld: illegal option -- rpath
     
I just now noticed that the problem probably isn't with C-ARES, but
with the "--rpath" options that Xymon uses for the linker command.

If you look at the build/Makefile.SunOS file, you'll find the linker
setup there. Xymon tries to figure out if you are using the GNU ld
program:

    LDTYPE := $(shell ld -V 2>&1|head -1|cut -d' ' -f1)
    ifeq ($(LDTYPE),GNU)
       RPATH=-Wl,--rpath,
    else
       RPATH=-Wl,-R
    endif

Try deleting those lines, and see if it helps.


Regards,
Henrik

list Roland Soderstrom · Thu, 18 Nov 2010 09:48:01 +1100 ·
Hi,

Here is the Solaris 10 x86 compile error:

gcc -o setup-newfiles -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I. -I/var/tmp/xymon-4.3.0.beta3/include -DCLIENTONLY=1 -Wl,-R setup-newfiles.c ../lib/xymonclient.a  -lresolv -lsocket -lnsl -lrt
Undefined                       first referenced
  symbol                             in file
main                                /usr/local/lib/gcc/i386-pc-solaris2.10/3.4.6/crt1.o
ld: fatal: Symbol referencing errors. No output written to setup-newfiles
collect2: ld returned 1 exit status
make[1]: *** [setup-newfiles] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/build'
make: *** [build-build] Error 2

- Roland
quoted from Roland Soderstrom


On 18/11/10 09:02 AM, Roland Soderstrom wrote:
Hi,

That seems like a dirty fix, I relinked /usr/ccs/bin/ld which is as dirty.
Wouldn't the proper solution be that if it could find the Gnu ld it will use it?
In my case it is in the path but /usr/ccs/bin is not.
Still /usr/ccs/bin/ld is found first and used.
I tried setting LD= but it doesn't help.
As in that statement:
-bash-3.00$ ld -V 2>&1|head -1|cut -d' ' -f1
GNU
-bash-3.00$ ld -V
GNU ld version 2.15
  Supported emulations:
   elf32_sparc
   elf64_sparc
So Makefile.SunOS finds the Gnu linker, but later it is using /usr/ccs/bin/ld. Where? and Why?


Another problem:
I'm trying to compile the client on Solaris 9 SPARC and get this error.
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSunOS -I. -I/var/tmp/xymon-4.3.0.beta3/include -DCLIENTONLY=1 -I. -I../include    -c -o misc.o misc.c
In file included from /var/tmp/xymon-4.3.0.beta3/include/libxymon.h:56,
                 from misc.c:34:
/var/tmp/xymon-4.3.0.beta3/include/../lib/eventlog.h:38: error: syntax error before numeric constant
make[1]: *** [misc.o] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/lib'
make: *** [lib-client] Error 2

Next up is Solaris 10 x86, well see if that works.

- Roland

On 18/11/10 07:40 AM, Henrik Størner wrote:
In<user-d6679e54e744@xymon.invalid>  Roland Soderstrom<user-0cec9512a49f@xymon.invalid>  writes:
make[1]: Entering directory `/var/tmp/xymon-4.3.0.beta3/xymonnet'
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I.
-I/var/tmp/xymon-4.3.0.beta3/include -I/usr/local/include -o xymonnet
-Wl,--rpath,/opt/csw/lib -Wl,--rpath,/usr/local/lib xymonnet.o contest.o
httptest.o httpresult.o ldaptest.o dns.o dns2.o httpcookies.o
../lib/libxymon.a libcares.a   -L/usr/local/lib -lpcre -lresolv -lsocket
-lnsl -lrt
/usr/ccs/bin/ld: illegal option -- rpath
I just now noticed that the problem probably isn't with C-ARES, but
with the "--rpath" options that Xymon uses for the linker command.

If you look at the build/Makefile.SunOS file, you'll find the linker
setup there. Xymon tries to figure out if you are using the GNU ld
program:

    LDTYPE := $(shell ld -V 2>&1|head -1|cut -d' ' -f1)
    ifeq ($(LDTYPE),GNU)
       RPATH=-Wl,--rpath,
    else
       RPATH=-Wl,-R
    endif

Try deleting those lines, and see if it helps.


Regards,
Henrik

list Roland Soderstrom · Thu, 18 Nov 2010 10:38:11 +1100 ·
Hi,

Solved that problem by using Gnu ld instead.
However I had to do the same trick as in SPARC.
linking /usr/ccs/bin/ld to /usr/local/bin/ld

So, only the Solaris 9 client compile problem left.

- Roland
quoted from Roland Soderstrom

On 18/11/10 09:48 AM, Roland Soderstrom wrote:
Hi,

Here is the Solaris 10 x86 compile error:

gcc -o setup-newfiles -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS 
-I. -I/var/tmp/xymon-4.3.0.beta3/include -DCLIENTONLY=1 -Wl,-R 
setup-newfiles.c ../lib/xymonclient.a  -lresolv -lsocket -lnsl -lrt
Undefined                       first referenced
 symbol                             in file
main                                
/usr/local/lib/gcc/i386-pc-solaris2.10/3.4.6/crt1.o
ld: fatal: Symbol referencing errors. No output written to setup-newfiles
collect2: ld returned 1 exit status
make[1]: *** [setup-newfiles] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/build'
make: *** [build-build] Error 2

- Roland


On 18/11/10 09:02 AM, Roland Soderstrom wrote:
Hi,

That seems like a dirty fix, I relinked /usr/ccs/bin/ld which is as 
dirty.
Wouldn't the proper solution be that if it could find the Gnu ld it 
will use it?
In my case it is in the path but /usr/ccs/bin is not.
Still /usr/ccs/bin/ld is found first and used.
I tried setting LD= but it doesn't help.
As in that statement:
-bash-3.00$ ld -V 2>&1|head -1|cut -d' ' -f1
GNU
-bash-3.00$ ld -V
GNU ld version 2.15
  Supported emulations:
   elf32_sparc
   elf64_sparc
So Makefile.SunOS finds the Gnu linker, but later it is using 
/usr/ccs/bin/ld. Where? and Why?


Another problem:
I'm trying to compile the client on Solaris 9 SPARC and get this error.
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -DSunOS -I. 
-I/var/tmp/xymon-4.3.0.beta3/include -DCLIENTONLY=1 -I. 
-I../include    -c -o misc.o misc.c
In file included from /var/tmp/xymon-4.3.0.beta3/include/libxymon.h:56,
                 from misc.c:34:
/var/tmp/xymon-4.3.0.beta3/include/../lib/eventlog.h:38: error: 
syntax error before numeric constant
make[1]: *** [misc.o] Error 1
make[1]: Leaving directory `/var/tmp/xymon-4.3.0.beta3/lib'
make: *** [lib-client] Error 2

Next up is Solaris 10 x86, well see if that works.

- Roland

On 18/11/10 07:40 AM, Henrik Størner wrote:
In<user-d6679e54e744@xymon.invalid>  Roland 
Soderstrom<user-0cec9512a49f@xymon.invalid>  writes:
make[1]: Entering directory `/var/tmp/xymon-4.3.0.beta3/xymonnet'
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT  -DSunOS -I.
-I/var/tmp/xymon-4.3.0.beta3/include -I/usr/local/include -o xymonnet
-Wl,--rpath,/opt/csw/lib -Wl,--rpath,/usr/local/lib xymonnet.o 
contest.o
httptest.o httpresult.o ldaptest.o dns.o dns2.o httpcookies.o
../lib/libxymon.a libcares.a   -L/usr/local/lib -lpcre -lresolv 
-lsocket
-lnsl -lrt
/usr/ccs/bin/ld: illegal option -- rpath
I just now noticed that the problem probably isn't with C-ARES, but
with the "--rpath" options that Xymon uses for the linker command.

If you look at the build/Makefile.SunOS file, you'll find the linker
setup there. Xymon tries to figure out if you are using the GNU ld
program:

    LDTYPE := $(shell ld -V 2>&1|head -1|cut -d' ' -f1)
    ifeq ($(LDTYPE),GNU)
       RPATH=-Wl,--rpath,
    else
       RPATH=-Wl,-R
    endif

Try deleting those lines, and see if it helps.


Regards,
Henrik

list Henrik Størner · Thu, 18 Nov 2010 07:10:20 +0000 (UTC) ·
quoted from Roland Soderstrom
In <user-89d2356daf37@xymon.invalid> Roland Soderstrom <user-0cec9512a49f@xymon.invalid> writes:
So Makefile.SunOS finds the Gnu linker, but later it is using /usr/ccs/bin/ld. Where? and Why?
Most likely your compiler was built to search for the linker
in /usr/ccs/bin before trying /usr/local/bin
quoted from Roland Soderstrom

Another problem:
I'm trying to compile the client on Solaris 9 SPARC and get this error.
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSunOS -I. -I/var/tmp/xymon-4.3.0.beta3/include -DCLIENTONLY=1 -I. -I../include    -c -o misc.o misc.c
In file included from /var/tmp/xymon-4.3.0.beta3/include/libxymon.h:56,
                 from misc.c:34:
/var/tmp/xymon-4.3.0.beta3/include/../lib/eventlog.h:38: error: syntax error before numeric constant
Yes, I've seen this on Solaris 8 also. Looking into it.


Regards,
Henrik
list Henrik Størner · Mon, 6 Dec 2010 09:38:07 +0000 (UTC) ·
quoted from Henrik Størner
In <ic2jgs$8ss$user-e356fad9864f@xymon.invalid> Henrik "Størner" <user-ce4a2c883f75@xymon.invalid> writes:
In <user-89d2356daf37@xymon.invalid> Roland Soderstrom <user-0cec9512a49f@xymon.invalid> writes:
Another problem:
I'm trying to compile the client on Solaris 9 SPARC and get this error.
gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -DSunOS -I. -I/var/tmp/xymon-4.3.0.beta3/include 
-DCLIENTONLY=1 -I. -I../include    -c -o misc.o misc.c
In file included from /var/tmp/xymon-4.3.0.beta3/include/libxymon.h:56,
                 from misc.c:34:
/var/tmp/xymon-4.3.0.beta3/include/../lib/eventlog.h:38: error: syntax 
error before numeric constant
Yes, I've seen this on Solaris 8 also. Looking into it.

Turned out to be a name collision between some constants defined on Solaris
and in Xymon. So renaming them in Xymon solves this issue. Patch attached,
or download rev. 6604 from SVN.


Index: xymongen/pagegen.c
===================================================================
--- xymongen/pagegen.c	(revision 6602)
+++ xymongen/pagegen.c	(revision 6604)
@@ -954,7 +954,7 @@
 				do_eventlog(output, nongreeneventlogmaxcount, nongreeneventlogmaxtime,
 				NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, nongreennodialups, 
 				host_exists,
-				NULL, NULL, NULL, COUNT_NONE, S_NONE, NULL);
+				NULL, NULL, NULL, XYMON_COUNT_NONE, XYMON_S_NONE, NULL);
 			}
 		}
 		else if (strcmp(p, "acklog.sh") == 0) {
@@ -1139,7 +1139,7 @@
 			do_eventlog(output, nongreeneventlogmaxcount, nongreeneventlogmaxtime, 
 				    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, nongreennodialups, 
 				    host_exists,
-				    NULL, NULL, NULL, COUNT_NONE, S_NONE, NULL);
+				    NULL, NULL, NULL, XYMON_COUNT_NONE, XYMON_S_NONE, NULL);
 		}
 		if (nongreenacklog && !havedoneacklog) do_acklog(output, nongreenacklogmaxcount, nongreenacklogmaxtime);
 	}
Index: lib/eventlog.c
===================================================================
--- lib/eventlog.c	(revision 6602)
+++ lib/eventlog.c	(revision 6604)
@@ -641,7 +641,7 @@
 		oldcolname = colorname(eventcolor(oldcol));
 		newcolname = colorname(eventcolor(newcol));
 		/* For DURATION counts, we must parse all events until now */
-		if ((counttype != COUNT_DURATION) && (eventtime > lastevent)) break;
+		if ((counttype != XYMON_COUNT_DURATION) && (eventtime > lastevent)) break;
 		eventhost = hostinfo(hostname);
 		eventcolumn = getname(svcname, 1);
 
@@ -657,7 +657,7 @@
 					ignoredialups, hostcheck) == 0) continue;
 
 			/* For duration counts, record all events. We'll filter out the colors later. */
-			if (colrregexp && (counttype != COUNT_DURATION)) {
+			if (colrregexp && (counttype != XYMON_COUNT_DURATION)) {
 				colrmatch = ( (pcre_exec(colrregexp, NULL, newcolname, strlen(newcolname), 0, 0,
 							ovector, (sizeof(ovector)/sizeof(int))) >= 0) ||
 					      (pcre_exec(colrregexp, NULL, oldcolname, strlen(oldcolname), 0, 0,
@@ -678,7 +678,7 @@
 			newevent->next = eventhead;
 			eventhead = newevent;
 
-			if (counttype != COUNT_DURATION) {
+			if (counttype != XYMON_COUNT_DURATION) {
 				countrec = (eventcount_t *)xmh_item(eventhost, XMH_DATA);
 				while (countrec && (countrec->service != eventcolumn)) countrec = countrec->next;
 				if (countrec == NULL) {
@@ -695,8 +695,8 @@
 	/* Count the state changes per host */
 	svccounthead = hostcounthead = NULL;
 	switch (counttype) {
-	  case COUNT_EVENTS: count_events(&hostcounthead, &svccounthead); break;
-	  case COUNT_DURATION: count_duration(firstevent, lastevent,
+	  case XYMON_COUNT_EVENTS: count_events(&hostcounthead, &svccounthead); break;
+	  case XYMON_COUNT_DURATION: count_duration(firstevent, lastevent,
 					       pageregexp, expageregexp,
 					       hostregexp, exhostregexp,
 					       testregexp, extestregexp,
@@ -718,12 +718,12 @@
 		if (periodstring) fprintf(output, "<p><font size=+1>%s</font></p>\n", periodstring);
 
 		switch (sumtype) {
-		  case S_HOST_BREAKDOWN:
+		  case XYMON_S_HOST_BREAKDOWN:
 			/* Request for a specific service, show breakdown by host */
 			for (cwalk = hostcounthead; (cwalk); cwalk = cwalk->next) totalcount += cwalk->total;
 			fprintf(output, "<table summary=\"Breakdown by host\" border=0>\n");
 			fprintf(output, "<tr><th align=left>Host</th><th colspan=2>%s</th></tr>\n",
-				(counttype == COUNT_EVENTS) ? "State changes" : "Seconds red/yellow");
+				(counttype == XYMON_COUNT_EVENTS) ? "State changes" : "Seconds red/yellow");
 			fprintf(output, "<tr><td colspan=3><hr width=\"100%%\"></td></tr>\n");
 			for (cwalk = hostcounthead; (cwalk && (cwalk->total > 0)); cwalk = cwalk->next) {
 				fprintf(output, "<tr><td align=left>%s</td><td align=right>%lu</td><td align=right>(%6.2f %%)</tr>\n",
@@ -733,12 +733,12 @@
 			fprintf(output, "</table>\n");
 			break;
 
-		  case S_SERVICE_BREAKDOWN:
+		  case XYMON_S_SERVICE_BREAKDOWN:
 			/* Request for a specific host, show breakdown by service */
 			for (cwalk = svccounthead; (cwalk); cwalk = cwalk->next) totalcount += cwalk->total;
 			fprintf(output, "<table summary=\"Breakdown by service\" border=0>\n");
 			fprintf(output, "<tr><th align=left>Service</th><th colspan=2>%s</th></tr>\n",
-				(counttype == COUNT_EVENTS) ? "State changes" : "Seconds red/yellow");
+				(counttype == XYMON_COUNT_EVENTS) ? "State changes" : "Seconds red/yellow");
 			fprintf(output, "<tr><td colspan=3><hr width=\"100%%\"></td></tr>\n");
 			for (cwalk = svccounthead; (cwalk && (cwalk->total > 0)); cwalk = cwalk->next) {
 				fprintf(output, "<tr><td align=left>%s</td><td align=right>%lu</td><td align=right>(%6.2f %%)</tr>\n",
@@ -748,11 +748,11 @@
 			fprintf(output, "</table>\n");
 			break;
 
-		  case S_NONE:
+		  case XYMON_S_NONE:
 			break;
 		}
 
-		if (sumtype == S_NONE) {
+		if (sumtype == XYMON_S_NONE) {
 			int  count;
 			count=0;
 			ewalk=eventhead; 
@@ -783,11 +783,11 @@
 		for (ewalk=eventhead; (ewalk); ewalk=ewalk->next) {
 			char *hostname = xmh_item(ewalk->host, XMH_HOSTNAME);
 
-			if ( (counttype == COUNT_DURATION) &&
+			if ( (counttype == XYMON_COUNT_DURATION) &&
 			     (ewalk->oldcolor < COL_YELLOW) &&
 			     (ewalk->newcolor < COL_YELLOW) ) continue;
 
-			if ( (counttype == COUNT_DURATION) &&
+			if ( (counttype == XYMON_COUNT_DURATION) &&
 			     (ewalk->eventtime >= lastevent) ) continue;
 
 			fprintf(output, "<TR BGCOLOR=%s>\n", bgcolors[bgcolor]);
Index: lib/eventlog.h
===================================================================
--- lib/eventlog.h	(revision 6602)
+++ lib/eventlog.h	(revision 6604)
@@ -35,8 +35,8 @@
 	struct countlist_t *next;
 } countlist_t;
 
-typedef enum { S_NONE, S_HOST_BREAKDOWN, S_SERVICE_BREAKDOWN } eventsummary_t;
-typedef enum { COUNT_NONE, COUNT_EVENTS, COUNT_DURATION } countsummary_t;
+typedef enum { XYMON_S_NONE, XYMON_S_HOST_BREAKDOWN, XYMON_S_SERVICE_BREAKDOWN } eventsummary_t;
+typedef enum { XYMON_COUNT_NONE, XYMON_COUNT_EVENTS, XYMON_COUNT_DURATION } countsummary_t;
 
 typedef int (*f_hostcheck)(char *hostname);
 
Index: web/eventlog.c
===================================================================
--- web/eventlog.c	(revision 6602)
+++ web/eventlog.c	(revision 6604)
@@ -43,8 +43,8 @@
 char	*colorregex = NULL;
 int	ignoredialups = 0;
 int	topcount = 0;
-eventsummary_t summarybar = S_NONE;
-countsummary_t counttype = COUNT_NONE;
+eventsummary_t summarybar = XYMON_S_NONE;
+countsummary_t counttype = XYMON_COUNT_NONE;
 char	*webfile_hf = "event";
 char	*webfile_form = "event_form";
 cgidata_t *cgidata = NULL;
@@ -102,14 +102,14 @@
 			if (*(cwalk->value)) topcount = atoi(cwalk->value);
 		}
 		else if (strcasecmp(cwalk->name, "SUMMARY") == 0) {
-			if (strcasecmp(cwalk->value, "hosts") == 0) summarybar = S_HOST_BREAKDOWN;
-			else if (strcasecmp(cwalk->value, "services") == 0) summarybar = S_SERVICE_BREAKDOWN;
-			else summarybar = S_NONE;
+			if (strcasecmp(cwalk->value, "hosts") == 0) summarybar = XYMON_S_HOST_BREAKDOWN;
+			else if (strcasecmp(cwalk->value, "services") == 0) summarybar = XYMON_S_SERVICE_BREAKDOWN;
+			else summarybar = XYMON_S_NONE;
 		}
 		else if (strcasecmp(cwalk->name, "COUNTTYPE") == 0) {
-			if (strcasecmp(cwalk->value, "events") == 0) counttype = COUNT_EVENTS;
-			else if (strcasecmp(cwalk->value, "duration") == 0) counttype = COUNT_DURATION;
-			else counttype = COUNT_NONE;
+			if (strcasecmp(cwalk->value, "events") == 0) counttype = XYMON_COUNT_EVENTS;
+			else if (strcasecmp(cwalk->value, "duration") == 0) counttype = XYMON_COUNT_DURATION;
+			else counttype = XYMON_COUNT_NONE;
 		}
 		else if (strcasecmp(cwalk->name, "TIMETXT") == 0) {
 			if (*(cwalk->value)) strcpy(periodstring, cwalk->value);
@@ -165,14 +165,14 @@
 		addtobuffer(othercriteria, "&amp;SUMMARY=services");
 		addtobuffer(othercriteria, "&amp;TIMETXT=");
 		addtobuffer(othercriteria, periodstring);
-		if (counttype == COUNT_EVENTS) addtobuffer(othercriteria, "&amp;COUNTTYPE=events");
-		else if (counttype == COUNT_DURATION) addtobuffer(othercriteria, "&amp;COUNTTYPE=duration");
+		if (counttype == XYMON_COUNT_EVENTS) addtobuffer(othercriteria, "&amp;COUNTTYPE=events");
+		else if (counttype == XYMON_COUNT_DURATION) addtobuffer(othercriteria, "&amp;COUNTTYPE=duration");
 
 		fprintf(output, "<td width=40%% align=center valign=top>\n");
 		fprintf(output, "   <table summary=\"Top %d hosts\" border=0>\n", topcount);
 		fprintf(output, "      <tr><th colspan=3>Top %d hosts</th></tr>\n", topcount);
 		fprintf(output, "      <tr><th align=left>Host</th><th align=left colspan=2>%s</th></tr>\n",
-			(counttype == COUNT_EVENTS) ? "State changes" : "Seconds red/yellow");
+			(counttype == XYMON_COUNT_EVENTS) ? "State changes" : "Seconds red/yellow");
 
 		/* Compute the total count */
 		for (i=0, cwalk=hostcounthead; (cwalk); i++, cwalk=cwalk->next) totalcount += cwalk->total;
@@ -246,15 +246,15 @@
 		addtobuffer(othercriteria, "&amp;SUMMARY=hosts");
 		addtobuffer(othercriteria, "&amp;TIMETXT=");
 		addtobuffer(othercriteria, periodstring);
-		if (counttype == COUNT_EVENTS) addtobuffer(othercriteria, "&amp;COUNTTYPE=events");
-		else if (counttype == COUNT_DURATION) addtobuffer(othercriteria, "&amp;COUNTTYPE=duration");
+		if (counttype == XYMON_COUNT_EVENTS) addtobuffer(othercriteria, "&amp;COUNTTYPE=events");
+		else if (counttype == XYMON_COUNT_DURATION) addtobuffer(othercriteria, "&amp;COUNTTYPE=duration");
 
 
 		fprintf(output, "<td width=40%% align=center valign=top>\n");
 		fprintf(output, "   <table summary=\"Top %d services\" border=0>\n", topcount);
 		fprintf(output, "      <tr><th colspan=3>Top %d services</th></tr>\n", topcount);
 		fprintf(output, "      <tr><th align=left>Service</th><th align=left colspan=2>%s</th></tr>\n",
-			(counttype == COUNT_EVENTS) ? "State changes" : "Seconds red/yellow");
+			(counttype == XYMON_COUNT_EVENTS) ? "State changes" : "Seconds red/yellow");
 
 		/* Compute the total count */
 		for (i=0, cwalk=svccounthead; (cwalk); i++, cwalk=cwalk->next) totalcount += cwalk->total;
@@ -360,7 +360,7 @@
 		do_eventlog(NULL, -1, -1, fromtime, totime, 
 			    pageregex, expageregex, hostregex, exhostregex, testregex, extestregex,
 			    colorregex, ignoredialups, NULL,
-			    &events, &hcounts, &scounts, counttype, S_NONE, NULL);
+			    &events, &hcounts, &scounts, counttype, XYMON_S_NONE, NULL);
 
 		lastevent = (totime ? eventreport_time(totime) : getcurrenttime(NULL));
 

Regards,
Henrik
list Roland Soderstrom · Wed, 8 Dec 2010 07:15:23 +1100 ·
Hi,

Compiling works like a charm now.
Thanks Henrik, great effort.

Still the ld problem and the /usr/ccs/bin path
On Solaris 9 it is setup-newfiles that complains.
But a link /usr/ccs/bin/ld that point to my gnu linker solves the problem.

- Roland

quoted from Henrik StørnerOn 6/12/10 08:38 PM, Henrik Størner wrote:
In  Henrik "Størner"  writes:



  
In <user-89d2356daf37@xymon.invalid> Roland Soderstrom  writes:

    
Another problem:

I'm trying to compile the client on Solaris 9 SPARC and get this error.

gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE 

-D_FILE_OFFSET_BITS=64 -DSunOS -I. -I/var/tmp/xymon-4.3.0.beta3/include 

-DCLIENTONLY=1 -I. -I../include    -c -o misc.o misc.c

In file included from /var/tmp/xymon-4.3.0.beta3/include/libxymon.h:56,

                 from misc.c:34:

/var/tmp/xymon-4.3.0.beta3/include/../lib/eventlog.h:38: error: syntax 

error before numeric constant

      
Yes, I've seen this on Solaris 8 also. Looking into it.

    



Turned out to be a name collision between some constants defined on Solaris

and in Xymon. So renaming them in Xymon solves this issue. Patch attached,

or download rev. 6604 from SVN.





Index: xymongen/pagegen.c

===================================================================

--- xymongen/pagegen.c  (revision 6602)

+++ xymongen/pagegen.c  (revision 6604)

@@ -954,7 +954,7 @@

                                do_eventlog(output, nongreeneventlogmaxcount, nongreeneventlogmaxtime,

                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, nongreennodialups, 

                                host_exists,

-                               NULL, NULL, NULL, COUNT_NONE, S_NONE, NULL);

+                               NULL, NULL, NULL, XYMON_COUNT_NONE, XYMON_S_NONE, NULL);

                        }

                }

                else if (strcmp(p, "acklog.sh") == 0) {

@@ -1139,7 +1139,7 @@

                        do_eventlog(output, nongreeneventlogmaxcount, nongreeneventlogmaxtime, 

                                    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, nongreennodialups, 

                                    host_exists,

-                                   NULL, NULL, NULL, COUNT_NONE, S_NONE, NULL);

+                                   NULL, NULL, NULL, XYMON_COUNT_NONE, XYMON_S_NONE, NULL);

                }

                if (nongreenacklog && !havedoneacklog) do_acklog(output, nongreenacklogmaxcount, nongreenacklogmaxtime);

        }

Index: lib/eventlog.c

===================================================================

--- lib/eventlog.c      (revision 6602)

+++ lib/eventlog.c      (revision 6604)

@@ -641,7 +641,7 @@

                oldcolname = colorname(eventcolor(oldcol));

                newcolname = colorname(eventcolor(newcol));

                /* For DURATION counts, we must parse all events until now */

-               if ((counttype != COUNT_DURATION) && (eventtime > lastevent)) break;

+               if ((counttype != XYMON_COUNT_DURATION) && (eventtime > lastevent)) break;

                eventhost = hostinfo(hostname);

                eventcolumn = getname(svcname, 1);

 

@@ -657,7 +657,7 @@

                                        ignoredialups, hostcheck) == 0) continue;

 

                        /* For duration counts, record all events. We'll filter out the colors later. */

-                       if (colrregexp && (counttype != COUNT_DURATION)) {

+                       if (colrregexp && (counttype != XYMON_COUNT_DURATION)) {

                                colrmatch = ( (pcre_exec(colrregexp, NULL, newcolname, strlen(newcolname), 0, 0,

                                                        ovector, (sizeof(ovector)/sizeof(int))) >= 0) ||

                                              (pcre_exec(colrregexp, NULL, oldcolname, strlen(oldcolname), 0, 0,

@@ -678,7 +678,7 @@

                        newevent->next = eventhead;

                        eventhead = newevent;

 

-                       if (counttype != COUNT_DURATION) {

+                       if (counttype != XYMON_COUNT_DURATION) {

                                countrec = (eventcount_t *)xmh_item(eventhost, XMH_DATA);

                                while (countrec && (countrec->service != eventcolumn)) countrec = countrec->next;

                                if (countrec == NULL) {

@@ -695,8 +695,8 @@

        /* Count the state changes per host */

        svccounthead = hostcounthead = NULL;

        switch (counttype) {

-         case COUNT_EVENTS: count_events(&hostcounthead, &svccounthead); break;

-         case COUNT_DURATION: count_duration(firstevent, lastevent,

+         case XYMON_COUNT_EVENTS: count_events(&hostcounthead, &svccounthead); break;

+         case XYMON_COUNT_DURATION: count_duration(firstevent, lastevent,

                                               pageregexp, expageregexp,

                                               hostregexp, exhostregexp,

                                               testregexp, extestregexp,

@@ -718,12 +718,12 @@

                if (periodstring) fprintf(output, "

%s

\n", periodstring);
quoted from Henrik Størner

 

                switch (sumtype) {

-                 case S_HOST_BREAKDOWN:

+                 case XYMON_S_HOST_BREAKDOWN:

                        /* Request for a specific service, show breakdown by host */

                        for (cwalk = hostcounthead; (cwalk); cwalk = cwalk->next) totalcount += cwalk->total;

                        fprintf(output, "
\n"); fprintf(output, "\n", - (counttype == COUNT_EVENTS) ? "State changes" : "Seconds red/yellow"); + (counttype == XYMON_COUNT_EVENTS) ? "State changes" : "Seconds red/yellow"); fprintf(output, "\n"); for (cwalk = hostcounthead; (cwalk && (cwalk->total > 0)); cwalk = cwalk->next) { fprintf(output, "\n", @@ -733,12 +733,12 @@ fprintf(output, "
Host%s

%s%lu(%6.2f %%)
\n"); break; - case S_SERVICE_BREAKDOWN: + case XYMON_S_SERVICE_BREAKDOWN: /* Request for a specific host, show breakdown by service */ for (cwalk = svccounthead; (cwalk); cwalk = cwalk->next) totalcount += cwalk->total; fprintf(output, "\n"); fprintf(output, "\n", - (counttype == COUNT_EVENTS) ? "State changes" : "Seconds red/yellow"); + (counttype == XYMON_COUNT_EVENTS) ? "State changes" : "Seconds red/yellow"); fprintf(output, "\n"); for (cwalk = svccounthead; (cwalk && (cwalk->total > 0)); cwalk = cwalk->next) { fprintf(output, "\n", @@ -748,11 +748,11 @@ fprintf(output, "
Service%s

%s%lu(%6.2f %%)
\n"); break; - case S_NONE: + case XYMON_S_NONE: break; } - if (sumtype == S_NONE) { + if (sumtype == XYMON_S_NONE) { int count; count=0; ewalk=eventhead; @@ -783,11 +783,11 @@ for (ewalk=eventhead; (ewalk); ewalk=ewalk->next) { char *hostname = xmh_item(ewalk->host, XMH_HOSTNAME); - if ( (counttype == COUNT_DURATION) && + if ( (counttype == XYMON_COUNT_DURATION) && (ewalk->oldcolor < COL_YELLOW) && (ewalk->newcolor < COL_YELLOW) ) continue; - if ( (counttype == COUNT_DURATION) && + if ( (counttype == XYMON_COUNT_DURATION) && (ewalk->eventtime >= lastevent) ) continue; fprintf(output, "\n", bgcolors[bgcolor]); Index: lib/eventlog.h =================================================================== --- lib/eventlog.h (revision 6602) +++ lib/eventlog.h (revision 6604) @@ -35,8 +35,8 @@ struct countlist_t *next; } countlist_t; -typedef enum { S_NONE, S_HOST_BREAKDOWN, S_SERVICE_BREAKDOWN } eventsummary_t; -typedef enum { COUNT_NONE, COUNT_EVENTS, COUNT_DURATION } countsummary_t; +typedef enum { XYMON_S_NONE, XYMON_S_HOST_BREAKDOWN, XYMON_S_SERVICE_BREAKDOWN } eventsummary_t; +typedef enum { XYMON_COUNT_NONE, XYMON_COUNT_EVENTS, XYMON_COUNT_DURATION } countsummary_t; typedef int (*f_hostcheck)(char *hostname); Index: web/eventlog.c =================================================================== --- web/eventlog.c (revision 6602) +++ web/eventlog.c (revision 6604) @@ -43,8 +43,8 @@ char *colorregex = NULL; int ignoredialups = 0; int topcount = 0; -eventsummary_t summarybar = S_NONE; -countsummary_t counttype = COUNT_NONE; +eventsummary_t summarybar = XYMON_S_NONE; +countsummary_t counttype = XYMON_COUNT_NONE; char *webfile_hf = "event"; char *webfile_form = "event_form"; cgidata_t *cgidata = NULL; @@ -102,14 +102,14 @@ if (*(cwalk->value)) topcount = atoi(cwalk->value); } else if (strcasecmp(cwalk->name, "SUMMARY") == 0) { - if (strcasecmp(cwalk->value, "hosts") == 0) summarybar = S_HOST_BREAKDOWN; - else if (strcasecmp(cwalk->value, "services") == 0) summarybar = S_SERVICE_BREAKDOWN; - else summarybar = S_NONE; + if (strcasecmp(cwalk->value, "hosts") == 0) summarybar = XYMON_S_HOST_BREAKDOWN; + else if (strcasecmp(cwalk->value, "services") == 0) summarybar = XYMON_S_SERVICE_BREAKDOWN; + else summarybar = XYMON_S_NONE; } else if (strcasecmp(cwalk->name, "COUNTTYPE") == 0) { - if (strcasecmp(cwalk->value, "events") == 0) counttype = COUNT_EVENTS; - else if (strcasecmp(cwalk->value, "duration") == 0) counttype = COUNT_DURATION; - else counttype = COUNT_NONE; + if (strcasecmp(cwalk->value, "events") == 0) counttype = XYMON_COUNT_EVENTS; + else if (strcasecmp(cwalk->value, "duration") == 0) counttype = XYMON_COUNT_DURATION; + else counttype = XYMON_COUNT_NONE; } else if (strcasecmp(cwalk->name, "TIMETXT") == 0) { if (*(cwalk->value)) strcpy(periodstring, cwalk->value); @@ -165,14 +165,14 @@ addtobuffer(othercriteria, "&SUMMARY=services"); addtobuffer(othercriteria, "&TIMETXT="); addtobuffer(othercriteria, periodstring); - if (counttype == COUNT_EVENTS) addtobuffer(othercriteria, "&COUNTTYPE=events"); - else if (counttype == COUNT_DURATION) addtobuffer(othercriteria, "&COUNTTYPE=duration"); + if (counttype == XYMON_COUNT_EVENTS) addtobuffer(othercriteria, "&COUNTTYPE=events"); + else if (counttype == XYMON_COUNT_DURATION) addtobuffer(othercriteria, "&COUNTTYPE=duration"); fprintf(output, "\n"); fprintf(output, " \n", topcount); fprintf(output, " \n", topcount); fprintf(output, " \n", - (counttype == COUNT_EVENTS) ? "State changes" : "Seconds red/yellow"); + (counttype == XYMON_COUNT_EVENTS) ? "State changes" : "Seconds red/yellow"); /* Compute the total count */ for (i=0, cwalk=hostcounthead; (cwalk); i++, cwalk=cwalk->next) totalcount += cwalk->total; @@ -246,15 +246,15 @@ addtobuffer(othercriteria, "&SUMMARY=hosts"); addtobuffer(othercriteria, "&TIMETXT="); addtobuffer(othercriteria, periodstring); - if (counttype == COUNT_EVENTS) addtobuffer(othercriteria, "&COUNTTYPE=events"); - else if (counttype == COUNT_DURATION) addtobuffer(othercriteria, "&COUNTTYPE=duration"); + if (counttype == XYMON_COUNT_EVENTS) addtobuffer(othercriteria, "&COUNTTYPE=events"); + else if (counttype == XYMON_COUNT_DURATION) addtobuffer(othercriteria, "&COUNTTYPE=duration"); fprintf(output, "
Top %d hosts
Host%s
\n"); fprintf(output, " \n", topcount); fprintf(output, " \n", topcount); fprintf(output, " \n", - (counttype == COUNT_EVENTS) ? "State changes" : "Seconds red/yellow"); + (counttype == XYMON_COUNT_EVENTS) ? "State changes" : "Seconds red/yellow"); /* Compute the total count */ for (i=0, cwalk=svccounthead; (cwalk); i++, cwalk=cwalk->next) totalcount += cwalk->total; @@ -360,7 +360,7 @@ do_eventlog(NULL, -1, -1, fromtime, totime, pageregex, expageregex, hostregex, exhostregex, testregex, extestregex, colorregex, ignoredialups, NULL, - &events, &hcounts, &scounts, counttype, S_NONE, NULL); + &events, &hcounts, &scounts, counttype, XYMON_S_NONE, NULL); lastevent = (totime ? eventreport_time(totime) : getcurrenttime(NULL)); Regards, Henrik
Top %d services
Service%s