This patch disables building nsgmls on linux in favor of the system built-in 
onsgmls, I finally ironed out the error with dtinfogen and now everything 
generates normally, once this code is also suited for the bsds and solaris, we 
can remove nsgmls from the repo entirely.

Thank you for your time,
-Chase
From 303183fe6f0c0abf5ee59b819940d11e53e8c635 Mon Sep 17 00:00:00 2001
From: chase <ch...@localhost.com>
Date: Wed, 26 Sep 2018 21:03:35 -0500
Subject: [PATCH] Disable building nsgmls on linux

---
 cde/config/cf/cde.tmpl                        | 13 ++-
 cde/doc/util/dbtoman/dbtoman                  | 16 ++--
 cde/programs/Imakefile                        | 16 +---
 .../dtinfogen/infolib/etc/dtinfogen_worker.c  | 79 ++++++-------------
 4 files changed, 39 insertions(+), 85 deletions(-)

diff --git a/cde/config/cf/cde.tmpl b/cde/config/cf/cde.tmpl
index 65a01992..50cc2295 100644
--- a/cde/config/cf/cde.tmpl
+++ b/cde/config/cf/cde.tmpl
@@ -237,11 +237,12 @@ XCOMM $XConsortium: cde.tmpl /main/2 1996/12/04 10:13:09 swick $
 
 #ifndef SGMLParser
 # if UseNSGMLS
-#  define SGMLDir $(NSGMLSSRC)
-#  define SGMLParser $(NSGMLSSRC)/nsgmls
-# else
-#  define SGMLDir $(SGMLSSRC)
-#  define SGMLParser $(SGMLSSRC)/sgmls
+#  if !defined(__linux__)
+#   define SGMLDir $(NSGMLSSRC)
+#   define SGMLParser $(NSGMLSSRC)/nsgmls
+#  else
+#   define SGMLParser /usr/bin/onsgmls
+#  endif
 # endif
 #endif
 
@@ -311,8 +312,6 @@ CDE_CONFIGURATION_TOP = CdeConfigurationTop
  DTDOCBOOKOPTIONS = DtDocBookOptions
 #if UseNSGMLS
         NSGMLSSRC = $(CDESRC)/nsgmls
-#else
-         SGMLSSRC = $(CDESRC)/dtdocbook/sgmls
 #endif
      DTINFOGENSRC = $(CDESRC)/dtinfo/dtinfogen
         DTINFOGEN = DtInfoGen
diff --git a/cde/doc/util/dbtoman/dbtoman b/cde/doc/util/dbtoman/dbtoman
index a76d41d3..2417b0be 100755
--- a/cde/doc/util/dbtoman/dbtoman
+++ b/cde/doc/util/dbtoman/dbtoman
@@ -31,7 +31,7 @@
 # Dalrymple Consulting shall not be used in advertising or otherwise to
 # promote the sale, use or other dealings in this Software without prior
 # written authorization.
-# 
+#
 
 trap "rm -f /tmp/dtm.$$.psinc /tmp/dtm.$$.out1 /tmp/dtm.$$.out2" 0 1 2 3 4 5 6 7 8 10 12 15
 
@@ -40,18 +40,16 @@ SGML=$CDETOP/programs/dtdocbook/doc2sdl/SGML
 TPT_LIB=$CDETOP/doc/util/dbtoman/transpec
 export TPT_LIB
 
-PARSER=$CDETOP/programs/nsgmls/nsgmls
-if [ -x $PARSER ]
+if [ $(uname) != "Linux" ]
 then
+PARSER=$CDETOP/programs/nsgmls/nsgmls
+else
+PARSER=/usr/bin/onsgmls
+fi
 PARSER_OPTS="-g -oline -wno-idref"
 SGML_CATALOG_FILES="$SGML/catalog"
 export SGML_CATALOG_FILES
-else
-PARSER=$CDETOP/programs/dtdocbook/sgmls/sgmls
-PARSER_OPTS="-gl"
-SGML_PATH="$SGML/%P:$SGML/%S:%S"
-export SGML_PATH
-fi
+
 INSTANT=$CDETOP/doc/util/dbtoman/instant/instant
 INSTANT_OPT=-d
 
diff --git a/cde/programs/Imakefile b/cde/programs/Imakefile
index 72f2224d..494b9154 100644
--- a/cde/programs/Imakefile
+++ b/cde/programs/Imakefile
@@ -2,21 +2,11 @@ XCOMM $XConsortium: Imakefile /main/17 1996/10/06 17:13:20 rws $
 #define IHaveSubdirs
 #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
 
