|
|
In almost all cases, SCO-specific code from SCO OpenServer 5 continues to apply in the SVR5 environment. Some X11R6 code in the SVR5 environment may continue to contain #if defined(sco) statements; this code is valid and is included for compiles on SVR5. Therefore, #if defined(sco) is valid for both SCO OpenServer 5 and SVR5, while #if defined(usl) is specifically for SVR5 and is excluded in the SCO OpenServer 5 environment.
To port your SCO OpenServer 5 NFB X server driver to SVR5:
#include "servermd.h" #include "misprite.h" #include "mipointer.h"They must be modified on SVR5 systems:
#include "servermd.h" #if defined(usl) #include "mi.h" #endif #include "mipointer.h" #include "misprite.h"
#if ! defined(usl) ioctl(1, SW_VGA12, 0); #endif
#if defined(usl) #include <sys/types.h> #include <sys/kd.h> #else #include <sys/console.h> #endif
#if defined(usl) #define VOLATILE volatile #endif
#if defined(usl) #include <sys/types.h> #include <sys/inline.h> #else #include "compiler.h" #endif
#define PCI_DEV "/dev/pci" #include <sys/pci.h>If you have done so, modify the code for SVR5 systems:
#if defined(usl) #define PCI_DEV "/dev/X/pci" #include <pcix.h> #else #define PCI_DEV "/dev/pci" #include <sys/pci.h> #endifThe ioctl access to this PCI device remains the same on SVR5 systems.
#if defined(USLArchitecture)STD_DEFINES = ServerDefines XDriverDefines -DVOLATILE=volatile INCLUDES = -I. -I../.. -I$(SERVERSRC)/include \ -I$(SERVERSRC)/hw/sco/include \ -I$(SERVERSRC)/hw/sco -I$(SERVERSRC)/hw/sco/nfb \ -I$(SERVERSRC)/hw/sco/ports/gen -I$(INCLUDESRC) \ -I$(SERVERSRC)/mi -I$(SERVERSRC) -I$(FONTINCSRC) LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/4.2bsd/llib-los.ln \ $(SERVERSRC)/ddx/mfb/llib-lmfb.ln $(SERVERSRC)/ddx/mi/llib-lmi.ln DDXLIBS = libxxx.a
all:: LibMkdir(shared)
clean:: LibCleanDir(shared)
.c.o: LibObjCompile(shared,-Kpic $(CDEBUGFLAGS)) NormalLibObjCompile($(NOOP_))
#ifndef SCP_PRODUCT NormalLibraryTarget(xxx,$(OBJS)) SharedXDriverTarget(xxx,6.0,$(OBJS),shared,..) #endif LintLibraryTarget(xxx,$(SRCS)) NormalLintTarget($(SRCS)) DynamicObjectRuleSCP(xxx,libxxx.a,xxxInit.c)
#else /* USLArchitecture */
STD_DEFINES = ServerDefines INCLUDES = -I. -I$(SERVERSRC)/sys/common -I$(SERVERSRC)/ddx \ -I$(SERVERSRC)/ddx/ports -I$(SERVERSRC)/include -I$(FONTSRC)/include \ -I$(INCLUDESRC)
LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/4.2bsd/llib-los.ln \ $(SERVERSRC)/ddx/mfb/llib-lmfb.ln $(SERVERSRC)/ddx/mi/llib-lmi.ln
... for about 42 lines, ending:
#endif /* DebugServer */
NormalLibraryTarget(xxx,$(OBJS)) LintLibraryTarget(xxx,$(SRCS))
NormalLintTarget($(SRCS))
DynamicObjectRule(xxx,$(DDXLIBS))
#endif /* USLArchitecture */