DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Porting NFB drivers from SCO OpenServer 5 to SVR5

Porting NFB drivers from SCO OpenServer 5 to SVR5

Porting an NFB X server driver from an SCO OpenServer 5 to a SVR5 environment is very simple. With only a few #ifdef statements, the same code can compile on both platforms. Starting from existing source, it usually takes less than one hour to get a package-installable driver running on a SVR5 system.


NOTE: When X Consortium code was modified for SCO OpenServer 5 systems, the directive #if defined(sco) was used to identify SCO-specific code. For SVR5, the directive #if defined(usl) selects code for the SVR5 X11R6 environment.

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:

  1. Create a directory tree for the ported driver using the xmkddx shell script as described in ``Set up the driver source tree and create a driver template''.

  2. Copy your SCO OpenServer 5 source code into the ./ports directory created by xmkddx.

  3. Make the following modifications (as necessary) to your driver source to allow it to compile without errors in the SVR5 X Link Kit environment. To ensure that it will continue to compile on SCO OpenServer 5 systems, surround the changes with #if defined(usl) as shown in these examples:

  4. The driver's Imakefile must be changed, protecting an SCO OpenServer 5 code passage with #ifdef statements and adding new code for SVR5 systems. In this example, xxx refers to your driver name.
       #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 */


© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005