1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dthelp/parser/pass1: get it to build

So this is going to be tricky/painful getting this parser fully
operational.  It's pretty hairy with various interdependencies and
generated code.

It's rather complicated how each sub dir depends on the previous one.
Also, the parser subdir has dependencies on the helptag subdir, and
vice-versa, so some hackery was needed to get that to work.

Due to the wierd interdepencencies between helptag and parser,
we disable parallel builds there.

This is some really horrible code and design - not surprising since it
dates to 1989.

I think it should just be removed -- who can maintain or refactor this
code?

Also, dthelp_htag1 is now built in pass1/parser/, not in
pass1/helptag/ as it used to be.
This commit is contained in:
Jon Trulson 2020-04-15 11:34:01 -06:00
parent 349802ddd3
commit 6da55905ec
10 changed files with 135 additions and 118 deletions

6
cde/.gitignore vendored
View file

@ -10,8 +10,9 @@
*~ *~
.depend .depend
# flags for saying directory is complete # flags for saying directory/target is complete
DONE DONE
?DONE
# imports of of headers # imports of of headers
imports/x11 imports/x11
@ -590,13 +591,12 @@ programs/dthelp/parser/pass1/eltdef/stfile.c
programs/dthelp/parser/pass1/eltdef/tfile.c programs/dthelp/parser/pass1/eltdef/tfile.c
programs/dthelp/parser/pass1/helptag/LocaleXlate.c programs/dthelp/parser/pass1/helptag/LocaleXlate.c
programs/dthelp/parser/pass1/helptag/XlationSvc.c programs/dthelp/parser/pass1/helptag/XlationSvc.c
programs/dthelp/parser/pass1/helptag/dthelp_htag1
programs/dthelp/parser/pass1/parser/case.c programs/dthelp/parser/pass1/parser/case.c
programs/dthelp/parser/pass1/parser/context.h programs/dthelp/parser/pass1/parser/context.h
programs/dthelp/parser/pass1/parser/delim.dat programs/dthelp/parser/pass1/parser/delim.dat
programs/dthelp/parser/pass1/parser/delim.h programs/dthelp/parser/pass1/parser/delim.h
programs/dthelp/parser/pass1/parser/error programs/dthelp/parser/pass1/parser/error
programs/dthelp/parser/pass1/parser/parser programs/dthelp/parser/pass1/parser/dthelp_htag1
programs/dthelp/parser/pass1/util/context programs/dthelp/parser/pass1/util/context
programs/dthelp/parser/pass1/util/fclndir programs/dthelp/parser/pass1/util/fclndir
programs/dthelp/parser/pass2/build/arc.h programs/dthelp/parser/pass2/build/arc.h

View file

@ -9,7 +9,7 @@ DIE=0
libtoolize --force --automake libtoolize --force --automake
aclocal -I admin aclocal -I admin
autoconf autoconf -f
autoheader autoheader
automake --foreign --include-deps --add-missing automake --foreign --include-deps --add-missing

View file

