From 8bb28edc6eec605926232c09e4f6f3e291d828d8 Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 18 Oct 2005 19:12:38 +0000 Subject: [PATCH] Update old make configure and build process; avoid including sys/time.h in lefty/common.h on Windows; fix Windows build; remove a couple of holes related to the new libgvc_dot_builtins.a; fix several bugs in dotty and lefty related to sending output to the printer and rendering output in postscript --- Makefile.am | 2 +- cmd/dotty/dotty.lefty | 35 ++++++++++++++++++++++++++++++----- cmd/dotty/dotty_layout.lefty | 1 + cmd/lefty/common.h | 2 ++ cmd/lefty/internal.c | 1 + configure.old | 3 ++- doc/build.html | 19 +++++++++++++------ lib/gvc/Makefile.am | 2 +- lib/gvc/Makefile.old | 8 ++++---- windows/bin/graphviz.wse | 15 +++++++++++++++ windows/bin/win.sh | 34 +++++++++++++++++++++++++++------- 11 files changed, 97 insertions(+), 25 deletions(-) diff --git a/Makefile.am b/Makefile.am index fc49a5344..8f01a46d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,7 +24,7 @@ dist-hook: EXTRA_DIST = $(txt) $(html) graphviz.spec.in graphviz.spec \ autogen.sh config/depcomp config/config.rpath ast_common.h.in \ Makefile.old Config.mk configure.old INSTALL.old \ - Makeargs config.h.old compat_getopt.h iffe \ + Makeargs config.h.old compat_getopt.h iffe config.iffe \ m4/README m4/iconv.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 \ Doxyfile.in Doxyfile \ makearch features awk windows \ diff --git a/cmd/dotty/dotty.lefty b/cmd/dotty/dotty.lefty index 75cd9bedf..561d0a8b8 100644 --- a/cmd/dotty/dotty.lefty +++ b/cmd/dotty/dotty.lefty @@ -596,15 +596,16 @@ dotty.message = function (level, text) { dotty.protogt.printorsave = function (gt, vt, otype, name, mode, ptype) { local pr, wrect, vsize, xy, psize, canvas, pscanvas, cid, cname, t; local graph, edgehandles, fontmap, eid, edge, nid, node, gid, sgraph; + local did, draw, i; if (~otype) if (~(otype = ask ('print to', 'choice', 'file|printer'))) return; if (otype == 'printer') { - if (~getenv ('TMPDIR')) - name = concat (getenv ('HOME'), '/.dottyout.ps'); - else - name = concat (getenv ('TMPDIR'), '/.dottyout.ps', random (10000)); + if (~getenv ('TMPDIR')) + name = concat (getenv ('HOME'), '/.dottyout.ps'); + else + name = concat (getenv ('TMPDIR'), '/.dottyout.ps', random (10000)); if (getenv ('LEFTYWINSYS') ~= 'mswin' & ~pr) if (~(pr = ask ('printer command', 'string', 'lpr'))) return; @@ -690,16 +691,40 @@ dotty.protogt.printorsave = function (gt, vt, otype, name, mode, ptype) { for (eid in graph.edges) { edge = graph.edges[eid]; edge.fontname = fontmap[edge.attr.fontname]; + for (did in edge.draws) { + if (did == 'ep') + continue; + draw = edge.draws[did]; + for (i = 0; draw[i]; i = i + 1) + if (draw[i].type == 'F') + draw[i].fn = fontmap[draw[i].ofn]; + } gt.drawedge (gt, [0 = vt;], edge); } for (nid in graph.nodes) { node = graph.nodes[nid]; node.fontname = fontmap[node.attr.fontname]; + for (did in node.draws) { + if (did == 'ep') + continue; + draw = node.draws[did]; + for (i = 0; draw[i]; i = i + 1) + if (draw[i].type == 'F') + draw[i].fn = fontmap[draw[i].ofn]; + } gt.drawnode (gt, [0 = vt;], node); } for (gid in graph.graphs) { sgraph = graph.graphs[gid]; sgraph.fontname = fontmap[sgraph.graphattr.fontname]; + for (did in sgraph.draws) { + if (did == 'ep') + continue; + draw = sgraph.draws[did]; + for (i = 0; draw[i]; i = i + 1) + if (draw[i].type == 'F') + draw[i].fn = fontmap[draw[i].ofn]; + } gt.drawsgraph (gt, [0 = vt;], sgraph); } graph.fontname = fontmap[graph.graphattr.fontname]; @@ -708,5 +733,5 @@ dotty.protogt.printorsave = function (gt, vt, otype, name, mode, ptype) { vt.canvas = canvas; destroywidget (pscanvas); if (otype == 'printer' & getenv ('LEFTYWINSYS') ~= 'mswin') - system (concat (pr, ' ', name, '; rm ',name)); + system (concat (pr, ' ', name, '; rm ',name)); }; diff --git a/cmd/dotty/dotty_layout.lefty b/cmd/dotty/dotty_layout.lefty index 1f3fcb666..b07cd2428 100644 --- a/cmd/dotty/dotty_layout.lefty +++ b/cmd/dotty/dotty_layout.lefty @@ -402,6 +402,7 @@ dotty.protogt.unpackdraw = function (gt, attr) { s = ''; for (j = 1; j < l; j = j + 1) s = concat (s, tt[j]); + o.ofn = s; o.fn = dotty.fontmap[s]; } else if (t[i] == 'S') { o.type = t[i]; diff --git a/cmd/lefty/common.h b/cmd/lefty/common.h index 1f995f6af..285250d2f 100644 --- a/cmd/lefty/common.h +++ b/cmd/lefty/common.h @@ -47,8 +47,10 @@ extern "C" { #include #include #include +#ifndef MSWIN32 #include #endif +#endif #include #include diff --git a/cmd/lefty/internal.c b/cmd/lefty/internal.c index 4ecd0ba71..e46e66df6 100644 --- a/cmd/lefty/internal.c +++ b/cmd/lefty/internal.c @@ -754,6 +754,7 @@ int Igetenv (int argc, lvar_t *argv) { if (!T_ISSTRING (argv[0].o)) return L_FAILURE; + rtno = NULL; if (!(s = getenv (Tgetstring (argv[0].o))) || !*s) return L_SUCCESS; rtno = Tstring (s); diff --git a/configure.old b/configure.old index 1c5bb876c..c1cab474b 100755 --- a/configure.old +++ b/configure.old @@ -12,9 +12,10 @@ for i in `find . -name Makefile.old`; do cp $i ${i%%.old}; done # do the same for config.h plus insert VERSION and BUILDDATE V=$(grep 'AC_INIT(graphviz' configure.ac | m4 '-DAC_INIT=$2') D=$(date) -sed "s/VVVV/$V/" config.h.old | sed "s/DDDD/$D/" > config.h +./iffe - set cc cc : run configdata | sed "s/VVVV/$V/" | sed "s/DDDD/$D/" > config.h # Append VERSION to Config.mk +mv Config.mk.old Config.mk echo "VERSION=$V" >> Config.mk # Remove cdt/ast_common.h if it came with the distribution diff --git a/doc/build.html b/doc/build.html index febcd7095..b77522b12 100644 --- a/doc/build.html +++ b/doc/build.html @@ -135,13 +135,20 @@ Obviously you would change the pathnames to reflect your installation. Note that the directory ${prefix}/include is automatically searched for headers, and ${prefix}/lib for libraries.

-2. (Recommend for other Unix platforms.) As above, you need +2. (Recommend for other Unix platforms.) As above, you need the external packages to be installed somewhere. -Then use old make by editing Config.mk for your architecture -and installation directory. Check settings in makearch/$(ARCH). +

    +
  • +Run configure.old from the root graphviz directory. +
  • +Edit Config.mk for your architecture, tools, and installation directory. +In particular, set the ARCH make variable. +
  • +If desired, check settings in makearch/$(ARCH). See below for further notes on individual platforms. -

    -Do the usual:
    +

  • +Run make. +
 make
 make install
@@ -149,7 +156,7 @@ make clean
 

-3. (Recommended for Dave Korn and Elefteris Koutsofios) Use AT&T/Lucent +3. (Recommended for Dave Korn and Eleftheris Koutsofios) Use AT&T/Lucent nmake.

You have to install the AST tools first. diff --git a/lib/gvc/Makefile.am b/lib/gvc/Makefile.am index 9373be3f4..e896f3dc4 100644 --- a/lib/gvc/Makefile.am +++ b/lib/gvc/Makefile.am @@ -37,4 +37,4 @@ libgvc_builtins_la_LIBADD = \ @GD_LIBS@ @EXPAT_LIBS@ @Z_LIBS@ @LIBGEN_LIBS@ libgvc_la_LIBADD = ${libgvc_builtins_la_LIBADD} -EXTRA_DIST = Makefile.old +EXTRA_DIST = Makefile.old dot_builtins.c diff --git a/lib/gvc/Makefile.old b/lib/gvc/Makefile.old index f8436bd57..ae834ec42 100644 --- a/lib/gvc/Makefile.old +++ b/lib/gvc/Makefile.old @@ -1,4 +1,4 @@ -all: libgvc.a +all: libgvc.a libgvc_dot_builtins.a ROOT=../.. include $(ROOT)/Config.mk include $(ROOT)/makearch/$(ARCH) @@ -26,9 +26,9 @@ OBJS = gvrender.o gvlayout.o gvdevice.o gvcontext.o gvjobs.o \ EXTRA_OBJS = no_builtins.o dot_builtins.o libgvc_dot_builtins.a : $(OBJS) dot_builtins.o - $(RM) libgvc_builtins.a - $(AR) cr libgvc_builtins.a $(OBJS) dot_builtins.o - $(RANLIB) libgvc_builtins.a + $(RM) libgvc_dot_builtins.a + $(AR) cr libgvc_dot_builtins.a $(OBJS) dot_builtins.o + $(RANLIB) libgvc_dot_builtins.a libgvc.a : $(OBJS) no_builtins.o $(RM) libgvc.a diff --git a/windows/bin/graphviz.wse b/windows/bin/graphviz.wse index 84f939b0e..00b39d1a5 100755 --- a/windows/bin/graphviz.wse +++ b/windows/bin/graphviz.wse @@ -867,6 +867,21 @@ end item: Include Script Pathname=%_WISE_%\INCLUDE\uninstal.wse end +item: Install File + Source=c:\graphvizCVS\builddaemon\package\source\lib\plugin.lib + Destination=%MAINDIR%\Graphviz\lib\plugin.lib + Flags=0000000010000010 +end +item: Install File + Source=c:\graphvizCVS\builddaemon\package\source\include\logic.h + Destination=%MAINDIR%\Graphviz\include\logic.h + Flags=0000000010000010 +end +item: Install File + Source=c:\graphvizCVS\builddaemon\package\source\include\arith.h + Destination=%MAINDIR%\Graphviz\include\arith.h + Flags=0000000010000010 +end item: Install File Source=c:\graphvizCVS\builddaemon\package\source\include\utils.h Destination=%MAINDIR%\Graphviz\include\utils.h diff --git a/windows/bin/win.sh b/windows/bin/win.sh index 1060320a5..9558e2d13 100755 --- a/windows/bin/win.sh +++ b/windows/bin/win.sh @@ -9,8 +9,11 @@ INPKG=graphviz-win.tgz # input CVS package #WISE=/C/wisein~1/wise32.exe # = /Wise InstallMaker WISE=/C/progra~1/wisein~2/wise32.exe # = Wise InstallMaker SOURCE=ellson@www.graphviz.org:www.graphviz.org/pub/graphviz +NSOURCE=www.graphviz.org:/home/ellson/www.graphviz.org/pub/graphviz SOURCEFILE=$SOURCE/CURRENT/$INPKG +NSOURCEFILE=$NSOURCE/CURRENT/$INPKG DESTDIR=$SOURCE/CURRENT +NDESTDIR=$NSOURCE/CURRENT OPTION=Release WISEFLAG=0 @@ -41,7 +44,11 @@ function setVersion { function getFile { # $TCLSH get.tcl $INPKG - scp -q $SOURCEFILE . >> $LFILE 2>&1 +# scp -q $SOURCEFILE . >> $LFILE 2>&1 + echo ssh soohan scp -q $NSOURCEFILE . >> $LFILE 2>&1 + ssh soohan scp -q $NSOURCEFILE . + echo rcp raptor:graphviz-win.tgz . >> $LFILE 2>&1 + rcp raptor:graphviz-win.tgz . >> $LFILE 2>&1 if [[ $? != 0 ]] then ErrorEx "failure to get source" @@ -52,10 +59,14 @@ function getFile function putFile { # $TCLSH tclscript.tcl $1 >> $LFILE 2>&1 - scp -q $1 $DESTDIR >> $LFILE 2>&1 & - PID=$(ps -e | grep scp | awk '{print $1 }') - sleep 10 - kill $PID +# scp -q $1 $DESTDIR >> $LFILE 2>&1 & +# PID=$(ps -e | grep scp | awk '{print $1 }') +# sleep 10 +# kill $PID + BASE=$(basename $1) + rcp $1 raptor:. >> $LFILE 2>&1 + ssh raptor scp -q $BASE $NDESTDIR >> $LFILE 2>&1 + ssh raptor rm $BASE >> $LFILE 2>&1 if [[ $? != 0 ]] then ErrorEx "failure to put $1" @@ -163,6 +174,7 @@ function Get #gunzip < graphviz.tar.gz | tar xf - echo "unpacking the package" >> $LFILE #pax -rf $INPKG >> $LFILE 2>&1 + echo "(gunzip < $INPKG | tar xf - )" >> $LFILE 2>&1 (gunzip < $INPKG | tar xf - ) >> $LFILE 2>&1 if [[ $? != 0 ]] then @@ -251,7 +263,7 @@ function Install # install libraries echo "copying libraries" >> $LFILE - LIBS=(ingraphs agraph cdt circogen common dotgen fdpgen gd graph gvc neatogen pack pathplan twopigen) + LIBS=(ingraphs agraph cdt circogen common dotgen fdpgen gd graph gvc neatogen pack pathplan plugin twopigen) if [[ ! -d $PACKAGE_HOME/source/lib ]] then mkdir $PACKAGE_HOME/source/lib @@ -309,12 +321,18 @@ function Package SRCDIR=$GVIZ_HOME/lib/circogen finstall circo.h SRCDIR=$GVIZ_HOME/lib/common + finstall arith.h finstall globals.h finstall const.h + finstall logic.h finstall macros.h finstall render.h - finstall renderprocs.h finstall types.h + finstall utils.h + finstall geom.h + finstall geomprocs.h + finstall color.h + finstall memory.h SRCDIR=$GVIZ_HOME/lib/dotgen finstall dot.h finstall dotprocs.h @@ -322,8 +340,10 @@ function Package finstall fdp.h SRCDIR=$GVIZ_HOME/lib/gvc finstall gvc.h + finstall gvcext.h finstall gvcint.h finstall gvcproc.h + finstall gvcjob.h finstall gvplugin.h finstall gvplugin_layout.h finstall gvplugin_render.h -- 2.40.0