Index: config/cf/Imake.cf =================================================================== RCS file: /cvs/xorg/xc/config/cf/Imake.cf,v retrieving revision 1.11 diff -u -3 -p -u -r1.11 Imake.cf --- config/cf/Imake.cf 3 Oct 2005 16:08:44 -0000 1.11 +++ config/cf/Imake.cf 7 Nov 2005 06:01:03 -0000 @@ -384,9 +384,10 @@ XCOMM $XFree86: xc/config/cf/Imake.cf,v # define HPArchitecture #endif /* hpux */ -#ifdef sco +#ifdef __SCO__ # define MacroIncludeFile # define MacroFile sco5.cf +# undef __SCO__ # undef sco # undef USL # undef SYSV @@ -418,18 +419,41 @@ XCOMM $XFree86: xc/config/cf/Imake.cf,v # undef __pentium # undef pentiumpro # undef __pentiumpro -#endif /* sco - SCO Open Server 5 */ +#endif /* __SCO__ - SCO Open Server 5 */ -#ifdef USL +#ifdef __UNIXWARE__ # define MacroIncludeFile # define MacroFile usl.cf +# undef __UNIXWARE__ # undef USL # undef SVR4 # undef i386 +# undef SVR5 +# undef SYSV5 # define SVR4Architecture # define i386Architecture # define USLArchitecture -#endif /* USL */ +# define UnixWareArchitecture +# undef i386 +# undef i486 +# undef i586 +# undef i686 +# undef k6 +# undef __i386__ +# undef __i486__ +# undef __i586__ +# undef __i686__ +# undef __k6__ +# undef __i386 +# undef __i486 +# undef __i586 +# undef __i686 +# undef __k6 +# undef pentium +# undef __pentium +# undef pentiumpro +# undef __pentiumpro +#endif /* __UNIXWARE__ */ #ifdef NCR # define MacroIncludeFile Index: config/cf/Imake.rules =================================================================== RCS file: /cvs/xorg/xc/config/cf/Imake.rules,v retrieving revision 1.10 diff -u -3 -p -u -r1.10 Imake.rules --- config/cf/Imake.rules 18 Aug 2005 22:38:58 -0000 1.10 +++ config/cf/Imake.rules 7 Nov 2005 06:01:04 -0000 @@ -2404,16 +2404,16 @@ clean:: @@\ #endif #ifndef AssembleObject -#define AssembleObject(flags) CPPOnlyAsm($*,flags) @@\ - RemoveFile($*.o) @@\ - $(AS) -o $*.o $*.i @@\ - RemoveFile($*.i) +#define AssembleObject(basename,flags) CPPOnlyAsm(basename,flags) @@\ + RemoveFile(basename.o) @@\ + $(AS) -o basename.o basename.i @@\ + RemoveFile(basename.i) #endif #ifndef NormalAsmObjectRule #define NormalAsmObjectRule() @@\ .S.o: @@\ - AssembleObject($(_NOOP_)) @@\ + AssembleObject($*,$(_NOOP_)) @@\ @@\ .S.i: @@\ CPPOnlyAsm($*,$(_NOOP_)) @@ -2426,7 +2426,7 @@ dst.S: src.S @@\ $(LN) $? $@ @@\ @@\ dst.o: dst.S @@\ - AssembleObject(flags) @@\ + AssembleObject(dst,flags) @@\ @@\ dst.i: dst.S @@\ CPPOnlyAsm(dst,flags) @@\ @@ -2441,7 +2441,7 @@ clean:: @@\ #define ObjectFromAsmSource(src,flags) @@\ @@\ src.o: src.S @@\ - AssembleObject(flags) @@\ + AssembleObject(src,flags) @@\ @@\ src.i: src.S @@\ CPPOnlyAsm(src,flags) @@\ Index: config/cf/Imake.tmpl =================================================================== RCS file: /cvs/xorg/xc/config/cf/Imake.tmpl,v retrieving revision 1.15 diff -u -3 -p -u -r1.15 Imake.tmpl --- config/cf/Imake.tmpl 14 Oct 2005 02:07:56 -0000 1.15 +++ config/cf/Imake.tmpl 7 Nov 2005 06:01:04 -0000 @@ -1965,7 +1965,7 @@ MODLDCOMBINEFLAGS = ModuleLdCombineFlags SHLIBLDFLAGS = SharedLibraryLoadFlags $(SHLIBGLOBALSFLAGS) #if HasGcc NOSTDLIB = -nostdlib - POSTNOSTDLIB = -Bstatic -lgcc + POSTNOSTDLIB = -Wl,-Bstatic -lgcc -Wl,-Bdynamic #elif HasIntelC NOSTDLIB = -nostdlib POSTNOSTDLIB = Index: config/cf/QNX4.rules =================================================================== RCS file: /cvs/xorg/xc/config/cf/QNX4.rules,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 QNX4.rules --- config/cf/QNX4.rules 23 Apr 2004 18:41:58 -0000 1.2 +++ config/cf/QNX4.rules 7 Nov 2005 06:01:04 -0000 @@ -36,7 +36,7 @@ dst.S: src.S @@\ $(CP) $? $@ @@\ @@\ dst.o: dst.S @@\ - AssembleObject(flags) @@\ + AssembleObject(dst,flags) @@\ @@\ dst.i: dst.S @@\ CPPOnlyAsm(dst,flags) @@\ Index: config/cf/minix.cf =================================================================== RCS file: /cvs/xorg/xc/config/cf/minix.cf,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 minix.cf --- config/cf/minix.cf 23 Apr 2004 18:41:58 -0000 1.2 +++ config/cf/minix.cf 7 Nov 2005 06:01:04 -0000 @@ -54,11 +54,11 @@ XCOMM platform: $XFree86: xc/config/cf/ #define HasPutenv YES /* for xsm */ #ifndef AssembleObject -#define AssembleObject(flags) $(RM) $@ @@\ - $(CPP) AsmDefines $(DEFINES) $(INCLUDES) flags $*.S | \ @@\ - grep -v '^\#' > $*.i.s @@\ - $(AS) -o $*.o $*.i.s @@\ - $(RM) $*.i.s +#define AssembleObject(basename,flags) $(RM) $@ @@\ + $(CPP) AsmDefines $(DEFINES) $(INCLUDES) flags basename.S | \ @@\ + grep -v '^\#' > basename.i.s @@\ + $(AS) -o $*.o basename.i.s @@\ + $(RM) basename.i.s #endif #include Index: config/cf/nto.rules =================================================================== RCS file: /cvs/xorg/xc/config/cf/nto.rules,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 nto.rules --- config/cf/nto.rules 23 Apr 2004 18:41:58 -0000 1.2 +++ config/cf/nto.rules 7 Nov 2005 06:01:04 -0000 @@ -59,7 +59,7 @@ dst.S: src.S @@\ $(CP) $? $@ @@\ @@\ dst.o: dst.S @@\ - AssembleObject(flags) @@\ + AssembleObject(dst,flags) @@\ @@\ dst.i: dst.S @@\ CPPOnlyAsm(dst,flags) @@\ Index: config/cf/sco5.cf =================================================================== RCS file: /cvs/xorg/xc/config/cf/sco5.cf,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 sco5.cf --- config/cf/sco5.cf 19 May 2005 18:53:42 -0000 1.6 +++ config/cf/sco5.cf 7 Nov 2005 06:01:04 -0000 @@ -14,19 +14,19 @@ XCOMM $XdotOrg: xc/config/cf/sco5.cf,v 1 */ #ifndef OSName -#define OSName UNIX System V/386 Open Server Release 5 +#define OSName UNIX System V/386 Open Server Release 5 #endif #ifndef OSVendor -#define OSVendor SCO-Group +#define OSVendor SCO-Group #endif #ifndef OSMajorVersion -#define OSMajorVersion 5 +#define OSMajorVersion 5 #endif #ifndef OSMinorVersion -#define OSMinorVersion 0 +#define OSMinorVersion 0 #endif #ifndef OSTeenyVersion -#define OSTeenyVersion 7 +#define OSTeenyVersion 7 #endif /* @@ -38,20 +38,22 @@ XCOMM $XdotOrg: xc/config/cf/sco5.cf,v 1 * Note 2: We also define _SVID3, as this seems to enable more Streams * based options which are closer to the "desired" state for X11. A by- * product of this is that we get better signals too. - * - * Note 3: We fool Xfree into thinking we have NCURSES. Thats becuase the - * system curses is close enough for Xfree86's purposes. Actually xf86cfg - * is poorly constructed, it should not depend on the NCURSES package but - * rather on a "capable curses", of which NCURSES is just one. */ -#if 1 #ifndef HasGcc2 # define HasGcc2 YES #endif +#ifndef HasGcc3 +# define HasGcc3 NO +#endif #ifndef HasGcc2ForCplusplus # define HasGcc2ForCplusplus YES #endif + +#ifndef HasGcc +# if HasGcc2 || HasGcc3 +# define HasGcc YES +# endif #endif /* @@ -63,139 +65,252 @@ XCOMM $XdotOrg: xc/config/cf/sco5.cf,v 1 * safe at least with regards to things like errno and various _r functions. */ #ifndef LibraryCCOptions -# define LibraryCCOptions -D_REENTRANT +# define LibraryCCOptions -D_REENTRANT -DFD_SETSIZE=11000 -D_NO_STATIC -DMAXPATHLEN=1024 #endif - -#define StandardDefines -Dsco -DSCO -DSCO5 -DSYSV -Di386 -DSCO325 -DFD_SETSIZE=256 -D_NO_STATIC -DMAXPATHLEN=1024 -#ifdef HasGcc2 -# define DefaultCCOptions GccWarningOptions -# define CcCmd gcc -# define DefaultCDebugFlags -O6 -fomit-frame-pointer -march=i586 -mcpu=i686 -# define OptimizedCDebugFlags -O6 -fomit-frame-pointer -march=i586 -mcpu=i686 + +#ifndef UseExportLists +# define UseExportLists YES +#endif + +#define StandardDefines -DSYSV -Di386 -DSCO325 -D__SCO__ +#if HasGcc +# define DefaultCCOptions GccWarningOptions +# ifndef CcCmd +# define CcCmd gcc +# endif +# ifndef DefaultCDebugFlags +# define DefaultCDebugFlags -O6 -fomit-frame-pointer -march=i586 -mcpu=i586 +# endif +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags -O6 -fomit-frame-pointer -march=i586 -mcpu=i586 +# endif #else +# ifndef CcCmd +# define CcCmd cc -belf +# endif # define DefaultCCOptions -dy -# define CcCmd cc -belf -# define DefaultCDebugFlags -O2 -# define OptimizedCDebugFlags -O2 +# ifndef DefaultCDebugFlags +# define DefaultCDebugFlags -O2 +# endif +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags -O2 +# endif #endif -#define HasNCurses YES -#define NCursesLibName -lcurses +#define BuildLibPathVar LD_LIBRARY_PATH -#ifndef UseDeprecatedKeyboardDriver -#define UseDeprecatedKeyboardDriver YES +#ifndef HasNCurses +# define HasNCurses YES +#endif +#ifndef NCursesLibName +# define NCursesLibName -lcurses +#endif +#ifndef TermcapLibrary +# define TermcapLibrary -lcurses #endif -#define LogDirectory /var/adm +#ifndef BuildXterm +# define BuildXterm BuildClients +#endif -#ifndef HasSymLinks -# define HasSymLinks YES +#ifndef UseDeprecatedKeyboardDriver +#define UseDeprecatedKeyboardDriver NO +#endif + +#ifndef SCOHasGWXLIBS +# define SCOHasGWXLIBS YES +#endif + +#ifndef LogDirectory +# define LogDirectory /var/adm #endif #ifndef DoLoadableServer # define DoLoadableServer YES #endif -#ifdef BuildDynamicLoading -# define SCODynamicFlags -Wl,-Bexport +#if DoLoadableServer +# if HasGcc +# define SCODynamicFlags -rdynamic +# else +# define SCODynamicFlags -Wl,-Bexport +# endif #else # define SCODynamicFlags /**/ #endif -#define AsmDefines -D__ELF__ -D__PIC__ -#define XawI18nDefines -DHAS_WCHAR_H -DHAS_WCTYPE_H -DHAS_ISW_FUNCS -#define ServerExtraSysLibs $(CBRT) -lm -levent SCODynamicFlags -#define ExtraLibraries -lsocket -#define NeedWidePrototypes NO -#define ServerOSDefines -DDDXTIME XFree86ServerOSDefines +#ifndef BuildFreetypeDlModule +# define BuildFreetypeDlModule NO +#endif + +#ifndef AsmDefines +# define AsmDefines -D__ELF__ -D__PIC__ +#endif + +#ifndef XawI18nDefines +# define XawI18nDefines -DHAS_WCHAR_H -DHAS_WCTYPE_H -DHAS_ISW_FUNCS +#endif + +#ifndef ServerExtraSysLibs +# define ServerExtraSysLibs $(CBRT) -lm SCODynamicFlags +#endif + +#ifndef ExtraLibraries +# define ExtraLibraries -lsocket +#endif + +#ifndef NeedWidePrototypes +# define NeedWidePrototypes YES +#endif + +#define SCOBuildFlags -DFD_SETSIZE=11000 -DMAXPATHLEN=1024 -DPATH_MAX=1024 + +#define ServerExtraDefines -D_REENTRANT SCOBuildFlags -DDDXTIME XFree86ServerDefines + +#ifndef ThreadedX +# define ThreadedX NO +#endif + +#ifndef HasThreadSafeAPI +# define HasThreadSafeAPI NO +#endif + +#define HasNdbm YES +#define HasVFork YES +#define HasPutenv YES +#define HasSnprintf YES #define ToolkitStringsABIOptions -intelabi -#define ThreadedX NO -#define HasThreadSafeAPI NO -#define HasNdbm YES -#define HasVFork YES -#define HasPutenv YES -#define HasSnprintf YES #define HasSetenv NO #define HasMkstemp YES -#define ExecableScripts YES +#define ExecableScripts YES #define HasShadowPasswd YES -#define ManSourcePath $(MANPATH)/man -#define Malloc0ReturnsNull YES -#define RemoveDSDENroffMacros NO -#define CompressManPages NO -#ifndef HasLibCrypt -# define HasLibCrypt YES -# define SpecialLibCrypt -lcrypt +#define HasSymLinks YES +#define HasDlopen YES +#define HasShm YES +#define HasStrcasecmp YES +#define HasLdRunPath YES +#define HasPoll YES + +#ifndef HasGnuMake +# define HasGnuMake YES #endif -#define PosixLibraries /**/ -#ifndef ForceNormalLib -# define ForceNormalLib NO +#if SCOHasGWXLIBS +# define HasExpat YES +# define HasFreetype2 YES +# define HasLibpng YES +# define HasZlib YES +# define HasFontconfig YES #endif -#define HasExpat YES -#define HasFreetype2 YES -#define HasLibpng YES +#define InstallHardcopyDocs NO + #define HasPerl YES #define HasPerl5 YES -#define HasDlopen YES -#define HasShm YES -#define HasStrcasecmp YES -#define HasZlib YES -#define HasFontconfig YES -#define SharedLibXmu YES -#define SystemV YES -#define LdCombineFlags -r +#ifndef ManSourcePath +# define ManSourcePath $(MANPATH)/man +#endif + +#define Malloc0ReturnsNull YES +#define RemoveDSDENroffMacros NO + +#ifndef CompressManPages +# define CompressManPages NO +#endif + +#ifndef HasLibCrypt +# define HasLibCrypt YES +# define SpecialLibCrypt -lcrypt +#endif + +#ifndef PosixLibraries +# define PosixLibraries /**/ +#endif + +#ifndef ForceNormalLib +# define ForceNormalLib NO +#endif + +#define SharedLibXmu YES +#define SystemV YES +#define LdCombineFlags -r #define AvoidNullMakeCommand YES -#define HasLdRunPath YES -#define HasPoll YES #define PatheticCpp YES -#define HasGnuMake YES - #define MesaUseX86Asm NO #define MakeNamedTargetSubdir(dir,flags,subname)\ $(MAKE) -C dir $(MFLAGS) $(PARALLELMFLAGS) flags subname -#define ArCmdBase ar -#define AsCmd CcCmd -#define CppCmd /lib/cpp -#define PreProcessCmd CppCmd -#define RawCppCmd CppCmd +#define ArCmdBase ar + +#ifndef AsCmd +# define AsCmd CcCmd +#endif + +#ifndef CppCmd +# define CppCmd /lib/cpp +#endif + +#ifndef PreProcessCmd +# define PreProcessCmd CppCmd +#endif + +#ifndef RawCppCmd +# define RawCppCmd CppCmd +#endif + +#ifndef LdCmd +# define LdCmd CcCmd +#endif #ifdef HasGcc2 -# define LdCmd CcCmd # ifndef SharedLibraryLoadFlags # define SharedLibraryLoadFlags -shared # endif # undef LdCombineFlags # define LdCombineFlags -nostdlib -r -#else -# define LdCmd /usr/ccs/bin/elf/ld #endif -#define LexCmd /usr/gnu/bin/flex -#define MakeCmd /usr/gnu/bin/gmake -#define YaccCmd /usr/gnu/bin/bison -y -#define InstallCmd /usr/gnu/bin/ginstall +#ifndef LexCmd +# define LexCmd /usr/gnu/bin/flex +#endif + +#ifndef MakeCmd +# define MakeCmd /usr/gnu/bin/gmake +#endif + +#ifndef YaccCmd +# define YaccCmd /usr/gnu/bin/bison -y +#endif +#ifndef InstallCmd +# define InstallCmd /usr/gnu/bin/ginstall +#endif #ifndef UseSeparateConfDir -#define UseSeparateConfDir NO +# define UseSeparateConfDir NO #endif #ifndef BuildHtmlManPages -#define BuildHtmlManPages NO +# define BuildHtmlManPages NO +#endif + +#ifndef DefaultUserPath +# define DefaultUserPath /bin:/usr/bin:$(BINDIR):/usr/bin/X11:/usr/gnu/bin:/usr/local/bin:/etc +#endif + +#ifndef DefaultSystemPath +# define DefaultSystemPath /etc:/bin:/usr/bin:$(BINDIR):/usr/bin/X11 #endif -#define DefaultUserPath /bin:/usr/bin:$(BINDIR):/usr/bin/X11:/usr/gnu/bin:/usr/local/bin:/etc -#define DefaultSystemPath /etc:/bin:/usr/bin:$(BINDIR):/usr/bin/X11 +#define ConnectionFlags -DLOCALCONN -DTCPCONN -DUNIXCONN -#define ConnectionFlags -DLOCALCONN -DTCPCONN -DUNIXCONN +#define ExportListGenSource elistgen.usl +#define ShlibExportListOpt(filename) Concat(-Bexport:,filename) /* * These settings control the interdependence of the shared libraries. @@ -211,47 +326,47 @@ XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLI #define XawClientLibs $(XAWLIB) $(XMULIBONLY) $(XTOOLLIB) $(XPMLIB) $(EXTRAXAWCLIENTLIBS) $(XLIB) #endif -#define SharedXlibi18nReqs $(LDPRELIB) $(XLIBONLY) +#define SharedXlibi18nReqs $(LDPRELIB) $(XLIBONLY) -#define SharedXfontReqs $(LDPRELIB) $(FONTSTUBLIB) GzipLibrary $(FREETYPE2LIB) $(XLIB) -#define SharedFontencReqs $(LDPRELIB) GzipLibrary -#define SharedGLReqs $(LDPRELIB) $(XLIB) -#define SharedGLUReqs $(LDPRELIB) $(XLIB) $(GLXLIB) -#define SharedOSMesaReqs $(LDPRELIB) $(XLIB) $(GLXLIB) -#define SharedSMReqs $(LDPRELIB) $(ICELIB) -#define SharedX11Reqs $(LDPRELIB) -lsocket -#define SharedXawReqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(EXTRAXAWREQS) $(XLIB) -#define SharedXaw7Reqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(XLIB) -#define SharedXaw6Reqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XLIB) -#define SharedXcursorReqs $(LDPRELIB) $(XRENDERLIB) $(XLIB) -#define SharedXextReqs $(LDPRELIB) $(XONLYLIB) -#define SharedXiReqs $(LDPRELIB) $(XLIB) -#define SharedXmuReqs $(LDPRELIB) $(XTOOLLIB) $(XLIB) -#define SharedXmuuReqs $(LDPRELIB) $(XONLYLIB) -#define SharedXpReqs $(LDPRELIB) $(XLIB) -#define SharedXpmReqs $(LDPRELIB) $(XLIB) -#define SharedXrandrReqs $(LDPRELIB) $(XRENDERLIB) $(XLIB) -#define SharedXrenderReqs $(LDPRELIB) $(XLIB) -#define SharedXtReqs $(LDPRELIB) $(XONLYLIB) $(SMLIB) $(ICELIB) -#define SharedXtstReqs $(LDPRELIB) $(XLIB) -#define SharedXvReqs $(LDPRELIB) $(XLIB) -#define SharedDPSReqs $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(XLIB) -#define SharedDPSTKReqs $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(DPSLIB) $(XLIB) -#define SharedOldXReqs $(LDPRELIB) $(XONLYLIB) -#define SharedpsresReqs $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(XLIB) -#define SharedXResReqs $(LDPRELIB) $(XLIB) -#define SharedXfontcacheReqs $(LDPRELIB) $(XLIB) -#define SharedXineramaReqs $(LDPRELIB) $(XLIB) -#define SharedXssReqs $(LDPRELIB) $(XLIB) -#define SharedXvMCReqs $(LDPRELIB) $(XLIB) -#define SharedXxf86miscReqs $(LDPRELIB) $(XLIB) -#define SharedXxf86vmReqs $(LDPRELIB) $(XLIB) -#define SharedxkbfileReqs $(LDPRELIB) $(XONLYLIB) -#define SharedxkbuiReqs $(LDPRELIB) $(XKBFILELIB) $(XONLYLIB) -#define SharedXReqs $(XTOOLLIB) $(XPLIB) $(XLIB) -#define SharedXmReqs $(LDPRELIB) SharedXReqs -#define SharedMrmReqs $(LDPRELIB) $(XMLIB) SharedXReqs -#define SharedUilReqs $(LDPRELIB) $(XMLIB) SharedXReqs +#define SharedXfontReqs $(LDPRELIB) $(FONTSTUBLIB) GzipLibrary $(FREETYPE2LIB) $(XLIB) +#define SharedFontencReqs $(LDPRELIB) GzipLibrary +#define SharedGLReqs $(LDPRELIB) $(XLIB) +#define SharedGLUReqs $(LDPRELIB) $(XLIB) $(GLXLIB) +#define SharedOSMesaReqs $(LDPRELIB) $(XLIB) $(GLXLIB) +#define SharedSMReqs $(LDPRELIB) $(ICELIB) +#define SharedX11Reqs $(LDPRELIB) -lsocket +#define SharedXawReqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(EXTRAXAWREQS) $(XLIB) +#define SharedXaw7Reqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(XLIB) +#define SharedXaw6Reqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XLIB) +#define SharedXcursorReqs $(LDPRELIB) $(XRENDERLIB) $(XLIB) +#define SharedXextReqs $(LDPRELIB) $(XONLYLIB) +#define SharedXiReqs $(LDPRELIB) $(XLIB) +#define SharedXmuReqs $(LDPRELIB) $(XTOOLLIB) $(XLIB) +#define SharedXmuuReqs $(LDPRELIB) $(XONLYLIB) +#define SharedXpReqs $(LDPRELIB) $(XLIB) +#define SharedXpmReqs $(LDPRELIB) $(XLIB) +#define SharedXrandrReqs $(LDPRELIB) $(XRENDERLIB) $(XLIB) +#define SharedXrenderReqs $(LDPRELIB) $(XLIB) +#define SharedXtReqs $(LDPRELIB) $(XONLYLIB) $(SMLIB) $(ICELIB) +#define SharedXtstReqs $(LDPRELIB) $(XLIB) +#define SharedXvReqs $(LDPRELIB) $(XLIB) +#define SharedDPSReqs $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(XLIB) +#define SharedDPSTKReqs $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(DPSLIB) $(XLIB) +#define SharedOldXReqs $(LDPRELIB) $(XONLYLIB) +#define SharedpsresReqs $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(XLIB) +#define SharedXResReqs $(LDPRELIB) $(XLIB) +#define SharedXfontcacheReqs $(LDPRELIB) $(XLIB) +#define SharedXineramaReqs $(LDPRELIB) $(XLIB) +#define SharedXssReqs $(LDPRELIB) $(XLIB) +#define SharedXvMCReqs $(LDPRELIB) $(XLIB) +#define SharedXxf86miscReqs $(LDPRELIB) $(XLIB) +#define SharedXxf86vmReqs $(LDPRELIB) $(XLIB) +#define SharedxkbfileReqs $(LDPRELIB) $(XONLYLIB) +#define SharedxkbuiReqs $(LDPRELIB) $(XKBFILELIB) $(XONLYLIB) +#define SharedXReqs $(XTOOLLIB) $(XPLIB) $(XLIB) +#define SharedXmReqs $(LDPRELIB) SharedXReqs +#define SharedMrmReqs $(LDPRELIB) $(XMLIB) SharedXReqs +#define SharedUilReqs $(LDPRELIB) $(XMLIB) SharedXReqs #define ObjectFromAsmSource(src,flags) @@\ @@\ @@ -259,7 +374,7 @@ src.o: src.S @@\ RemoveFile(src.o) @@\ $(CC) -c AsmDefines $(DEFINES) $(INCLUDES) flags src.S -#include /* minor changes to sv4Lib.rules */ +#include /* minor changes to sv4Lib.rules */ #include #include Index: config/cf/scoLib.rules =================================================================== RCS file: /cvs/xorg/xc/config/cf/scoLib.rules,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 scoLib.rules --- config/cf/scoLib.rules 23 Apr 2004 18:41:58 -0000 1.2 +++ config/cf/scoLib.rules 7 Nov 2005 06:01:04 -0000 @@ -3,11 +3,7 @@ XCOMM $Xorg: scoLib.rules,v 1.3 2000/08/ XCOMM $XFree86: xc/config/cf/scoLib.rules,v 1.10 2003/12/18 16:38:34 dawes Exp $ #ifndef UseExportLists -# define UseExportLists NO -#endif - -#ifndef ExtraLoadFlags -#define ExtraLoadFlags -R $(USRLIBDIRPATH) +# define UseExportLists YES #endif #ifndef SCOAbsShlibPath @@ -17,7 +13,10 @@ XCOMM $XFree86: xc/config/cf/scoLib.rule #if SCOAbsShlibPath # define SCOShlibFlags -h $(SHLIBDIR)/$@ #else -# define SCOShlibFlags -R $(DESTDIR)$(SHLIBDIR) -h $@ +# ifndef ExtraLoadFlags +# define ExtraLoadFlags -R $(USRLIBDIRPATH) +# endif +# define SCOShlibFlags -R $(SHLIBDIR) -h $@ #endif /* Index: config/cf/usl.cf =================================================================== RCS file: /cvs/xorg/xc/config/cf/usl.cf,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 usl.cf --- config/cf/usl.cf 23 Apr 2004 18:41:59 -0000 1.2 +++ config/cf/usl.cf 7 Nov 2005 06:01:04 -0000 @@ -22,21 +22,83 @@ XCOMM operating system: OSName (OSMajorV #ifndef CcCmd # define CcCmd /usr/ccs/bin/cc #endif -#ifndef CplusplusCmd -# define CplusplusCmd /usr/ccs/bin/CC +#ifndef LexCmd +# define LexCmd /usr/ccs/bin/lex #endif -#ifndef CplusplusFilt -# define CplusplusFilt /usr/ccs/bin/c++filt +#ifndef YaccCmd +# define YaccCmd /usr/ccs/bin/yacc #endif -#ifndef CplusplusDependIncludes -# define CplusplusDependIncludes -I/usr/include/CC +#ifndef MakeCmd +# define MakeCmd /usr/gnu/bin/gmake +#endif + +#ifndef HasGcc2ForCplusplus +# ifndef CplusplusCmd +# define CplusplusCmd /usr/ccs/bin/CC +# endif +# ifndef CplusplusFilt +# define CplusplusFilt /usr/ccs/bin/c++filt +# endif +# ifndef CplusplusDependIncludes +# define CplusplusDependIncludes -I/usr/include/CC +# endif +#else +# ifndef CplusplusCmd +# define CplusplusCmd /usr/gnu/bin/g++ +# endif +# ifndef CplusplusFilt +# define CplusplusFilt /usr/gnu/bin/c++filt +# endif +#endif + +#ifndef LibraryCCOptions +# define LibraryCCOptions -D_REENTRANT -DFD_SETSIZE=16384 #endif #define BootstrapCFlags /* none needed */ -#define StandardDefines -DUSL -DSVR4 -Di386 -#define NeedWidePrototypes NO /* experimental */ -#define ServerExtraDefines -D__USLC__ XFree86ServerDefines -#define ServerOSDefines -DDDXTIME XFree86ServerOSDefines +#define StandardDefines -DSVR4 -DSVR5 -Di386 -D__UNIXWARE__ +#define NeedWidePrototypes YES + +#ifdef HasGcc2 +# define DefaultCCOptions GccWarningOptions +# ifndef CcCmd +# define CcCmd /usr/gnu/bin/gcc +# endif +# define DefaultCDebugFlags -O6 -fomit-frame-pointer -march=i586 -mcpu=i586 +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags -O6 -fomit-frame-pointer -march=i586 -mcpu=i586 +# endif +#else +# ifndef CcCmd +# define CcCmd /usr/ccs/bin/cc +# endif +# define DefaultCCOptions -dy -O -Kalloca -Dasm=__asm +# define DefaultCDebugFlags -O +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags -O +# endif +#endif + +#ifndef DoLoadableServer +# define DoLoadableServer YES +#endif + +#if DoLoadableServer +# if HasGcc +# define USLDynamicFlags -rdynamic +# else +# define USLDynamicFlags -Wl,-Bexport +# endif +#else +# define USLDynamicFlags /**/ +#endif + +#define ServerExtraDefines XFree86ServerDefines +#ifndef ServerExtraSysLibs +# define ServerExtraSysLibs $(CBRT) -lm USLDynamicFlags +#endif + +#define ServerOSDefines -D_REENTRANT -DFD_SETSIZE=16384 -DDDXTIME XFree86ServerOSDefines #define ToolkitStringsABIOptions -intelabi #if OSMajorVersion < 2 #define XawI18nDefines -DHAS_WCTYPE_H -DHAS_ISW_FUNCS @@ -52,40 +114,112 @@ XCOMM operating system: OSName (OSMajorV # define ThreadedX YES # define HasThreadSafeAPI NO /* UnixWare does not have MT-safe pwd routines. */ -# define MTSafeAPIDefines \ --DXUSE_MTSAFE_API -DXNO_MTSAFE_PWDAPI -DXNO_MTSAFE_GRPAPI +# define MTSafeAPIDefines -DXUSE_MTSAFE_API -DXNO_MTSAFE_PWDAPI -DXNO_MTSAFE_GRPAPI # define SystemMTDefines -D_REENTRANT -# define ThreadsLibraries -lthread -# define ThreadsCplusplusLibraries -lthread -# ifndef DefaultCCOptions -# define DefaultCCOptions -W0,-2A -Xa -Dasm=__asm +# ifdef HasGcc2 +# define ThreadsLoadFlags -pthread +# else +# define ThreadsLoadFlags -Kpthread # endif #endif -#define BuildLibPathVar LD_LIBRARY_PATH +#define BuildLibPathVar LD_LIBRARY_PATH -/* UnixWare 7.x comes with perl. */ -#ifndef HasPerl -# if OSMajorVersion >= 7 -# define HasPerl YES -# else -# define HasPerl NO -# endif +#ifndef BuildXterm +# define BuildXterm BuildClients +#endif + +#ifndef HasNCurses +# define HasNCurses YES +#endif +#ifndef NCursesLibName +# define NCursesLibName -lcurses +#endif +#ifndef TermcapLibrary +# define TermcapLibrary -lcurses +#endif + +#ifndef BuildFreetypeDlModule +# define BuildFreetypeDlModule NO +#endif + +#ifndef UseDeprecatedKeyboardDriver +#define UseDeprecatedKeyboardDriver NO +#endif + +#ifndef ManSuffix +# define ManSuffix 1 +#endif + +#ifndef LibManSuffix +# define LibManSuffix 3 +#endif + +#ifndef FileManSuffix +# define FileManSuffix 4 #endif #ifndef UseExportLists -# define UseExportLists YES +# define UseExportLists YES #endif #define GencatFlags -m -#define HasStrcasecmp NO +#ifndef HasCplusplus +# define HasCplusplus YES +#endif + +#ifndef HasDlopen +# define HasDlopen YES +#endif + +#ifndef HasShm +# define HasShm YES +#endif + +#ifndef HasStrcasecmp +# define HasStrcasecmp YES +#endif + #ifndef HasSnprintf -#define HasSnprintf YES +# define HasSnprintf YES +#endif + +#ifndef UseSmartScheduler +# define UseSmartScheduler NO #endif + +#define SharedLibXmu YES +#ifndef NothingOutsideProjectRoot +# define NothingOutsideProjectRoot YES +#endif -#include +#ifndef UseSeparateConfDir +# define UseSeparateConfDir NO +#endif +#ifndef BuildHtmlManPages +# define BuildHtmlManPages NO +#endif + +#ifndef SCOHasGWXLIBS +# define SCOHasGWXLIBS YES +#endif + +#if SCOHasGWXLIBS +#define HasExpat YES +#define HasFreetype2 YES +#define HasLibpng YES +#define HasZlib YES +#define HasFontconfig YES +#define HasXpm YES +#endif /* SCOHasGWXLIBS */ + +#define InstallHardcopyDocs NO + +#define HasPerl YES +#define HasPerl5 YES + /* * When generating templates the UnixWare 2.02 C++ compiler leaves * protected .i files behind. Remove them so other people can @@ -100,10 +234,8 @@ XCOMM operating system: OSName (OSMajorV /* USL does not have a shared regex library. */ #define UseLocalRegex YES -#define XmDefines \ - -DNO_REGCOMP -DNEED_STRCASECMP \ - -DSUPPORT_ZERO_WIDTH -DHAS_WIDECHAR_FUNCTIONS -#define DtSvcDefines -DXK_MISCELLANY -DMULTIBYTE -DNO_REGCOMP +#define XmDefines -DSUPPORT_ZERO_WIDTH -DHAS_WIDECHAR_FUNCTIONS +#define DtSvcDefines -DXK_MISCELLANY -DMULTIBYTE #define DtSearchDefines -DI18N_MSG DtSvcDefines #define DtWidgetDefines DtSearchDefines #define DtPrintDefines DtSearchDefines @@ -116,16 +248,71 @@ XCOMM operating system: OSName (OSMajorV #define ExportListGenSource elistgen.usl #define ShlibExportListOpt(filename) Concat(-Bexport:,filename) -/* Remove -lc because select.o is not relocatable. */ -/* Remove -lgen (and set UseLocalRegex) because no shared library exists. */ -#define SharedXmReqs $(LDPRELIBS) SharedXReqs -lsocket -lnsl -lw -#define SharedMrmReqs $(LDPRELIBS) $(XMLIB) SharedXReqs -lsocket -lnsl -lw -#define SharedUilReqs $(LDPRELIBS) $(MRESOURCELIB) $(XMLIB) SharedXReqs -lsocket -lnsl -lw - /* requires process locking for missing _r functions */ #define TtClientLibs $(TTLIB) $(XTOOLLIB) $(XLIB) #define TtClientDepLibs $(DEPTTLIB) $(DEPXTOOLLIB) $(DEPXLIB) #define CdeProjectDefines \ - -DANSICPP -DMULTIBYTE -DNLS16 -DNEED_STRCASECMP \ + -DANSICPP -DMULTIBYTE -DNLS16 \ -DOSMAJORVERSION=OSMajorVersion -DOSMINORVERSION=OSMinorVersion + +/* + * These settings control the interdependence of the shared libraries. + * Mostly borrowed from darwinLib.tmpl. + */ +#ifndef FixupLibReferences +#define FixupLibReferences() @@\ +XMULIBONLY = -lXmu @@\ +XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLIB) +#endif + +#ifndef XawClientLibs +#define XawClientLibs $(XAWLIB) $(XMULIBONLY) $(XTOOLLIB) $(XPMLIB) $(EXTRAXAWCLIENTLIBS) $(XLIB) +#endif + +#define SharedXlibi18nReqs $(LDPRELIB) $(XLIBONLY) + +#define SharedXfontReqs $(LDPRELIB) $(FONTSTUBLIB) GzipLibrary $(FREETYPE2LIB) $(XLIB) +#define SharedFontencReqs $(LDPRELIB) GzipLibrary +#define SharedGLReqs $(LDPRELIB) $(XLIB) +#define SharedGLUReqs $(LDPRELIB) $(XLIB) $(GLXLIB) +#define SharedOSMesaReqs $(LDPRELIB) $(XLIB) $(GLXLIB) +#define SharedPexReqs $(LDPRELIB) $(XONLYLIB) MathLibrary +#define SharedSMReqs $(LDPRELIB) $(ICELIB) +#define SharedX11Reqs $(LDPRELIB) -lsocket -lnsl +#define SharedXawReqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(EXTRAXAWREQS) $(XLIB) +#define SharedXaw7Reqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(XLIB) +#define SharedXaw6Reqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XLIB) +#define SharedXcursorReqs $(LDPRELIB) $(XRENDERLIB) $(XLIB) +#define SharedXextReqs $(LDPRELIB) $(XONLYLIB) +#define SharedXiReqs $(LDPRELIB) $(XLIB) +#define SharedXieReqs $(LDPRELIB) $(XONLYLIB) +#define SharedXmuReqs $(LDPRELIB) $(XTOOLLIB) $(XLIB) +#define SharedXmuuReqs $(LDPRELIB) $(XONLYLIB) +#define SharedXpReqs $(LDPRELIB) $(XLIB) +#define SharedXpmReqs $(LDPRELIB) $(XLIB) +#define SharedXrandrReqs $(LDPRELIB) $(XRENDERLIB) $(XLIB) +#define SharedXrenderReqs $(LDPRELIB) $(XLIB) +#define SharedXtReqs $(LDPRELIB) $(XONLYLIB) $(SMLIB) $(ICELIB) +#define SharedXtstReqs $(LDPRELIB) $(XLIB) +#define SharedXvReqs $(LDPRELIB) $(XLIB) +#define SharedDPSReqs $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(XLIB) +#define SharedDPSTKReqs $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(DPSLIB) $(XLIB) +#define SharedOldXReqs $(LDPRELIB) $(XONLYLIB) +#define SharedpsresReqs $(LDPRELIB) $(SMLIB) $(ICELIB) $(XTOOLLIB) $(XLIB) +#define SharedXResReqs $(LDPRELIB) $(XLIB) +#define SharedXfontcacheReqs $(LDPRELIB) $(XLIB) +#define SharedXineramaReqs $(LDPRELIB) $(XLIB) +#define SharedXssReqs $(LDPRELIB) $(XLIB) +#define SharedXvMCReqs $(LDPRELIB) $(XLIB) +#define SharedXxf86miscReqs $(LDPRELIB) $(XLIB) +#define SharedXxf86vmReqs $(LDPRELIB) $(XLIB) +#define SharedxkbfileReqs $(LDPRELIB) $(XONLYLIB) +#define SharedxkbuiReqs $(LDPRELIB) $(XKBFILELIB) $(XONLYLIB) +#define SharedXReqs $(XTOOLLIB) $(XPLIB) $(XLIB) +#define SharedXmReqs $(LDPRELIB) SharedXReqs +#define SharedMrmReqs $(LDPRELIB) $(XMLIB) SharedXReqs +#define SharedUilReqs $(LDPRELIB) $(XMLIB) SharedXReqs + +#include /* minor changes to sv4Lib.rules */ +#include Index: config/cf/xf86.tmpl =================================================================== RCS file: /cvs/xorg/xc/config/cf/xf86.tmpl,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 xf86.tmpl --- config/cf/xf86.tmpl 9 Oct 2004 22:04:13 -0000 1.3 +++ config/cf/xf86.tmpl 7 Nov 2005 06:01:04 -0000 @@ -84,10 +84,10 @@ MODULE_DEFINES = -DXFree86Module grep -v '^\#' > basename.i #undef AssembleObject -#define AssembleObject(flags) ModCPPOnlyAsm($*,flags) @@\ - RemoveFile($*.o) @@\ - $(MODAS) $(MODASFLAGS) -o $*.o $*.i @@\ - RemoveFile($*.i) +#define AssembleObject(basename,flags) ModCPPOnlyAsm(basename,flags) @@\ + RemoveFile(basename.o) @@\ + $(MODAS) $(MODASFLAGS) -o basename.o basename.i @@\ + RemoveFile(basename.i) /* This overrides the NormalRelocatableTarget in Imake.rules */ #undef NormalRelocatableTarget Index: config/cf/xorg.tmpl =================================================================== RCS file: /cvs/xorg/xc/config/cf/xorg.tmpl,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 xorg.tmpl --- config/cf/xorg.tmpl 2 Apr 2005 19:07:53 -0000 1.4 +++ config/cf/xorg.tmpl 7 Nov 2005 06:01:04 -0000 @@ -101,10 +101,10 @@ MODULE_DEFINES = -DXFree86Module grep -v '^\#' > basename.i #undef AssembleObject -#define AssembleObject(flags) ModCPPOnlyAsm($*,flags) @@\ - RemoveFile($*.o) @@\ - $(MODAS) $(MODASFLAGS) -o $*.o $*.i @@\ - RemoveFile($*.i) +#define AssembleObject(basename,flags) ModCPPOnlyAsm(basename,flags) @@\ + RemoveFile(basename.o) @@\ + $(MODAS) $(MODASFLAGS) -o basename.o basename.i @@\ + RemoveFile(basename.i) /* This overrides the NormalRelocatableTarget in Imake.rules */ #undef NormalRelocatableTarget Index: config/imake/imake.c =================================================================== RCS file: /cvs/xorg/xc/config/imake/imake.c,v retrieving revision 1.9 diff -u -3 -p -u -r1.9 imake.c --- config/imake/imake.c 8 Oct 2005 20:46:40 -0000 1.9 +++ config/imake/imake.c 7 Nov 2005 06:01:04 -0000 @@ -195,7 +195,7 @@ in this Software without prior written a #include #ifndef X_NOT_POSIX # ifdef _POSIX_SOURCE -# ifdef SCO325 +# ifdef __SCO__ # include # include # endif Index: config/imake/imakemdep.h =================================================================== RCS file: /cvs/xorg/xc/config/imake/imakemdep.h,v retrieving revision 1.11 diff -u -3 -p -u -r1.11 imakemdep.h --- config/imake/imakemdep.h 3 Oct 2005 16:17:10 -0000 1.11 +++ config/imake/imakemdep.h 7 Nov 2005 06:01:04 -0000 @@ -65,16 +65,37 @@ in this Software without prior written a #define imake_ccflags "-DSYSV" #endif -#if defined(USL) || defined(__USLC__) || defined(Oki) || defined(NCR) -#define imake_ccflags "-Xa -DSVR4" +/* + * SCO UnixWare and OpenServer 6 are both System V Release 5 based OSes. + * The native C compiler doesn't assert __UNIXWARE__ but gcc does, so + * we don't redefine it if we are using gcc (as it sets it to a specific + * value). On OpenServer 6, which is a multi-ABI world, if you attempt + * to build with -Kosr, then the C compiler will assert __OPENSERVER__ + * and set it to the value 507. That indicates an OSR5 compile, and + * is handled below. + */ + +#if defined(__UNIXWARE__) || defined(__USLC__) || defined(Oki) || defined(NCR) +# ifdef imake_ccflags +# undef imake_ccflags +# endif +# ifdef __UNIXWARE__ +# ifndef __GNUC__ +# define imake_ccflags "-Xa -DSVR4 -DSVR5 -D__UNIXWARE__" +# else +# define imake_ccflags "-Xa -DSVR4 -DSVR5" +# endif +# else +# define imake_ccflags "-Xa -DSVR4" +# endif #endif /* SCO may define __USLC__ so put this after the USL check */ -#if defined(M_UNIX) || defined(_SCO_DS) -#ifdef imake_ccflags -#undef imake_ccflags -#endif -#define imake_ccflags "-Dsco -DSYSV -DSCO -DSCO325" +#if defined(M_UNIX) || defined(_SCO_DS) || defined(__OPENSERVER__) +# ifdef imake_ccflags +# undef imake_ccflags +# endif +# define imake_ccflags "-DSYSV -DSCO325 -D__SCO__" #endif #ifdef sony @@ -204,7 +225,7 @@ in this Software without prior written a * descriptor onto another, define such a mechanism here (if you don't * already fall under the existing category(ies). */ -#if defined(SYSV) && !defined(_CRAY) && !defined(Mips) && !defined(_SEQUENT_) && !defined(sco) +#if defined(SYSV) && !defined(_CRAY) && !defined(Mips) && !defined(_SEQUENT_) && !defined(__SCO__) #define dup2(fd1,fd2) ((fd1 == fd2) ? fd1 : (close(fd2), \ fcntl(fd1, F_DUPFD, fd2))) #endif @@ -219,7 +240,7 @@ in this Software without prior written a * all colons). One way to tell if you need this is to see whether or not * your Makefiles have no tabs in them and lots of @@ strings. */ -#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(sco) || (defined(AMOEBA) && defined(CROSS_COMPILE)) || defined(__QNX__) || defined(__sgi) || defined(__UNIXOS2__) +#if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(__SCO__) || (defined(AMOEBA) && defined(CROSS_COMPILE)) || defined(__QNX__) || defined(__sgi) || defined(__UNIXOS2__) || defined(__UNIXWARE__) #define FIXUP_CPP_WHITESPACE #endif #ifdef WIN32 @@ -436,8 +457,9 @@ char *cpp_argv[ARGUMENTS] = { #if defined(macII) || defined(_AUX_SOURCE) "-DmacII", /* Apple A/UX */ #endif -#if defined(USL) || defined(__USLC__) - "-DUSL", /* USL */ +#if defined(USL) || defined(__UNIXWARE__) || \ + (defined(__USLC__) && !defined(_SCO_DS)) + "-D__UNIXWARE__", /* SCO UnixWare 7 */ #endif #ifdef sony "-Dsony", /* Sony */ @@ -495,8 +517,9 @@ char *cpp_argv[ARGUMENTS] = { "-DSVR4", # endif #endif /* MOTOROLA */ -#if defined(M_UNIX) || defined(sco) - "-Dsco", +#if defined(M_UNIX) || defined(sco) || defined(__SCO__) || \ + defined(_SCO_DS) || defined(__OPENSERVER__) + "-D__SCO__", "-DSYSV", #endif #ifdef i386 @@ -522,11 +545,11 @@ char *cpp_argv[ARGUMENTS] = { # endif # endif # endif -# ifdef SCO - "-DSCO", -# ifdef _SCO_DS +# if (_SCO_DS - 0 == 1) "-DSCO325", -# endif +# endif +# if (_SCO_DS - 0 > 1) + "-DSCO5V6", # endif # endif # ifdef ESIX @@ -560,12 +583,12 @@ char *cpp_argv[ARGUMENTS] = { # endif # endif # endif -# ifdef SCO - "-DSCO", -# ifdef _SCO_DS +# if (_SCO_DS - 0 == 1) "-DSCO325", -# endif # endif +# if (_SCO_DS - 0 > 1) + "-DSCO5V6", +# endif # ifdef ESIX "-DESIX", # endif @@ -783,7 +806,8 @@ char *cpp_argv[ARGUMENTS] = { # define DEFAULT_OS_MINOR_REV "r %*[^.].%*d.%1s" # define DEFAULT_OS_TEENY_REV "r %*[^.].%*d.%*c%[0-9]" # define DEFAULT_OS_NAME "srvm %[^\n]" -# elif defined(USL) || defined(__USLC__) +# elif defined(USL) || defined(__USLC__) || defined(__UNIXWARE__) || \ + defined(__SCO__) || defined(__OPENSERVER__) || defined(_SCO_DS) /* uname -v returns "x.yz" or "x.y.z", e.g. "2.02" or "2.1.2". */ # define DEFAULT_OS_MAJOR_REV "v %[0-9]" # define DEFAULT_OS_MINOR_REV "v %*d.%1s" @@ -1116,6 +1140,24 @@ struct symtab predefs[] = { #ifdef __HIGHC__ {"__HIGHC__", "1"}, #endif +#ifdef __OPENSERVER__ + {"__OPENSERVER__", DEF_STRINGIFY(__OPENSERVER__)}, +#endif +#ifdef _SCO_DS + {"_SCO_DS", DEF_STRINGIFY(_SCO_DS)}, +#endif +#ifdef _SCO_DS_LL + {"_SCO_DS_LL", DEF_STRINGIFY(_SCO_DS_LL)}, +#endif +#ifdef __SCO_VERSION__ + {"__SCO_VERSION__", DEF_STRINGIFY(__SCO_VERSION__)}, +#endif +#ifdef __UNIXWARE__ + {"__UNIXWARE__", DEF_STRINGIFY(__UNIXWARE__)}, +#endif +#ifdef __USLC__ + {"__USLC__", DEF_STRINGIFY(__USLC__)}, +#endif #ifdef CMU {"CMU", "1"}, #endif Index: extras/Xpm/Imakefile =================================================================== RCS file: /cvs/xorg/xc/extras/Xpm/Imakefile,v retrieving revision 1.1.1.1 diff -u -3 -p -u -r1.1.1.1 Imakefile --- extras/Xpm/Imakefile 14 Nov 2003 16:48:24 -0000 1.1.1.1 +++ extras/Xpm/Imakefile 7 Nov 2005 06:01:05 -0000 @@ -42,8 +42,7 @@ XCOMM add -DVOID_SPRINTF (defined(MipsArchitecture) && !defined(SGIArchitecture)) STRDUPDEF = -DNEED_STRDUP #else -# if defined(Win32Architecture) || defined(USLArchitecture) || \ - (defined(HasStrcasecmp) && !HasStrcasecmp) +# if defined(Win32Architecture) || (defined(HasStrcasecmp) && !HasStrcasecmp) STRCASECMPDEF = -DNEED_STRCASECMP # else # if defined(SunArchitecture) && !defined(SVR4Architecture) Index: extras/Xpm/lib/Imakefile =================================================================== RCS file: /cvs/xorg/xc/extras/Xpm/lib/Imakefile,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 Imakefile --- extras/Xpm/lib/Imakefile 11 Dec 2004 16:17:13 -0000 1.3 +++ extras/Xpm/lib/Imakefile 7 Nov 2005 06:01:05 -0000 @@ -72,8 +72,7 @@ XCOMM add -DVOID_SPRINTF (defined(MipsArchitecture) && !defined(SGIArchitecture)) STRDUPDEF = -DNEED_STRDUP #else -# if defined(Win32Architecture) || defined(USLArchitecture) || \ - (defined(HasStrcasecmp) && !HasStrcasecmp) +# if defined(Win32Architecture) || (defined(HasStrcasecmp) && !HasStrcasecmp) STRCASECMPDEF = -DNEED_STRCASECMP # else # if defined(SunArchitecture) && !defined(SVR4Architecture) Index: extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/simplemath.h =================================================================== RCS file: /cvs/xorg/xc/extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/simplemath.h,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 simplemath.h --- extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/simplemath.h 22 Apr 2005 22:00:09 -0000 1.3 +++ extras/ogl-sample/main/gfx/lib/glu/libnurbs/internals/simplemath.h 7 Nov 2005 06:01:05 -0000 @@ -50,7 +50,7 @@ max( int x, int y ) { return ( x < y ) ? inline REAL min( REAL x, REAL y ) { return ( x > y ) ? y : x; } -#if defined(_SCO_DS) || defined(__SUNPRO_CC) +#if defined(__SCO__) || defined(__UNIXWARE__) || defined(__SUNPRO_CC) #define abs __gluabs #endif inline REAL Index: include/Xfuncs.h =================================================================== RCS file: /cvs/xorg/xc/include/Xfuncs.h,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 Xfuncs.h --- include/Xfuncs.h 13 Jul 2005 07:23:56 -0000 1.3 +++ include/Xfuncs.h 7 Nov 2005 06:01:05 -0000 @@ -41,21 +41,23 @@ void bcopy(); void bzero(); int bcmp(); #else -#if defined(SYSV) && !defined(SCO325) && !defined(sun) +#if defined(SYSV) && !defined(__SCO__) && !defined(sun) && !defined(__UNIXWARE__) #include void bcopy(); #define bzero(b,len) memset(b, 0, len) #define bcmp(b1,b2,len) memcmp(b1, b2, len) #else #include -#if defined(SCO325) || defined(sun) +#if defined(__SCO__) || defined(sun) || defined(__UNIXWARE__) #include #endif #define _XFUNCS_H_INCLUDED_STRING_H +#if defined(sun) #define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len)) #define bzero(b,len) memset(b, 0, (size_t)(len)) #define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len)) #endif +#endif #endif /* X_USEBFUNCS */ /* the new Xfuncs.h */ Index: include/Xos.h =================================================================== RCS file: /cvs/xorg/xc/include/Xos.h,v retrieving revision 1.7 diff -u -3 -p -u -r1.7 Xos.h --- include/Xos.h 23 Jul 2005 02:53:32 -0000 1.7 +++ include/Xos.h 7 Nov 2005 06:01:05 -0000 @@ -62,7 +62,7 @@ in this Software without prior written a #endif /* USG */ #ifndef sgi -#if defined(SCO325) || defined(__USLC__) +#if defined(__SCO__) || defined(__UNIXWARE__) #include #endif #endif @@ -92,7 +92,7 @@ in this Software without prior written a #ifndef X_NOT_STDC_ENV #include -#ifdef SCO325 +#if defined(__SCO__) || defined(__UNIXWARE__) #include #else #if (defined(sun) && defined(__SVR4)) Index: include/Xosdefs.h =================================================================== RCS file: /cvs/xorg/xc/include/Xosdefs.h,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 Xosdefs.h --- include/Xosdefs.h 21 Aug 2005 15:27:27 -0000 1.6 +++ include/Xosdefs.h 7 Nov 2005 06:01:05 -0000 @@ -81,18 +81,16 @@ in this Software without prior written a #endif #ifdef _SCO_DS -#ifndef SCO -#define SCO -#endif -#ifndef SCO325 -#define SCO325 +#ifndef __SCO__ +#define __SCO__ #endif #endif #ifdef i386 #ifdef SYSV -#if !defined(ISC) && !defined(SCO) && !defined(_SEQUENT_) && !defined(sun) -#if !defined(_POSIX_SOURCE) && !defined(_SCO_DS) +#if !defined(ISC) && !defined(__SCO__) && !defined(_SEQUENT_) && \ + !defined(__UNIXWARE__) && !defined(sun) +#if !defined(_POSIX_SOURCE) #define X_NOT_POSIX #endif #define X_NOT_STDC_ENV @@ -148,6 +146,15 @@ in this Software without prior written a #endif #endif +#if defined(__SCO__) || defined(__UNIXWARE__) +# ifndef PATH_MAX +# define PATH_MAX 1024 +# endif +# ifndef MAXPATHLEN +# define MAXPATHLEN 1024 +# endif +#endif + #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) \ || defined(__Darwin__) || defined(__DragonFly__) # ifndef CSRG_BASED Index: include/Xthreads.h =================================================================== RCS file: /cvs/xorg/xc/include/Xthreads.h,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 Xthreads.h --- include/Xthreads.h 13 Jul 2005 20:12:13 -0000 1.5 +++ include/Xthreads.h 7 Nov 2005 06:01:05 -0000 @@ -70,7 +70,12 @@ typedef thread_t xthread_t; typedef thread_key_t xthread_key_t; typedef cond_t xcondition_rec; typedef mutex_t xmutex_rec; +#if defined(__UNIXWARE__) +extern xthread_t (*_x11_thr_self)(); +#define xthread_self (_x11_thr_self) +#else #define xthread_self thr_self +#endif #define xthread_fork(func,closure) thr_create(NULL,0,func,closure,THR_NEW_LWP|THR_DETACHED,NULL) #define xthread_yield() thr_yield() #define xthread_exit(v) thr_exit(v) Index: lib/FS/FSlibos.h =================================================================== RCS file: /cvs/xorg/xc/lib/FS/FSlibos.h,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 FSlibos.h --- lib/FS/FSlibos.h 3 Jul 2005 07:00:55 -0000 1.4 +++ lib/FS/FSlibos.h 7 Nov 2005 06:01:05 -0000 @@ -62,7 +62,7 @@ in this Software without prior written a #ifndef WIN32 -#if defined(SCO) || defined(__USLC__) +#if defined(__SCO__) || defined(__UNIXWARE__) #include /* For SIZE_MAX */ #endif Index: lib/ICE/Imakefile =================================================================== RCS file: /cvs/xorg/xc/lib/ICE/Imakefile,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 Imakefile --- lib/ICE/Imakefile 27 Aug 2004 22:47:45 -0000 1.3 +++ lib/ICE/Imakefile 7 Nov 2005 06:01:05 -0000 @@ -22,13 +22,8 @@ REQUIREDLIBS = SharedICEReqs #if (SystemV || SystemV4) && !HasSockets CONN_DEFINES = -DTCPCONN -DICE_t -DTRANS_CLIENT -DTRANS_SERVER $(XTRANS_FAILDEFINES) #else -#ifdef USLArchitecture -/* XXX temporary hack, PTS is failing on UnixWare */ -CONN_DEFINES = -DSTREAMSCONN -DUNIXCONN -DICE_t -DTRANS_CLIENT -DTRANS_SERVER $(XTRANS_FAILDEFINES) -#else CONN_DEFINES = $(CONNECTION_FLAGS) -DICE_t -DTRANS_CLIENT -DTRANS_SERVER $(XTRANS_FAILDEFINES) #endif -#endif #if HasBSD44Sockets SOCK_DEFINES = -DBSD44SOCKETS Index: lib/SM/sm_manager.c =================================================================== RCS file: /cvs/xorg/xc/lib/SM/sm_manager.c,v retrieving revision 1.7 diff -u -3 -p -u -r1.7 sm_manager.c --- lib/SM/sm_manager.c 9 Jun 2005 15:52:02 -0000 1.7 +++ lib/SM/sm_manager.c 7 Nov 2005 06:01:06 -0000 @@ -37,7 +37,7 @@ in this Software without prior written a #include "SMlibint.h" #include -#ifdef __USLC__ +#ifdef __UNIXWARE__ #undef shutdown #endif Index: lib/X11/XKeysymDB =================================================================== RCS file: /cvs/xorg/xc/lib/X11/XKeysymDB,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 XKeysymDB --- lib/X11/XKeysymDB 23 Apr 2004 18:43:24 -0000 1.2 +++ lib/X11/XKeysymDB 7 Nov 2005 06:01:06 -0000 @@ -352,3 +352,20 @@ usldead_asciicircum :100000AA usldead_asciitilde :100000AC usldead_cedilla :1000FE2C usldead_ring :1000FEB0 + +scodead_grave :FE50 +scodead_acute :FE51 +scodead_circumflex :FE52 +scodead_tilde :FE53 +scodead_macron :FE54 +scodead_breve :FE55 +scodead_abovedot :FE56 +scodead_diaeresis :FE57 +scodead_abovering :FE58 +scodead_doubleacute :FE59 +scodead_caron :FE5A +scodead_cedilla :FE5B +scodead_ogonek :FE5C +scodead_iota :FE5D +scodead_voiced_sound :FE5E +scodead_semivoiced_sound :FE5F Index: lib/X11/Xlib.h =================================================================== RCS file: /cvs/xorg/xc/lib/X11/Xlib.h,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 Xlib.h --- lib/X11/Xlib.h 3 Jul 2005 07:00:55 -0000 1.5 +++ lib/X11/Xlib.h 7 Nov 2005 06:01:06 -0000 @@ -53,7 +53,7 @@ in this Software without prior written a #endif #endif /* USG */ -#if defined(SCO325) || defined(__USLC__) +#if defined(__SCO__) || defined(__UNIXWARE__) #include #endif @@ -65,13 +65,11 @@ in this Software without prior written a #ifndef X_WCHAR #ifdef X_NOT_STDC_ENV -#ifndef SCO324 #ifndef ISC #define X_WCHAR #endif #endif #endif -#endif #ifndef X_WCHAR #include Index: lib/X11/locking.c =================================================================== RCS file: /cvs/xorg/xc/lib/X11/locking.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 locking.c --- lib/X11/locking.c 13 May 2005 22:53:44 -0000 1.3 +++ lib/X11/locking.c 7 Nov 2005 06:01:06 -0000 @@ -43,6 +43,10 @@ in this Software without prior written a #ifdef XTHREADS +#ifdef __UNIXWARE__ +#include +#endif + #include "locking.h" #ifdef XTHREADS_WARN #include /* for warn/debug stuff */ @@ -587,11 +591,27 @@ static int _XInitDisplayLock( return 0; } +#ifdef __UNIXWARE__ +xthread_t __x11_thr_self() { return 0; } +xthread_t (*_x11_thr_self)() = __x11_thr_self; +#endif + Status XInitThreads() { if (_Xglobal_lock) return 1; +#ifdef __UNIXWARE__ + else { + void *dl_handle = dlopen(NULL, RTLD_LAZY); + if (!dl_handle || + ((_x11_thr_self = (xthread_t(*)())dlsym(dl_handle,"thr_self")) == 0)) { + _x11_thr_self = __x11_thr_self; + (void) fprintf (stderr, + "XInitThreads called, but no libthread in the calling program!\n" ); + } + } +#endif /* __UNIXWARE__ */ #ifdef xthread_init xthread_init(); /* return value? */ #endif Index: lib/Xaw/XawI18n.h =================================================================== RCS file: /cvs/xorg/xc/lib/Xaw/XawI18n.h,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 XawI18n.h --- lib/Xaw/XawI18n.h 3 Jul 2005 07:00:56 -0000 1.3 +++ lib/Xaw/XawI18n.h 7 Nov 2005 06:01:06 -0000 @@ -42,7 +42,7 @@ in this Software without prior written a #include #endif -#if defined(AIXV3) || defined(SCO325) +#if defined(AIXV3) || defined(__SCO__) #include #endif Index: lib/Xbsd/Berklib.c =================================================================== RCS file: /cvs/xorg/xc/lib/Xbsd/Berklib.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 Berklib.c --- lib/Xbsd/Berklib.c 23 Apr 2004 18:43:40 -0000 1.2 +++ lib/Xbsd/Berklib.c 7 Nov 2005 06:01:06 -0000 @@ -52,7 +52,7 @@ from The Open Group. #define WANT_RANDOM #endif -#if defined(SVR4) && !defined(SCO325) +#if defined(SVR4) && !defined(__UNIXWARE__) #define WANT_BFUNCS #define WANT_FFS #define WANT_RANDOM @@ -64,7 +64,7 @@ from The Open Group. #ifdef SYSV #ifdef i386 -#ifndef SCO +#if !defined(__SCO__) && !defined(__UNIXWARE__) #define WANT_FFS #define WANT_MEMMOVE #endif Index: lib/Xt/NextEvent.c =================================================================== RCS file: /cvs/xorg/xc/lib/Xt/NextEvent.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 NextEvent.c --- lib/Xt/NextEvent.c 18 May 2005 15:38:31 -0000 1.4 +++ lib/Xt/NextEvent.c 7 Nov 2005 06:01:06 -0000 @@ -80,7 +80,7 @@ static SignalEventRec* freeSignalRecs; */ #ifndef NEEDS_NTPD_FIXUP -# if defined(sun) || defined(MOTOROLA) || defined(sco324) || (defined(__osf__) && defined(__alpha)) +# if defined(sun) || defined(MOTOROLA) || (defined(__osf__) && defined(__alpha)) # define NEEDS_NTPD_FIXUP 1 # else # define NEEDS_NTPD_FIXUP 0 Index: lib/Xxf86dga/XF86DGA.c =================================================================== RCS file: /cvs/xorg/xc/lib/Xxf86dga/XF86DGA.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 XF86DGA.c --- lib/Xxf86dga/XF86DGA.c 6 May 2004 17:31:17 -0000 1.3 +++ lib/Xxf86dga/XF86DGA.c 7 Nov 2005 06:01:06 -0000 @@ -374,7 +374,7 @@ Bool XF86DGAViewPortChanged( #include #include -#if defined(SVR4) && !defined(sun) && !defined(SCO325) +#if defined(SVR4) && !defined(sun) #define DEV_MEM "/dev/pmem" #elif defined(SVR4) && defined(sun) #define DEV_MEM "/dev/xsvc" Index: lib/Xxf86dga/XF86DGA2.c =================================================================== RCS file: /cvs/xorg/xc/lib/Xxf86dga/XF86DGA2.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 XF86DGA2.c --- lib/Xxf86dga/XF86DGA2.c 23 Apr 2004 18:43:55 -0000 1.2 +++ lib/Xxf86dga/XF86DGA2.c 7 Nov 2005 06:01:06 -0000 @@ -742,7 +742,7 @@ void XDGAKeyEventToXKeyEvent( #include #include -#if defined(SVR4) && !defined(sun) && !defined(SCO325) +#if defined(SVR4) && !defined(sun) #define DEV_MEM "/dev/pmem" #elif defined(SVR4) && defined(sun) #define DEV_MEM "/dev/xsvc" Index: lib/dps/Xlibnet.h =================================================================== RCS file: /cvs/xorg/xc/lib/dps/Xlibnet.h,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 Xlibnet.h --- lib/dps/Xlibnet.h 23 Apr 2004 18:43:56 -0000 1.2 +++ lib/dps/Xlibnet.h 7 Nov 2005 06:01:06 -0000 @@ -58,7 +58,7 @@ without express or implied warranty. #endif #if defined(i386) && defined(SYSV) -#if !defined(SCO) && !defined(SCO325) +#if !defined(__SCO__) #include #endif #include @@ -272,10 +272,10 @@ extern Xstream _XsStream[]; #ifndef USL_COMPAT -#if !defined(USG) || defined(MOTOROLA) -#if (defined(SCO) || defined(SCO325)) || (!(defined(SYSV) && defined(i386))) +#if !defined(USG) || defined(MOTOROLA) || \ + defined(__SCO__) || (!(defined(SYSV) && defined(i386))) || \ + defined(__UNIXWARE__) #define _XReadV readv -#endif #define _XWriteV writev #endif #endif /* !USL_COMPAT */ Index: lib/dps/cslibint.h =================================================================== RCS file: /cvs/xorg/xc/lib/dps/cslibint.h,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 cslibint.h --- lib/dps/cslibint.h 23 Apr 2004 18:43:56 -0000 1.2 +++ lib/dps/cslibint.h 7 Nov 2005 06:01:06 -0000 @@ -65,7 +65,7 @@ /* For SYSV, no gethostname, so fake it */ #include -#if defined(SCO) || defined(SCO325) +#if defined(__SCO__) /* SCO systems define MAXHOSTNAMELEN here */ #include #endif Index: lib/font/fc/fslibos.h =================================================================== RCS file: /cvs/xorg/xc/lib/font/fc/fslibos.h,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 fslibos.h --- lib/font/fc/fslibos.h 9 Jun 2005 15:52:03 -0000 1.3 +++ lib/font/fc/fslibos.h 7 Nov 2005 06:01:07 -0000 @@ -65,11 +65,7 @@ from The Open Group. #endif #ifndef OPEN_MAX #if defined(SVR4) || defined(__UNIXOS2__) -#ifdef SCO325 -#define OPEN_MAX sysconf(_SC_OPEN_MAX) -#else #define OPEN_MAX 256 -#endif #else #include #ifndef OPEN_MAX Index: lib/font/fontfile/encparse.c =================================================================== RCS file: /cvs/xorg/xc/lib/font/fontfile/encparse.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 encparse.c --- lib/font/fontfile/encparse.c 3 Jul 2005 07:01:00 -0000 1.3 +++ lib/font/fontfile/encparse.c 7 Nov 2005 06:01:07 -0000 @@ -32,7 +32,7 @@ THE SOFTWARE. #include #include -#ifdef SCO325 +#if defined(__SCO__) || defined(__UNIXWARE__) #include #endif Index: lib/font/fontfile/fontenc.c =================================================================== RCS file: /cvs/xorg/xc/lib/font/fontfile/fontenc.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 fontenc.c --- lib/font/fontfile/fontenc.c 9 Jul 2005 23:31:40 -0000 1.4 +++ lib/font/fontfile/fontenc.c 7 Nov 2005 06:01:07 -0000 @@ -27,7 +27,7 @@ THE SOFTWARE. #include -#ifdef SCO325 +#if defined(__SCO__) || defined(__UNIXWARE__) #include #endif Index: lib/fontconfig/Imakefile =================================================================== RCS file: /cvs/xorg/xc/lib/fontconfig/Imakefile,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 Imakefile --- lib/fontconfig/Imakefile 2 Sep 2005 22:47:50 -0000 1.5 +++ lib/fontconfig/Imakefile 7 Nov 2005 06:01:07 -0000 @@ -99,9 +99,13 @@ SUBSTVARS=prefix=$(PROJECTROOT) \ CONFIG_SUBST_PROG=sh ./config-subst -#if (defined(SunArchitecture) && defined(SVR4Architecture)) && !(HasGnuMake) -XCOMM Required for the config-subst rules to work with Solaris make -SHELL=/bin/ksh +#if !(HasGnuMake) +#if (defined(SunArchitecture) && defined(SVR4Architecture)) || \ + defined(SCOArchitecture) || defined(USLArchitecture) || \ + defined(UnixWareArchitecture) + XCOMM Required for the config-subst rules to work with Solaris make + SHELL=/bin/ksh +#endif #endif #if InstallFontconfigLibrary Index: lib/lbxutil/lbx_zlib/lbx_zlib_io.c =================================================================== RCS file: /cvs/xorg/xc/lib/lbxutil/lbx_zlib/lbx_zlib_io.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 lbx_zlib_io.c --- lib/lbxutil/lbx_zlib/lbx_zlib_io.c 3 Jul 2005 07:43:17 -0000 1.4 +++ lib/lbxutil/lbx_zlib/lbx_zlib_io.c 7 Nov 2005 06:01:07 -0000 @@ -43,7 +43,7 @@ * The following is taken from the xtrans code, almost as is, * it would be nice to share it... */ -#if defined(WIN32) || defined(__sxg__) || (defined(SCO) && !defined(SVR4) && !defined(SCO325)) +#if defined(WIN32) || defined(__sxg__) static int writev(int fildes, const struct iovec *iov, int iovcnt) { Index: lib/xtrans/Xtrans.c =================================================================== RCS file: /cvs/xorg/xc/lib/xtrans/Xtrans.c,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 Xtrans.c --- lib/xtrans/Xtrans.c 3 Jul 2005 07:01:01 -0000 1.5 +++ lib/xtrans/Xtrans.c 7 Nov 2005 06:01:07 -0000 @@ -117,7 +117,7 @@ Xtransport_table Xtransports[] = { { &TRANS(NAMEDFuncs), TRANS_LOCAL_NAMED_INDEX }, #endif #ifndef sun -#ifndef SCO325 +#if !defined(__SCO__) && !defined(__UNIXWARE__) { &TRANS(ISCFuncs), TRANS_LOCAL_ISC_INDEX }, #endif { &TRANS(SCOFuncs), TRANS_LOCAL_SCO_INDEX }, @@ -712,7 +712,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, break; case 1: /* Set to non-blocking mode */ -#if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(AIXV3) && !defined(uniosu) && !defined(__UNIXOS2__) && !defined(SCO)) && !defined(__QNX__) +#if defined(O_NONBLOCK) && (!defined(ultrix) && !defined(hpux) && !defined(AIXV3) && !defined(uniosu) && !defined(__UNIXOS2__) && !defined(SCO325)) && !defined(__QNX__) ret = fcntl (fd, F_GETFL, 0); if (ret != -1) ret = fcntl (fd, F_SETFL, ret | O_NONBLOCK); @@ -1303,7 +1303,7 @@ static int TRANS(WriteV) (XtransConnInfo #endif /* CRAY */ -#if (defined(SYSV) && defined(i386) && !defined(SCO325)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) +#if (defined(SYSV) && defined(i386) && !defined(__SCO__)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) /* * emulate readv @@ -1335,7 +1335,7 @@ static int TRANS(ReadV) (XtransConnInfo #endif /* SYSV && i386 || WIN32 || __sxg__ */ -#if (defined(SYSV) && defined(i386) && !defined(SCO325)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) +#if (defined(SYSV) && defined(i386) && !defined(__SCO__)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) /* * emulate writev @@ -1368,7 +1368,7 @@ static int TRANS(WriteV) (XtransConnInfo #endif /* SYSV && i386 || WIN32 || __sxg__ */ -#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || defined(SCO) +#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || defined(__SCO__) #ifndef NEED_UTSNAME #define NEED_UTSNAME #endif Index: lib/xtrans/Xtransint.h =================================================================== RCS file: /cvs/xorg/xc/lib/xtrans/Xtransint.h,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 Xtransint.h --- lib/xtrans/Xtransint.h 3 Jul 2005 07:01:01 -0000 1.3 +++ lib/xtrans/Xtransint.h 7 Nov 2005 06:01:07 -0000 @@ -110,7 +110,7 @@ from The Open Group. * to avoid a race condition. JKJ (6/5/97) */ -# if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || defined(SCO) +# if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || defined(__SCO__) # ifndef NEED_UTSNAME # define NEED_UTSNAME # endif @@ -383,7 +383,7 @@ typedef struct _Xtransport_table { * systems, so they may be emulated. */ -#if defined(CRAY) || (defined(SYSV) && defined(i386) && !defined(SCO325)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) +#if defined(CRAY) || (defined(SYSV) && defined(i386) && !defined(__SCO__)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) #define READV(ciptr, iov, iovcnt) TRANS(ReadV)(ciptr, iov, iovcnt) @@ -400,7 +400,7 @@ static int TRANS(ReadV)( #endif /* CRAY || (SYSV && i386) || WIN32 || __sxg__ || */ -#if defined(CRAY) || (defined(SYSV) && defined(i386) && !defined(SCO325)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) +#if defined(CRAY) || (defined(SYSV) && defined(i386) && !defined(__SCO__)) || defined(WIN32) || defined(__sxg__) || defined(__UNIXOS2__) #define WRITEV(ciptr, iov, iovcnt) TRANS(WriteV)(ciptr, iov, iovcnt) Index: lib/xtrans/Xtranslcl.c =================================================================== RCS file: /cvs/xorg/xc/lib/xtrans/Xtranslcl.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 Xtranslcl.c --- lib/xtrans/Xtranslcl.c 19 Aug 2005 23:53:22 -0000 1.3 +++ lib/xtrans/Xtranslcl.c 7 Nov 2005 06:01:07 -0000 @@ -146,8 +146,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr if ((sunaddr = (struct sockaddr_un *) xalloc (ciptr->addrlen)) == NULL) { - PRMSG(1,"FillAddrInfo: failed to allocate memory for addr\n", - 0,0,0); + PRMSG(1,"FillAddrInfo: failed to allocate memory for addr\n", 0, 0, 0); return 0; } @@ -198,7 +197,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr /* PTS */ -#if defined(SYSV) && !defined(sco) && !defined(SCO) && !defined(ISC) +#if defined(SYSV) && !defined(__SCO__) && !defined(ISC) #define SIGNAL_T int #else #define SIGNAL_T void @@ -244,7 +243,7 @@ static void _dummy(int sig) #endif /* - * ISC and SCO are only defined for X11 since they are there for + * ISC is only defined for X11 since they are there for * backwards binary compatability only. */ @@ -257,6 +256,8 @@ static void _dummy(int sig) #if defined(XIM_t) #define PTSNODENAME "/dev/X/XIM." #define NAMEDNODENAME "/dev/X/NXIM." +#define SCORNODENAME "/dev/XIM.%sR" +#define SCOSNODENAME "/dev/XIM.%sS" #endif #if defined(FS_t) || defined (FONT_t) /* @@ -265,14 +266,20 @@ static void _dummy(int sig) */ #define PTSNODENAME "/dev/X/fontserver." #define NAMEDNODENAME "/dev/X/Nfontserver." +#define SCORNODENAME "/dev/fontserver.%sR" +#define SCOSNODENAME "/dev/fontserver.%sS" #endif #if defined(ICE_t) #define PTSNODENAME "/dev/X/ICE." #define NAMEDNODENAME "/dev/X/NICE." +#define SCORNODENAME "/dev/ICE.%sR" +#define SCOSNODENAME "/dev/ICE.%sS" #endif #if defined(TEST_t) #define PTSNODENAME "/dev/X/transtest." #define NAMEDNODENAME "/dev/X/Ntranstest." +#define SCORNODENAME "/dev/transtest.%sR" +#define SCOSNODENAME "/dev/transtest.%sS" #endif @@ -394,8 +401,7 @@ TRANS(PTSOpenClient)(XtransConnInfo cipt if (ret != 1) { PRMSG(1, - "PTSOpenClient: failed to get acknoledgement from server\n", - 0,0,0); + "PTSOpenClient: failed to get acknoledgement from server\n", 0, 0, 0); (void) close(fd); fd = -1; } @@ -406,8 +412,7 @@ TRANS(PTSOpenClient)(XtransConnInfo cipt if (TRANS(FillAddrInfo) (ciptr, slave, server_path) == 0) { - PRMSG(1,"PTSOpenClient: failed to fill in addr info\n", - 0,0,0); + PRMSG(1,"PTSOpenClient: failed to fill in addr info\n", 0, 0, 0); close(fd); return -1; } @@ -517,8 +522,7 @@ TRANS(PTSOpenServer)(XtransConnInfo cipt if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) { - PRMSG(1,"PTSOpenServer: failed to fill in addr info\n", - 0,0,0); + PRMSG(1,"PTSOpenServer: failed to fill in addr info\n", 0, 0, 0); close(fd); return -1; } @@ -842,11 +846,8 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, #ifndef sun -/* SCO doesnt use the ISC transport type - it causes problems */ -#ifndef SCO325 - /* - * connect_spipe is used by the ISC connection type. + * connect_spipe is used by the SCO and ISC connection types. */ static int connect_spipe(int fd1, int fd2) @@ -871,7 +872,7 @@ connect_spipe(int fd1, int fd2) } /* - * named_spipe is used by ISC connection type. + * named_spipe is used by the SCO and ISC connection types. */ static int @@ -897,6 +898,9 @@ named_spipe(int fd, char *path) return(ret); } +/* SCO doesnt use the ISC transport type - it causes problems */ +#if !defined(__SCO__) && !defined(__UNIXWARE__) + /* ISC */ @@ -1001,8 +1005,7 @@ TRANS(ISCOpenClient)(XtransConnInfo cipt if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) { - PRMSG(1,"ISCOpenClient: failed to fill in addr info\n", - 0,0,0); + PRMSG(1,"ISCOpenClient: failed to fill in addr info\n", 0, 0, 0); close(fd); return -1; } @@ -1119,8 +1122,7 @@ TRANS(ISCOpenServer)(XtransConnInfo cipt if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) { - PRMSG(1,"ISCOpenServer: failed to fill in addr info\n", - 0,0,0); + PRMSG(1,"ISCOpenServer: failed to fill in addr info\n", 0, 0, 0); close(fd); return -1; } @@ -1181,7 +1183,7 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, X } #endif /* TRANS_SERVER */ -#endif /* !SCO325 */ +#endif /* !__SCO__ && !__UNIXWARE__ */ /* SCO */ @@ -1193,6 +1195,12 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, X * This greatly helps inter-operability between X11R6 and X11R5 (the native * SCO server). Mainly, it relies on streams nodes existing in /dev, not * creating them or unlinking them, which breaks the native X server. + * + * However, this is only for the X protocol. For all other protocols, we + * do in fact create the nodes, as only X11R6 will use them, and this makes + * it possible to have both types of clients running, otherwise we get all + * kinds of nasty errors on startup for anything that doesnt use the X + * protocol (like SM, when KDE starts up). */ #ifdef TRANS_CLIENT @@ -1211,9 +1219,11 @@ TRANS(SCOOpenClient)(XtransConnInfo cipt #endif PRMSG(2,"SCOOpenClient(%s)\n", port, 0,0 ); + if (!port || !port[0]) + port = "0"; #if !defined(SCORNODENAME) - PRMSG(1,"SCOOpenClient: Protocol is not supported by a SCO connection\n", 0,0,0); + PRMSG(2,"SCOOpenClient: Protocol is not supported by a SCO connection\n", 0,0,0); return -1; #else (void) sprintf(server_path, SCORNODENAME, port); @@ -1263,11 +1273,12 @@ TRANS(SCOOpenClient)(XtransConnInfo cipt * Everything looks good: fill in the XtransConnInfo structure. */ +#if defined(X11_t) && defined(__SCO__) ciptr->flags |= TRANS_NOUNLINK; +#endif if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) { - PRMSG(1,"SCOOpenClient: failed to fill addr info\n", - 0,0,0); + PRMSG(1,"SCOOpenClient: failed to fill addr info\n", 0, 0, 0); close(fd); return -1; } @@ -1291,11 +1302,11 @@ TRANS(SCOOpenServer)(XtransConnInfo cipt struct flock mylock; int fdr = -1; int fds = -1; - long temp; - struct strfdinsert sbuf; #endif PRMSG(2,"SCOOpenServer(%s)\n", port, 0,0 ); + if (!port || !port[0]) + port = "0"; #if !defined(SCORNODENAME) PRMSG(1,"SCOOpenServer: Protocol is not supported by a SCO connection\n", 0,0,0); @@ -1304,9 +1315,34 @@ TRANS(SCOOpenServer)(XtransConnInfo cipt (void) sprintf(serverR_path, SCORNODENAME, port); (void) sprintf(serverS_path, SCOSNODENAME, port); +#if !defined(X11_t) || !defined(__SCO__) + unlink(serverR_path); + unlink(serverS_path); + + if ((fds = open(DEV_SPX, O_RDWR)) < 0 || + (fdr = open(DEV_SPX, O_RDWR)) < 0 ) { + PRMSG(1,"SCOOpenServer: failed to open %s\n", DEV_SPX, 0,0 ); + return -1; + } + + if (named_spipe (fds, serverS_path) == -1) { + PRMSG(1,"SCOOpenServer: failed to create %s\n", serverS_path, 0, 0); + close (fdr); + close (fds); + return -1; + } + + if (named_spipe (fdr, serverR_path) == -1) { + PRMSG(1,"SCOOpenServer: failed to create %s\n", serverR_path, 0, 0); + close (fdr); + close (fds); + return -1; + } +#else /* X11_t */ + fds = open (serverS_path, O_RDWR | O_NDELAY); if (fds < 0) { - PRMSG(1,"SCOOpenServer: failed to open %s", serverS_path, 0, 0); + PRMSG(1,"SCOOpenServer: failed to open %s\n", serverS_path, 0, 0); return -1; } @@ -1319,30 +1355,22 @@ TRANS(SCOOpenServer)(XtransConnInfo cipt mylock.l_start = 0; mylock.l_len = 0; if (fcntl (fds, F_SETLK, &mylock) < 0) { - PRMSG(1,"SCOOpenServer: failed to lock %s", serverS_path, 0, 0); + PRMSG(1,"SCOOpenServer: failed to lock %s\n", serverS_path, 0, 0); close (fds); return -1; } fdr = open (serverR_path, O_RDWR | O_NDELAY); if (fds < 0) { - PRMSG(1,"SCOOpenServer: failed to open %s", serverR_path, 0, 0); + PRMSG(1,"SCOOpenServer: failed to open %s\n", serverR_path, 0, 0); close (fds); return -1; } +#endif /* X11_t */ - sbuf.databuf.maxlen = 0; - sbuf.databuf.len = -1; - sbuf.databuf.buf = NULL; - sbuf.ctlbuf.maxlen = sizeof(long); - sbuf.ctlbuf.len = sizeof(long); - sbuf.ctlbuf.buf = (caddr_t)&temp; - sbuf.offset = 0; - sbuf.flags = 0; - sbuf.fildes = fdr; - - if (ioctl(fds, I_FDINSERT, &sbuf) < 0) { - PRMSG(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s", serverS_path, 0, 0); + if (connect_spipe(fds, fdr)) { + PRMSG(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s\n", + serverS_path, 0, 0); close (fdr); close (fds); return -1; @@ -1352,7 +1380,9 @@ TRANS(SCOOpenServer)(XtransConnInfo cipt * Everything looks good: fill in the XtransConnInfo structure. */ +#if defined(X11_t) && defined(__SCO__) ciptr->flags |= TRANS_NOUNLINK; +#endif if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0) { PRMSG(1,"SCOOpenServer: failed to fill in addr info\n", 0,0,0); close(fds); @@ -1370,35 +1400,23 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, X { char c; int fd; - long temp; - struct strfdinsert sbuf; PRMSG(2,"SCOAccept(%d)\n", ciptr->fd, 0,0 ); if (read(ciptr->fd, &c, 1) < 0) { - PRMSG(1,"SCOAccept: can't read from client",0,0,0); + PRMSG(1,"SCOAccept: can't read from client\n",0,0,0); *status = TRANS_ACCEPT_MISC_ERROR; return(-1); } if( (fd = open(DEV_SPX, O_RDWR)) < 0 ) { - PRMSG(1,"SCOAccept: can't open \"%s\"",DEV_SPX, 0,0 ); + PRMSG(1,"SCOAccept: can't open \"%s\"\n",DEV_SPX, 0,0 ); *status = TRANS_ACCEPT_MISC_ERROR; return(-1); } - sbuf.databuf.maxlen = 0; - sbuf.databuf.len = -1; - sbuf.databuf.buf = NULL; - sbuf.ctlbuf.maxlen = sizeof(long); - sbuf.ctlbuf.len = sizeof(long); - sbuf.ctlbuf.buf = (caddr_t)&temp; - sbuf.offset = 0; - sbuf.flags = 0; - sbuf.fildes = fd; - - if (ioctl(ciptr->fd, I_FDINSERT, &sbuf) < 0) { - PRMSG(1,"SCOAccept: ioctl(I_FDINSERT) failed", 0, 0, 0); + if (connect_spipe (ciptr->fd, fd) < 0) { + PRMSG(1,"SCOAccept: ioctl(I_FDINSERT) failed\n", 0, 0, 0); close (fd); *status = TRANS_ACCEPT_MISC_ERROR; return -1; @@ -1419,7 +1437,9 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, X } memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); +#if defined(__SCO__) newciptr->flags |= TRANS_NOUNLINK; +#endif newciptr->peeraddrlen=newciptr->addrlen; if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) { @@ -1522,7 +1542,7 @@ TRANS(NAMEDReopenServer)(XtransConnInfo } #ifndef sun -#ifndef SCO325 +#if !defined(__SCO__) && !defined(__UNIXWARE__) static int TRANS(ISCReopenServer)(XtransConnInfo ciptr, int fd, char *port) @@ -1550,7 +1570,7 @@ TRANS(ISCReopenServer)(XtransConnInfo ci #endif /* !ISCDEVNODENAME */ } -#endif /* !SCO325 */ +#endif /* !__SCO__ && !__UNIXWARE__ */ static int TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, char *port) @@ -1561,15 +1581,19 @@ TRANS(SCOReopenServer)(XtransConnInfo ci #endif PRMSG(2,"SCOReopenServer(%s)\n", port, 0,0 ); + if (!port || !port[0]) + port = "0"; #if !defined(SCORNODENAME) - PRMSG(1,"SCOReopenServer: Protocol is not supported by a SCO connection\n", 0,0,0); + PRMSG(2,"SCOReopenServer: Protocol is not supported by a SCO connection\n", 0,0,0); return 0; #else (void) sprintf(serverR_path, SCORNODENAME, port); (void) sprintf(serverS_path, SCOSNODENAME, port); +#if defined(X11_t) && defined(__SCO__) ciptr->flags |= TRANS_NOUNLINK; +#endif if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0) { PRMSG(1, "SCOReopenServer: failed to fill in addr info\n", 0,0,0); @@ -1791,7 +1815,7 @@ static LOCALtrans2dev LOCALtrans2devtab[ #endif /* SVR4 */ #ifndef sun -#ifndef SCO325 +#if !defined(__SCO__) && !defined(__UNIXWARE__) {"isc", #ifdef TRANS_CLIENT TRANS(ISCOpenClient), @@ -1813,7 +1837,7 @@ static LOCALtrans2dev LOCALtrans2devtab[ TRANS(ISCAccept) #endif /* TRANS_SERVER */ }, -#endif /* !SCO325 */ +#endif /* !__SCO__ && !__UNIXWARE__ */ {"sco", #ifdef TRANS_CLIENT @@ -1845,8 +1869,10 @@ static char *XLOCAL=NULL; static char *workingXLOCAL=NULL; static char *freeXLOCAL=NULL; -#ifdef SCO325 +#if defined(__SCO__) #define DEF_XLOCAL "SCO:UNIX:PTS" +#elif defined(__UNIXWARE__) +#define DEF_XLOCAL "UNIX:PTS:NAMED:SCO" #else #define DEF_XLOCAL "UNIX:PTS:NAMED:ISC:SCO" #endif @@ -2396,7 +2422,7 @@ TRANS(LocalBytesReadable)(XtransConnInfo { PRMSG(2,"LocalBytesReadable(%x->%d,%x)\n", ciptr, ciptr->fd, pend); -#if defined(ISC) || defined(SCO) +#if defined(ISC) || defined(SCO325) return ioctl(ciptr->fd, I_NREAD, (char *)pend); #else return ioctl(ciptr->fd, FIONREAD, (char *)pend); @@ -2504,7 +2530,7 @@ static char * local_aliases[] = { # endif "named", # ifndef sun -# ifndef SCO325 +# if !defined(__SCO__) && !defined(__UNIXWARE__) "isc", # endif "sco", @@ -2637,7 +2663,7 @@ Xtransport TRANS(NAMEDFuncs) = { }; #ifndef sun -#ifndef SCO325 +#if !defined(__SCO__) && !defined(__UNIXWARE__) Xtransport TRANS(ISCFuncs) = { /* Local Interface */ "isc", @@ -2677,7 +2703,7 @@ Xtransport TRANS(ISCFuncs) = { TRANS(LocalClose), TRANS(LocalCloseForCloning), }; -#endif /* !SCO325 */ +#endif /* !__SCO__ && !__UNIXWARE__ */ Xtransport TRANS(SCOFuncs) = { /* Local Interface */ "sco", Index: lib/xtrans/Xtranssock.c =================================================================== RCS file: /cvs/xorg/xc/lib/xtrans/Xtranssock.c,v retrieving revision 1.10 diff -u -3 -p -u -r1.10 Xtranssock.c --- lib/xtrans/Xtranssock.c 3 Oct 2005 17:45:28 -0000 1.10 +++ lib/xtrans/Xtranssock.c 7 Nov 2005 06:01:07 -0000 @@ -99,11 +99,11 @@ from the copyright holders. #endif /* !NO_TCP_H */ #include -#if defined(SVR4) && !defined(SCO325) && !defined(DGUX) && !defined(_SEQUENT_) +#if defined(SVR4) && !defined(DGUX) && !defined(_SEQUENT_) #include #endif -#if (defined(i386) && defined(SYSV)) && !defined(sco) && !defined(sun) +#if (defined(i386) && defined(SYSV)) && !defined(SCO325) && !defined(sun) #include #endif @@ -330,7 +330,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo #endif struct sockaddr_in socknamev4; void *socknamePtr; -#if defined(SVR4) || defined(SCO325) +#if defined(SVR4) || defined(__SCO__) size_t namelen; #else int namelen; @@ -405,7 +405,7 @@ TRANS(SocketINETGetPeerAddr) (XtransConn #endif struct sockaddr_in socknamev4; void *socknamePtr; -#if defined(SVR4) || defined(SCO325) +#if defined(SVR4) || defined(__SCO__) size_t namelen; #else int namelen; @@ -1103,7 +1103,7 @@ TRANS(SocketUNIXCreateListener) (XtransC sprintf (sockname.sun_path, "%s%ld", UNIX_PATH, (long)getpid()); } -#if defined(BSD44SOCKETS) && !defined(Lynx) +#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx) sockname.sun_len = strlen(sockname.sun_path); namelen = SUN_LEN(&sockname); #else @@ -1167,7 +1167,7 @@ TRANS(SocketUNIXResetListener) (XtransCo if (stat (unsock->sun_path, &statb) == -1 || ((statb.st_mode & S_IFMT) != -#if (defined (sun) && defined(SVR4)) || defined(NCR) || defined(SCO) || defined(sco) || !defined(S_IFSOCK) +#if (defined (sun) && defined(SVR4)) || defined(NCR) || defined(SCO325) || !defined(S_IFSOCK) S_IFIFO)) #else S_IFSOCK)) @@ -1312,7 +1312,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo { XtransConnInfo newciptr; struct sockaddr_un sockname; -#if defined(SVR4) || defined(SCO325) +#if defined(SVR4) || defined(__SCO__) size_t namelen = sizeof sockname; #else int namelen = sizeof sockname; @@ -1993,7 +1993,7 @@ TRANS(SocketUNIXConnect) (XtransConnInfo return TRANS_CONNECT_FAILED; } -#if defined(BSD44SOCKETS) && !defined(Lynx) +#if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) && !defined(Lynx) sockname.sun_len = strlen (sockname.sun_path); namelen = SUN_LEN (&sockname); #else @@ -2109,7 +2109,7 @@ TRANS(SocketBytesReadable) (XtransConnIn return ret; } #else -#if (defined(i386) && defined(SYSV) && !defined(sco)) || (defined(_SEQUENT_) && _SOCKET_VERSION == 1) +#if (defined(i386) && defined(SYSV) && !defined(SCO325)) || (defined(_SEQUENT_) && _SOCKET_VERSION == 1) return ioctl (ciptr->fd, I_NREAD, (char *) pend); #else #if defined(__UNIXOS2__) Index: lib/xtrans/Xtransutil.c =================================================================== RCS file: /cvs/xorg/xc/lib/xtrans/Xtransutil.c,v retrieving revision 1.7 diff -u -3 -p -u -r1.7 Xtransutil.c --- lib/xtrans/Xtransutil.c 26 Jul 2005 18:55:41 -0000 1.7 +++ lib/xtrans/Xtransutil.c 7 Nov 2005 06:01:07 -0000 @@ -192,6 +192,13 @@ TRANS(ConvertAddress)(int *familyp, int } #endif /* defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN)*/ +#if (defined(__SCO__) || defined(__UNIXWARE__)) && defined(LOCALCONN) + case 0: + { + *familyp=FamilyLocal; + break; + } +#endif default: PRMSG(1,"ConvertAddress: Unknown family type %d\n", Index: programs/Xserver/Xext/xf86bigfont.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xext/xf86bigfont.c,v retrieving revision 1.9 diff -u -3 -p -u -r1.9 xf86bigfont.c --- programs/Xserver/Xext/xf86bigfont.c 3 Jul 2005 08:53:36 -0000 1.9 +++ programs/Xserver/Xext/xf86bigfont.c 7 Nov 2005 06:01:08 -0000 @@ -51,7 +51,7 @@ #ifdef SVR4 #include #endif -#if defined(ISC) || defined(__CYGWIN__) || defined(SCO) || defined(SCO325) +#if defined(ISC) || defined(__CYGWIN__) || defined(__SCO__) #include #include #endif Index: programs/Xserver/Xprint/attributes.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/attributes.c,v retrieving revision 1.13 diff -u -3 -p -u -r1.13 attributes.c --- programs/Xserver/Xprint/attributes.c 12 Jul 2005 03:09:20 -0000 1.13 +++ programs/Xserver/Xprint/attributes.c 7 Nov 2005 06:01:08 -0000 @@ -61,7 +61,7 @@ copyright holders. #include #include -#if (defined(sun) && defined(SVR4)) || (defined(SCO)) +#if (defined(sun) && defined(SVR4)) || defined(__SCO__) || defined(__UNIXWARE__) #include #endif #include "scrnintstr.h" @@ -1377,7 +1377,7 @@ ReplaceAllKeywords( defined(linux) || \ defined(__CYGWIN__) || \ (defined(sun) && !defined(SVR4)) || \ - (defined(SVR4) && !defined(sun) && !defined(USL)) || \ + (defined(SVR4) && !defined(sun) && !defined(__UNIXWARE__)) || \ defined(__UNIXOS2__) || \ defined(ISC) || \ defined(Lynx) || \ Index: programs/Xserver/Xprint/ps/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/Imakefile,v retrieving revision 1.9 diff -u -3 -p -u -r1.9 Imakefile --- programs/Xserver/Xprint/ps/Imakefile 1 Apr 2005 21:45:20 -0000 1.9 +++ programs/Xserver/Xprint/ps/Imakefile 7 Nov 2005 06:01:08 -0000 @@ -20,6 +20,10 @@ TTF2PT1SRCFILE = ttf2pt1wrap.c TTF2PT1OBJFILE = ttf2pt1wrap.o #endif +#if defined(SCOArchitecture) +XTRA_SYS_DEFINES = SCOBuildFlags +#endif + TTF2PT1SRCS = ft.c pt1.c runt1asm.c $(TTF2PT1SRCFILE) TTF2PT1OBJS = ft.o pt1.o runt1asm.o $(TTF2PT1OBJFILE) TTF2PT1_DEFINES = -DUSE_FREETYPE -DXP_ONLY_BLOCKS @@ -66,7 +70,7 @@ XCOMM DEFINES = -DPIXPRIV XCOMM BM_CACHE disabled because it causes PostScript errors XCOMM (see http://xprint.mozdev.org/bugs/show_bug.cgi?id=1489) XCOMM DEFINES = -DPSOUT_USE_DEEPCOLOR -DXP_PSTEXT -DBM_CACHE $(VENDOR_DEFINES) $(TTF2PT1_DEFINES) $(FT_DEFINES) - DEFINES = -UXFree86LOADER -DPSOUT_USE_DEEPCOLOR -DXP_PSTEXT -D_XP_PRINT_SERVER_ $(VENDOR_DEFINES) $(TTF2PT1_DEFINES) $(FT_DEFINES) $(EXT_DEFINES) + DEFINES = -UXFree86LOADER -DPSOUT_USE_DEEPCOLOR -DXP_PSTEXT -D_XP_PRINT_SERVER_ $(VENDOR_DEFINES) $(TTF2PT1_DEFINES) $(FT_DEFINES) $(EXT_DEFINES) $(XTRA_SYS_DEFINES) INCLUDES = -I. -I../../mi -I../../mfb -I$(LIBSRC) \ -I$(XINCLUDESRC) -I../../include -I.. -I$(TOP)/include \ Index: programs/Xserver/hw/xfree86/common/compiler.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/compiler.h,v retrieving revision 1.10 diff -u -3 -p -u -r1.10 compiler.h --- programs/Xserver/hw/xfree86/common/compiler.h 28 Oct 2005 16:01:17 -0000 1.10 +++ programs/Xserver/hw/xfree86/common/compiler.h 7 Nov 2005 06:01:08 -0000 @@ -1604,18 +1604,8 @@ extern void outl(unsigned int a, unsigne # define asm __asm # endif # endif -# ifdef SVR4 -#if 0 -# include -#endif -# ifndef __HIGHC__ -# if !defined(__USLC__) && !defined(__SUNPRO_C) -# define __USLC__ -# endif -# endif -# endif # ifndef SCO325 -# if defined(USL) +# if defined(__UNIXWARE__) # if defined(IN_MODULE) # /* avoid including for on UnixWare */ # define ushort unsigned short @@ -1627,15 +1617,15 @@ extern void outl(unsigned int a, unsigne # else # include # endif /* IN_MODULE */ -# endif /* USL */ +# endif /* __UNIXWARE__ */ # if !defined(sgi) && !defined(__SUNPRO_C) # include # endif # else # include "scoasm.h" # endif -# if !defined(__HIGHC__) && !defined(SCO325) && !defined(sgi) && \ - !defined(__SUNPRO_C) +# if (!defined(__HIGHC__) && !defined(sgi) && !defined(__SUNPRO_C)) || \ + defined(__USLC__) # pragma asm partial_optimization outl # pragma asm partial_optimization outw # pragma asm partial_optimization outb Index: programs/Xserver/hw/xfree86/common/scoasm.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/scoasm.h,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 scoasm.h --- programs/Xserver/hw/xfree86/common/scoasm.h 3 Jul 2005 07:01:24 -0000 1.2 +++ programs/Xserver/hw/xfree86/common/scoasm.h 7 Nov 2005 06:01:08 -0000 @@ -35,7 +35,7 @@ #include #endif -#ifdef SCO325 +#if defined(__SCO__) && defined(__USLC__) #ifndef _SCOASM_HDR_INC #define _SCOASM_HDR_INC @@ -140,4 +140,4 @@ asm int inb(port) } #endif /* _SCOASM_HDR_INC */ -#endif /* SCO325 */ +#endif /* __SCO__ && __USLC__ */ Index: programs/Xserver/hw/xfree86/common/xf86Config.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v retrieving revision 1.15 diff -u -3 -p -u -r1.15 xf86Config.c --- programs/Xserver/hw/xfree86/common/xf86Config.c 9 Oct 2005 23:47:52 -0000 1.15 +++ programs/Xserver/hw/xfree86/common/xf86Config.c 7 Nov 2005 06:01:09 -0000 @@ -1106,6 +1106,11 @@ configInputKbd(IDevPtr inputp) MessageType from = X_DEFAULT; Bool customKeycodesDefault = FALSE; int verb = 0; +#if defined(XQUEUE) + char *kbdproto = "Xqueue"; +#else + char *kbdproto = "standard"; +#endif /* Initialize defaults */ xf86Info.xleds = 0L; @@ -1146,17 +1151,26 @@ configInputKbd(IDevPtr inputp) xf86Info.xkbgeometry = NULL; #endif - s = xf86SetStrOption(inputp->commonOptions, "Protocol", "standard"); + s = xf86SetStrOption(inputp->commonOptions, "Protocol", kbdproto); if (xf86NameCmp(s, "standard") == 0) { xf86Info.kbdProc = xf86KbdProc; xf86Info.kbdEvents = xf86KbdEvents; xfree(s); } else if (xf86NameCmp(s, "xqueue") == 0) { +#ifdef __UNIXWARE__ + /* + * To retain compatibility with older config files, on UnixWare, we + * accept the xqueue protocol but use the normal keyboard procs. + */ + xf86Info.kbdProc = xf86KbdProc; + xf86Info.kbdEvents = xf86KbdEvents; +#else #ifdef XQUEUE xf86Info.kbdProc = xf86XqueKbdProc; xf86Info.kbdEvents = xf86XqueEvents; xf86Msg(X_CONFIG, "Xqueue selected for keyboard input\n"); #endif +#endif xfree(s); #ifdef WSCONS_SUPPORT } else if (xf86NameCmp(s, "wskbd") == 0) { Index: programs/Xserver/hw/xfree86/common/xf86Configure.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v retrieving revision 1.14 diff -u -3 -p -u -r1.14 xf86Configure.c --- programs/Xserver/hw/xfree86/common/xf86Configure.c 3 Oct 2005 16:46:13 -0000 1.14 +++ programs/Xserver/hw/xfree86/common/xf86Configure.c 7 Nov 2005 06:01:09 -0000 @@ -76,8 +76,11 @@ Bool foundMouse = FALSE; #if defined(__UNIXOS2__) #define DFLT_MOUSE_DEV "mouse$" #define DFLT_MOUSE_PROTO "OS2Mouse" -#elif defined(SCO) +#elif defined(__SCO__) static char *DFLT_MOUSE_PROTO = "OSMouse"; +#elif defined(__UNIXWARE__) +static char *DFLT_MOUSE_PROTO = "Xqueue"; +static char *DFLT_MOUSE_DEV = "/dev/mouse"; #elif defined(QNX4) static char *DFLT_MOUSE_PROTO = "OSMouse"; static char *DFLT_MOUSE_DEV = "/dev/mouse"; @@ -294,7 +297,7 @@ configureInputSection (void) } #endif -#ifndef SCO +#ifndef __SCO__ fd = open(DFLT_MOUSE_DEV, 0); if (fd != -1) { foundMouse = TRUE; @@ -311,12 +314,14 @@ configureInputSection (void) mouse->inp_driver = "mouse"; mouse->inp_option_lst = xf86addNewOption(mouse->inp_option_lst, "Protocol", DFLT_MOUSE_PROTO); -#ifndef SCO +#ifndef __SCO__ mouse->inp_option_lst = xf86addNewOption(mouse->inp_option_lst, "Device", DFLT_MOUSE_DEV); -#endif +#ifndef __UNIXWARE__ mouse->inp_option_lst = xf86addNewOption(mouse->inp_option_lst, "ZAxisMapping", "4 5 6 7"); +#endif +#endif ptr = (XF86ConfInputPtr)xf86addListItem((glp)ptr, (glp)mouse); return ptr; } @@ -885,7 +890,7 @@ DoConfigure() #ifdef __UNIXOS2__ #define PATH_MAX 2048 #endif -#if defined(SCO) || defined(SCO325) +#if !defined(PATH_MAX) #define PATH_MAX 1024 #endif const char* configfile = XF86CONFIGFILE".new"; @@ -1009,13 +1014,13 @@ DoConfigure() ErrorF("\n"); -#ifdef SCO +#ifdef __SCO__ ErrorF("\n"__XSERVERNAME__ " is using the kernel event driver to access the mouse.\n" "If you wish to use the internal "__XSERVERNAME__ - "mouse drivers, please\n" + " mouse drivers, please\n" "edit the file and correct the Device.\n"); -#else /* !SCO */ +#else /* !__SCO__ */ if (!foundMouse) { ErrorF("\n"__XSERVERNAME__" is not able to detect your mouse.\n" "Edit the file and correct the Device.\n"); @@ -1028,7 +1033,7 @@ DoConfigure() "the protocol.\n",DFLT_MOUSE_DEV); #endif } -#endif /* !SCO */ +#endif /* !__SCO__ */ if (xf86NumScreens > 1) { ErrorF("\n"__XSERVERNAME__ Index: programs/Xserver/hw/xfree86/common/xf86Events.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v retrieving revision 1.20 diff -u -3 -p -u -r1.20 xf86Events.c --- programs/Xserver/hw/xfree86/common/xf86Events.c 27 Oct 2005 21:03:27 -0000 1.20 +++ programs/Xserver/hw/xfree86/common/xf86Events.c 7 Nov 2005 06:01:09 -0000 @@ -364,7 +364,7 @@ xf86ProcessActionEvent(ActionEvent actio case ACTION_SWITCHSCREEN: if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) { int vtno = *((int *) arg); -#ifdef SCO +#if defined(__SCO__) || defined(__UNIXWARE__) vtno--; #endif #if defined(QNX4) @@ -377,12 +377,13 @@ xf86ProcessActionEvent(ActionEvent actio break; case ACTION_SWITCHSCREEN_NEXT: if (VTSwitchEnabled && !xf86Info.dontVTSwitch) { -#if defined(SCO) /* Shouldn't this be true for (sun) && (i386) && (SVR4) ? */ +/* Shouldn't this be true for (sun) && (i386) && (SVR4) ? */ +#if defined(__SCO__) || defined(__UNIXWARE__) if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0) #else if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno + 1) < 0) #endif -#if defined (SCO) || (defined(sun) && defined (i386) && defined (SVR4)) +#if defined (__SCO__) || (defined(sun) && defined (i386) && defined (SVR4)) || defined(__UNIXWARE__) if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 0) < 0) #else if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) < 0) @@ -784,7 +785,7 @@ special: break; #endif -#if defined(linux) || (defined(CSRG_BASED) && (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT))) || defined(SCO) +#if defined(linux) || (defined(CSRG_BASED) && (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT))) || defined(__SCO__) || defined(__UNIXWARE__) /* * Under Linux, the raw keycodes are consumed before the kernel * does any processing on them, so we must emulate the vt switching @@ -923,7 +924,7 @@ special: #endif /* USE_VT_SYSREQ */ -#ifdef SCO +#ifdef __SCO__ /* * With the console in raw mode, SCO will not switch consoles, * you get around this by activating the next console along, if @@ -938,7 +939,7 @@ special: xf86ProcessActionEvent(ACTION_SWITCHSCREEN_NEXT, NULL); return; } -#endif /* SCO */ +#endif /* __SCO__ */ #ifdef XKB } #endif @@ -1104,8 +1105,9 @@ special: Bool xf86CommonSpecialKey(int key, Bool down, int modifiers) { - if ((ModifierIsSet(ControlMask | AltMask)) || - (ModifierIsSet(ControlMask | AltLangMask))) { + if ((!ModifierIsSet(ShiftMask)) && + (((ModifierIsSet(ControlMask | AltMask)) || + (ModifierIsSet(ControlMask | AltLangMask))))) { switch (key) { case KEY_BackSpace: Index: programs/Xserver/hw/xfree86/common/xf86Init.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v retrieving revision 1.27 diff -u -3 -p -u -r1.27 xf86Init.c --- programs/Xserver/hw/xfree86/common/xf86Init.c 5 Nov 2005 18:56:50 -0000 1.27 +++ programs/Xserver/hw/xfree86/common/xf86Init.c 7 Nov 2005 06:01:09 -0000 @@ -906,7 +906,7 @@ InitOutput(ScreenInfo *pScreenInfo, int xf86EnterServerState(SETUP); } } -#ifdef SCO +#ifdef SCO325 else { /* * Under SCO we must ack that we got the console at startup, @@ -919,7 +919,7 @@ InitOutput(ScreenInfo *pScreenInfo, int xf86Msg(X_WARNING, "VT_ACKACQ failed"); } } -#endif /* SCO */ +#endif /* SCO325 */ for (i = 0; i < xf86NumScreens; i++) { xf86EnableAccess(xf86Screens[i]); Index: programs/Xserver/hw/xfree86/doc/sgml/SCO.sgml =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/doc/sgml/SCO.sgml,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 SCO.sgml --- programs/Xserver/hw/xfree86/doc/sgml/SCO.sgml 3 Sep 2004 18:48:11 -0000 1.3 +++ programs/Xserver/hw/xfree86/doc/sgml/SCO.sgml 7 Nov 2005 06:01:09 -0000 @@ -7,7 +7,7 @@ Information for SCO OpenServer Users <author>J. Kean Johnston (jkj@sco.com) -<date>14 February 2003 +<date>1 November 2005 <ident> $XdotOrg: xc/programs/Xserver/hw/xfree86/doc/sgml/SCO.sgml,v 1.2 2004/04/23 19:23:59 eich Exp $ @@ -30,9 +30,9 @@ X11R&relvers, the following conditions m installed, if appropriate. Check the release notes for that update to see whether or not your current operating system requires this update. At least version OSS646B is required. If you are running - SCO OpenServer Release 5.0.7, you must have Maintenance Pack 1 installed. + SCO OpenServer Release 5.0.7, you must have Maintenance Pack 4 installed. <item>Ensure that the "Graphics, Web and X11 Libraries" package is - installed. At least version 1.3.2Ag is required. You should always + installed. At least version 2.1.0Ba is required. You should always install the latest possible version of this supplement that is valid for your operating system release. From time to time this release is bundled with Maintenance Packs, so if you are running 5.0.7 or later, Index: programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 AsmMacros.h --- programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h 23 Apr 2004 19:27:51 -0000 1.2 +++ programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h 7 Nov 2005 06:01:09 -0000 @@ -438,13 +438,13 @@ void outl(U16_t, U32_t); # define __USLC__ # endif # endif -#ifndef SCO325 -# include <sys/inline.h> -#else -# include "../common/scoasm.h" -#endif -#define intr_disable() asm("cli") -#define intr_enable() asm("sti") +# ifndef __SCO__ +# include <sys/inline.h> +# else +# include "../common/scoasm.h" +# endif +# define intr_disable() asm("cli") +# define intr_enable() asm("sti") #endif /* _MINIX and _ACK */ #endif /* __GNUC__ */ Index: programs/Xserver/hw/xfree86/drivers/rendition/vboard.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/rendition/vboard.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 vboard.c --- programs/Xserver/hw/xfree86/drivers/rendition/vboard.c 11 Jul 2005 02:29:58 -0000 1.3 +++ programs/Xserver/hw/xfree86/drivers/rendition/vboard.c 7 Nov 2005 06:01:10 -0000 @@ -13,7 +13,7 @@ #include "vloaduc.h" #include "vos.h" -#if defined(SCO) || defined(SCO325) +#if !defined(PATH_MAX) #define PATH_MAX 1024 #endif Index: programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c,v retrieving revision 1.8 diff -u -3 -p -u -r1.8 savage_cursor.c --- programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c 11 Jul 2005 02:29:59 -0000 1.8 +++ programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c 7 Nov 2005 06:01:10 -0000 @@ -194,7 +194,7 @@ SavageLoadCursorImage( * loading the cursor. */ volatile unsigned int i = ALT_STATUS_WORD0; - (void)i; /* Not to be optimised out */ + (void)i++; /* Not to be optimised out */ } } Index: programs/Xserver/hw/xfree86/etc/mmapr.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/etc/mmapr.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 mmapr.c --- programs/Xserver/hw/xfree86/etc/mmapr.c 23 Apr 2004 19:53:57 -0000 1.2 +++ programs/Xserver/hw/xfree86/etc/mmapr.c 7 Nov 2005 06:01:10 -0000 @@ -38,7 +38,7 @@ # define MAP_FAILED ((void *)(-1)) #endif -#if defined(_SCO_DS) && !defined(_SCO_DS_LL) +#if _SCO_DS - 0 == 1 #define strtoull (unsigned long long)strtoul #endif Index: programs/Xserver/hw/xfree86/etc/mmapw.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/etc/mmapw.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 mmapw.c --- programs/Xserver/hw/xfree86/etc/mmapw.c 23 Apr 2004 19:53:57 -0000 1.2 +++ programs/Xserver/hw/xfree86/etc/mmapw.c 7 Nov 2005 06:01:10 -0000 @@ -38,7 +38,7 @@ # define MAP_FAILED ((void *)(-1)) #endif -#if defined(_SCO_DS) && !defined(_SCO_DS_LL) +#if _SCO_DS - 0 == 1 #define strtoull (unsigned long long)strtoul #endif Index: programs/Xserver/hw/xfree86/input/keyboard/kbd.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/input/keyboard/kbd.c,v retrieving revision 1.17 diff -u -3 -p -u -r1.17 kbd.c --- programs/Xserver/hw/xfree86/input/keyboard/kbd.c 1 Oct 2005 17:30:58 -0000 1.17 +++ programs/Xserver/hw/xfree86/input/keyboard/kbd.c 7 Nov 2005 06:01:10 -0000 @@ -139,7 +139,11 @@ static const OptionInfoRec KeyboardOptio #endif static const char *kbdDefaults[] = { +#ifdef XQUEUE + "Protocol", "Xqueue", +#else "Protocol", "standard", +#endif "AutoRepeat", "500 30", "XkbRules", __XKBDEFRULES__, "XkbModel", "pc105", @@ -150,7 +154,11 @@ static const char *kbdDefaults[] = { }; static const char *kbd98Defaults[] = { +#ifdef XQUEUE + "Protocol", "Xqueue", +#else "Protocol", "standard", +#endif "AutoRepeat", "500 30", "XkbRules", "xfree98", "XkbModel", "pc98", Index: programs/Xserver/hw/xfree86/input/mouse/mouse.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v retrieving revision 1.13 diff -u -3 -p -u -r1.13 mouse.c --- programs/Xserver/hw/xfree86/input/mouse/mouse.c 31 Aug 2005 23:38:47 -0000 1.13 +++ programs/Xserver/hw/xfree86/input/mouse/mouse.c 7 Nov 2005 06:01:10 -0000 @@ -535,7 +535,11 @@ MouseCommonOptions(InputInfoPtr pInfo) } } +#if defined(__SCO__) || defined(__UNIXWARE__) + s = xf86SetStrOption(pInfo->options, "ZAxisMapping", 0); +#else s = xf86SetStrOption(pInfo->options, "ZAxisMapping", "4 5 6 7"); +#endif if (s) { int b1 = 0, b2 = 0, b3 = 0, b4 = 0; char *msg = NULL; Index: programs/Xserver/hw/xfree86/loader/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/loader/Imakefile,v retrieving revision 1.10 diff -u -3 -p -u -r1.10 Imakefile --- programs/Xserver/hw/xfree86/loader/Imakefile 18 Oct 2005 04:02:31 -0000 1.10 +++ programs/Xserver/hw/xfree86/loader/Imakefile 7 Nov 2005 06:01:10 -0000 @@ -82,6 +82,19 @@ NormalLibraryTarget(xloader,$(XOBJS) ) SpecialCObjectRule(loadmod,NullParameter,$(MODULEDEFINES) $(EXT_DEFINES)) SpecialCObjectRule(dixsym,NullParameter,$(EXT_DEFINES)) +#if defined(USLArchitecture) && !HasGcc +XCOMM Copy libcrt.a from uccs since it will be missing in a +XCOMM runtime-only environment +libcrt.a: /usr/ccs/lib/libcrt.a + rm -f libcrt.a + cp /usr/ccs/lib/libcrt.a libcrt.a + +InstallLibraryModule(crt,$(MODULEDIR),.) + +XCOMM loader needs to know the location of modules to load libcrt.a +SpecialCObjectRule(loader,NullParameter,$(MODULEDEFINES)) +#endif + #if ProPoliceSupport SpecialCObjectRule(xf86sym,NullParameter,$(SSPOPTIONS) $(EXT_DEFINES)) #else Index: programs/Xserver/hw/xfree86/loader/loader.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/loader/loader.c,v retrieving revision 1.9 diff -u -3 -p -u -r1.9 loader.c --- programs/Xserver/hw/xfree86/loader/loader.c 26 Aug 2005 06:23:41 -0000 1.9 +++ programs/Xserver/hw/xfree86/loader/loader.c 7 Nov 2005 06:01:10 -0000 @@ -402,6 +402,26 @@ LoaderInit(void) */ mallopt(M_MMAP_MAX, 0); #endif +#if defined(__UNIXWARE__) && !defined(__GNUC__) + /* For UnixWare we need to load the C Runtime libraries which are + * normally auto-linked by the compiler. Otherwise we are bound to + * see unresolved symbols when trying to use the type "long long". + * Obviously, this does not apply if the GNU C compiler is used. + */ + { + int errmaj, errmin, wasLoaded; /* place holders */ + char *xcrtpath = DEFAULT_MODULE_PATH "/libcrt.a"; + char *uwcrtpath = "/usr/ccs/lib/libcrt.a"; + char *path; + struct stat st; + + if(stat(xcrtpath, &st) < 0) + path = uwcrtpath; /* fallback: try to get libcrt.a from the uccs */ + else + path = xcrtpath; /* get the libcrt.a we compiled with */ + LoaderOpen (path, "libcrt", 0, &errmaj, &errmin, &wasLoaded); + } +#endif } /* Index: programs/Xserver/hw/xfree86/loader/os.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/loader/os.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 os.c --- programs/Xserver/hw/xfree86/loader/os.c 3 Jul 2005 07:01:29 -0000 1.2 +++ programs/Xserver/hw/xfree86/loader/os.c 7 Nov 2005 06:01:10 -0000 @@ -50,7 +50,7 @@ #define OSNAME "lynxos" #elif defined(__GNU__) #define OSNAME "hurd" -#elif defined(SCO) +#elif defined(__SCO__) #define OSNAME "sco" #elif defined(DGUX) #define OSNAME "dgux" @@ -58,6 +58,8 @@ #define OSNAME "isc" #elif defined(SVR4) && defined(sun) #define OSNAME "solaris" +#elif defined(SVR5) +#define OSNAME "svr5" #elif defined(SVR4) #define OSNAME "svr4" #elif defined(__UNIXOS2__) Index: programs/Xserver/hw/xfree86/os-support/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/Imakefile,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 Imakefile --- programs/Xserver/hw/xfree86/os-support/Imakefile 3 Oct 2005 16:46:14 -0000 1.4 +++ programs/Xserver/hw/xfree86/os-support/Imakefile 7 Nov 2005 06:01:11 -0000 @@ -51,6 +51,8 @@ OS_SUBDIR = pmax OS_SUBDIR = dgux # elif defined(SGIArchitecture) OS_SUBDIR = irix +# elif defined(UnixWareArchitecture) +OS_SUBDIR = usl # else OS_SUBDIR = sysv # endif Index: programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v retrieving revision 1.12 diff -u -3 -p -u -r1.12 xf86_OSlib.h --- programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h 3 Oct 2005 16:46:14 -0000 1.12 +++ programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h 7 Nov 2005 06:01:11 -0000 @@ -118,7 +118,7 @@ typedef signed long xf86ssize_t; # include <termio.h> # include <sys/stat.h> # include <sys/types.h> -# if defined(SCO) || defined(ISC) +# if defined(__SCO__) || defined(ISC) # include <sys/param.h> # endif @@ -176,7 +176,7 @@ typedef signed long xf86ssize_t; # if !defined(sun) # include <sys/emap.h> # endif -# if defined(SCO) +# if defined(SCO325) # include <sys/vtkd.h> # include <sys/console.h> # include <sys/scankbd.h> @@ -203,16 +203,16 @@ typedef signed long xf86ssize_t; # define LED_NUM LED_NUM_LOCK # define LED_SCR LED_SCROLL_LOCK # define LED_COMP LED_COMPOSE -# endif /* SCO */ +# endif /* sun */ # if !defined(VT_ACKACQ) # define VT_ACKACQ 2 # endif /* !VT_ACKACQ */ -# if defined(SCO) +# if defined(__SCO__) # include <sys/sysmacros.h> # define POSIX_TTY -# endif /* SCO */ +# endif /* __SCO__ */ # if defined(SVR4) || defined(SCO325) # include <sys/mman.h> @@ -243,9 +243,11 @@ typedef signed long xf86ssize_t; # define i386 /* not defined in ANSI C mode */ # endif /* ATT && !i386 */ -# if (defined(ATT) || defined(SVR4)) && !defined(sun) && !defined(SCO325) -# ifndef XQUEUE -# define XQUEUE +# if (defined(ATT) || defined(SVR4)) && !defined(sun) +# ifndef __UNIXWARE__ +# ifndef XQUEUE +# define XQUEUE +# endif # endif # include <sys/xque.h> # endif /* ATT || SVR4 */ Index: programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v retrieving revision 1.7 diff -u -3 -p -u -r1.7 xf86_OSproc.h --- programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h 24 Aug 2005 11:18:31 -0000 1.7 +++ programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h 7 Nov 2005 06:01:11 -0000 @@ -136,6 +136,10 @@ extern void xf86WrapperInit(void); #include <X11/Xfuncproto.h> #include "opaque.h" +#if defined(XQUEUE) +#include "input.h" /* for DeviceIntPtr */ +#endif + _XFUNCPROTOBEGIN /* public functions */ Index: programs/Xserver/hw/xfree86/os-support/xf86_ansic.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 xf86_ansic.h --- programs/Xserver/hw/xfree86/os-support/xf86_ansic.h 24 Aug 2005 11:18:31 -0000 1.5 +++ programs/Xserver/hw/xfree86/os-support/xf86_ansic.h 7 Nov 2005 06:01:11 -0000 @@ -55,7 +55,8 @@ #if defined(XFree86LOADER) || defined(NEED_XF86_TYPES) -#if !defined(SYSV) && !defined(SVR4) && !defined(Lynx) || defined(SCO) +#if !defined(SYSV) && !defined(SVR4) && !defined(Lynx) || \ + defined(__SCO__) || defined(__UNIXWARE__) #define HAVE_VSSCANF #define HAVE_VFSCANF #endif Index: programs/Xserver/hw/xfree86/os-support/sco/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 Imakefile --- programs/Xserver/hw/xfree86/os-support/sco/Imakefile 23 Apr 2004 19:54:12 -0000 1.2 +++ programs/Xserver/hw/xfree86/os-support/sco/Imakefile 7 Nov 2005 06:01:11 -0000 @@ -10,12 +10,13 @@ XCOMM $XConsortium: Imakefile /main/4 19 SRCS = sco_init.c sco_video.c sco_io.c sco_iop.c sco_mouse.c VTsw_sco.c \ std_kbdEv.c posix_tty.c bios_mmap.c vidmem.c \ libc_wrapper.c stdResource.c stdPci.c sigiostubs.c pm_noop.c \ - kmod_noop.c agp_noop.c + kmod_noop.c agp_noop.c sco_kbd.c at_scancode.c sco_KbdMap.c OBJS = sco_init.o sco_video.o sco_io.o sco_iop.o sco_mouse.o VTsw_sco.o \ std_kbdEv.o posix_tty.o bios_mmap.o vidmem.o \ libc_wrapper.o stdResource.o stdPci.o sigiostubs.o pm_noop.o \ - kmod_noop.o agp_noop.o + kmod_noop.o agp_noop.o sco_kbd.o at_scancode.o sco_KbdMap.o \ + sco_event.o INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \ -I$(SERVERSRC)/mi -I$(XINCLUDESRC) -I$(EXTINCSRC) @@ -27,8 +28,20 @@ DEFINES = $(RESDEFINES) SubdirLibraryRule($(OBJS)) NormalLibraryObjectRule() +XCOMM Hack for SCO platforms to get around a bug in GNU ld. The server needs +XCOMM to link with -levent for the event driver interface. However, that is +XCOMM a COFF-only library, and GCC/GNU ld only deal with ELF. Theoretically, +XCOMM GNU ld will convert COFF to ELF on the fly, but it gets it wrong. The +XCOMM SCO link editor gets it right. So we create an object here that the +XCOMM server can link against. +sco_event.o: + @ar x /usr/lib/libevent.a mouse.o + @/usr/ccs/bin/elf/ld -r -o sco_event.o mouse.o + @rm -f mouse.o + LinkSourceFile(bios_mmap.c,../shared) LinkSourceFile(std_kbdEv.c,../shared) +LinkSourceFile(at_scancode.c,../shared) LinkSourceFile(posix_tty.c,../shared) LinkSourceFile(libc_wrapper.c,../shared) LinkSourceFile(stdResource.c,../shared) Index: programs/Xserver/hw/xfree86/os-support/sco/VTsw_sco.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/sco/VTsw_sco.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 VTsw_sco.c --- programs/Xserver/hw/xfree86/os-support/sco/VTsw_sco.c 3 Jul 2005 07:01:35 -0000 1.4 +++ programs/Xserver/hw/xfree86/os-support/sco/VTsw_sco.c 7 Nov 2005 06:01:11 -0000 @@ -58,7 +58,7 @@ xf86VTRequest(int sig) } Bool -xf86VTSwitchPending() +xf86VTSwitchPending(void) { return(xf86Info.vtRequestsPending ? TRUE : FALSE); } @@ -72,7 +72,7 @@ static int sco_ledstatus = -1; static unsigned int sco_ledstate = 0; Bool -xf86VTSwitchAway() +xf86VTSwitchAway(void) { ev_flush(); ev_suspend(); @@ -93,7 +93,7 @@ xf86VTSwitchAway() * switched away. */ Bool -xf86VTSwitchTo() +xf86VTSwitchTo(void) { ev_resume(); Index: programs/Xserver/hw/xfree86/os-support/sco/sco_KbdMap.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/sco/sco_KbdMap.c diff -N programs/Xserver/hw/xfree86/os-support/sco/sco_KbdMap.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/sco/sco_KbdMap.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,304 @@ +/* $XFree86$ */ +/* + * Copyright 2005 by J. Kean Johnston <jkj@sco.com> + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name J. Kean Johnston not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. J. Kean Johnston makes no + * representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Based on xf86KbdMap.c, which is + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. + * Copyright (c) 1992-2003 by The XFree86 Project, Inc. + */ + +#include "X.h" +#include "Xmd.h" +#include "input.h" +#include "scrnintstr.h" + +#include "compiler.h" + +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86_OSlib.h" +#include "xf86Xinput.h" +#include "xf86OSKbd.h" +#include "atKeynames.h" +#include "xf86Keymap.h" + +#include "sco_kbd.h" + +#define KD_GET_ENTRY(i,n) \ + eascii_to_x[((priv->keymap.key[i].spcl << (n+1)) & 0x100) + priv->keymap.key[i].map[n]] + +/* + * NOTE: Not all possible remappable symbols are remapped. There are two main + * reasons: + * a) The mapping between scancode and SYSV/386 - symboltable + * is inconsistent between different versions and has some + * BIG mistakes. + * b) In X-Windows there is a difference between numpad-keys + * and normal keys. SYSV/386 uses for both kinds of keys + * the same symbol. + * + * Thus only the alpha keypad and the function keys are translated. + * Also CapsLock, NumLock, ScrollLock, Shift, Control & Alt. + */ + +static unsigned char remap[128] = { + 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */ + 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */ + 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */ + 0, 0, 0x69, 0x65, 0, 0, 0, 0, /* 0x70 - 0x77 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */ +}; + +static KeySym eascii_to_x[512] = { + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol, + NoSymbol, XK_Return, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, XK_Escape, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_space, XK_exclam, XK_quotedbl, XK_numbersign, + XK_dollar, XK_percent, XK_ampersand, XK_apostrophe, + XK_parenleft, XK_parenright, XK_asterisk, XK_plus, + XK_comma, XK_minus, XK_period, XK_slash, + XK_0, XK_1, XK_2, XK_3, + XK_4, XK_5, XK_6, XK_7, + XK_8, XK_9, XK_colon, XK_semicolon, + XK_less, XK_equal, XK_greater, XK_question, + XK_at, XK_A, XK_B, XK_C, + XK_D, XK_E, XK_F, XK_G, + XK_H, XK_I, XK_J, XK_K, + XK_L, XK_M, XK_N, XK_O, + XK_P, XK_Q, XK_R, XK_S, + XK_T, XK_U, XK_V, XK_W, + XK_X, XK_Y, XK_Z, XK_bracketleft, + XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore, + XK_grave, XK_a, XK_b, XK_c, + XK_d, XK_e, XK_f, XK_g, + XK_h, XK_i, XK_j, XK_k, + XK_l, XK_m, XK_n, XK_o, + XK_p, XK_q, XK_r, XK_s, + XK_t, XK_u, XK_v, XK_w, + XK_x, XK_y, XK_z, XK_braceleft, + XK_bar, XK_braceright, XK_asciitilde, XK_Delete, + XK_Ccedilla, XK_udiaeresis, XK_eacute, XK_acircumflex, + XK_adiaeresis, XK_agrave, XK_aring, XK_ccedilla, + XK_ecircumflex, XK_ediaeresis, XK_egrave, XK_idiaeresis, + XK_icircumflex, XK_igrave, XK_Adiaeresis, XK_Aring, + XK_Eacute, XK_ae, XK_AE, XK_ocircumflex, + XK_odiaeresis, XK_ograve, XK_ucircumflex, XK_ugrave, + XK_ydiaeresis, XK_Odiaeresis, XK_Udiaeresis, XK_cent, + XK_sterling, XK_yen, XK_paragraph, XK_section, + XK_aacute, XK_iacute, XK_oacute, XK_uacute, + XK_ntilde, XK_Ntilde, XK_ordfeminine, XK_masculine, + XK_questiondown,XK_hyphen, XK_notsign, XK_onehalf, + XK_onequarter, XK_exclamdown, XK_guillemotleft,XK_guillemotright, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_Greek_alpha, XK_ssharp, XK_Greek_GAMMA, XK_Greek_pi, + XK_Greek_SIGMA, XK_Greek_sigma, XK_mu, XK_Greek_tau, + XK_Greek_PHI, XK_Greek_THETA, XK_Greek_OMEGA, XK_Greek_delta, + XK_infinity, XK_Ooblique, XK_Greek_epsilon, XK_intersection, + XK_identical, XK_plusminus, XK_greaterthanequal, XK_lessthanequal, + XK_topintegral, XK_botintegral, XK_division, XK_similarequal, + XK_degree, NoSymbol, NoSymbol, XK_radical, + XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol, + + /* + * special marked entries (256 + x) + */ + + NoSymbol, NoSymbol, XK_Shift_L, XK_Shift_R, + XK_Caps_Lock, XK_Num_Lock, XK_Scroll_Lock, XK_Alt_L, + NoSymbol, XK_Control_L, XK_Alt_L, XK_Alt_R, + XK_Control_L, XK_Control_R, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, XK_F1, + XK_F2, XK_F3, XK_F4, XK_F5, + XK_F6, XK_F7, XK_F8, XK_F9, + XK_F10, XK_F11, XK_F12, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + }; + +/* + * KbdGetMapping -- + * Get the national keyboard mapping. The keyboard type is set, a new map + * and the modifiermap is computed. + */ + +void +KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + ScoKbdPrivPtr priv = (ScoKbdPrivPtr) pKbd->private; + KeySym *k; + int i; + KeySym *pMap = map; + + for (i = 0; i < priv->keymap.n_keys && i < NUM_KEYCODES; i++) { + if (remap[i]) { + k = pMap + (remap[i] << 2); + + k[0] = KD_GET_ENTRY(i,0); /* non-shifed */ + k[1] = KD_GET_ENTRY(i,1); /* shifted */ + k[2] = KD_GET_ENTRY(i,4); /* alt */ + k[3] = KD_GET_ENTRY(i,5); /* alt - shifted */ + + if (k[3] == k[2]) k[3] = NoSymbol; + if (k[2] == k[1]) k[2] = NoSymbol; + if (k[1] == k[0]) k[1] = NoSymbol; + if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol; + } + } + + /* + * compute the modifier map + */ + for (i = 0; i < MAP_LENGTH; i++) + pModMap[i] = NoSymbol; /* make sure it is restored */ + + for (k = pMap, i = MIN_KEYCODE; + i < (NUM_KEYCODES + MIN_KEYCODE); + i++, k += GLYPHS_PER_KEY) { + + switch(*k) { + case XK_Shift_L: + case XK_Shift_R: + pModMap[i] = ShiftMask; + break; + + case XK_Control_L: + case XK_Control_R: + pModMap[i] = ControlMask; + break; + + case XK_Caps_Lock: + pModMap[i] = LockMask; + break; + + case XK_Alt_L: + case XK_Alt_R: + pModMap[i] = AltMask; + break; + + case XK_Num_Lock: + pModMap[i] = NumLockMask; + break; + + case XK_Scroll_Lock: + pModMap[i] = ScrollLockMask; + break; + + /* kana support */ + case XK_Kana_Lock: + case XK_Kana_Shift: + pModMap[i] = KanaMask; + break; + + /* alternate toggle for multinational support */ + case XK_Mode_switch: + pModMap[i] = AltLangMask; + break; + } + } + + pKeySyms->map = pMap; + pKeySyms->mapWidth = GLYPHS_PER_KEY; + pKeySyms->minKeyCode = MIN_KEYCODE; + pKeySyms->maxKeyCode = MAX_KEYCODE; +} Index: programs/Xserver/hw/xfree86/os-support/sco/sco_init.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/sco/sco_init.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 sco_init.c --- programs/Xserver/hw/xfree86/os-support/sco/sco_init.c 3 Jul 2005 07:01:35 -0000 1.4 +++ programs/Xserver/hw/xfree86/os-support/sco/sco_init.c 7 Nov 2005 06:01:11 -0000 @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_init.c,v 3.13 2002/06/03 21:22:10 dawes Exp $ */ /* - * Copyright 2001 by J. Kean Johnston <jkj@sco.com> + * Copyright 2001-2005 by J. Kean Johnston <jkj@sco.com> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -39,19 +39,19 @@ static Bool KeepTty = FALSE; static int VTnum = -1; -static char *vtdevice = NULL; +static char vtdevice[48]; static int sco_console_mode = -1; extern Bool mpxLock; void -xf86OpenConsole() +xf86OpenConsole(void) { - int fd,i, ioctl_ret; + int i, ioctl_ret; struct vt_mode VT; - static char vtname[32]; struct vid_info vidinf; struct sigaction sigvtsw; + char *ttn; if (serverGeneration == 1) { /* check if we're run with euid==0 */ @@ -59,6 +59,9 @@ xf86OpenConsole() FatalError("xf86OpenConsole: Server must be setuid root\n"); } + /* If we are run in the background we will get SIGTTOU. Ignore it. */ + OsSignal (SIGTTOU, SIG_IGN); + /* * Set up the virtual terminal (multiscreen in SCO parlance). * For the actual console itself, screens are numbered from @@ -67,75 +70,37 @@ xf86OpenConsole() * system such as MaxSpeed or SunRiver. Therefore, we should * not make any assumptions about the TTY name we are on, and * instead we rely on ttyname() to give us the real TTY name. - * Previously, XFree86 tried to determine the TTY name manually. + * Previously, we tried to determine the TTY name manually. * This is wrong. The only time we need to futz with the TTY name - * if if we were given the name of a TTY to run on explicity on + * is if we were given the name of a TTY to run on explicity on * the command line. */ if (VTnum == -1) { /* - * We can query the current VT number using CONS_GETINFO. + * No device was specified. We need to query the kernel to see which + * console device we are on (and in fact if we are on a console at all). */ - char *ttn; - - vidinf.size = sizeof(vidinf); - if (ioctl (0, CONS_GETINFO, &vidinf) < 0) { - FatalError ("xf86OpenConsole: Not on a console device " - "or error querying device (%s)\n", strerror (errno)); - } - - VTnum = vidinf.m_num + 1; /* 0-based */ - ttn = ttyname (0); + ttn = ttyname (1); if (ttn == (char *)0) { - ErrorF ("xf86OpenConsole: Error determining TTY name (%s)\n", - strerror(errno)); - snprintf (vtname, sizeof(vtname)-1, "/dev/tty%02d", VTnum); - } else { - strlcpy (vtname, ttn, sizeof(vtname)); - } - vtdevice = vtname; - } else if (VTnum == -2 || VTnum >= 0) { - /* - * An explicit device was specified. Make sure its a console device. - */ - if (VTnum != -2) { - snprintf (vtname, sizeof(vtname)-1, "/dev/tty%02d", VTnum); - vtdevice = vtname; - } - - fd = open (vtdevice, O_RDWR | O_NDELAY, 0); - if (fd < 0) { - FatalError ("xf86OpenConsole: Can not open device '%s' (%s)\n", - vtdevice, strerror(errno)); - } - - vidinf.size = sizeof(vidinf); - if (ioctl (fd, CONS_GETINFO, &vidinf) < 0) { - FatalError ("xf86OpenConsole: '%s' is not a console device " - "or error querying device (%s)\n", vtname, strerror (errno)); + FatalError ("xf86OpenConsole: Could not determine TTY name: %s\n", + strerror(errno)); } - VTnum = vidinf.m_num + 1; /* 0-based */ - close (fd); /* We're done with it for now */ + strlcpy (vtdevice, ttn, sizeof(vtdevice)); + } else if (VTnum >= 0) { + snprintf (vtdevice, sizeof(vtdevice), "/dev/tty%02d", VTnum); } - ErrorF("(using VT%02d device %s)\n\n", VTnum, vtdevice); + /* + * Now we can dispose of stdin/stdout + */ + fclose (stdin); + fclose (stdout); if ((xf86Info.consoleFd = open(vtdevice, O_RDWR | O_NDELAY, 0)) < 0) { - FatalError("xf86OpenConsole: Cannot open %s (%s)\n", vtdevice, - strerror(errno)); - } - - /* Dispose of stdin and stdout */ - if (freopen(vtdevice, "r+", stdin) == (FILE *) NULL) { - FatalError("xf86OpenConsole: Cannot reopen stdin as %s (%s)\n", - vtdevice, strerror(errno)); - } - - if (freopen(vtname, "r+", stdout) == (FILE *) NULL) { - FatalError("xf86OpenConsole: Cannot reopen stdout as %s (%s)\n", - vtdevice, strerror(errno)); + FatalError("xf86OpenConsole: Cannot open %s: %s\n", vtdevice, + strerror(errno)); } /* @@ -145,10 +110,13 @@ xf86OpenConsole() */ vidinf.size = sizeof(vidinf); if (ioctl (xf86Info.consoleFd, CONS_GETINFO, &vidinf) < 0) { - FatalError ("xf86OpenConsole: Failed to query console number (%s)\n", - strerror (errno)); + FatalError ("xf86OpenConsole: %s not a console device " + "or error querying device: %s\n", vtdevice, strerror (errno)); } xf86Info.vtno = vidinf.m_num; + VTnum = vidinf.m_num + 1; /* 0-based */ + + ErrorF("(using VT%02d device %s)\n\n", VTnum, vtdevice); /* We activate the console just in case its not the one we are on */ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) { @@ -161,7 +129,7 @@ xf86OpenConsole() } /* - * Now we get the current mode that the console device is on. We will + * Now we get the current mode that the console device is in. We will * use this later when we close the console device to restore it to * that same mode. */ @@ -227,7 +195,7 @@ xf86OpenConsole() * video card down again after coming out of Xfree86. */ void -xf86CloseConsole() +xf86CloseConsole(void) { struct vt_mode VT; struct sigaction sigvtsw; @@ -310,7 +278,7 @@ xf86ProcessArgument(int argc, char *argv return(0); } else { VTnum = -2; - vtdevice = argv[i]; + strlcpy (vtdevice, argv[i], sizeof(vtdevice)); return(2); } } @@ -318,7 +286,7 @@ xf86ProcessArgument(int argc, char *argv } void -xf86UseMsg() +xf86UseMsg(void) { ErrorF("vtXX use the specified VT number\n"); ErrorF("-crt DEVICE use the specified VT device\n"); Index: programs/Xserver/hw/xfree86/os-support/sco/sco_io.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/sco/sco_io.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 sco_io.c --- programs/Xserver/hw/xfree86/os-support/sco/sco_io.c 3 Jul 2005 07:01:35 -0000 1.4 +++ programs/Xserver/hw/xfree86/os-support/sco/sco_io.c 7 Nov 2005 06:01:11 -0000 @@ -73,7 +73,7 @@ xf86SetKbdLeds(int leds) } int -xf86GetKbdLeds() +xf86GetKbdLeds(void) { int leds; @@ -140,7 +140,7 @@ static uchar_t *sc_mapbuf; static uchar_t *sc_mapbuf2; void -xf86KbdInit() +xf86KbdInit(void) { orig_getsc = 0; if (ioctl (xf86Info.consoleFd, TCGETSC, &orig_getsc) < 0) @@ -214,7 +214,7 @@ xf86KbdInit() } int -xf86KbdOn() +xf86KbdOn(void) { struct termios newtio; @@ -248,7 +248,7 @@ xf86KbdOn() } int -xf86KbdOff() +xf86KbdOff(void) { /* Revert back to original translate scancode mode */ if (use_tcs) @@ -267,11 +267,3 @@ xf86KbdOff() return(xf86Info.consoleFd); } - -#include "xf86OSKbd.h" - -Bool -xf86OSKbdPreInit(InputInfoPtr pInfo) -{ - return FALSE; -} Index: programs/Xserver/hw/xfree86/os-support/sco/sco_iop.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/sco/sco_iop.c,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 sco_iop.c --- programs/Xserver/hw/xfree86/os-support/sco/sco_iop.c 3 Jul 2005 07:01:35 -0000 1.5 +++ programs/Xserver/hw/xfree86/os-support/sco/sco_iop.c 7 Nov 2005 06:01:11 -0000 @@ -66,7 +66,8 @@ extern long sysi86 (int cmd, ...); static Bool IOEnabled = FALSE; -Bool xf86EnableIO(void) +Bool +xf86EnableIO(void) { if (IOEnabled) return TRUE; @@ -80,7 +81,8 @@ Bool xf86EnableIO(void) return TRUE; } -void xf86DisableIO(void) +void +xf86DisableIO(void) { if (!IOEnabled) return; @@ -93,7 +95,8 @@ void xf86DisableIO(void) /* Interrupt Handling section */ /***************************************************************************/ -Bool xf86DisableInterrupts() +Bool +xf86DisableInterrupts(void) { if (!IOEnabled) { if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) @@ -113,7 +116,8 @@ Bool xf86DisableInterrupts() return(TRUE); } -void xf86EnableInterrupts() +void +xf86EnableInterrupts(void) { if (!IOEnabled) { if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) Index: programs/Xserver/hw/xfree86/os-support/sco/sco_kbd.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/sco/sco_kbd.c diff -N programs/Xserver/hw/xfree86/os-support/sco/sco_kbd.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/sco/sco_kbd.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,530 @@ +/* $XFree86$ */ +/* + * Copyright 2005 by J. Kean Johnston <jkj@sco.com> + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name J. Kean Johnston not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. J. Kean Johnston makes no + * representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ +/* $XConsortium$ */ + +/* + * Based on sco_io.c which is + * (C) Copyright 2003 J. Kean Johnston <jkj@sco.com> + * + * Based on lnx_kbd.c which is + * Copyright (c) 2002 by The XFree86 Project, Inc. + * + * Based on the code from lnx_io.c which is + * Copyright 1992 by Orest Zborowski <obz@Kodak.com> + * Copyright 1993 by David Dawes <dawes@xfree86.org> + */ + +#define NEED_EVENTS +#include "X.h" + +#include "compiler.h" + +#define _NEED_SYSI86 +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86OSpriv.h" +#include "xf86_OSlib.h" + +#include "xf86Xinput.h" +#include "xf86OSKbd.h" +#include "atKeynames.h" +#include "sco_kbd.h" + +#include <sys/param.h> +#include <sys/emap.h> +#include <sys/nmap.h> + +static KbdProtocolRec protocols[] = { + { "standard", PROT_STD }, + { NULL, PROT_UNKNOWN_KBD } +}; + +extern Bool VTSwitchEnabled; +#ifdef USE_VT_SYSREQ +extern Bool VTSysreqToggle; +#endif + +static void +SoundBell(InputInfoPtr pInfo, int loudness, int pitch, int duration) +{ + if (loudness && pitch) { + ioctl(pInfo->fd, KIOCSOUND, 1193180 / pitch); + usleep(duration * loudness * 20); + ioctl(pInfo->fd, KIOCSOUND, 0); + } +} + +static void +SetKbdLeds(InputInfoPtr pInfo, int leds) +{ + int real_leds = 0; + static int once = 1; + + /* + * sleep the first time through under SCO. There appears to be a + * timing problem in the driver which causes the keyboard to be lost. + * This usleep stops it from occurring. NOTE: this was in the old code. + * I am not convinced it is true any longer, but it doesn't hurt to + * leave this in here. + */ + if (once) { + usleep(100); + once = 0; + } + +#ifdef LED_CAP + if (leds & XLED1) + real_leds |= LED_CAP; + if (leds & XLED2) + real_leds |= LED_NUM; + if (leds & XLED3) + real_leds |= LED_SCR; +#ifdef LED_COMP + if (leds & XLED4) + real_leds |= LED_COMP; +#else + if (leds & XLED4) + real_leds |= LED_SCR; +#endif +#endif + ioctl(pInfo->fd, KDSETLED, real_leds); +} + +static int +GetKbdLeds(InputInfoPtr pInfo) +{ + int real_leds, leds = 0; + + ioctl(pInfo->fd, KDGETLED, &real_leds); + + if (real_leds & LED_CAP) leds |= XLED1; + if (real_leds & LED_NUM) leds |= XLED2; + if (real_leds & LED_SCR) leds |= XLED3; + + return(leds); +} + +/* + * NOTE: Only OpenServer Release 5.0.6 with Release Supplement 5.0.6A + * and later have the required ioctl. 5.0.6A or higher is HIGHLY + * recommended. The console driver is quite a different beast on that OS. + */ +#undef rate + +static void +SetKbdRepeat(InputInfoPtr pInfo, char rad) +{ +#if defined(KBIO_SETRATE) + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + int i; + int value = 0x7f; /* Maximum delay with slowest rate */ + int delay = 250; /* Default delay */ + int rate = 300; /* Default repeat rate */ + + static int valid_rates[] = { 300, 267, 240, 218, 200, 185, 171, 160, 150, + 133, 120, 109, 100, 92, 86, 80, 75, 67, + 60, 55, 50, 46, 43, 40, 37, 33, 30, 27, + 25, 23, 21, 20 }; +#define RATE_COUNT (sizeof( valid_rates ) / sizeof( int )) + + static int valid_delays[] = { 250, 500, 750, 1000 }; +#define DELAY_COUNT (sizeof( valid_delays ) / sizeof( int )) + + if (pKbd->rate >= 0) + rate = pKbd->rate * 10; + if (pKbd->delay >= 0) + delay = pKbd->delay; + + for (i = 0; i < RATE_COUNT; i++) + if (rate >= valid_rates[i]) { + value &= 0x60; + value |= i; + break; + } + + for (i = 0; i < DELAY_COUNT; i++) + if (delay <= valid_delays[i]) { + value &= 0x1f; + value |= i << 5; + break; + } + + ioctl (pInfo->fd, KBIO_SETRATE, value); +#endif /* defined(KBIO_SETRATE) */ +} + +static int +KbdInit(InputInfoPtr pInfo, int what) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + ScoKbdPrivPtr priv = (ScoKbdPrivPtr) pKbd->private; + + if (pKbd->isConsole) { + priv->use_tcs = 1; + priv->use_kd = 1; + priv->no_nmap = 1; + priv->no_emap = 1; + priv->orig_getsc = 0; + + if (ioctl (pInfo->fd, TCGETSC, &priv->orig_getsc) < 0) + priv->use_tcs = 0; + if (ioctl (pInfo->fd, KDGKBMODE, &priv->orig_kbm) < 0) + priv->use_kd = 0; + + if (!priv->use_tcs && !priv->use_kd) { + xf86Msg (X_ERROR, "KbdInit: Could not determine keyboard mode\n"); + return !Success; + } + + /* + * One day this should be fixed to translate normal ASCII characters + * back into scancodes or into events that XFree86 wants, but not + * now. For the time being, we only support scancode mode screens. + */ + if (priv->use_tcs && !(priv->orig_getsc & KB_ISSCANCODE)) { + xf86Msg (X_ERROR, "KbdInit: Keyboard can not send scancodes\n"); + return !Success; + } + + /* + * We need to get the original keyboard map and NUL out the lock + * modifiers. This prevents the scancode API from messing with + * the keyboard LED's. We restore the original map when we exit. + */ + if (ioctl (pInfo->fd, GIO_KEYMAP, &priv->keymap) < 0) { + xf86Msg (X_ERROR, "KbdInit: Failed to get keyboard map (%s)\n", + strerror(errno)); + return !Success; + } + if (ioctl (pInfo->fd, GIO_KEYMAP, &priv->noledmap) < 0) { + xf86Msg (X_ERROR, "KbdInit: Failed to get keyboard map (%s)\n", + strerror(errno)); + return !Success; + } else { + int i, j; + + for (i = 0; i < priv->noledmap.n_keys; i++) { + for (j = 0; j < NUM_STATES; j++) { + if (IS_SPECIAL(priv->noledmap, i, j) && + ((priv->noledmap.key[i].map[j] == K_CLK) || + (priv->noledmap.key[i].map[j] == K_NLK) || + (priv->noledmap.key[i].map[j] == K_SLK))) { + priv->noledmap.key[i].map[j] = K_NOP; + } + } + } + } + + if (ioctl (pInfo->fd, XCGETA, &priv->kbdtty) < 0) { + xf86Msg (X_ERROR, "KbdInit: Failed to get terminal modes (%s)\n", + strerror(errno)); + return !Success; + } + + priv->sc_mapbuf = xalloc (10*BSIZE); + priv->sc_mapbuf2 = xalloc(10*BSIZE); + + /* Get the emap */ + if (ioctl (pInfo->fd, LDGMAP, priv->sc_mapbuf) < 0) { + if (errno != ENAVAIL) { + xf86Msg (X_ERROR, "KbdInit: Failed to retrieve e-map (%s)\n", + strerror (errno)); + return !Success; + } + priv->no_emap = 0; + } + + /* Get the nmap */ + if (ioctl (pInfo->fd, NMGMAP, priv->sc_mapbuf2) < 0) { + if (errno != ENAVAIL) { + xf86Msg (X_ERROR, "KbdInit: Failed to retrieve n-map (%s)\n", + strerror (errno)); + return !Success; + } + priv->no_nmap = 0; + } + } /* End of if we are on a console */ + + return Success; +} + +static int +KbdOn(InputInfoPtr pInfo, int what) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + ScoKbdPrivPtr priv = (ScoKbdPrivPtr) pKbd->private; + struct termios newtio; + + if (pKbd->isConsole) { + ioctl (pInfo->fd, LDNMAP); /* Turn e-mapping off */ + ioctl (pInfo->fd, NMNMAP); /* Turn n-mapping off */ + + newtio = priv->kbdtty; /* structure copy */ + newtio.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); + newtio.c_oflag = 0; + newtio.c_cflag = CREAD | CS8 | B9600; + newtio.c_lflag = 0; + newtio.c_cc[VTIME]=0; + newtio.c_cc[VMIN]=1; + cfsetispeed(&newtio, 9600); + cfsetospeed(&newtio, 9600); + ioctl(pInfo->fd, XCSETA, &newtio); + + /* Now tell the keyboard driver to send us raw scancodes */ + if (priv->use_tcs) { + int nm = priv->orig_getsc; + nm &= ~KB_XSCANCODE; + ioctl (pInfo->fd, TCSETSC, &nm); + } + + if (priv->use_kd) + ioctl (pInfo->fd, KDSKBMODE, K_RAW); + + ioctl (pInfo->fd, PIO_KEYMAP, &priv->noledmap); + } + + return Success; +} + +static int +KbdOff(InputInfoPtr pInfo, int what) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + ScoKbdPrivPtr priv = (ScoKbdPrivPtr) pKbd->private; + + if (pKbd->isConsole) { + /* Revert back to original translate scancode mode */ + if (priv->use_tcs) + ioctl (pInfo->fd, TCSETSC, &priv->orig_getsc); + if (priv->use_kd) + ioctl (pInfo->fd, KDSKBMODE, priv->orig_kbm); + + ioctl (pInfo->fd, PIO_KEYMAP, &priv->keymap); + + if (priv->no_emap) + ioctl (pInfo->fd, LDSMAP, priv->sc_mapbuf); + if (priv->no_nmap) + ioctl (pInfo->fd, NMSMAP, priv->sc_mapbuf2); + + ioctl(pInfo->fd, XCSETA, &priv->kbdtty); + } + + return Success; +} + +static int +GetSpecialKey(InputInfoPtr pInfo, int scanCode) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + int specialkey = scanCode; + + if (pKbd->CustomKeycodes) { + specialkey = pKbd->specialMap->map[scanCode]; + } + return specialkey; +} + +#define ModifierSet(k) ((modifiers & (k)) == (k)) + +static Bool +SpecialKey(InputInfoPtr pInfo, int key, Bool down, int modifiers) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + + if(!pKbd->vtSwitchSupported) + return FALSE; + + if ((!ModifierSet(ShiftMask)) && ((ModifierSet(ControlMask | AltMask)) || + (ModifierSet(ControlMask | AltLangMask)))) { + if (VTSwitchEnabled && !xf86Info.vtSysreq) { + switch (key) { + case KEY_F1: + case KEY_F2: + case KEY_F3: + case KEY_F4: + case KEY_F5: + case KEY_F6: + case KEY_F7: + case KEY_F8: + case KEY_F9: + case KEY_F10: + if (down) { + int sts = key - KEY_F1; + if (sts != xf86Info.vtno) { + ioctl(pInfo->fd, VT_ACTIVATE, sts); + } + return TRUE; + } + case KEY_F11: + case KEY_F12: + if (down) { + int sts = key - KEY_F11 + 10; + if (sts != xf86Info.vtno) { + ioctl(pInfo->fd, VT_ACTIVATE, sts); + } + return TRUE; + } + } + } + } +#ifdef USE_VT_SYSREQ + if (VTSwitchEnabled && xf86Info.vtSysreq) { + switch (key) { + case KEY_F1: + case KEY_F2: + case KEY_F3: + case KEY_F4: + case KEY_F5: + case KEY_F6: + case KEY_F7: + case KEY_F8: + case KEY_F9: + case KEY_F10: + if (VTSysreqToggle && down) { + ioctl(pInfo->fd, VT_ACTIVATE, key - KEY_F1); + VTSysreqToggle = FALSE; + return TRUE; + } + break; + case KEY_F11: + case KEY_F12: + if (VTSysreqToggle && down) { + ioctl(pInfo->fd, VT_ACTIVATE, key - KEY_F11 + 10); + VTSysreqToggle = FALSE; + return TRUE; + } + break; + /* Ignore these keys -- ie don't let them cancel an alt-sysreq */ + case KEY_Alt: + case KEY_AltLang: + break; + case KEY_SysReqest: + if (!(ModifierSet(ShiftMask) || ModifierSet(ControlMask))) { + if ((ModifierSet(AltMask) || ModifierSet(AltLangMask)) && down) + VTSysreqToggle = TRUE; + } + break; + default: + /* + * We only land here when Alt-SysReq is followed by a + * non-switching key. + */ + if (VTSysreqToggle) + VTSysreqToggle = FALSE; + } + } +#endif /* USE_VT_SYSREQ */ + return FALSE; +} + +static void +stdReadInput(InputInfoPtr pInfo) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + unsigned char rBuf[64]; + int nBytes, i; + + if ((nBytes = read( pInfo->fd, (char *)rBuf, sizeof(rBuf))) > 0) { + for (i = 0; i < nBytes; i++) { + pKbd->PostEvent(pInfo, rBuf[i] & 0x7f, rBuf[i] & 0x80 ? FALSE : TRUE); + } + } +} + +static Bool +OpenKeyboard(InputInfoPtr pInfo) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + int i; + KbdProtocolId prot = PROT_UNKNOWN_KBD; + char *s; + + s = xf86SetStrOption(pInfo->options, "Protocol", NULL); + for (i = 0; protocols[i].name; i++) { + if (xf86NameCmp(s, protocols[i].name) == 0) { + prot = protocols[i].id; + break; + } + } + + switch (prot) { + case PROT_STD: + pInfo->read_input = stdReadInput; + break; + default: + xf86Msg(X_ERROR,"\"%s\" is not a valid keyboard protocol name\n", s); + xfree(s); + return FALSE; + } + + xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, s); + xfree(s); + + s = xf86SetStrOption(pInfo->options, "Device", NULL); + if (s == NULL) { + pInfo->fd = xf86Info.consoleFd; + pKbd->isConsole = TRUE; + } else { + pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL); + if (pInfo->fd == -1) { + xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s); + xfree(s); + return FALSE; + } + pKbd->isConsole = FALSE; + xfree(s); + } + + if (pKbd->isConsole) + pKbd->vtSwitchSupported = TRUE; + + return TRUE; +} + +Bool +xf86OSKbdPreInit(InputInfoPtr pInfo) +{ + KbdDevPtr pKbd = pInfo->private; + + pKbd->KbdInit = KbdInit; + pKbd->KbdOn = KbdOn; + pKbd->KbdOff = KbdOff; + pKbd->Bell = SoundBell; + pKbd->SetLeds = SetKbdLeds; + pKbd->GetLeds = GetKbdLeds; + pKbd->SetKbdRepeat = SetKbdRepeat; + pKbd->KbdGetMapping = KbdGetMapping; + pKbd->SpecialKey = SpecialKey; + pKbd->GetSpecialKey = GetSpecialKey; + pKbd->OpenKeyboard = OpenKeyboard; + pKbd->RemapScanCode = ATScancode; + pKbd->vtSwitchSupported = FALSE; + + pKbd->private = xcalloc(sizeof(ScoKbdPrivRec), 1); + if (pKbd->private == NULL) { + xf86Msg(X_ERROR,"can't allocate keyboard OS private data\n"); + return FALSE; + } + + return TRUE; +} Index: programs/Xserver/hw/xfree86/os-support/sco/sco_kbd.h =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/sco/sco_kbd.h diff -N programs/Xserver/hw/xfree86/os-support/sco/sco_kbd.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/sco/sco_kbd.h 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,20 @@ +/* $XFree86$ */ +#ifndef SCO_KBD_HDR +#define SCO_KBD_HDR + +typedef struct { + int use_tcs; + int use_kd; + int no_nmap; + int no_emap; + int orig_getsc; + int orig_kbm; + struct termios kbdtty; + keymap_t keymap, noledmap; + uchar_t *sc_mapbuf; + uchar_t *sc_mapbuf2; +} ScoKbdPrivRec, *ScoKbdPrivPtr; + +extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms, + CARD8 *pModMap); +#endif /* SCO_KBD_HDR */ Index: programs/Xserver/hw/xfree86/os-support/sco/sco_mouse.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/sco/sco_mouse.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 sco_mouse.c --- programs/Xserver/hw/xfree86/os-support/sco/sco_mouse.c 3 Jul 2005 07:01:35 -0000 1.4 +++ programs/Xserver/hw/xfree86/os-support/sco/sco_mouse.c 7 Nov 2005 06:01:11 -0000 @@ -42,8 +42,7 @@ static int SupportedInterfaces (void) { - /* FIXME: Is this correct? Should we just return MSE_MISC? */ - return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_MISC | MSE_AUTO; + return MSE_MISC; } static const char *internalNames[] = { @@ -107,8 +106,8 @@ OsMouseProc (DeviceIntPtr pPointer, int case DEVICE_INIT: pPointer->public.on = FALSE; - dmask = D_REL | D_BUTTON; - if ((evi = ev_init()) < 0) { + dmask = D_ABS | D_REL | D_BUTTON; + if ((evi = ev_initf(xf86Info.consoleFd)) < 0) { FatalError ("OsMouseProc: Event driver initialization failed (%s)\n", evtErrStr(evi)); } @@ -127,9 +126,9 @@ OsMouseProc (DeviceIntPtr pPointer, int map[1] = 1; map[2] = 2; map[3] = 3; - map[4] = 6; - map[5] = 7; - map[6] = 8; + map[4] = 7; + map[5] = 8; + map[6] = 6; map[7] = 4; map[8] = 5; /* Compatibile with SCO X server */ @@ -161,7 +160,7 @@ OsMouseProc (DeviceIntPtr pPointer, int case DEVICE_OFF: case DEVICE_CLOSE: - pPointer->public.on = TRUE; + pPointer->public.on = FALSE; RemoveEnabledDevice (pInfo->fd); if (what == DEVICE_CLOSE) { ev_close(); @@ -185,18 +184,15 @@ OsMouseReadInput (InputInfoPtr pInfo) while ((evp = ev_read()) != (EVENT *)0) { int buttons = EV_BUTTONS(*evp); - int dx = EV_DX(*evp), dy = -(EV_DY(*evp)), dz = 0, dw = 0; + int dx = EV_DX(*evp), dy = -(EV_DY(*evp)); if (EV_TAG(*evp) & T_WHEEL) { - dz = (dy & 0x08) ? (dy & 0x0f) - 16 : (dy & 0x0f); - dx = dy = 0; - pMse->PostEvent (pInfo, buttons, dx, dy, dz, dw); + pMse->PostEvent (pInfo, buttons, 0, 0, 0, 0); /* Simulate button release */ - dz = 0; buttons &= ~(WHEEL_FWD | WHEEL_BACK); } - pMse->PostEvent (pInfo, buttons, dx, dy, dz, dw); + pMse->PostEvent (pInfo, buttons, dx, dy, 0, 0); ev_pop(); } } @@ -217,9 +213,9 @@ OsMousePreInit(InputInfoPtr pInfo, const xf86ProcessCommonOptions(pInfo, pInfo->options); /* Check if the device can be opened. */ - pInfo->fd = ev_init(); + pInfo->fd = ev_initf(xf86Info.consoleFd); if (pInfo->fd != -1) { - dmask_t dmask = (D_REL | D_BUTTON); + dmask_t dmask = (D_ABS | D_REL | D_BUTTON); pInfo->fd = ev_open(&dmask); } else { pInfo->fd = -999; Index: programs/Xserver/hw/xfree86/os-support/shared/sysv_kbd.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/shared/sysv_kbd.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 sysv_kbd.c --- programs/Xserver/hw/xfree86/os-support/shared/sysv_kbd.c 3 Jul 2005 07:01:35 -0000 1.4 +++ programs/Xserver/hw/xfree86/os-support/shared/sysv_kbd.c 7 Nov 2005 06:01:11 -0000 @@ -65,7 +65,7 @@ xf86KbdInit() ioctl (xf86Info.consoleFd, KDGKBMODE, &kbdtrans); #endif ioctl (xf86Info.consoleFd, TCGETA, &kbdtty); -#if defined(E_TABSZ) && !defined(SCO325) +#if defined(E_TABSZ) kbdemap = xalloc(E_TABSZ); if (ioctl(xf86Info.consoleFd, LDGMAP, kbdemap) < 0) { Index: programs/Xserver/hw/xfree86/os-support/usl/Imakefile =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/Imakefile diff -N programs/Xserver/hw/xfree86/os-support/usl/Imakefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/Imakefile 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,40 @@ +XCOMM $XdotOrg$ +XCOMM $XConsortium$ + +#include <Server.tmpl> + +SRCS = usl_init.c usl_video.c usl_io.c usl_iop.c usl_mouse.c usl_vtsw.c \ + usl_xqueue.c std_kbdEv.c posix_tty.c bios_mmap.c vidmem.c \ + libc_wrapper.c stdResource.c stdPci.c sigiostubs.c pm_noop.c \ + kmod_noop.c agp_noop.c usl_kbd.c at_scancode.c usl_KbdMap.c + +OBJS = usl_init.o usl_video.o usl_io.o usl_iop.o usl_mouse.o usl_vtsw.o \ + usl_xqueue.o std_kbdEv.o posix_tty.o bios_mmap.o vidmem.o \ + libc_wrapper.o stdResource.o stdPci.o sigiostubs.o pm_noop.o \ + kmod_noop.o agp_noop.o usl_kbd.o at_scancode.o usl_KbdMap.o + +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \ + -I$(SERVERSRC)/mi -I$(XINCLUDESRC) -I$(EXTINCSRC) + +RESDEFINES = -DUSESTDRES + +DEFINES = $(RESDEFINES) + +SubdirLibraryRule($(OBJS)) +NormalLibraryObjectRule() + +LinkSourceFile(bios_mmap.c,../shared) +LinkSourceFile(std_kbdEv.c,../shared) +LinkSourceFile(at_scancode.c,../shared) +LinkSourceFile(posix_tty.c,../shared) +LinkSourceFile(libc_wrapper.c,../shared) +LinkSourceFile(stdResource.c,../shared) +LinkSourceFile(stdPci.c,../shared) +LinkSourceFile(sigiostubs.c,../shared) +LinkSourceFile(pm_noop.c,../shared) +LinkSourceFile(kmod_noop.c,../shared) +LinkSourceFile(agp_noop.c,../shared) +LinkSourceFile(vidmem.c,../shared) + +DependTarget() + Index: programs/Xserver/hw/xfree86/os-support/usl/usl_KbdMap.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_KbdMap.c diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_KbdMap.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_KbdMap.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,304 @@ +/* $XdotOrg$ */ +/* + * Copyright 2005 by J. Kean Johnston <jkj@sco.com> + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name J. Kean Johnston not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. J. Kean Johnston makes no + * representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL J. KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Based on xf86KbdMap.c, which is + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. + * Copyright (c) 1992-2003 by The XFree86 Project, Inc. + */ + +#include "X.h" +#include "Xmd.h" +#include "input.h" +#include "scrnintstr.h" + +#include "compiler.h" + +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86_OSlib.h" +#include "xf86Xinput.h" +#include "xf86OSKbd.h" +#include "atKeynames.h" +#include "xf86Keymap.h" + +#include "usl_kbd.h" + +#define KD_GET_ENTRY(i,n) \ + eascii_to_x[((priv->keymap.key[i].spcl << (n+1)) & 0x100) + priv->keymap.key[i].map[n]] + +/* + * NOTE: Not all possible remappable symbols are remapped. There are two main + * reasons: + * a) The mapping between scancode and SYSV/386 - symboltable + * is inconsistent between different versions and has some + * BIG mistakes. + * b) In X-Windows there is a difference between numpad-keys + * and normal keys. SYSV/386 uses for both kinds of keys + * the same symbol. + * + * Thus only the alpha keypad and the function keys are translated. + * Also CapsLock, NumLock, ScrollLock, Shift, Control & Alt. + */ + +static unsigned char remap[128] = { + 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */ + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */ + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */ + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */ + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */ + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */ + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */ + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */ + 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */ + 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */ + 0, 0, 0x69, 0x65, 0, 0, 0, 0, /* 0x70 - 0x77 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */ +}; + +static KeySym eascii_to_x[512] = { + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol, + NoSymbol, XK_Return, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, XK_Escape, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_space, XK_exclam, XK_quotedbl, XK_numbersign, + XK_dollar, XK_percent, XK_ampersand, XK_apostrophe, + XK_parenleft, XK_parenright, XK_asterisk, XK_plus, + XK_comma, XK_minus, XK_period, XK_slash, + XK_0, XK_1, XK_2, XK_3, + XK_4, XK_5, XK_6, XK_7, + XK_8, XK_9, XK_colon, XK_semicolon, + XK_less, XK_equal, XK_greater, XK_question, + XK_at, XK_A, XK_B, XK_C, + XK_D, XK_E, XK_F, XK_G, + XK_H, XK_I, XK_J, XK_K, + XK_L, XK_M, XK_N, XK_O, + XK_P, XK_Q, XK_R, XK_S, + XK_T, XK_U, XK_V, XK_W, + XK_X, XK_Y, XK_Z, XK_bracketleft, + XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore, + XK_grave, XK_a, XK_b, XK_c, + XK_d, XK_e, XK_f, XK_g, + XK_h, XK_i, XK_j, XK_k, + XK_l, XK_m, XK_n, XK_o, + XK_p, XK_q, XK_r, XK_s, + XK_t, XK_u, XK_v, XK_w, + XK_x, XK_y, XK_z, XK_braceleft, + XK_bar, XK_braceright, XK_asciitilde, XK_Delete, + XK_Ccedilla, XK_udiaeresis, XK_eacute, XK_acircumflex, + XK_adiaeresis, XK_agrave, XK_aring, XK_ccedilla, + XK_ecircumflex, XK_ediaeresis, XK_egrave, XK_idiaeresis, + XK_icircumflex, XK_igrave, XK_Adiaeresis, XK_Aring, + XK_Eacute, XK_ae, XK_AE, XK_ocircumflex, + XK_odiaeresis, XK_ograve, XK_ucircumflex, XK_ugrave, + XK_ydiaeresis, XK_Odiaeresis, XK_Udiaeresis, XK_cent, + XK_sterling, XK_yen, XK_paragraph, XK_section, + XK_aacute, XK_iacute, XK_oacute, XK_uacute, + XK_ntilde, XK_Ntilde, XK_ordfeminine, XK_masculine, + XK_questiondown,XK_hyphen, XK_notsign, XK_onehalf, + XK_onequarter, XK_exclamdown, XK_guillemotleft,XK_guillemotright, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_Greek_alpha, XK_ssharp, XK_Greek_GAMMA, XK_Greek_pi, + XK_Greek_SIGMA, XK_Greek_sigma, XK_mu, XK_Greek_tau, + XK_Greek_PHI, XK_Greek_THETA, XK_Greek_OMEGA, XK_Greek_delta, + XK_infinity, XK_Ooblique, XK_Greek_epsilon, XK_intersection, + XK_identical, XK_plusminus, XK_greaterthanequal, XK_lessthanequal, + XK_topintegral, XK_botintegral, XK_division, XK_similarequal, + XK_degree, NoSymbol, NoSymbol, XK_radical, + XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol, + + /* + * special marked entries (256 + x) + */ + + NoSymbol, NoSymbol, XK_Shift_L, XK_Shift_R, + XK_Caps_Lock, XK_Num_Lock, XK_Scroll_Lock, XK_Alt_L, + NoSymbol, XK_Control_L, XK_Alt_L, XK_Alt_R, + XK_Control_L, XK_Control_R, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, XK_F1, + XK_F2, XK_F3, XK_F4, XK_F5, + XK_F6, XK_F7, XK_F8, XK_F9, + XK_F10, XK_F11, XK_F12, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + }; + +/* + * KbdGetMapping -- + * Get the national keyboard mapping. The keyboard type is set, a new map + * and the modifiermap is computed. + */ + +void +KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + USLKbdPrivPtr priv = (USLKbdPrivPtr) pKbd->private; + KeySym *k; + int i; + KeySym *pMap = map; + + for (i = 0; i < priv->keymap.n_keys && i < NUM_KEYCODES; i++) { + if (remap[i]) { + k = pMap + (remap[i] << 2); + + k[0] = KD_GET_ENTRY(i,0); /* non-shifed */ + k[1] = KD_GET_ENTRY(i,1); /* shifted */ + k[2] = KD_GET_ENTRY(i,4); /* alt */ + k[3] = KD_GET_ENTRY(i,5); /* alt - shifted */ + + if (k[3] == k[2]) k[3] = NoSymbol; + if (k[2] == k[1]) k[2] = NoSymbol; + if (k[1] == k[0]) k[1] = NoSymbol; + if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol; + } + } + + /* + * compute the modifier map + */ + for (i = 0; i < MAP_LENGTH; i++) + pModMap[i] = NoSymbol; /* make sure it is restored */ + + for (k = pMap, i = MIN_KEYCODE; + i < (NUM_KEYCODES + MIN_KEYCODE); + i++, k += 4) { + + switch(*k) { + case XK_Shift_L: + case XK_Shift_R: + pModMap[i] = ShiftMask; + break; + + case XK_Control_L: + case XK_Control_R: + pModMap[i] = ControlMask; + break; + + case XK_Caps_Lock: + pModMap[i] = LockMask; + break; + + case XK_Alt_L: + case XK_Alt_R: + pModMap[i] = AltMask; + break; + + case XK_Num_Lock: + pModMap[i] = NumLockMask; + break; + + case XK_Scroll_Lock: + pModMap[i] = ScrollLockMask; + break; + + /* kana support */ + case XK_Kana_Lock: + case XK_Kana_Shift: + pModMap[i] = KanaMask; + break; + + /* alternate toggle for multinational support */ + case XK_Mode_switch: + pModMap[i] = AltLangMask; + break; + } + } + + pKeySyms->map = pMap; + pKeySyms->mapWidth = GLYPHS_PER_KEY; + pKeySyms->minKeyCode = MIN_KEYCODE; + pKeySyms->maxKeyCode = MAX_KEYCODE; +} Index: programs/Xserver/hw/xfree86/os-support/usl/usl_init.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_init.c diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_init.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_init.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,359 @@ +/* $XdotOrg$ */ +/* + * Copyright 2001-2005 by Kean Johnston <jkj@sco.com> + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany + * Copyright 1993 by David Wexelblat <dwex@goblin.org> + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of Thomas Roell, David Wexelblat + * and Kean Johnston not be used in advertising or publicity pertaining to + * distribution of the software without specific, written prior permission. + * Thomas Roell, David Wexelblat and Kean Johnston make no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THOMAS ROELL, DAVID WEXELBLAT AND KEAN JOHNSTON DISCLAIM ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THOMAS ROELLm DAVID WEXELBLAT + * OR KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + * + */ +/* $XConsortium$ */ + +#include "X.h" +#include "Xmd.h" + +#include "compiler.h" + +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86_OSlib.h" + +#include <sys/utsname.h> + +static Bool KeepTty = FALSE; +static Bool Protect0 = FALSE; +static Bool CRTSpecified = FALSE; +static int VTnum = -1; +static char vtdevice[48]; + +int usl_is_osr6 = -1; + +static Bool +IsConsoleDevice(const char *dev) +{ + if ((!strcmp (dev, "/dev/console")) || + (!strcmp (dev, "/dev/syscon")) || + (!strcmp (dev, "/dev/systty"))) + return TRUE; + + return FALSE; +} + +static int +is_osr6 (void) +{ + struct utsname uts; + + if (usl_is_osr6 == -1) { + if (uname (&uts) < 0) { + FatalError ("get_usl_ver: Failed to determine UNIX name (%s)\n", + strerror (errno)); + } + + if (uts.version[0] == '6') + usl_is_osr6 = 1; + else + usl_is_osr6 = 0; + } + + return usl_is_osr6; +} + + +void +xf86OpenConsole(void) +{ + int fd, i, ioctl_ret; + struct vt_mode VT; + struct vt_stat vts; + MessageType from = X_PROBED; + struct sigaction sigvtsw; + char *ttn; + + if (serverGeneration == 1) { + int isconsole = 0, consdev = 0; + + /* check if we're run with euid==0 */ + if (geteuid() != 0) { + FatalError("xf86OpenConsole: Server must be suid root\n"); + } + + /* If we are run in the background we will get SIGTTOU. Ignore it. */ + OsSignal (SIGTTOU, SIG_IGN); + + /* Protect page 0 to help find NULL dereferencing */ + /* mprotect() doesn't seem to work */ + if (Protect0) { + int fd = -1; + + if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0) { + xf86Msg(X_WARNING, "xf86OpenConsole: cannot open /dev/zero (%s)\n", + strerror(errno)); + } else { + if ((int)mmap(0, 0x1000, PROT_NONE, + MAP_FIXED | MAP_SHARED, fd, 0) == -1) { + xf86Msg(X_WARNING, "xf86OpenConsole: failed to protect page 0 (%s)\n", + strerror(errno)); + } + close(fd); + } + } + + /* + * setup the virtual terminal manager + */ + if (VTnum == -1) { + /* + * No device was specified. We need to query the kernel to see which + * console device we are on (and in fact if we are on a console at all). + */ + if (ioctl (0, VT_GETSTATE, &vts) < 0) { + FatalError("xf86OpenConsole: Could not query active VT: %s\n", + strerror(errno)); + } + VTnum = vts.v_active; + if (is_osr6()) + snprintf (vtdevice, sizeof(vtdevice), "/dev/tty%02d", VTnum + 1); + else + snprintf (vtdevice, sizeof(vtdevice), "/dev/vt%02d", VTnum); + } else { + from = X_CMDLINE; + if (is_osr6()) + snprintf (vtdevice, sizeof(vtdevice), "/dev/tty%02d", VTnum + 1); + else + snprintf (vtdevice, sizeof(vtdevice), "/dev/vt%02d", VTnum); + } + + if (IsConsoleDevice(vtdevice)) { + isconsole = 1; + CRTSpecified = FALSE; /* Dont honour -crt /dev/console */ + } + + if (ioctl (0, KIOCINFO, 0) >= 0) + consdev = 1 + isconsole; + + if ((!CRTSpecified) && (isconsole || (!consdev))) { + /* + * Need to find a free VT + */ + if ((fd = open ("/dev/console", O_WRONLY | O_NOCTTY)) < 0) { + FatalError ("xf86OpenConsole: Could not open /dev/console: %s\n", + strerror (errno)); + } + + if (ioctl (fd, VT_OPENQRY, &VTnum) < 0) { + FatalError ("xf86OpenConsole: Cannot find a free VT: %s\n", + strerror(errno)); + } + close (fd); + if (usl_is_osr6) + snprintf (vtdevice, sizeof(vtdevice), "/dev/tty%02d", VTnum + 1); + else + snprintf (vtdevice, sizeof(vtdevice), "/dev/vt%02d", VTnum); + } + + /* + * Now we can dispose of stdin/stdout + */ + fclose (stdin); + fclose (stdout); + + if (CRTSpecified || isconsole || consdev != 1) { + if (!KeepTty) { + setpgrp(); + } + } + + if ((xf86Info.consoleFd = open(vtdevice, O_RDWR | O_NONBLOCK, 0)) < 0) { + FatalError("xf86OpenConsole: Cannot open %s: %s\n", vtdevice, + strerror(errno)); + } + + xf86Msg (from, "using VT number %d (%s)\n\n", VTnum, vtdevice); + xf86Info.vtno = VTnum; + + /* change ownership of the vt */ + chown(vtdevice, getuid(), getgid()); + + /* + * now get the VT + */ + if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) { + FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n", + strerror(errno)); + } + if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0) { + FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n",strerror(errno)); + } + + if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) { + FatalError("xf86OpenConsole: VT_GETMODE failed: %s\n", strerror(errno)); + } + + sigvtsw.sa_handler = xf86VTRequest; + sigfillset(&sigvtsw.sa_mask); + sigvtsw.sa_flags = 0; + sigaction(SIGUSR1, &sigvtsw, NULL); + + VT.mode = VT_PROCESS; + VT.relsig = SIGUSR1; + VT.acqsig = SIGUSR1; + + ioctl_ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); + if (ioctl_ret < 0) { + FatalError("xf86OpenConsole: VT_SETMODE failed: %s\n", strerror(errno)); + } + + if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) { + FatalError("xf86OpenConsole: KD_GRAPHICS failed: %s\n", strerror(errno)); + } + } else { /* serverGeneration != 1 */ + /* + * now get the VT + */ + if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) { + FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n", strerror(errno)); + } + if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0) { + FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n",strerror(errno)); + } + /* + * If the server doesn't have the VT when the reset occurs, + * this is to make sure we don't continue until the activate + * signal is received. + */ + if (!xf86Screens[0]->vtSema) + sleep(5); + } + return; +} + +void +xf86CloseConsole(void) +{ + struct vt_mode VT; + struct sigaction sigvtsw; + + ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */ + + sigvtsw.sa_handler = SIG_DFL; + sigfillset(&sigvtsw.sa_mask); + sigvtsw.sa_flags = 0; + sigaction(SIGUSR1, &sigvtsw, NULL); + + if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1) { + VT.mode = VT_AUTO; + VT.waitv = 0; + ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* set dflt vt handling */ + } + close(xf86Info.consoleFd); /* make the vt-manager happy */ + return; +} + +int +xf86ProcessArgument(int argc, char *argv[], int i) +{ + /* + * Keep server from detaching from controlling tty. This is useful + * when debugging (so the server can receive keyboard signals. + */ + if (!strcmp(argv[i], "-keeptty")) { + KeepTty = TRUE; + return(1); + } + + /* + * Undocumented flag to protect page 0 from read/write to help + * catch NULL pointer dereferences. This is purely a debugging + * flag. + */ + if (!strcmp(argv[i], "-protect0")) { + Protect0 = TRUE; + return(1); + } + + if ((argv[i][0] == 'v') && (argv[i][1] == 't')) { + if (sscanf(argv[i], "vt%2d", &VTnum) == 0) { + UseMsg(); + VTnum = -1; + return(0); + } + VTnum -= is_osr6(); + CRTSpecified = TRUE; + return(1); + } + + /* + * Use a device the user specifies. + */ + if (!strcmp(argv[i], "-crt")) { + if (++i > argc) { + UseMsg(); + VTnum = -1; + return(0); + } else { + char *mytty = ttyname(0); + char *arg = argv[i]; + + if (!mytty) + mytty = "\1"; + if (!arg[0]) + arg = "\2"; /* Prevent idiots from using -crt "" */ + + if (strcmp (mytty, arg) != 0) { + char *fmt; + + if (is_osr6()) + fmt = "/dev/tty%02d"; + else + fmt = "/dev/vt%02d"; + + if (sscanf(arg, fmt, &VTnum) == 0) { + UseMsg(); + VTnum = -1; + return(0); + } + + /* OSR6 devices start names at 1, UW7 starts at 0 */ + VTnum -= is_osr6(); + CRTSpecified = TRUE; + } + return(2); + } + } + return(0); +} + +void +xf86UseMsg(void) +{ + if (is_osr6()) { + ErrorF("-crt /dev/ttyXX use the specified VT device\n"); + ErrorF("vtXX use the specified VT number (01-16)\n"); + } else { + ErrorF("-crt /dev/vtXX use the specified VT device\n"); + ErrorF("vtXX use the specified VT number (00-15)\n"); + } + + ErrorF("-keeptty "); + ErrorF("don't detach controlling tty (for debugging only)\n"); + return; +} Index: programs/Xserver/hw/xfree86/os-support/usl/usl_io.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_io.c diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_io.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_io.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,172 @@ +/* $XdotOrg$ */ +/* + * Copyright 2001-2005 by Kean Johnston <jkj@sco.com> + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany + * Copyright 1993 by David Dawes <dawes@xfree86.org> + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of Thomas Roell, David Dawes + * and Kean Johnston not be used in advertising or publicity pertaining to + * distribution of the software without specific, written prior permission. + * Thomas Roell, David Dawes and Kean Johnston make no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THOMAS ROELL, DAVID DAWES AND KEAN JOHNSTON DISCLAIM ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THOMAS ROELLm DAVID WEXELBLAT + * OR KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + * + */ +/* $XConsortium$ */ + +#include "X.h" + +#include "compiler.h" + +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86_OSlib.h" + +void +xf86SoundKbdBell(int loudness, int pitch, int duration) +{ + if (loudness && pitch) { + ioctl(xf86Info.consoleFd, KIOCSOUND, 1193180 / pitch); + usleep(xf86Info.bell_duration * loudness * 20); + ioctl(xf86Info.consoleFd, KIOCSOUND, 0); + } +} + +void +xf86SetKbdLeds(int leds) +{ + ioctl(xf86Info.consoleFd, KDSETLED, leds); +} + +int +xf86GetKbdLeds(void) +{ + int leds; + + ioctl(xf86Info.consoleFd, KDGETLED, &leds); + return(leds); +} + +/* + * Much of the code in this function is duplicated from the Linux code + * by Orest Zborowski <obz@Kodak.com> and David Dawes <dawes@xfree86.org>. + * Please see the file ../linux/lnx_io.c for full copyright information. + */ +void +xf86SetKbdRepeat(char rad) +{ + int i; + int value = 0x7f; /* Maximum delay with slowest rate */ + int delay = 250; /* Default delay */ + int rate = 300; /* Default repeat rate */ + + static int valid_rates[] = { 300, 267, 240, 218, 200, 185, 171, 160, 150, + 133, 120, 109, 100, 92, 86, 80, 75, 67, + 60, 55, 50, 46, 43, 40, 37, 33, 30, 27, + 25, 23, 21, 20 }; +#define RATE_COUNT (sizeof( valid_rates ) / sizeof( int )) + + static int valid_delays[] = { 250, 500, 750, 1000 }; +#define DELAY_COUNT (sizeof( valid_delays ) / sizeof( int )) + + if (xf86Info.kbdRate >= 0) + rate = xf86Info.kbdRate * 10; + if (xf86Info.kbdDelay >= 0) + delay = xf86Info.kbdDelay; + + for (i = 0; i < RATE_COUNT; i++) + if (rate >= valid_rates[i]) { + value &= 0x60; + value |= i; + break; + } + + for (i = 0; i < DELAY_COUNT; i++) + if (delay <= valid_delays[i]) { + value &= 0x1f; + value |= i << 5; + break; + } + + ioctl (xf86Info.consoleFd, KDSETTYPEMATICS, value); +} + +static int orig_kbm; +static struct termio orig_termio; +static keymap_t keymap, noledmap; + +void +xf86KbdInit(void) +{ + ioctl (xf86Info.consoleFd, KDGKBMODE, &orig_kbm); + ioctl (xf86Info.consoleFd, TCGETA, &orig_termio); + /* + * We need to get the original keyboard map and NUL out the lock + * modifiers. This prevents the scancode API from messing with + * the keyboard LED's. We restore the original map when we exit. + */ + if (ioctl (xf86Info.consoleFd, GIO_KEYMAP, &keymap) < 0) { + FatalError ("xf86KbdInit: Failed to get keyboard map (%s)\n", + strerror(errno)); + } + if (ioctl (xf86Info.consoleFd, GIO_KEYMAP, &noledmap) < 0) { + FatalError ("xf86KbdInit: Failed to get keyboard map (%s)\n", + strerror(errno)); + } else { + int i, j; + + for (i = 0; i < noledmap.n_keys; i++) { + for (j = 0; j < NUM_STATES; j++) { + if (IS_SPECKEY(&noledmap, i, j) && + ((noledmap.key[i].map[j] == K_CLK) || + (noledmap.key[i].map[j] == K_NLK) || + (noledmap.key[i].map[j] == K_SLK))) { + noledmap.key[i].map[j] = K_NOP; + } + } + } + } +} + +int +xf86KbdOn(void) +{ + struct termio newtio; + + newtio = orig_termio; /* structure copy */ + newtio.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); + newtio.c_oflag = 0; + newtio.c_cflag = CREAD | CS8 | B9600; + newtio.c_lflag = 0; + newtio.c_cc[VTIME]=0; + newtio.c_cc[VMIN]=1; + ioctl(xf86Info.consoleFd, TCSETA, &newtio); + + ioctl (xf86Info.consoleFd, KDSKBMODE, K_RAW); + ioctl (xf86Info.consoleFd, PIO_KEYMAP, &noledmap); + + return(xf86Info.consoleFd); +} + +int +xf86KbdOff(void) +{ + ioctl (xf86Info.consoleFd, KDSKBMODE, orig_kbm); + ioctl (xf86Info.consoleFd, PIO_KEYMAP, &keymap); + ioctl(xf86Info.consoleFd, TCSETA, &orig_termio); + + return(xf86Info.consoleFd); +} Index: programs/Xserver/hw/xfree86/os-support/usl/usl_iop.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_iop.c diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_iop.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_iop.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,108 @@ +/* $XdotOrg$ */ +/* + * Copyright 2001,2005 by Kean Johnston <jkj@sco.com> + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Kean Johnston not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Kean Johnston makes no + * representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ +/* $XConsortium$ */ + + +#include "X.h" + +#include "compiler.h" + +#define _NEED_SYSI86 +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86OSpriv.h" +#include "xf86_OSlib.h" + + +/***************************************************************************/ +/* I/O Permissions section */ +/***************************************************************************/ + +static Bool IOEnabled = FALSE; + +Bool +xf86EnableIO(void) +{ + if (IOEnabled) + return TRUE; + + if (sysi86(SI86IOPL, 3) < 0) + FatalError("Failed to set IOPL for extended I/O\n"); + IOEnabled = TRUE; + return TRUE; +} + +void +xf86DisableIO(void) +{ + if (!IOEnabled) + return; + + sysi86(SI86IOPL, 0); + IOEnabled = FALSE; +} + +/***************************************************************************/ +/* Interrupt Handling section */ +/***************************************************************************/ + +Bool +xf86DisableInterrupts(void) +{ + if (!IOEnabled) { + if (sysi86(SI86IOPL, 3) < 0) + return FALSE; + } + +#ifdef __GNUC__ + __asm__ __volatile__("cli"); +#else + asm("cli"); +#endif /* __GNUC__ */ + + if (!IOEnabled) { + sysi86(SI86IOPL, 0); + } + + return(TRUE); +} + +void +xf86EnableInterrupts(void) +{ + if (!IOEnabled) { + if (sysi86(SI86IOPL, 3) < 0) + return; + } + +#ifdef __GNUC__ + __asm__ __volatile__("sti"); +#else + asm("sti"); +#endif /* __GNUC__ */ + + if (!IOEnabled) { + sysi86(SI86IOPL, 0); + } +} + Index: programs/Xserver/hw/xfree86/os-support/usl/usl_kbd.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_kbd.c diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_kbd.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_kbd.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,456 @@ +/* $XdotOrg$ */ +/* + * Copyright 2005 by Kean Johnston <jkj@sco.com> + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Kean Johnston not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Kean Johnston makes no + * representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ +/* $XConsortium$ */ + +/* + * Based on sco_io.c which is + * (C) Copyright 2003 Kean Johnston <jkj@sco.com> + * + * Based on lnx_kbd.c which is + * Copyright (c) 2002 by The XFree86 Project, Inc. + * + * Based on the code from lnx_io.c which is + * Copyright 1992 by Orest Zborowski <obz@Kodak.com> + * Copyright 1993 by David Dawes <dawes@xfree86.org> + */ + +#define NEED_EVENTS +#include "X.h" + +#include "compiler.h" + +#define _NEED_SYSI86 +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86OSpriv.h" +#include "xf86_OSlib.h" + +#include "xf86Xinput.h" +#include "xf86OSKbd.h" +#include "atKeynames.h" +#include "usl_kbd.h" +#include "usl_xqueue.h" + +#include <sys/param.h> + +static KbdProtocolRec protocols[] = { + { "standard", PROT_STD }, + { "Xqueue", PROT_XQUEUE }, + { NULL, PROT_UNKNOWN_KBD } +}; + +extern Bool VTSwitchEnabled; +#ifdef USE_VT_SYSREQ +extern Bool VTSysreqToggle; +#endif + +static void +SoundBell(InputInfoPtr pInfo, int loudness, int pitch, int duration) +{ + if (loudness && pitch) { + ioctl(pInfo->fd, KIOCSOUND, 1193180 / pitch); + usleep(duration * loudness * 20); + ioctl(pInfo->fd, KIOCSOUND, 0); + } +} + +static void +SetKbdLeds(InputInfoPtr pInfo, int leds) +{ + int real_leds = 0; + + if (leds & XLED1) + real_leds |= LED_CAP; + if (leds & XLED2) + real_leds |= LED_NUM; + if (leds & XLED3) + real_leds |= LED_SCR; + ioctl(pInfo->fd, KDSETLED, real_leds); +} + +static int +GetKbdLeds(InputInfoPtr pInfo) +{ + int real_leds, leds = 0; + + ioctl(pInfo->fd, KDGETLED, &real_leds); + + if (real_leds & LED_CAP) leds |= XLED1; + if (real_leds & LED_NUM) leds |= XLED2; + if (real_leds & LED_SCR) leds |= XLED3; + + return(leds); +} + +static void +SetKbdRepeat(InputInfoPtr pInfo, char rad) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + int i; + int value = 0x7f; /* Maximum delay with slowest rate */ + int delay = 250; /* Default delay */ + int rate = 300; /* Default repeat rate */ + + static int valid_rates[] = { 300, 267, 240, 218, 200, 185, 171, 160, 150, + 133, 120, 109, 100, 92, 86, 80, 75, 67, + 60, 55, 50, 46, 43, 40, 37, 33, 30, 27, + 25, 23, 21, 20 }; +#define RATE_COUNT (sizeof( valid_rates ) / sizeof( int )) + + static int valid_delays[] = { 250, 500, 750, 1000 }; +#define DELAY_COUNT (sizeof( valid_delays ) / sizeof( int )) + + if (pKbd->rate >= 0) + rate = pKbd->rate * 10; + if (pKbd->delay >= 0) + delay = pKbd->delay; + + for (i = 0; i < RATE_COUNT; i++) + if (rate >= valid_rates[i]) { + value &= 0x60; + value |= i; + break; + } + + for (i = 0; i < DELAY_COUNT; i++) + if (delay <= valid_delays[i]) { + value &= 0x1f; + value |= i << 5; + break; + } + + ioctl (pInfo->fd, KDSETTYPEMATICS, value); +} + +static int +KbdInit(InputInfoPtr pInfo, int what) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + USLKbdPrivPtr priv = (USLKbdPrivPtr) pKbd->private; + + if (pKbd->isConsole) { + if (ioctl (pInfo->fd, KDGKBMODE, &priv->orig_kbm) < 0) { + xf86Msg (X_ERROR, "KbdInit: Could not determine keyboard mode\n"); + return !Success; + } + + /* + * We need to get the original keyboard map and NUL out the lock + * modifiers. This prevents the kernel from messing with + * the keyboard LED's. We restore the original map when we exit. + * Note that we also have to eliminate screen switch sequences + * else the VT manager will switch for us, which we don't want. + * For example, lets say you had changed the VT manager to switch + * on Alt-Fx instead of Ctrl-Alt-Fx. This means that while inside + * X, you cant use, for example, Alt-F4, which is a pain in the + * fundamental when you're using CDE-like thingies. + */ + if (ioctl (pInfo->fd, GIO_KEYMAP, &priv->keymap) < 0) { + xf86Msg (X_ERROR, "KbdInit: Failed to get keyboard map (%s)\n", + strerror(errno)); + return !Success; + } + if (ioctl (pInfo->fd, GIO_KEYMAP, &priv->noledmap) < 0) { + xf86Msg (X_ERROR, "KbdInit: Failed to get keyboard map (%s)\n", + strerror(errno)); + return !Success; + } else { + int i, j; + + for (i = 0; i < priv->noledmap.n_keys; i++) { + for (j = 0; j < NUM_STATES; j++) { + if (IS_SPECKEY(&priv->noledmap, i, j) && + ((priv->noledmap.key[i].map[j] == K_CLK) || + (priv->noledmap.key[i].map[j] == K_NLK) || + (priv->noledmap.key[i].map[j] == K_SLK) || + (priv->noledmap.key[i].map[j] == K_FRCNEXT) || + (priv->noledmap.key[i].map[j] == K_FRCPREV) || + ((priv->noledmap.key[i].map[j] >= K_VTF) && + (priv->noledmap.key[i].map[j] <= K_VTL)) )) { + priv->noledmap.key[i].map[j] = K_NOP; + } + } + } + } + + if (ioctl (pInfo->fd, TCGETA, &priv->kbdtty) < 0) { + xf86Msg (X_ERROR, "KbdInit: Failed to get terminal modes (%s)\n", + strerror(errno)); + return !Success; + } + } /* End of if we are on a console */ + + return Success; +} + +static int +KbdOn(InputInfoPtr pInfo, int what) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + USLKbdPrivPtr priv = (USLKbdPrivPtr) pKbd->private; + struct termio newtio; + + if (pKbd->isConsole) { + /* + * Use the calculated keyboard map that does not have active + * LED lock handling (we track LEDs ourselves). + */ + ioctl (pInfo->fd, PIO_KEYMAP, &priv->noledmap); + +#ifdef NOTYET + newtio = priv->kbdtty; /* structure copy */ + newtio.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP); + newtio.c_oflag = 0; + newtio.c_cflag = CREAD | CS8 | B9600; + newtio.c_lflag = 0; + newtio.c_cc[VTIME]=0; + newtio.c_cc[VMIN]=1; + ioctl(pInfo->fd, TCSETA, &newtio); + + if (priv->xq == 0) + ioctl (pInfo->fd, KDSKBMODE, K_RAW); + else +#endif + XqKbdOnOff (pInfo, 1); + } + + return Success; +} + +static int +KbdOff(InputInfoPtr pInfo, int what) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + USLKbdPrivPtr priv = (USLKbdPrivPtr) pKbd->private; + + if (pKbd->isConsole) { + /* Revert back to original translate scancode mode */ +#ifdef NOTYET + if (priv->xq == 0) + ioctl (pInfo->fd, KDSKBMODE, priv->orig_kbm); + else +#endif + XqKbdOnOff (pInfo, 0); + + ioctl (pInfo->fd, PIO_KEYMAP, &priv->keymap); + ioctl(pInfo->fd, TCSETA, &priv->kbdtty); + } + + return Success; +} + +#define ModifierSet(k) ((modifiers & (k)) == (k)) + +static Bool +SpecialKey(InputInfoPtr pInfo, int key, Bool down, int modifiers) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + + if(!pKbd->vtSwitchSupported) + return FALSE; + + if ((!ModifierSet(ShiftMask)) && ((ModifierSet(ControlMask | AltMask)) || + (ModifierSet(ControlMask | AltLangMask)))) { + if (VTSwitchEnabled && !xf86Info.vtSysreq) { + switch (key) { + case KEY_F1: + case KEY_F2: + case KEY_F3: + case KEY_F4: + case KEY_F5: + case KEY_F6: + case KEY_F7: + case KEY_F8: + case KEY_F9: + case KEY_F10: + if (down) { + int sts = key - KEY_F1; + if (sts != xf86Info.vtno) { + ioctl(pInfo->fd, VT_SWITCH, sts); + } + return TRUE; + } + case KEY_F11: + case KEY_F12: + if (down) { + int sts = key - KEY_F11 + 10; + if (sts != xf86Info.vtno) { + ioctl(pInfo->fd, VT_SWITCH, sts); + } + return TRUE; + } + } + } + } +#ifdef USE_VT_SYSREQ + if (VTSwitchEnabled && xf86Info.vtSysreq) { + switch (key) { + case KEY_F1: + case KEY_F2: + case KEY_F3: + case KEY_F4: + case KEY_F5: + case KEY_F6: + case KEY_F7: + case KEY_F8: + case KEY_F9: + case KEY_F10: + if (VTSysreqToggle && down) { + ioctl(pInfo->fd, VT_ACTIVATE, key - KEY_F1); + VTSysreqToggle = FALSE; + return TRUE; + } + break; + case KEY_F11: + case KEY_F12: + if (VTSysreqToggle && down) { + ioctl(pInfo->fd, VT_ACTIVATE, key - KEY_F11 + 10); + VTSysreqToggle = FALSE; + return TRUE; + } + break; + /* Ignore these keys -- ie don't let them cancel an alt-sysreq */ + case KEY_Alt: + case KEY_AltLang: + break; + case KEY_SysReqest: + if (!(ModifierSet(ShiftMask) || ModifierSet(ControlMask))) { + if ((ModifierSet(AltMask) || ModifierSet(AltLangMask)) && down) + VTSysreqToggle = TRUE; + } + break; + default: + /* + * We only land here when Alt-SysReq is followed by a + * non-switching key. + */ + if (VTSysreqToggle) + VTSysreqToggle = FALSE; + } + } +#endif /* USE_VT_SYSREQ */ + return FALSE; +} + +#ifdef NOTYET +static void +stdReadInput(InputInfoPtr pInfo) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + unsigned char rBuf[64]; + int nBytes, i; + + if ((nBytes = read( pInfo->fd, (char *)rBuf, sizeof(rBuf))) > 0) { + for (i = 0; i < nBytes; i++) { + pKbd->PostEvent(pInfo, rBuf[i] & 0x7f, rBuf[i] & 0x80 ? FALSE : TRUE); + } + } +} +#endif + +static Bool +OpenKeyboard(InputInfoPtr pInfo) +{ + KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; + USLKbdPrivPtr priv = (USLKbdPrivPtr) pKbd->private; + int i; + KbdProtocolId prot = PROT_UNKNOWN_KBD; + char *s; + + s = xf86SetStrOption(pInfo->options, "Protocol", NULL); + for (i = 0; protocols[i].name; i++) { + if (xf86NameCmp(s, protocols[i].name) == 0) { + prot = protocols[i].id; + break; + } + } + + switch (prot) { + case PROT_STD: +#ifdef NOTYET + pInfo->read_input = stdReadInput; + priv->xq = 0; + break; +#endif + case PROT_XQUEUE: + pInfo->read_input = NULL; /* Handled by the XQUEUE signal handler */ + priv->xq = 1; + break; + default: + xf86Msg(X_ERROR,"\"%s\" is not a valid keyboard protocol name\n", s); + xfree(s); + return FALSE; + } + + xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, s); + xfree(s); + + s = xf86SetStrOption(pInfo->options, "Device", NULL); + if (s == NULL) { + pInfo->fd = xf86Info.consoleFd; + pKbd->isConsole = TRUE; + } else { + pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL); + if (pInfo->fd == -1) { + xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s); + xfree(s); + return FALSE; + } + pKbd->isConsole = FALSE; + xfree(s); + } + + if (pKbd->isConsole) + pKbd->vtSwitchSupported = TRUE; + + return TRUE; +} + +Bool +xf86OSKbdPreInit(InputInfoPtr pInfo) +{ + KbdDevPtr pKbd = pInfo->private; + + pKbd->KbdInit = KbdInit; + pKbd->KbdOn = KbdOn; + pKbd->KbdOff = KbdOff; + pKbd->Bell = SoundBell; + pKbd->SetLeds = SetKbdLeds; + pKbd->GetLeds = GetKbdLeds; + pKbd->SetKbdRepeat = SetKbdRepeat; + pKbd->KbdGetMapping = KbdGetMapping; + pKbd->SpecialKey = SpecialKey; + pKbd->OpenKeyboard = OpenKeyboard; + + pKbd->GetSpecialKey = NULL; + pKbd->RemapScanCode = ATScancode; + pKbd->vtSwitchSupported = FALSE; + + pKbd->private = xcalloc(sizeof(USLKbdPrivRec), 1); + if (pKbd->private == NULL) { + xf86Msg(X_ERROR,"can't allocate keyboard OS private data\n"); + return FALSE; + } + + return TRUE; +} Index: programs/Xserver/hw/xfree86/os-support/usl/usl_kbd.h =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_kbd.h diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_kbd.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_kbd.h 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,14 @@ +/* $XdotOrg$ */ +#ifndef SCO_KBD_HDR +#define SCO_KBD_HDR + +typedef struct { + int orig_kbm; + struct termio kbdtty; + keymap_t keymap, noledmap; + int xq; +} USLKbdPrivRec, *USLKbdPrivPtr; + +extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms, + CARD8 *pModMap); +#endif /* SCO_KBD_HDR */ Index: programs/Xserver/hw/xfree86/os-support/usl/usl_mouse.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_mouse.c diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_mouse.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_mouse.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,187 @@ +/* $XdotOrg$ */ + +/* + * Copyright 2005 Kean Johnston + * Copyright 1999 by The XFree86 Project, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of The XFree86 Project, Inc + * and Kean Johnston not be used in advertising or publicity pertaining to + * distribution of the software without specific, written prior permission. + * The XFree86 Project, Inc and Kean Johnston make no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE XFREE86 PROJECT, INC AND KEAN JOHNSTON DISCLAIM ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THOMAS ROELLm DAVID WEXELBLAT + * OR KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + * + */ + +#include "X.h" +#include "compiler.h" +#include "xf86.h" +#include "xf86Xinput.h" +#include "xf86OSmouse.h" +#include "xf86Priv.h" +#include "xf86_OSlib.h" +#include "mipointer.h" +#include "usl_xqueue.h" + +static int +SupportedInterfaces(void) +{ + return MSE_MISC; +} + +static const char *internalNames[] = { + "Xqueue", + NULL +}; + +static const char ** +BuiltinNames(void) +{ + return internalNames; +} + +static const char * +DefaultProtocol (void) +{ + return "Xqueue"; +} + +static Bool +CheckProtocol(const char *protocol) +{ + int i; + + for (i = 0; internalNames[i]; i++) + if (xf86NameCmp(protocol, internalNames[i]) == 0) + return TRUE; + return FALSE; +} + +static int +OsMouseProc(DeviceIntPtr pPointer, int what) +{ + InputInfoPtr pInfo; + MouseDevPtr pMse; + unsigned char map[9]; + int ret; + + pInfo = pPointer->public.devicePrivate; + pMse = pInfo->private; + pMse->device = pPointer; + + switch (what) { + case DEVICE_INIT: + pPointer->public.on = FALSE; + + map[1] = 1; + map[2] = 2; + map[3] = 3; + map[4] = 7; + map[5] = 8; + map[6] = 6; + map[7] = 4; + map[8] = 5; + + InitPointerDeviceStruct((DevicePtr)pPointer, map, 8, + miPointerGetMotionEvents, pMse->Ctrl, + miPointerGetMotionBufferSize()); + /* X valuator */ + xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1); + xf86InitValuatorDefaults(pPointer, 0); + + /* Y valuator */ + xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1); + xf86InitValuatorDefaults(pPointer, 1); + + xf86MotionHistoryAllocate(pInfo); + break; + + case DEVICE_ON: + pMse->lastButtons = 0; + pMse->emulateState = 0; + pPointer->public.on = TRUE; + XqMseOnOff (pInfo, 1); + break; + + case DEVICE_CLOSE: + case DEVICE_OFF: + pPointer->public.on = FALSE; + XqMseOnOff (pInfo, 0); + break; + } + return Success; +} + +static Bool +OsMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags) +{ + /* This is called when the protocol is "Xqueue" */ + MouseDevPtr pMse; + + pMse = pInfo->private; + pMse->protocol = protocol; + xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol); + + /* Collect the options, and process the common options. */ + xf86CollectInputOptions(pInfo, NULL, NULL); + xf86ProcessCommonOptions(pInfo, pInfo->options); + + pInfo->fd = -1; +#if 0 + /* Make sure we can open the mouse */ + pInfo->fd = open ("/dev/mouse", O_RDONLY | O_NONBLOCK); + + if (pInfo->fd < 0) { + if (xf86GetAllowMouseOpenFail()) { + xf86Msg(X_WARNING, "%s: cannot open /dev/mouse (%s)\n", + pInfo->name, strerror(errno)); + } else { + xf86Msg(X_ERROR, "%s: cannot open /dev/mouse (%s)\n", + pInfo->name, strerror(errno)); + xfree(pMse); + return FALSE; + } + } +#endif + + /* Process common mouse options (like Emulate3Buttons, etc). */ + pMse->CommonOptions(pInfo); + + /* Setup the local procs. */ + pInfo->device_control = OsMouseProc; + pInfo->read_input = NULL; /* Handled by the XQUEUE signal handler */ + + pInfo->flags |= XI86_CONFIGURED; + return TRUE; +} + +OSMouseInfoPtr +xf86OSMouseInit(int flags) +{ + OSMouseInfoPtr p; + + p = xcalloc(sizeof(OSMouseInfoRec), 1); + if (!p) + return NULL; + + p->SupportedInterfaces = SupportedInterfaces; + p->BuiltinNames = BuiltinNames; + p->DefaultProtocol = DefaultProtocol; + p->CheckProtocol = CheckProtocol; + p->PreInit = OsMousePreInit; + return p; +} + Index: programs/Xserver/hw/xfree86/os-support/usl/usl_video.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_video.c diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_video.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_video.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,111 @@ +/* $XdotOrg$ */ +/* + * Copyrught 2005 Kean Johnston <jkj@sco.com> + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany + * Copyright 1993 by David Wexelblat <dwex@goblin.org> + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of Thomas Roell, David Dawes + * and Kean Johnston not be used in advertising or publicity pertaining to + * distribution of the software without specific, written prior permission. + * Thomas Roell, David Dawes and Kean Johnston make no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THOMAS ROELL, DAVID DAWES AND KEAN JOHNSTON DISCLAIM ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THOMAS ROELLm DAVID WEXELBLAT + * OR KEAN JOHNSTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + * + */ +/* $XConsortium$ */ + +#include "X.h" + +#define _NEED_SYSI86 +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86_OSlib.h" +#include "xf86OSpriv.h" + +#ifndef MAP_FAILED +#define MAP_FAILED ((void *)-1) +#endif + +static Bool +linearVidMem(void) +{ + return TRUE; +} + +static pointer +mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) +{ + pointer base; + int fd; + + fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); + if (fd < 0) { + FatalError("xf86MapVidMem: failed to open %s (%s)\n", + DEV_MEM, strerror(errno)); + } + base = mmap((caddr_t)0, Size, (flags & VIDMEM_READONLY) ? + PROT_READ : (PROT_READ | PROT_WRITE), + MAP_SHARED, fd, (off_t)Base); + close(fd); + + if (base == MAP_FAILED) { + FatalError("%s: Could not mmap framebuffer [s=%x,a=%x] (%s)\n", + "xf86MapVidMem", Size, Base, strerror(errno)); + } + return(base); +} + +/* ARGSUSED */ +static void +unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) +{ + munmap(Base, Size); +} + +/* + * For some SVR4 versions, a 32-bit read is done for the first location + * in each page when the page is first mapped. If this is done while + * memory access is enabled for regions that have read side-effects, + * this can cause unexpected results, including lockups on some hardware. + * This function is called to make sure each page is mapped while it is + * safe to do so. + */ + +#define X_PAGE_SIZE 4096 + +static void +readSideEffects(int ScreenNum, pointer Base, unsigned long Size) +{ + unsigned long base, end, addr; + CARD32 val; + + base = (unsigned long)Base; + end = base + Size; + + for (addr = base; addr < end; addr += X_PAGE_SIZE) + val = *(volatile CARD32 *)addr; +} + +void +xf86OSInitVidMem(VidMemInfoPtr pVidMem) +{ + pVidMem->linearSupported = linearVidMem(); + pVidMem->mapMem = mapVidMem; + pVidMem->unmapMem = unmapVidMem; + pVidMem->readSideEffects = readSideEffects; + pVidMem->initialised = TRUE; +} + Index: programs/Xserver/hw/xfree86/os-support/usl/usl_vtsw.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_vtsw.c diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_vtsw.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_vtsw.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,97 @@ +/* $XdotOrg$ */ +/* + * Copyright 2005 by Kean Johnston <jkj@sco.com> + * Copyright 1993 by David Wexelblat <dwex@goblin.org> + * Copyright 1993 by David McCullough <davidm@stallion.oz.au> + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of David Wexelblat not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. David Wexelblat makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XConsortium$ */ + +#include "X.h" + +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86_OSlib.h" + +/* + * Handle the VT-switching interface for SCO UnixWare / OpenServer 6 + */ + +/* + * This function is the signal handler for the VT-switching signal. It + * is only referenced inside the OS-support layer. NOTE: we do NOT need + * to re-arm the signal here, since we used sigaction() to set the signal + * disposition in usl_init.c. If we had used signal(), we would need to + * re-arm the signal here. All we need to do now is record the fact that + * we got the signal. XFree86 handles the rest. + */ +void +xf86VTRequest(int sig) +{ + xf86Info.vtRequestsPending = TRUE; + return; +} + +Bool +xf86VTSwitchPending(void) +{ + return(xf86Info.vtRequestsPending ? TRUE : FALSE); +} + +static int usl_ledstatus = -1; +static unsigned int usl_ledstate = 0; + +Bool +xf86VTSwitchAway(void) +{ + usl_ledstatus = ioctl(xf86Info.consoleFd, KDGETLED, &usl_ledstate); + + xf86Info.vtRequestsPending = FALSE; + if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) { + return(FALSE); + } else { + return(TRUE); + } +} + +Bool +xf86VTSwitchTo(void) +{ + xf86Info.vtRequestsPending = FALSE; + if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) { + return(FALSE); + } else { + if (usl_ledstatus >= 0) { + ioctl (xf86Info.consoleFd, KDSETLED, usl_ledstate); + } + usl_ledstatus = -1; + + /* + * Convince the console driver this screen is in graphics mode, + * otherwise it assumes it can do more to the screen than it should. + */ + if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) { + ErrorF("Failed to set graphics mode (%s)\n", strerror(errno)); + } + + return TRUE; + } +} Index: programs/Xserver/hw/xfree86/os-support/usl/usl_xqueue.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_xqueue.c diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_xqueue.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_xqueue.c 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,363 @@ +/* $XdotOrg$ */ +/* + * Copyright 2005 by Kean Johnston <jkj@sco.com> + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany + * Copyright 1993-1999 by The XFree86 Project, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The copyright holders make no + * representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XConsortium$ */ + +#include "X.h" +#include "compiler.h" + +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86_OSlib.h" +#include "xf86Xinput.h" +#include "xf86OSmouse.h" +#include "xf86OSKbd.h" +#include "usl_xqueue.h" + +#ifdef XKB +#include "inputstr.h" +#include <X11/extensions/XKB.h> +#include <X11/extensions/XKBstr.h> +#include <X11/extensions/XKBsrv.h> +extern Bool noXkbExtension; +#endif + +#include "xf86Xinput.h" +#include "mipointer.h" + +#if !defined(XQ_WHEEL) +# define XQ_WHEEL 4 +#endif + +/* + * Implementation notes + * + * This code is based on a mixture of the original XFree86 sysv/xqueue.c + * and information gathered from the SCO X server code (no actual code + * was used, just the principles). + * + * The XFree86 XQUEUE code went to some considerable lengths to implement + * what it calls "asynchronous XQUEUE". This involved creating a pipe, + * and writing to that pipe each time an XQUEUE signal is received. The + * one end of that pipe was then added to the list of selectable file + * descriptors with AddEnabledDevice(). I completely fail to see the need + * for this, and this code does not implement that mechanism. The server + * will be interrupted anyway by the XQUEUE driver, so whether we pull the + * events off the queue at the time we receive the signal or whether we + * write to a pipe and then have the main select() loop stop and call us, + * it makes no difference I can fathom. + * + * The code also differs from the original XFree86 code in that it maintains + * local variables for the number of devices initialized. The original code + * stored that information in the private data pointer of the mouse structure, + * but this same code is used for both the keyboard and the mouse, so that + * was changed. + * + * Part of the difficulty in dealing with XQUEUE is that it is a single + * interface to two devices. The recent changes in XFree86/Xorg try to + * treat the mouse and keyboard as discrete devices, and the code is + * structured in such a way that they should be able to be independently + * opened and closed. But we can't do that with XQUEUE, so we have to + * centralize XQUEUE access here in this module. + */ + +static xqEventQueue *xqQaddr = NULL; +static int xqSigEnable = 1; +static int xqEnableCount = 0; +static struct kd_quemode xqMode; + +/* + * These two pointers are set when the keyboard/mouse handler procs + * are called to turn them on or off. This is so that we can call the + * correct PostEvent for the device. + */ +static InputInfoPtr xqMouse = NULL; +static InputInfoPtr xqKeyboard = NULL; + +static void XqSignalHandler (int signo); + +/* + * Private functions + */ +static void +XqReset (void) +{ + if (xqEnableCount > 0) { + xqQaddr->xq_head = xqQaddr->xq_tail; + xqQaddr->xq_sigenable = xqSigEnable; + } +} + +#ifdef NOTNEEDED +static void +XqLock (void) +{ + xqSigEnable = 0; + if (xqEnableCount > 0) { + xqQaddr->xq_sigenable = xqSigEnable; + } +} + +static void +XqUnlock (void) +{ + xqSigEnable = 1; + if (xqEnableCount > 0) { + xqQaddr->xq_sigenable = xqSigEnable; + } +} +#endif /* NOTNEEDED */ + +/* + * Since this code is shared between two devices, we need to keep track + * of how many times we've been enabled or disabled. For example, if the + * keyboard has been turned off, but the mouse hasn't, then we do not + * want the whole queue off. Only when both devices are turned off do we + * actually disable Xqueue mode. When either device is turned on, we + * enable it. + */ +static int +XqEnable (InputInfoPtr pInfo) +{ + struct sigaction xqsig; + static int msefd = -1; + + if (msefd == -1) { + msefd = open ("/dev/mouse", O_RDONLY | O_NONBLOCK); +#if 0 + msefd = open ("/dev/mouse", O_RDONLY | O_NONBLOCK | O_NOCTTY); + if (msefd < 0) { + /* + * Try giving it a controlling tty + */ + msefd = open (ttyname(xf86Info.consoleFd), O_RDWR | O_NONBLOCK); + if (msefd >= 0) + close (msefd); + msefd = open ("/dev/mouse", O_RDONLY | O_NONBLOCK | O_NOCTTY); + if (msefd < 0) + sleep(2); + } +#endif + } + + if (msefd < 0) { + if (xf86GetAllowMouseOpenFail()) { + ErrorF("%s: cannot open /dev/mouse (%s)\n", + ttyname(xf86Info.consoleFd), strerror(errno)); + } else { + sleep(5); + FatalError ("%s: cannot open /dev/mouse (%s)\n", + ttyname(xf86Info.consoleFd), strerror(errno)); + } + } + + if (xqEnableCount++ == 0) { + xqMode.qaddr = 0; + ioctl (xf86Info.consoleFd, KDQUEMODE, NULL); + + /* + * Note: We need to make sure the signal is armed before we enable + * XQUEUE mode, so that if we get events immediately after the ioctl + * we dont have an unhandled signal coming to the Xserver. + * Also note that we use sigaction, so that we do not have to re-arm + * the signal every time it is delivered, which just slows things + * down (setting a signal is a fairly expensive operation). + */ + + xqsig.sa_handler = XqSignalHandler; + sigfillset (&xqsig.sa_mask); + xqsig.sa_flags = 0; + sigaction (SIGUSR2, &xqsig, NULL); + + /* + * This is a fairly large queue size. Since we are reacting to events + * asynchronously, its best for performance if we deal with as many + * events as possible, and high resolution mice generate a lot of + * events. + */ + xqMode.qsize = 64; + xqMode.signo = SIGUSR2; + xqMode.qaddr = 0; + if (ioctl (xf86Info.consoleFd, KDQUEMODE, &xqMode) < 0) { + xf86Msg (X_ERROR, "%s: could not set XQUEUE mode (%s)", pInfo->name, + strerror(errno)); + xqEnableCount--; + + xqsig.sa_handler = SIG_DFL; + sigfillset (&xqsig.sa_mask); + xqsig.sa_flags = 0; + sigaction (SIGUSR2, &xqsig, NULL); + + return !Success; + } + + /* + * We're in business. The workstation is now in XQUEUE mode. + */ + xqQaddr = (xqEventQueue *)xqMode.qaddr; + xqQaddr->xq_sigenable = 0; /* LOCK */ + nap(500); + XqReset(); + } + return Success; +} + +static int +XqDisable (InputInfoPtr pInfo) +{ + struct sigaction xqsig; + + if (xqEnableCount-- == 1) { + xqQaddr->xq_sigenable = 0; /* LOCK */ + + if (ioctl (xf86Info.consoleFd, KDQUEMODE, NULL) < 0) { + xf86Msg (X_ERROR, "%s: could not unset XQUEUE mode (%s)", pInfo->name, + strerror(errno)); + xqEnableCount++; + return !Success; + } + + xqsig.sa_handler = SIG_DFL; + sigfillset (&xqsig.sa_mask); + xqsig.sa_flags = 0; + sigaction (SIGUSR2, &xqsig, NULL); + } + + return Success; +} + +/* + * XQUEUE signal handler. This is what goes through the list of events + * we've already received and dispatches them to either the keyboard or + * mouse event poster. + */ +static void +XqSignalHandler (int signo) +{ + xqEvent *xqEvents = xqQaddr->xq_events; + int xqHead = xqQaddr->xq_head; + xEvent xE; + MouseDevPtr pMse = NULL; + KbdDevPtr pKbd = NULL; + signed char dx, dy; + + if (xqMouse) + pMse = (MouseDevPtr)xqMouse->private; + if (xqKeyboard) + pKbd = (KbdDevPtr)xqKeyboard->private; + + while (xqHead != xqQaddr->xq_tail) { + + switch (xqEvents[xqHead].xq_type) { + case XQ_MOTION: + dx = (signed char)xqEvents[xqHead].xq_x; + dy = (signed char)xqEvents[xqHead].xq_y; + if (pMse) + pMse->PostEvent(xqMouse, ~(xqEvents[xqHead].xq_code) & 0x07, + (int)dx, (int)dy, 0, 0); + break; + + case XQ_BUTTON: + if (pMse) + pMse->PostEvent(xqMouse, ~(xqEvents[xqHead].xq_code) & 0x07, + 0, 0, 0, 0); + break; + + case XQ_WHEEL: + if (pMse) { + int wbut = pMse->lastButtons; + if (xqEvents[xqHead].xq_code == 1) + wbut |= 0x80; + else + wbut |= 0x40; + pMse->PostEvent(xqMouse, wbut, 0, 0, 0, 0); + /* Simulate button release */ + wbut &= ~0xc0; + pMse->PostEvent(xqMouse, wbut, 0, 0, 0, 0); + } + break; + + case XQ_KEY: + if (pKbd) + pKbd->PostEvent(xqKeyboard, xqEvents[xqHead].xq_code & 0x7f, + xqEvents[xqHead].xq_code & 0x80 ? FALSE : TRUE); + break; + + default: + xf86Msg(X_WARNING, "XQUEUE: unknown event type %d\n", + xqEvents[xqHead].xq_type); + break; + } + + xqHead++; + if (xqHead == xqQaddr->xq_size) + xqHead = 0; + xf86Info.inputPending = TRUE; + } + + XqReset(); +} + +/* + * Public functions + */ +int +XqMseOnOff (InputInfoPtr pInfo, int on) +{ + if (on) { + if (xqMouse) { + if (xqMouse != pInfo) + xf86Msg(X_WARNING, "XqMseOnOff: mouse pointer structure changed!\n"); + xqMouse = pInfo; + } else { + xqMouse = pInfo; + return XqEnable(pInfo); + } + } else { + xqMouse = NULL; + return XqDisable(pInfo); + } + return Success; +} + +int +XqKbdOnOff (InputInfoPtr pInfo, int on) +{ + if (on) { + if (xqKeyboard) { + if (xqKeyboard != pInfo) + xf86Msg(X_WARNING, "XqKbdOnOff: keyboard pointer structure changed!\n"); + xqKeyboard = pInfo; + } else { + xqKeyboard = pInfo; + return XqEnable(pInfo); + } + } else { + xqKeyboard = NULL; + return XqDisable(pInfo); + } + return Success; +} + Index: programs/Xserver/hw/xfree86/os-support/usl/usl_xqueue.h =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/usl/usl_xqueue.h diff -N programs/Xserver/hw/xfree86/os-support/usl/usl_xqueue.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/usl/usl_xqueue.h 7 Nov 2005 06:01:11 -0000 @@ -0,0 +1,9 @@ +/* $XdotOrg$ */ + +#ifndef _XF86_USL_XQUEUE_H_ +#define _XF86_USL_XQUEUE_H_ + +extern int XqMseOnOff (InputInfoPtr pInfo, int on); +extern int XqKbdOnOff (InputInfoPtr pInfo, int on); + +#endif Index: programs/Xserver/hw/xfree86/parser/Monitor.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/parser/Monitor.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 Monitor.c --- programs/Xserver/hw/xfree86/parser/Monitor.c 3 Jul 2005 07:01:37 -0000 1.3 +++ programs/Xserver/hw/xfree86/parser/Monitor.c 7 Nov 2005 06:01:11 -0000 @@ -654,6 +654,11 @@ xf86printMonitorSection (FILE * cf, XF86 int i; XF86ConfModeLinePtr mlptr; XF86ConfModesLinkPtr mptr; +#if defined(__SCO__) || defined(__UNIXWARE__) + const char *cstr = ""; +#else + const char *cstr = "#"; +#endif while (ptr) { @@ -675,17 +680,22 @@ xf86printMonitorSection (FILE * cf, XF86 fprintf (cf, "\tDisplaySize %d\t%d\n", ptr->mon_width, ptr->mon_height); +#if defined(__SCO__) || defined(__UNIXWARE__) + if ( ptr->mon_n_hsync || ptr->mon_n_vrefresh ) + fprintf(cf," ### Comment all HorizSync and VertSync values to use DDC:\n"); +#else if ( ptr->mon_n_hsync || ptr->mon_n_vrefresh ) fprintf(cf," ### Uncomment if you don't want to default to DDC:\n"); +#endif for (i = 0; i < ptr->mon_n_hsync; i++) { - fprintf (cf, "#\tHorizSync %2.1f - %2.1f\n", + fprintf (cf, "%s\tHorizSync %2.1f - %2.1f\n", cstr, ptr->mon_hsync[i].lo, ptr->mon_hsync[i].hi); } for (i = 0; i < ptr->mon_n_vrefresh; i++) { - fprintf (cf, "#\tVertRefresh %2.1f - %2.1f\n", + fprintf (cf, "%s\tVertRefresh %2.1f - %2.1f\n", cstr, ptr->mon_vrefresh[i].lo, ptr->mon_vrefresh[i].hi); } Index: programs/Xserver/hw/xfree86/vbe/vbe.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/vbe/vbe.h,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 vbe.h --- programs/Xserver/hw/xfree86/vbe/vbe.h 24 Aug 2005 11:18:34 -0000 1.5 +++ programs/Xserver/hw/xfree86/vbe/vbe.h 7 Nov 2005 06:01:11 -0000 @@ -60,8 +60,7 @@ typedef struct vbeControllerInfoBlock { CARD8 OemData[256]; } vbeControllerInfoRec, *vbeControllerInfoPtr; -#if defined(__GNUC__) || defined(SCO) || defined(__USLC__) || \ - defined(__SUNPRO_C) +#if defined(__GNUC__) || defined(__USLC__) || defined(__SUNPRO_C) #pragma pack() /* All GCC versions recognise this syntax */ #else #pragma pack(0) Index: programs/Xserver/hw/xfree86/xf86cfg/cards.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/xf86cfg/cards.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 cards.c --- programs/Xserver/hw/xfree86/xf86cfg/cards.c 4 Dec 2004 00:43:11 -0000 1.3 +++ programs/Xserver/hw/xfree86/xf86cfg/cards.c 7 Nov 2005 06:01:12 -0000 @@ -489,6 +489,9 @@ LookupCard(char *name) { CardsEntry **ptr; + if (NumCardsEntry == 0 || CardsDB == 0) + return NULL; + ptr = (CardsEntry**)bsearch(name, CardsDB, NumCardsEntry, sizeof(CardsEntry*), BCompareCards); Index: programs/Xserver/hw/xfree86/xf86cfg/interface.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c,v retrieving revision 1.7 diff -u -3 -p -u -r1.7 interface.c --- programs/Xserver/hw/xfree86/xf86cfg/interface.c 26 Sep 2005 02:41:38 -0000 1.7 +++ programs/Xserver/hw/xfree86/xf86cfg/interface.c 7 Nov 2005 06:01:12 -0000 @@ -68,6 +68,9 @@ #define DefaultXFree86Dir "/usr/X11R6" #endif +#define IS_KBDDRIV(S) ((strcasecmp((S),"kbd") == 0) || \ + (strcasecmp((S), "keyboard") == 0)) + /* * Prototypes */ @@ -791,7 +794,7 @@ InitializeDevices(void) mouse_x = work->core.width - (work->core.width >> 2); } } - else if (strcasecmp(input->inp_driver, "keyboard") == 0) { + else if (IS_KBDDRIV(input->inp_driver)) { device = AddDevice(KEYBOARD, (XtPointer)input, keyboard_x, keyboard_y); SetTip(device); if ((keyboard_x += DEFAULT_KEYBOARD_WIDTH) > @@ -1645,8 +1648,7 @@ EnableDeviceCallback(Widget w, XtPointer while (nex != NULL) { if (strcasecmp(nex->iref_inputdev->inp_driver, "mouse") == 0) ++nmouses; - else if (strcasecmp(nex->iref_inputdev->inp_driver, - "keyboard") == 0) + else if (IS_KBDDRIV(nex->iref_inputdev->inp_driver)) ++nkeyboards; iref = nex; nex = (XF86ConfInputrefPtr)(nex->list.next); Index: programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 keyboard-cfg.c --- programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c 4 Apr 2005 10:17:06 -0000 1.4 +++ programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c 7 Nov 2005 06:01:12 -0000 @@ -38,6 +38,9 @@ #include <X11/Xaw/SimpleMenu.h> #include <X11/Xaw/SmeBSB.h> +#define IS_KBDDRIV(X) ((strcasecmp((X),"kbd") == 0) || \ + (strcasecmp((X), "keyboard") == 0)) + /* * Types */ @@ -159,8 +162,7 @@ KeyboardConfig(XtPointer config) XF86ConfInputPtr key = XF86Config->conf_input_lst; while (key != NULL) { - if (strcasecmp(key->inp_driver, "keyboard") == 0 && - xkb_infos[i]->conf == key) + if (IS_KBDDRIV(key->inp_driver) && xkb_infos[i]->conf == key) break; key = (XF86ConfInputPtr)(key->list.next); } @@ -216,7 +218,7 @@ KeyboardConfig(XtPointer config) int nkeyboards = 0; while (input != NULL) { - if (strcasecmp(input->inp_driver, "keyboard") == 0) + if (IS_KBDDRIV(input->inp_driver)) ++nkeyboards; input = (XF86ConfInputPtr)(input->list.next); } @@ -253,7 +255,11 @@ KeyboardConfig(XtPointer config) keyboard = XtNew(XF86ConfInputRec); keyboard->list.next = NULL; keyboard->inp_identifier = XtNewString(ident_string); +#if defined(USE_DEPRECATED_KEYBOARD_DRIVER) keyboard->inp_driver = XtNewString("keyboard"); +#else + keyboard->inp_driver = XtNewString("kbd"); +#endif keyboard->inp_option_lst = xf86newOption(XtNewString(XkbRules), XtNewString(rules)); xf86addNewOption(keyboard->inp_option_lst, @@ -493,7 +499,7 @@ InitializeKeyboard(void) /* XXX Assumes the first keyboard is the core keyboard */ while (keyboard != NULL) { - if (strcasecmp(keyboard->inp_driver, "keyboard") == 0) + if (IS_KBDDRIV(keyboard->inp_driver)) break; keyboard = (XF86ConfInputPtr)(keyboard->list.next); } Index: programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 mouse-cfg.c --- programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.c 4 Apr 2005 10:17:06 -0000 1.4 +++ programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.c 7 Nov 2005 06:01:12 -0000 @@ -58,9 +58,12 @@ static struct MouseProtocol { #ifdef __UNIXOS2__ {"OS2Mouse", MTYPE_AUTOMOUSE}, #endif -#ifdef SCO +#ifdef __SCO__ {"OsMouse", MTYPE_AUTOMOUSE}, #endif +#if defined(__UNIXWARE__) + {"Xqueue", MTYPE_XQUEUE}, +#endif #ifdef WSCONS_SUPPORT {"wsmouse", MTYPE_AUTOMOUSE}, #endif Index: programs/Xserver/hw/xfree86/xf86cfg/text-mode.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 text-mode.c --- programs/Xserver/hw/xfree86/xf86cfg/text-mode.c 25 Aug 2005 04:09:45 -0000 1.4 +++ programs/Xserver/hw/xfree86/xf86cfg/text-mode.c 7 Nov 2005 06:01:12 -0000 @@ -33,7 +33,8 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#if defined(_SCO_DS) || (defined(sun) && defined(__SVR4)) +#if defined(__SCO__) || defined(__UNIXWARE__) || \ + (defined(sun) && defined(__SVR4)) #include <curses.h> #else #include <ncurses.h> @@ -47,6 +48,9 @@ #include "xf86config.h" #include "loader.h" +#define IS_KBDDRIV(X) ((strcmp((X),"kbd") == 0) || \ + (strcmp((X), "keyboard") == 0)) + #ifndef PROJECT_ROOT #define PROJECT_ROOT "/usr/X11R6" #endif @@ -201,16 +205,21 @@ TextMode(void) ClearScreen(); refresh(); - if (Dialog( __XSERVERNAME__"Configuration", + if (Dialog( __XSERVERNAME__" Configuration", "This program will create the "__XCONFIGFILE__" file, based on " "menu selections you make.\n" "\n" +#if defined(__SCO__) || defined(__UNIXWARE__) + "The "__XCONFIGFILE__" file usually resides in /etc. A " + "sample "__XCONFIGFILE__" file is supplied with " +#else #ifndef __UNIXOS2__ "The "__XCONFIGFILE__" file usually resides in /usr/X11R6/etc/X11 " #else "The "__XCONFIGFILE__" file usually resides in "XF86CONFIGDIR" " #endif "or /etc/X11. A sample "__XCONFIGFILE__" file is supplied with " +#endif __XSERVERNAME__"; it is configured for a standard VGA card and " "monitor with 640x480 resolution. This program will ask for " "a pathname when it is ready to write the file.\n" @@ -350,9 +359,12 @@ static char *protocols[] = { #ifdef __UNIXOS2__ "OS2Mouse", #endif -#ifdef SCO +#ifdef __SCO__ "OsMouse", #endif +#ifdef __UNIXWARE__ + "Xqueue", +#endif #ifdef WSCONS_SUPPORT "wsmouse", #endif @@ -611,7 +623,7 @@ KeyboardConfig(void) nlist = 0; while (input) { - if (strcmp(input->inp_driver, "keyboard") == 0) { + if (IS_KBDDRIV(input->inp_driver)) { list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); list[nlist] = XtMalloc(sizeof(Edit) + strlen(input->inp_identifier) + 1); @@ -730,7 +742,11 @@ KeyboardConfig(void) input->inp_option_lst = xf86addNewOption(input->inp_option_lst, XtNewString("XkbLayout"), XtNewString("us")); +#if defined(USE_DEPRECATED_KEYBOARD_DRIVER) input->inp_driver = XtNewString("keyboard"); +#else + input->inp_driver = XtNewString("kbd"); +#endif XF86Config->conf_input_lst = xf86addInput(XF86Config, input); } @@ -806,7 +822,11 @@ KeyboardConfig(void) XtNewString("XkbLayout"), XtNewString(layout)); if (input->inp_driver == NULL) { +#if defined(USE_DEPRECATED_KEYBOARD_DRIVER) input->inp_driver = XtNewString("keyboard"); +#else + input->inp_driver = XtNewString("kbd"); +#endif XF86Config->conf_input_lst = xf86addInput(XF86Config->conf_input_lst, input); } @@ -1884,7 +1904,7 @@ LayoutConfig(void) mouses[nmouses] = input; ++nmouses; } - else if (strcmp(input->inp_driver, "keyboard") == 0) { + else if (IS_KBDDRIV(input->inp_driver)) { keyboards = (XF86ConfInputPtr*)XtRealloc((XtPointer)keyboards, (nkeyboards + 1) * sizeof(XF86ConfInputPtr)); keyboards[nkeyboards] = input; @@ -2119,7 +2139,7 @@ LayoutConfig(void) piref = NULL; iref = layout->lay_input_lst; while (iref) { - if (strcmp(iref->iref_inputdev->inp_driver, "keyboard") == 0) { + if (IS_KBDDRIV(iref->iref_inputdev->inp_driver)) { if (keyboard == NULL) piref = iref; if (xf86findOption(iref->iref_option_lst, "CoreKeyboard")) { @@ -2165,7 +2185,7 @@ LayoutConfig(void) list[nlist++] = keyboard->inp_identifier; input = XF86Config->conf_input_lst; while (input) { - if (input != keyboard && strcmp(input->inp_driver, "keyboard") == 0) { + if (input != keyboard && IS_KBDDRIV(input->inp_driver)) { list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); list[nlist++] = input->inp_identifier; } @@ -3206,6 +3226,9 @@ DialogInput(char *title, char *prompt, i continue; case KEY_BACKSPACE: case 0177: +#if defined(__SCO__) || defined(__UNIXWARE__) + case '\b': +#endif if (input_x || scrlx) { wattrset(dialog, dialog_attr); Index: programs/Xserver/hw/xfree86/xf86config/xorgconfig.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/xf86config/xorgconfig.c,v retrieving revision 1.18 diff -u -3 -p -u -r1.18 xorgconfig.c --- programs/Xserver/hw/xfree86/xf86config/xorgconfig.c 26 Sep 2005 02:41:38 -0000 1.18 +++ programs/Xserver/hw/xfree86/xf86config/xorgconfig.c 7 Nov 2005 06:01:13 -0000 @@ -2134,8 +2134,13 @@ static char *pointersection_text1 = "\n" "# Identifier and driver\n" "\n" +#if defined(__UNIXWARE__) || defined(XQUEUE) +"# Identifier \"Mouse1\"\n" +"# Driver \"mouse\"\n" +#else " Identifier \"Mouse1\"\n" " Driver \"mouse\"\n" +#endif ; static char *pointersection_text2 = @@ -2143,7 +2148,11 @@ static char *pointersection_text2 = "# When using XQUEUE, comment out the above two lines, and uncomment\n" "# the following line.\n" "\n" +#if defined(__UNIXWARE__) || defined(XQUEUE) +" Option \"Protocol\" \"Xqueue\"\n" +#else "# Option \"Protocol\" \"Xqueue\"\n" +#endif "\n" "# Mouse-speed setting for PS/2 mouse.\n" "\n" Index: programs/Xserver/include/os.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/include/os.h,v retrieving revision 1.8 diff -u -3 -p -u -r1.8 os.h --- programs/Xserver/include/os.h 3 Jul 2005 08:53:50 -0000 1.8 +++ programs/Xserver/include/os.h 7 Nov 2005 06:01:13 -0000 @@ -93,7 +93,7 @@ typedef struct _NewClientRec *NewClientP #endif #ifndef IN_MODULE -#ifdef SCO +#ifdef __SCO__ #include <stdio.h> #endif #include <string.h> Index: programs/Xserver/os/access.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/os/access.c,v retrieving revision 1.12 diff -u -3 -p -u -r1.12 access.c --- programs/Xserver/os/access.c 3 Jul 2005 08:53:51 -0000 1.12 +++ programs/Xserver/os/access.c 7 Nov 2005 06:01:13 -0000 @@ -84,9 +84,9 @@ SOFTWARE. #include <sys/ioctl.h> #include <ctype.h> -#if defined(TCPCONN) || defined(STREAMSCONN) || defined(ISC) || defined(SCO) +#if defined(TCPCONN) || defined(STREAMSCONN) || defined(ISC) || defined(__SCO__) #include <netinet/in.h> -#endif /* TCPCONN || STREAMSCONN || ISC || SCO */ +#endif /* TCPCONN || STREAMSCONN || ISC || __SCO__ */ #ifdef DNETCONN #include <netdnet/dn.h> #include <netdnet/dnetdb.h> @@ -138,9 +138,7 @@ SOFTWARE. #endif /* hpux */ #ifdef SVR4 -#ifndef SCO #include <sys/sockio.h> -#endif #include <sys/stropts.h> #endif @@ -193,6 +191,11 @@ SOFTWARE. #endif #endif +#ifdef __SCO__ +/* The system defined value is wrong. MAXPATHLEN is set in sco5.cf. */ +#undef PATH_MAX +#endif + #define X_INCLUDE_NETDB_H #include <X11/Xos_r.h> Index: programs/Xserver/os/osinit.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/os/osinit.c,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 osinit.c --- programs/Xserver/os/osinit.c 3 Jul 2005 08:53:51 -0000 1.6 +++ programs/Xserver/os/osinit.c 7 Nov 2005 06:01:13 -0000 @@ -69,7 +69,7 @@ SOFTWARE. #endif #endif -#if defined(Lynx) || defined(SCO) || defined(SCO325) +#if defined(Lynx) || defined(__SCO__) #include <sys/wait.h> #endif @@ -114,7 +114,7 @@ OsInit(void) #ifdef XFree86LOADER xf86WrapperInit(); #endif -#if !defined(SCO) && !defined(__CYGWIN__) +#if !defined(__SCO__) && !defined(__CYGWIN__) && !defined(__UNIXWARE__) fclose(stdin); fclose(stdout); #endif Index: programs/Xserver/os/utils.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/os/utils.c,v retrieving revision 1.20 diff -u -3 -p -u -r1.20 utils.c --- programs/Xserver/os/utils.c 3 Jul 2005 08:53:51 -0000 1.20 +++ programs/Xserver/os/utils.c 7 Nov 2005 06:01:13 -0000 @@ -2238,3 +2238,53 @@ CheckUserAuthorization(void) } #endif } + +#ifdef __SCO__ +#include <fcntl.h> + +static void +lockit (int fd, short what) +{ + struct flock lck; + + lck.l_whence = 0; + lck.l_start = 0; + lck.l_len = 1; + lck.l_type = what; + + (void)fcntl (fd, F_SETLKW, &lck); +} + +/* SCO OpenServer 5 lacks pread/pwrite. Emulate them. */ +ssize_t +pread (int fd, void *buf, size_t nbytes, off_t offset) +{ + off_t saved; + ssize_t ret; + + lockit (fd, F_RDLCK); + saved = lseek (fd, 0, SEEK_CUR); + lseek (fd, offset, SEEK_SET); + ret = read (fd, buf, nbytes); + lseek (fd, saved, SEEK_SET); + lockit (fd, F_UNLCK); + + return ret; +} + +ssize_t +pwrite (int fd, const void *buf, size_t nbytes, off_t offset) +{ + off_t saved; + ssize_t ret; + + lockit (fd, F_WRLCK); + saved = lseek (fd, 0, SEEK_CUR); + lseek (fd, offset, SEEK_SET); + ret = write (fd, buf, nbytes); + lseek (fd, saved, SEEK_SET); + lockit (fd, F_UNLCK); + + return ret; +} +#endif /* __SCO__ */ Index: programs/fonttosfnt/util.c =================================================================== RCS file: /cvs/xorg/xc/programs/fonttosfnt/util.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 util.c --- programs/fonttosfnt/util.c 23 Apr 2004 19:54:32 -0000 1.2 +++ programs/fonttosfnt/util.c 7 Nov 2005 06:01:13 -0000 @@ -56,7 +56,7 @@ THE SOFTWARE. #define GMTOFFMEMBER tm_gmtoff #endif -#ifdef SCO +#ifdef __SCO__ #define HAVE_TM_GMTOFF #define GMTOFFMEMBER tm_tzadj #endif Index: programs/ico/ico.c =================================================================== RCS file: /cvs/xorg/xc/programs/ico/ico.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 ico.c --- programs/ico/ico.c 13 Aug 2005 02:13:30 -0000 1.3 +++ programs/ico/ico.c 7 Nov 2005 06:01:14 -0000 @@ -238,6 +238,7 @@ const char *ico_geom = NULL; /* -size: s const char *delta_geom = NULL; /* -delta: amount by which to move object */ Polyinfo *poly; /* -obj: the poly to draw */ int dsync = 0; /* -dsync */ +int xsync = 0; /* -sync */ int msleepcount = 0; /* -sleep value in milliseconds*/ #ifdef MULTITHREAD int thread_count; @@ -1268,7 +1269,7 @@ int main(argc, argv) } else if (!strcmp(*argv, "-dsync")) dsync = 1; else if (!strncmp(*argv, "-sync", 5)) - _Xdebug = 1; + xsync = 1; else if (!strcmp(*argv, "-objhelp")) { giveObjHelp(); exit(1); @@ -1293,6 +1294,8 @@ int main(argc, argv) if (!(dpy = XOpenDisplay(display))) icoFatal("cannot open display \"%s\"", XDisplayName(display)); wm_delete_window = XInternAtom (dpy, "WM_DELETE_WINDOW", False); + if (xsync) + XSynchronize(dpy, True); #ifdef MULTIBUFFER if (multibufext && !XmbufQueryExtension (dpy, &mbevbase, &mberrbase)) { Index: programs/rgb/rgb.c =================================================================== RCS file: /cvs/xorg/xc/programs/rgb/rgb.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 rgb.c --- programs/rgb/rgb.c 23 Jul 2005 15:32:50 -0000 1.3 +++ programs/rgb/rgb.c 7 Nov 2005 06:01:14 -0000 @@ -42,7 +42,7 @@ from The Open Group. #ifdef NDBM #include <ndbm.h> #else -#if defined(SVR4) && !defined(SCO325) +#if defined(SVR4) #include <rpcsvc/dbm.h> #else #include <dbm.h> Index: programs/rgb/showrgb.c =================================================================== RCS file: /cvs/xorg/xc/programs/rgb/showrgb.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 showrgb.c --- programs/rgb/showrgb.c 23 Jul 2005 15:32:50 -0000 1.4 +++ programs/rgb/showrgb.c 7 Nov 2005 06:01:14 -0000 @@ -37,7 +37,7 @@ in this Software without prior written a #ifdef NDBM #include <ndbm.h> #else -#if defined(SVR4) && !defined(SCO325) +#if defined(SVR4) #include <rpcsvc/dbm.h> #else #include <dbm.h> Index: programs/xauth/gethost.c =================================================================== RCS file: /cvs/xorg/xc/programs/xauth/gethost.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 gethost.c --- programs/xauth/gethost.c 26 Jul 2005 16:58:27 -0000 1.3 +++ programs/xauth/gethost.c 7 Nov 2005 06:01:14 -0000 @@ -63,9 +63,9 @@ in this Software without prior written a #include <arpa/inet.h> #ifdef SYSV #ifdef i386 -#if !defined(sco) && !defined(sun) +#if !defined(SCO325) && !defined(sun) #include <net/errno.h> -#endif /* !sco && !sun */ +#endif /* !SCO325 && !sun */ #endif /* i386 */ #endif /* SYSV */ #endif /* !STREAMSCONN */ Index: programs/xconsole/xconsole.c =================================================================== RCS file: /cvs/xorg/xc/programs/xconsole/xconsole.c,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 xconsole.c --- programs/xconsole/xconsole.c 17 Aug 2005 21:03:23 -0000 1.6 +++ programs/xconsole/xconsole.c 7 Nov 2005 06:01:14 -0000 @@ -940,10 +940,10 @@ get_pty(int *pty, int *tty, char *ttydev * sends the output to xconsole. */ -#ifdef SCO +#ifdef SCO325 #define OSM_DEVICE "/dev/error" #else -#ifdef USL +#ifdef __UNIXWARE__ #define OSM_DEVICE "/dev/osm2" #define NO_READAHEAD #else Index: programs/xcursorgen/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/xcursorgen/Imakefile,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 Imakefile --- programs/xcursorgen/Imakefile 23 Apr 2004 19:54:41 -0000 1.2 +++ programs/xcursorgen/Imakefile 7 Nov 2005 06:01:14 -0000 @@ -8,8 +8,8 @@ XCOMM $XFree86: xc/programs/xcursorgen/I THEMEDIR = $(ICONDIR)/default INCLUDES = $(LIBPNGINC) DEPLIBS = $(DEPXLIB) -LOCAL_LIBRARIES = $(XCURSORLIB) $(XRENDERLIB) $(XLIB) $(LIBPNGLIB) \ - MathLibrary GzipLibrary +LOCAL_LIBRARIES = $(XCURSORLIB) $(XRENDERLIB) $(XFIXESLIB) $(XLIB) \ + $(LIBPNGLIB) MathLibrary GzipLibrary SRCS = xcursorgen.c OBJS = xcursorgen.o Index: programs/xdm/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/xdm/Imakefile,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 Imakefile --- programs/xdm/Imakefile 18 Oct 2005 02:12:17 -0000 1.5 +++ programs/xdm/Imakefile 7 Nov 2005 06:01:14 -0000 @@ -96,12 +96,16 @@ PAM_DEFINES = -DUSE_PAM BSDAUTH_DEFINES = -DUSE_BSDAUTH #endif +#if defined(i386ScoArchitecture) +PWD_DEFINES = -DUSESECUREWARE +#else #if SystemV4 || HasShadowPasswd #if !LinuxShadowSuite PWD_DEFINES = -DUSESHADOW #else PWD_DEFINES = -DUSESHADOW -DSHADOWSUITE #endif +#endif #if !defined(i386IscArchitecture) && !defined(i386ScoArchitecture) && !defined(LinuxArchitecture) && !defined(NTOArchitecture) && !defined(SGIArchitecture) SYS_LIBRARIES3 = -lresolv @@ -122,6 +126,10 @@ SYS_LIBRARIES1 = -lauth SYS_LIBRARIES1 = -ls #endif +#if defined(i386ScoArchitecture) +SYS_LIBRARIES1 = -lprot +#endif + #if HasLibCrypt #ifdef SpecialLibCrypt CRYPT_LIBRARIES = SpecialLibCrypt Index: programs/xdm/auth.c =================================================================== RCS file: /cvs/xorg/xc/programs/xdm/auth.c,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 auth.c --- programs/xdm/auth.c 3 Oct 2005 17:36:09 -0000 1.4 +++ programs/xdm/auth.c 7 Nov 2005 06:01:14 -0000 @@ -39,6 +39,7 @@ from The Open Group. */ #include <X11/X.h> +#include <X11/Xlibint.h> #include <sys/types.h> #include <sys/stat.h> @@ -58,8 +59,7 @@ from The Open Group. # include <netdnet/dnetdb.h> #endif -#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) || (defined(SYSV) && defined(i386)) -#define NEED_UTSNAME +#if defined(hpux) #include <sys/utsname.h> #endif @@ -73,9 +73,7 @@ from The Open Group. #ifdef SVR4 # include <netdb.h> -# ifndef SCO325 # include <sys/sockio.h> -# endif # include <sys/stropts.h> #endif #ifdef __convex__ @@ -685,11 +683,7 @@ static void DefineLocal (FILE *file, Xauth *auth) { char displayname[100]; - char tmp_displayname[100]; - - strcpy(tmp_displayname, ""); - - /* stolen from xinit.c */ + int len = _XGetHostname (displayname, sizeof(displayname)); /* Make sure this produces the same string as _XGetHostname in lib/X/XlibInt.c. * Otherwise, Xau will not be able to find your cookies in the Xauthority file. @@ -699,46 +693,29 @@ DefineLocal (FILE *file, Xauth *auth) * and so, you may be better off using gethostname (if it exists). */ -#ifdef NEED_UTSNAME - - /* hpux: - * Why not use gethostname()? Well, at least on my system, I've had to - * make an ugly kernel patch to get a name longer than 8 characters, and - * uname() lets me access to the whole string (it smashes release, you - * see), whereas gethostname() kindly truncates it for me. - */ - { - struct utsname name; - - uname(&name); - snprintf(displayname, sizeof(displayname), "%s", name.nodename); - } - writeAddr (FamilyLocal, strlen (displayname), displayname, file, auth); - - snprintf(tmp_displayname, sizeof(tmp_displayname), "%s", displayname); -#endif - -#if (!defined(NEED_UTSNAME) || defined (hpux)) - /* AIXV3: - * In AIXV3, _POSIX_SOURCE is defined, but uname gives only first - * field of hostname. Thus, we use gethostname instead. - */ - +#if defined(hpux) /* * For HP-UX, HP's Xlib expects a fully-qualified domain name, which * is achieved by using gethostname(). For compatability, we must - * also still create the entry using uname() above. + * also still create the entry using uname(). */ - gethostname(displayname, sizeof(displayname)); - + char tmp_displayname[100]; + struct utsname name; + + tmp_displayname[0] = 0; + uname(&name); + snprintf(tmp_displayname, sizeof(tmp_displayname), "%s", name.nodename); + writeAddr (FamilyLocal, strlen (tmp_displayname), tmp_displayname, + file, auth); + /* - * If gethostname and uname both returned the same name, - * do not write a duplicate entry. + * If _XGetHostname() returned the same value as uname(), don't + * write a duplicate entry. */ if (strcmp (displayname, tmp_displayname)) - writeAddr (FamilyLocal, strlen (displayname), displayname, - file, auth); #endif + + writeAddr (FamilyLocal, len, displayname, file, auth); } #ifdef HAS_GETIFADDRS Index: programs/xdm/chooser.c =================================================================== RCS file: /cvs/xorg/xc/programs/xdm/chooser.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 chooser.c --- programs/xdm/chooser.c 24 May 2005 00:10:17 -0000 1.3 +++ programs/xdm/chooser.c 7 Nov 2005 06:01:17 -0000 @@ -75,7 +75,7 @@ in this Software without prior written a #include <X11/extensions/Xinerama.h> #endif -#if defined(SVR4) && !defined(SCO325) +#if defined(SVR4) #include <sys/sockio.h> #endif #if defined(SVR4) && defined(PowerMAX_OS) Index: programs/xdm/dm.c =================================================================== RCS file: /cvs/xorg/xc/programs/xdm/dm.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 dm.c --- programs/xdm/dm.c 23 Apr 2004 19:54:42 -0000 1.2 +++ programs/xdm/dm.c 7 Nov 2005 06:01:17 -0000 @@ -56,6 +56,9 @@ from The Open Group. #ifdef __NetBSD__ #include <sys/param.h> #endif +#ifdef USESECUREWARE +#include <prot.h> +#endif #ifndef sigmask #define sigmask(m) (1 << ((m - 1))) @@ -73,7 +76,7 @@ from The Open Group. #endif -#if defined(SVR4) && !defined(SCO) && !defined(sun) +#if defined(SVR4) && !defined(sun) extern FILE *fdopen(); #endif @@ -118,6 +121,10 @@ main (int argc, char **argv) TitleLen = (argv[argc - 1] + strlen(argv[argc - 1])) - Title; #endif +#ifdef USESECUREWARE + set_auth_parameters (argc, argv); +#endif + /* * Step 1 - load configuration parameters */ Index: programs/xdm/dm.h =================================================================== RCS file: /cvs/xorg/xc/programs/xdm/dm.h,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 dm.h --- programs/xdm/dm.h 14 Jul 2005 22:58:25 -0000 1.4 +++ programs/xdm/dm.h 7 Nov 2005 06:01:17 -0000 @@ -80,7 +80,7 @@ from The Open Group. #include <sys/wait.h> #else #define _POSIX_SOURCE -#ifdef SCO325 +#ifdef __SCO__ #include <sys/procset.h> #include <sys/siginfo.h> #endif Index: programs/xdm/resource.c =================================================================== RCS file: /cvs/xorg/xc/programs/xdm/resource.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 resource.c --- programs/xdm/resource.c 11 Nov 2004 15:44:31 -0000 1.3 +++ programs/xdm/resource.c 7 Nov 2005 06:01:17 -0000 @@ -133,9 +133,13 @@ int choiceTimeout; /* chooser choice tim #ifndef DEF_RANDOM_FILE #define DEF_RANDOM_FILE "/dev/mem" #endif +#ifdef __SCO__ +#define DEF_PRNGD_SOCKET "/etc/egd-pool" +#else #ifndef DEF_PRNGD_SOCKET #define DEF_PRNGD_SOCKET "/tmp/entropy" #endif +#endif #ifndef DEF_PRNGD_PORT #define DEF_PRNGD_PORT "0" #endif Index: programs/xdm/session.c =================================================================== RCS file: /cvs/xorg/xc/programs/xdm/session.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 session.c --- programs/xdm/session.c 23 Apr 2004 19:54:42 -0000 1.2 +++ programs/xdm/session.c 7 Nov 2005 06:01:17 -0000 @@ -61,6 +61,10 @@ extern int key_setnet(struct key_netstar # include <krb5/krb5.h> #endif +#ifdef __SCO__ +#include <prot.h> +#endif + #ifndef GREET_USER_STATIC # include <dlfcn.h> # ifndef RTLD_NOW @@ -70,7 +74,7 @@ extern int key_setnet(struct key_netstar static int runAndWait (char **args, char **environ); -#if defined(CSRG_BASED) || defined(__osf__) || defined(__DARWIN__) || defined(__QNXNTO__) || defined(sun) || defined(__GLIBC__) +#if defined(CSRG_BASED) || defined(__osf__) || defined(__DARWIN__) || defined(__QNXNTO__) || defined(sun) || defined(__GLIBC__) || defined(__SCO__) # include <sys/types.h> # include <grp.h> #else @@ -88,7 +92,7 @@ extern struct spwd *getspnam(GETSPNAM_AR extern void endspent(void); # endif #endif -#if defined(CSRG_BASED) || defined(__GLIBC__) || defined(USL) +#if defined(CSRG_BASED) || defined(__GLIBC__) || defined(__UNIXWARE__) || defined(__SCO__) # include <pwd.h> # include <unistd.h> #else @@ -534,6 +538,11 @@ StartClient ( pam_handle_t *pamh = thepamh (); int pam_error; #endif +#ifdef USESECUREWARE + char *reason, **smpenv, *smpshell; + int ret; + extern struct smp_user_info *userp; +#endif if (verify->argv) { Debug ("StartSession %s: ", verify->argv[0]); @@ -570,6 +579,35 @@ StartClient ( } #endif +#ifdef USESECUREWARE + Debug ("set_identity: uid=%d\n", userp->pw.pw_uid); + ret = smp_set_identity (userp, &reason, &smpenv, &smpshell); + Debug ("smp_set_identity returns %d luid=%d\n", ret, getluid()); + switch (ret) { + case SMP_FAIL: + LogError ("Unable to set identity\n"); + smp_audit_fail (userp, 0); + return 0; + case SMP_EXTFAIL: + LogError ("Unable to set identity: %s\n", reason); + smp_audit_fail (userp, 0); + return 0; + case SMP_NOTAUTH: + LogError ("Authorization failed\n"); + smp_audit_fail (userp, 0); + return 0; + case SMP_ACCTLOCK: + LogError ("Account is locked\n"); + smp_audit_fail (userp, 0); + return 0; + case SMP_COMPLETE: + break; + default: + LogError ("Unhandled identity error %d\n", ret); + smp_audit_fail (userp, 0); + return 0; + } +#endif #ifndef AIXV3 #ifndef HAS_SETUSERCONTEXT @@ -911,7 +949,7 @@ systemEnv (struct display *d, char *user return env; } -#if (defined(Lynx) && !defined(HAS_CRYPT)) || defined(SCO) && !defined(SCO_USA) && !defined(_SCO_DS) +#if (defined(Lynx) && !defined(HAS_CRYPT)) char *crypt(char *s1, char *s2) { return(s2); Index: programs/xdm/util.c =================================================================== RCS file: /cvs/xorg/xc/programs/xdm/util.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 util.c --- programs/xdm/util.c 23 Apr 2004 19:54:42 -0000 1.2 +++ programs/xdm/util.c 7 Nov 2005 06:01:17 -0000 @@ -245,7 +245,7 @@ CleanUpChild (void) setsid(); #else #if defined(SYSV) || defined(SVR4) || defined(__CYGWIN__) -#if !(defined(SVR4) && defined(i386)) || defined(SCO325) +#if !(defined(SVR4) && defined(i386)) setpgrp (); #endif #else Index: programs/xdm/config/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/xdm/config/Imakefile,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 Imakefile --- programs/xdm/config/Imakefile 20 Jun 2005 02:59:16 -0000 1.4 +++ programs/xdm/config/Imakefile 7 Nov 2005 06:01:17 -0000 @@ -8,7 +8,7 @@ XCOMM $XFree86: xc/programs/xdm/config/I SERVERSTYPE = XdmServersType -all:: Xservers.ws xdm-config Xservers Xresources +all:: Xservers.ws xdm-config Xservers Xresources Xsession #if (defined(i386Architecture) || defined(AMD64Architecture)) && (defined(KNetBSDArchitecture) || defined(KOpenBSDArchitecture)) DEFAULTVT=vt05 @@ -41,9 +41,16 @@ SU = "su -m" SU = su #endif -CppFileTarget(Xservers.ws,Xserv.ws.cpp,-DBINDIR=$(BINDIR) -DDEFAULTVT=$(DEFAULTVT),NullParameter) +#ifdef SCOArchitecture +SHELL_CMD = /bin/ksh +#else +SHELL_CMD = /bin/sh +#endif + +CppFileTarget(Xservers.ws,Xserv.ws.cpp,-DBINDIR=$(BINDIR) -DDEFAULTVT=$(DEFAULTVT) -DSHELL_CMD=$(SHELL_CMD),NullParameter) CppFileTarget(xdm-config,xdm-conf.cpp,-DXDMDIR=$(XDMDIR) -DXDMLOGDIR=$(XDMLOGDIR) -DXDMPIDDIR=$(XDMPIDDIR) -DSU=$(SU) -DCHOOSERPATH=$(CHOOSERPATH),NullParameter) CppFileTarget(Xresources,Xres.cpp,$(XPM_DEFINES),NullParameter) +CppFileTarget(Xsession,Xsession.cpp,-DBINDIR=$(BINDIR) -DDEFAULTVT=$(DEFAULTVT) -DSHELL_CMD=$(SHELL_CMD),NullParameter) LinkFile(Xservers,Xservers.$(SERVERSTYPE)) Index: programs/xdm/config/Xsession =================================================================== RCS file: programs/xdm/config/Xsession diff -N programs/xdm/config/Xsession --- programs/xdm/config/Xsession 23 Apr 2004 19:54:43 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -#!/bin/sh -# -# $Xorg: Xsession,v 1.4 2000/08/17 19:54:17 cpqbld Exp $ -# -# -# -# -# $XFree86: xc/programs/xdm/config/Xsession,v 1.2 1998/01/11 03:48:32 dawes Exp $ - -# redirect errors to a file in user's home directory if we can -for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER" -do - if ( cp /dev/null "$errfile" 2> /dev/null ) - then - chmod 600 "$errfile" - exec > "$errfile" 2>&1 - break - fi -done - -case $# in -1) - case $1 in - failsafe) - exec xterm -geometry 80x24-0-0 - ;; - esac -esac - -# The startup script is not intended to have arguments. - -startup=$HOME/.xsession -resources=$HOME/.Xresources - -if [ -s "$startup" ]; then - if [ -x "$startup" ]; then - exec "$startup" - else - exec /bin/sh "$startup" - fi -else - if [ -r "$resources" ]; then - xrdb -load "$resources" - fi - exec xsm -fi Index: programs/xdm/config/Xsession.cpp =================================================================== RCS file: programs/xdm/config/Xsession.cpp diff -N programs/xdm/config/Xsession.cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/xdm/config/Xsession.cpp 7 Nov 2005 06:01:17 -0000 @@ -0,0 +1,60 @@ +XCOMM!SHELL_CMD +XCOMM +XCOMM $Xorg: Xsession,v 1.4 2000/08/17 19:54:17 cpqbld Exp $ +XCOMM $XFree86: xc/programs/xdm/config/Xsession,v 1.2 1998/01/11 03:48:32 dawes Exp $ + +XCOMM redirect errors to a file in user's home directory if we can +for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER" +do + if ( cp /dev/null "$errfile" 2> /dev/null ) + then + chmod 600 "$errfile" + exec > "$errfile" 2>&1 + break + fi +done + +case $# in +1) + case $1 in + failsafe) + exec BINDIR/xterm -geometry 80x24-0-0 + ;; + esac +esac + +XCOMM The startup script is not intended to have arguments. + +startup=$HOME/.xsession +resources=$HOME/.Xresources + +if [ -s "$startup" ]; then + if [ -x "$startup" ]; then + exec "$startup" + else + exec /bin/sh "$startup" + fi +else + if [ -r "$resources" ]; then + BINDIR/xrdb -load "$resources" + fi +#if defined(__SCO__) || defined(__UNIXWARE__) + [ -r /etc/default/xdesktops ] && { + . /etc/default/xdesktops + } + + [ -r /etc/default/xdm ] && { + . /etc/default/xdm + } + + XCOMM Allow the user to over-ride the system default desktop + [ -r $HOME/.xdmdesktop ] && { + . $HOME/.xdmdesktop + } + + [ -n "$XDESKTOP" ] && { + exec `eval $XDESKTOP` + } +#endif + exec BINDIR/xsm +fi Index: programs/xdm/greeter/verify.c =================================================================== RCS file: /cvs/xorg/xc/programs/xdm/greeter/verify.c,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 verify.c --- programs/xdm/greeter/verify.c 29 Oct 2005 01:48:12 -0000 1.5 +++ programs/xdm/greeter/verify.c 7 Nov 2005 06:01:18 -0000 @@ -53,6 +53,9 @@ from The Open Group. # include <login_cap.h> # include <varargs.h> # include <bsd_auth.h> +#elif defined(USESECUREWARE) +# include <sys/types.h> +# include <prot.h> #endif # include "greet.h" @@ -291,7 +294,98 @@ Verify (struct display *d, struct greet_ break; } } -#else /* !USE_BSDAUTH */ +#elif defined(USESECUREWARE) /* !USE_BSDAUTH */ +/* + * This is a global variable and will be referenced in at least session.c + */ +struct smp_user_info *userp = 0; + +int +Verify (struct display *d, struct greet_info *greet, struct verify_info *verify) +{ + int ret, pwtries = 0, nis, delay; + char *reason = 0; + struct passwd *p; + char *shell, *home, **argv; + + Debug ("Verify %s ...\n", greet->name); + + p = getpwnam (greet->name); + endpwent(); + + if (!p || strlen (greet->name) == 0) { + LogError ("getpwnam() failed.\n"); + bzero(greet->password, strlen(greet->password)); + return 0; + } + + ret = smp_check_user (SMP_LOGIN, greet->name, 0, 0, &userp, &pwtries, + &reason, &nis, &delay); + if (ret != SMP_RETIRED && userp->retired) + ret = userp->result = SMP_RETIRED; + Debug ("smp_check_user returns %d\n", ret); + + switch (ret) { + case SMP_FAIL: + Debug ("Out of memory in smp_check_user\n"); + goto smp_fail; + case SMP_EXTFAIL: + Debug ("SMP_EXTFAIL: %s", reason); + goto smp_fail; + case SMP_NOTAUTH: + Debug ("Not authorized\n"); + goto smp_fail; + case SMP_TERMLOCK: + Debug ("Terminal is locked!\n"); + goto smp_fail; + case SMP_ACCTLOCK: + Debug ("Account is locked\n"); + goto smp_fail; + case SMP_RETIRED: + Debug ("Account is retired\n"); + goto smp_fail; + case SMP_OVERRIDE: + Debug ("On override device ... proceeding\n"); + break; + case SMP_NULLPW: + Debug ("NULL password entry\n"); + if (!greet->allow_null_passwd) { + goto smp_fail; + } + break; + case SMP_BADUSER: + Debug ("User not found in protected password database\n"); + goto smp_fail; + case SMP_PWREQ: + Debug ("Password change required\n"); + goto smp_fail; + case SMP_HASPW: + break; + default: + Debug ("Unhandled smp_check_user return %d\n", ret); +smp_fail: + sleep(delay); + smp_audit_fail (userp, 0); + bzero(greet->password, strlen(greet->password)); + return 0; + break; + } + + if (ret != SMP_NULLPW) { + /* + * If we require a password, check it. + */ + ret = smp_check_pw (greet->password, userp, &reason); + switch (ret) { + case SMP_CANCHANGE: + case SMP_CANTCHANGE: + case SMP_OVERRIDE: + break; + default: + goto smp_fail; + } + } +#else /* !USE_BSDAUTH && !USESECUREWARE */ int Verify (struct display *d, struct greet_info *greet, struct verify_info *verify) { Index: programs/xedit/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/xedit/Imakefile,v retrieving revision 1.7 diff -u -3 -p -u -r1.7 Imakefile --- programs/xedit/Imakefile 11 Apr 2005 01:06:15 -0000 1.7 +++ programs/xedit/Imakefile 7 Nov 2005 06:01:18 -0000 @@ -41,9 +41,12 @@ LOCAL_LIBRARIES = $(LISPLIBS) $(PRINT_LI STRCCMP_OBJS = strcasecmp.o STRCCMP_DEFINES = -DNEED_STRCASECMP #endif +#if defined(SCOArchitecture) + XTRA_SYS_FLAGS = SCOBuildFlags +#endif SYS_SRCS = $(RP_SRCS) $(STRCCMP_SRCS) SYS_OBJS = $(RP_OBJS) $(STRCCMP_OBJS) - SYS_DEFINES = $(RP_DEFINES) $(STRCCMP_DEFINES) + SYS_DEFINES = $(RP_DEFINES) $(STRCCMP_DEFINES) $(XTRA_SYS_FLAGS) DEFINES = $(PRINT_DEFS) $(SIGNAL_DEFINES) $(SYS_DEFINES) -DXEDIT INCLUDES = -I. -Ilisp/re $(MISC_INCLUDES) Index: programs/xfs/os/osdep.h =================================================================== RCS file: /cvs/xorg/xc/programs/xfs/os/osdep.h,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 osdep.h --- programs/xfs/os/osdep.h 23 Apr 2004 19:54:48 -0000 1.2 +++ programs/xfs/os/osdep.h 7 Nov 2005 06:01:18 -0000 @@ -74,17 +74,16 @@ in this Software without prior written a #define OPEN_MAX 256 #else #ifdef SVR4 -#ifdef SCO324 -#define OPEN_MAX sysconf(_SC_OPEN_MAX) -#else #define OPEN_MAX 128 -#endif #else #include <sys/param.h> #ifdef __GNU__ #define OPEN_MAX (sysconf(_SC_OPEN_MAX)) #endif /*__GNU__*/ #ifndef OPEN_MAX +#ifdef SCO325 +#define OPEN_MAX (sysconf(_SC_OPEN_MAX)) +#else #if defined(NOFILE) && !defined(NOFILES_MAX) #define OPEN_MAX NOFILE #else @@ -94,8 +93,9 @@ in this Software without prior written a #endif #endif #endif +#endif -#ifdef __GNU__ +#if defined(__GNU__) || defined(SCO325) #define MAXSOCKS 128 #else /*__GNU__*/ #if OPEN_MAX <= 128 /* 128 is value of MAXCLIENTS */ Index: programs/xinit/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/xinit/Imakefile,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 Imakefile --- programs/xinit/Imakefile 23 Apr 2004 19:54:49 -0000 1.2 +++ programs/xinit/Imakefile 7 Nov 2005 06:01:18 -0000 @@ -31,16 +31,27 @@ LOCAL_LIBRARIES = $(XONLYLIB) #if HasCookieMaker COOKIEDEFS = -DHAS_COOKIE_MAKER -DMK_COOKIE=MkCookieCmd #endif +#if defined(SCOArchitecture) || defined(USLArchitecture) + SHELL_CMD = /bin/ksh +#else + SHELL_CMD = /bin/sh +#endif all:: startx $(SAMPLECONFIG) ComplexProgramTarget_1(xinit,$(LOCAL_LIBRARIES),$(DEFFILE)) -MakeScriptFromCpp(xinitrc, -DXINITDIR=$(XINITDIR)) +MakeScriptFromCpp(xinitrc, -DXINITDIR=$(XINITDIR) -DBINDIR=$(BINDIR) -DSHELL_CMD=$(SHELL_CMD) -DLIBDIR=$(LIBDIR)) + +MakeScriptFromCpp(startx, -DXINITDIR=$(XINITDIR) -DBINDIR=$(BINDIR) $(COOKIEDEFS) -DSHELL_CMD=$(SHELL_CMD) -DLIBDIR=$(LIBDIR)) -MakeScriptFromCpp(startx, -DXINITDIR=$(XINITDIR) -DBINDIR=$(BINDIR) $(COOKIEDEFS)) +#if defined(SCOArchitecture) || defined(USLArchitecture) +ARCHMANDEFS=-D__SCOMAN__ +#else +ARCHMANDEFS= +#endif -EXTRAMANDEFS=-D__xinitdir__=$(XINITDIR) -D__XCONFIGFILE__=XConfigFile -D__XSERVERNAME__=XServerName +EXTRAMANDEFS=-D__xinitdir__=$(XINITDIR) -D__XCONFIGFILE__=XConfigFile -D__XSERVERNAME__=XServerName -D__libdir__=$(LIBDIR) $(ARCHMANDEFS) InstallNamedProg(startx,startx,$(BINDIR)) #ifdef OS2Architecture Index: programs/xinit/startx.cpp =================================================================== RCS file: /cvs/xorg/xc/programs/xinit/startx.cpp,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 startx.cpp --- programs/xinit/startx.cpp 25 Jul 2005 23:19:06 -0000 1.5 +++ programs/xinit/startx.cpp 7 Nov 2005 06:01:18 -0000 @@ -1,4 +1,4 @@ -XCOMM!/bin/sh +XCOMM!SHELL_CMD XCOMM $Xorg: startx.cpp,v 1.3 2000/08/17 19:54:29 cpqbld Exp $ XCOMM @@ -13,28 +13,36 @@ XCOMM Site administrators are STRONGLY u XCOMM XCOMM $XFree86: xc/programs/xinit/startx.cpp,v 3.16tsi Exp $ -#ifdef SCO +#if defined(__SCO__) || defined(__UNIXWARE__) XCOMM Check for /usr/bin/X11 and BINDIR in the path, if not add them. XCOMM This allows startx to be placed in a place like /usr/bin or /usr/local/bin -XCOMM and people may use X without changing their PATH +XCOMM and people may use X without changing their PATH. +XCOMM Note that we put our own bin directory at the front of the path, and +XCOMM the standard SCO path at the back, since if you are using the Xorg +XCOMM server theres a pretty good chance you want to bias the Xorg clients +XCOMM over the old SCO X11R5 clients. XCOMM First our compiled path bindir=BINDIR -if expr $PATH : ".*`echo $bindir | sed 's?/?\\/?g'`.*" > /dev/null 2>&1; then - : -else - PATH=$PATH:BINDIR -fi +scobindir=/usr/bin/X11 + +case $PATH in + *:$bindir | *:$bindir:* | $bindir:*) ;; + *) PATH=$bindir:$PATH ;; +esac XCOMM Now the "SCO" compiled path -if expr $PATH : '.*\/usr\/bin\/X11.*' > /dev/null 2>&1; then - : -else - PATH=$PATH:/usr/bin/X11 -fi +case $PATH in + *:$scobindir | *:$scobindir:* | $scobindir:*) ;; + *) PATH=$PATH:$scobindir ;; +esac + +XCOMM Bourne shell doesn't automatically export modified environment variables +XCOMM so export the new PATH just in case the user changes the shell +export PATH XCOMM Set up the XMERGE env var so that dos merge is happy under X @@ -45,12 +53,16 @@ elif [ -f /usr/lib/merge/console.disp ]; export XMERGE fi -scoclientrc=$HOME/.startxrc +userclientrc=$HOME/.startxrc +sysclientrc=LIBDIR/sys.startxrc +scouserclientrc=$HOME/.xinitrc +scosysclientrc=XINITDIR/xinitrc +#else +userclientrc=$HOME/.xinitrc +sysclientrc=XINITDIR/xinitrc #endif -userclientrc=$HOME/.xinitrc userserverrc=$HOME/.xserverrc -sysclientrc=XINITDIR/xinitrc sysserverrc=XINITDIR/xserverrc defaultclient=BINDIR/xterm defaultserver=BINDIR/X @@ -59,18 +71,31 @@ defaultserverargs="" clientargs="" serverargs="" -#ifdef SCO -if [ -f $scoclientrc ]; then - defaultclientargs=$scoclientrc -else -#endif if [ -f $userclientrc ]; then defaultclientargs=$userclientrc elif [ -f $sysclientrc ]; then defaultclientargs=$sysclientrc +#if defined(__SCO__) || defined(__UNIXWARE__) +elif [ -f $scouserclientrc ]; then + defaultclientargs=$scouserclientrc +elif [ -f $scosysclientrc ]; then + defaultclientargs=$scosysclientrc +#endif fi -#ifdef SCO -fi + +#if defined(__SCO__) || defined(__UNIXWARE__) + +XCOMM SCO -t option: do not start an X server +case $1 in + -t) if [ -n "$DISPLAY" ]; then + REMOTE_SERVER=TRUE + shift + else + echo "DISPLAY environment variable not set" + exit 1 + fi + ;; +esac #endif if [ -f $userserverrc ]; then @@ -175,16 +200,16 @@ XCOMM now add the same credentials to th XCOMM if '$displayname' already exists don't overwrite it as another XCOMM server man need it. Add them to the '$xserverauthfile' instead. for displayname in $authdisplay $hostname$authdisplay; do - authcookie=`xauth list "$displayname" @@ + authcookie=`BINDIR/xauth list "$displayname" @@ | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; if [ "z${authcookie}" = "z" ] ; then - xauth -q << EOF + BINDIR/xauth -q << EOF add $displayname . $mcookie EOF removelist="$displayname $removelist" else dummy=$((dummy+1)); - xauth -q -f $xserverauthfile << EOF + BINDIR/xauth -q -f $xserverauthfile << EOF add :$dummy . $authcookie EOF fi @@ -192,10 +217,18 @@ done #endif -xinit $client $clientargs -- $server $display $serverargs +#if defined(__SCO__) || defined(__UNIXWARE__) +if [ "$REMOTE_SERVER" = "TRUE" ]; then + exec SHELL_CMD ${client} +else + BINDIR/xinit $client $clientargs -- $server $display $serverargs +fi +#else +BINDIR/xinit $client $clientargs -- $server $display $serverargs +#endif if [ x"$removelist" != x ]; then - xauth remove $removelist + BINDIR/xauth remove $removelist fi if [ x"$xserverauthfile" != x ]; then rm -f $xserverauthfile Index: programs/xinit/startx.man =================================================================== RCS file: /cvs/xorg/xc/programs/xinit/startx.man,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 startx.man --- programs/xinit/startx.man 23 Apr 2004 19:54:49 -0000 1.2 +++ programs/xinit/startx.man 7 Nov 2005 06:01:18 -0000 @@ -72,6 +72,23 @@ startx -- -dpi 100 .PP startx -- -layout Multihead .RE +#ifdef __SCOMAN__ +.PP +To determine the client to run, +.I startx +looks for the following files, in order: +.RS +.PP +.I $(HOME)/.startxrc +.PP +.I __libdir__/sys.startxrc +.PP +.I $(HOME)/.xinitrc +.PP +.I __xinitdir__/xinitrc +.RE +.PP +#else .PP To determine the client to run, .I startx @@ -83,6 +100,7 @@ the file in the .I xinit library directory. +#endif If command line client options are given, they override this behavior and revert to the .IR xinit (1) @@ -166,6 +184,17 @@ and .IR Xsecurity (__miscmansuffix__) manual pages for more information on X client/server authentication. .SH FILES +#ifdef __SCOMAN__ +.TP 25 +.I $(HOME)/.startxrc +Client to run. Typically a shell script which runs many programs in +the background. +.TP 25 +.I __libdir__/sys.startxrc +Client to use if the user has no +.I .startxrc +file. +#endif .TP 25 .I $(HOME)/.xinitrc Client to run. Typically a shell script which runs many programs in Index: programs/xinit/xinitrc.cpp =================================================================== RCS file: /cvs/xorg/xc/programs/xinit/xinitrc.cpp,v retrieving revision 1.1.1.1 diff -u -3 -p -u -r1.1.1.1 xinitrc.cpp --- programs/xinit/xinitrc.cpp 14 Nov 2003 16:49:22 -0000 1.1.1.1 +++ programs/xinit/xinitrc.cpp 7 Nov 2005 06:01:18 -0000 @@ -1,4 +1,4 @@ -XCOMM!/bin/sh +XCOMM!SHELL_CMD XCOMM $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $ userresources=$HOME/.Xresources @@ -9,25 +9,67 @@ sysmodmap=XINITDIR/.Xmodmap XCOMM merge in defaults and keymaps if [ -f $sysresources ]; then - xrdb -merge $sysresources + BINDIR/xrdb -merge $sysresources fi if [ -f $sysmodmap ]; then - xmodmap $sysmodmap + BINDIR/xmodmap $sysmodmap fi if [ -f $userresources ]; then - xrdb -merge $userresources + BINDIR/xrdb -merge $userresources fi if [ -f $usermodmap ]; then - xmodmap $usermodmap + BINDIR/xmodmap $usermodmap fi XCOMM start some nice programs -twm & -xclock -geometry 50x50-1+1 & -xterm -geometry 80x50+494+51 & -xterm -geometry 80x20+494-0 & -exec xterm -geometry 80x66+0+0 -name login +#if defined(__SCO__) || defined(__UNIXWARE__) +if [ -r /etc/default/xdesktops ]; then + . /etc/default/xdesktops +fi + +if [ -r $HOME/.x11rc ]; then + . $HOME/.x11rc +else + if [ -r /etc/default/X11 ]; then + . /etc/default/X11 + fi +fi + +#if defined(__SCO__) +if [ -n "$XSESSION" ]; then + case "$XSESSION" in + [Yy][Ee][Ss]) + [ -x /usr/bin/X11/scosession ] && exec /usr/bin/X11/scosession + ;; + esac +fi + +if [ -n "$XDESKTOP" ]; then + exec `eval echo $"$XDESKTOP"` +else + if [ -x /usr/bin/X11/pmwm -a -x /usr/bin/X11/scoterm ]; then + /usr/bin/X11/scoterm 2> /dev/null & + exec /usr/bin/X11/pmwm 2> /dev/null + fi +fi +#elif defined(__UNIXWARE__) +if [ -n "$XDESKTOP" ]; then + exec `eval echo $"$XDESKTOP"` +else + if [ -x /usr/X/bin/pmwm ]; then + exec /usr/X/bin/pmwm 2> /dev/null + fi +fi +#endif + +XCOMM This is the fallback case if nothing else is executed above +#endif /* !defined(__SCO__) && !defined(__UNIXWARE__) */ +BINDIR/twm & +BINDIR/xclock -geometry 50x50-1+1 & +BINDIR/xterm -geometry 80x50+494+51 & +BINDIR/xterm -geometry 80x20+494-0 & +exec BINDIR/xterm -geometry 80x66+0+0 -name login Index: programs/xman/man.c =================================================================== RCS file: /cvs/xorg/xc/programs/xman/man.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 man.c --- programs/xman/man.c 22 May 2004 19:20:06 -0000 1.3 +++ programs/xman/man.c 7 Nov 2005 06:01:18 -0000 @@ -437,7 +437,7 @@ ReadCurrentSection(Manual * local_manual */ if ( (ptr = rindex(path, '.')) != NULL) { -#if !defined(SCO) && !defined(ISC) +#if !defined(__SCO__) && !defined(ISC) if (streq(ptr + 1, COMPRESSION_EXTENSION)) #else if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL) @@ -475,7 +475,7 @@ ReadCurrentSection(Manual * local_manual */ if ( (ptr = rindex(full_name, '.')) != NULL) { -#if !defined(SCO) && !defined(ISC) +#if !defined(__SCO__) && !defined(ISC) if (streq(ptr + 1, COMPRESSION_EXTENSION)) #else if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL) Index: programs/xman/misc.c =================================================================== RCS file: /cvs/xorg/xc/programs/xman/misc.c,v retrieving revision 1.7 diff -u -3 -p -u -r1.7 misc.c --- programs/xman/misc.c 16 Jul 2005 22:07:13 -0000 1.7 +++ programs/xman/misc.c 7 Nov 2005 06:01:18 -0000 @@ -66,7 +66,7 @@ static Boolean UncompressUnformatted(Man static Boolean ConstructCommand(char * cmdbuf, char * path, char * filename, char * tempfile); #endif -#if defined(ISC) || defined(SCO) +#if defined(ISC) || defined(__SCO__) || defined(__UNIXWARE__) static char *uncompress_format = NULL; static char *uncompress_formats[] = { UNCOMPRESS_FORMAT_1, @@ -197,7 +197,7 @@ FindManualFile(ManpageGlobals * man_glob char filename[BUFSIZ]; char * entry = manual[section_num].entries[entry_num]; int len_cat = strlen(CAT); -#if defined(ISC) || defined(SCO) +#if defined(ISC) || defined(__SCO__) || defined(__UNIXWARE__) int i; #endif @@ -228,7 +228,7 @@ FindManualFile(ManpageGlobals * man_glob * Then for compressed files in an uncompressed directory. */ -#if !defined(ISC) && !defined(SCO) +#if !defined(ISC) && !defined(__UNIXWARE__) #if defined(__OpenBSD__) || defined(__NetBSD__) /* look in machine subdir first */ snprintf(filename, sizeof(filename), "%s/%s%s/%s/%s.%s", path, CAT, Index: programs/xman/vendor.c =================================================================== RCS file: /cvs/xorg/xc/programs/xman/vendor.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 vendor.c --- programs/xman/vendor.c 23 Apr 2004 19:54:58 -0000 1.2 +++ programs/xman/vendor.c 7 Nov 2005 06:01:18 -0000 @@ -55,7 +55,7 @@ static SectionNameRec SectionNames[] = { {"(l) Local", "l"}, {"(n) New", "n"}, {"(o) Old", "o"} -#ifdef SCO +#ifdef __SCO__ , { "(ADM) System Administration", "ADM" }, { "(ADMN) Network Administration", "ADMN" }, Index: programs/xman/vendor.h =================================================================== RCS file: /cvs/xorg/xc/programs/xman/vendor.h,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 vendor.h --- programs/xman/vendor.h 28 Jul 2005 23:16:55 -0000 1.6 +++ programs/xman/vendor.h 7 Nov 2005 06:01:18 -0000 @@ -83,7 +83,7 @@ from the X Consortium. # define SYSMANPATH "/usr/share/man" #elif defined(hcx) # define SYSMANPATH "/usr/catman/local_man:/usr/catman/u_man:/usr/catman/a_man:/usr/catman/p_man:/usr/catman/ada_man" -#elif defined(SYSV) && defined(i386) && !defined(SCO) +#elif defined(SYSV) && defined(i386) && !defined(__SCO__) # define SYSMANPATH "/usr/catman/u_man:/usr/catman/p_man" #elif defined(sgi) # define SYSMANPATH "/usr/catman/a_man:/usr/catman/g_man:/usr/catman/p_man:/usr/catman/u_man:/usr/man/p_man:/usr/man/u_man:/usr/man" @@ -100,8 +100,8 @@ from the X Consortium. */ #if defined( macII ) || defined( hcx ) || \ - (defined(SYSV) && defined(i386) && !defined(ISC) && !defined(SCO)) || \ - defined(sgi) + (defined(SYSV) && defined(i386) && !defined(ISC) && \ + !defined(__UNIXWARE__) && !defined(__SCO__)) || defined(sgi) # define COMPRESSION_EXTENSION "z" # define UNCOMPRESS_FORMAT "pcat %s > %s" # define NO_COMPRESS /* mac can't handle using pack as a filter and @@ -110,9 +110,9 @@ from the X Consortium. # define COMPRESSION_EXTENSION "C" # define UNCOMPRESS_FORMAT "ccat < %s > %s" # define COMPRESS "compact" -#elif defined (ISC) || defined(SCO) +#elif defined (ISC) || defined(__SCO__) || defined(__UNIXWARE__) # define COMPRESSION_EXTENSION "Z" /* dummy */ -# ifndef SCO +# if !defined(__SCO__) && !defined(__UNIXWARE__) # define COMPRESSION_EXTENSIONS "zZF" /* pack, compress, freeze */ # else # define COMPRESSION_EXTENSIONS "zZ" /* pack, compress */ Index: programs/xmh/command.c =================================================================== RCS file: /cvs/xorg/xc/programs/xmh/command.c,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 command.c --- programs/xmh/command.c 23 Apr 2004 19:54:58 -0000 1.2 +++ programs/xmh/command.c 7 Nov 2005 06:01:18 -0000 @@ -35,7 +35,7 @@ #ifndef SYSV #include <sys/wait.h> #endif /* SYSV */ -#if defined(SVR4) && !defined(SCO325) && !defined(DGUX) +#if defined(SVR4) && !defined(DGUX) #include <sys/filio.h> #endif Index: programs/xterm/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/Imakefile,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 Imakefile --- programs/xterm/Imakefile 1 Oct 2005 16:38:35 -0000 1.6 +++ programs/xterm/Imakefile 7 Nov 2005 06:01:19 -0000 @@ -156,7 +156,7 @@ module.o: ; $(CC) -c defines $(CFLAGS) m #ifndef TermcapLibrary #if SystemV && !defined(MacIIArchitecture) -#if defined(CrayArchitecture) || (defined(HPArchitecture) && (OSMajorVersion < 10)) || defined(RsArchitecture) +#if defined(CrayArchitecture) || (defined(HPArchitecture) && (OSMajorVersion < 10)) || defined(RsArchitecture) || defined(SCOArchitecture) || defined(USLArchitecture) #define TermcapLibrary -lcurses /* special cases of System V */ #else #define TermcapLibrary -ltermlib /* usually in here */ @@ -223,7 +223,6 @@ InstallNamedProg(uxterm,uxterm,$(BINDIR) * Link with the termcap library if USE_TERMCAP is defined in resize.c */ #if defined(NTOArchitecture) || \ - defined(SCOArchitecture) || \ defined(LinuxArchitecture) || \ defined(OpenBSDArchitecture) || \ defined(SGIArchitecture) || \ Index: programs/xterm/main.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/main.c,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 main.c --- programs/xterm/main.c 5 Aug 2005 16:13:04 -0000 1.6 +++ programs/xterm/main.c 7 Nov 2005 06:01:19 -0000 @@ -1719,9 +1719,11 @@ main(int argc, char *argv[]ENVP_ARG) #ifdef ECHOKE d_tio.c_lflag |= ECHOKE | IEXTEN; #endif +#ifndef __UNIXWARE__ #ifdef ECHOCTL d_tio.c_lflag |= ECHOCTL | IEXTEN; #endif +#endif #ifndef USE_POSIX_TERMIOS #ifdef NTTYDISC d_tio.c_line = NTTYDISC; @@ -3452,9 +3454,11 @@ spawn(void) #ifdef ECHOKE tio.c_lflag |= ECHOKE | IEXTEN; #endif +#ifndef __UNIXWARE__ #ifdef ECHOCTL tio.c_lflag |= ECHOCTL | IEXTEN; #endif +#endif #ifndef __MVS__ /* reset EOL to default value */ tio.c_cc[VEOL] = CEOL; /* '^@' */