@ -514,6 +514,13 @@ programs/dthelp/dthelpview/Makefile
programs/dthelp/dthelpgen/Makefile programs/dthelp/dthelpgen/Makefile
programs/dthelp/dthelpdemo/Makefile programs/dthelp/dthelpdemo/Makefile
programs/dthelp/dthelpprint/Makefile programs/dthelp/dthelpprint/Makefile
programs/dthelp/parser/Makefile
programs/dthelp/parser/pass1/Makefile
programs/dthelp/parser/pass1/util/Makefile
programs/dthelp/parser/pass1/build/Makefile
programs/dthelp/parser/pass1/eltdef/Makefile
programs/dthelp/parser/pass1/helptag/Makefile
programs/dthelp/parser/pass1/parser/Makefile
programs/nsgmls/Makefile programs/nsgmls/Makefile
@ -659,9 +666,6 @@ programs/localized/es_ES.UTF-8/appmanager/Makefile
AC_OUTPUT AC_OUTPUT
dnl not currently building dnl not currently building
dnl programs/dthelp/Makefile
dnl programs/dthelp/dthelpgen/Makefile
dnl programs/dthelp/dthelpprint/Makefile
dnl programs/dthelp/parser/pass1/helptag/Makefile dnl programs/dthelp/parser/pass1/helptag/Makefile
dnl programs/dthelp/parser/pass1/Makefile dnl programs/dthelp/parser/pass1/Makefile
dnl programs/dthelp/parser/pass1/eltdef/Makefile dnl programs/dthelp/parser/pass1/eltdef/Makefile
@ -669,4 +673,3 @@ dnl programs/dthelp/parser/pass1/build/Makefile
dnl programs/dthelp/parser/Makefile dnl programs/dthelp/parser/Makefile
dnl programs/dthelp/parser/canon1/Makefile dnl programs/dthelp/parser/canon1/Makefile
dnl programs/dthelp/parser/pass2/Makefile dnl programs/dthelp/parser/pass2/Makefile
dnl programs/dthelp/dthelpview/Makefile

View file

@ -1,5 +1,4 @@
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = dthelpview dthelpgen dthelpdemo dthelpprint SUBDIRS = dthelpview dthelpgen dthelpdemo dthelpprint parser
#NOTYET = parser

View file

@ -1,3 +1,5 @@
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = pass1 canon1 pass2 helptag misc dtds SUBDIRS = pass1
#NOTYET canon1 pass2 helptag misc dtds

View file

@ -2,10 +2,6 @@ MAINTAINERCLEANFILES = Makefile.in
noinst_PROGRAMS = build noinst_PROGRAMS = build
ARCCMD = arc u
UNARCCMD = arc x
ARCDELCMD = arc d
HELPTAG = .. HELPTAG = ..
HELPTAGSRC = $(HELPTAG)/helptag HELPTAGSRC = $(HELPTAG)/helptag
HELPPARSERSRC = $(HELPTAG)/parser HELPPARSERSRC = $(HELPTAG)/parser
@ -17,15 +13,7 @@ HELPUTILLIB = $(HELPTAG)/util/libutil.a
build_CFLAGS = -I$(HELPUTILSRC) build_CFLAGS = -I$(HELPUTILSRC)
build_LDADD = -l$(HELPUTILLIB) build_LDADD = ../util/libutil.a
if HPUX
build_LDFLAGS = -Wl,-a archive
endif
if SOLARIS
.NO_PARALLEL:
endif
build_SOURCES = build.c buildutl.c eltree.c except.c fsa.c out.c param.c \ build_SOURCES = build.c buildutl.c eltree.c except.c fsa.c out.c param.c \
scan.c sref.c tree.c scan.c sref.c tree.c
@ -43,28 +31,25 @@ CPRODS = $(CHPRODS) $(CCPRODS)
BPRODS = $(BHPRODS) $(BCPRODS) BPRODS = $(BHPRODS) $(BCPRODS)
TRASH = error delim.dat template TRASH = error delim.dat template
PRODUCTS = $(CPRODS) $(BPRODS) BUILT_SOURCES = $(CPRODS) $(BPRODS)
CLEANFILES = $(BUILT_SOURCES) $(TRASH) BDONE CDONE
all:: $(PRODUCTS) # We want the commands that actually create BPRODS and CPRODS to only
# run once during a make so we gate them using these CDONE and BDONE
# targets. This allows us to enable parallel building too.
$(BPRODS): BDONE
$(BPRODS): build $(HELPDTDFILE) $(CPRODS): CDONE
$(RM) $(BPRODS) $(BTRASH)
./build < $(HELPDTDFILE)
$(CPRODS): $(HELPUTILSRC)/context $(HELPTAGSRC)/delim.bld context.dat # build the BRPODS
BDONE: ./build $(HELPDTDFILE)
$(RM) $(BPRODS) $(BTRASH) && ./build < $(HELPDTDFILE) && touch BDONE
# build the CRPODS
CDONE: $(HELPUTILSRC)/context $(HELPTAGSRC)/delim.bld context.dat
$(RM) $(CPRODS) $(CTRASH) $(RM) $(CPRODS) $(CTRASH)
$(CP) $(HELPTAGSRC)/delim.bld delim.dat # appl.-specific delim.dat $(CP) $(HELPTAGSRC)/delim.bld delim.dat # appl.-specific delim.dat
$(HELPUTILSRC)/context sparse $(HELPUTILSRC)/context sparse
touch CDONE
$(HELPUTILSRC)/context:
cd $(HELPUTILSRC); make context
arc package :
if exist util.arc $(CP) build.arc old.arc
$(ARCCMD) util.arc *.c *.h makefile
unarc dearc :
$(UNARCCMD) util.arc
clean::
$(RM) $(PRODUCTS) $(TRASH)

