"Pier P. Fumagalli" wrote: > > Marcus Crafter <[EMAIL PROTECTED]> wrote: > > > Hi All, > > > > I've been trying to build the service code from the Tomcat 4.0b1 source base > > under my Linux system. Unfortunately there seems to be a problem with the > > systeminfo.h (and underlying sysinfo system call) header file. > > > > systeminfo.h does not exist under Linux (at least on my system, it's > > sysinfo.h), and the sysinfo system call made (jsvc_unix.c, line 158) also > > doesn't exist. :-( There is a sysinfo system call, but it returns a struct > > containing system details like uptime, load, etc. > > > > sysinfo() is used in jsvc_unix.c to obtain the architecture, which is used to > > build up a string locating libjvm.so. Looks like under linux we'll have to do > > this another way, unless I've overlooked/missed something ? > > > > I've searched the man pages to find an equivalent system call. The best I > > could > > find was uname() in utsname.h which returns a struct including the > > architecture > > type, however it returns too specific information (ie. i686 where i386 is > > needed for our purposes). > > > > Any ideas, suggestions for a solution ? > > > > How should we manage platform dependancies/differences like this ? (configure > > script? etc) > > The problem lies in the fact that I'm developing the native components under > Solaris, and up to this point, I've never tried a port to Linux or other > OSes (my next attempt is a build on MacOS/X, and then Yellow Dog Linux for > PPC - Can you tell I work on Macintoshes now?). > > I'm kinda biased towards not using autoconf/automake (mainly because I don't > know them), but they worked well in JServ (yes Jon, you convinced me!). If > someone with more experience could come up with something along those lines, > I'll be happy to include it, otherwise we might just use a nasty BASH > script, we don't have to filter out _that_ many calls outside the ANSI C > specification. > > Pier > > -- > ---------------------------------------------------------------------------- > Pier Fumagalli <http://www.betaversion.org/> <mailto:[EMAIL PROTECTED]> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] And that no easy... But what is needed is the patch to libjvm.so isn't it? On my Linux it is: /home2/jdk1.2.2/jre/lib/i386/classic/libjvm.so (JAVA_HOME is /home2/jdk1.2.2). On a ReliantUnix it is: /opt/java/jdk12/jre/lib/mips/classic/green_threads/libjvm.so I would suggest to define it in the Makedefs: I have tried the following Makedefs on Linux: +++ JAVA_HOME = /home2/jdk1.2.2 JAVAC = $(JAVA_HOME)/bin/javac JAVACOPTS = -O JAVADOC = $(JAVA_HOME)/bin/javadoc JAVADOCOPTS = -author -version -splitindex -windowtitle "Apache Service Interface" JAR = $(JAVA_HOME)/bin/jar JVMLIB = $(JAVA_HOME)/jre/lib/i386/classic/libjvm.so CC = gcc COPTS = -O6 -Wall -Wstrict-prototypes CINCS = -I. -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DJVMLIB=\""$(JVMLIB)"\" CLIBS = -ldl +++ And I have applied the enclosed patch. Cheers Jean-frederic
? Makedefs ? service.jar ? cscope.list ? patch.txt ? cscope.out ? native/jsvc Index: native/jsvc.h =================================================================== RCS file: /home/cvs/mirror/jakarta-tomcat-4.0/service/src/native/jsvc.h,v retrieving revision 1.3 diff -u -r1.3 jsvc.h --- native/jsvc.h 2000/11/27 11:05:14 1.3 +++ native/jsvc.h 2001/02/26 16:23:36 @@ -61,7 +61,9 @@ #ifndef _JSVC_H_ #define _JSVC_H_ +#if HAVE_SYSTEMINFO_H #include <sys/systeminfo.h> +#endif #include <strings.h> #include <stdarg.h> #include <stdlib.h> @@ -163,4 +165,4 @@ // Stop the service boolean jsvc_stop(jsvc_config *); -#endif // #ifndef _JSVC_H_ \ No newline at end of file +#endif // #ifndef _JSVC_H_ Index: native/jsvc_unix.c =================================================================== RCS file: /home/cvs/mirror/jakarta-tomcat-4.0/service/src/native/jsvc_unix.c,v retrieving revision 1.3 diff -u -r1.3 jsvc_unix.c --- native/jsvc_unix.c 2000/11/27 11:05:18 1.3 +++ native/jsvc_unix.c 2001/02/26 16:23:37 @@ -155,14 +155,30 @@ else xvm=strcat(strdup(cfg->vm),"/"); // Check the processor architecture +#if !HAVE_SYSTEMINFO_H +#ifdef JVMLIB +#else +#error "JVMLIB should defined" +#endif +#else sysinfo(SI_ARCHITECTURE,arc,32); +#endif // Calculate the Java Virtual Machine library filename (for JRE standard) +#ifdef JVMLIB + strcpy(lib,JVMLIB); +#else sprintf(lib,"%s/lib/%s/%slibjvm.so",cfg->home,arc,xvm); +#endif jsvc_debug(JSVC_MARK, "Attempting to load library from \"%s\"",lib); + printf("Attempting to load library from \"%s\"",lib); x=open(lib,O_RDONLY); if (x<0) { +#ifdef JVMLIB + strcpy(lib,JVMLIB); +#else sprintf(lib,"%s/jre/lib/%s/%slibjvm.so",cfg->home,arc,xvm); +#endif jsvc_debug(JSVC_MARK, "Attempting to load library from \"%s\"",lib); x=open(lib,O_RDONLY); if (x<0) {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]