Attached are the patches to get both the Imakefile in shape, and to get
the program to compile. (I was a bit too quick earlier, there was one
more Imakefile change to make.)

        Danny

On Sat, 2004-12-11 at 23:04 -0500, Zachary Uram wrote:
> Hello,
> 
> I'm trying to get a program working that was written in 1993 for
> X11R5, Motif 1.1 and tested on SunOS 4.1. My build machine is running
> 2.4.18 linux kernel with Debian GNU/Linux distro (unstable branch),
> XFree86 4.3.0.dfsg.1-8 Xserve; I have the Open Motif 2.2.3-1 shared
> libraries installed as well as the Lesstif 1.2 development library and
> header
> files which contains static libraries and header files for libXm and
> libMrm. The code for the program, xnetrekm, can be downloaded here:
> 
> http://ftp.netrek.org/pub/netrek/clients/xnetrekm/xnetrekm1.1.tar.Z
> 
> It is a small download - only 35K.
> 
> Following the instructions in the README for COMPILING I edited the
> Imakefile and changed the following to be:
> 
> CC = /usr/bin/gcc
> XMINCLUDE = -I/usr/include/Xm
> XMLIB = -L/usr/lib -lXm
> 
> I then did: xmkmf
> 
> This resulted in a fatal error:
> 
> netrek:~/xnetrekm/build/xnetrekm1.1# xmkmf
> mv -f Makefile Makefile.bak
> imake -DUseInstalled -I/usr/X11R6/lib/X11/config
> In file included from /usr/X11R6/lib/X11/config/Imake.tmpl:1802,
> from Imakefile.c:33:
> Imakefile:32: arguments given to macro `DependTarget'
> imake: Exit code 1.
> Stop.
> 
> I looked at /usr/X11R6/lib/X11/config/Imake.tmpl but didn't know how
> to proceed to fix this. I've never used xmkmf or compiled Motif apps
> before :)
> 
> The lesstif docs say to use mxmkmf but this program was not included
> with the Debian lesstif-dev package. Will using lesstif solve this
> compile problem? If so what should I add to the Imakefile so that it
> uses lesstif.
> 
> If you could try the code and see if you can get it working I'd really
> appreciate it.
> 
> Regards,
> Zach
> [EMAIL PROTECTED]
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now. 
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Lesstif-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/lesstif-discuss
> 
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://up.to/danny.backx
*** Imakefile.orig	1993-07-29 19:00:34.000000000 +0200
--- Imakefile	2004-12-12 11:32:05.296487734 +0100
***************
*** 7,32 ****
   * Add str.c str.o if you don't have strdup or strstr. 
   */
  
-               CC = cc
-        XMINCLUDE = -I/usr/bs/motif-1.2/include
-            XMLIB = -L/usr/bs/motif-1.2/lib -lXm
- /* This might be needed for X11R4 */
- /*       XTOOLIB = -L/usr/bs/motif-1.2/lib -lXt */
- 
  /* CONFIG:
  /* -D_NO_PROTO  	-- needed for motif and non-ansi compilers */
  /* -DGATEWAY		-- for use with gateway */
  /* -DSYSV		-- sysv rather then bsd */
  /* -DXtPointer=char*	-- if your version of X doesn't have XtPointer */
  
-       EXTRA_DEFS = -D_NO_PROTO
-      CDEBUGFLAGS = -O $(EXTRA_DEFS)
-   EXTRA_INCLUDES = $(XMINCLUDE)
- 
  /* CONFIG: add str.c str.o if you don't have strdup or strstr */
  
!             SRCS = connect.c metaserver.c mesg.c popen.c strutil.c xnetrekm.c 
!             OBJS = connect.o metaserver.o mesg.o popen.o strutil.o xnetrekm.o
  
! NormalProgramTarget(xnetrekm,$(OBJS), ,$(XMLIB) $(XTOOLLIB) $(XLIB),)
! DependTarget($(SRCS))
--- 7,26 ----
   * Add str.c str.o if you don't have strdup or strstr. 
   */
  
  /* CONFIG:
  /* -D_NO_PROTO  	-- needed for motif and non-ansi compilers */
  /* -DGATEWAY		-- for use with gateway */
  /* -DSYSV		-- sysv rather then bsd */
  /* -DXtPointer=char*	-- if your version of X doesn't have XtPointer */
  
  /* CONFIG: add str.c str.o if you don't have strdup or strstr */
  
! SYS_LIBRARIES=	$(XMLIB) $(XTOOLLIB)
! 
! SRCS = connect.c metaserver.c mesg.c popen.c strutil.c xnetrekm.c 
! OBJS = connect.o metaserver.o mesg.o popen.o strutil.o xnetrekm.o
! 
! ComplexProgramTargetNoMan(xnetrekm)
  
! /* NormalProgramTarget(xnetrekm,$(OBJS), ,$(XMLIB) $(XTOOLLIB) $(XLIB),) */
! /* DependTarget($(SRCS)) */
*** mesg.c.orig	1993-07-29 19:00:35.000000000 +0200
--- mesg.c	2004-12-12 11:26:49.716614948 +0100
***************
*** 1,5 ****
  #include <stdio.h>
! #include <varargs.h>
  #include <sys/types.h>
  #include <X11/Intrinsic.h>
  #include <X11/Xos.h>
--- 1,5 ----
  #include <stdio.h>
! #include <stdarg.h>
  #include <sys/types.h>
  #include <X11/Intrinsic.h>
  #include <X11/Xos.h>
***************
*** 17,37 ****
  
  static void	_outputMessage();
  
! void 
! error(va_alist)
! 
!    int	va_alist;
  {
     va_list	ap;
-    char		*format;
     Widget	e = _globals.errorw;
     XmString	mess;
     int		i;
     Arg		args[2];
  
!    va_start(ap);
!    format = va_arg(ap, char *);
!    vsprintf(_message, format, ap);
     if(_message[499] != '\0'){
        fprintf(stderr, "%s: string constant length 500 overwritten.\n", 
  	 _globals.program);
--- 17,34 ----
  
  static void	_outputMessage();
  
! void error(char *fmt, ...)
  {
     va_list	ap;
     Widget	e = _globals.errorw;
     XmString	mess;
     int		i;
     Arg		args[2];
  
!    va_start(ap, fmt);
!    vsprintf(_message, fmt, ap);
!    va_end(ap);
! 
     if(_message[499] != '\0'){
        fprintf(stderr, "%s: string constant length 500 overwritten.\n", 
  	 _globals.program);
***************
*** 53,69 ****
   * Mostly borrowed from Dirk Grunwald's xtex
   */
  
! void 
! message(va_alist)
!    
!    int	va_alist;
  {
     va_list	ap;
-    char		*format;
  
!    va_start(ap);
!    format = va_arg(ap, char *);
!    vsprintf(_message, format, ap);
     if(_message[499] != '\0'){
        fprintf(stderr, "%s: string constant length 500 overwritten.\n", 
  	 _globals.program);
--- 50,63 ----
   * Mostly borrowed from Dirk Grunwald's xtex
   */
  
! void message(char *fmt, ...)
  {
     va_list	ap;
  
!    va_start(ap, fmt);
!    vsprintf(_message, fmt, ap);
!    va_end(ap);
! 
     if(_message[499] != '\0'){
        fprintf(stderr, "%s: string constant length 500 overwritten.\n", 
  	 _globals.program);
*** metaserver.c.orig	1993-07-29 19:00:35.000000000 +0200
--- metaserver.c	2004-12-12 11:15:25.537034619 +0100
***************
*** 2,8 ****
  #include <sys/types.h>
  #include <sys/time.h>
  #include <sys/socket.h>
! #include <sys/filio.h>
  #include <netinet/in.h>
  #include <arpa/inet.h>
  #include <netdb.h>
--- 2,8 ----
  #include <sys/types.h>
  #include <sys/time.h>
  #include <sys/socket.h>
! #include <sys/ioctl.h>
  #include <netinet/in.h>
  #include <arpa/inet.h>
  #include <netdb.h>
***************
*** 335,341 ****
     FILE	*f;
  {
     fclose(f);
!    shutdown(_sock);
  }
  
  static void 
--- 335,341 ----
     FILE	*f;
  {
     fclose(f);
!    shutdown(_sock, SHUT_RDWR);
  }
  
  static void 
*** xnetrekm.h.orig	1993-07-29 19:00:37.000000000 +0200
--- xnetrekm.h	2004-12-12 11:27:49.118695611 +0100
***************
*** 58,69 ****
     long		last_refresh;
  } Globals;
  
! extern char	*strdup();
  
  extern void 	starNetrek();			/* connect.c */
  extern char	*getNumeric();			/* connect.c */
! extern void	error();			/* mesg.c */
! extern void	message();			/* mesg.c */
  extern int	getServers();			/* metaserver.c */
  extern int	getResourceServerList();	/* metaserver.c */
  extern FILE	*myPopen();			/* popen.c */
--- 58,69 ----
     long		last_refresh;
  } Globals;
  
! /* extern char	*strdup(); */
  
  extern void 	starNetrek();			/* connect.c */
  extern char	*getNumeric();			/* connect.c */
! extern void error(char *fmt, ...);		/* mesg.c */
! extern void message(char *fmt, ...);		/* mesg.c */
  extern int	getServers();			/* metaserver.c */
  extern int	getResourceServerList();	/* metaserver.c */
  extern FILE	*myPopen();			/* popen.c */

Reply via email to