From smedley!smedley.telex.mn.org!brian@kksys.mn.org Tue Nov  2 18:39:25 1993
Return-Path: <smedley!smedley.telex.mn.org!brian@kksys.mn.org>
Received: from eagle.is.lmsc.lockheed.com by rocket.sanders.lockheed.com (4.1/SMI-4.1)
	id AA12900; Tue, 2 Nov 93 18:39:20 EST
Received: by eagle.is.lmsc.lockheed.com (5.57/Ultrix3.0-C)
	id AA22948; Tue, 2 Nov 93 15:40:44 -0800
Received: from kksys.mn.org by uum1.mn.org with bsmtp
	(Smail3.1.28.1 #3) id m0ouUqb-0000wIC; Tue, 2 Nov 93 17:09 CST
Received: by kksys.mn.org (Smail3.1.28.1 #14)
	id m0ouUhh-0007jSC; Tue, 2 Nov 93 16:59 CST
Received: by smedley.telex.mn.org (4.0/SMI-4.1(CGCtelex.920727a))
	id AA06055; Tue, 2 Nov 93 17:06:23 CST
Date: Tue, 2 Nov 93 17:06:23 CST
From: Brian K. Teravskis <brian@smedley.telex.mn.org>
Message-Id: <9311022306.AA06055@smedley.telex.mn.org>
To: nation@rocket.sanders.lockheed.com
Subject: fvwm0.99 and sun3
Status: RO

Hi Rob:

I finally got fvwm to compile on a sun3 system running
SunOS 4.0.X. If you are interested here are the diffs
that I used on your 0.99 sources. I had to use the
GCC compiler as my attempts to get fvwm to compile
with cc were futile. It seems that Sun's standard
C initializes structures/variables different than
GCC does, so some of the X calls were messing up do
to improper values in the structures due to the
initialization. I'm sure given more time I could
eventually get it to work, but I found the GCC method
much quicker as you alluded earlier.


8<------------8<-------------8<--------------8<--------------8<
*** fvwm.h	Tue Oct 19 15:17:14 1993
--- ../fvwm.new/fvwm.h	Tue Nov  2 13:35:25 1993
***************
*** 208,214 ****
--- 208,217 ----
  #define DoesWmTakeFocus		16384
  #define DoesWmDeleteWindow	32768
  
+ #ifndef NOSTDHDRS
  #include <stdlib.h>
+ #endif
+ 
  extern void Reborder(void);
  extern void SigDone(int);
  extern void Done(int, char *);
*** configure.c	Sun Oct 24 12:53:55 1993
--- ../fvwm.new/configure.c	Tue Nov  2 13:36:36 1993
***************
*** 17,23 ****
--- 17,27 ----
  #include <signal.h>
  #include <string.h>
  #include <ctype.h>
+ 
+ #ifndef NOSTDHDRS
  #include <stdlib.h>
+ #endif
+ 
  #include <X11/Xos.h>
  #include <X11/Xproto.h>
  #include <X11/Xatom.h>
*** add_window.c	Sun Oct 24 08:25:33 1993
--- ../fvwm.new/add_window.c	Tue Nov  2 13:36:10 1993
***************
*** 39,45 ****
--- 39,49 ----
  
  #include <stdio.h>
  #include <string.h>
+ 
+ #ifndef NOSTDHDRS
  #include <stdlib.h>
+ #endif
+ 
  #include "fvwm.h"
  #include <X11/Xatom.h>
  #include "misc.h"
*** Imakefile	Sun Oct 24 09:00:54 1993
--- ../fvwm.new/Imakefile	Tue Nov  2 16:30:54 1993
***************
*** 6,11 ****
--- 6,12 ----
   * fvwm.1 must be renamed to fvwm.man
   */
   
+ CC = gcc
  /*
   * If you want the Shaped window extensions, uncomment this line
   * Shaped window extensions seem to increase the window managers RSS
***************
*** 64,71 ****
  /* If your libraries don't have sysconf(), uncomment this line  */
  /*EF3 = -DNO_SYSCONF*/
  
! EXTRAFLAGS = $(EF1) $(EF2) $(EF3) 
  
  CCOPTIONS = $(MORE_FLAGS) $(SHAPEFLAG) $(XPMFLAG) $(EXTRAFLAGS) $(OTHERFLAGS) -DFVWMRC=\"$(FVWMDIR)/system.fvwmrc\"
  
  DEPLIBS = $(DEPXLIB) 
--- 65,76 ----
  /* If your libraries don't have sysconf(), uncomment this line  */
  /*EF3 = -DNO_SYSCONF*/
  
! #If your libraries don't have strncasecmp() and/or strcasecmp(), uncomment this line
! /*EF4 = -DNO_STRNCASECMP -DNO_STRCASECMP*/
  
+ 
+ EXTRAFLAGS = $(EF1) $(EF2) $(EF3) $(EF4)
+ 
  CCOPTIONS = $(MORE_FLAGS) $(SHAPEFLAG) $(XPMFLAG) $(EXTRAFLAGS) $(OTHERFLAGS) -DFVWMRC=\"$(FVWMDIR)/system.fvwmrc\"
  
  DEPLIBS = $(DEPXLIB) 
***************
*** 76,85 ****
  
  
  SRCS = fvwm.c configure.c events.c borders.c menus.c functions.c resize.c\
!        add_window.c pager.c move.c icons.c windows.c
   
  OBJS = fvwm.o configure.o events.o borders.o menus.o functions.o resize.o\
!        add_window.o pager.o move.o icons.o windows.o
  
  ComplexProgramTarget(fvwm)
  InstallNonExecFile(system.fvwmrc,$(FVWMDIR))
--- 81,90 ----
  
  
  SRCS = fvwm.c configure.c events.c borders.c menus.c functions.c resize.c\
!        add_window.c pager.c move.c icons.c windows.c strings.c
   
  OBJS = fvwm.o configure.o events.o borders.o menus.o functions.o resize.o\
!        add_window.o pager.o move.o icons.o windows.o strings.o
  
  ComplexProgramTarget(fvwm)
  InstallNonExecFile(system.fvwmrc,$(FVWMDIR))
*** Makefile.noImake	Sun Oct 24 09:01:01 1993
--- ../fvwm.new/Makefile.noImake	Tue Nov  2 16:38:09 1993
***************
*** 66,84 ****
  #If your libraries don't have sysconf(), uncomment this line 
  #EF3 = -DNO_SYSCONF
  
! EXTRAFLAGS = $(EF1) $(EF2) $(EF3) 
  
  
  
  FFLAGS = $(MORE_FLAGS) $(SHAPEFLAG) $(XPMFLAG) $(EXTRAFLAGS) -DFVWMRC=\"$(INITDIR)/system.fvwmrc\"
  
  COPTS = -O2 -s 
  CFLAGS = $(COPTS) -I$(INCROOT) $(FFLAGS)
  
  SRCS = fvwm.c configure.c events.c borders.c menus.c functions.c resize.c \
!         add_window.c pager.c move.c icons.c windows.c
  OBJS = fvwm.o configure.o events.o borders.o menus.o functions.o resize.o \
! 	add_window.o pager.o move.o icons.o windows.o
  
  fvwm: $(OBJS)
  	$(CC) $(CFLAGS) -o fvwm $(OBJS) $(LIBS) 
--- 66,91 ----
  #If your libraries don't have sysconf(), uncomment this line 
  #EF3 = -DNO_SYSCONF
  
! #If your libraries don't have strncasecmp() and/or strcasecmp(), uncomment
! #or modify this line
! #EF4 = -DNO_STRNCASECMP -DNO_STRCASECMP
  
+ #If your include files don't have stdlib.h, uncomment this line
+ #EF5 = -DNOSTDHDRS
  
+ EXTRAFLAGS = $(EF1) $(EF2) $(EF3) $(EF4) $(EF5)
  
+ 
+ 
  FFLAGS = $(MORE_FLAGS) $(SHAPEFLAG) $(XPMFLAG) $(EXTRAFLAGS) -DFVWMRC=\"$(INITDIR)/system.fvwmrc\"
  
  COPTS = -O2 -s 
  CFLAGS = $(COPTS) -I$(INCROOT) $(FFLAGS)
  
  SRCS = fvwm.c configure.c events.c borders.c menus.c functions.c resize.c \
!         add_window.c pager.c move.c icons.c windows.c strings.c
  OBJS = fvwm.o configure.o events.o borders.o menus.o functions.o resize.o \
! 	add_window.o pager.o move.o icons.o windows.o strings.o
  
  fvwm: $(OBJS)
  	$(CC) $(CFLAGS) -o fvwm $(OBJS) $(LIBS) 
***************
*** 108,120 ****
  
  add_window.o: add_window.c fvwm.h screen.h misc.h menus.h
  events.o:     events.c     fvwm.h screen.h misc.h menus.h parse.h
! menus.o:      menus.c      fvwm.h screen.h misc.h menus.h parse.h 
  resize.o:     resize.c     fvwm.h screen.h misc.h menus.h
  fvwm.o:       fvwm.c       fvwm.h screen.h misc.h menus.h
  configure.o:  configure.c  fvwm.h screen.h misc.h menus.h
! functions.o:  functions.c  fvwm.h screen.h misc.h menus.h parse.h 
! move.o:       move.c       fvwm.h screen.h misc.h menus.h parse.h 
! borders.o:    borders.c    fvwm.h screen.h misc.h menus.h parse.h 
! pager.o:      pager.c      fvwm.h screen.h misc.h menus.h parse.h 
! icons.o:      icons.c      fvwm.h screen.h misc.h menus.h parse.h 
! windows.o:    windows.c    fvwm.h screen.h misc.h menus.h parse.h 
--- 115,127 ----
  
  add_window.o: add_window.c fvwm.h screen.h misc.h menus.h
  events.o:     events.c     fvwm.h screen.h misc.h menus.h parse.h
! menus.o:      menus.c      fvwm.h screen.h misc.h menus.h parse.h
  resize.o:     resize.c     fvwm.h screen.h misc.h menus.h
  fvwm.o:       fvwm.c       fvwm.h screen.h misc.h menus.h
  configure.o:  configure.c  fvwm.h screen.h misc.h menus.h
! functions.o:  functions.c  fvwm.h screen.h misc.h menus.h parse.h
! move.o:       move.c       fvwm.h screen.h misc.h menus.h parse.h
! borders.o:    borders.c    fvwm.h screen.h misc.h menus.h parse.h
! pager.o:      pager.c      fvwm.h screen.h misc.h menus.h parse.h
! icons.o:      icons.c      fvwm.h screen.h misc.h menus.h parse.h
! windows.o:    windows.c    fvwm.h screen.h misc.h menus.h parse.h
*** strings.c	Tue Nov  2 16:44:05 1993
--- ../fvwm.sun/strings.c	Tue Nov  2 16:25:27 1993
***************
*** 0 ****
--- 1,49 ----
+ #include <ctype.h>
+ 
+ #define MATCH 0
+ #define NO_MATCH 1
+ 
+ #ifdef NO_STRCASECMP
+ int
+ strcasecmp(char *s1, char *s2)
+ {
+     char c1, c2;
+ 
+     while (*s1 && *s2) 
+ 	{
+ 		c1 = isupper(*s1) ? tolower(*s1) : *s1;
+ 		c2 = isupper(*s2) ? tolower(*s2) : *s2;
+ 		if (c1 != c2)
+ 	    	return (NO_MATCH);
+ 		++s1;
+ 		++s2;
+     }
+     if (*s1 || *s2)
+ 		return (NO_MATCH);
+     return (MATCH);
+ }
+ #endif
+ 
+ #ifdef NO_STRNCASECMP
+ int
+ strncasecmp(char *s1, char *s2, int n)
+ {
+     char c1, c2;
+ 	int	m = 0;
+ 
+     while ((*s1 && *s2) && (m < n)) 
+ 	{
+ 		c1 = isupper(*s1) ? tolower(*s1) : *s1;
+ 		c2 = isupper(*s2) ? tolower(*s2) : *s2;
+ 		if (c1 != c2)
+ 	    	return (NO_MATCH);
+ 		++s1;
+ 		++s2;
+ 		++m;
+     }
+     if ((*s1 || *s2) && (m < n))
+ 		return (NO_MATCH);
+     return (MATCH);
+ }
+ #endif
+ 

8<------------8<-------------8<--------------8<--------------8<

You can do with this as you please. I'm keeping the file
just so I know what I did to get it to work. I compiled
all the options with no problems, although I did not try
the binaries with all the options.
