3 Patches:

- remove manual lcrypt flags, since we detect them in autotools, also removed 
manually linking libc in some solaris defines, as doing so violates posix and 
even then autotools can handle this directly without us.
-  Clean up some defines in DtTerm, these were mostly duplicates of OS defines 
specified by us
- The big one, generifying the source code. I made any defines that specified 
Linux, all three BSDs and Solaris to be default code, this allows for some 
currently unsupported OSes like minix and gnu hurd to actually start the 
building process without running into errors about the OS not being recognized 
(I'm pretty sure they'll error out elsewhere but it won't be because we didn't 
have a default configuration).

Thank you for your time,
-Chase

Sent with [Proton Mail](https://proton.me/) secure email.
From f3d5df0cf41e3b50d0b03c518683dbb0ce2b5884 Mon Sep 17 00:00:00 2001
From: Chase <nicetry...@protonmail.ch>
Date: Wed, 3 Aug 2022 18:07:57 -0500
Subject: [PATCH 1/3] Remove detected -lcrypt flag

---
 cde/lib/DtHelp/Makefile.am        |  2 +-
 cde/lib/DtSearch/Makefile.am      |  6 ------
 cde/lib/DtWidget/Makefile.am      |  2 +-
 cde/lib/tt/lib/Makefile.am        |  2 +-
 cde/programs/dtaction/Makefile.am | 12 ------------
 5 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/cde/lib/DtHelp/Makefile.am b/cde/lib/DtHelp/Makefile.am
index a3b59681b..04730f098 100644
--- a/cde/lib/DtHelp/Makefile.am
+++ b/cde/lib/DtHelp/Makefile.am
@@ -16,7 +16,7 @@ libDtHelp_la_CFLAGS = -I./il -I./jpeg -I../DtSvc/DtUtil2 -DDTLIB \
 libDtHelp_la_LIBADD = $(JPEGLIB) il/libil.la $(LTLIBICONV)
 
 if SOLARIS
-libDtHelp_la_LIBADD += -lw -lgen -lc
+libDtHelp_la_LIBADD += -lw -lgen
 endif
 
 
diff --git a/cde/lib/DtSearch/Makefile.am b/cde/lib/DtSearch/Makefile.am
index 5c359728f..fdd8f7585 100644
--- a/cde/lib/DtSearch/Makefile.am
+++ b/cde/lib/DtSearch/Makefile.am
@@ -21,10 +21,6 @@ endif
 
 libDtSearch_la_LIBADD = raima/libraima.la
 
-if SOLARIS
-libDtSearch_la_LIBADD += -lc
-endif
-
 libDtSearch_la_SOURCES = apndext.c	ausdopen.c	ausexit.c \
 			 bmstrstr.c	boolpars.c	boolsrch.c \
 			 boolyac.y	cuslang.c	dbchange.c \
@@ -39,5 +35,3 @@ libDtSearch_la_SOURCES = apndext.c	ausdopen.c	ausexit.c \
 			 ocf.c		opendblk.c	ophuf.c \
 			 readchar.c	strupr.c	userint.c \
 			 vedelete.c	vestatis.c	vstfunct.c
-
-
diff --git a/cde/lib/DtWidget/Makefile.am b/cde/lib/DtWidget/Makefile.am
index 182717e2e..ca9eda4b9 100644
--- a/cde/lib/DtWidget/Makefile.am
+++ b/cde/lib/DtWidget/Makefile.am
@@ -17,7 +17,7 @@ endif
 
 if SOLARIS
 libDtWidget_la_CFLAGS += -DNO_REGCOMP
-libDtWidget_la_LIBADD = -lc -lw -lintl
+libDtWidget_la_LIBADD = -lw -lintl
 endif
 
 
diff --git a/cde/lib/tt/lib/Makefile.am b/cde/lib/tt/lib/Makefile.am
index b9e17b595..6fa386ad6 100644
--- a/cde/lib/tt/lib/Makefile.am
+++ b/cde/lib/tt/lib/Makefile.am
@@ -18,7 +18,7 @@ libtt_la_LIBADD = api/c/libapi.la api/dnd/libdnd.la db/libdb.la mp/libmp.la \
 
 if SOLARIS
 # This stuff should be figured out by configure
-libtt_la_LIBADD += -lnsl -lsocket -lintl -lc -lw
+libtt_la_LIBADD += -lnsl -lsocket -lintl -lw
 endif
 
 if LINUX
diff --git a/cde/programs/dtaction/Makefile.am b/cde/programs/dtaction/Makefile.am
index 6dde85bec..245d887ce 100644
--- a/cde/programs/dtaction/Makefile.am
+++ b/cde/programs/dtaction/Makefile.am
@@ -5,15 +5,3 @@ bin_PROGRAMS = dtaction
 dtaction_SOURCES = Main.c
 
 dtaction_LDADD = $(DTCLIENTLIBS) $(XTOOLLIB)
-
-if LINUX
-dtaction_LDADD += -lcrypt
-endif
-
-if FREEBSD
-dtaction_LDADD += -lcrypt
-endif
-
-if NETBSD
-dtaction_LDADD += -lcrypt
-endif
-- 
2.34.1

From e0df1d4a9298e60548917de616cf6041e7f8c46b Mon Sep 17 00:00:00 2001
From: Chase <nicetry...@protonmail.ch>
Date: Wed, 3 Aug 2022 18:41:37 -0500
Subject: [PATCH 2/3] lib/DtTerm/TermPrim: clean up defines

---
 cde/lib/DtTerm/TermPrim/Makefile.am       | 20 +-------------------
 cde/lib/DtTerm/TermPrim/TermPrimOSDepI.h  |  8 ++++----
 cde/lib/DtTerm/TermPrim/TermPrimSetPty.c  |  6 +++---
 cde/lib/DtTerm/TermPrim/TermPrimSubproc.c | 16 ++++++----------
 4 files changed, 14 insertions(+), 36 deletions(-)

diff --git a/cde/lib/DtTerm/TermPrim/Makefile.am b/cde/lib/DtTerm/TermPrim/Makefile.am
index 6ecc554f4..6c404dd7a 100644
--- a/cde/lib/DtTerm/TermPrim/Makefile.am
+++ b/cde/lib/DtTerm/TermPrim/Makefile.am
@@ -35,24 +35,6 @@ libTermPrim_la_SOURCES = TermPrim.c \
 
 if SOLARIS
 libTermPrim_la_SOURCES += TermPrimGetPty-svr4.c
-AM_CPPFLAGS += -DSUN_ARCHITECTURE
-endif
-
-# Use the posix pts api, like linux
-if BSD
-libTermPrim_la_SOURCES += TermPrimGetPty-pts.c
-# uses CSRG_BASED global define
-endif
-
-if FREEBSD
-AM_CPPFLAGS += -DFREEBSD_ARCHITECTURE
-endif
-
-if OPENBSD
-AM_CPPFLAGS += -DOPENBSD_ARCHITECTURE
-endif
-
-if LINUX
+else
 libTermPrim_la_SOURCES += TermPrimGetPty-pts.c
-AM_CPPFLAGS += -DLINUX_ARCHITECTURE
 endif
diff --git a/cde/lib/DtTerm/TermPrim/TermPrimOSDepI.h b/cde/lib/DtTerm/TermPrim/TermPrimOSDepI.h
index d79c22f69..a9a74df21 100644
--- a/cde/lib/DtTerm/TermPrim/TermPrimOSDepI.h
+++ b/cde/lib/DtTerm/TermPrim/TermPrimOSDepI.h
@@ -63,12 +63,12 @@
 #ifndef	_Dt_TermPrimOSDepI_h
 #define	_Dt_TermPrimOSDepI_h
 
-#ifdef  LINUX_ARCHITECTURE
+#ifdef  __linux__
 # define USE_TIOCCONS            /* use tioccons for -C          */
 # define HAS_SETEUID             /* seteuid available            */
 # define HAS_SETREUID            /* setreuid available           */
 # define USE_TCSENDBREAK	/* use tiocbreak()		*/
-#endif /* LINUX_ARCHITECTURE */
+#endif /* LINUX */
 
 #ifdef  CSRG_BASED
 # define HAS_SETEUID             /* seteuid available            */
@@ -76,7 +76,7 @@
 # define USE_TCSENDBREAK	/* use tiocbreak()		*/
 #endif /* CSRG_BASED */
 
-#ifdef	SUN_ARCHITECTURE
+#ifdef	sun
 # define XOR_CAPS_LOCK		/* xor caps lock and shift	*/
 # define USE_SRIOCSREDIR	/* use SRIOCSREDIR ioctl for -C	*/
 # define USE_STREAMS		/* use streams			*/
@@ -87,7 +87,7 @@
 #  define USE_SUN_WCWIDTH_PATCH
 #  define wcwidth(w)  sun_wcwidth(w)
 # endif /* (_XOPEN_VERSION == 3) */
-#endif /* SUN_ARCHITECTURE */
+#endif /* SUN */
 
 #ifdef	IBM_ARCHITECTURE
 /* this seems to be #define'ed in the world of imake... */
diff --git a/cde/lib/DtTerm/TermPrim/TermPrimSetPty.c b/cde/lib/DtTerm/TermPrim/TermPrimSetPty.c
index 97b502046..c2b76acfb 100644
--- a/cde/lib/DtTerm/TermPrim/TermPrimSetPty.c
+++ b/cde/lib/DtTerm/TermPrim/TermPrimSetPty.c
@@ -55,9 +55,9 @@
 #include <sys/stat.h>
 #endif	/* USE_TIOCCONS */
 
-#if defined(LINUX_ARCHITECTURE) || defined(CSRG_BASED)
+#if defined(__linux__) || defined(CSRG_BASED)
 #include <sys/ioctl.h>
-#endif /* LINUX_ARCHITECTURE */
+#endif /* LINUX */
 
 #ifdef	USE_STREAMS
 #include <sys/types.h>
@@ -569,7 +569,7 @@ _DtTermPrimPtyInit
             TMODE (XTTYMODE_weras, tio.c_cc[VWERSE]);
             TMODE (XTTYMODE_lnext, tio.c_cc[VLNEXT]);
 
-#elif	defined(SUN_ARCHITECTURE)
+#elif	defined(sun)
             TMODE (XTTYMODE_swtch, tio.c_cc[VSWTCH]);
             TMODE (XTTYMODE_start, tio.c_cc[VSTART]);
             TMODE (XTTYMODE_stop,  tio.c_cc[VSTOP]);
diff --git a/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c b/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c
index a0c1df334..2e14d94f3 100644
--- a/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c
+++ b/cde/lib/DtTerm/TermPrim/TermPrimSubproc.c
@@ -32,7 +32,7 @@
 
 #include "TermHeader.h"
 #include <fcntl.h>
-#if defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
+#if defined(CSRG_BASED) || defined(__linux__)
 /* For TIOCSTTY definitions */
 #include <sys/ioctl.h>
 #endif /* BSD || Linux */
@@ -47,11 +47,7 @@
 #include <X11/Xos_r.h>
 
 #include <Xm/Xm.h>
-#if defined(HPVUE)
-#include <Xv/EnvControl.h>
-#else    /* HPVUE */
 #include <Dt/EnvControlP.h>
-#endif   /* HPVUE */
 
 #include "TermPrimP.h"
 #include "TermPrimI.h"
@@ -451,7 +447,7 @@ _DtTermPrimSubprocExec(Widget		  w,
 	/* child...
 	 */
         _DtTermProcessUnlock();
-#if defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
+#if defined(CSRG_BASED) || defined(__linux__)
         /* establish a new session for child */
         setsid();
 #else
@@ -459,7 +455,7 @@ _DtTermPrimSubprocExec(Widget		  w,
 	(void) setpgrp();
 #endif /* Linux || BSD */
 
-#if defined(LINUX_ARCHITECTURE)
+#if defined(__linux__)
 	/* set the ownership and mode of the pty... */
 	(void) _DtTermPrimSetupPty(ptyName, pty);
 #endif
@@ -472,7 +468,7 @@ _DtTermPrimSubprocExec(Widget		  w,
 	    (void) _exit(1);
 	}
 
-#if defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
+#if defined(CSRG_BASED) || defined(__linux__)
         /* BSD needs to do this to acquire pty as controlling terminal */
         if (ioctl(pty, TIOCSCTTY, (char *)NULL) < 0) {
 	    (void) close(pty);
@@ -485,10 +481,10 @@ _DtTermPrimSubprocExec(Widget		  w,
         _DtTermPrimPtyGetDefaultModes();
 #endif /* Linux || BSD */
 
-#if !defined(LINUX_ARCHITECTURE)
+#if !defined(__linux__)
 	/* set the ownership and mode of the pty... */
 	(void) _DtTermPrimSetupPty(ptyName, pty);
-#endif /* LINUX_ARCHITECTURE */
+#endif /* LINUX */
 
 	/* apply the ttyModes... */
 	_DtTermPrimPtyInit(pty, tw->term.ttyModes, tw->term.csWidth);
-- 
2.34.1

From 39e5428e102a1525eb2e63eb08a4430945c7a155 Mon Sep 17 00:00:00 2001
From: Chase <nicetry...@protonmail.ch>
Date: Wed, 3 Aug 2022 23:15:45 -0500
Subject: [PATCH 3/3] Generify source code

Previously we would fail in some parts of the code if we did not have a
premade configuration, now we use any code that was marked as Linux, BSD and
Solaris as our basis in order to support building unknown Unix systems.
---
 cde/.gitignore                                | 123 +-------
 cde/include/Dt/vista.h                        |   2 -
 cde/include/EUSCompat.h                       |   4 +-
 cde/lib/DtMmdb/StyleSheet/DocParser.C         |   8 -
 cde/lib/DtMmdb/StyleSheet/Expression.C        |  12 -
 cde/lib/DtMmdb/btree_berkeley/compat.h        |   8 -
 cde/lib/DtMmdb/dti_excs/Destructable_il.hh    |   6 -
 cde/lib/DtMmdb/utility/filebuf.C              |   4 -
 cde/lib/DtMmdb/utility/funcs.h                |   7 -
 cde/lib/DtMmdb/utility/streambuf.C            |   5 -
 cde/lib/DtSearch/raima/Makefile.am            |  12 +-
 cde/lib/DtSvc/include/codelibs/dynarray.h     |   8 -
 cde/lib/DtSvc/include/codelibs/privbuf.h      |   8 -
 cde/lib/DtSvc/include/codelibs/stringx.h      |  29 --
 cde/lib/DtTerm/TermPrim/TermPrimDebug.c       |   6 +-
 cde/lib/tt/bin/dbck/options.C                 |   2 +-
 cde/lib/tt/bin/ttauth/ttauth.h                |   3 -
 cde/lib/tt/bin/ttdbserverd/db_server_svc.C    |   4 -
 cde/lib/tt/bin/tttar/tttar.C                  |   6 -
 cde/lib/tt/bin/tttar/tttar_api.C              |   4 -
 cde/lib/tt/bin/tttar/tttar_spec.C             |   4 -
 cde/lib/tt/lib/Makefile.am                    |   5 -
 cde/lib/tt/lib/realpath.c                     | 160 -----------
 cde/lib/tt/lib/realpath.hp.c                  | 146 ----------
 cde/lib/tt/lib/tt_options.h                   | 271 ++----------------
 cde/lib/tt/lib/util/tt_host.C                 |   3 -
 cde/lib/tt/lib/util/tt_log.C                  |   3 -
 cde/lib/tt/lib/util/tt_path.C                 |  13 -
 cde/lib/tt/lib/util/tt_string.C               |   2 -
 cde/lib/tt/mini_isam/iscntl.c                 |  16 --
 .../dthelp/parser/canon1/helptag/global.h     |  10 -
 .../dthelp/parser/canon1/helptag/help.c       |  52 ----
 .../dthelp/parser/pass1/helptag/help.c        |  51 ----
 .../dthelp/parser/pass2/htag2/global.h        |   2 -
 .../dtinfo/src/Other/WindowSystemMotif.C      |   5 -
 .../dtinfo/src/Preferences/UserPreference.C   |   3 -
 .../dtinfo/dtinfo/src/Query/QueryTermView.C   |   2 -
 .../dtinfo/dtinfo/src/Support/xList.hh        |  12 -
 .../dtinfo/dtinfo/wwl/include/WWL/WArgList.h  |   5 -
 .../dtinfo/dtinfo/wwl/include/WWL/wwl.h       |  14 -
 cde/programs/dtinfo/tools/misc/msgsets.C      |   4 -
 cde/programs/dtlogin/config/Xconfig.src       |   4 -
 cde/programs/dtlogin/dm.c                     |   4 -
 cde/programs/dtlogin/genauth.c                |  40 ---
 cde/programs/dtmail/include/DtMail/Buffer.hh  |   3 -
 .../dtmail/libDtMail/RFC/RFCTransport.C       |   7 -
 cde/programs/dtscreen/usleep.c                |  16 --
 cde/programs/dtscreen/worm.c                  |   9 -
 cde/programs/dtsearchpath/dtappg/Options.C    |   4 -
 .../dtsearchpath/dtappg/dtappgather.C         |   6 +-
 .../dtsearchpath/dtsp/ManSearchPath.C         |  12 -
 cde/programs/dtsearchpath/dtsp/Options.C      |   4 -
 cde/programs/dtsearchpath/dtsp/SearchPath.C   |  27 --
 cde/programs/dtsearchpath/dtsp/SearchPath.h   |  14 -
 cde/programs/dtsearchpath/libCliSrv/TTFile.C  |  17 --
 cde/programs/dtsearchpath/libCliSrv/TTFile.h  |   4 -
 cde/programs/dtsearchpath/libCliSrv/UnixEnv.C |   6 -
 cde/programs/dtsearchpath/libCliSrv/cstring.C |   8 -
 cde/programs/dtsearchpath/libCliSrv/cstring.h |   8 -
 cde/programs/dtsession/Makefile.am            |   2 -
 cde/programs/dtudcfonted/libfuty/getfname.c   |   4 -
 cde/programs/dtudcfonted/libfuty/oakfuty.c    |   5 -
 cde/programs/dtwm/WmFunction.c                |   2 +-
 cde/programs/localized/templates/French.am    |   8 +-
 cde/programs/localized/templates/German.am    |   8 +-
 cde/programs/localized/templates/Italian.am   |   8 +-
 cde/programs/localized/templates/Japanese.am  |   8 +-
 cde/programs/localized/templates/Spanish.am   |   8 +-
 cde/programs/ttsnoop/tt_c++.h                 |   4 -
 cde/programs/ttsnoop/ttsnoop.C.src            |   2 -
 70 files changed, 46 insertions(+), 1250 deletions(-)
 delete mode 100644 cde/lib/tt/lib/realpath.c
 delete mode 100644 cde/lib/tt/lib/realpath.hp.c

diff --git a/cde/.gitignore b/cde/.gitignore
index 0102a0fab..f76c859d1 100644
--- a/cde/.gitignore
+++ b/cde/.gitignore
@@ -22,130 +22,14 @@ imports/motif
 # exports of libraries/headers
 exports
 
-# admin/IntegTools/ 
-admin/IntegTools/post_install/*.list
-admin/IntegTools/post_install/*.lst
-
-admin/IntegTools/post_install/linux/CDE-MIN.list
-admin/IntegTools/post_install/linux/CDE-MIN.lst
-admin/IntegTools/post_install/linux/CDE-RUN.list
-admin/IntegTools/post_install/linux/CDE-RUN.lst
-admin/IntegTools/post_install/linux/CDE-SHLIBS.list
-admin/IntegTools/post_install/linux/CDE-SHLIBS.lst
-admin/IntegTools/post_install/linux/CDE-TT.list
-admin/IntegTools/post_install/linux/CDE-TT.lst
-admin/IntegTools/post_install/linux/configMin
-admin/IntegTools/post_install/linux/configRun
-admin/IntegTools/post_install/linux/configShlibs
-admin/IntegTools/post_install/linux/configTT
-
-admin/IntegTools/post_install/freebsd/CDE-MIN.list
-admin/IntegTools/post_install/freebsd/CDE-MIN.lst
-admin/IntegTools/post_install/freebsd/CDE-RUN.list
-admin/IntegTools/post_install/freebsd/CDE-RUN.lst
-admin/IntegTools/post_install/freebsd/CDE-SHLIBS.list
-admin/IntegTools/post_install/freebsd/CDE-SHLIBS.lst
-admin/IntegTools/post_install/freebsd/CDE-TT.list
-admin/IntegTools/post_install/freebsd/CDE-TT.lst
-admin/IntegTools/post_install/freebsd/configMin
-admin/IntegTools/post_install/freebsd/configRun
-admin/IntegTools/post_install/freebsd/configShlibs
-admin/IntegTools/post_install/freebsd/configTT
-
-admin/IntegTools/post_install/openbsd/CDE-MIN.list
-admin/IntegTools/post_install/openbsd/CDE-MIN.lst
-admin/IntegTools/post_install/openbsd/CDE-RUN.list
-admin/IntegTools/post_install/openbsd/CDE-RUN.lst
-admin/IntegTools/post_install/openbsd/CDE-SHLIBS.list
-admin/IntegTools/post_install/openbsd/CDE-SHLIBS.lst
-admin/IntegTools/post_install/openbsd/CDE-TT.list
-admin/IntegTools/post_install/openbsd/CDE-TT.lst
-admin/IntegTools/post_install/openbsd/configMin
-admin/IntegTools/post_install/openbsd/configRun
-admin/IntegTools/post_install/openbsd/configShlibs
-admin/IntegTools/post_install/openbsd/configTT
-
-admin/IntegTools/post_install/netbsd/CDE-MIN.list
-admin/IntegTools/post_install/netbsd/CDE-MIN.lst
-admin/IntegTools/post_install/netbsd/CDE-RUN.list
-admin/IntegTools/post_install/netbsd/CDE-RUN.lst
-admin/IntegTools/post_install/netbsd/CDE-SHLIBS.list
-admin/IntegTools/post_install/netbsd/CDE-SHLIBS.lst
-admin/IntegTools/post_install/netbsd/CDE-TT.list
-admin/IntegTools/post_install/netbsd/CDE-TT.lst
-admin/IntegTools/post_install/netbsd/configMin
-admin/IntegTools/post_install/netbsd/configRun
-admin/IntegTools/post_install/netbsd/configShlibs
-admin/IntegTools/post_install/netbsd/configTT
-
-admin/IntegTools/post_install/sun/CDE-MIN.list
-admin/IntegTools/post_install/sun/CDE-MIN.lst
-admin/IntegTools/post_install/sun/CDE-RUN.list
-admin/IntegTools/post_install/sun/CDE-RUN.lst
-admin/IntegTools/post_install/sun/CDE-SHLIBS.list
-admin/IntegTools/post_install/sun/CDE-SHLIBS.lst
-admin/IntegTools/post_install/sun/CDE-TT.list
-admin/IntegTools/post_install/sun/CDE-TT.lst
-admin/IntegTools/post_install/sun/configMin
-admin/IntegTools/post_install/sun/configRun
-admin/IntegTools/post_install/sun/configShlibs
-admin/IntegTools/post_install/sun/configTT
-
-admin/IntegTools/post_install/configDemos
-admin/IntegTools/post_install/configFonts
-admin/IntegTools/post_install/configHelp
-admin/IntegTools/post_install/configHelpPrg
-admin/IntegTools/post_install/configHelpRun
-admin/IntegTools/post_install/configIcons
-admin/IntegTools/post_install/configInc
-admin/IntegTools/post_install/configMan
-admin/IntegTools/post_install/configManDev
-admin/IntegTools/post_install/configMsgCat
-admin/IntegTools/post_install/configPrg
-admin/IntegTools/post_install/configShlibs
-
-install.dt
-install.dt.hp
-install.dt.ibm
-install.dt.sun
-dinstall.dt
-dinstallCDE
-installCDE
-updateCDE
-
 installCDE.*.log
 
 cscope.out
 
-# Makefiles (generated by Imakefiles)
+# Makefiles
 Makefile
-xmakefile
-
-# generated db files
-databases/*\.db
-databases/*\.tmp
-databases/CDE-MIN.udb
-databases/CDE-RUN.udb
-databases/CDE-C.udb
-databases/CDE-DE.udb
-databases/CDE-ES.udb
-databases/CDE-FR.udb
-databases/CDE-IT.udb
-databases/CDE-JP.udb
-databases/CDE-INFOLIB-*\.udb
-databases/CDE-HELP-*\.udb
-databases/CDE-MSG-*\.udb
-databases/CDE-SHLIBS\.udb
 
-# config
-config/imake/imake
-config/makedepend/makedepend
-config/util/lndir
-config/util/makestrs
-config/util/mergelib
-config/util/xmkmf
-
-# exampls
+# examples
 examples/tt/broadcast
 
 # Compiled binaries and misc generated program files
@@ -367,9 +251,6 @@ programs/dtappbuilder/src/abmf/dtcodegen.cat
 programs/dtappbuilder/src/libABil/bil_parse.c
 programs/dtappbuilder/src/libABil/bil_parse.h
 
-# imake
-config/imake/Makefile.proto
-
 # doc
 book.log
 book.out.idx
diff --git a/cde/include/Dt/vista.h b/cde/include/Dt/vista.h
index 7fd869dca..ac47147f7 100644
--- a/cde/include/Dt/vista.h
+++ b/cde/include/Dt/vista.h
@@ -86,7 +86,6 @@
 # define __SVR4_I386_ABI_L1__
 #endif
 #include <limits.h>	/* pickup WORD_BIT, LONG_BIT */
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 # undef __SVR4_I386_ABI_L1__
 # ifndef WORD_BIT
 # define WORD_BIT 32
@@ -94,7 +93,6 @@
 # ifndef LONG_BIT
 # define LONG_BIT 32
 # endif
-#endif
 
 #define db_VERSION "3.dt"	/* was "3.10" */
 #define dbd_VERSION "V3.dt\032"	/* was "V3.00\032" */
diff --git a/cde/include/EUSCompat.h b/cde/include/EUSCompat.h
index 50f43020d..68140abe8 100644
--- a/cde/include/EUSCompat.h
+++ b/cde/include/EUSCompat.h
@@ -52,9 +52,7 @@ extern "C" {
 ** System V R4 based systems define the stuff we need in
 ** sys/types.h. Include that and then we are done.
 */
-#if defined(__linux__) || defined(SunOS) || defined(CSRG_BASED)
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
 
 #if defined(CSRG_BASED) || defined(__linux__)
 # include <sys/socket.h>
diff --git a/cde/lib/DtMmdb/StyleSheet/DocParser.C b/cde/lib/DtMmdb/StyleSheet/DocParser.C
index 6579e06fc..1bf65192a 100644
--- a/cde/lib/DtMmdb/StyleSheet/DocParser.C
+++ b/cde/lib/DtMmdb/StyleSheet/DocParser.C
@@ -242,15 +242,7 @@ DocParser::process(istream &input, ostringstream &output,
 	  break;
 	case AttributeSection:
 	  {
-#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
-    !defined(CSRG_BASED) && !defined(sun)
-	    volatile
-#endif
 	    AttributeList *attrs = 0;
-#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
-    !defined(CSRG_BASED) && !defined(sun)
-	    volatile
-#endif
 	    AttributeList *olias_attrs = 0;
 
 	    mtry
diff --git a/cde/lib/DtMmdb/StyleSheet/Expression.C b/cde/lib/DtMmdb/StyleSheet/Expression.C
index e85a1167b..f3c7a9cdb 100644
--- a/cde/lib/DtMmdb/StyleSheet/Expression.C
+++ b/cde/lib/DtMmdb/StyleSheet/Expression.C
@@ -141,20 +141,8 @@ BinaryOperatorNode::evaluate() const
 {
   // calculate children trees and then have feature value do the operation 
 
-#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
-    !defined(CSRG_BASED) && !defined(sun)
-  volatile
-#endif
   FeatureValue *left =  0;
-#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
-    !defined(CSRG_BASED) && !defined(sun)
-  volatile
-#endif
   FeatureValue *right = 0;
-#if !defined(SC3) && !defined(_IBMR2) && !defined(__linux__) && \
-    !defined(CSRG_BASED) && !defined(sun)
-  volatile
-#endif
   FeatureValue *result = 0;
 
   mtry
diff --git a/cde/lib/DtMmdb/btree_berkeley/compat.h b/cde/lib/DtMmdb/btree_berkeley/compat.h
index 48de36163..e5c8d5bab 100644
--- a/cde/lib/DtMmdb/btree_berkeley/compat.h
+++ b/cde/lib/DtMmdb/btree_berkeley/compat.h
@@ -85,14 +85,6 @@ typedef unsigned int	size_t;
 typedef unsigned int	sigset_t;
 #endif
 
-/*
- * If your system's vsnprintf returns a char *, not an int,
- * change the 0 to a 1.
- */
-#if !defined(_AIX) && !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-#define	VSPRINTF_CHARSTAR
-#endif
-
 /*
  * If you don't have POSIX 1003.1 signals, the signal code surrounding the 
  * temporary file creation is intended to block all of the possible signals
diff --git a/cde/lib/DtMmdb/dti_excs/Destructable_il.hh b/cde/lib/DtMmdb/dti_excs/Destructable_il.hh
index ea01d5377..c198a37ad 100644
--- a/cde/lib/DtMmdb/dti_excs/Destructable_il.hh
+++ b/cde/lib/DtMmdb/dti_excs/Destructable_il.hh
@@ -102,12 +102,6 @@ Destructable::~Destructable()
 inline void
 Destructable::destruct()
 {
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
   delete this;
-#else
-  // Have to call this here since some compilers don't allow
-  // qualified calls through object pointer.
-  Destructable::~Destructable();
-#endif
 }
 #endif
diff --git a/cde/lib/DtMmdb/utility/filebuf.C b/cde/lib/DtMmdb/utility/filebuf.C
index aedc8fee0..d08dbe7fa 100644
--- a/cde/lib/DtMmdb/utility/filebuf.C
+++ b/cde/lib/DtMmdb/utility/filebuf.C
@@ -26,10 +26,6 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-#include <sysent.h>
-#endif
-
 #include <fcntl.h>
 #include <string.h>
 
diff --git a/cde/lib/DtMmdb/utility/funcs.h b/cde/lib/DtMmdb/utility/funcs.h
index abf9b00d5..b4253e4a4 100644
--- a/cde/lib/DtMmdb/utility/funcs.h
+++ b/cde/lib/DtMmdb/utility/funcs.h
@@ -52,14 +52,7 @@
 #ifndef _funcs_h
 #define _funcs_h 1
 
-#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-#include <libc.h>
-#endif
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <unistd.h>
-#else
-#include <sysent.h>
-#endif
 #include <time.h>
 #include <errno.h>
 #include <string.h>
diff --git a/cde/lib/DtMmdb/utility/streambuf.C b/cde/lib/DtMmdb/utility/streambuf.C
index 959b62412..f01ad68e3 100644
--- a/cde/lib/DtMmdb/utility/streambuf.C
+++ b/cde/lib/DtMmdb/utility/streambuf.C
@@ -22,12 +22,7 @@
  */
 /* $XConsortium: streambuf.C /main/8 1996/08/21 15:55:14 drk $ */
 #include "utility/c_streambuf.h"
-
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <stdlib.h>
-#else
-#include <libc.h>
-#endif
 
 #define DEF_BUF_SIZ 4096
 
diff --git a/cde/lib/DtSearch/raima/Makefile.am b/cde/lib/DtSearch/raima/Makefile.am
index 5be3c10e4..7213ee168 100644
--- a/cde/lib/DtSearch/raima/Makefile.am
+++ b/cde/lib/DtSearch/raima/Makefile.am
@@ -7,16 +7,10 @@ libraima_la_CFLAGS = -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \
 		     -DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\" \
 		     -DNO_TRANS -DUNIX -D_POSIX_SOURCE -DMULTIBYTE
 
-if LINUX
-libraima_la_CFLAGS += -D_XOPEN_SOURCE=700
-endif
-
-if BSD
-libraima_la_CFLAGS += -D_XOPEN_SOURCE=700
-endif
-
 if SOLARIS
-libraima_la_CFLAGS += -D_XOPEN_SOURCE=500 -DNO_REGCOMP
+libraima_la_CFLAGS += -D_XOPEN_SOURCE=500
+else
+libraima_la_CFLAGS += -D_XOPEN_SOURCE=700
 endif
 
 
diff --git a/cde/lib/DtSvc/include/codelibs/dynarray.h b/cde/lib/DtSvc/include/codelibs/dynarray.h
index 785606393..5cf7e99f9 100644
--- a/cde/lib/DtSvc/include/codelibs/dynarray.h
+++ b/cde/lib/DtSvc/include/codelibs/dynarray.h
@@ -36,15 +36,7 @@
 #ifndef __DYNARRAY_H_
 #define __DYNARRAY_H_
 
-#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-#include <generic.h>
-#endif
-#if defined(sun) || defined(__linux__) || defined(CSRG_BASED)
 #define _DELETE_ARRAY(sz) delete[]
-#else
-#define _DELETE_ARRAY(sz) delete[(sz)]
-#endif
-
 
 // this is used to create an ARRAY of a TYPE
 #define declare_array(ARRAY, TYPE, BUMP) \
diff --git a/cde/lib/DtSvc/include/codelibs/privbuf.h b/cde/lib/DtSvc/include/codelibs/privbuf.h
index b692dda57..e5f1d85ba 100644
--- a/cde/lib/DtSvc/include/codelibs/privbuf.h
+++ b/cde/lib/DtSvc/include/codelibs/privbuf.h
@@ -41,14 +41,6 @@ typedef void (*privbuf_func)(void *v);
 #include <stddef.h>
 #include <stdlib.h>
 
-#if defined(sun) || defined(__linux__) || defined(CSRG_BASED)
-// Rejects valid inline declarations, claiming they have both internal and
-// external linkage.
-#else
-inline static void *operator new(size_t size) { return malloc((unsigned)size); }
-inline static void operator delete(void *p) { if (p) free((char*)p); }
-#endif
-
 #include <codelibs/dynarray.h>
 declare_array(privbuf_charbuf, char, 128)
 declare_array(privbuf_strvec, char*, 128)
diff --git a/cde/lib/DtSvc/include/codelibs/stringx.h b/cde/lib/DtSvc/include/codelibs/stringx.h
index f69fb54e1..e702d0e9a 100644
--- a/cde/lib/DtSvc/include/codelibs/stringx.h
+++ b/cde/lib/DtSvc/include/codelibs/stringx.h
@@ -66,28 +66,11 @@ extern "C"
 
 #ifdef __cplusplus
     char *strtokx(char *&ptr, const char *sep);
-# if !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
-    char **strsep(const char *str, const char *sep,
-	boolean whsp = TRUE, int *num = NULL);
-    const char *strcmbn(const char **vec, const char *sep = " ");
-# endif
-
 #else /* __STDC__ */
     char *strtokx(char **ptr, const char *sep);
-# if !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
-    char **strsep(const char *str, const char *sep,
-	boolean whsp, int *num);
-#endif
     const char *strcmbn(const char **vec, const char *sep);
-
 #endif /* __STDC__ */
 
-
-#ifdef __OBSOLETE
-    size_t nl_strlen(const char *str);	/* __OBSOLETE */
-    int strcharsize(const char *str);	/* __OBSOLETE */
-#endif /* __OBSOLETE */
-
 #else /* C */
 
 extern void   strfree();
@@ -102,12 +85,6 @@ extern unsigned   strhashi();
 
 extern char      *strupper(), *strlower();
 
-
-#ifdef __OBSOLETE
-extern int        strcharsize();	/* __OBSOLETE */
-extern size_t     nl_strlen();		/* __OBSOLETE */
-#endif /* __OBSOLETE */
-
 #endif /* C */
 #if defined(__cplusplus)
 }
@@ -145,12 +122,6 @@ inline char *strdup(const char *s)
 
 /* macros for funcs that work on top of privbuf versions */
 
-/* for backward compatibility only - __OBSOLETE */
-#ifdef __OBSOLETE
-#define strpos strstrx /* __OBSOLETE */
-#define strrpos strrstrx /* __OBSOLETE */
-#endif /* __OBSOLETE */
-
 #endif /* C || __STDC__ */
 
 #endif /* __STRINGX_H_ */
diff --git a/cde/lib/DtTerm/TermPrim/TermPrimDebug.c b/cde/lib/DtTerm/TermPrim/TermPrimDebug.c
index 9990ebfb8..119fc56d4 100644
--- a/cde/lib/DtTerm/TermPrim/TermPrimDebug.c
+++ b/cde/lib/DtTerm/TermPrim/TermPrimDebug.c
@@ -33,11 +33,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
+#include <stdarg.h>
 #include "TermHeader.h"
 #include "TermPrimDebug.h"
 #include <signal.h>
diff --git a/cde/lib/tt/bin/dbck/options.C b/cde/lib/tt/bin/dbck/options.C
index 98393be4d..55ccb8e44 100644
--- a/cde/lib/tt/bin/dbck/options.C
+++ b/cde/lib/tt/bin/dbck/options.C
@@ -37,7 +37,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "util/copyright.h"
-#if defined(__linux__) || defined(sgi) || defined(CSRG_BASED)
+#if defined(__linux__) || defined(CSRG_BASED)
 #include <getopt.h>
 #endif     
 #include "dbck.h"     
diff --git a/cde/lib/tt/bin/ttauth/ttauth.h b/cde/lib/tt/bin/ttauth/ttauth.h
index c12ef0842..b3670b366 100644
--- a/cde/lib/tt/bin/ttauth/ttauth.h
+++ b/cde/lib/tt/bin/ttauth/ttauth.h
@@ -58,9 +58,6 @@ typedef int Bool;
 
 extern char *ProgramName;
 
-#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-extern char *malloc(), *realloc();
-#endif
 int process_command(), auth_initialize(), auth_finalize();
 extern int print_help();
 extern int verbose;
diff --git a/cde/lib/tt/bin/ttdbserverd/db_server_svc.C b/cde/lib/tt/bin/ttdbserverd/db_server_svc.C
index 3716b737a..af4d4dc55 100644
--- a/cde/lib/tt/bin/ttdbserverd/db_server_svc.C
+++ b/cde/lib/tt/bin/ttdbserverd/db_server_svc.C
@@ -214,11 +214,7 @@ main(int argc, char** argv, char **envp)
 	void install_signal_handler();
 	SVCXPRT *transp;
 	struct sockaddr_in saddr;
-# if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 	socklen_t asize = sizeof(saddr);
-# else
-	size_t asize = sizeof(saddr);
-# endif
 	int is_aix = 0;
 
 	int do_garbage_collect = 0;
diff --git a/cde/lib/tt/bin/tttar/tttar.C b/cde/lib/tt/bin/tttar/tttar.C
index 1a66e83e5..b3961be1c 100644
--- a/cde/lib/tt/bin/tttar/tttar.C
+++ b/cde/lib/tt/bin/tttar/tttar.C
@@ -37,13 +37,7 @@
 #include <stdlib.h>
 #include <sys/param.h>
 #include <sys/stat.h>
-#if defined(__linux__) || defined(sun) || defined(CSRG_BASED)
 #include <unistd.h>
-#else
-#if !defined(sun)
-#include <osfcn.h>
-#endif
-#endif
 #include <netdb.h>
 #include <locale.h>
 #include <errno.h>
diff --git a/cde/lib/tt/bin/tttar/tttar_api.C b/cde/lib/tt/bin/tttar/tttar_api.C
index e742c3a83..7da03deae 100644
--- a/cde/lib/tt/bin/tttar/tttar_api.C
+++ b/cde/lib/tt/bin/tttar/tttar_api.C
@@ -33,11 +33,7 @@
  */
 
 #include <errno.h>
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <unistd.h>
-#else
-#include <osfcn.h>
-#endif
 #include <sys/param.h>
 #include "api/c/api_api.h"
 #include "Tt/tt_c.h"
diff --git a/cde/lib/tt/bin/tttar/tttar_spec.C b/cde/lib/tt/bin/tttar/tttar_spec.C
index bee2cb13d..771ee1656 100644
--- a/cde/lib/tt/bin/tttar/tttar_spec.C
+++ b/cde/lib/tt/bin/tttar/tttar_spec.C
@@ -32,11 +32,7 @@
  *
  */
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <unistd.h>
-#else
-#include <osfcn.h>
-#endif
 #include "Tt/tt_c.h"
 #include "util/tt_iostream.h"
 #include "tttar_utils.h"
diff --git a/cde/lib/tt/lib/Makefile.am b/cde/lib/tt/lib/Makefile.am
index 6fa386ad6..9d48f9457 100644
--- a/cde/lib/tt/lib/Makefile.am
+++ b/cde/lib/tt/lib/Makefile.am
@@ -4,11 +4,6 @@ SUBDIRS = api db mp util tttk
 
 lib_LTLIBRARIES = libtt.la
 
-# if you are on a system that does not support realpath(), you may need to
-# include realpath.c in the _SOURCES
-#
-#libtt_la_SOURCES = realpath.c
-
 libtt_la_SOURCES =
 
 # fake things so libtool creates this as a C++ library
diff --git a/cde/lib/tt/lib/realpath.c b/cde/lib/tt/lib/realpath.c
deleted file mode 100644
index cd22ba9d7..000000000
--- a/cde/lib/tt/lib/realpath.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
-/*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company			 */
-/*%%  (c) Copyright 1993, 1994 International Business Machines Corp.	 */
-/*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.			 */
-/*%%  (c) Copyright 1993, 1994 Novell, Inc. 				 */
-/*%%  $XConsortium: realpath.c /main/3 1995/10/23 09:49:50 rswiston $ 			 				 */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <strings.h>		
-#include <errno.h>
-
-/* This is used when the operating system  does not  provide us  with
- * a realpath implementation.  It's named differently so there is
- * no name clash between it and the system version of realpath.
- */
-
-char *
-_tt_internal_realpath(pathname, finalpath)
-char *pathname;
-char *finalpath;
-{
-  struct stat sbuf;
-  char curpath[MAXPATHLEN],
-  workpath[MAXPATHLEN],
-  linkpath[MAXPATHLEN],
-  namebuf[MAXPATHLEN],
-  *where,
-  *ptr,
-  *last;
-  int len;
-  int nlink = 0;	/* To keep track of loops in the path. */
-
-   strcpy(curpath, pathname);
-
-   if (*pathname != '/') {
-#if defined(__STDC__)
-      if (!getcwd(workpath)) {
-#else
-      if (!getwd(workpath)) {	
-#endif
-      strcpy(finalpath, ".");
-         return(NULL);
-       } 
-    } else *workpath = NULL;
-
-   /* curpath is the path we're still resolving      */
-   /* linkpath is the path a symbolic link points to */
-   /* workpath is the path we've resolved            */
-
- loop:
-   where = curpath;
-   while (*where != NULL) {
-      if (!strcmp(where, ".")) {
-         where++;
-         continue;
-       }
-
-      /* deal with "./" */
-      if (!strncmp(where, "./", 2)) {
-         where += 2;
-         continue;
-       }
-
-      /* deal with "../" */
-      if (!strncmp(where, "../", 3)) {
-         where += 3;
-         ptr = last = workpath;
-         while (*ptr) {
-            if (*ptr == '/') last = ptr;
-            ptr++;
-	  }
-         *last = NULL;
-         continue;
-       }
-
-      ptr = strchr(where, '/');
-      if (!ptr)
-         ptr = where + strlen(where) - 1;
-      else
-         *ptr = NULL;
-
-      strcpy(namebuf, workpath);
-
-      for (last = namebuf; *last; last++) continue;
-
-      /* tack on a trailing, or leading, `/` */
-      if (last == namebuf || *--last != '/') {
-      	strcat(namebuf, "/");
-      }
-
-      strcat(namebuf, where);
-
-      where = ++ptr;
-      if (lstat(namebuf, &sbuf) == -1) {
-         strcpy(finalpath, namebuf);
-         return(NULL);
-       }
-      
-      if ((sbuf.st_mode & S_IFLNK) == S_IFLNK) {
-	 /* Look for loop in path such as link to self. */
-	 nlink++;			 
-	 if (nlink > MAXSYMLINKS) {
-		 errno = ELOOP;
-		 return (NULL);
-	 }
-         len = readlink(namebuf, linkpath, MAXPATHLEN);
-         if (len == 0) {
-            strcpy(finalpath, namebuf);
-            return(NULL);
-	  }
-         *(linkpath + len) = NULL; /* readlink doesn't null-terminate result */
-         if (*linkpath == '/') *workpath = NULL;
-         if (*where) {
-            strcat(linkpath, "/");
-            strcat(linkpath, where);
-	  }
-         strcpy(curpath, linkpath);
-         goto loop;
-       }
-
-      if ((sbuf.st_mode & S_IFDIR) == S_IFDIR) {
-         strcpy(workpath, namebuf);
-         continue;
-       }
-
-      if (*where) {
-         strcpy(finalpath, namebuf);
-         return(NULL);  /* path/notadir/morepath */
-       } else
-         strcpy(workpath, namebuf);
-    }
-   strcpy(finalpath, workpath);
-   return(finalpath);
-
-}
-
diff --git a/cde/lib/tt/lib/realpath.hp.c b/cde/lib/tt/lib/realpath.hp.c
deleted file mode 100644
index 97a700b0c..000000000
--- a/cde/lib/tt/lib/realpath.hp.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
-/*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company			 */
-/*%%  (c) Copyright 1993, 1994 International Business Machines Corp.	 */
-/*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.			 */
-/*%%  (c) Copyright 1993, 1994 Novell, Inc. 				 */
-/*%%  $XConsortium: realpath.hp.c /main/3 1995/10/23 09:49:57 rswiston $ 			 				 */
-/* @(#)realpath.hp.c	1.3 93/07/30
- * Version of realpath for HP/UX systems */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <strings.h>
-
-char *
-realpath(pathname, finalpath)
-char *pathname;
-char *finalpath;
-{
-  struct stat sbuf;
-  char curpath[MAXPATHLEN],
-  workpath[MAXPATHLEN],
-  linkpath[MAXPATHLEN],
-  namebuf[MAXPATHLEN],
-  *where,
-  *ptr,
-  *last;
-  int len;
-
-   strcpy(curpath, pathname);
-
-   if (*pathname != '/') {
-#if defined(__STDC__)
-      if (!getcwd(workpath)) {
-#else
-      if (!getwd(workpath)) {
-#endif
-         strcpy(finalpath, ".");
-         return(NULL);
-       }
-    } else *workpath = NULL;
-
-   /* curpath is the path we're still resolving      */
-   /* linkpath is the path a symbolic link points to */
-   /* workpath is the path we've resolved            */
-
- loop:
-   where = curpath;
-   while (*where != NULL) {
-      if (!strcmp(where, ".")) {
-         where++;
-         continue;
-       }
-
-      /* deal with "./" */
-      if (!strncmp(where, "./", 2)) {
-         where += 2;
-         continue;
-       }
-
-      /* deal with "../" */
-      if (!strncmp(where, "../", 3)) {
-         where += 3;
-         ptr = last = workpath;
-         while (*ptr) {
-            if (*ptr == '/') last = ptr;
-            ptr++;
-	  }
-         *last = NULL;
-         continue;
-       }
-
-      ptr = strchr(where, '/');
-      if (!ptr)
-         ptr = where + strlen(where) - 1;
-      else
-         *ptr = NULL;
-
-      strcpy(namebuf, workpath);
-      for (last = namebuf; *last; last++) continue;
-      /* tack on a trailing, or leading, `/` */
-      if (last == namebuf || *--last != '/') {
-        strcat(namebuf, "/");
-      }
-      strcat(namebuf, where);
-
-      where = ++ptr;
-      if (lstat(namebuf, &sbuf) == -1) {
-         strcpy(finalpath, namebuf);
-         return(NULL);
-       }
-
-      if ((sbuf.st_mode & S_IFLNK) == S_IFLNK) {
-         len = readlink(namebuf, linkpath, MAXPATHLEN);
-         if (len == 0) {
-            strcpy(finalpath, namebuf);
-            return(NULL);
-	  }
-         *(linkpath + len) = NULL; /* readlink doesn't null-terminate result */
-         if (*linkpath == '/') *workpath = NULL;
-         if (*where) {
-            strcat(linkpath, "/");
-            strcat(linkpath, where);
-	  }
-         strcpy(curpath, linkpath);
-         goto loop;
-       }
-
-      if ((sbuf.st_mode & S_IFDIR) == S_IFDIR) {
-         strcpy(workpath, namebuf);
-         continue;
-       }
-
-      if (*where) {
-         strcpy(finalpath, namebuf);
-         return(NULL);  /* path/notadir/morepath */
-       } else
-         strcpy(workpath, namebuf);
-    }
-   strcpy(finalpath, workpath);
-   return(finalpath);
-
-}
-
diff --git a/cde/lib/tt/lib/tt_options.h b/cde/lib/tt/lib/tt_options.h
index 3af74946a..09631f10e 100644
--- a/cde/lib/tt/lib/tt_options.h
+++ b/cde/lib/tt/lib/tt_options.h
@@ -65,9 +65,6 @@
  *
  * OPT_PATCH -- if defined, build patch info into objects
  *
- * OPT_BUG_SUNOS_4 -- used to flag special hacks only needed because
- *   of bugs or quirks in SunOS 4.x.
- *
  * OPT_BUG_SUNOS_5 -- used to flag special hacks only needed because
  *   of bugs or quirks in SunOS 5.x.
  * 
@@ -77,9 +74,9 @@
  * OPT_XDR_LONG_TYPE -- used for (64-bit) architectures where
  *   <rcp/xdr.h> defines x_putlong and x_getlong to not take "long*".
  *
- * OPT_POSIX_SIGNAL -- set to assume posix-style sigaction() call.
+ * OPT_POSIX_SIGNAL -- set to assume posix-style sigaction() call (default).
  * OPT_BSD_SIGNAL -- set to assume bsd-style signal() call. 
- *   If *neither* OPT_POSIX_SIGNAL or OPT_BSD_SIGNAL is defined, use
+ *   If OPT_POSIX_SIGNAL is undefined and OPT_BSD_SIGNAL is not set, use
  *   the old SVR2-style sigset().
  *
  * OPT_BSD_WAIT -- set to assume bsd-style wait() calls, which expect
@@ -117,9 +114,6 @@
  *   the tttarfile file will appear after extracts, a small flaw but not a 
  *   fatal one.
  *
- * OPT_HAS_REALPATH -- set if the system provides a realpath() library
- *		       function; otherwise we'll  use our  local copy.
- *
  * OPT_PING_TRIES - The number of times to rpc-ping ttsession to
  *   see if ttsession is alive.
  *
@@ -191,136 +185,50 @@
 # define GNU_STRCAST
 #endif
 
-/*
- * To avoid ugly cpp command-line options, we instead centralize
- * in the following code all knowledge about deducing the OS version
- * from the definitions cpp gives us.
- */
-#if defined(sun)
-# if !defined(OS_VERSION)
-#  if defined(OSMajorVersion)
-#   define OS_VERSION		OSMajorVersion
-#   define OS_MINOR_VERSION	OSMinorVersion
-#  else
-#   if !defined(_STDIO_H) && !defined(__stdio_h)
-#    include <stdio.h>
-#   endif
-#   if defined(_SIZE_T)
-#    define OS_VERSION		5
-#   else
-#    define OS_VERSION		4
-#   endif
-#  endif
-# endif
+#undef OPT_CPP_PATH
+#define OPT_CPP_PATH CPP_PROGRAM
+
+#ifdef sun
+#define OPT_CPP_OPTIONS "-B"
+#else
+#define OPT_BUG_RPCINTR
+#define OPT_CPP_OPTIONS ""
+#define OPT_AUTOMOUNT_PATH_FIX
+#define OPT_DEFINE_SIG_PF
 #endif
 
+#ifdef __linux__
+#define OPT_LOCAL_MOUNT_TYPE   "ext2fs"
+#else
+#define OPT_LOCAL_MOUNT_TYPE   MNTTYPE_UFS
+#endif
+
+#define OPT_POSIX_SIGNAL
+#define OPT_CATGETS
+#define OPT_TAR_HAS_EXCLUDE_OPTION
+
 #if defined(_AIX)
-# undef  OPT_UNIX_SOCKET_RPC 
-# undef  OPT_TLI 
-# undef  OPT_DLOPEN_X11 
-# undef  OPT_DLOPEN_CE 
-# undef  OPT_ADDMSG_DIRECT
+# undef OPT_BUG_RPCINTR
+# undef OPT_LOCAL_MOUNT_TYPE
+# undef OPT_TAR_HAS_EXCLUDE_OPTION
 # define OPT_BUG_AIX
-# undef  OPT_SECURE_RPC 
-# undef  OPT_CLASSING_ENGINE 
-# undef  OPT_BSD_SIGNAL
-# define OPT_POSIX_SIGNAL
-# undef  OPT_BSD_WAIT
-# undef  OPT_DGETTEXT
-# define OPT_CATGETS
 # define OPT_GETDTABLESIZE
-# undef  OPT_SYSINFO
-# define OPT_CPP_PATH		"/usr/ccs/lib/cpp"
-# define OPT_CPP_OPTIONS	""
-# undef  OPT_SVR4_GETMNTENT
-# undef  OPT_LOCKF_MNTENT
-# define OPT_DEFINE_SIG_PF
-# undef  OPT_TAR_HAS_EXCLUDE_OPTION
-# undef  OPT_HAS_REALPATH 
-# define OPT_AUTOMOUNT_PATH_FIX
 /* # define OPT_XTHREADS   	1 */	/* Defaulted by -DXTHREADS */
 
-#elif defined(sun) && (OS_VERSION <= 4)
-
-# define OPT_UNIX_SOCKET_RPC 
-# undef  OPT_TLI 
-	/* for 4.1.1 systems turning on any dlopen features on the    */
-	/* client side would break clients with ld errors unless they */
-	/* linked with -ldl. OPT_DLOPEN_CE is ok since clients don't  */
-	/* ever execute ce_* functions.				      */
-# undef  OPT_DLOPEN_X11 
-# undef  OPT_DLOPEN_CE 
-# undef  OPT_ADDMSG_DIRECT 
-# define OPT_SECURE_RPC 
-# undef  OPT_CLASSING_ENGINE
-# undef  OPT_PATCH
-# define OPT_BSD_SIGNAL
-# define OPT_BSD_WAIT
-# define OPT_DGETTEXT
-# undef  OPT_CATGETS
-# undef  OPT_GETDTABLESIZE
-# undef  OPT_SYSINFO
-# define OPT_CPP_PATH		"/usr/lib/cpp"
-# define OPT_CPP_OPTIONS	 "-B"
-# undef  OPT_SVR4_GETMNTENT
-# undef  OPT_LOCKF_MNTENT
-# define OPT_LOCAL_MOUNT_TYPE	MNTTYPE_42
-# undef  OPT_OLD_RPC
-# undef  OPT_DEFINE_SIG_PF
-# define OPT_TAR_HAS_EXCLUDE_OPTION
-
-# define OPT_BUG_SUNOS_4
-
-# define OPT_HAS_REALPATH
-# undef  OPT_AUTOMOUNT_PATH_FIX
-
 #elif defined(sun) && (OS_VERSION >= 5)
-
-# undef  OPT_UNIX_SOCKET_RPC 
 # define OPT_TLI 
-# undef  OPT_DLOPEN_X11
-# undef  OPT_DLOPEN_CE
-# undef  OPT_ADDMSG_DIRECT 
 # define OPT_SECURE_RPC 
-# undef  OPT_CLASSING_ENGINE
-# undef  OPT_BSD_SIGNAL
-# define OPT_POSIX_SIGNAL
-# undef  OPT_BSD_WAIT
-# undef  OPT_DGETTEXT
-# define OPT_CATGETS
-# undef  OPT_GETDTABLESIZE
 # define OPT_SYSINFO
-# define OPT_CPP_PATH		"/usr/ccs/lib/cpp"
-# define OPT_CPP_OPTIONS	"-B"
 # define OPT_SVR4_GETMNTENT
 # define OPT_LOCKF_MNTENT
-# define OPT_LOCAL_MOUNT_TYPE	MNTTYPE_UFS
-# undef  OPT_DEFINE_SIG_PF
-# define OPT_TAR_HAS_EXCLUDE_OPTION
 
-# define OPT_HAS_REALPATH
-# undef  OPT_AUTOMOUNT_PATH_FIX
-
-/* Does not work on X86 */
-# if defined(i386) && OS_MINOR_VERSION <= 4
-#  undef OPT_GARBAGE_THREADS
-#  undef OPT_SOLARIS_THREADED_TRIES
-# else
-#  define OPT_SOLARIS_THREADS		1
+# define OPT_SOLARIS_THREADS		1
 /* #  define OPT_XTHREADS   		1 */	/* Defaulted by -DXTHREADS */
-#  define OPT_GARBAGE_THREADS		1
-#  define OPT_SOLARIS_THREADED_TRIES	10
-# endif
-
-/* Solaris 2.5 and above, supports clnt_create_timed(3N) */
-# if (OS_MINOR_VERSION >= 5)
-#  define OPT_HAS_CLNT_CREATE_TIMED	1
-#  define OPT_CLNT_CREATE_TIMEOUT	30
-# endif
+# define OPT_GARBAGE_THREADS		1
+# define OPT_SOLARIS_THREADED_TRIES	10
 
-/* TURN THESE OFF FOR NOW */
-# undef OPT_GARBAGE_IN_PARALLEL
-# undef OPT_GARBAGE_THREADS
+# define OPT_HAS_CLNT_CREATE_TIMED	1
+# define OPT_CLNT_CREATE_TIMEOUT	30
 
 /* Turn ON/OFF parallel threads for garbage collection */
 # if defined(OPT_DO_AUTO_GARBAGE_COLLECT) && defined(OPT_SOLARIS_THREADS)
@@ -328,140 +236,23 @@
 #  define OPT_GARBAGE_THREADS		1
 # else
 #  define OPT_GARBAGE_IN_PARALLEL	0	/* used as a const */
-#  undef  OPT_GARBAGE_THREADS
 # endif
 
 #elif defined(__linux__)
-
-# undef  OPT_UNIX_SOCKET_RPC 
-# undef  OPT_TLI 
-# undef  OPT_DLOPEN_X11 
-# undef  OPT_DLOPEN_CE 
-# undef  OPT_ADDMSG_DIRECT 
-# undef  OPT_SECURE_RPC 
-# undef  OPT_CLASSING_ENGINE
-# undef  OPT_PATCH
-# define OPT_POSIX_SIGNAL
-# undef  OPT_BSD_WAIT
-# undef  OPT_DGETTEXT
-# define OPT_CATGETS
-# undef  OPT_GETDTABLESIZE
-# undef  OPT_SYSINFO
-# define OPT_CPP_PATH		"/usr/bin/cpp"
-# define OPT_CPP_OPTIONS	 ""
-# undef  OPT_SVR4_GETMNTENT
-# undef  OPT_LOCKF_MNTENT
-# define OPT_LOCAL_MOUNT_TYPE	"ext2fs"
-# undef  OPT_OLD_RPC
-# define OPT_DEFINE_SIG_PF
-# define OPT_TAR_HAS_EXCLUDE_OPTION
-# define OPT_HAS_REALPATH
-# define OPT_AUTOMOUNT_PATH_FIX
-# define OPT_BUG_RPCINTR
-# undef  OPT_XTHREADS 
 # define OPT_CONST_CORRECT
 
 #elif defined(__OpenBSD__)
 
-# undef  OPT_UNIX_SOCKET_RPC 
-# undef  OPT_TLI 
-# undef  OPT_DLOPEN_X11 
-# undef  OPT_DLOPEN_CE 
-# undef  OPT_ADDMSG_DIRECT 
-# undef  OPT_SECURE_RPC 
-# undef  OPT_CLASSING_ENGINE
-# undef  OPT_PATCH
-# define OPT_POSIX_SIGNAL
-# undef  OPT_BSD_WAIT
-# undef  OPT_DGETTEXT
-# define OPT_CATGETS
-# undef  OPT_GETDTABLESIZE
-# undef  OPT_SYSINFO
-# define OPT_CPP_PATH		"/usr/libexec/cpp"
-# define OPT_CPP_OPTIONS	""
-# undef  OPT_SVR4_GETMNTENT
-# undef  OPT_LOCKF_MNTENT
-# define OPT_LOCAL_MOUNT_TYPE	MNTTYPE_UFS
-# undef  OPT_OLD_RPC
-# define OPT_DEFINE_SIG_PF
-# define OPT_TAR_HAS_EXCLUDE_OPTION
-# define OPT_HAS_REALPATH
-# define OPT_AUTOMOUNT_PATH_FIX
-# define OPT_BUG_RPCINTR
-# undef  OPT_XTHREADS 
-
 #elif defined(__FreeBSD__)
-# undef  OPT_UNIX_SOCKET_RPC 
-# undef  OPT_TLI 
-# undef  OPT_DLOPEN_X11 
-# undef  OPT_DLOPEN_CE 
-# undef  OPT_ADDMSG_DIRECT 
-# undef  OPT_SECURE_RPC 
-# undef  OPT_CLASSING_ENGINE
-# undef  OPT_PATCH
-# define OPT_POSIX_SIGNAL
-# undef  OPT_BSD_WAIT
-# undef  OPT_DGETTEXT
-# define OPT_CATGETS
-# undef  OPT_GETDTABLESIZE
-# undef  OPT_SYSINFO
-# if defined(OSMAJORVERSION) && (OSMAJORVERSION >= 5)
-#  define OPT_CPP_PATH		"/usr/bin/cpp"
-# else
-#  define OPT_CPP_PATH		"/usr/libexec/cpp"
-# endif
-# define OPT_CPP_OPTIONS	""
-# undef  OPT_SVR4_GETMNTENT
-# undef  OPT_LOCKF_MNTENT
-# define OPT_LOCAL_MOUNT_TYPE	MNTTYPE_UFS
-# undef  OPT_OLD_RPC
-# define OPT_DEFINE_SIG_PF
-# define OPT_TAR_HAS_EXCLUDE_OPTION
-# define OPT_HAS_REALPATH
-# define OPT_AUTOMOUNT_PATH_FIX
-# define OPT_BUG_RPCINTR
-# undef  OPT_XTHREADS 
 # define OPT_CONST_CORRECT
 
 #elif defined(__NetBSD__)
-# undef  OPT_UNIX_SOCKET_RPC
-# undef  OPT_TLI
-# undef  OPT_DLOPEN_X11
-# undef  OPT_DLOPEN_CE
-# undef  OPT_ADDMSG_DIRECT
-# undef  OPT_SECURE_RPC
-# undef  OPT_CLASSING_ENGINE
-# undef  OPT_PATCH
-# define OPT_POSIX_SIGNAL
-# undef  OPT_BSD_WAIT
-# undef  OPT_DGETTEXT
-# define OPT_CATGETS
-# undef  OPT_GETDTABLESIZE
-# undef  OPT_SYSINFO
-# define OPT_CPP_PATH		"/usr/bin/cpp"
-# define OPT_CPP_OPTIONS	""
-# undef  OPT_SVR4_GETMNTENT
-# undef  OPT_LOCKF_MNTENT
-# define OPT_LOCAL_MOUNT_TYPE	MNTTYPE_UFS
-# undef  OPT_OLD_RPC
-# define OPT_DEFINE_SIG_PF
-# define OPT_TAR_HAS_EXCLUDE_OPTION
-# define OPT_HAS_REALPATH
-# define OPT_AUTOMOUNT_PATH_FIX
-# define OPT_BUG_RPCINTR
-# undef  OPT_XTHREADS
 # define OPT_CONST_CORRECT
 # define HAS_STATVFS
 
 #else
 /* Unknown configuration, complain */
-}}}} You must edit lib/tt_options.h and add a section defining the options for your configuration.
-
-#endif
-
-#ifdef CPP_PROGRAM
-# undef OPT_CPP_PATH
-# define OPT_CPP_PATH CPP_PROGRAM
+#warning "Your system is unknown to us, things might not build properly without editing tt_options.h"
 #endif
 
 #endif				/* _TT_OPTIONS_H */
diff --git a/cde/lib/tt/lib/util/tt_host.C b/cde/lib/tt/lib/util/tt_host.C
index d608b57e1..87342ef71 100644
--- a/cde/lib/tt/lib/util/tt_host.C
+++ b/cde/lib/tt/lib/util/tt_host.C
@@ -45,9 +45,6 @@ extern "C" in_addr_t inet_addr(const char *);
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
-#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-#include <osfcn.h>
-#endif
 
 #define X_INCLUDE_NETDB_H
 #define XOS_USE_XT_LOCKING
diff --git a/cde/lib/tt/lib/util/tt_log.C b/cde/lib/tt/lib/util/tt_log.C
index aaf4e1f36..5f8f3b2d3 100644
--- a/cde/lib/tt/lib/util/tt_log.C
+++ b/cde/lib/tt/lib/util/tt_log.C
@@ -34,9 +34,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-#include <osfcn.h>
-#endif
 
 #define X_INCLUDE_TIME_H
 #define XOS_USE_XT_LOCKING
diff --git a/cde/lib/tt/lib/util/tt_path.C b/cde/lib/tt/lib/util/tt_path.C
index 7cc309c0d..0d3df63ce 100644
--- a/cde/lib/tt/lib/util/tt_path.C
+++ b/cde/lib/tt/lib/util/tt_path.C
@@ -59,23 +59,10 @@
 #undef rindex
 #endif
 
-// Not everybody has realpath() in libc, sometimes we have to define
-// it ourselves, see realpath*.c in tt/lib
-
-#if !defined(OPT_HAS_REALPATH)
-	extern "C" { char *_tt_internal_realpath(char*, char*); }
-#endif
-
-// Use the system realpath on OS's that have it, otherwise
-// use the ToolTalk implementation of it.
 char *
 _tt_get_realpath(char  *pathname, char  *finalpath)
 {
-#ifdef OPT_HAS_REALPATH
 	return realpath(pathname, finalpath);
-#else
-	return _tt_internal_realpath(pathname, finalpath);
-#endif
 }
 
 /*
diff --git a/cde/lib/tt/lib/util/tt_string.C b/cde/lib/tt/lib/util/tt_string.C
index 8479da8a8..5d086d5ae 100644
--- a/cde/lib/tt/lib/util/tt_string.C
+++ b/cde/lib/tt/lib/util/tt_string.C
@@ -51,9 +51,7 @@
 #include <memory.h>
 #include <stdlib.h>
 #include <ctype.h>
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <wctype.h>
-#endif
 #include "util/tt_string.h"
 #include "util/tt_assert.h"
 #include "util/tt_xdr_utils.h"
diff --git a/cde/lib/tt/mini_isam/iscntl.c b/cde/lib/tt/mini_isam/iscntl.c
index f243e5345..29c65e39c 100644
--- a/cde/lib/tt/mini_isam/iscntl.c
+++ b/cde/lib/tt/mini_isam/iscntl.c
@@ -36,11 +36,7 @@
  *	Generic control function
  */
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
 #include "isam_impl.h"
 
 
@@ -76,25 +72,13 @@
 
 typedef int (* intfunc)();
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 int 
 iscntl(int isfd, int func, ...)
-#else
-int 
-iscntl(isfd, func, va_alist)
-    int			isfd;
-    int			func;
-    va_dcl
-#endif
 {
     va_list		pvar;
     int			ret;
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
     va_start(pvar, func);
-#else
-    va_start(pvar);
-#endif
     switch (func) {
 
 	  case ISCNTL_MASKSIGNALS:
diff --git a/cde/programs/dthelp/parser/canon1/helptag/global.h b/cde/programs/dthelp/parser/canon1/helptag/global.h
index 482307f02..cd62e28a9 100644
--- a/cde/programs/dthelp/parser/canon1/helptag/global.h
+++ b/cde/programs/dthelp/parser/canon1/helptag/global.h
@@ -38,11 +38,9 @@
 #include <time.h>
 #include <ctype.h>
 
-#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
 #include <unistd.h>
 #include <locale.h>
 #include <fcntl.h>
-#endif
 
 #define MAXHEADLINES 3
 #define FNAMELEN 513
@@ -170,19 +168,11 @@ struct search {
 EXTERN SEARCH *path INIT(NULL) ;
 EXTERN SEARCH **endpath INIT(&path) ;
 EXTERN char dirsep
-#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
 INIT('/')
-#else
-****define directory separator here****
-#endif
   ;
 
-#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
 #define CSEP '/'
 #define SSEP "/"
-#else
-****define directory separator here****
-#endif
 
 /* Location in .TEX file of two \wlog messages */
 EXTERN long wlog ;
diff --git a/cde/programs/dthelp/parser/canon1/helptag/help.c b/cde/programs/dthelp/parser/canon1/helptag/help.c
index ed96d7c76..4479c1619 100644
--- a/cde/programs/dthelp/parser/canon1/helptag/help.c
+++ b/cde/programs/dthelp/parser/canon1/helptag/help.c
@@ -349,10 +349,7 @@ m_free(string, "GetDefaultHeaderString return");
 /* construct a qualified file name */
 static int mb_getqualified(char *qualname, char *unqualname)
 {
-#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
-
 FILE *f;
-#endif
 char fn[FNAMELEN];
 char tokstr [ 20 ], *gp, *p, *pp, *fnp, curdir[FNAMELEN-1];
 int roomleft = FNAMELEN - 1;
@@ -374,7 +371,6 @@ else
 
 fnp = fn;
 
-#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
 qualname[0] = '\0';
 gp = qualname + strlen(qualname);
 roomleft = roomleft - strlen(qualname);
@@ -402,49 +398,6 @@ else
     strcat(qualname,SSEP);
     roomleft--;
     }
-#else
-/* if MS-DOS, force to upper case, then get drive spec */
-strupr ( fn );
-if ( fn[1] == ':' ) {
-strncpy ( qualname, fn, 2 );
-fnp += 2;
-}
-else {
-getcwd(qualname, roomleft);
-}
-qualname[2] = '\0';
-gp = qualname + strlen ( qualname );
-roomleft = roomleft - strlen ( qualname );
-/* if path is from root, tack that on, else tack on the current
- directory (for the referenced drive, if MS-DOS) */
-if ( *fnp == CSEP ) {
-strcat ( qualname, SSEP );
-roomleft--;
-++fnp;
-}
-else {
-/* assume current directory always !!! */
-*gp = CSEP;
-getcwd(curdir, FNAMELEN-1);
-if (*curdir != *qualname) {
-  m_err1("Relative directory %s for non-current drive, can't qualify",
-	  unqualname);
-  return (-1);
-  }
-if (strlen(curdir) > 3) {
-  if ((strlen(curdir+3)+1) < roomleft) {  /* "1" for SSEP */
-    strcpy( gp+1, curdir+3 );
-    strcat ( qualname, SSEP );
-    roomleft = roomleft - strlen(curdir+3) - 1;  /* "1" for SSEP */
-    }
-  else {
-    m_err1("Internal error. File name too long for qualifying: %s",
-      unqualname);
-    return (-1);
-    }
-  }
-}
-#endif
 
 strcpy(tokstr, " \r\n\t");
 strcat(tokstr, SSEP);
@@ -488,11 +441,6 @@ do  {
 while (1);
 *strrchr(qualname, CSEP) = '\0';
 
-#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
-#else
-strupr ( qualname );
-#endif
-
 return ( 0 );
 }  /* end mb_getqualified */
 
diff --git a/cde/programs/dthelp/parser/pass1/helptag/help.c b/cde/programs/dthelp/parser/pass1/helptag/help.c
index 0cbd21cea..48c43af5d 100644
--- a/cde/programs/dthelp/parser/pass1/helptag/help.c
+++ b/cde/programs/dthelp/parser/pass1/helptag/help.c
@@ -350,9 +350,7 @@ m_free(string, "GetDefaultHeaderString return");
 /* construct a qualified file name */
 static int mb_getqualified(char *qualname, char *unqualname)
 {
-#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
 FILE *f;
-#endif
 char fn[FNAMELEN];
 char tokstr [ 20 ], *gp, *p, *pp, *fnp, curdir[FNAMELEN-1];
 int roomleft = FNAMELEN - 1;
@@ -374,7 +372,6 @@ else
 
 fnp = fn;
 
-#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
 qualname[0] = '\0';
 gp = qualname + strlen(qualname);
 roomleft = roomleft - strlen(qualname);
@@ -402,49 +399,6 @@ else
     strcat(qualname,SSEP);
     roomleft--;
     }
-#else
-/* if MS-DOS, force to upper case, then get drive spec */
-strupr ( fn );
-if ( fn[1] == ':' ) {
-strncpy ( qualname, fn, 2 );
-fnp += 2;
-}
-else {
-getcwd(qualname, roomleft);
-}
-qualname[2] = '\0';
-gp = qualname + strlen ( qualname );
-roomleft = roomleft - strlen ( qualname );
-/* if path is from root, tack that on, else tack on the current
- directory (for the referenced drive, if MS-DOS) */
-if ( *fnp == CSEP ) {
-strcat ( qualname, SSEP );
-roomleft--;
-++fnp;
-}
-else {
-/* assume current directory always !!! */
-*gp = CSEP;
-getcwd(curdir, FNAMELEN-1);
-if (*curdir != *qualname) {
-  m_err1("Relative directory %s for non-current drive, can't qualify",
-	  unqualname);
-  return (-1);
-  }
-if (strlen(curdir) > 3) {
-  if ((strlen(curdir+3)+1) < roomleft) {  /* "1" for SSEP */
-    strcpy( gp+1, curdir+3 );
-    strcat ( qualname, SSEP );
-    roomleft = roomleft - strlen(curdir+3) - 1;  /* "1" for SSEP */
-    }
-  else {
-    m_err1("Internal error. File name too long for qualifying: %s",
-      unqualname);
-    return (-1);
-    }
-  }
-}
-#endif
 
 strcpy(tokstr, " \r\n\t");
 strcat(tokstr, SSEP);
@@ -488,11 +442,6 @@ do  {
 while (1);
 *strrchr(qualname, CSEP) = '\0';
 
-#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
-#else
-strupr ( qualname );
-#endif
-
 return ( 0 );
 }  /* end mb_getqualified */
 
diff --git a/cde/programs/dthelp/parser/pass2/htag2/global.h b/cde/programs/dthelp/parser/pass2/htag2/global.h
index 5816d7221..b61a16547 100644
--- a/cde/programs/dthelp/parser/pass2/htag2/global.h
+++ b/cde/programs/dthelp/parser/pass2/htag2/global.h
@@ -38,11 +38,9 @@
 #include <time.h>
 #include <ctype.h>
 
-#if defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
 #include <unistd.h>
 #include <locale.h>
 #include <fcntl.h>
-#endif
 
 #ifndef MB_MAX_LEN
 #define MB_MAX_LEN 4
diff --git a/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C b/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C
index e70c885b8..a371efca2 100644
--- a/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C
+++ b/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C
@@ -171,12 +171,7 @@ static unsigned char anno_double_bits[] = {
    0x0a, 0x20, 0xea, 0x2f, 0x0a, 0x20, 0xea, 0x2f, 0x0a, 0x20, 0xfa, 0x3f,
    0x02, 0x08, 0xfe, 0x0f, 0x00, 0x00};
 
-#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
 #include <signal.h>
-#else
-#include <sys/signal.h>
-#endif
-
 #include <unistd.h>
 #include <stdio.h>
 
diff --git a/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C b/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C
index 8464aa805..340fc8732 100644
--- a/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C
+++ b/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C
@@ -63,9 +63,6 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <unistd.h>
-#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-#include <sysent.h>
-#endif
 #include <sys/types.h>
 #include <sys/stat.h>
 
diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C b/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C
index d8b8652b6..cee1b8a47 100644
--- a/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C
+++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C
@@ -77,9 +77,7 @@
 #include <WWL/WXmPushButton.h>
 
 #include <stdlib.h>
-#if defined(SVR4) || defined(SYSV) || defined(__linux__) || defined(CSRG_BASED)
 #include <limits.h>
-#endif
 
 #define CLASS QueryTermView
 
diff --git a/cde/programs/dtinfo/dtinfo/src/Support/xList.hh b/cde/programs/dtinfo/dtinfo/src/Support/xList.hh
index a4e2159a4..f7b56d698 100644
--- a/cde/programs/dtinfo/dtinfo/src/Support/xList.hh
+++ b/cde/programs/dtinfo/dtinfo/src/Support/xList.hh
@@ -71,20 +71,12 @@ private:
 };
 
 template <class T>
-#if defined(_IBMR2) || defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 class xList : public List_base
-#else
-class xList : private List_base
-#endif
 {
 // NOTE: This friend declaration is too general because cfront
 // barfs when I do it the correct way.  22:05 22-Jul-93 DJB
 #ifdef SC3
 friend class List_Iterator<T>;
-#else
-#if !defined(_IBMR2) && !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-template <class T> friend class List_Iterator;
-#endif
 #endif
 public:
   xList() { } 
@@ -118,11 +110,7 @@ public:
 
 
 template <class T>
-#if defined(_IBMR2) || defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 class List_Iterator : public List_Iterator_base
-#else
-class List_Iterator : private List_Iterator_base
-#endif
 {
 friend class xList<T>;
 public:
diff --git a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WArgList.h b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WArgList.h
index 47f9a305f..96733a57e 100644
--- a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WArgList.h
+++ b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WArgList.h
@@ -45,13 +45,8 @@
 #define WArgList_h
 
 // Allow setting of resources by name in arg list
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #define CASTRNAM (char*)
 #define CASTVAL  (void*)(size_t)
-#else
-#define CASTRNAM
-#define CASTVAL
-#endif
 
 #define RSRC_SET(RSC,TYP,RNAM) \
    inline WArgList& RSC(TYP val) { return Add(CASTRNAM RNAM, CASTVAL val); }
diff --git a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/wwl.h b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/wwl.h
index 31632a601..4484177a7 100644
--- a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/wwl.h
+++ b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/wwl.h
@@ -45,19 +45,10 @@
 #define wwl_h
 
 // Widget Wrapper Library by:
-//
-//    ___    0  Jean-Daniel Fekete            uucp  : j...@lri.lri.fr
-//   /   \  /   LRI - Bat 490                 bitnet: jdf@FRLRI61.bitnet
-//  /   _/ /    Universite de Paris-Sud       voice : +33 (1) 69 41 65 91
-// /__   \/     F-91405 ORSAY Cedex                   +33 (1) 69 41 66 29
 
 #include <X11/Intrinsic.h>
-#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-#include <generic.h>
-#else
 #define name2(__n1,__n2)	__paste2(__n1,__n2)
 #define __paste2(__p1,__p2)	__p1##__p2
-#endif
 
 #include <Xm/Xm.h>
 #include "WXmString.h"
@@ -78,13 +69,8 @@ class WComposite;
  typedef void	(* XtProc)();
 #endif
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #define CASTRNAM (char*)
 #define CASTVAL  (void*)(size_t)
-#else
-#define CASTRNAM
-#define CASTVAL
-#endif
 
 #define	DEFINE_GETTER(rsc,typ,rnam) \
 inline typ rsc() const \
diff --git a/cde/programs/dtinfo/tools/misc/msgsets.C b/cde/programs/dtinfo/tools/misc/msgsets.C
index 639fb839f..17b2dbfbf 100644
--- a/cde/programs/dtinfo/tools/misc/msgsets.C
+++ b/cde/programs/dtinfo/tools/misc/msgsets.C
@@ -42,11 +42,7 @@
 #ifdef __cplusplus
 
 #include <stdlib.h>
-#if !defined(__DECCXX) && !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-#include <osfcn.h>
-#else
 #include <unistd.h>
-#endif
 
 /* use prototypes in function declarations */
 #define YY_USE_PROTOS
diff --git a/cde/programs/dtlogin/config/Xconfig.src b/cde/programs/dtlogin/config/Xconfig.src
index 05294ba94..6d474df3a 100644
--- a/cde/programs/dtlogin/config/Xconfig.src
+++ b/cde/programs/dtlogin/config/Xconfig.src
@@ -64,11 +64,7 @@ Dtlogin*startup:               Xstartup
 Dtlogin*reset:                 Xreset
 Dtlogin*setup:                 Xsetup
 
-#if defined (_AIX) || defined (sun) || defined(CSRG_BASED) || defined(__linux__)
 Dtlogin*failsafeClient:        Xfailsafe
-#else
-Dtlogin*failsafeClient:        /usr/bin/X11/xterm
-#endif
 
 XCOMM #########################################################################
 XCOMM To specify the system env vars to be exported to the users session
diff --git a/cde/programs/dtlogin/dm.c b/cde/programs/dtlogin/dm.c
index d81830a15..b73b24e5d 100644
--- a/cde/programs/dtlogin/dm.c
+++ b/cde/programs/dtlogin/dm.c
@@ -63,11 +63,7 @@
 # include	<time.h>
 # include	<utime.h>
 # include	<pwd.h>
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 # include	<stdarg.h>
-#else
-# include	<varargs.h>
-#endif
 
 #if defined(SYSV) || defined(SVR4) || defined(__linux__)
 #ifndef F_TLOCK
diff --git a/cde/programs/dtlogin/genauth.c b/cde/programs/dtlogin/genauth.c
index f3b192ddc..c9836bce9 100644
--- a/cde/programs/dtlogin/genauth.c
+++ b/cde/programs/dtlogin/genauth.c
@@ -213,7 +213,6 @@ bitsToBytes (unsigned long bits[2], char bytes[64])
  *  the OS's random number device.
  */
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #define READ_LIMIT (sizeof (long) * 2)
 
 static int
@@ -254,45 +253,6 @@ sumFile (char *name, long sum[2])
 
 #undef READ_LIMIT
 
-#else /* linux || CSRG_BASED */
-
-static int
-sumFile (char *name, long sum[2])
-{
-    long    buf[1024*2];
-    int	    cnt;
-    int	    fd;
-    int	    loops;
-    int	    reads;
-    int	    i;
-    int     ret_status = 0;
-
-    fd = open (name, 0);
-    if (fd < 0) {
-	LogError((unsigned char *) "Cannot open randomFile \"%s\", errno = %d\n", name, errno);
-	return 0;
-    }
-#ifdef FRAGILE_DEV_MEM
-    if (strcmp(name, "/dev/mem") == 0) lseek (fd, (off_t) 0x100000, SEEK_SET);
-#endif
-    reads = FILE_LIMIT;
-    sum[0] = 0;
-    sum[1] = 0;
-    while ((cnt = read (fd, (char *) buf, sizeof (buf))) > 0 && --reads > 0) {
-	loops = cnt / (2 * sizeof (long));
-	for (i = 0; i < loops; i+= 2) {
-	    sum[0] += buf[i];
-	    sum[1] += buf[i+1];
-	    ret_status = 1;
-	}
-    }
-    if (cnt < 0)
-	LogError((unsigned char *) "Cannot read randomFile \"%s\", errno = %d\n", name, errno);
-    close (fd);
-    return ret_status;
-}
-#endif /* linux || CSRG_BASED */
-
 void
 GenerateAuthData (char *auth, int len)
 {
diff --git a/cde/programs/dtmail/include/DtMail/Buffer.hh b/cde/programs/dtmail/include/DtMail/Buffer.hh
index 1f2232740..88d41e576 100644
--- a/cde/programs/dtmail/include/DtMail/Buffer.hh
+++ b/cde/programs/dtmail/include/DtMail/Buffer.hh
@@ -125,9 +125,6 @@ class BufferMemory : public Buffer {
 	virtual int getSize(void);      // get total size of the buffer
 
     private:
-#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
-	class Chunk;
-#endif
 
 	BufferMemory(const Buffer&);	// try and avoid copies
 	void initBuffer(int size);	// common constructor
diff --git a/cde/programs/dtmail/libDtMail/RFC/RFCTransport.C b/cde/programs/dtmail/libDtMail/RFC/RFCTransport.C
index 00ddf4633..a6e5dda99 100644
--- a/cde/programs/dtmail/libDtMail/RFC/RFCTransport.C
+++ b/cde/programs/dtmail/libDtMail/RFC/RFCTransport.C
@@ -975,14 +975,7 @@ RFCTransport::signalRegister(void)
     if (initialized) return;
     initialized = 1;
 
-#if defined(_aix) || defined(__linux__) || \
-    (defined(sun) && OSMAJORVERSION>=5 && OSMINORVERSION>4) || defined(CSRG_BASED)
-    // SunOS 5.5 and above defined prototype for signal handler
     act.sa_handler = (void (*)(int))&RFCTransport::childHandler;
-#else
-    // SunOS 5.4 and before defined prototype signal handler
-    act.sa_handler = (void (*)())&RFCTransport::childHandler;
-#endif
     sigemptyset(&act.sa_mask);
     sigaddset(&act.sa_mask, SIGCHLD);
     act.sa_flags = 0;
diff --git a/cde/programs/dtscreen/usleep.c b/cde/programs/dtscreen/usleep.c
index 834c41ab2..9dda981c3 100644
--- a/cde/programs/dtscreen/usleep.c
+++ b/cde/programs/dtscreen/usleep.c
@@ -41,22 +41,6 @@
 
 #include "dtscreen.h"
 
-#if !defined(_AIX) && !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
-int
-usleep(unsigned long usec)
-{
-#ifdef SYSV
-    poll((struct poll *) 0, (size_t) 0, usec / 1000);	/* ms resolution */
-#else
-    struct timeval timeout;
-    timeout.tv_usec = usec % (unsigned long) 1000000;
-    timeout.tv_sec = usec / (unsigned long) 1000000;
-    select(0, (void *) 0, (void *) 0, (void *) 0, &timeout);
-#endif
-    return 0;
-}
-#endif /* !_AIX && */
-
 /*
  * returns the number of seconds since 01-Jan-70.
  * This is used to control rate and timeout in many of the animations.
diff --git a/cde/programs/dtscreen/worm.c b/cde/programs/dtscreen/worm.c
index 4fce9758b..afe8aa0d9 100644
--- a/cde/programs/dtscreen/worm.c
+++ b/cde/programs/dtscreen/worm.c
@@ -88,15 +88,6 @@ typedef struct {
     int         size[MAXCOLORS];
 }           wormstruct;
 
-#if !defined(CSRG_BASED) && !defined(sun) && !defined(__linux__)
-int
-round(float x)
-{
-    return ((int) floor((double) x));
-}
-#endif
-
-
 void
 worm_doit(perwindow *pwin, wormstruct *wp, int which, unsigned long color)
 {
diff --git a/cde/programs/dtsearchpath/dtappg/Options.C b/cde/programs/dtsearchpath/dtappg/Options.C
index ffaf55e10..2752f0505 100644
--- a/cde/programs/dtsearchpath/dtappg/Options.C
+++ b/cde/programs/dtsearchpath/dtappg/Options.C
@@ -31,11 +31,7 @@
 
 #include "Options.h"
 #include <stdlib.h>
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <iostream>
-#else
-#include <iostream.h>
-#endif
 #include <stdio.h>
 #include <pwd.h>
 
diff --git a/cde/programs/dtsearchpath/dtappg/dtappgather.C b/cde/programs/dtsearchpath/dtappg/dtappgather.C
index 5ed0c8b70..beef8c26e 100644
--- a/cde/programs/dtsearchpath/dtappg/dtappgather.C
+++ b/cde/programs/dtsearchpath/dtappg/dtappgather.C
@@ -75,11 +75,7 @@
 #include "dtappgather.h"
 #include "DirIterator.h"
 #include <stdlib.h>
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <iostream>
-#else
-#include <iostream.h>
-#endif
 
 Options * options;
 
@@ -88,7 +84,7 @@ void LegacyCleanUp
 	CDEEnvironment * user
 	)
 {
-
+    //XXX:
     // For now, remove the old ApplicationManager subdirectory
     // so that we don't leave old CDE users with extra baggage
     // under $HOME.
diff --git a/cde/programs/dtsearchpath/dtsp/ManSearchPath.C b/cde/programs/dtsearchpath/dtsp/ManSearchPath.C
index 2aca2d54c..ca4b1b398 100644
--- a/cde/programs/dtsearchpath/dtsp/ManSearchPath.C
+++ b/cde/programs/dtsearchpath/dtsp/ManSearchPath.C
@@ -136,25 +136,13 @@ void ManSearchPath::Print()
     }
 }
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 std::ostream & operator<< 
 	(
 	std::ostream & os, 
 	const ManSearchPath & sp
 	)
-#else
-ostream & operator<< 
-	(
-	ostream & os, 
-	const ManSearchPath & sp
-	)
-#endif
 {
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
     os << sp.GetEnvVar() << std::endl;
-#else
-    os << sp.GetEnvVar() << endl;
-#endif
     sp.PrettyPrint(os);
     return os;
 }
diff --git a/cde/programs/dtsearchpath/dtsp/Options.C b/cde/programs/dtsearchpath/dtsp/Options.C
index 1edfcc3f9..1ef9c16bd 100644
--- a/cde/programs/dtsearchpath/dtsp/Options.C
+++ b/cde/programs/dtsearchpath/dtsp/Options.C
@@ -33,11 +33,7 @@
 
 #include "Options.h"
 #include <stdlib.h>
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <iostream>
-#else
-#include <iostream.h>
-#endif
 #include <stdio.h>
 #include <pwd.h>
 
diff --git a/cde/programs/dtsearchpath/dtsp/SearchPath.C b/cde/programs/dtsearchpath/dtsp/SearchPath.C
index 55334856d..d4838ef4b 100644
--- a/cde/programs/dtsearchpath/dtsp/SearchPath.C
+++ b/cde/programs/dtsearchpath/dtsp/SearchPath.C
@@ -387,33 +387,18 @@ void SearchPath::Print()
  *
  ****************************************************************/
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 void SearchPath::PrettyPrint
 	(
 	std::ostream & os
 	) const
-#else
-void SearchPath::PrettyPrint
-	(
-	ostream & os
-	) const
-#endif
 {
     CTokenizedString path (GetSearchPath(), Separator().data());
     CString subpath = path.next();
     while (!subpath.isNull()) {
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 	os << "        " << subpath << std::endl;
-#else
-	os << "        " << subpath << endl;
-#endif
 	subpath = path.next();
     }
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
     os << std::endl;
-#else
-    os << endl;
-#endif
 }
 
 
@@ -424,25 +409,13 @@ void SearchPath::PrettyPrint
  *
  ****************************************************************/
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 std::ostream & operator<< 
 	(
 	std::ostream & os, 
 	const SearchPath & sp
 	)
-#else
-ostream & operator<< 
-	(
-	ostream & os, 
-	const SearchPath & sp
-	)
-#endif
 {
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
     os << sp.GetEnvVar() << "SEARCHPATH:" << std::endl;
-#else
-    os << sp.GetEnvVar() << "SEARCHPATH:" << endl;
-#endif
     sp.PrettyPrint(os);
     return os;
 }
diff --git a/cde/programs/dtsearchpath/dtsp/SearchPath.h b/cde/programs/dtsearchpath/dtsp/SearchPath.h
index 841648768..a81727a7b 100644
--- a/cde/programs/dtsearchpath/dtsp/SearchPath.h
+++ b/cde/programs/dtsearchpath/dtsp/SearchPath.h
@@ -34,11 +34,7 @@
 
 #include "Environ.h"
 #include "cstring.h"
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <iostream>
-#else
-#include <iostream.h>
-#endif
 #include <stdio.h>
 
 class SearchPath {
@@ -51,15 +47,9 @@ class SearchPath {
   virtual void Print();
   virtual void AddPredefinedPath();
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
   virtual void PrettyPrint (std::ostream &) const;
 
   friend std::ostream & operator<< (std::ostream &, const SearchPath &);
-#else
-  virtual void PrettyPrint (ostream &) const;
-
-  friend ostream & operator<< (ostream &, const SearchPath &);
-#endif
 
   const char *  GetEnvVar() const    { return environment_var; }
   CString       GetSearchPath() const { return final_search_path; }
@@ -186,11 +176,7 @@ class ManSearchPath : public SearchPath {
   virtual void    ExportPath ();
   virtual void    Print();
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
   friend std::ostream & operator<< (std::ostream &, const ManSearchPath &);
-#else
-  friend ostream & operator<< (ostream &, const ManSearchPath &);
-#endif
 
  protected:
   virtual void    MakePath (const CString &);
diff --git a/cde/programs/dtsearchpath/libCliSrv/TTFile.C b/cde/programs/dtsearchpath/libCliSrv/TTFile.C
index 8349cb391..2d01f67a2 100644
--- a/cde/programs/dtsearchpath/libCliSrv/TTFile.C
+++ b/cde/programs/dtsearchpath/libCliSrv/TTFile.C
@@ -95,32 +95,15 @@ TTFile & TTFile::operator=
     return *this;
 }
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 std::ostream & operator<<
 	(
 	std::ostream & os,
 	TTFile &  file
 	)
-#else
-ostream & operator<<
-	(
-	ostream & os,
-	TTFile &  file
-	)
-#endif
 {
     if (file.ttFileOpFailed())
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 	return os << "Error in filename mapping; status = " 
 		  << file.getStatus() << std::endl;
-#else
-	return os << "Error in filename mapping; status = " 
-		  << file.getStatus() << endl;
-#endif
     else
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 	return os << file.data() << std::endl;
-#else
-	return os << file.data() << endl;
-#endif
 }
diff --git a/cde/programs/dtsearchpath/libCliSrv/TTFile.h b/cde/programs/dtsearchpath/libCliSrv/TTFile.h
index 9753fa246..fb9294ed7 100644
--- a/cde/programs/dtsearchpath/libCliSrv/TTFile.h
+++ b/cde/programs/dtsearchpath/libCliSrv/TTFile.h
@@ -65,11 +65,7 @@ class TTFile : public CString {
   };
 #else
   void TT_Exception (char *);
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
   friend std::ostream & operator<< (std::ostream &, TTFile &);
-#else
-  friend ostream & operator<< (ostream &, TTFile &);
-#endif
 #endif
 
   int  ttFileOpFailed () { return status != TT_OK; }
diff --git a/cde/programs/dtsearchpath/libCliSrv/UnixEnv.C b/cde/programs/dtsearchpath/libCliSrv/UnixEnv.C
index f3bd8d631..51a1fe9df 100644
--- a/cde/programs/dtsearchpath/libCliSrv/UnixEnv.C
+++ b/cde/programs/dtsearchpath/libCliSrv/UnixEnv.C
@@ -34,11 +34,7 @@
 #include <sys/stat.h>
 #include <stdlib.h>
 #include <string.h>
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <iostream>
-#else
-#include <iostream.h>
-#endif
 #include <stdio.h>
 #include <unistd.h>
 #include <grp.h>
@@ -50,10 +46,8 @@
 #endif
 #include <errno.h>
 
-#if defined(sun) || defined(_AIX) || defined(__linux__) || defined(CSRG_BASED)
 #define UID_NO_CHANGE ((uid_t) -1)
 #define GID_NO_CHANGE ((gid_t) -1)
-#endif
 
 UnixEnvironment::UnixEnvironment()
 {
diff --git a/cde/programs/dtsearchpath/libCliSrv/cstring.C b/cde/programs/dtsearchpath/libCliSrv/cstring.C
index 828291129..c5901c00d 100644
--- a/cde/programs/dtsearchpath/libCliSrv/cstring.C
+++ b/cde/programs/dtsearchpath/libCliSrv/cstring.C
@@ -566,19 +566,11 @@ int i;
     }
 }
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 std::ostream & operator<<
 	(
 	std::ostream &       os,
 	const CString & s
 	)
-#else
-ostream & operator<<
-	(
-	ostream &       os,
-	const CString & s
-	)
-#endif
 {
     if (s.isNull())
 	return os << "(null)";
diff --git a/cde/programs/dtsearchpath/libCliSrv/cstring.h b/cde/programs/dtsearchpath/libCliSrv/cstring.h
index e2c785238..b9aed7b52 100644
--- a/cde/programs/dtsearchpath/libCliSrv/cstring.h
+++ b/cde/programs/dtsearchpath/libCliSrv/cstring.h
@@ -32,11 +32,7 @@
 #ifndef _CSTRING_H_
 #define _CSTRING_H_
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <iostream>
-#else
-#include <iostream.h>
-#endif
 #include <string.h>
 
 class CString {
@@ -72,11 +68,7 @@ class CString {
   int       isNull() const;
   void      replace (const CString &, const CString &);
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
   friend std::ostream & operator<< (std::ostream &, const CString &);
-#else
-  friend ostream & operator<< (ostream &, const CString &);
-#endif
 
  protected:
   char *        contents;
diff --git a/cde/programs/dtsession/Makefile.am b/cde/programs/dtsession/Makefile.am
index bc8830826..22834c7a1 100644
--- a/cde/programs/dtsession/Makefile.am
+++ b/cde/programs/dtsession/Makefile.am
@@ -65,7 +65,6 @@ endif
 
 if FREEBSD
 LOCAL_CPP_DEFINES += -DFREEBSD -D__FreeBSD__
-SUBDIRS += config
 endif
 
 if SOLARIS
@@ -78,7 +77,6 @@ endif
 
 if NETBSD
 LOCAL_CPP_DEFINES += -D__NetBSD__
-SUBDIRS += config
 endif
 
 if BSD
diff --git a/cde/programs/dtudcfonted/libfuty/getfname.c b/cde/programs/dtudcfonted/libfuty/getfname.c
index 167a3135b..36f6cbf52 100644
--- a/cde/programs/dtudcfonted/libfuty/getfname.c
+++ b/cde/programs/dtudcfonted/libfuty/getfname.c
@@ -945,11 +945,7 @@ GetUdcFontName(
 {
 	FILE	*fp ;
 	pid_t	chld_pid = 0;
-#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || defined(__linux__)
 	int	chld_stat ;
-#else
-	union	wait	chld_stat ;
-#endif
 	struct	ptobhead head ;
 	char	*p, *tmp_font ;
 	char	readbuf[BUFSIZE], fntbuf[BUFSIZE] ;
diff --git a/cde/programs/dtudcfonted/libfuty/oakfuty.c b/cde/programs/dtudcfonted/libfuty/oakfuty.c
index a10d3ed37..49e91a05b 100644
--- a/cde/programs/dtudcfonted/libfuty/oakfuty.c
+++ b/cde/programs/dtudcfonted/libfuty/oakfuty.c
@@ -163,12 +163,7 @@ WriteBdfHeader( struct ptobhead *head )
 	char  buf[BUFSIZE], *p;
 
 	pid_t	chld_pid = 0;
-#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || defined(__linux__)
 	int	chld_stat ;
-#else
-	union	wait	chld_stat ;
-#endif
-
 
 	if (head->snf_file != NULL) {
 		if (pipe(fd) != 0) {
diff --git a/cde/programs/dtwm/WmFunction.c b/cde/programs/dtwm/WmFunction.c
index 869b9a2fa..534e006ef 100644
--- a/cde/programs/dtwm/WmFunction.c
+++ b/cde/programs/dtwm/WmFunction.c
@@ -98,7 +98,7 @@ extern XmMenuState _XmGetMenuState();
 
 static unsigned int GetEventInverseMask(XEvent *event);
 
-#if (defined(__linux__) || defined(sun) || defined(CSRG_BASED)) && !defined(_NFILE)
+#if !defined(_NFILE)
 #define _NFILE FOPEN_MAX
 #endif
 
diff --git a/cde/programs/localized/templates/French.am b/cde/programs/localized/templates/French.am
index 8ba41d1e7..c2a4b35f4 100644
--- a/cde/programs/localized/templates/French.am
+++ b/cde/programs/localized/templates/French.am
@@ -3,12 +3,6 @@
 
 if SOLARIS
 LANG=fr
-endif
-
-if LINUX
-LANG=fr_FR.UTF-8
-endif
-
-if BSD
+else
 LANG=fr_FR.UTF-8
 endif
diff --git a/cde/programs/localized/templates/German.am b/cde/programs/localized/templates/German.am
index dc3dbf200..57cf3ff0e 100644
--- a/cde/programs/localized/templates/German.am
+++ b/cde/programs/localized/templates/German.am
@@ -3,12 +3,6 @@
 
 if SOLARIS
 LANG=de
-endif
-
-if LINUX
-LANG=de_DE.UTF-8
-endif
-
-if BSD
+else
 LANG=de_DE.UTF-8
 endif
diff --git a/cde/programs/localized/templates/Italian.am b/cde/programs/localized/templates/Italian.am
index 205330944..e4d6746bd 100644
--- a/cde/programs/localized/templates/Italian.am
+++ b/cde/programs/localized/templates/Italian.am
@@ -3,12 +3,6 @@
 
 if SOLARIS
 LANG=it
-endif
-
-if LINUX
-LANG=it_IT.UTF-8
-endif
-
-if BSD
+else
 LANG=it_IT.UTF-8
 endif
diff --git a/cde/programs/localized/templates/Japanese.am b/cde/programs/localized/templates/Japanese.am
index 433cfd2b8..99028fd9a 100644
--- a/cde/programs/localized/templates/Japanese.am
+++ b/cde/programs/localized/templates/Japanese.am
@@ -3,12 +3,6 @@
 
 if SOLARIS
 LANG=ja
-endif
-
-if LINUX
-LANG=ja_JP.UTF-8
-endif
-
-if BSD
+else
 LANG=ja_JP.UTF-8
 endif
diff --git a/cde/programs/localized/templates/Spanish.am b/cde/programs/localized/templates/Spanish.am
index 4e4c2efac..2678c7492 100644
--- a/cde/programs/localized/templates/Spanish.am
+++ b/cde/programs/localized/templates/Spanish.am
@@ -3,12 +3,6 @@
 
 if SOLARIS
 LANG=es
-endif
-
-if LINUX
-LANG=es_ES.UTF-8
-endif
-
-if BSD
+else
 LANG=es_ES.UTF-8
 endif
diff --git a/cde/programs/ttsnoop/tt_c++.h b/cde/programs/ttsnoop/tt_c++.h
index a7af12ac0..c5c0165c3 100644
--- a/cde/programs/ttsnoop/tt_c++.h
+++ b/cde/programs/ttsnoop/tt_c++.h
@@ -29,12 +29,8 @@
 #ifndef TT_CXX_H
 #define TT_CXX_H
 
-#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
 #include <iostream>
 using namespace std;
-#else
-#include <iostream.h>
-#endif
 
 #include <Tt/tt_c.h>
 
diff --git a/cde/programs/ttsnoop/ttsnoop.C.src b/cde/programs/ttsnoop/ttsnoop.C.src
index f9a590241..2173edfdc 100644
--- a/cde/programs/ttsnoop/ttsnoop.C.src
+++ b/cde/programs/ttsnoop/ttsnoop.C.src
@@ -190,12 +190,10 @@ signalHandler(
 	}
 }
 
-#if defined(SVR4) || defined(aix) || defined(__linux__) || defined(CSRG_BASED)
 #if !defined(SIG_PF)
 typedef void (*sig_pf_t)(int);
 #define SIG_PF sig_pf_t
 #endif
-#endif
 
 int
 _tt_sigset(
-- 
2.34.1

_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to