-#if UseNSGMLS
+#if !defined(__linux__)
 NSGMLSDIR = nsgmls
 #endif
 EXTRADIRS = types localized tttypes $(NSGMLSDIR) util dtopen
 
-XCOMM some of these cannot be built on linux yet.
-XCOMM dtinfo
-#if defined(LinuxArchitecture)
-DTINFODIR = dtinfo
-#elif defined(BSDArchitecture)
-DTINFODIR = dtinfo
-#else
-DTINFODIR = dtinfo
-#endif
-
 
 SUBDIRS = dthelp dsdm dtmail dtpad dtfile dtwm dtlogin \
 	dtsession dthello dtstyle dtexec dtdbcache dticon dtterm \
@@ -25,7 +15,7 @@ SUBDIRS = dthelp dsdm dtmail dtpad dtfile dtwm dtlogin \
         dtappbuilder dtappintegrate dtprintegrate dtconfig \
         dtcreate dtprintinfo fontaliases dtdspmsg ttsnoop \
 	dtudcfonted dtudcexch dtimsstart dtdocbook dtpdm dtsr \
-	dtpdmd $(DTINFODIR) $(EXTRADIRS)
+	dtpdmd dtinfo $(EXTRADIRS)
 
 LINTSUBDIRS = dthelp dsdm dtmail dtpad dtfile dtwm dtlogin \
 	dtsession dthello dtstyle dtexec dtdbcache dticon dtterm \
@@ -33,7 +23,7 @@ LINTSUBDIRS = dthelp dsdm dtmail dtpad dtfile dtwm dtlogin \
 	dtscreen dtksh dtcm dtsearchpath \
         dtappbuilder dtappintegrate dtprintegrate dtprintinfo dtdspmsg \
 	dtudcfonted dtudcexch dtimsstart dtdocbook dtpdm dtsr \
-	dtpdmd $(DTINFODIR) $(EXTRADIRS)
+	dtpdmd dtinfo $(EXTRADIRS)
 
 MakeSubdirs($(SUBDIRS))
 DependSubdirs($(SUBDIRS))
diff --git a/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c b/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c
index f3218647..f6baf91d 100644
--- a/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c
+++ b/cde/programs/dtinfo/dtinfogen/infolib/etc/dtinfogen_worker.c
@@ -1094,10 +1094,9 @@ defaultGlobals(void)
 
     gStruct->dirMode = 0775;
     gStruct->searchEngine = "dtsearch";
+#if !defined(__linux__)
     gStruct->parser = "nsgmls";
-    if (!testExec(gStruct->parser, False))
-	gStruct->parser = "sgmls";
-
+#endif
     gStruct->keepWorkDir = False;
     gStruct->workDir = (char *)NULL;
 
@@ -1142,7 +1141,9 @@ checkGlobals(void)
     checkExec("NodeParser");
     checkExec("StyleUpdate");
     checkExec("valBase");
+#if !defined(__linux__)
     checkExec(gStruct->parser);
+#endif
     if (strcmp(gStruct->searchEngine, "dtsearch") == 0)
     {
 	checkExec("dtsrcreate");
@@ -1172,7 +1173,6 @@ checkGlobals(void)
 static void
 addCatFile(char *catalog, Bool needed)
 {
-    Boolean parserIsNSGMLS;
     char pathBuf[(2 * MAXPATHLEN) + 10];
     char *ptr1, *ptr2;
     int catlen;
@@ -1183,31 +1183,12 @@ addCatFile(char *catalog, Bool needed)
 	dieRWD(-1, "%s: %s: %s\n",
 	       EXEC_NAME, catalog, strerror(errno));
     }
-    parserIsNSGMLS = (strcmp(gStruct->parser, "nsgmls") == 0);
-    if (parserIsNSGMLS)
-    {
-	ptr1 = makeAbsPathStr(catalog);
-	snprintf(pathBuf, sizeof(pathBuf), "-c%s ", ptr1);
-	appendStr(&gStruct->sgmlCatFiles, &gStruct->sgmlCatFilesLen,
-		  &gStruct->sgmlCatFilesMaxLen, pathBuf);
-	XtFree(ptr1);
-    }
-    else
-    {
-	ptr1 = strrchr(catalog, '/');
-	catlen = strlen(catalog);
-	if (ptr1)
-	    catlen -= strlen(ptr1);
-	snprintf(pathBuf, sizeof(pathBuf), "%.*s/%%P:%.*s/%%S",
-				catlen, catalog, catlen, catalog);
-	ptr1 = makeAbsPathStr(pathBuf);
-	ptr2 = addToEnv("SGML_PATH", ptr1, False);
-	if (gStruct->sgmlPathEnv)
-	    XtFree(gStruct->sgmlPathEnv);
-	if (ptr1)
-	    XtFree(ptr1);
-	gStruct->sgmlPathEnv = ptr2;
-    }
+
+    ptr1 = makeAbsPathStr(catalog);
+    snprintf(pathBuf, sizeof(pathBuf), "-c%s ", ptr1);
+    appendStr(&gStruct->sgmlCatFiles, &gStruct->sgmlCatFilesLen,
+              &gStruct->sgmlCatFilesMaxLen, pathBuf);
+    XtFree(ptr1);
 }
 
 static int