View file

@ -2,10 +2,6 @@ MAINTAINERCLEANFILES = Makefile.in
noinst_PROGRAMS = eltdef noinst_PROGRAMS = eltdef
ARCCMD = arc u
UNARCCMD = arc x
ARCDELCMD = arc d
HELPTAG = .. HELPTAG = ..
HELPTAGSRC = $(HELPTAG)/helptag HELPTAGSRC = $(HELPTAG)/helptag
HELPPARSERSRC = $(HELPTAG)/parser HELPPARSERSRC = $(HELPTAG)/parser
@ -17,15 +13,7 @@ HELPUTILLIB = $(HELPTAG)/util/libutil.a
HELPIFFILE = $(HELPTAGSRC)/help.if HELPIFFILE = $(HELPTAGSRC)/help.if
HELPTSSFILE = $(HELPTAGSRC)/htag.tss HELPTSSFILE = $(HELPTAGSRC)/htag.tss
eltdef_LDADD = -l$(HELPUTILLIB) eltdef_LDADD = $(HELPUTILLIB)
if HPUX
eltdef_LDFLAGS = -Wl,-a archive
endif
if SOLARIS
.NO_PARALLEL:
endif
eltdef_CFLAGS = -I$(HELPUTILSRC) -I$(HELPBUILDSRC) eltdef_CFLAGS = -I$(HELPUTILSRC) -I$(HELPBUILDSRC)
@ -44,28 +32,22 @@ CTRASH = delim.dat error
ETRASH = estring.h error ETRASH = estring.h error
TRASH = delim.dat estring.h error TRASH = delim.dat estring.h error
PRODUCTS = $(CPRODS) $(EPRODS) BUILT_SOURCES = $(CPRODS) $(EPRODS)
CLEANFILES = $(BUILT_SOURCES) $(TRASH) CDONE EDONE
all:: $(PRODUCTS) $(CPRODS): CDONE
$(EPRODS): eltdef $(HELPIFFILE) $(HELPTSSFILE) $(EPRODS): EDONE
EDONE: eltdef $(HELPIFFILE) $(HELPTSSFILE)
$(RM) $(EPRODS) $(ETRASH) $(RM) $(EPRODS) $(ETRASH)
./eltdef $(HELPIFFILE) ./eltdef $(HELPIFFILE)
touch EDONE
$(CPRODS): $(HELPUTILSRC)/context $(HELPTAGSRC)/delim.elt context.dat CDONE: $(HELPUTILSRC)/context $(HELPTAGSRC)/delim.elt context.dat
$(RM) $(CPRODS) $(CTRASH) $(RM) $(CPRODS) $(CTRASH)
$(CP) $(HELPTAGSRC)/delim.elt delim.dat # appl.-specific delim.dat $(CP) $(HELPTAGSRC)/delim.elt delim.dat # appl.-specific delim.dat
$(HELPUTILSRC)/context $(HELPUTILSRC)/context
touch CDONE
$(HELPUTILSRC)/context:
cd $(HELPUTILSRC); make context
arc package :
if exist util.arc $(CP) build.arc old.arc
$(ARCCMD) util.arc *.c *.h makefile
unarc dearc :
$(UNARCCMD) util.arc
clean::
$(RM) $(PRODUCTS) $(TRASH)

