Xymon Mailing List Archive search

Client build fails on SCO_SV (i386)

2 messages in this thread

list Charles Goyard · Wed, 19 Jul 2006 15:04:51 +0200 ·
Hi,

at my company we have some old or unusual platforms, such as SCO_SV or
Sinix.

Here I'm trying to build the hobbit client out of 4.2-beta
(snapshot 2006-07-04) on this kind of environment :

SCO_SV 3.2 5.0.5 i386
GNU Make version 3.75, by Richard Stallman and Roland McGrath.
GCC 2.95.1
and the native cc.

The configure runs well, but when building with gcc I get :

gcc -g -O -D_REENTRANT -Dgeneric -I. -I/usr2/local/hobbit/cvf/include -DCLIENTONLY=1 -I. -I../include    -c errormsg.c -o errormsg.o
errormsg.c: In function `redirect_cgilog':
errormsg.c:159: `PATH_MAX' undeclared (first use in this function)
errormsg.c:159: (Each undeclared identifier is reported only once
errormsg.c:159: for each function it appears in.)
gmake[1]: *** [errormsg.o] Error 1
gmake[1]: Leaving directory `/usr2/local/hobbit/cvf/lib'
gmake: *** [lib-client] Error 2

and when building with cc I get :

"/usr2/local/hobbit/cvf/include/../lib/misc.h", line 39: error: invalid type combination
If I change the type from "long long" to "long", it then builds up to
the exact same point as gcc.


If anyone has some clue about this...


Regards,

-- 
Charles Goyard - user-98f9625a7a59@xymon.invalid - (+33) 1 45 38 01 31
list Henrik Størner · Wed, 19 Jul 2006 22:13:07 +0200 ·
quoted from Charles Goyard
On Wed, Jul 19, 2006 at 03:04:51PM +0200, Charles Goyard wrote:
Here I'm trying to build the hobbit client out of 4.2-beta
(snapshot 2006-07-04) on this kind of environment :

SCO_SV 3.2 5.0.5 i386
GNU Make version 3.75, by Richard Stallman and Roland McGrath.
GCC 2.95.1
and the native cc.

The configure runs well, but when building with gcc I get :

gcc -g -O -D_REENTRANT -Dgeneric -I. -I/usr2/local/hobbit/cvf/include -DCLIENTONLY=1 -I. -I../include    -c errormsg.c -o errormsg.o
errormsg.c: In function `redirect_cgilog':
errormsg.c:159: `PATH_MAX' undeclared (first use in this function)
I though PATH_MAX was a fairly standard definition, but it appears that
it is not defined everywhere. I'll add a check for this to the configure
script, and make sure it gets defined if there is no standard definition
available for it. Try the attached patch (run a "make clean" before
re-building the client).

The native cc command on this platform appears not to support the C99 
standard. Hobbit uses the "long long" datatype for a few things; this 
is standard in C99 which gcc supports. So I'd recommend using that.


Regards,
Henrik

-------------- next part --------------
--- build/genconfig.sh	2006/04/15 16:02:50	1.9
+++ build/genconfig.sh	2006/07/19 20:06:43
@@ -64,6 +64,10 @@
 	echo "#undef HAVE_UINT32_TYPEDEF" >>include/config.h
 fi
 
+echo "Checking for PATH_MAX definition"
+$CC -o build/testfile $CFLAGS build/test-pathmax.c 1>/dev/null 2>&1
+if test -x build/testfile; then ./build/testfile >>include/config.h; fi
• echo "#endif" >>include/config.h
 
 echo "config.h created"
--- /dev/null	2006-05-22 16:25:23.000000000 +0200
+++ build/test-pathmax.c	2006-07-19 22:07:03.904154797 +0200
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <limits.h>
• +int main(int argc, char *argv[])
+{
+	long res;
• +#ifndef PATH_MAX
+	res = pathconf("/", _PC_PATH_MAX);
+	printf("#define PATH_MAX %ld\n", res);
+#endif
• +	return 0;
+}
+