@@ -1342,7 +1323,11 @@ parseArgs(int argc, char *argv[])
 	else if (strcmp(argv[i], "-parser") == 0)
 	{
 	    if (++i < argc)
+		{
+#if !defined(__linux__)
 		gStruct->parser = argv[i];
+#endif
+		}
 	}
 	else
 	{
@@ -1362,9 +1347,6 @@ parseDocument(int runCmd, ...)
     char *cmd = (char *)NULL;
     int cmdLen = 0;
     int maxLen = 0;
-    Boolean parserIsNSGMLS;
-
-    parserIsNSGMLS = (strcmp(gStruct->parser, "nsgmls") == 0);
 
     if (!checkStat(gStruct->sgml, FSTAT_IS_DIR | FSTAT_IS_READABLE))
 	dieRWD(-1, "%s: faulty installation: %s\n",
@@ -1375,33 +1357,21 @@ parseDocument(int runCmd, ...)
     addCatFile(buildPath("%s/infolib/%s/SGML/catalog",
 			 STR(gStruct->install), LANG_COMMON), True);
 
-    if (parserIsNSGMLS)
-    {
-	if (!gStruct->sgmlSearchPathEnv)
-	    gStruct->sgmlSearchPathEnv = addToEnv("SGML_SEARCH_PATH", ".", False);
-    }
-    else
-    {
-	ptr = addToEnv("SGML_PATH", "%S", False);
-	if (gStruct->sgmlPathEnv)
-	    XtFree(gStruct->sgmlPathEnv);
-	gStruct->sgmlPathEnv = ptr;
-    }
+    if (!gStruct->sgmlSearchPathEnv)
+	gStruct->sgmlSearchPathEnv = addToEnv("SGML_SEARCH_PATH", ".", False);
 
+#if !defined(__linux__)
     appendStr(&cmd, &cmdLen, &maxLen, gStruct->parser);
-
-    if (parserIsNSGMLS) {
-	appendStr(&cmd, &cmdLen, &maxLen, " -bidentity ");
-	appendStr(&cmd, &cmdLen, &maxLen, gStruct->sgmlCatFiles);
-    }
+#else
+    appendStr(&cmd, &cmdLen, &maxLen, "/usr/bin/onsgmls");
+#endif
+    appendStr(&cmd, &cmdLen, &maxLen, " -bidentity ");
+    appendStr(&cmd, &cmdLen, &maxLen, gStruct->sgmlCatFiles);
 
     if (runCmd)
     {
 	appendStr(&cmd, &cmdLen, &maxLen, " -sg ");
 
-	if (! parserIsNSGMLS)
-	    appendStr(&cmd, &cmdLen, &maxLen, gStruct->decl);
-
 	va_start(ap, runCmd);
 	while ((ptr = va_arg(ap, char *)) != 0)
 	{
@@ -1415,10 +1385,7 @@ parseDocument(int runCmd, ...)
 	return (char *)NULL;
     }
 
-    if (parserIsNSGMLS)
-	appendStr(&cmd, &cmdLen, &maxLen, "-oline -wno-idref ");
-    else
-	appendStr(&cmd, &cmdLen, &maxLen, " -l ");
+    appendStr(&cmd, &cmdLen, &maxLen, "-oline -wno-idref ");
 
     appendStr(&cmd, &cmdLen, &maxLen, gStruct->decl);
     va_start(ap, runCmd);
-- 
2.17.1

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

Reply via email to