View file

@ -1,10 +1,9 @@
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = dthelp_htag1 # Due to the wierd interdepencencies between helptag and parser,
# disable parallel builds here. This is some really horrible code and
ARCCMD = arc u # design - not surprising since it dates to 1989.
UNARCCMD = arc x .NOTPARALLEL:
ARCDELCMD = arc d
HELPTAG = .. HELPTAG = ..
HELPTAGSRC = $(HELPTAG)/helptag HELPTAGSRC = $(HELPTAG)/helptag
@ -17,51 +16,28 @@ HELPUTILLIB = $(HELPTAG)/util/libutil.a
HELPIFFILE = $(HELPTAGSRC)/help.if HELPIFFILE = $(HELPTAGSRC)/help.if
HELPTSSFILE = $(HELPTAGSRC)/htag.tss HELPTSSFILE = $(HELPTAGSRC)/htag.tss
XLATESRC = $(DTHELPSRC) XLATESRCS = XlationSvc.c LocaleXlate.c
XLATEHDRS = $(XLATESRC)/XlationSvc.h $(XLATESRC)/LocaleXlate.h
XLATESRCS = ${top_srcdir}/lib/DtSvc/DtUtil2/XlationSvc.c \
${top_srcdir}/lib/DtSvc/DtUtil2/LocaleXlate.c
ELTHDRS = $(HELPUTILSRC)/entdef.h $(HELPUTILSRC)/entext.h XLATESRCDIR = ${top_srcdir}/lib/DtSvc/DtUtil2
# PARSEHDRS are header files used by many parser routines $(XLATESRCS): XDONE
PARSEHDRS = $(HELPUTILSRC)/basic.h $(HELPUTILSRC)/trie.h \
$(HELPUTILSRC)/common.h $(HELPUTILSRC)/dtddef.h \
$(HELPUTILSRC)/dtdext.h $(HELPUTILSRC)/sparse.h \
parser.h proto.h
APPLHDRS = $(PARSEHDRS) $(ELTHDRS) \ XDONE: $(XLATESRCDIR)/XlationSvc.c $(XLATESRCDIR)/LocaleXlate.c
$(HELPUTILSRC)/version.h \ $(RM) $(XLATESRCS)
$(HELPTAGSRC)/global.h $(HELPTAGSRC)/charconv.h \ $(CP) $(XLATESRCDIR)/XlationSvc.c XlationSvc.c
$(HELPTAGSRC)/roman8.h $(HELPTAGSRC)/fproto.h \ $(CP) $(XLATESRCDIR)/LocaleXlate.c LocaleXlate.c
../parser/pval.h ../parser/globdec.h ../parser/signonx.h \ cd ../parser; $(MAKE) CDONE
../parser/userinc.h touch XDONE
dthelp_htag1_CFLAGS = -I$(HELPUTILSRC) -I$(HELPPARSERSRC) -I$(HELPELTDEFSRC) \ BUILT_SOURCES = $(XLATESRCS)
-I$(XLATESRC) CLEANFILES = $(BUILT_SOURCES) XDONE
dthelp_htag1_LDADD = $(HELPUTILLIB) AM_CPPFLAGS = -I. -I$(HELPPARSERSRC) -I$(HELPUTILSRC) \
-I$(HELPELTDEFSRC) -I$(XLATESRCDIR) $(DT_INCDIR)
if HPUX # needed by parser/
dthelp_htag1_LDFLAGS = -Wl,-a archive noinst_LIBRARIES = libhelptag.a
endif libhelptag_a_SOURCES = custom.c default.c help.c make.c option.c \
special.c out.c xref.c $(XLATESRCS) \
if SOLARIS ../parser/delim.h
dthelp_htag1_LDADD += -lm -ldl -lgen
endif
dthelp_htag1_SOURCES = custom.c default.c help.c make.c option.c out.c \
special.c xref.c $(XLATESRCS)
dthelp_htag1$(EXEEXT): $(HELPPARSERSRC)/parser
$(RM) dthelp_htag1
$(CP) $(HELPPARSERSRC)/parser dthelp_htag1
arcappl archptag :
if exist hptag.arc $(CP) hptag.arc hptag.old
$(ARCCMD) hptag.arc *.c *.h linkcmd.dos linkcmd.unx $(HELPDTDFILE) \
tex.if makefile makefile.doc make.ini delim.*
unarcappl unarchptag :
$(UNARCCMD) hptag.arc

