[hobbit] [continuation] Client compilation failed on AIX 4.2.1

Henrik Stoerner henrik at hswn.dk
Thu Sep 7 08:13:01 CEST 2006


On Mon, Sep 04, 2006 at 07:16:41PM +0200, thomas.seglard.enata at cnp.fr wrote:

> it's me again with all my troubles on AIX 4.2.1... Sorry ! Now, I'm just 
> using the C compiler from IBM. Here is the new output :
> 
> gmake[1]: Entering directory `/opt/gnu/hobbit/common'
> cc -g -O3 -qstrict -qcpluscmt -D_REENTRANT  -DAIX -I. 
> -I/opt/gnu/hobbit/include -DCLIENTONLY=1 -c -o bb.o bb.c
> cc -g -O3 -qstrict -qcpluscmt -D_REENTRANT  -DAIX -I. 
> -I/opt/gnu/hobbit/include -DCLIENTONLY=1 -o ../client/bb bb.o 
> ../lib/hobbitclient.a 
> ld: 0711-317 ERROR: Undefined symbol: .strtok_r

Ouch ... your system doesn't have the strtok_r function.

This is a standard function, but it didn't become that until the 2001 
edition of POSIX. Apparently AIX 4.2.1 predates that.

Still, I would like the client to work on as many platforms as possible.
Does this patch fix it for you?


Regards,
Henrik

-------------- next part --------------
--- lib/Makefile	2006/07/04 11:32:14	1.50
+++ lib/Makefile	2006/09/07 06:06:37
@@ -3,7 +3,7 @@
 
 BBGENLIBOBJS = osdefs.o acklog.o availability.o calc.o cgi.o cgiurls.o clientlocal.o color.o digest.o encoding.o environ.o errormsg.o eventlog.o files.o headfoot.o hobbitrrd.o htmllog.o ipaccess.o loadalerts.o loadhosts.o loadnkconf.o links.o matching.o md5.o memory.o misc.o netservices.o rbtr.o reportlog.o rmd160c.o sendmsg.o sha1.o sig.o stackio.o strfunc.o suid.o timefunc.o timing.o url.o
 
-CLIENTLIBOBJS = osdefs.o cgiurls.o color.o digest.o encoding.o environ-client.o errormsg.o ipaccess.o loadhosts.o md5.o memory.o misc.o rbtr.o rmd160c.o sendmsg.o sha1.o sig.o stackio.o strfunc.o suid.o timefunc.o
+CLIENTLIBOBJS = osdefs.o cgiurls.o color-client.o digest.o encoding.o environ-client.o errormsg.o ipaccess.o loadhosts.o md5.o memory.o misc.o rbtr.o rmd160c.o sendmsg.o sha1.o sig.o stackio.o strfunc.o suid.o timefunc-client.o
 ifeq ($(LOCALCLIENT),yes)
 	CLIENTLIBOBJS += matching.o
 endif
@@ -53,6 +53,12 @@
 environ-client.o: environ.c
 	$(CC) $(CFLAGS) -DBBTOPDIR=\"$(BBTOPDIR)\" -DBBLOGDIR=\"$(BBLOGDIR)\" -DBBHOSTNAME=\"$(BBHOSTNAME)\" -DBBHOSTIP=\"$(BBHOSTIP)\" -DBBHOSTOS=\"$(BBHOSTOS)\" -DBUILD_HOME=\"$(BBTOPDIR)/client\" -c -o $@ environ.c
 
+color-client.o: color.c
+	$(CC) $(CFLAGS) -DCLIENTONLY -c -o $@ $<
+
+timefunc-client.o: timefunc.c
+	$(CC) $(CFLAGS) -DCLIENTONLY -c -o $@ $<
+
 loadhosts: loadhosts.c libbbgen.a
 	$(CC) $(CFLAGS) -DSTANDALONE -o $@ loadhosts.c ./libbbgen.a
 
--- lib/color.c	2006/05/03 21:12:33	1.12
+++ lib/color.c	2006/09/07 06:07:06
@@ -111,6 +111,7 @@
 	return filename;
 }
 
+#ifndef CLIENTONLY
 int colorset(char *colspec, int excludeset)
 {
 	char *cspeccopy = strdup(colspec);
@@ -131,4 +132,5 @@
 	ac = (ac & ~excludeset);
 	return ac;
 }
+#endif
 
--- lib/timefunc.c	2006/07/20 16:06:41	1.31
+++ lib/timefunc.c	2006/09/07 06:07:54
@@ -245,6 +245,7 @@
 	return found;
 }
 
+#ifndef CLIENTONLY
 char *check_downtime(char *hostname, char *testname)
 {
 	namelist_t *hinfo = hostinfo(hostname);
@@ -300,6 +301,7 @@
 
 	return NULL;
 }
+#endif
 
 int periodcoversnow(char *tag)
 {


More information about the Xymon mailing list