[hobbit] Client build fails on SCO_SV (i386)

Henrik Stoerner henrik at hswn.dk
Wed Jul 19 22:13:07 CEST 2006


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;
+}
+


More information about the Xymon mailing list