View file

@ -0,0 +1,49 @@
MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = dthelp_htag1
# Due to the wierd interdepencencies between helptag and parser,
# disable parallel builds here. This is some really horrible code and
# design - not surprising since it dates to 1989.
.NOTPARALLEL:
HELPTAG = ..
HELPTAGSRC = $(HELPTAG)/helptag
HELPPARSERSRC = $(HELPTAG)/parser
HELPELTDEFSRC = $(HELPTAG)/eltdef
HELPDTDFILE = $(HELPTAGSRC)/hptag.dtd
HELPUTILSRC = $(HELPTAG)/util
HELPBUILDSRC = $(HELPTAG)/build
HELPUTILLIB = $(HELPTAG)/util/libutil.a
AM_CPPFLAGS = -I. -I$(HELPUTILSRC) -I$(HELPTAGSRC) -I$(HELPBUILDSRC) \
-I$(HELPELTDEFSRC)
dthelp_htag1_SOURCES = parser.c actutil.c \
closent.c code.c cyclent.c dcurelt.c \
end.c entity.c \
error.c getsign.c \
input.c level.c lookent.c \
minim.c optstrg.c param.c parent.c \
parutil.c pi.c \
scan.c setpar.c start.c string.c struct.c \
text.c
APPLOBJECTS = ../helptag/libhelptag.a
dthelp_htag1_LDADD = $(APPLOBJECTS) $(HELPUTILLIB) $(DTCLIENTLIBS) $(XTOOLLIB)
CPRODS = case.c context.h delim.h
CTRASH = error delim.dat
BUILT_SOURCES = $(CPRODS)
CLEANFILES = $(BUILT_SOURCES) $(CTRASH) CDONE
$(CPRODS): CDONE
CDONE: $(HELPUTILSRC)/context $(HELPTAGSRC)/delim.par context.dat
$(RM) $(CPRODS) $(CTRASH)
$(CP) $(HELPTAGSRC)/delim.par delim.dat # appl.-specific delim.dat
$(HELPUTILSRC)/context
touch CDONE

View file

@ -0,0 +1,21 @@
MAINTAINERCLEANFILES = Makefile.in
noinst_LIBRARIES = libutil.a
noinst_PROGRAMS = context fclndir
context_SOURCES = context.c
fclndir_SOURCES = context.c
libutil_a_SOURCES = allwhite.c inctest.c letter.c triedump.c \
triepdmp.c trieplk.c trierset.c upcmp8.c upstrcmp.c wchar.c \
conutil.c error.c exit.c itoa.c lower.c malloc.c openchk.c \
trie.c triecnt.c upper.c whitesp.c basic.h common.h \
dtddef.h entdef.h sparse.h trie.h chartype.h cont.h dtdext.h \
entext.h sref.h version.h
# FIXME I think emptyfil.c and fclndir.c can be deleted?
context_LDADD = libutil.a
fclndir_LDADD = libutil.a