mgp_1.04a.orig.tar.gz (not available from upstream any more) mgp-1.04a
authormirabilos <t.glaser@tarent.de>
Wed, 22 May 2019 18:42:28 +0000 (20:42 +0200)
committermirabilos <mirabilos@evolvis.org>
Wed, 22 May 2019 18:42:28 +0000 (20:42 +0200)
163 files changed:
.cvsignore [new file with mode: 0644]
CHANGELOG [new file with mode: 0644]
COPYRIGHT [new file with mode: 0644]
COPYRIGHT.jp [new file with mode: 0644]
Imakefile.in [new file with mode: 0644]
README [new file with mode: 0644]
README.fonts [new file with mode: 0644]
README.fonts.jp [new file with mode: 0644]
SYNTAX [new file with mode: 0644]
TODO.jp [new file with mode: 0644]
USAGE [new file with mode: 0644]
USAGE.jp [new file with mode: 0644]
background.c [new file with mode: 0644]
configure [new file with mode: 0755]
configure.in [new file with mode: 0644]
contrib/.cvsignore [new file with mode: 0644]
contrib/Imakefile [new file with mode: 0644]
contrib/mgp2html.pl.in [new file with mode: 0644]
contrib/mgp2latex.pl.in [new file with mode: 0644]
contrib/mgpnet.in [new file with mode: 0644]
contrib/mgpnet.man [new file with mode: 0644]
contrib/xmindpath/.cvsignore [new file with mode: 0644]
contrib/xmindpath/Makefile.in [new file with mode: 0644]
contrib/xmindpath/config.guess [new file with mode: 0755]
contrib/xmindpath/config.sub [new file with mode: 0755]
contrib/xmindpath/configure [new file with mode: 0755]
contrib/xmindpath/configure.in [new file with mode: 0644]
contrib/xmindpath/install-sh [new file with mode: 0755]
contrib/xmindpath/main.c [new file with mode: 0644]
contrib/xmindpath/pathnames.h [new file with mode: 0644]
contrib/xmindpath/uucplock.c [new file with mode: 0644]
contrib/xmindpath/xmindpath.1 [new file with mode: 0644]
contrib/xwintoppm/.cvsignore [new file with mode: 0644]
contrib/xwintoppm/Imakefile [new file with mode: 0644]
contrib/xwintoppm/README [new file with mode: 0644]
contrib/xwintoppm/dsimple.c [new file with mode: 0644]
contrib/xwintoppm/dsimple.h [new file with mode: 0644]
contrib/xwintoppm/list.c [new file with mode: 0644]
contrib/xwintoppm/list.h [new file with mode: 0644]
contrib/xwintoppm/multiVis.c [new file with mode: 0644]
contrib/xwintoppm/multiVis.h [new file with mode: 0644]
contrib/xwintoppm/wsutils.h [new file with mode: 0644]
contrib/xwintoppm/xwintoppm.c [new file with mode: 0644]
contrib/xwintoppm/xwintoppm.man [new file with mode: 0644]
ctlwords.awk [new file with mode: 0644]
ctlwords.pl [new file with mode: 0644]
draw.c [new file with mode: 0644]
embed.c [new file with mode: 0644]
font.c [new file with mode: 0644]
globals.c [new file with mode: 0644]
grammar.y [new file with mode: 0644]
image/.cvsignore [new file with mode: 0644]
image/Imakefile.in [new file with mode: 0644]
image/bright.c [new file with mode: 0644]
image/clip.c [new file with mode: 0644]
image/cmuwmraster.c [new file with mode: 0644]
image/cmuwmraster.h [new file with mode: 0644]
image/compress.c [new file with mode: 0644]
image/copyright.h [new file with mode: 0644]
image/dither.c [new file with mode: 0644]
image/faces.c [new file with mode: 0644]
image/fbm.c [new file with mode: 0644]
image/fbm.h [new file with mode: 0644]
image/g3.c [new file with mode: 0644]
image/g3.h [new file with mode: 0644]
image/gif.c [new file with mode: 0644]
image/gif.h [new file with mode: 0644]
image/halftone.c [new file with mode: 0644]
image/image.h [new file with mode: 0644]
image/imagetypes.c [new file with mode: 0644]
image/imagetypes.h [new file with mode: 0644]
image/img.c [new file with mode: 0644]
image/img.h [new file with mode: 0644]
image/jpeg.c [new file with mode: 0644]
image/jpeg.h [new file with mode: 0644]
image/kljcpyrght.h [new file with mode: 0644]
image/mac.c [new file with mode: 0644]
image/mac.h [new file with mode: 0644]
image/mc_tables.c [new file with mode: 0644]
image/mcidas.c [new file with mode: 0644]
image/mcidas.h [new file with mode: 0644]
image/misc.c [new file with mode: 0644]
image/mit.cpyrght [new file with mode: 0644]
image/new.c [new file with mode: 0644]
image/options.h [new file with mode: 0644]
image/patchlevel [new file with mode: 0644]
image/path.c [new file with mode: 0644]
image/pbm.c [new file with mode: 0644]
image/pbm.h [new file with mode: 0644]
image/pcx.c [new file with mode: 0644]
image/pcx.h [new file with mode: 0644]
image/reduce.c [new file with mode: 0644]
image/rle.c [new file with mode: 0644]
image/rle.h [new file with mode: 0644]
image/rlelib.c [new file with mode: 0644]
image/rotate.c [new file with mode: 0644]
image/send.c [new file with mode: 0644]
image/smooth.c [new file with mode: 0644]
image/sunraster.c [new file with mode: 0644]
image/sunraster.h [new file with mode: 0644]
image/tgncpyrght.h [new file with mode: 0644]
image/value.c [new file with mode: 0644]
image/window.c [new file with mode: 0644]
image/xbitmap.c [new file with mode: 0644]
image/xloadimage.h [new file with mode: 0644]
image/xpixmap.c [new file with mode: 0644]
image/xwd.c [new file with mode: 0644]
image/xwd.h [new file with mode: 0644]
image/zio.c [new file with mode: 0644]
image/zoom.c [new file with mode: 0644]
keywords.pl [new file with mode: 0644]
mgp.c [new file with mode: 0644]
mgp.h [new file with mode: 0644]
mgp.man [new file with mode: 0644]
mgp2ps.man [new file with mode: 0644]
mgpembed.man [new file with mode: 0644]
mgpembed.pl.in [new file with mode: 0755]
missing/memcmp.c [new file with mode: 0644]
missing/mkstemp.c [new file with mode: 0644]
missing/snprintf.c [new file with mode: 0644]
missing/strdup.c [new file with mode: 0644]
missing/strsep.c [new file with mode: 0644]
missing/usleep.c [new file with mode: 0644]
parse.c [new file with mode: 0644]
plist.c [new file with mode: 0644]
postscript.c [new file with mode: 0644]
print.c [new file with mode: 0644]
sample/.cvsignore [new file with mode: 0644]
sample/Imakefile.in [new file with mode: 0644]
sample/README [new file with mode: 0644]
sample/README.jp [new file with mode: 0644]
sample/cloud.gif [new file with mode: 0644]
sample/dad.eps [new file with mode: 0644]
sample/dad.gif [new file with mode: 0644]
sample/default.mgp [new file with mode: 0644]
sample/dns-jp.mgp [new file with mode: 0644]
sample/embed-jp.mgp [new file with mode: 0644]
sample/embed.mgp [new file with mode: 0644]
sample/gradation-jp.mgp [new file with mode: 0644]
sample/gradation.mgp [new file with mode: 0644]
sample/mgp-old1.gif [new file with mode: 0644]
sample/mgp-old2.gif [new file with mode: 0644]
sample/mgp-old3.gif [new file with mode: 0644]
sample/mgp1.gif [new file with mode: 0644]
sample/mgp2.gif [new file with mode: 0644]
sample/mgp3.gif [new file with mode: 0644]
sample/mgp3.xbm [new file with mode: 0644]
sample/mgprc-sample [new file with mode: 0644]
sample/multilingual.mgp [new file with mode: 0644]
sample/sample-jp.mgp [new file with mode: 0644]
sample/sample.mgp [new file with mode: 0644]
sample/sendmail6-jp.mgp [new file with mode: 0644]
sample/sendmail6.mgp [new file with mode: 0644]
sample/tutorial-jp.mgp [new file with mode: 0644]
sample/tutorial.mgp [new file with mode: 0644]
sample/v6-jp.mgp [new file with mode: 0644]
sample/v6.mgp [new file with mode: 0644]
sample/v6header.eps [new file with mode: 0644]
sample/v6header.gif [new file with mode: 0644]
scanner.l [new file with mode: 0644]
tfont.c [new file with mode: 0644]
x11.c [new file with mode: 0644]
x11dummy.c [new file with mode: 0644]

diff --git a/.cvsignore b/.cvsignore
new file mode 100644 (file)
index 0000000..c456bc9
--- /dev/null
@@ -0,0 +1,18 @@
+config.log
+config.cache
+configure.scan
+Imakefile
+config.status
+Makefile
+tp
+ctlwords.h
+tp2ps
+mgp
+mgp2ps
+mgp.0
+mgp2ps.0
+mgpembed.0
+grammar.c
+tokdefs.h
+scanner.c
+mgpembed.pl
diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644 (file)
index 0000000..267add9
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,51 @@
+CHANGELOG for magicpoint
+$Id: CHANGELOG,v 1.9 1998/09/04 15:11:21 onoe Exp $
+
+Fri Sep  5 1998  onoe@sm.sony.co.jp
+       * handle key inputs from invoked terminal as pressed on Xserver,
+         even if the Xserver is running on a remote host.
+
+Mon Aug 26 1998  itojun@iijlab.net
+       * new copyright. (BSDish copyright without clause 3)
+
+Mon Aug 25 1998  itojun@iijlab.net
+       * print.c: better x11/freetype/vflib -> postscript font mapping.
+
+Mon Aug 23 1998  kato@wide.ad.jp
+       * embedded image support (added mgpembed.pl and embed.c)
+
+Mon Aug 22 1998  itojun@iijlab.net
+       * added contrib/xmindpath, MindPath PocketPoint user-level driver.
+
+Fri Jul 10 11:57:59 JST 1998  itojun@iijlab.net
+       * cache gs-generated image file.
+         Suggested by: luigi@FreeBSD.org
+
+Mon Jul  6 11:38:32 JST 1998  itojun@iijlab.net
+       * capable of handling GB2312 and KSC5601 encoding.
+         they must be encoded by using iso-2022 like escape sequences.
+         EUC-cn or EUC-kr does not work.
+       * -x option is added.
+
+Thu Jul  2 18:04:16 JST 1998  itojun@iijlab.net
+       * eliminate gsview.
+       * revamp "xfont" directive. (see SYNTAX for detail)
+
+Thu Jun 25 13:10:28 JST 1998  itojun@iijlab.net
+       * print.c: color postscript support by "mgp2ps -c".
+
+changes between 1.02a and 1.03a:
+       * To allow color name that has space inbetween ("dark blue"), 
+         color name after directives SHOULD come with doublequote.
+         Therefore,
+               %fore blue
+         should be
+               %fore "blue"
+         At this moment, doublequote can be ommitted for backward
+         compatibility.  We may require to have doublequote in the future.
+         Font names and other string parameter obeys the same rule.
+       * %image is now capable of rendering encapsulated postscript files
+         (*.eps).
+               %image foo.eps
+         should work fine.
+         By using -X option, you can specify device name for ghostscript.
diff --git a/COPYRIGHT b/COPYRIGHT
new file mode 100644 (file)
index 0000000..9f850bf
--- /dev/null
+++ b/COPYRIGHT
@@ -0,0 +1,25 @@
+Copyright (C) 1997 and 1998 WIDE Project.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/COPYRIGHT.jp b/COPYRIGHT.jp
new file mode 100644 (file)
index 0000000..de7b8c2
--- /dev/null
@@ -0,0 +1,29 @@
+(\e$BCm\e(B) \e$B0J2<$OF|K\8l$NJ}$,J,$+$j$d$9$$?M$N$?$a$K!"1Q8l$NCx:n8"I=<($rLu$7\e(B
+\e$B$?J8>O$G$"$k!#@5<0$JCx:n8"$O!"1Q8l$N86K\$K=>$&!#\e(B
+
+Copyright (C) 1997 and 1998 WIDE \e$B%W%m%8%'%/%H\e(B.  All rights reserved.
+
+\e$BJQ99$NM-L5$K$+$+$o$i$:!"%=!<%9$*$h$S%P%$%J%j7A<0$N:FG[I[$*$h$SMxMQ$O!"\e(B
+\e$B0J2<$N>r7o$rK~$?$7$F$$$l$P!"$3$l$r5v2D$9$k!#\e(B
+
+1. \e$B%=!<%9!&%3!<%I$N:FG[I[$O!">e5-$NCx:n8"I=<(!"$3$N>r7o9`L\!"$*$h$S!"\e(B
+\e$B0J2<$NLH@U;v9`$rJ]B8$7$J$1$l$P$J$i$J$$!#\e(B
+
+2. \e$B%P%$%J%j7A<0$N:FG[I[$O!">e5-$NCx:n8"I=<(!"$3$N>r7o9`L\!"$*$h$S!"0J\e(B
+\e$B2<$NLH@U;v9`$r!"$=$NG[I[$KIU?o$9$k@bL@=q!"$"$k$$$O$=$NB>$N;qNA$N$$$:$l\e(B
+\e$B$+$KL@5-$7$J$1$l$P$J$i$J$$!#\e(B
+
+3. \e$BA0$b$C$FFCJL$K5vBz$rF@$J$$8B$j!"$3$N%=%U%H%&%'%"$+$iGI@8$7$?@=IJ$N\e(B
+\e$B?d>)$dHNGdB%?J$N$?$a$K!"$3$N%W%m%8%'%/%HL>$H9W8%<TC#$NL>A0$rMxMQ$7$F$O\e(B
+\e$B$J$i$J$$!#\e(B
+
+\e$B$3$N%=%U%H%&%'%"$O!V$3$N$^$^$N7A$G!WDs6!$5$l!"L@<(E*$"$k$$$O8@30$NJ]>Z\e(B
+\e$B$O!">&MQMxMQ$*$h$SFCDjL\E*$X$NE,9g$KBP$9$k8@30$NJ]>Z$b4^$_!"$^$?$3$l$i\e(B
+\e$B$@$1$K8B$i$:!"B8:_$7$J$$!#$?$H$(0J2<$N$h$&$JB;32$N2DG=@-$r<(:6$5$l$F$$\e(B
+\e$B$?$H$7$F$b!"$I$N$h$&$J7A$K$7$m$3$N%=%U%H%&%'%"$NMxMQ$+$iH/@8$7$?LdBj$K\e(B
+\e$B$*$$$F!"$3$N%W%m%8%'%/%H$H9W8%<TC#$O!"\e(B(\e$BBeBX@=IJ$d%5!<%S%9$ND4C#\e(B; \e$BMxMQ\e(B
+\e$B8"!"%G!<%?!"$"$k$$$OMx1W$NB;<:\e(B; \e$B$"$k$$$O1D6H$NCfCG$r4^$`!"$^$?$3$l$i$@\e(B
+\e$B$1$K8B$i$:\e(B)\e$BD>@\E*$K!"4V@\E*$K!"6vA3$K!"FCJL$K!"D(H3>e!"$"$k$$$O!"I,A3\e(B
+\e$BE*$K@8$8$F$7$^$C$?B;32$KBP$7@UG$$O$J$/!"$$$+$J$k@UG$M}O@>e$G$b7@Ls$NM-\e(B
+\e$BL5$K78$o$i$:87L)$J@UG$$O$J$/!"$^$?\e(B(\e$B2a<:$"$k$$$O$=$NB>$r4^$`\e(B)\e$BITK!9T0Y$K\e(B
+\e$BBP$7$F$b@UG$$O$J$$!#\e(B
diff --git a/Imakefile.in b/Imakefile.in
new file mode 100644 (file)
index 0000000..f018171
--- /dev/null
@@ -0,0 +1,129 @@
+# $Id: Imakefile.in,v 1.37 1998/09/04 09:00:40 onoe Exp $
+
+@SET_MAKE@
+srcdir=        @srcdir@
+VPATH= @srcdir@
+SRCS=  mgp.c draw.c parse.c plist.c print.c globals.c x11.c x11dummy.c \
+       font.c background.c scanner.c grammar.c postscript.c tfont.c \
+       embed.c 
+TPOBJS=        mgp.o draw.o parse.o plist.o globals.o x11.o font.o background.o \
+       scanner.o grammar.o postscript.o tfont.o embed.o
+PROBJS=        print.o parse.o globals.o x11dummy.o scanner.o grammar.o postscript.o \
+       embed.o
+LIBOBJS=       @LIBOBJS@
+OBJS=  ${TPOBJ} ${PROBJS} ${LIBOBJS}
+LIBS=  $(srcdir)/image/libimage.a
+AWK=   @AWK@
+PERL=  @mgp_cv_path_perl@
+YACC=  @YACC@
+LEX=   @LEX@
+
+OPTFLAGS=      @OPTFLAGS@
+DEFS=  @DEFS@ -DMGPLIBDIR=\"$(LIBDIR)/mgp\"
+#DEFS+=        -DGLYPHEDGE
+
+SYS_LIBRARIES= -L$(srcdir)/image -limage @LIBS@
+EXTRA_DEPLIBS= @DEPLIBS@
+
+#undef DefaultCDebugFlags
+#define DefaultCDebugFlags     @DEBUGFLAGS@
+#undef ServerCDebugFlags
+#undef LibraryDebugFlags
+
+AllTarget(mgp mgp2ps)
+DependTarget()
+
+#ifndef NullParameter
+#define  NullParameter 
+#endif
+
+NormalProgramTarget(mgp,$(TPOBJS) $(LIBOBJS), $(LIBS) $(EXTRA_DEPLIBS), NullParameter,$(XLIB))
+NormalProgramTarget(mgp2ps,$(PROBJS) $(LIBOBJS), $(LIBS) $(EXTRA_DEPLIBS), NullParameter,$(XLIB))
+
+InstallProgram(mgp,$(BINDIR))
+InstallProgram(mgp2ps,$(BINDIR))
+InstallManPage(mgp,$(MANDIR))
+InstallManPage(mgp2ps,$(MANDIR))
+
+#if defined(ImakeConfigRelease) && ImakeConfigRelease >= 6
+InstallNamedTarget(install,mgpembed.pl,$(INSTBINFLAGS),$(BINDIR),mgpembed) /*R6 only*/
+#else
+InstallNamedProg(mgpembed.pl,mgpembed,$(BINDIR)) /*obsoleted in R6?*/
+#endif
+InstallManPage(mgpembed,$(MANDIR))
+
+SpecialObjectRule(draw.o,draw.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(parse.o,parse.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(plist.o,plist.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(postscript.o,postscript.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(print.o,print.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(x11.o,x11.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(font.o,font.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(tfont.o,tfont.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(x11dummy.o,x11dummy.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(background.o,background.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(globals.o,globals.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(mgp.o,mgp.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(scanner.o,scanner.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(grammar.o,grammar.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(embed.o,embed.c, $(DEFS) $(OPTFLAGS))
+
+#define PassCDebugFlags
+#define IHaveSubdirs
+
+SUBDIRS=       image sample contrib
+NamedMakeSubdirs($(srcdir)/image/libimage.a, image)
+MakeSubdirs(sample contrib)
+
+mgp.o: $(srcdir)/mgp.c ctlwords.h
+draw.o: $(srcdir)/draw.c ctlwords.h
+globals.o: $(srcdir)/globals.c ctlwords.h
+grammar.o: $(srcdir)/grammar.c ctlwords.h
+parse.o: $(srcdir)/parse.c ctlwords.h
+plist.o: $(srcdir)/plist.c ctlwords.h
+print.o: $(srcdir)/print.c ctlwords.h
+
+ctlwords.h: $(srcdir)/ctlwords.pl $(srcdir)/globals.c
+       $(PERL) $(srcdir)/ctlwords.pl < $(srcdir)/globals.c > ctlwords.h
+
+scanner.c: $(srcdir)/scanner.l
+       $(LEX) -t $(srcdir)/scanner.l > scanner.c
+scanner.o: scanner.c tokdefs.h
+
+grammar.c: $(srcdir)/grammar.y
+       $(YACC) -d $(srcdir)/grammar.y
+       mv y.tab.c grammar.c
+       mv y.tab.h tokdefs.h
+
+tokdefs.h: grammar.c
+
+# missing libraries
+memcmp.o: missing/memcmp.c
+       $(CC) -c $(CFLAGS) -I$(srcdir) $(DEFS) $(OPTFLAGS) \
+               $(srcdir)/missing/memcmp.c
+strdup.o: missing/strdup.c
+       $(CC) -c $(CFLAGS) -I$(srcdir) $(DEFS) $(OPTFLAGS) \
+               $(srcdir)/missing/strdup.c
+strsep.o: missing/strsep.c
+       $(CC) -c $(CFLAGS) -I$(srcdir) $(DEFS) $(OPTFLAGS) \
+               $(srcdir)/missing/strsep.c
+usleep.o: missing/usleep.c
+       $(CC) -c $(CFLAGS) -I$(srcdir) $(DEFS) $(OPTFLAGS) \
+               $(srcdir)/missing/usleep.c
+mkstemp.o: missing/mkstemp.c
+       $(CC) -c $(CFLAGS) -I$(srcdir) $(DEFS) $(OPTFLAGS) \
+               $(srcdir)/missing/mkstemp.c
+snprintf.o: missing/snprintf.c
+       $(CC) -c $(CFLAGS) -I$(srcdir) $(DEFS) $(OPTFLAGS) \
+               $(srcdir)/missing/snprintf.c
+
+distclean:: clean
+       -/bin/rm -f config.status config.log config.cache ctlwords.h
+       -/bin/rm -f scanner.c grammar.c tokdefs.h mgp.0 mgp2ps.0
+       -/bin/rm -f contrib/mgp2html.pl contrib/mgp2latex.pl
+       for i in $(SUBDIRS); do \
+               (cd $$i; if [ -f Makefile ]; then make distclean; fi); \
+       done
+       -/bin/rm -f Makefile Imakefile
+
+/*EOF*/
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..030e4bc
--- /dev/null
+++ b/README
@@ -0,0 +1,102 @@
+            MagicPoint - an X11 based presentation tool
+
+                         September 4, 1998
+
+MagicPoint is an X11 based presentation tool.  It is designed to make
+simple presentations easy while to make complicated presentations
+possible.  Its presentation file (whose suffix is typically .mgp) is
+just text so that you can create presentation files quickly with your
+favorite editor (e.g. Emacs).
+
+This is alpha release of MagicPoint.  We're planing to add version
+control mechanism of .mgp file for forward compatibly.  But currently,
+such a mechanism is missing. Please use this package at your own risk.
+
+MagicPoint is completely free but absolutely no warranty. For more
+information, please refer to COPYRIGHT or COPYRIGHT.jp.  Please note
+that some of the source code is derived from other people's work, and
+may have different distribution policy.  Be sure to check the comment
+in the source code.
+
+
+                            INSTALLATION
+
+Since MagicPoint extensively uses fonts in various sizes we recommend
+you to have good font rendering capability in your system.  Please
+refer to README.fonts for detail.
+
+- Short summary for non-Japanese readers:
+
+We recommend you to either:
+
+    (1) compile MagicPoint with FreeType linked, or
+    (2) use X11 server with good outline font capability.
+
+The former one is recommended.  For the latter case, it should be okay
+if you have adobe Type1 font in X11 font directory.  There are some
+advanced methods, such as modified X11 server.
+
+- Short summary to Japanese readers:
+
+We recommend you to either:
+
+    (1) compile MagicPoint with FreeType and VFlib linked, or
+    (2) compile MagicPoint with FreeType linked, or
+    (3) compile MagicPoint with VFlib linked, or
+    (4) use X11 server with outline English/Japanese font capability.
+
+At this moment, MagicPoint uses FreeType only for English fonts, and
+VFlib only for Japanese fonts.  Therefore, Approach (1) is the best.
+(4) needs some special software as standard X11 server will not render
+Japanese scalable font files.
+
+
+Follow the steps below to make MagicPoint:
+
+       % ./configure
+       % xmkmf
+       % make Makefiles
+       % make
+
+Note1: if you have vflib installed AND you do NOT want to compile the
+vflib support into the binary, try the following option: 
+       % ./configure --disable-vflib
+
+Note2: if you have FreeType installed AND you do NOT want to compile the
+FreeType support into the binary, try the following option: 
+       % ./configure --disable-freetype
+
+Invoking `configure' updates Imakefile.  So, do NOT forget to invoke
+`xmkmf' every time you update Imakefile.
+
+It's a good idea to preview a sample file before installation.
+
+       % ./mgp sample/tutorial.mgp
+
+For more information, see sample/README or sample/README.jp.
+
+When you believe that everything is OK, install MagicPoint as follows:
+
+       % su
+       # make install
+       # make install.man
+
+If you want to paste EPS figure into your presentation, you will need to
+install ghostscript or alike.
+
+                            FOR MORE INFO
+
+Official home page of MagicPoint is "http://www.Mew.org/mgp/".
+
+Latest packages are available from "ftp://ftp.Mew.org/pub/MagicPoint/"
+as well as this home page.
+
+Please send comments to the developer mailing-list "mgp@Mew.org".
+
+There are two mailing list for magicpoint users:
+       mgp-users@Mew.org       (language: English)
+       mgp-users-jp@Mew.org    (language: Japanese)
+For subscription, please send an email to
+       mgp-users-ctl@Mew.org   or
+       mgp-users-jp-ctl@Mew.org
+with "# guide" in the email body (without quotes).
diff --git a/README.fonts b/README.fonts
new file mode 100644 (file)
index 0000000..4dc8ce0
--- /dev/null
@@ -0,0 +1,159 @@
+           Configuring fonts for MagicPoint presentation
+
+$Id: README.fonts,v 1.16 1998/09/04 10:47:35 kazu Exp $
+
+For better presentation with "MagicPoint" presentation tool, it is
+necessary to configure your MagicPoint, and maybe your X11 server to
+handle large-size fonts.  The document tries to summarize steps to
+make use of large-size fonts with MagicPoint.
+
+
+Standard methods
+================
+
+Scalable English fonts, with FreeType library
+---------------------------------------------
+FreeType project, a free software project for TrueType scalable font
+renderer, provides FreeType library at:
+       http://www.freetype.org/
+MagicPoint implements native support for FreeType library.  You can
+compile the renderer into MagicPoint.  If you have FreeType library
+(libttf.a) somewhere in your system, "configure" script will find the
+library and links the library into MagicPoint binary.
+
+To avoid compiling libttf.a into MagicPoint binary, you can specify 
+--disable-freetype option to "configure" script, as below:
+       ./configure --disable-freetype
+
+If you want to get Free/Commercial TrueType fonts, read below section
+"How to get TrueType font."
+
+
+Scalable English fonts, with standard X11 server
+------------------------------------------------
+Standard X11 server is capable of rendering "Adobe Type-1" scalable
+fonts.  To use Adobe Type-1 fonts, you have to install their font
+files.  You can find some fonts in /usr/X11R6/lib/X11/fonts/Type1,
+which is a part of the X11 standard distribution.  If you do not have
+the directory (or similar directory), please install adequate font
+files into your system.
+
+Some good additional fonts can be found at:
+       http://www.gimp.org/fonts.html
+       ftp://ftp.gimp.org/pub/gimp/fonts/
+
+You may also add X11 font search path.  Refer to the manual for your
+system.  Also, please do not forget to perform "xset fp rehash", if
+you added X11 font path while X11 sever is running.
+
+You can query these fonts by using XLFD (X11 font specification
+string) staring from "-adobe-".  Use xfontsel to confirm if it is
+installed or not.
+
+Scalable Japanese fonts, with VFLib
+-----------------------------------
+For non-Adobe and Adobe scalable fonts, a library called VFLib is
+available from:
+       ftp://gull.se.hiroshima-u.ac.jp/pub/VFlib/.
+MagicPoint implements native support for VFlib library.  You can
+compile the renderer into MagicPoint.  If you have VFlib library
+(libVFlib.a) somewhere in your system, "configure" script will find
+the library and links the library into MagicPoint binary.
+
+To avoid compiling libVFlib.a into MagicPoint binary, you can specify 
+--disable-vflib option to "configure" script, as below:
+       ./configure --disable-vflib
+
+English fonts will become scalable as well, however, this method is
+not very suitable for western readers as this approach usually uses
+Japanese font files.  Japanese font file includes several thousand of
+letters and will occupies several megabytes on your disk.
+
+Combination of FreeType and VFlib
+---------------------------------
+MagicPoint uses FreeType only for rendering English fonts, and uses
+VFlib only for rendering Japanese fonts, at this moment.  Therefore,
+it would be the best for Japanese people to link BOTH FreeType and
+VFlib into MagicPoint binary.
+
+
+Advanced/complex methods
+========================
+
+Scalable fonts, with FreeType-ready X11 server
+------------------------------------------------------
+There seems to be several projects for implementing FreeType into X11
+server, or X11 font server (xfs).  By using these kind of
+implementation X11 server will be able to render wide variety of
+TrueType scalable fonts.  For obtaining implementation, visit the
+following URL:
+       http://www.freetype.org/projects.htm
+       http://www.gimp.org/fonts.html
+               See the "Using TrueType fonts with Gimp and X" section.
+
+The projects listed below support not only Western languages but also
+Asian languages:
+       http://cclub.cc.tut.ac.jp/~go/unix/xtt.html
+       http://hawk.ise.chuo-u.ac.jp/student/person/tshiozak/x-tt/index-eng.html
+
+By specifying proper XLFD you can use those scalable fonts from
+MagicPoint.  You may have to modify some of the FreeType-X11 font
+specification file as well.
+
+
+Scalable Japanese/English fonts, with VFlib-ready X11 server
+------------------------------------------------------------
+There are several project to compiling VFlib into X11 server, or X11
+font server (xfs), for example:
+       http://karin.ip.titech.ac.jp/~takagi/X-VFlib/index.html
+
+By specifying proper XLFD you can use those scalable fonts from
+MagicPoint.  You may have to modify some of the VFlib-X11 font
+specification file as well.
+
+
+Scalable Japanese fonts, with VFlib/FreeType-hetero library
+-----------------------------------------------------------
+It may be really confusing (even for the authors), but there are
+several attempts to merge VFlib and FreeType.  Some try to provide
+functionality of FreeType under VFlib API (FreeType-in-VFlib), and
+others try to do the other way around (VFlib-in-FreeType).
+
+In either cases, you can link the library into MagicPoint itself.
+
+There are, of course, attempts to merge those font renderer into X11
+server or X11 font server (xfs).  In this case, you can use scalable
+font by using proper XLFD.
+
+
+Miscellaneous 
+=============
+
+How to get TrueType Fonts.
+---------------------------------
+You can get freely available TrueType font from following:
+       http://www.aaa.nl/people/mkatwijk/freettf.html
+       http://come.to/freefonts
+       CTAN mirros, pub/CTAN/fonts/cm/ps-type1/bakoma/ttf
+               Computer modern fonts in TrueType format
+
+Also there are several sources for free-of-charge fonts, with some
+licensing things:
+       http://microsoft.com/typography/fontpack/default.htm
+               NOTE: Because that MS fonts package is Self Extract type 
+               windows executable, you must extract it on windows 
+               platform.  mmmm...
+       http://www.bitstream.com/products/world/cyberbits/index.html
+               NOTE: You can download it without fee.
+               You must sign a form to download this.
+               You can also purchase their CD-ROM.
+
+Of course, it's also good for you to purchase commercial font
+products.  Here are some online stores for font files, including
+TrueType fonts:
+       http://www3.digitalriver.com/bit/index.html
+       http://www.arttoday.com/
+       http://www.matchfonts.com/
+
+You may also able to purchase "font collection CD-ROM", at computer
+store near you.
diff --git a/README.fonts.jp b/README.fonts.jp
new file mode 100644 (file)
index 0000000..69b88d8
--- /dev/null
@@ -0,0 +1,204 @@
+        MagicPoint\e$B%W%l%<%s%F!<%7%g%sMQ$N%U%)%s%H@_Dj$K$D$$$F\e(B
+
+$Id: README.fonts.jp,v 1.6 1998/09/04 10:47:37 kazu Exp $
+
+       -----\e$BF|K\8lHG\e(B(README.fonts.jp)\e$B$K4X$9$kCm0U\e(B-----
+       \e$B1Q8lHG\e(B(README.fonts)\e$B$NJ}$,@5<0$G$9!#\e(B
+       \e$BF|K\8lHG$OFbMF$N99?7$,CY$l$k2DG=@-$,$"$j$^$9!#\e(B
+       -------------------------------------------------
+
+MagicPoint \e$B$G$OMM!9$JJ}K!$G%U%)%s%H>pJs$r<hF@$7$^$9!#\e(BX11 \e$B%5!<%P$+$i$N\e(B 
+X \e$B%U%)%s%H$N<hF@$r;O$a!"\e(BVFlib \e$B$d\e(B FreeType \e$B$rD>@\8F$S=P$7$K$h$k%Y%/%?!<\e(B
+\e$B%U%)%s%H$NMxMQ$b$G$-$k$h$&$K$J$C$F$$$^$9!#\e(B
+
+\e$B$3$3$G$O!"\e(BMagicPoint \e$B$GH/I=$9$k:]$K5$$K$J$kBg$-$JJ8;z$rH~$7$/I=<($9$k\e(B
+\e$BJ}K!$K$D$$$F@bL@$7$^$9!#\e(B
+
+\e$BI8=`E*$JJ}K!\e(B
+============
+
+FreeType \e$B%i%$%V%i%j$rMxMQ$7$?%9%1!<%i%V%k%U%)%s%H$NMxMQ\e(B
+-------------------------------------------------------
+
+FreeType \e$B%i%$%V%i%j$O!"\e(BFreeType \e$B%W%m%8%'%/%H\e(B
+       http://www.freetype.org/
+\e$B$,G[I[$7$F$$$k%U%j!<$N\e(B TrueType \e$B%U%)%s%H!&%l%s%@%i!<$G$9!#\e(BMagicPoint 
+\e$B$O\e(BFreeType \e$B%i%$%V%i%j$rAH$_9~$`$3$H$G!"D>@\\e(B TrueType \e$B%U%)%s%H$rMxMQ$G\e(B
+\e$B$-$k$h$&$K$J$j$^$9!#$*;H$$%7%9%F%`$K\e(B FreeType \e$B%i%$%V%i%j\e(B(libttf.a)\e$B$,%$\e(B
+\e$B%s%9%H!<%k$5$l$F$$$k>l9g!"\e(BMagicPoint \e$B$N9=C[;~\e(B(configure\e$B%9%/%j%W%H<B9T\e(B
+\e$B;~\e(B)\e$B$K<+F0E*$KAH$_9~$^$l$k$h$&$K$J$C$F$$$^$9!#\e(B
+
+\e$B$b$7!"\e(BFreeType \e$B%i%$%V%i%j$r4^$^$J$$\e(B MagicPoint \e$B$r:n@.$7$?$$>l9g$O!"\e(B
+       ./configure --disable-freetype
+\e$B$N$h$&$K!"\e(Bconfigure\e$B%9%/%j%W%H$N0z?t$K\e(B--disable-freetype\e$B$r$D$1$F<B9T$7\e(B
+\e$B$F$/$@$5$$!#\e(B
+
+\e$BCm0U!'8=:_\e(B FreeType \e$B%i%$%V%i%j$rD>@\MxMQ$9$kJ}K!$G$O!"1QJ8;z%U%)%s%H$7\e(B
+\e$B$+MxMQ$G$-$^$;$s!#6aF|Cf$K$O!"F|K\8l%U%)%s%H$b%5%]!<%H$9$kM=Dj$G$9!#\e(B
+
+TrueType \e$B%U%)%s%H\e(B(\e$B%U%j!<\e(B/\e$B>&MQ\e(B)\e$B$N<hF@J}K!$O!"!X\e(BTrueType \e$B%U%)%s%H$N<hF@\e(B
+\e$BJ}K!!Y$r;2>H$7$F$/$@$5$$!#\e(B
+
+
+\e$BI8=`E*$J\e(BX11\e$B%5!<%P$rMxMQ$7$?%9%1!<%i%V%k!&%U%)%s%H$NMxMQ\e(B
+-----------------------------------------------------
+\e$B1QJ8;z%U%)%s%H$K4X$7$F$O!"\e(BX11\e$B%5!<%P$OI8=`$G!"\e(BAdobe Type1\e$B7A<0$N%9%1!<%i\e(B
+\e$B%V%k!&%U%)%s%H$rMxMQ$G$-$^$9!#\e(BAdobe Type1 \e$B7A<0$N%U%)%s%H$r;H$&$K$O!"\e(B
+X11\e$B%U%)%s%H%Q%9$,DL$C$F$$$k>l=j$K\e(B(\e$BDL>o$O\e(B/usr/X11R6/lib/X11/font/Type1)
+\e$B$K%U%)%s%H$,CV$+$l$F$$$J$1$l$P$J$j$^$;$s!#\e(B
+
+\e$B$*;H$$$N%7%9%F%`$K\e(B Type1 \e$B%U%)%s%H$,4^$^$l$F$$$J$$!"$b$7$/$O!"I,MW$J%U%)\e(B
+\e$B%s%H$,7g$1$F$$$k>l9g$O!"$4<+J,$G%$%s%9%H!<%k$7$F$/$@$5$$!#\e(B
+
+X11\e$BI8=`G[IU$K$D$$$F$$$k$b$N0J30$K$b!"$$$/$D$+$N\e(BAdobe Type1\e$B7A<0$N%U%)%s%H$r\e(B
+       http://www.gimp.org/fonts.html
+       ftp://ftp.gimp.org/pub/gimp/fonts/
+\e$B$+$i<hF@$9$k$3$H$,$G$-$^$9!#\e(B
+
+\e$B%U%)%s%H$r%$%s%9%H!<%k$7$?%G%#%l%/%H%jCf$K!"\e(Bfonts.dir \e$B$r:n@.$9$k$3$H$r\e(B
+\e$BK:$l$J$$$h$&$K$7$F$/$@$5$$!#\e(Bfonts.dir \e$B$O\e(B mkfontdir \e$B%3%^%s%I$G:n@.$7$^\e(B
+\e$B$9!#\e(Bmkfontdir \e$B%3%^%s%I$K$D$$$F$O\e(B man \e$B$r;2>H$7$F$/$@$5$$!#\e(B
+
+\e$B$^$?!"K:$l$:$K\e(B Type1 \e$B%U%)%s%H$,CV$+$l$?%G%#%l%/%H%j$X$N%U%)%s%H!&%Q%9\e(B
+\e$B$r@_Dj$9$k$h$&$K$7$F$/$@$5$$!#%7%9%F%`$K$h$C$F%U%)%s%H!&%Q%9$N@_DjJ}K!\e(B
+\e$B$,0[$J$k$3$H$,$"$k$N$G!"$*;H$$$N\e(B X \e$B%5!<%P$N%^%K%e%"%k$r;2>H$7$F$/$@$5\e(B
+\e$B$$!#\e(B
+
+\e$B%U%)%s%H$r%$%s%9%H!<%k$7$?D>8e$b$7$/$O%U%)%s%H!&%Q%9DL$7$?D>8e$O\e(B
+       xset fp rehash
+\e$B%3%^%s%I$rMxMQ$7$F\e(B X \e$B%5!<%P$N%U%)%s%H>pJs$r99?7$7$F$/$@$5$$!#\e(B
+
+\e$B@5$7$/%U%)%s%H$,%$%s%9%H!<%k$5$l$F$$$k$+$O!"\e(Bxfontsel \e$B$*$h$S\e(B xlsfonts\e$B$G\e(B
+\e$B3NG'$G$-$^$9!#\e(BType1 \e$B%U%)%s%H$O\e(B XLFD \e$B$H$7$F$O\e(B "-adobe-" \e$B$G;O$^$kL>A0$,\e(B
+\e$B$D$$$F$$$^$9$N$G!"$=$N%U%)%s%H$,$"$k$3$H$r3NG'$7$F$/$@$5$$!#\e(B
+
+\e$B%9%1!<%i%V%kF|K\8l%U%)%s%H$NMxMQ\e(B
+--------------------------------
+[VFlib\e$B$rMxMQ$7$?>l9g\e(B]
+
+VFlib
+       ftp://gull.se.hiroshima-u.ac.jp/pub/VFlib/
+\e$B$O3F<o$N%9%1!<%i%V%k%U%)%s%H$r07$&$3$H$,$G$-$k%U%)%s%H!&%(%s%8%s%i%$%V\e(B
+\e$B%i%j$G$9!#\e(B
+
+MagicPoint \e$B$O\e(B VFlib \e$B%i%$%V%i%j$rAH$_9~$`$3$H$G!"MM!9$J7A<0$N%9%1!<%i%V\e(B
+\e$B%k!&%U%)%s%H$rMxMQ$G$-$k$h$&$K$J$j$^$9!#$*;H$$%7%9%F%`$K\e(B VFlib \e$B%i%$%V\e(B
+\e$B%i%j\e(B(libVFlib.a)\e$B$,%$%s%9%H!<%k$5$l$F$$$k>l9g!"\e(BMagicPoint \e$B$N:n@.;~\e(B
+(configure\e$B%9%/%j%W%H<B9T;~\e(B)\e$B$K<+F0E*$KAH$_9~$^$l$k$h$&$K$J$C$F$$$^$9!#\e(B
+
+\e$B$b$7!"\e(BVFlib \e$B%i%$%V%i%j$r4^$^$J$$\e(B MagicPoint \e$B$r:n@.$7$?$$>l9g$O!"\e(B
+       ./configure --disable-vflib
+\e$B$N$h$&$K!"\e(Bconfigure \e$B%9%/%j%W%H$N0z?t$K\e(B --disable-vflib \e$B$r$D$1$F<B9T$7\e(B
+\e$B$F$/$@$5$$!#\e(B
+
+\e$BF|K\8l$N%9%1!<%i%V%k!&%U%)%s%H$rMxMQ$7$F$b1QJ8;z$rH~$7$/=PNO$G$-$^$9$,!"\e(B
+\e$BF|K\8l$N%U%)%s%H$O?t@iJ8;z$N%U%)%s%H$r4^$s$G$$$k4X78>e$H$F$bBg$-$$$N$G!"\e(B
+\e$B1Q8l$7$+MxMQ$7$J$$%f!<%6$K$H$C$F$O$A$g$C$HL5BL$+$b$7$l$^$;$s!#\e(B
+
+[VFlib\e$B$H\e(BFreeType\e$B$NJ#9gMxMQ\e(B]
+
+\e$B8=;~E@$G$O!"\e(BMagicPoint \e$B$G$O\e(B FreeType \e$B$O1QJ8;z%U%)%s%H$N$_$K!"\e(BVFlib \e$B$O\e(B
+\e$BF|K\8l%U%)%s%H$N$_$KMxMQ$9$k$h$&$K$J$C$F$$$^$9!#\e(B
+
+
+\e$B9g$o$;5;\e(B
+========
+
+FreeType \e$B$KBP1~$7$?\e(B X11 \e$B%5!<%P$K$h$k%9%1!<%i%V%k!&%U%)%s%H$NMxMQ\e(B
+---------------------------------------------------------
+
+[\e$B1QJ8;z%U%)%s%H$N$_$NMxMQ\e(B]
+
+\e$B%U%j!<$N\e(B TreeType \e$B%U%)%s%H!&%l%s%@%i$G$"$k\e(B FreeType \e$B%i%$%V%i%j$,8x3+$5\e(B
+\e$B$l$F$+$i!"\e(BFreeType \e$B$r\e(B X11 \e$B%5!<%P<+BN$b$7$/$O\e(B X11 \e$B%U%)%s%H!&%5!<%P\e(B(xfs)
+\e$B$KAH$_9~$b$&$9$kF0$-$,3hH/2=$7$F$*$j!"$$$/$D$+$N%W%m%8%'%/%H$,<BAu$r;n\e(B
+\e$B$_$F$$$^$9!#\e(B
+
+\e$B$?$H$($P!"\e(B
+       http://www.freetype.org/projects.htm
+       http://www.gimp.org/fonts.html
+               "Using TrueType fonts with Gimp and X"\e$B%;%/%7%g%s$r\e(B
+               \e$B;2>H$N$3$H\e(B
+\e$B$N%5%$%H$G8x3+$5$l$F$$$^$9!#\e(B
+
+\e$B$3$l$i$N\e(B FreeType \e$B$,AH$_9~$^$l$?\e(B X11 \e$B%5!<%P$rMxMQ$9$k$H!"MM!9$J\e(B
+TrueType \e$B%U%)%s%H$r\e(B X11 \e$B$N%U%)%s%H$H$7$FMxMQ$G$-$k$h$&$K$J$j$^$9!#\e(B
+
+\e$B$3$l$i$N%U%)%s%H$N\e(B XLFD \e$B$r;XDj$9$k$3$H$G!"\e(BMagicPoint \e$B$+$iMxMQ$G$-$k$h\e(B
+\e$B$&$K$J$j$^$9!#\e(B
+
+
+[\e$B1QJ8;z\e(B/\e$BF|K\8l%U%)%s%H$NMxMQ\e(B]
+
+\e$BF|K\8l\e(B TrueType \e$B$K4X$7$F$b!"\e(BFreeType \e$B$rAH$_9~$s$@\e(B X11 \e$B%5!<%P$*$h$S\e(B X11 
+\e$B%U%)%s%H!&%5!<%P$GMxMQ$7$h$&$H$$$&F0$-$,$"$j$^$9!#\e(B
+
+\e$B$?$H$($P!"\e(B
+       http://cclub.cc.tut.ac.jp/~go/unix/xtt.html
+       http://hawk.ise.chuo-u.ac.jp/student/person/tshiozak/x-tt/
+\e$B$N%5%$%H$G8x3+$5$l$F$$$^$9!#\e(B
+
+\e$B$3$l$i$N%U%)%s%H$N\e(B XLFD \e$B$r;XDj$9$k$3$H$G!"\e(BMagicPoint \e$B$+$iMxMQ$G$-$k$h\e(B
+\e$B$&$K$J$j$^$9!#\e(B
+
+
+VFlib \e$B$KBP1~$7$?\e(B X11 \e$B%5!<%P$K$h$k%9%1!<%i%V%k!&%U%)%s%H$NMxMQ\e(B
+------------------------------------------------------
+
+VFlib \e$B$rAH$_9~$s$@\e(B X11 \e$B%5!<%P$*$h$S\e(B X11 \e$B%U%)%s%H!&%5!<%P$rMxMQ$7$F1Q8l\e(B
+\e$B$dF|K\8l$rI=<($G$-$^$9!#\e(B
+
+\e$B$?$H$($P!"\e(B
+       http://karin.ip.titech.ac.jp/~takagi/X-VFlib/index.html
+\e$B$N%5%$%H$G8x3+$5$l$F$$$^$9!#\e(B
+
+\e$B$3$l$i$N%U%)%s%H$N\e(B XLFD \e$B$r;XDj$9$k$3$H$G!"\e(BMagicPoint\e$B$+$iMxMQ$G$-$k$h$&\e(B
+\e$B$K$J$j$^$9!#\e(B
+
+
+VFlib/FreeType \e$BJ#9g%i%$%V%i%j$K$h$k%9%1!<%i%V%k!&%U%)%s%H$NMxMQ\e(B
+------------------------------------------------------------
+
+VFlib \e$B$H\e(B FreeType \e$B$r9g$o$;$?%i%$%V%i%j$,B8:_$7$^$9!#\e(BVFlib API \e$B$rMxMQ$7\e(B
+\e$B$F\e(B FreeType \e$B$N5!G=$rMxMQ$9$k$b$N$d!"\e(BFreeType \e$B$r3HD%$7$F\e(BVFlib\e$B5!G=$rMxMQ\e(B
+\e$B$G$-$k$h$&$K$9$k$b$N$,$"$j$^$9!#\e(B
+
+\e$B$I$A$i$N>l9g$G$b!"\e(B(\e$B$?$V$s\e(B) MagicPoint \e$B$G$b$=$N$^$^MxMQ$G$-$k$G$7$g$&!#\e(B
+
+\e$B$^$?!"EvA3$G$9$,!"$3$l$i$N%U%)%s%H!&%l%s%@%i$r\e(B X11 \e$B%5!<%P$*$h$S\e(B X11 \e$B%U%)\e(B
+\e$B%s%H!&%5!<%P$KAH$_9~$s$G$$$k>l9g$O!"\e(BMagicPoint \e$B$G$b\e(B XLFD \e$B$r;XDj$9$k$3\e(B
+\e$B$H$G\e(BX\e$B$N%U%)%s%H$H$7$FMxMQ$G$-$^$9!#\e(B
+
+
+\e$B$=$NB>;(B?$J$3$H\e(B
+================
+
+TrueType \e$B%U%)%s%H$N<hF@J}K!\e(B
+--------------------------
+
+\e$B0J2<$N%5%$%H$G!"%U%j!<$N\e(B TrueType \e$B%U%)%s%H$r<hF@$G$-$^$9\e(B:
+       http://www.aaa.nl/people/mkatwijk/freettf.html
+       http://come.to/freefonts
+       CTAN mirros, pub/CTAN/fonts/cm/ps-type1/bakoma/ttf
+               Computer modern fonts in TrueType format
+
+\e$B$^$?!"0J2<$N%5%$%H$G<hF@$G$-$k%U%)%s%H$O!"L5NA$G$9$,%i%$%;%s%9$K>/$7Ld\e(B
+\e$BBj$,$"$j$^$9!#\e(B
+       http://microsoft.com/typography/fontpack/default.htm
+               \e$B%i%$%;%s%9$K$O%U%j!<$G$"$k$H=q$+$l$F$$$^$9$,!"\e(B
+               Windows\e$B%W%i%C%H!&%U%)!<%`$G$7$+E83+$G$-$J$$<+8J2rE`\e(B
+               \e$B7A<0%P%$%J%j$GG[I[$5$l$F$$$^$9!#E83+$N:]$K$O%i%$%;\e(B
+               \e$B%s%9>r9`$X$NF10U$,I,MW$K$J$j!"<+F0E*$K\e(Bwindows\e$B$N%U%)\e(B
+               \e$B%s%H%G%#%l%/%H%j$K%$%s%9%H!<%k$5$l$^$9!#\e(B
+       http://www.bitstream.com/products/world/cyberbits/index.html
+               \e$BL5NA$G%@%&%s%m!<%I$G$-$^$9$,!"$=$N:]$K%5%$%s$7$J$$\e(B
+               \e$B$H$$$1$^$;$s!#\e(BCDROM \e$B$r9XF~$9$k$3$H$G$b<hF@$G$-$^$9!#\e(B
+
+\e$B>&MQ%U%)%s%H$rMxMQ$9$k$N$bNI$$J}K!$G$7$g$&!#0J2<$N%5%$%H$G$O%$%s%?!<%M%C\e(B
+\e$B%H>e$G%*%s%i%$%s$G%U%)%s%H$rHNGd$7$F$$$^$9\e(B:
+       http://www3.digitalriver.com/bit/index.html
+       http://www.arttoday.com/
+       http://www.matchfonts.com/
+
+\e$B$^$?!"%Q%=%3%s!&%7%g%C%WE9F,$G!V%U%)%s%H!&%3%l%/%7%g%s\e(B CD-ROM\e$B!W$NN`$r\e(B
+\e$B9XF~$9$k$N$b$$$$$G$7$g$&!#\e(B
diff --git a/SYNTAX b/SYNTAX
new file mode 100644 (file)
index 0000000..e44f924
--- /dev/null
+++ b/SYNTAX
@@ -0,0 +1,256 @@
+$Id: SYNTAX,v 1.18 1998/09/04 13:11:54 itojun Exp $
+
+placement restriction for directives:
+               .mgprc          preamble        main pages
+               ---             ---             ---
+%vfcap         okay            x               okay
+%tfdir         okay            x               okay
+%tfont0                okay            x               okay
+%default       x               okay            x
+%tab           x               okay            x
+%deffont       x               okay            x
+%include       x               okay            okay
+others         x               x               okay
+
+
+#
+       Comment lines.
+
+%size <size>
+       <size> :: size of fonts
+
+%fore "color"
+       "color" :: color of foreground
+
+%back "color"
+       "color" :: color of background
+
+%bgrad <xsize> <ysize> <nuncolor> <dir> <zoomflag> <colorlist...>
+       <xsize> :: width of generated image(0-100%)
+                       0 means physical display size
+       <ysize> :: height of generated image(0-100%)
+                       0 means physical display size
+       <numcolor> :: number of colors, 0 means no reduction.
+                       default 256 colors(8bit)
+       <dir> :: gradation direction (0-360 degree) 
+                0 :Top to Bottom   90 :Left to Right
+               180:Bottom to Top 270 :Right to Left
+                       default 0
+               negative value means "non-liner gradation"
+       <zoomflag> :: zoom to max size
+               0 nozoom, 1 zoom
+                       default 0
+       <colorlist> :: colors in the gradation image
+
+%left
+       Left justify.
+
+%leftfill
+       Left justify, with folding long line.
+
+%center
+       Centering.
+
+%right
+       Right justify.
+
+%shrink
+       (not supported at this moment)
+
+%lcutin
+       Text will be animated (flying from the leftmost edge of the page).
+
+%rcutin
+       Text will be animated (flying from the leftmost edge of the page).
+
+%cont
+       Draw without line break.
+
+%nodefault
+       Disable effect of default directive.
+
+%xfont "font"
+       <font> :: use X11's <font> to draw ASCII characters.
+
+       interpretation of "font":
+       - If it has no dash inside,
+               Try font alias, such as "8x5" or "a14".
+               If there's no font alias matched, it should be "times" or
+               something like that. In this case, try
+               "-*-FONT-*-*-*-*-SIZE-*-*-*-*-*-iso8859-1".
+       - If it has single dash inside, such as "times-medium":
+               Try "-*-FONT-NAME-*-*-*-SIZE-*-*-*-*-*-iso8859-1".
+       - If it has two dash inside, such as "times-medium-r":
+               Try "-*-FONT-NAME-SPECIFIED-*-*-SIZE-*-*-*-*-*-iso8859-1".
+       - Otherwise, try the specified string itself as XLFD.
+
+%vfont "font"
+       <font> :: use VFlib's <font> to draw Kanji characters.
+
+%tfont "font"
+       <font> :: use TrueType font <font> to draw ASCII characters.
+               <font> can be full pathname, or just filename.  Use %tfdir
+               for setting default font directory.
+
+%tfont0 "font"
+       <font> :: use TrueType font <font>, if none of the font specified by
+               %tfont directive is found.  This is the last-resort for the
+               TrueType font finding code.
+               (allowed in ~/.mgprc, without "%" sign)
+
+%bar <color> <width> <start> <length>
+       <color> :: color of bar, foreground color will be used as default.
+       <width> :: permill of display height. default 10.
+       <start> :: start position percent of display width. default 0.
+       <length> :: length percent of display width. default 100.
+
+%image "imagefile" <numcolor> <xzoomrate> <yzoomrate> <zoomflag>
+%image "imagefile" [<numcolor>] <screensize>
+       "imagefile" :: name of image file
+       <numcolor> :: number of colors, 0 means no reduction.
+       <xzoomrate> :: height percentage against physical display or original
+                       size, 0 means the original height.
+       <yzoomrate> :: width percentage against physical display or original
+                       size, 0 means the original width.
+       <zoomflag> :: 0 means zoomrate is against physial display
+                       others mean zoomrate is against original size   
+
+       <screensize> :: auto resizing.
+                       specify the original screen size by WIDTHxHEIGHT.
+                       unless screensize is the same size of the physical
+                       display, zoomrate is calculated automagically.
+
+       Note that if the image is a binary image, current foreground
+       and background colors are applied to the drawn image.
+
+%prefix "string"
+       Place "string" at the beginning of line.
+       "string" should be a set of blank characters (\040).
+
+       The effect of %prefix command in %tab command is local to
+       tab-indented line.
+
+%icon <arc|box|delta1|delta2|delta3|delta4|dia> <color> <size>
+%icon <imagefile> <color> <size>
+       add an icon for itemizing lines.
+       for example,
+               %tab 1 size 5, icon box green 50
+       gives you an green box on the leftmost column of line.
+       size is the percentage against the current character size.
+
+%bimage "imagefile"
+       Specify the name of background image file
+
+%default <linenum> <list-of-directives>
+       Unless nodefault directive is specified, the directives in the
+       argument is prepended to the directives of the linenum'th line
+       in every page. The syntax of <list-of-directives> is a comma
+       separated directives.
+       This directive has to be placed in the preamble.
+
+%tab <tabnum> <list-of-directives>
+       Apply list of directives, if any of the lines start with tabnum
+       tabs.
+       This directive has to be placed in the preamble.
+
+%tab <id> <list-of-directives>
+       Apply list of directives, if any of the lines start with "&id".
+       This directive has to be placed in the preamble.
+
+%page
+       A new page starts
+
+%vgap <gapsize>
+       Specify vertical gap size of each line
+       <gapsize>:: percentage against current character size
+               vertical gap = vertical font size * gapsize / 100
+
+%hgap <gapsize>
+       Specify horizontal gap size of each line
+       <gapsize>:: percentage against current character size
+               horizontal gap = vertical font size * gapsize / 100
+       NOTE: horizontal gap is calculated based on vertical size,
+       because fonts are proportional (horizontal size varies by code point).
+
+%pause
+       Stop drawing until forward key or button is pressed
+
+%mark
+       Mark the current position on the screen, so that we can come back
+       later by %again.
+       NOTE: mark is local to a page.  mark will be cleared at the page
+       boundary.
+
+%again
+       Move current position to the location marked by %mark.
+
+%system "command"
+       Fork&exec the specified program.
+       NOTE: the program will be invoked every time the page is redrawn.
+       It sometimes annoy you.  it needs some rework.
+
+       Special translation for presentation-window-relative geometry:
+               Argument that starts with "%" will be translated as if
+               it was interpreted relative to presentation window.
+
+               "xeyes -geometry %50x50+25+25"  will be translated
+               so that eyes appear on the center of the presentation window.
+
+       The command has to be placed on a line alone.
+       Do not use commas.
+
+       Process will be killed when you leave the page.
+
+%system "command" <page>
+       Almost same as above.
+       Process will be killed when you leave the specified <page>.
+       If you set <page> to -1, the process will be killed when MagicPoint
+       is terminated. (of course, you can terminate the child process alone
+       by yourself)
+
+%filter "command"
+TEXT
+%endfilter
+       Fork&exec the specified program, feed TEXT into that process
+       from standard input.  use the standard output from the process
+       as presentation input.
+       Do not forget to place %endfilter.
+
+       The command has to be placed on a line alone.
+       Do not use commas.
+
+%vfcap "filename"
+       Specifies VFlib configuration filename.
+       (allowed in ~/.mgprc, without "%" sign)
+
+%tfdir "dir"
+       Specifies where to find TrueType font by default.
+       (allowed in ~/.mgprc, without "%" sign)
+
+%deffont "fontname" <list-of-directives>
+       Define a symbolic fontname, by using list-of-directives.
+       The directive must appear in the preamble.
+
+       For example, you may want to define a typewriter-like font as:
+               %deffont "typewriter" xfont "courier", tfont "cour.ttf"
+       By using the above definition, you can make your presentation file
+       less dependent to the configuration of magicpoint binary.
+       If the configuration allows the use of TrueType "cour.ttf" font,
+       "tfont" directive will be effective.  If there's no TrueType font
+       available, or FreeType library is not compiled into the magicpoint
+       binary you are currently using, "xfont" will be effective.
+
+       "%font" cannot be used in "%deffont".  this is for avoiding infinite
+       loops.
+
+%font "fontname"
+       Invoke the symbolic fontname defined by %deffont directive.
+
+%embed "filename"
+%endembed
+       Embedded image support.  uuencoded data fragment can be put between
+       the directives.
+       NOTE: this directive is not for human beings.  use "mgpembed" command.
+
+%noop
+       No operation
diff --git a/TODO.jp b/TODO.jp
new file mode 100644 (file)
index 0000000..bf63ea7
--- /dev/null
+++ b/TODO.jp
@@ -0,0 +1,58 @@
+TODOs
+$Id: TODO.jp,v 1.21 1998/07/20 17:50:15 itojun Exp $
+
+mgp2ps
+- gif\e$B2hA|$r\e(Bsubroutine\e$B2=$7$F\e(Bps\e$B$r$A$$$5$/\e(B
+- image\e$B$GFI$s$@\e(Beps\e$B%U%!%$%k$N\e(Bzoom
+- \e$B<PBN%U%)%s%H\e(B
+- \e$B2hLL$H0u:~%$%a!<%8$r6a$E$1$k\e(B
+
+\e$BA4BN\e(B
+- draw.c\e$B$H\e(Bprint.c\e$B$NM;9g\e(B(\e$B$$$^$O;w$?$h$&$J%3!<%I$,\e(B2\e$B=E$K$"$k\e(B)
+- \e$B2hLLI=<(;~$K<!$N%Z!<%8%$%a!<%8$r\e(B pixmap \e$B$K:n@.$7$F$*$/\e(B
+- \e$B<+F0E*$J8:?'\e(B
+- %pause\e$B$rL5;k$7$F<!$K?J$`\e(Bdirective
+- table
+- vflib3\e$B$r$?$a$7$F$_$k\e(B
+- X resouce \e$B$N%5%]!<%H!#\e(B.Xdefaults \e$B$G\e(B default \e$B$N5sF0$N;XDj!#\e(B
+- image \e$B$N\e(B antialias
+- debug: itojun branch
+       %image\e$B$HIaDL$N%F%-%9%H$N2#$J$i$Y\e(B
+       %image\e$B$NG[CV\e(B
+       shrink
+       lcutin/rcutin\e$B$NGX7J2hA|\e(B
+
+=== done, partially.
+- \e$BGX7J%0%i%G!<%7%g%s\e(B
+- /etc/magic (#!)
+- mgp2ps\e$B$G%+%i!<\e(Bps\e$B=PNO\e(B
+- \e$B2hA|\e(B(\e$BFC$K\e(Beps)\e$B$N\e(Bcache
+- 2\e$BCM\e(Bbmp\e$B$r\e(Bforeground color\e$B$H\e(Bbackground color\e$B$GIA2h\e(B
+- bimage \e$B$r;HMQ$7$F$$$J$$>l9g$K\e(B xbm/bitmap \e$B$J$I$r\e(B fore/back \e$B$GI=<(\e(B
+
+=== done
+- pixmap, maskpix \e$B$rDIJ|$7$F!":BI87O$r@0M}$9$k\e(B
+- bimage \e$B$r;HMQ$7$F$$$J$$>l9g$N9bB.2=\e(B
+- transparent gif
+- back\e$B$H\e(Bbimage\e$B$NE}9g\e(B
+       bimage\e$B$H\e(Bback\e$B$r=E$M$k$H\e(BVFlib\e$B$G=q$$$?\e(Bfont\e$B$N\e(Battribute\e$B$,$/$5$k\e(B
+       bimage\e$B$b\e(Bpage_attribute\e$B$G;XDj$7$F\e(Bdraw\e$B$9$k$h$&$K$9$k$N$,NI$$\e(B
+- font\e$B4XO"$r\e(Bfont.c\e$B$KJ,$1$k!#\e(Bvflib\e$B$N%U%)%s%H$K%"%s%@!<%i%$%s!"$H$+!#\e(B
+- antialias
+- \e$BJ8;zI=<($N\e(Boptimization\e$B!#!V\e(Band\e$B$7$F\e(Bor\e$B$9$k!W$N$r0l7b$G$d$l$J$$$+\e(B?
+       window\e$B$r=E$M$FIA2h$r$O$d$/\e(B(\e$BF)L@$K$9$k$N$O$I$&$d$k$N\e(B?)
+- timebar
+- %include directive \e$B$N%5%]!<%H!#$3$N;~$N\e(B search path \e$B$NDj5A!#\e(B
+- \e$BI=<(Cf$K%/%j%C%/$7$?>l9g$NBP=h\e(B (skip\e$B$7$F\e(Bx event\e$B$r=hM}\e(B)
+- \e$BD9$$9T$N\e(B folding
+       %leftfill
+- leftfill\e$B$N$H$-$N6XB'=hM}\e(B
+- leftfill\e$B$N$H$-$N1Q8l$N9TKv=hM}\e(B(\e$B$;$a$FC18l$G6h@Z$j$?$$\e(B)
+- %system directive (\e$B30It%W%m%;%9$N8F$S=P$7\e(B)
+       \e$B30It%W%m%;%9$N=PNO$r?)$($?$j!"\e(B<<EOF\e$B$G$-$?$j$9$k$H$b$C$H$h$7!#\e(B
+       (-> %filter)
+- \e$BMn=q%l%$%d\e(B/\e$B5!G=\e(B
+       \e$B%Z%s$N?'$KBP$9$k9M;!$H$+I,MW\e(B? -> 5\e$B?'A*Br2D\e(B
+- reload (control-R)
+- freetype\e$B$ND>@\%5%]!<%H\e(B
+- gs-view.c\e$B$H$5$h$J$i\e(B
diff --git a/USAGE b/USAGE
new file mode 100644 (file)
index 0000000..6e0fccf
--- /dev/null
+++ b/USAGE
@@ -0,0 +1,233 @@
+                How to make .mgp files (cheat sheet)
+
+                     Kazu Yamamoto (with Chaki)
+
+                         September 4, 1998
+
+
+All .mgp commands start with "%". After making sure that
+/usr/X11R6/lib/X11/mgp/default.mgp exists, add the following line to
+the beginning of the .mgp file.
+
+       %include default.mgp
+
+This determines the default style. Each page begins with "%page".
+
+       %page
+
+       TITLE
+
+       Body
+
+MagicPoint is line oriented. Don't write anything in the first line
+because the default style uses the first line for making space at the
+top of the screen. The second line is the title of the page. The third
+line is transformed into a horizontal line. The fourth line on becomes
+the body.
+
+When there is a "%" at the beginning of a line, the rest of the line
+becomes a command. Multiple commands separated by "," can be written
+in a single line. To make the size 7% of the screen and the foreground
+color yellow, one would write:
+
+       %size 7, fore yellow
+       This line is big and yellow.
+
+Any line that starts with "%" won't show up on the screen nor will it
+be counted as a line. The following parameters can be used to change
+how a line looks.
+
+       text color                      %fore
+       background color                %back
+       text size                       %size
+       text placement                  %center, %left, %right
+       space between characters        %hgap
+       space between lines             %vgap
+       Font                            %font
+
+There are a few others, but this should be enough for now. The
+parameters of default.mgp are set as follows:
+
+       %default 1 leftfill, size 2, fore "white", back "black", font "thick"
+       %default 2 size 7, vgap 10, prefix " "
+       %default 3 size 2, bar "gray70", vgap 10
+       %default 4 size 5, fore "white", vgap 30, prefix " ", font "standard"
+
+%default set the parameters for the line specified in the first
+argment to the values specified the second and later argments. In the
+first line, the size is 2% and in the second line the size is set to
+7%. Parameters set in previous lines are valid unless
+overwritten. Therefore, the text in the second line will be white.
+
+When MagicPoint shows a particular line, it first refers to the
+%default values. Then it refers to the values set within the
+body. Values of the previous line remain valid unless set otherwise.
+
+Let's take a look at the following example:
+
+       %page
+                                               (A space of 2%)
+       TITLE --- size 7% color white and in gothic font
+                                               (horizontal line)
+       text --- size 5% white gothic font
+       %fore yellow, size 4
+       text --- size 4% yellow gothic font 
+       %vfont min
+       text --- size 4% yellow mincho font 
+
+%tab is a command that directly associates with the line. In
+default.mgp it is set as follows:
+
+       %tab 1 size 5, vgap 40, prefix "  ", icon box green 50
+       %tab 2 size 4, vgap 40, prefix "      ", icon arc yellow 50
+       %tab 3 size 3, vgap 40, prefix "            ", icon delta3 white 40
+
+When there is a singular tab at the head of the line, the values of
+%tab override the current values and become valid. When there are two
+tabs at the head of the line, %tab2 becomes valid, when there are
+three tabs at the head of the line %tab3 becomes valid and so on.
+
+In other words,
+1 tab means text size 5% and the line starts with spaces and green box icon.
+2 tabs mean text size 4% and the line starts with spaces and yellow arc icon. 
+3 tabs mean text size 3% and the line starts with spaces and white delta3 icon.
+
+By using this, it's easy to itemize. Let's take a look at an example:
+
+       %page
+
+       Emacs and friends
+
+               Emacs
+                       19 is currently the main stream
+                       20 has been released
+               Mule
+                       2.3 is most used
+                       Integrated to Emacs and XEmacs 
+               XEmacs
+                       19 is the English version
+                       20 is the International version
+
+To find out more about the other commands, take a look at SYNTAX or
+sample/*.mgp.
+
+                           Life with tgif
+
+
+MagicPoint cannot display tgif objs but there is a way to sort of get
+around this.
+
+       If you cannot use ghostscript:
+       - make tgif create a GIF file for screen display
+       - make tgif create an EPS file for printing out
+       If you have ghostscript:
+       - craete EPS file from tgif "obj" file and use that for both cases
+
+If you cannot use ghostscript:
+
+The image created by tgif is displayed "as is" on MagicPoint's screen.
+This is pretty sad when fonts aren't displayed clearly when viewing
+with tgif. Either Mincho or Gothic font is provided for 14, 16, 24,
+and 26 dot. So it's possible to give xrdb something like the
+following, and then make tgif create a GIF file.
+
+Tgif*Background: black
+Tgif*Foreground: white
+Tgif*WhereToPrint: EPS
+Tgif*InitialFontSize: 16
+Tgif*InitialKanjiFont: Gothic
+Tgif*FontSizes: 14 16 24 26
+Tgif*NihongoFonts: \
+       -*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
+       Ryumin-Light-EUC-H, Ryumin, \
+       H, false, 24, 26 \n\
+       -*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
+       GothicBBB-Medium-EUC-H, Gothic, \
+       H, false, 16, 18 \n\
+       -*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
+       Ryumin-Light-EUC-V, Ryumin-V, \
+       V, false, 24, 26 \n\
+       -*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
+       GothicBBB-Medium-EUC-V, Gothic-V, \
+       V, false, 16, 18
+
+EPS files can be created just by typing:
+       tgif -print -eps *.obj
+This is convenient when you have a whole lot of files.
+
+However, some files might not get the right colors using this way. If
+you find any files that don't have the right colors, try manually
+creating the EPS file using tgif.
+
+If corresponding filename.eps exists for filename.{gif,jpg,...}, mgp2ps
+uses filename.eps when creating a PS file.
+
+If you want to bundle two pages into one, you could try this:
+       pstops '2:0R@.5(2cm,26cm)+1R@.5(2cm,13cm)' input.ps > output.ps
+
+If you can ghostscript:
+
+Generate eps file, again by using
+       tgif -print -eps *.obj
+command.
+
+Paste the eps file into your presentation by adding
+       %image "foobaa.eps"
+then, mgp will render the eps file on-the-fly, by invoking ghostscript.
+mgp2ps will properly include the eps file into the output.
+
+
+                       Mathematical Formulas
+
+There are, at least, three way to include mathematical formulas in 
+.mgp file.
+
+(1) TeX
+- Obtain .dvi file for the expression with TeX.
+- With dvipr you can obtain .eps file for the dvi.
+- Include .eps file into your presentation as follows:
+
+       %image "foo.eps"
+
+(2) eqn/troff
+- Obtain .ps file for the expression with eqn/troff.
+- Convert .ps file to .eps file. (e.g. pstoepsi)
+- Include .eps file into your presentation as follows:
+
+       %image "foo.eps"
+
+(3) Bitmap (not recommended)
+- Obtain .ps file for the expression with TeX or eqn/troff.
+- Convert .ps file to .pnm file.(e.g. pstopnm)
+- Convert .pnm file to .pbm file (e.g. pnmcrop)
+- Include .pbm file into your presentation as follows:
+
+       %image "foo.pbm"
+
+
+                       Pasting foils onto the web
+
+If you wish to paste your magicpoint presentation, you have three options.
+
+If you can assume that the client-side has magicpoint, you can paste
+a presentation file after processing that by "mgpembed" program.
+       1. Merge images into presentation file, by using "mgpembed".
+          mgpembed generates single archive-like presentation file, which
+          includes images (encoded by uuencode).
+       2. Paste the generated file onto the web, under name "foo.mgp".
+Client side (Browser) needs to be configured as follows:
+- Define "helper application" for extention ".mgp" as,
+       mgp -g 400x300 -S <filename>
+You can specify any screeen size as you want.  Here, -S is REALLY important
+for security, since magicpoint presentation can include arbitrary shell
+command.  -S option disables invocation of any external process from
+magicpoint.
+If you need to configure content-type for ".mgp", use
+"application/x-magicpoint".  I believe "text/plain" would be a last resort.
+
+If you cannot asuume that there's no magicpoint at the client's site,
+you'll need to convert presentation into html file.  use mgp -D for this.
+
+You may convert your presentation as postscript file, after processing it
+with "mgp2ps".   It would be nice if you would like nobody to reuse your
+work at ease.
diff --git a/USAGE.jp b/USAGE.jp
new file mode 100644 (file)
index 0000000..187a7f6
--- /dev/null
+++ b/USAGE.jp
@@ -0,0 +1,225 @@
+                  .mgp \e$B%U%!%$%k$N$$$$2C8:$J=q$-J}\e(B
+
+                              \e$B;3K\OBI'\e(B
+
+                            1998\e$BG/\e(B9\e$B7n\e(B4\e$BF|\e(B
+
+.mgp \e$B$N%3%^%s%I\e(B(directive) \e$B$O\e(B "%" \e$B$G;O$^$j$^$9!#$H$j$"$($:!"\e(B
+/usr/X11R6/lib/X11/mgp/default.mgp \e$B$,$"$k$3$H$r3NG'$7$?$i!"\e(B.mgp \e$B%U%!%$\e(B
+\e$B%k$N:G=i$K0J2<$N9T$rF~$l$F2<$5$$!#\e(B
+
+       %include default.mgp
+
+\e$B$3$l$G3F%Z!<%8$N%G%U%)%k%H$N%9%?%$%k$,@_Dj$5$l$^$9!#3F%Z!<%8$O!"\e(B%page 
+\e$B$G$O$8$a$^$9!#\e(B
+
+       %page
+
+       \e$B$3$3$,%?%$%H%k\e(B
+
+       \e$B$3$3$+$iK\J8\e(B
+
+MagicPoint \e$B$O9T;X8~$G$9!#%G%U%)%k%H$N%9%?%$%k$G$O!"\e(B1 \e$B9TL\$r2hLL>e$NM>\e(B
+\e$BGr$K;H$$$^$9$N$G!"2?$b=q$+$J$$$G2<$5$$!#\e(B2 \e$B9TL\$,%?%$%H%k$G$9!#\e(B3 \e$B9TL\$O!"\e(B
+\e$B2#K@$K2=$1$^$9!#\e(B4 \e$B9TL\$+$iK\J8$G$9!#\e(B
+
+\e$B9TF,$K\e(B % \e$B$r=q$/$H!"0J9_$,%3%^%s%I$K$J$j$^$9!#%3%^%s%I$O\e(B "," \e$B6h@Z$C$FNs\e(B
+\e$B5s$G$-$^$9!#Bg$-$5$r2hLL$N\e(B 7 \e$B!s!"?'$r2+?'$K$9$k$K$O0J2<$N$h$&$K$7$^$9!#\e(B
+
+       %size 7, fore yellow
+       \e$B$3$N9T$OBg$-$/$F2+?'$G$9!#\e(B
+
+\e$B9TF,$K$,\e(B % \e$B$N9T$O!"EvA3I=<($5$l$^$;$s$7!"9T$H$7$F%+%&%s%H$5$l$^$;$s!#\e(B
+\e$B?'$dBg$-$5$J$I$N9T$NB0@-$O!"0J2<$N$b$N$,MQ0U$5$l$F$$$^$9!#\e(B
+
+       \e$BJ8;z$N?'\e(B          %fore
+       \e$BGX7J$N?'\e(B          %back
+       \e$BJ8;z$NBg$-$5\e(B              %size
+       \e$BJ8;z$N0LCV\e(B                %center, %left, %right
+       \e$BJ8;z4V\e(B                    %hgap
+       \e$B9T4V\e(B                      %vgap
+       \e$B%U%)%s%H\e(B          %font
+
+\e$B$^$@B>$K$b$"$j$^$9$,!"$H$j$"$($:$3$N$/$i$$$G$$$$$G$7$g$&!#$A$J$_$K!"\e(B
+default.mgp \e$B$G$O0J2<$N$h$&$KDj5A$5$l$F$$$^$9!#\e(B
+
+       %default 1 leftfill, size 2, fore "white", back "black", font "thick"
+       %default 2 size 7, vgap 10, prefix " "
+       %default 3 size 2, bar "gray70", vgap 10
+       %default 4 size 5, fore "white", vgap 30, prefix " ", font "standard"
+
+%default \e$B$OBh\e(B 1 \e$B0z?t$G;XDj$5$l$?9T$NB0@-$K!"Bh\e(B 2 \e$B0z?t0J9_$NCM$r%;%C%H\e(B
+\e$B$7$^$9!#\e(B1 \e$B9TL\$O!"%5%$%:$,\e(B 2\e$B!s!"\e(B2 \e$B9TL\$O\e(B 7 \e$B!s$G$9$M!#<!$N9T$GL@<(E*$K\e(B
+\e$B>e=q$-$7$J$$8B$jA0$N9T$N@_Dj$OM-8z$G$9!#$G$9$+$i!"\e(B2 \e$B9TL\$NJ8;z$N?'$OGr\e(B
+\e$B$K$J$j$^$9!#\e(B
+
+MagicPoint \e$B$O$"$k9T$rI=<($9$k:]$K!"$^$:$=$N9T$N\e(B %default \e$B$N@_Dj$rH?1G\e(B
+\e$B$7$^$9!#<!$KK\J8Cf$G;XDj$5$l$?@_Dj$rH?1G$7$^$9!#$?$@$7!"L@<(E*$K;XDj$5\e(B
+\e$B$l$J$$B0@-$O!"A0$N9T$NCM$r0z$-$:$j$^$9!#\e(B
+
+\e$BNc$r$_$F8+$^$7$g$&\e(B
+
+       %page
+                                               (\e$BBg$-$5\e(B 2 \e$B!s\e(B \e$B$NM>Gr\e(B)
+       \e$BBg$-$5\e(B 7 \e$B!s$GGr?'$G%4%A%C%/$N%?%$%H%k\e(B
+                                               (\e$B2#K@\e(B)
+       \e$BBg$-$5\e(B 5 \e$B!s\e(B \e$B$GGr?'$G%4%A%C%/$NJ8;z\e(B
+       %fore yellow, size 4
+       \e$BBg$-$5\e(B 4 \e$B!s\e(B \e$B$G2+?'$G%4%A%C%/$NJ8;z\e(B
+       %vfont min
+       \e$BBg$-$5\e(B 4 \e$B!s\e(B \e$B$G2+?'$GL@D+$NJ8;z\e(B
+
+\e$B$"$H!"9T$HD>9T$9$kL?Na$K\e(B %tab \e$B$,$"$j$^$9!#\e(Bdefault.mgp \e$B$G$O0J2<$N$h$&$K\e(B
+\e$BDj5A$5$l$F$$$^$9!#\e(B
+
+       %tab 1 size 5, vgap 40, prefix "  ", icon box green 50
+       %tab 2 size 4, vgap 40, prefix "      ", icon arc yellow 50
+       %tab 3 size 3, vgap 40, prefix "            ", icon delta3 white 40
+
+\e$B9TF,$K\e(B 1 \e$B$D%?%V$,$"$k$H\e(B %tab 1 \e$B$N@_Dj$,M-8z$K$J$j$^$9!#\e(B2 \e$B$D$"$k$H\e(B %tab
+2\e$B!"\e(B3 \e$B$D$"$k$H\e(B %tab 2 \e$B$,!"8=:_$NB0@-$K>e=q$-$5$l$^$9!#\e(B
+
+\e$B$D$^$j!"\e(B
+       \e$B%?%V\e(B 1 \e$B$D$GBg$-$5$,\e(B 5 \e$B!s!"F,$K6uGr$HNPH"%"%$%3%s\e(B
+       \e$B%?%V\e(B 2 \e$B$D$GBg$-$5$,\e(B 4 \e$B!s!"F,$K6uGr$H2+4]%"%$%3%s\e(B
+       \e$B%?%V\e(B 3 \e$B$D$GBg$-$5$,\e(B 3 \e$B!s!"F,$K6uGr$HGr;03Q%"%$%3%s\e(B
+\e$B$H$J$j$^$9!#\e(B
+
+\e$B$3$N5!G=$r;H$&$H!"\e(Bitemize \e$B$r4JC1$K=q$+$1$^$9!#Nc$r8+$F$_$^$7$g$&!#\e(B
+
+       %page
+
+       Emacs \e$B$N$J$+$^$?$A\e(B
+
+               Emacs
+                       \e$B8=:_$O\e(B 19 \e$B$,<gN.\e(B
+                       \e$B$G$b\e(B 20 \e$B$b%j%j!<%9$5$l$F$$$k\e(B
+               Mule
+                       2.3 \e$B$,$h$/;H$o$l$F$$$k\e(B
+                       Emacs \e$B$H\e(B XEmacs \e$B$KE}9g$5$l$?\e(B
+               XEmacs
+                       19 \e$B$,1Q8lHG\e(B
+                       20 \e$B$,9q:]HG\e(B
+
+\e$BB>$N%3%^%s%I$KIU$$$F$O!"\e(BSYNTAX \e$B$r8+$?$j!"\e(Bsample/*.mgp \e$B$r8+$?$j$7$F2<$5\e(B
+\e$B$$!#\e(B
+
+                           tgif \e$B$H$N@83h\e(B
+
+
+MagicPoint \e$B$O\e(B tgif \e$B$N\e(B obj \e$B$rI=<($G$-$J$$$1$I!"9,$;$K$J$kJ}K!$O$"$j$^$9!#\e(B
+
+       ghostscript\e$B$r;H$($J$$$J$i\e(B...
+       - \e$B2hLLI=<($N$?$a$K$O\e(B tgif \e$B$K\e(B GIF \e$B$rEG$+$;$k\e(B
+       - \e$B0u:~$N$?$a$K$O\e(B tgif \e$B$K\e(B EPS \e$B$rEG$+$;$F;H$&\e(B
+       ghostscript\e$B$r;H$($k$J$i\e(B...
+       - \e$B2hLLI=<(\e(B/\e$B0u:~$H$b!"\e(Btgif \e$B$K\e(B EPS \e$B$rEG$+$;$?$N$r;H$&\e(B
+
+ghostscript \e$B$r;H$($J$$>l9g\e(B:
+
+tgif \e$B$GI=<($5$l$?%$%a!<%8$,$=$N$^$^!"\e(Bmgp \e$B$N2hLL$K=P$^$9!#$@$+$i!"%U%)\e(B
+\e$B%s%H$,\e(B tgif \e$B$G$-$l$$$KI=<($5$l$F$$$J$$$HHa$7$$$G$9!#$H$j$"$($:!"\e(B14\e$B!"\e(B16\e$B!"\e(B
+24\e$B!"\e(B26 \e$B%I%C%H$N%U%)%s%H$O!"L@D+$+%4%7%C%/$I$A$i$+$,$"$j$^$9!#$@$+$i!"\e(B
+\e$B0J2<$N$h$&$J%U%!%$%k$r\e(B xrdb \e$B$K?)$o$;$F!"\e(Btgif \e$B$r>e$2!"\e(BGIF \e$B$rEG$+$;$k$H\e(B
+\e$B$$$$$G$7$g$&!#\e(B
+
+Tgif*Background: black
+Tgif*Foreground: white
+Tgif*WhereToPrint: EPS
+Tgif*InitialFontSize: 16
+Tgif*InitialKanjiFont: Gothic
+Tgif*FontSizes: 14 16 24 26
+Tgif*NihongoFonts: \
+       -*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
+       Ryumin-Light-EUC-H, Ryumin, \
+       H, false, 24, 26 \n\
+       -*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
+       GothicBBB-Medium-EUC-H, Gothic, \
+       H, false, 16, 18 \n\
+       -*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
+       Ryumin-Light-EUC-V, Ryumin-V, \
+       V, false, 24, 26 \n\
+       -*-fixed-medium-r-normal--%d-*-*-*-*-*-jisx0208.1983-0,, \
+       GothicBBB-Medium-EUC-V, Gothic-V, \
+       V, false, 16, 18
+
+EPS \e$B$O!"\e(B
+       tgif -print -eps *.obj
+\e$B$H$d$l$P:n$l$^$9!#%U%!%$%k$,$?$/$5$s$"$k$H$-$KJXMx!#\e(B
+
+\e$B$?$@$7!"$3$NJ}K!$@$H?'$r4V0c$&2DG=@-$,$"$k$N$G!"4V0c$C$?%U%!%$%k$O!"\e(B
+tgif \e$B$r>e$2$F%^%K%e%"%kA`:n$G\e(B EPS \e$B$rEG$+$;$^$7$g$&!#\e(B
+
+mgp2ps \e$B$O!"\e(Bfilename.{gif,jpg,...} \e$B$KBP$7!"\e(Bfilename.eps \e$B$,$"$l$P$=$A$i\e(B
+\e$B$rFI$_9~$s$G\e(B PS \e$B$r:n$j$^$9!#$"$"!"$J$s$FJXMx!#\e(B
+
+2 \e$B$D$N%Z!<%8$r\e(B 1 \e$B$D$K$^$H$a$k$K$O!"\e(B
+       pstops '2:0R@.5(2cm,26cm)+1R@.5(2cm,13cm)' input.ps > output.ps
+\e$B$H<vJ8$r>'$($l$P$$$$$G$7$g$&!#\e(B\^^/
+
+ghostscript \e$B$r;H$($k>l9g\e(B:
+
+EPS \e$B$r$D$/$j$^$9!#7+$jJV$7$K$J$j$^$9$,!"\e(B
+       tgif -print -eps *.obj
+\e$B$H$d$l$P:n$l$^$9!#\e(B
+
+nantara.mgp \e$B$NCf$G!"\e(B
+       %image "hoge.eps"
+\e$B$H$9$l$P!"%W%l%<%s$N:]$K$O\e(B mgp \e$B$NCf$+$i\e(B ghostscript \e$B$,8F$S=P$5$l!"\e(B
+EPS \e$B%U%!%$%k$NCf?H$,2hLL>e$KIA2h$5$l$^$9!#\e(B
+\e$B0u:~$N:]$K$O\e(B mgp2ps \e$B$,@5$7$/\e(B eps \e$B$r=hM}$7$^$9!#\e(B
+
+
+                                \e$B?t<0\e(B
+
+.mgp \e$B%U%!%$%k$K?t<0$rKd$a9~$`$K$O>/$J$/$H$b\e(B 3 \e$B$D$NJ}K!$,$"$j$^$9!#\e(B
+
+(1) TeX
+- TeX \e$B$G?t<0$r=q$$$F\e(B .dvi \e$B%U%!%$%k$r@8@.$7$^$9!#\e(B
+- dvipr \e$B$r;H$C$F!"\e(B.dvi \e$B%U%!%$%k$r\e(B .eps \e$B%U%!%$%k$KJQ49$7$^$9!#\e(B
+- .eps \e$B%U%!%$%k$r0J2<$N$h$&$KFI$_9~$_$^$9!#\e(B
+
+       %image "foo.eps"
+
+(2) eqn/troff
+- eqn/troff \e$B$G?t<0$r=q$$$F\e(B .ps \e$B%U%!%$%k$rF@$^$9!#\e(B
+- .ps \e$B%U%!%$%k$r\e(B .eps \e$B%U%!%$%k$KJQ49$7$^$9!#\e(B(e.g. pstoepsi)
+- .eps \e$B%U%!%$%k$r0J2<$N$h$&$KFI$_9~$_$^$9!#\e(B
+
+       %image "foo.eps"
+
+(3) \e$B%S%C%H%^%C%W\e(B (\e$B$*4+$a$G$-$^$;$s\e(B)
+- TeX \e$B$+\e(B eqn/troff \e$B$r;H$C$F?t<0$r=q$-!"\e(B.ps \e$B%U%!%$%k$rF@$^$9!#\e(B
+- .ps \e$B%U%!%$%k$r\e(B .pnm \e$B%U%!%$%k$KJQ49$7$^$9!#\e(B(e.g. pstopnm)
+- .pnm \e$B%U%!%$%k$r\e(B .pbm \e$B%U%!%$%k$KJQ49$7$^$9!#\e(B(e.g. pnmcrop)
+- .pbm \e$B%U%!%$%k$r0J2<$N$h$&$KFI$_9~$_$^$9!#\e(B
+
+       %image "foo.pbm"
+
+
+
+                       \e$B%W%l%<%s%U%!%$%k$r\e(Bweb\e$B$KE=$m$&\e(B
+
+magicpoint\e$B$N%W%l%<%s%F!<%7%g%s%U%!%$%k$r\e(Bweb\e$B$KE=$k>l9g!"\e(B3\e$B$D$NJ}K!$,$"$j$^$9!#\e(B
+
+\e$B%/%i%$%"%s%HB&$K\e(Bmagicpoint\e$B$,$"$k$H2>Dj$G$-$k>l9g$K$O!"\e(Bmgpembed\e$B$G=hM}$7$?\e(B
+\e$B%W%l%<%s%U%!%$%k$r$=$N$^$^\e(Bweb\e$B%5!<%P$GDs6!$9$l$P\e(Bok\e$B$G$9!#\e(B
+       1. mgpembed\e$B%3%^%s%I$r;H$C$F!"2hA|%U%!%$%k$r%W%l%<%s%U%!%$%kCf$K\e(B
+          \e$BKd$a9~$_$^$9!#7k2L$H$7$FC10l$N%W%l%<%s%U%!%$%k$,$G$-$"$,$j$^$9!#\e(B
+       2. \e$B$G$-$"$,$C$?%U%!%$%k$r\e(B"foo.mgp"\e$B$J$I$H$7$F\e(Bweb\e$B%5!<%P$KCV$-$^$9!#\e(B
+\e$B%/%i%$%"%s%HB&$O!"\e(B".mgp"\e$B$H$$$&3HD%;R$N%U%!%$%kL>$KBP$9$k\e(Bhelper application
+\e$B$H$7$F!"\e(B
+       mgp -g 400x300 -S <filename>
+\e$B$r;XDj$7$^$9\e(B(\e$B2hLL%5%$%:$O$J$s$G$b$+$^$$$^$;$s\e(B)\e$B!#\e(B-S\e$B$r$D$1$k$N$O%;%-%e%j%F%#>e\e(B
+\e$BHs>o$K=EMW$G$9!#\e(Bmagicpoint\e$B$N%W%l%<%s%U%!%$%k$OG$0U$N\e(Bshell\e$B%3%^%s%I$r4^$`\e(B
+\e$B$3$H$,$G$-$^$9$N$G!"0-0U$N%W%l%<%s%U%!%$%k$r$&$+$D$K<B9T$9$k$H:$$C$?$3$H$K\e(B
+\e$B$J$j$^$9!#\e(B-S\e$B$r;H$&$H\e(Bshell\e$B%3%^%s%I$N<B9T$rM^;_$G$-$^$9!#\e(B
+".mgp"\e$B$K\e(BContent-type\e$B$rDj5A$9$k>l9g!"\e(B"application/x-magicpoint"\e$B$r;H$C$F\e(B
+\e$B$/$@$5$$!#\e(B"text/plain"\e$B$G$b$$$$$H$O;W$$$^$9$,!#\e(B
+
+\e$BG$0U$N%/%i%$%"%s%H$G8+$?$$>l9g!"%W%l%<%s%F!<%7%g%s$r\e(Bhtml\e$B$KJQ49$9$k$3$H$K\e(B
+\e$B$J$j$^$9!#$3$N$?$a$K$O\e(Bmgp -D\e$B$r;H$$$^$9!#\e(B
+
+\e$B%W%l%<%s%U%!%$%k$r\e(Bpostscript\e$B%U%!%$%k$KJQ49$7$F$+$iE=$k$N$b$$$$$+$b$7$l$^$;$s!#\e(B
+\e$B$3$N>l9g\e(Bmgp2ps\e$B$G=hM}$7$F$+$i\e(Bweb\e$B%5!<%P$KCV$/$3$H$K$J$j$^$9!#$3$&$9$k$H!"\e(B
+\e$BB>?M$K%W%l%<%s%U%!%$%k$r:FMxMQ$5$l$k$N$rKI$2$^$9\e(B(\e$B>/$7Fq$7$/$J$k$@$1$G$9$,\e(B)\e$B!#\e(B
diff --git a/background.c b/background.c
new file mode 100644 (file)
index 0000000..ca48404
--- /dev/null
@@ -0,0 +1,415 @@
+/*
+ * Copyright (C) 1997 and 1998 WIDE Project.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/*
+ * $Id: background.c,v 1.10 1998/09/04 21:05:07 itojun Exp $
+ */
+
+#include <math.h>
+#include "mgp.h"
+
+/* background gradation */
+#define G_PI   3.1415926535897932385
+#define G_PI2  1.5707963267948966192
+
+static void draw_gradation0 __P((int, int, int, int, int, int,
+       byte *, byte *, int, int, byte));
+static void g_rotate __P((byte *, struct ctrl_grad *, int, int));
+
+/*
+ * generate gradation for single color plane.
+ * x: color plane
+ * y: axis for gradation
+ * z: extra axis
+ */
+static void
+draw_gradation0(x1, x2, y1, y2, z1, z2, p1, p2, dpy, dpz, mask)
+       int x1, x2;
+       int y1, y2;
+       int z1, z2;
+       byte *p1, *p2;
+       int dpy, dpz;   /* delta of p in x/y's direction */
+       byte mask;
+{
+       int s, step;
+       int dx, dy;
+       int z;
+       byte *p;
+
+       dx = abs(x2 - x1);
+       dy = abs(y2 - y1);
+
+       if (dx > dy) {
+               if (x1 > x2) {
+                       step = (y1 > y2) ? 1 : -1;
+                       s = x1; x1 = x2; x2 = s; /*swap*/
+                       y1 = y2;
+                       p = p2;
+               } else {
+                       step = (y1 < y2) ? 1 : -1;
+                       p = p1;
+               }
+
+               for (z = z1; z < z2; z++)
+                       *(p + z * dpz) = x1 & mask;
+               s = dx >> 1;
+               while (++x1 <= x2) {
+                       if ((s -= dy) < 0) {
+                               s += dx;
+                               y1 += step;
+                               p += (dpy * step);
+                       }
+                       for (z = z1; z < z2; z++)
+                               *(p + z * dpz) = x1 & mask;
+               }
+       } else {
+               if (y1 > y2) {
+                       step = (x1 > x2) ? 1 : -1;
+                       s = y1; y1 = y2; y2 = s; /*swap*/
+                       x1 = x2;
+                       p = p2;
+               } else {
+                       step = (x1 < x2) ? 1 : -1;
+                       p = p1;
+               }
+
+               for (z = z1; z < z2; z++)
+                       *(p + z * dpz) = x1 & mask;
+               s = dy >> 1;
+               while (++y1 <= y2) {
+                       p += dpy;       /*y always inc*/
+                       if ((s -= dx) < 0) {
+                               s += dy;
+                               x1 += step;
+                       }
+                       for (z = z1; z < z2; z++)
+                               *(p + z * dpz) = x1 & mask;
+               }
+       }
+}
+
+byte *
+draw_gradation(width, height, cg)
+       int width;
+       int height;
+       struct ctrl_grad *cg;
+{
+       int bmask[8] = { 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff };
+       byte *pic;
+       u_int bits = 8;
+       int i, j;
+       int x1, x2;
+       int y1, y2, dpy;
+       int z1, z2, dpz;
+       byte *p1, *p2;
+       byte mask;
+
+       bits = 8;
+
+       pic = (byte *)malloc(width * height * 3 * sizeof(byte));
+       if (!pic) {
+               fprintf(stderr,"couldn't alloc space for gradation image\n");
+               return NULL;
+       }
+
+       memset(pic, 0, width * height * 3 * sizeof(byte));
+
+       if (cg->ct_direction % 90) {
+               g_rotate(pic, cg, width, height);
+               return pic;
+       }
+
+       for (j = 0; j < 3; j++) {       /*r, g, b*/
+               for (i = 0; i < cg->ct_g_colors - 1; i++) {
+                       switch (j) {
+                       case 0:
+                               x1 = cg->colors[i]->r;
+                               x2 = cg->colors[i + 1]->r;
+                               break;
+                       case 1:
+                               x1 = cg->colors[i]->g;
+                               x2 = cg->colors[i + 1]->g;
+                               break;
+                       case 2:
+                               x1 = cg->colors[i]->b;
+                               x2 = cg->colors[i + 1]->b;
+                               break;
+                       }
+
+                       mask = bmask[bits - 1];
+                       switch (cg->ct_direction) {
+                       case 0:
+                               y1 = ((height - 1) * i) / (cg->ct_g_colors - 1);
+                               y2 = ((height - 1) * (i + 1))
+                                       / (cg->ct_g_colors - 1);
+                               p1 = pic + j + width * 3 * y1;
+                               p2 = pic + j + width * 3 * y2;
+                               z1 = 0;
+                               z2 = width;
+                               dpy = width * 3;
+                               dpz = 3;
+                               break;
+                       case 90:
+                               y1 = ((width - 1) * i) / (cg->ct_g_colors - 1);
+                               y2 = ((width - 1) * (i + 1))
+                                       / (cg->ct_g_colors - 1);
+                               p1 = pic + j + 3 * y1;
+                               p2 = pic + j + 3 * y2;
+                               z1 = 0;
+                               z2 = height;
+                               dpy = 3;
+                               dpz = width * 3;
+                               break;
+                       case 180:
+                               y1 = ((height - 1) * (cg->ct_g_colors - i - 1))
+                                       / (cg->ct_g_colors - 1);
+                               y2 = ((height - 1) * (cg->ct_g_colors - i - 2))
+                                       / (cg->ct_g_colors - 1);
+                               p1 = pic + j + width * 3 * y1;
+                               p2 = pic + j + width * 3 * y2;
+                               z1 = 0;
+                               z2 = width;
+                               dpy = width * 3;
+                               dpz = 3;
+                               break;
+                       case 270:
+                               y1 = ((width - 1) * (cg->ct_g_colors - i - 1))
+                                       / (cg->ct_g_colors - 1);
+                               y2 = ((width - 1) * (cg->ct_g_colors - i - 2))
+                                       / (cg->ct_g_colors - 1);
+                               p1 = pic + j + 3 * y1;
+                               p2 = pic + j + 3 * y2;
+                               z1 = 0;
+                               z2 = height;
+                               dpy = 3;
+                               dpz = width * 3;
+                               break;
+                       }
+                       draw_gradation0(x1, x2, y1, y2, z1, z2, p1, p2,
+                               dpy, dpz, mask);
+               }
+       }
+
+       return pic;
+}
+
+static double cost, sint;
+static double cos2t, sin2t;
+static double dcost, dsint;
+
+/* rotate graphic */
+static void
+g_rotate(pic, cg, width, height)
+     byte *pic;
+     struct ctrl_grad * cg;
+     int width, height;
+{
+    byte *pp;
+    double maxd, mind, del, d, rat, crat, cval;
+    double theta, dy, ey, td1, td2;
+    int    x, y, cx, cy, r, g, b, bc, nc1;
+    int    rot, mode;
+    struct g_color * c1;
+    struct g_color * c2;
+
+    rot   = cg->ct_direction;
+    mode  = cg->ct_mode;
+  
+    cx = width/2;  cy = height/2;
+    theta = (double) rot * G_PI / 180.0;
+    cost  = cos(theta);
+    sint  = sin(theta);
+    dsint = sint*sint;
+    dcost = cost*cost;
+    sin2t = sin(2*theta);
+    cos2t = cos(2*theta);
+
+    nc1 = cg->ct_g_colors - 1;
+
+    /* compute max/min distances */
+    if (rot > 0 && rot < 90) {
+       mind = cdist(0, 0, cx, cy, rot, mode);
+       maxd = cdist(width-1, height-1, cx, cy, rot, mode);
+    }
+    else if (rot >= 90 && rot < 180) {
+       mind = cdist(0, height-1, cx, cy, rot, mode);
+       maxd = cdist(width-1, 0,  cx, cy, rot, mode);
+    }
+    else if (rot >= 180 && rot < 270) {
+       mind = cdist(width-1, height-1, cx, cy, rot, mode);
+       maxd = cdist(0, 0, cx, cy, rot, mode);
+    }
+    else {
+       mind = cdist(width-1,  0, cx, cy, rot, mode);
+       maxd = cdist(0, height-1, cx, cy, rot, mode);
+    }
+  
+    del = maxd - mind;         /* maximum distance */
+  
+    /* loop start */
+
+    td1 = cx - cx*dcost;
+    td2 = cy + 0.5*cx*sin2t;
+
+    for (y=0; y < height; y++) {
+       pp = pic + (y * width * 3);
+       dy = (cy-y)*0.5*sin2t + td1;
+       ey = (y-cy)*dsint + td2;
+
+       for (x=0; x < width; x++) {
+           d = lcdist(x, y, cx, cy, rot, mode, dy, ey);
+           rat = (d - mind) / del;
+
+           if (rat < 0.0){
+               cval = bc = crat = 0.0;
+           } else if (rat > 1.0){
+               cval = bc = (double)nc1;
+               crat = 0.0;
+           } else {
+               cval = rat * nc1;
+               bc   = floor(cval);
+               crat = cval - bc;
+           }
+
+           if (bc < nc1) {
+               c1 = (cg->colors)[bc];
+               c2 = (cg->colors)[bc+1];
+
+               r = c1->r + crat * ((c2->r) - (c1->r));
+               g = c1->g + crat * ((c2->g) - (c1->g));
+               b = c1->b + crat * ((c2->b) - (c1->b));
+           } else {
+               c1 = (cg->colors)[nc1];
+               r = c1->r; g = c1->g; b = c1->b;
+           }
+           *pp++ = (byte) r;  *pp++ = (byte) g;  *pp++ = (byte) b;
+       }
+    }
+}
+
+/* compute distance */
+double cdist(x, y, cx, cy, rot, mode)
+     int x, y, cx, cy, rot, mode;
+{
+    double x1, y1, x2, y2, x3, d ;
+  
+    /* special case */
+    if (rot == 0)   return (double) (y - cy);
+    if (rot == 90)  return (double) (x - cx);
+    if (rot == 180) return (double) (cy - y);
+    if (rot == 270) return (double) (cx - x);
+
+/* experimental routine for circle patern gradation */
+    if (mode == 1) {
+       d = sqrt((y-cy)*(y-cy)*cost + (x-cx)*(x-cx)*sint);
+       if (x + y - cy < 0) d = -d;
+       return d;
+    }
+
+    /* x1,y1 = original point */
+    x1 = (double) x;  y1 = (double) y;
+    x2 = cx + (cy-y1)*0.5*sin2t - (cx-x1)*dcost;
+    y2 = cy - (cy-y1)*dsint + (cx-x1)*0.5*sin2t;
+    x3 = x1-x2;
+
+    d = sqrt(x3*x3 + (y1 - y2)*(y1 - y2));
+    if ((rot < 180 && x3<0) || (rot > 180 && x3>0)) d = -d;
+    return d;
+}
+
+double lcdist(x, y, cx, cy, rot, mode, dy, ey)
+    int x, y, cx, cy, rot, mode;
+    double dy,ey;
+{
+    double x1, y1, x2, y2, x3, d ;
+  
+    /* special case */
+    if (rot == 0)   return (double) (y - cy);
+    if (rot == 90)  return (double) (x - cx);
+    if (rot == 180) return (double) (cy - y);
+    if (rot == 270) return (double) (cx - x);
+
+/* experimental routine for circle patern gradation */
+    if (mode == 1) {
+       d = sqrt((y-cy)*(y-cy)*cost + (x-cx)*(x-cx)*sint);
+       if (x + y - cy < 0) d = -d;
+       return d;
+    }
+
+    x1 = (double) x;
+    y1 = (double) y;
+
+    x2 = dy + x1*dcost;
+    y2 = ey - x1*0.5*sin2t;
+    x3 = x1-x2;
+
+    d = sqrt(x3*x3 + (y1 - y2)*(y1 - y2));
+    if ((rot < 180 && x3<0) || (rot > 180 && x3>0)) d = -d;
+    return d;
+}
+
+
+Image *
+make_XImage(pic, width, height)
+     byte *pic;
+     unsigned int width, height;
+{
+    Image        *image;
+    int           size;
+
+#if USE_COLOR_DEPTH
+    byte         *destptr;
+    unsigned int  y, maxval;
+#endif
+
+    size= height * width * 3;
+
+    /* make Image structure (stolen from image/new.c)*/
+    image= (Image *)lmalloc(sizeof(Image));
+    image->type= ITRUE;
+    image->title= strdup("");
+    image->rgb.used= image->rgb.size= 0;
+    image->width= width;
+    image->height= height;
+    image->depth= 24;
+    image->pixlen= 3;
+    image->data= pic;
+
+#if USE_COLOR_DEPTH
+#define PM_SCALE(a, b, c) (long)((a) * (c))/(b)
+    /* color depth (future use) */
+    maxval=0xff;
+
+    destptr= image->data;
+    for (y= 0; y < size; y++) {
+       *destptr= PM_SCALE(*destptr, maxval, 0xff);
+       destptr++;
+    }
+#endif
+
+    return(image);
+}
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..a6efaf3
--- /dev/null
+++ b/configure
@@ -0,0 +1,2532 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+  --enable-debug          compile debugging information in."
+ac_help="$ac_help
+  --disable-freetype      DON'T use freetype routines."
+ac_help="$ac_help
+  --disable-vflib         DON'T use vflib routines."
+ac_help="$ac_help
+  --with-vfontcap=PATH    use PATH as vfontcap"
+ac_help="$ac_help
+  --with-x                use the X Window System"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.12"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"     "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=image/imagetypes.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='       '
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:534: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+       @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:563: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:592: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  ac_prog_rejected=no
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+       continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:640: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 650 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  ac_cv_prog_cc_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:674: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:679: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:703: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+for ac_prog in mawk gawk nawk awk
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:735: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AWK="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+AWK="$ac_cv_prog_AWK"
+if test -n "$AWK"; then
+  echo "$ac_t""$AWK" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$AWK" && break
+done
+
+for ac_prog in 'bison -y' byacc
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:768: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$YACC"; then
+  ac_cv_prog_YACC="$YACC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_YACC="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+YACC="$ac_cv_prog_YACC"
+if test -n "$YACC"; then
+  echo "$ac_t""$YACC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
+
+# Extract the first word of "flex", so it can be a program name with args.
+set dummy flex; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:800: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$LEX"; then
+  ac_cv_prog_LEX="$LEX" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_LEX="flex"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
+fi
+fi
+LEX="$ac_cv_prog_LEX"
+if test -n "$LEX"; then
+  echo "$ac_t""$LEX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$LEXLIB"
+then
+  case "$LEX" in
+  flex*) ac_lib=fl ;;
+  *) ac_lib=l ;;
+  esac
+  echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
+echo "configure:833: checking for yywrap in -l$ac_lib" >&5
+ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-l$ac_lib  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 841 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char yywrap();
+
+int main() {
+yywrap()
+; return 0; }
+EOF
+if { (eval echo configure:852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LEXLIB="-l$ac_lib"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+for ac_prog in perl5 perl
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:879: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_mgp_cv_path_perl'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$mgp_cv_path_perl" in
+  /*)
+  ac_cv_path_mgp_cv_path_perl="$mgp_cv_path_perl" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_mgp_cv_path_perl="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+mgp_cv_path_perl="$ac_cv_path_mgp_cv_path_perl"
+if test -n "$mgp_cv_path_perl"; then
+  echo "$ac_t""$mgp_cv_path_perl" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$mgp_cv_path_perl" && break
+done
+test -n "$mgp_cv_path_perl" || mgp_cv_path_perl="no"
+
+
+for ac_prog in uuencode
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:917: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_mgp_cv_path_uuencode'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$mgp_cv_path_uuencode" in
+  /*)
+  ac_cv_path_mgp_cv_path_uuencode="$mgp_cv_path_uuencode" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_mgp_cv_path_uuencode="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+mgp_cv_path_uuencode="$ac_cv_path_mgp_cv_path_uuencode"
+if test -n "$mgp_cv_path_uuencode"; then
+  echo "$ac_t""$mgp_cv_path_uuencode" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$mgp_cv_path_uuencode" && break
+done
+test -n "$mgp_cv_path_uuencode" || mgp_cv_path_uuencode="no"
+
+
+for ac_prog in gzip
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:955: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_mgp_cv_path_gzip'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$mgp_cv_path_gzip" in
+  /*)
+  ac_cv_path_mgp_cv_path_gzip="$mgp_cv_path_gzip" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_mgp_cv_path_gzip="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+fi
+mgp_cv_path_gzip="$ac_cv_path_mgp_cv_path_gzip"
+if test -n "$mgp_cv_path_gzip"; then
+  echo "$ac_t""$mgp_cv_path_gzip" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$mgp_cv_path_gzip" && break
+done
+test -n "$mgp_cv_path_gzip" || mgp_cv_path_gzip="no"
+
+
+
+echo $ac_n "checking if --enable-debug option specified""... $ac_c" 1>&6
+echo "configure:990: checking if --enable-debug option specified" >&5
+# Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval="$enable_debug"
+  mgp_debug="yes"; DEBUGFLAGS="-DDEBUG -g -Wall"
+else
+  mgp_debug="no"
+fi
+
+echo "$ac_t""$mgp_debug" 1>&6
+DEBUGFLAGS=${DEBUGFLAGS-"OptimizedCDebugFlags"}
+
+
+LIBS="-lm $LIBS"
+
+echo $ac_n "checking if --disable-freetype option specified""... $ac_c" 1>&6
+echo "configure:1006: checking if --disable-freetype option specified" >&5
+# Check whether --enable-freetype or --disable-freetype was given.
+if test "${enable_freetype+set}" = set; then
+  enableval="$enable_freetype"
+  mgp_skip_freetype="yes"; mgp_use_freetype="no"
+else
+  mgp_skip_freetype="no"; mgp_use_freetype="yes"
+fi
+
+echo "$ac_t""$mgp_skip_freetype" 1>&6
+OPTFLAGS=
+
+DEPLIBS=
+
+if test "$mgp_use_freetype" = "yes"; then
+       echo $ac_n "checking for freetype library/header""... $ac_c" 1>&6
+echo "configure:1023: checking for freetype library/header" >&5
+       for dir in /usr/local/freetype /usr/local; do
+               ac_cv_ft_lib=no
+               ac_cv_ft_include=no
+               if test -d $dir/lib -a -f $dir/lib/libttf.so; then
+                       ac_cv_ft_lib="$dir/lib"
+                       ac_cv_ft_libpath="libttf.so"
+               elif test -d $dir/lib -a -f $dir/lib/libttf.a; then
+                       ac_cv_ft_lib="$dir/lib"
+                       ac_cv_ft_libpath="libttf.a"
+               fi
+               if test -d $dir/include -a -f $dir/include/freetype.h; then
+                       ac_cv_ft_include="$dir/include"
+               fi
+               if test "$ac_cv_ft_lib" != "no" -a "$ac_cv_ft_include" != "no"; then
+                       LIBS="-L$ac_cv_ft_lib $LIBS"
+                       CFLAGS="-I$ac_cv_ft_include $CFLAGS"
+                       break
+               fi
+       done
+       if test "$ac_cv_ft_lib" = "no" -a "$ac_cv_ft_include" = "no"; then
+               echo "$ac_t""no - not using freetype" 1>&6
+               mgp_use_freetype=no
+       else
+               echo "$ac_t""$ac_cv_ft_lib and $ac_cv_ft_include" 1>&6
+       fi
+fi
+if test "$mgp_use_freetype" = "yes"; then
+       LIBS="-L$ac_cv_ft_lib $LIBS"
+       OPTFLAGS="-I$ac_cv_ft_include $OPTFLAGS"
+       DEPLIBS="$ac_cv_ft_lib/$ac_cv_ft_libpath $DEPLIBS"
+       echo $ac_n "checking for TT_Init_FreeType in -lttf""... $ac_c" 1>&6
+echo "configure:1055: checking for TT_Init_FreeType in -lttf" >&5
+ac_lib_var=`echo ttf'_'TT_Init_FreeType | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lttf  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1063 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char TT_Init_FreeType();
+
+int main() {
+TT_Init_FreeType()
+; return 0; }
+EOF
+if { (eval echo configure:1074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo ttf | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lttf $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+echo "Fatal: libttf.a not found"
+               exit 1
+fi
+
+       cat > conftest.$ac_ext <<EOF
+#line 1104 "configure"
+#include "confdefs.h"
+#include <freetype.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+               echo "Fatal: freetype.h not found"
+               exit 1
+fi
+rm -f conftest*
+       cat >> confdefs.h <<\EOF
+#define FREETYPE 1
+EOF
+
+       echo $ac_n "checking for num_CharMaps field in TT_Face_Properties""... $ac_c" 1>&6
+echo "configure:1126: checking for num_CharMaps field in TT_Face_Properties" >&5
+       cat > conftest.$ac_ext <<EOF
+#line 1128 "configure"
+#include "confdefs.h"
+#include <freetype.h>
+int main() {
+TT_Face_Properties x; return x.num_CharMaps;
+; return 0; }
+EOF
+if { (eval echo configure:1135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  result=yes; cat >> confdefs.h <<\EOF
+#define HAVE_TT_FACE_PROPERTIES_CHARMAPS 1
+EOF
+
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  result=no
+fi
+rm -f conftest*
+       echo "$ac_t""$result" 1>&6
+fi
+
+echo $ac_n "checking if --disable-vflib option specified""... $ac_c" 1>&6
+echo "configure:1152: checking if --disable-vflib option specified" >&5
+# Check whether --enable-vflib or --disable-vflib was given.
+if test "${enable_vflib+set}" = set; then
+  enableval="$enable_vflib"
+  mgp_skip_vflib="yes"; mgp_use_vflib="no"
+else
+  mgp_skip_vflib="no"; mgp_use_vflib="yes"
+fi
+
+echo "$ac_t""$mgp_skip_vflib" 1>&6
+
+if test "$mgp_use_vflib" = "yes"; then
+       echo $ac_n "checking for VFlib library/header""... $ac_c" 1>&6
+echo "configure:1165: checking for VFlib library/header" >&5
+       for dir in /usr/local/VFlib /usr/local/vflib /usr/local; do
+               ac_cv_vf_libname=VFlib
+               ac_cv_vf_libdir=no
+               ac_cv_vf_hdrdir=no
+               if test -d $dir/lib -a -f $dir/lib/libVFlib.so; then
+                       ac_cv_vf_libdir="$dir/lib"
+                       ac_cv_vf_libpath="libVFlib.so"
+               elif test -d $dir/lib -a -f $dir/lib/libVFlib.a; then
+                       ac_cv_vf_libdir="$dir/lib"
+                       ac_cv_vf_libpath="libVFlib.a"
+               elif test -d $dir/lib -a -f $dir/lib/libVFlib2.so; then
+                       ac_cv_vf_libname=VFlib2
+                       ac_cv_vf_libdir="$dir/lib"
+                       ac_cv_vf_libpath="libVFlib2.so"
+               elif test -d $dir/lib -a -f $dir/lib/libVFlib2.a; then
+                       ac_cv_vf_libname=VFlib2
+                       ac_cv_vf_libdir="$dir/lib"
+                       ac_cv_vf_libpath="libVFlib2.a"
+               fi
+               if test -d $dir/include -a -f $dir/include/VF.h; then
+                       ac_cv_vf_hdrdir="$dir/include"
+               fi
+               if test "$ac_cv_vf_libdir" != "no" -a "$ac_cv_vf_hdrdir" != "no"; then
+                       LIBS="-L$ac_cv_vf_libdir $LIBS"
+                       CFLAGS="-I$ac_cv_vf_hdrdir $CFLAGS"
+                       break
+               fi
+       done
+       if test "$ac_cv_vf_libdir" = "no" -a "$ac_cv_vf_hdrdir" = "no"; then
+               echo "$ac_t""no - not using VFlib" 1>&6
+               mgp_use_vflib=no
+       else
+               echo "$ac_t""$ac_cv_vf_libdir and $ac_cv_vf_hdrdir" 1>&6
+       fi
+fi
+if test "$mgp_use_vflib" = "yes"; then
+       LIBS="-L$ac_cv_vf_libdir -l$ac_cv_vf_libname $LIBS"
+       OPTFLAGS="-I$ac_cv_vf_hdrdir $OPTFLAGS"
+       DEPLIBS="$ac_cv_vf_libdir/$ac_cv_vf_libpath $DEPLIBS"
+       echo $ac_n "checking for VF_Init in -l$ac_cv_vf_libname""... $ac_c" 1>&6
+echo "configure:1206: checking for VF_Init in -l$ac_cv_vf_libname" >&5
+ac_lib_var=`echo $ac_cv_vf_libname'_'VF_Init | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-l$ac_cv_vf_libname  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1214 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char VF_Init();
+
+int main() {
+VF_Init()
+; return 0; }
+EOF
+if { (eval echo configure:1225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  mgp_cv_vflib_a=$ac_cv_vf_libpath
+else
+  echo "$ac_t""no" 1>&6
+echo "Fatal: $ac_cv_vf_libpath not found"
+               exit 1
+fi
+
+       cat > conftest.$ac_ext <<EOF
+#line 1248 "configure"
+#include "confdefs.h"
+#include <VF.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+               echo "Fatal: VF.h not found"
+               exit 1
+fi
+rm -f conftest*
+       cat >> confdefs.h <<\EOF
+#define VFLIB 1
+EOF
+
+
+       echo $ac_n "checking for VFlib configuration file""... $ac_c" 1>&6
+echo "configure:1271: checking for VFlib configuration file" >&5
+       # Check whether --with-vfontcap or --without-vfontcap was given.
+if test "${with_vfontcap+set}" = set; then
+  withval="$with_vfontcap"
+  :
+fi
+
+       ac_cv_vf_fontcap="no"
+       if test -f "$with_vfontcap"; then
+               ac_cv_vf_fontcap=$with_vfontcap;
+       else
+               for ac_dir in /usr/local/lib /usr/local/lib/tex \
+                   /usr/local/lib/VFlib /usr/local/lib/fonts/vf \
+                   /usr/local/lib /usr/local/etc /etc \
+                   /usr/local/libdata/vflib /usr/local/share/VFlib \
+                   ../../VFlib* ../VFlib* VFlib*; do
+                       if test -d $ac_dir -a -f $ac_dir/vfontcap; then
+                               ac_cv_vf_fontcap=$ac_dir/vfontcap;
+                               break
+                       fi
+               done
+       fi
+       echo "$ac_t""$ac_cv_vf_fontcap" 1>&6
+       if test "$ac_cv_vf_fontcap" = "no"; then
+               echo Fatal: no vfontcap file found.  cannot continue.
+               echo Please use the option --with-vfontcap=PATH to specify the path to vfontcap.
+               exit 1
+       fi
+       cat >> confdefs.h <<EOF
+#define VFCAP "$ac_cv_vf_fontcap"
+EOF
+
+       
+fi
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1307: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+  cat > conftest.$ac_ext <<EOF
+#line 1322 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+  cat > conftest.$ac_ext <<EOF
+#line 1339 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
+fi
+  CPP="$ac_cv_prog_CPP"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+# If we find X, set shell vars x_includes and x_libraries to the
+# paths, otherwise set no_x=yes.
+# Uses ac_ vars as temps to allow command line to override cache and checks.
+# --without-x overrides everything else, but does not touch the cache.
+echo $ac_n "checking for X""... $ac_c" 1>&6
+echo "configure:1372: checking for X" >&5
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+  withval="$with_x"
+  :
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+    # Both variables are already set.
+    have_x=yes
+  else
+if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=NO ac_x_libraries=NO
+rm -fr conftestdir
+if mkdir conftestdir; then
+  cd conftestdir
+  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+  cat > Imakefile <<'EOF'
+acfindx:
+       @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+        test -f $ac_im_libdir/libX11.$ac_extension; then
+        ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case "$ac_im_incroot" in
+       /usr/include) ;;
+       *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+    esac
+    case "$ac_im_usrlibdir" in
+       /usr/lib | /lib) ;;
+       *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+    esac
+  fi
+  cd ..
+  rm -fr conftestdir
+fi
+
+if test "$ac_x_includes" = NO; then
+  # Guess where to find include files, by looking for this one X11 .h file.
+  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+  # First, try using that file with no special directory specified.
+cat > conftest.$ac_ext <<EOF
+#line 1434 "configure"
+#include "confdefs.h"
+#include <$x_direct_test_include>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1439: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  # Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+  for ac_dir in               \
+    /usr/X11/include          \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/include              \
+    /usr/local/include        \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    ; \
+  do
+    if test -r "$ac_dir/$x_direct_test_include"; then
+      ac_x_includes=$ac_dir
+      break
+    fi
+  done
+fi
+rm -f conftest*
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+  # Check for the libraries.
+
+  test -z "$x_direct_test_library" && x_direct_test_library=Xt
+  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS="$LIBS"
+  LIBS="-l$x_direct_test_library $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1508 "configure"
+#include "confdefs.h"
+
+int main() {
+${x_direct_test_function}()
+; return 0; }
+EOF
+if { (eval echo configure:1515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+    /usr/X11/lib          \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11     \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+rm -f conftest*
+fi # $ac_x_libraries = NO
+
+if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
+  # Didn't find X anywhere.  Cache the known absence of X.
+  ac_cv_have_x="have_x=no"
+else
+  # Record where we found X for the cache.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  echo "$ac_t""$have_x" 1>&6
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
+fi
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1602: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1607 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  ac_cv_header_stdc=yes
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1632 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1650 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1671 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:1682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+  cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
+echo "configure:1706: checking for sys/wait.h that is POSIX.1 compatible" >&5
+if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1711 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+int main() {
+int s;
+wait (&s);
+s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+; return 0; }
+EOF
+if { (eval echo configure:1727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_header_sys_wait_h=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_sys_wait_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
+if test $ac_cv_header_sys_wait_h = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_SYS_WAIT_H 1
+EOF
+
+fi
+
+for ac_hdr in fcntl.h strings.h sys/file.h unistd.h sys/time.h sys/select.h stdarg.h varargs.h termios.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1751: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1756 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:1789: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1794 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this.  */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this.  */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this.  */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+   It does not let you subtract one const X* pointer from another in an arm
+   of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this.  */
+  char *t;
+  char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+  *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+  int x[] = {25, 17};
+  const int *foo = &x[0];
+  ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+  typedef const int *iptr;
+  iptr p = 0;
+  ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+  struct s { int j; const int *ap[3]; };
+  struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+  const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:1843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_const=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+  cat >> confdefs.h <<\EOF
+#define const 
+EOF
+
+fi
+
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:1864: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat > conftest.$ac_ext <<EOF
+#line 1871 "configure"
+#include "confdefs.h"
+
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:1878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_c_inline=$ac_kw; break
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+  inline | yes) ;;
+  no) cat >> confdefs.h <<\EOF
+#define inline 
+EOF
+ ;;
+  *)  cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+echo $ac_n "checking for pid_t""... $ac_c" 1>&6
+echo "configure:1904: checking for pid_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1909 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_pid_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_pid_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_pid_t" 1>&6
+if test $ac_cv_type_pid_t = no; then
+  cat >> confdefs.h <<\EOF
+#define pid_t int
+EOF
+
+fi
+
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:1937: checking for size_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1942 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_size_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_size_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+  cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
+
+fi
+
+echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
+echo "configure:1970: checking whether time.h and sys/time.h may both be included" >&5
+if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1975 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+int main() {
+struct tm *tp;
+; return 0; }
+EOF
+if { (eval echo configure:1984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_header_time=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_time=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_time" 1>&6
+if test $ac_cv_header_time = yes; then
+  cat >> confdefs.h <<\EOF
+#define TIME_WITH_SYS_TIME 1
+EOF
+
+fi
+
+echo $ac_n "checking for u_int""... $ac_c" 1>&6
+echo "configure:2005: checking for u_int" >&5
+if eval "test \"`echo '$''{'ac_cv_type_u_int'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2010 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "u_int[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_u_int=yes
+else
+  rm -rf conftest*
+  ac_cv_type_u_int=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_u_int" 1>&6
+if test $ac_cv_type_u_int = no; then
+  cat >> confdefs.h <<\EOF
+#define u_int unsigned int
+EOF
+
+fi
+
+echo $ac_n "checking for u_char""... $ac_c" 1>&6
+echo "configure:2038: checking for u_char" >&5
+if eval "test \"`echo '$''{'ac_cv_type_u_char'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2043 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "u_char[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_u_char=yes
+else
+  rm -rf conftest*
+  ac_cv_type_u_char=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_u_char" 1>&6
+if test $ac_cv_type_u_char = no; then
+  cat >> confdefs.h <<\EOF
+#define u_char unsigned char
+EOF
+
+fi
+
+
+echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
+echo "configure:2072: checking for 8-bit clean memcmp" >&5
+if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_memcmp_clean=no
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2080 "configure"
+#include "confdefs.h"
+
+main()
+{
+  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
+}
+
+EOF
+if { (eval echo configure:2090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_func_memcmp_clean=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_func_memcmp_clean=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
+
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:2108: checking return type of signal handlers" >&5
+if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2113 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int main() {
+int i;
+; return 0; }
+EOF
+if { (eval echo configure:2130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_type_signal=void
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_type_signal=int
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_type_signal" 1>&6
+cat >> confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+
+for ac_func in poll strstr
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2151: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2156 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in usleep strsep strdup mkstemp snprintf memcmp
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2206: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2211 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+LIBOBJS="$LIBOBJS ${ac_func}.o"
+fi
+done
+
+
+
+mgp_keywords=`$mgp_cv_path_perl $srcdir/keywords.pl $srcdir/globals.c`
+
+
+echo "be sure to generate Makefile from Imakefile, using xmkmf -a."
+/bin/rm -f Makefile image/Makefile
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[        ]*VPATH[        ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[    `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.12"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Imakefile image/Imakefile sample/Imakefile
+       contrib/mgp2html.pl contrib/mgp2latex.pl contrib/mgpnet mgpembed.pl" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@CC@%$CC%g
+s%@AWK@%$AWK%g
+s%@YACC@%$YACC%g
+s%@LEX@%$LEX%g
+s%@LEXLIB@%$LEXLIB%g
+s%@mgp_cv_path_perl@%$mgp_cv_path_perl%g
+s%@mgp_cv_path_uuencode@%$mgp_cv_path_uuencode%g
+s%@mgp_cv_path_gzip@%$mgp_cv_path_gzip%g
+s%@DEBUGFLAGS@%$DEBUGFLAGS%g
+s%@OPTFLAGS@%$OPTFLAGS%g
+s%@DEPLIBS@%$DEPLIBS%g
+s%@mgp_cv_vflib_a@%$mgp_cv_vflib_a%g
+s%@CPP@%$CPP%g
+s%@LIBOBJS@%$LIBOBJS%g
+s%@mgp_keywords@%$mgp_keywords%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Imakefile image/Imakefile sample/Imakefile
+       contrib/mgp2html.pl contrib/mgp2latex.pl contrib/mgpnet mgpembed.pl"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/configure.in b/configure.in
new file mode 100644 (file)
index 0000000..1a1316e
--- /dev/null
@@ -0,0 +1,206 @@
+dnl NOTE:
+dnl This 'configure' and 'Imakefile.in' are written to be directory
+dnl independent (using srcdir), however, xmkmf and Imake.tmpl do not
+dnl allow us to switch compilation directory.
+dnl
+dnl $Id: configure.in,v 1.41 1998/09/06 02:10:21 itojun Exp $
+AC_INIT(image/imagetypes.c)
+
+dnl Checks for programs.
+AC_PROG_MAKE_SET
+AC_PROG_CC
+AC_PROG_AWK
+AC_PROG_YACC
+AC_PROG_LEX
+AC_PATH_PROGS(mgp_cv_path_perl, perl5 perl, no)
+AC_SUBST(mgp_cv_path_perl)
+AC_PATH_PROGS(mgp_cv_path_uuencode, uuencode, no)
+AC_SUBST(mgp_cv_path_uuencode)
+AC_PATH_PROGS(mgp_cv_path_gzip, gzip, no)
+AC_SUBST(mgp_cv_path_gzip)
+
+dnl Checks for debugging option.
+AC_MSG_CHECKING(if --enable-debug option specified)
+AC_ARG_ENABLE(debug,
+       [  --enable-debug          compile debugging information in.],
+       [mgp_debug="yes"; DEBUGFLAGS="-DDEBUG -g -Wall"],
+       [mgp_debug="no"])
+AC_MSG_RESULT($mgp_debug)
+DEBUGFLAGS=${DEBUGFLAGS-"OptimizedCDebugFlags"}
+AC_SUBST(DEBUGFLAGS)
+
+dnl Checks for libraries.
+LIBS="-lm $LIBS"
+
+AC_MSG_CHECKING(if --disable-freetype option specified)
+AC_ARG_ENABLE(freetype,
+       [  --disable-freetype      DON'T use freetype routines.],
+       [mgp_skip_freetype="yes"; mgp_use_freetype="no"],
+       [mgp_skip_freetype="no"; mgp_use_freetype="yes"])
+AC_MSG_RESULT($mgp_skip_freetype)
+OPTFLAGS=
+AC_SUBST(OPTFLAGS)
+DEPLIBS=
+AC_SUBST(DEPLIBS)
+if test "$mgp_use_freetype" = "yes"; then
+       AC_MSG_CHECKING(for freetype library/header)
+       for dir in /usr/local/freetype /usr/local; do
+               ac_cv_ft_lib=no
+               ac_cv_ft_include=no
+               if test -d $dir/lib -a -f $dir/lib/libttf.so; then
+                       ac_cv_ft_lib="$dir/lib"
+                       ac_cv_ft_libpath="libttf.so"
+               elif test -d $dir/lib -a -f $dir/lib/libttf.a; then
+                       ac_cv_ft_lib="$dir/lib"
+                       ac_cv_ft_libpath="libttf.a"
+               fi
+               if test -d $dir/include -a -f $dir/include/freetype.h; then
+                       ac_cv_ft_include="$dir/include"
+               fi
+               if test "$ac_cv_ft_lib" != "no" -a "$ac_cv_ft_include" != "no"; then
+                       LIBS="-L$ac_cv_ft_lib $LIBS"
+                       CFLAGS="-I$ac_cv_ft_include $CFLAGS"
+                       break
+               fi
+       done
+       if test "$ac_cv_ft_lib" = "no" -a "$ac_cv_ft_include" = "no"; then
+               AC_MSG_RESULT(no - not using freetype)
+               mgp_use_freetype=no
+       else
+               AC_MSG_RESULT($ac_cv_ft_lib and $ac_cv_ft_include)
+       fi
+fi
+if test "$mgp_use_freetype" = "yes"; then
+       LIBS="-L$ac_cv_ft_lib $LIBS"
+       OPTFLAGS="-I$ac_cv_ft_include $OPTFLAGS"
+       DEPLIBS="$ac_cv_ft_lib/$ac_cv_ft_libpath $DEPLIBS"
+       AC_CHECK_LIB(ttf, TT_Init_FreeType, [],
+               [echo "Fatal: libttf.a not found"
+               exit 1])
+       AC_TRY_COMPILE([#include <freetype.h>], [], [], [dnl
+               echo "Fatal: freetype.h not found"
+               exit 1])
+       AC_DEFINE(FREETYPE)
+       AC_MSG_CHECKING(for num_CharMaps field in TT_Face_Properties)
+       AC_TRY_COMPILE([#include <freetype.h>],
+               [TT_Face_Properties x; return x.num_CharMaps;],
+               [result=yes; AC_DEFINE(HAVE_TT_FACE_PROPERTIES_CHARMAPS)],
+               [result=no])
+       AC_MSG_RESULT($result)
+fi
+
+AC_MSG_CHECKING(if --disable-vflib option specified)
+AC_ARG_ENABLE(vflib,
+       [  --disable-vflib         DON'T use vflib routines.],
+       [mgp_skip_vflib="yes"; mgp_use_vflib="no"],
+       [mgp_skip_vflib="no"; mgp_use_vflib="yes"])
+AC_MSG_RESULT($mgp_skip_vflib)
+
+if test "$mgp_use_vflib" = "yes"; then
+       AC_MSG_CHECKING(for VFlib library/header)
+       for dir in /usr/local/VFlib /usr/local/vflib /usr/local; do
+               ac_cv_vf_libname=VFlib
+               ac_cv_vf_libdir=no
+               ac_cv_vf_hdrdir=no
+               if test -d $dir/lib -a -f $dir/lib/libVFlib.so; then
+                       ac_cv_vf_libdir="$dir/lib"
+                       ac_cv_vf_libpath="libVFlib.so"
+               elif test -d $dir/lib -a -f $dir/lib/libVFlib.a; then
+                       ac_cv_vf_libdir="$dir/lib"
+                       ac_cv_vf_libpath="libVFlib.a"
+               elif test -d $dir/lib -a -f $dir/lib/libVFlib2.so; then
+                       ac_cv_vf_libname=VFlib2
+                       ac_cv_vf_libdir="$dir/lib"
+                       ac_cv_vf_libpath="libVFlib2.so"
+               elif test -d $dir/lib -a -f $dir/lib/libVFlib2.a; then
+                       ac_cv_vf_libname=VFlib2
+                       ac_cv_vf_libdir="$dir/lib"
+                       ac_cv_vf_libpath="libVFlib2.a"
+               fi
+               if test -d $dir/include -a -f $dir/include/VF.h; then
+                       ac_cv_vf_hdrdir="$dir/include"
+               fi
+               if test "$ac_cv_vf_libdir" != "no" -a "$ac_cv_vf_hdrdir" != "no"; then
+                       LIBS="-L$ac_cv_vf_libdir $LIBS"
+                       CFLAGS="-I$ac_cv_vf_hdrdir $CFLAGS"
+                       break
+               fi
+       done
+       if test "$ac_cv_vf_libdir" = "no" -a "$ac_cv_vf_hdrdir" = "no"; then
+               AC_MSG_RESULT(no - not using VFlib)
+               mgp_use_vflib=no
+       else
+               AC_MSG_RESULT($ac_cv_vf_libdir and $ac_cv_vf_hdrdir)
+       fi
+fi
+if test "$mgp_use_vflib" = "yes"; then
+       LIBS="-L$ac_cv_vf_libdir -l$ac_cv_vf_libname $LIBS"
+       OPTFLAGS="-I$ac_cv_vf_hdrdir $OPTFLAGS"
+       DEPLIBS="$ac_cv_vf_libdir/$ac_cv_vf_libpath $DEPLIBS"
+       AC_CHECK_LIB($ac_cv_vf_libname, VF_Init,
+               [mgp_cv_vflib_a=$ac_cv_vf_libpath],
+               [echo "Fatal: $ac_cv_vf_libpath not found"
+               exit 1])
+       AC_TRY_COMPILE([#include <VF.h>], [], [], [dnl
+               echo "Fatal: VF.h not found"
+               exit 1])
+       AC_DEFINE(VFLIB)
+
+       AC_MSG_CHECKING(for VFlib configuration file)
+       AC_ARG_WITH(vfontcap, [  --with-vfontcap=PATH    use PATH as vfontcap])
+       ac_cv_vf_fontcap="no"
+       if test -f "$with_vfontcap"; then
+               ac_cv_vf_fontcap=$with_vfontcap;
+       else
+               for ac_dir in /usr/local/lib /usr/local/lib/tex \
+                   /usr/local/lib/VFlib /usr/local/lib/fonts/vf \
+                   /usr/local/lib /usr/local/etc /etc \
+                   /usr/local/libdata/vflib /usr/local/share/VFlib \
+                   ../../VFlib* ../VFlib* VFlib*; do
+                       if test -d $ac_dir -a -f $ac_dir/vfontcap; then
+                               ac_cv_vf_fontcap=$ac_dir/vfontcap;
+                               break
+                       fi
+               done
+       fi
+       AC_MSG_RESULT($ac_cv_vf_fontcap)
+       if test "$ac_cv_vf_fontcap" = "no"; then
+               echo Fatal: no vfontcap file found.  cannot continue.
+               echo Please use the option --with-vfontcap=PATH to specify the path to vfontcap.
+               exit 1
+       fi
+       AC_DEFINE_UNQUOTED(VFCAP, "$ac_cv_vf_fontcap")
+       AC_SUBST(mgp_cv_vflib_a)
+fi
+
+dnl Checks for header files.
+AC_PATH_X
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h unistd.h sys/time.h sys/select.h stdarg.h varargs.h termios.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_CHECK_TYPE(u_int, unsigned int)
+AC_CHECK_TYPE(u_char, unsigned char)
+
+dnl Checks for library functions.
+AC_FUNC_MEMCMP
+AC_TYPE_SIGNAL
+AC_CHECK_FUNCS(poll strstr)
+AC_REPLACE_FUNCS(usleep strsep strdup mkstemp snprintf memcmp)
+
+dnl keyword substitution.
+mgp_keywords=`$mgp_cv_path_perl $srcdir/keywords.pl $srcdir/globals.c`
+AC_SUBST(mgp_keywords)
+
+echo "be sure to generate Makefile from Imakefile, using xmkmf -a."
+/bin/rm -f Makefile image/Makefile
+
+AC_OUTPUT(Imakefile image/Imakefile sample/Imakefile
+       contrib/mgp2html.pl contrib/mgp2latex.pl contrib/mgpnet mgpembed.pl)
diff --git a/contrib/.cvsignore b/contrib/.cvsignore
new file mode 100644 (file)
index 0000000..66f2210
--- /dev/null
@@ -0,0 +1,7 @@
+tp2latex.pl
+tp2html.pl
+mgp2latex.pl
+mgp2html.pl
+Makefile
+mgpnet
+mgpnet.0
diff --git a/contrib/Imakefile b/contrib/Imakefile
new file mode 100644 (file)
index 0000000..37c5047
--- /dev/null
@@ -0,0 +1,23 @@
+#define IHaveSubdirs
+#define PassCDebugFlags
+
+SUBDIRS=       xwintoppm
+
+MakeSubdirs($(SUBDIRS))
+
+#if defined(ImakeConfigRelease) && ImakeConfigRelease >= 6
+InstallNamedTarget(install,mgpnet,$(INSTBINFLAGS),$(BINDIR),mgpnet) /*R6 only*/
+#else
+InstallNamedProg(mgpnet,mgpnet,$(BINDIR)) /*obsoleted in R6?*/
+#endif
+InstallManPage(mgpnet,$(MANDIR))
+
+all::
+depend::
+install::
+
+distclean:: clean
+       for i in $(SUBDIRS); do \
+               (cd $$i; if [ -f Makefile ]; then make distclean; fi) ;\
+       done
+       -/bin/rm -f mgpnet mgpnet.0 mgp2latex.pl mgp2html.pl Makefile
diff --git a/contrib/mgp2html.pl.in b/contrib/mgp2html.pl.in
new file mode 100644 (file)
index 0000000..38b92cc
--- /dev/null
@@ -0,0 +1,229 @@
+#! @mgp_cv_path_perl@
+
+# mgp2html.pl
+# converts MagicPoint input file to simple dumb html file.
+# $Id: mgp2html.pl.in,v 1.9 1998/08/26 05:30:12 itojun Exp $
+#
+# Copyright (C) 1997 and 1998 WIDE Project.  All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the project nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+@keywords = split(/\s+/, <<EOF);
+@mgp_keywords@
+EOF
+
+$alignmode = '';
+$outputsomething = 0;
+$page = -1;
+$line = 0;
+$doimage = 1;
+$nodefault = 0;
+$ignoremode = 0;
+$indent = 0;
+
+&prologue;
+while (<>) {
+       s/\n$//;
+
+       $_ = '' if (/^#/o);
+
+       if ($_ eq '' || $_ =~ /^[^%]/) {
+               $line++;
+               if ($default[$line] && !$nodefault) {
+                       &cmds($default[$line]);
+               }
+               next if ($ignoremode);
+               next if ($page == -1);
+               &output($_);
+               next;
+       }
+
+       &cmds($_);
+}
+&pageepilogue;
+&epilogue;
+exit 0;
+
+
+sub cmds {
+       local($_) = @_;
+
+       # special directives
+       if (/^%page/i) {
+               if ($page != -1) {
+                       &alignreset;
+                       &pageepilogue;
+               } else {
+                       $page = 0;
+               }
+               &pageprologue;
+               $line = 0;
+               $nodefault = 0;
+               next;
+       } elsif (/^%default/i) {
+               $x = (split(/\s+/, $_))[1];
+               $default[$x] = $_;
+               $default[$x] =~ s/^%default\s+\d+\s+/\%/;
+               next;
+       } elsif (/^%%/) {
+               &output('');
+               next;
+       }
+
+       # parsed directives
+       @dirs = split(/,\s*/, substr($_, 1));
+       foreach $j (@dirs) {
+               @dir = split(/\s+/, $j);
+               $dir[0] =~ tr/A-Z/a-z/;
+               if ($dir[0] eq 'image') {
+                       if ($dir[$#dir] =~ /^\d+x\d+/) {
+                               $#dir--;
+                       }
+                       $dir[1] =~ s/\"//g;
+                       if (!$doimage) {
+                               # don't use images
+                       } elsif (scalar(@dir) == 2 || scalar(@dir) == 3) {
+                               print "<IMG SRC=\"$dir[1]\" ALT=\"$dir[1]\">\n";
+                       } elsif (scalar(@dir) == 4) {
+                               # interpretation wrong
+                               print "<IMG SRC=\"$dir[1]\" WIDTH=$dir[3]% HEIGHT=$dir[3]% ALT=\"$dir[1]\">\n";
+                       } elsif (scalar(@dir) >= 5) {
+                               # interpretation wrong
+                               print "<IMG SRC=\"$dir[1]\" WIDTH=$dir[3]% HEIGHT=$dir[4]% ALT=\"$dir[1]\">\n";
+                       }
+               } elsif ($dir[0] eq 'nodefault') {
+                       $nodefault++;
+               } elsif ($dir[0] =~ /^(left|right|center)$/) {
+                       $dir[0] =~ tr/A-Z/a-z/;
+                       &alignreset;
+                       &alignmode($dir[0]);
+               } elsif ($dir[0] =~ /^filter$/) {
+                       $ignoremode = 1;
+               } elsif ($dir[0] =~ /^endfilter$/) {
+                       $ignoremode = 0;
+               } elsif (grep($dir[0] eq $_, @keywords)) {
+                       # unsupported directive with 1 parameter
+               } else {
+                       die "unsupported directive $dir[0]\n";
+               }
+       }
+}
+
+sub prologue {
+       print <<EOF;
+<HTML>
+<BODY>
+EOF
+}
+
+sub epilogue {
+       print <<EOF;
+</BODY>
+</HTML>
+EOF
+}
+
+sub pageprologue {
+       print <<EOF
+<HR>
+EOF
+}
+
+sub pageepilogue {
+       $page++;
+       &doindent(0);
+       print <<EOF
+(page $page)<BR>
+EOF
+}
+
+sub output {
+       local($str) = @_;
+       local($i) = 0;
+
+       while ($str =~ /^\t/) {
+               $i++;
+               $str = substr($str, 1);
+       }
+       &doindent($i);
+       if (length($str)) {
+               if ($indent) {
+                       print "\t" x $indent . "<LI>" . $str . "\n";
+               } else {
+                       print $str . "<BR>\n";
+               }
+               $outputsomething++;
+       } else {
+               print "<BR>\n";
+       }
+}
+
+sub doindent {
+       local($level) = @_;
+
+       if ($indent > $level) {
+               while ($indent > $level) {
+                       print "\t" x $indent . "</UL>\n";
+                       $indent--;
+               }
+       } else {
+               while ($indent < $level) {
+                       $indent++;
+                       print "\t" x $indent . "<UL>\n";
+               }
+       }
+}
+
+sub alignreset {
+       return if ($alignmode eq '');
+
+       if ($alignmode eq 'left') {
+               print "</DIV>\n";
+       } elsif ($alignmode eq 'right') {
+               print "</DIV>\n";
+       } elsif ($alignmode eq 'center') {
+               print "</DIV>\n";
+       } else {
+               die "unknown alignment $alignmode\n";
+       }
+
+       $alignmode = '';
+}
+
+sub alignmode {
+       local($mode) = @_;
+
+       $alignmode = $mode;
+       if ($alignmode eq 'left') {
+               print "<DIV ALIGN=LEFT>\n";
+       } elsif ($alignmode eq 'right') {
+               print "<DIV ALIGN=RIGHT>\n";
+       } elsif ($alignmode eq 'center') {
+               print "<DIV ALIGN=CENTER>\n";
+       } else {
+               die "unknown alignment $mode\n";
+       }
+       $outputsomething = 0;
+}
diff --git a/contrib/mgp2latex.pl.in b/contrib/mgp2latex.pl.in
new file mode 100644 (file)
index 0000000..9a2e4b9
--- /dev/null
@@ -0,0 +1,198 @@
+#! @mgp_cv_path_perl@
+
+# mgp2latex.pl
+# converts MagicPoint input file to latex "seminar" style document.
+# $Id: mgp2latex.pl.in,v 1.8 1998/08/26 05:30:12 itojun Exp $
+#
+# Copyright (C) 1997 and 1998 WIDE Project.  All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the project nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+@keywords = split(/\s+/, <<EOF);
+@mgp_keywords@
+EOF
+
+$alignmode = '';
+$outputsomething = 0;
+$page = -1;
+$line = 0;
+$doimage = 0;
+$nodefault = 0;
+$ignoremode = 0;
+
+&prologue;
+while (<>) {
+       s/\n$//;
+
+       $_ = '' if (/^#/o);
+
+       if ($_ eq '' || $_ =~ /^[^%]/) {
+               $line++;
+               if ($default[$line] && !$nodefault) {
+                       &cmds($default[$line]);
+               }
+               next if ($ignoremode);
+               next if ($page == -1);
+               &output($_);
+               next;
+       }
+
+       &cmds($_);
+}
+&pageepilogue;
+&epilogue;
+exit 0;
+
+
+sub cmds {
+       local($_) = @_;
+
+       # special directives
+       if (/^%page/i) {
+               if ($page != -1) {
+                       &alignreset;
+                       &pageepilogue;
+               } else {
+                       $page = 0;
+               }
+               &pageprologue;
+               $line = 0;
+               $nodefault = 0;
+               next;
+       } elsif (/^%default/i) {
+               $x = (split(/\s+/, $_))[1];
+               $default[$x] = $_;
+               $default[$x] =~ s/^%default\s+\d+\s+/\%/;
+               next;
+       } elsif (/^%%/) {
+               &output('');
+               next;
+       }
+
+       # parsed directives
+       @dirs = split(/,\s*/, substr($_, 1));
+       foreach $j (@dirs) {
+               @dir = split(/\s+/, $j);
+               $dir[0] =~ tr/A-Z/a-z/;
+               if ($dir[0] eq 'image') {
+#                      if (!$doimage) {
+#                              # don't use images
+#                      } elsif (scalar(@dir) == 2 || scalar(@dir) == 3) {
+#                              print "<IMG SRC=\"$dir[1]\" ALT=\"$dir[1]\">\n";
+#                      } elsif (scalar(@dir) == 4) {
+#                              # interpretation wrong
+#                              print "<IMG SRC=\"$dir[1]\" WIDTH=$dir[3]% HEIGHT=$dir[3]% ALT=\"$dir[1]\">\n";
+#                      } elsif (scalar(@dir) >= 5) {
+#                              # interpretation wrong
+#                              print "<IMG SRC=\"$dir[1]\" WIDTH=$dir[3]% HEIGHT=$dir[4]% ALT=\"$dir[1]\">\n";
+#                      }
+               } elsif ($dir[0] eq 'nodefault') {
+                       $nodefault++;
+               } elsif ($dir[0] =~ /^(left|right|center)$/) {
+                       $dir[0] =~ tr/A-Z/a-z/;
+                       &alignreset;
+                       &alignmode($dir[0]);
+               } elsif ($dir[0] =~ /^filter$/) {
+                       $ignoremode = 1;
+               } elsif ($dir[0] =~ /^endfilter$/) {
+                       $ignoremode = 0;
+               } elsif (grep($dir[0] eq $_, @keywords)) {
+                       # unsupported directive with 1 parameter
+               } else {
+                       die "unsupported directive $dir[0]\n";
+               }
+       }
+}
+
+sub prologue {
+       print <<EOF;
+\\documentstyle{seminar}
+\\begin{document}
+EOF
+}
+
+sub epilogue {
+       print <<EOF;
+\\end{document}
+EOF
+}
+
+sub pageprologue {
+       print <<EOF
+\\begin{slide}
+EOF
+}
+
+sub pageepilogue {
+       print <<EOF
+\\end{slide}
+EOF
+}
+
+sub output {
+       local($str) = @_;
+
+       if (length($str)) {
+               print $str . "\\\\\n";
+               $outputsomething++;
+       } else {
+               print "\\vspace{3mm}\n";
+       }
+}
+
+sub alignreset {
+       return if ($alignmode eq '');
+
+       if (!$outputsomething) {
+               print "\\quad\n";
+       }
+       if ($alignmode eq 'left') {
+               print "\\end{flushleft}\n";
+       } elsif ($alignmode eq 'right') {
+               print "\\end{flushright}\n";
+       } elsif ($alignmode eq 'center') {
+               print "\\end{center}\n";
+       } else {
+               die "unknown alignment $alignmode\n";
+       }
+
+       $alignmode = '';
+}
+
+sub alignmode {
+       local($mode) = @_;
+
+       $alignmode = $mode;
+       if ($alignmode eq 'left') {
+               print "\\begin{flushleft}\n";
+       } elsif ($alignmode eq 'right') {
+               print "\\begin{flushright}\n";
+       } elsif ($alignmode eq 'center') {
+               print "\\begin{center}\n";
+       } else {
+               die "unknown alignment $mode\n";
+       }
+       $outputsomething = 0;
+}
diff --git a/contrib/mgpnet.in b/contrib/mgpnet.in
new file mode 100644 (file)
index 0000000..6f6e912
--- /dev/null
@@ -0,0 +1,459 @@
+#! @mgp_cv_path_perl@
+
+#
+# Copyright (C) 1997 and 1998 WIDE Project.  All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of the project nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $Id: mgpnet.in,v 1.4 1998/08/26 05:30:13 itojun Exp $
+#
+
+# configurations
+$tmpdir = '/tmp';
+$httpdatestr = "date '+\%a, \%d \%b \%Y \%H:\%M:\%S \%Z'";
+$seltimeout = 1;
+$refreshtimeout = 10;
+$debug = 0;
+$port = 9999;
+# it looks that "charset" parameter for Content-type makes many browsers
+# unhappy.  it is a shame.
+$usecharset = 0;
+
+# do not edit beyond here
+$hostname = `hostname`;
+$hostname =~ s/\n$//;
+
+# portable?
+if (scalar(@ARGV) == 0) {
+       open(IN, "ifconfig -a | grep 'inet '|") && do {
+               do {
+                       $hostname = (split(/\s+/, <IN>))[2];
+               } while ($hostname =~ /^127\./);
+               close(IN);
+       };
+       print "http://$hostname:$port/\n";
+       exit 0;
+}
+
+# greeting
+print STDERR "welcome to MagicPoint Netserver...\n";
+
+# parameter parsing
+$tmpseed = 0;
+$checkfile = &tmpname;
+if (grep($ARGV[$_] eq '-T', 0 .. scalar(@ARGV) - 1)) {
+       $checkfile = $ARGV[$_ + 1];
+} else {
+       @ARGV = ('-T', $checkfile, @ARGV);
+}
+
+$imagefile = &tmpname;
+$checkcontent = '';
+
+# OS parameter
+&guessparam;
+if (!defined $AF_INET || !defined $PF_INET || !defined $SOCK_STREAM
+ || !defined $sockaddr || !defined $WNOHANG) {
+       print STDERR "could not guess system parameter. edit by hand.\n";
+       exit 1;
+}
+
+# HTTP/1.0 related
+$tmp = <<EOF;
+200    OK
+201    Created
+202    Accepted
+204    No Content
+301    Moved Permanently
+302    Moved Temporarily
+304    Not Modified
+400    Bad Request
+401    Unauthorized
+403    Forbidden
+404    Not Found
+500    Internal Server Error
+501    Not Implemented
+502    Bad Gateway
+503    Service Unavailable
+EOF
+foreach $i (split(/\n/, $tmp)) {
+       ($j, $k) = split(/\t/, $i);
+       $httpmsg{$j} = $k;
+}
+
+# setting up socket.
+$anyinaddr = pack('C4', 0, 0, 0, 0);
+if ($havesinlen) {
+       $mysockaddr = pack($sockaddr, 14, $AF_INET, $port, $anyinaddr);
+       $hissockaddr = pack($sockaddr, 14, $AF_INET, $port, $anyinaddr);
+} else {
+       $mysockaddr = pack($sockaddr, $AF_INET, $port, $anyinaddr);
+       $hissockaddr = pack($sockaddr, $AF_INET, $port, $anyinaddr);
+}
+$proto = (getprotobyname('tcp'))[2];
+socket(S, $PF_INET, $SOCK_STREAM, $proto) || die "socket: $!";
+if (defined $SOL_SOCKET && defined $SO_REUSEPORT) {
+       setsockopt(S, $SOL_SOCKET, $SO_REUSEPORT, 1);
+}
+bind(S, $mysockaddr) || die "bind: $!";
+listen(S, 5) || die "listen: $!";
+
+# fork/exec mgp
+$mgppid = fork;
+if ($mgppid < 0) {
+       print STDERR "could not invoke MagicPoint (fork): $!\n";
+       exit -1;
+}
+$SIG{'CHLD'} = 'chldhandler';
+if ($mgppid == 0){
+       close(S);
+       exec 'mgp', @ARGV;
+       print STDERR "could not invoke MagicPoint (exec): $!\n"
+}
+
+$SIG{'TERM'} = 'IGNORE';
+print STDERR "waiting for connection on port $port.\n";
+$acceptstat = 0;
+while (1) {
+       if (waitpid($mgppid, $WNOHANG) == -1) {
+               print STDERR "MagicPoint terminated.\n";
+               last;
+       }
+
+       # page changed?
+       &checkimgfile;
+
+       # wait for an event...
+       $rin = $win = $ein = '';
+       vec($rin, fileno(S), 1) = 1;
+       vec($win, fileno(S), 1) = 1;
+       $ewin = $rin | $win;
+       print STDERR "waiting for connetion...\n" if ($debug);
+       ($nfound, $timeleft) = 
+               select($rout = $rin, $wout = $win, $eout = $ein, $seltimeout);
+       next if ($nfound <= 0);
+       if (vec($rout, fileno(S), 1)) {
+               print STDERR "accepting connetion...\n" if ($debug);
+               accept(NS, S) || do {
+                       print STDERR "server: accept fail\n" if ($debug);
+                       next;
+               };
+
+               $acceptstat++;
+               print STDERR "connetion accepted...\n" if ($debug);
+
+               $pid = fork;
+               if ($pid < 0) {
+                       print STDERR "server: fork fail\n" if ($debug);
+                       close(NS);
+                       next;
+               } elsif ($pid) {
+                       print STDERR "server: fork success\n" if ($debug);
+                       close(NS);
+                       next;
+               }
+
+               # http server task
+               print STDERR "http server task started...\n" if ($debug);
+               select(NS); $/ = "\n"; $| = 1;
+               &httpserver;
+               close(NS);
+               close(S);
+               exit;
+       }
+}
+print STDERR "leaving MagicPoint Netserver...\n";
+print STDERR "accepted $acceptstat connetions so far.\n";
+close(NS);
+close(S);
+unlink($imagefile);
+exit 0;
+
+sub checkimgfile {
+       local($junk, $t);
+       local($imgtmp);
+       local($pid, $errout);
+       open(CHK, "< $checkfile") || return;
+       $junk = select(CHK); $/ = ''; $| = 1; select($junk);
+       $t = <CHK>;
+       close(CHK);
+       if ($checkcontent ne $t) {
+               print STDERR "page updated.\n";
+               $checkcontent = $t;
+               $pid = fork;
+               return if (0 < $pid);   # if fork success, parent returns.
+               if ($pid == 0) {
+                       print STDERR "window grab: fork success.\n" if ($debug);
+               } else {
+                       print STDERR "window grab: fork fail, ".
+                               "process without fork.\n" if ($debug);
+               }
+
+               $imgtmp = &tmpname;
+               $errout = ($debug ? '' : '2>&-');
+               system "xwintoppm -silent -name MagicPoint | ".
+                       "ppmquant 256 $errout | ppmtogif $errout > $imgtmp";
+               if (-z $imgtmp) {
+                       unlink $imgtmp;
+                       $checkcontent = '';
+               } else {
+                       unlink $imagefile;
+                       link($imgtmp, $imagefile);
+                       unlink $imgtmp;
+                       $checkcontent = $t;
+               }
+               print STDERR 'window grab: done with ' .
+                       ($checkcontent eq '' ? 'failure' : 'success') . ".\n";
+               if ($pid == 0) {
+                       print STDERR "window grab: forked process dies.\n"
+                               if ($debug);
+                       # if fork success, child dies.
+                       exit 0;
+               }
+       }
+}
+
+sub chldhandler {
+       local($sig) = @_;
+       return if ($sig ne 'CHLD');
+       wait;
+}
+
+sub httpserver {
+       local($httpreq, $httpmethod, $httppath, $httpver, $httphost);
+       local($httpagent);
+       local($imgplace, $imgwidth, $imgheight, $buf, $imglen);
+       local($cthtml, $ctgif);
+
+       $cthtml = ($usecharset ? 'text/html; charset=us-ascii' : 'text/html');
+       $ctgif = 'image/gif';
+
+       $httpreq = <NS>;
+       print STDERR 'HTTP in> ' . $httpreq if ($debug);
+       $httpreq =~ s/[\r\n]+$//;
+       $httpmethod = $httppath = $httpver = '';
+       ($httpmethod, $httppath, $httpver) = split(/\s+/, $httpreq);
+       $httppath =~ s/http:\/\/[^:\/]+(:\d+)\//\//;
+       if ($httpver eq '' || $httpver eq 'HTTP/1.0') {
+               ;       # ok
+       } else {
+               &httpheader(501, $cthtml) if ($httpver);
+
+               print <<EOF;
+<HEAD><TITLE>Version not implemented</TITLE></HEAD>
+<BODY><H1>Version not implemented</H1>
+HTTP protocol version $httpversion not supported.<P>
+</BODY>
+EOF
+               return;
+       }
+
+       $httphost = "$hostname:$port";
+       if ($httpver) {
+               while (<NS>) {
+                       $_ =~ s/[\r\n]+$//;
+                       $httphost = $1 if ($_ =~ /^Host:\s*(\S+)$/i);
+                       $httpagent = $1 if ($_ =~ /^User-Agent:\s*(\S+)$/i);
+                       last if ($_ eq '');
+                       print STDERR 'HTTP in> ' . $_ . "\n" if ($debug);
+               }
+       }
+
+       if ($httpmethod !~ /^(GET|HEAD)$/) {
+               &httpheader(501, $cthtml) if ($httpver);
+
+               print <<EOF;
+<HEAD><TITLE>Method not implemented</TITLE></HEAD>
+<BODY><H1>Method not implemented</H1>
+$httpmethod to $httppath not supported.<P>
+</BODY>
+EOF
+               return;
+       }
+
+       $imgwidth = $imgheight = 0;
+       if ($httppath =~ /^\/(\d+)x(\d+)\.html$/) {
+               $imgwidth = $1;
+               $imgheight = $2;
+               $httppath = '/index.html';
+       }
+
+       if ($httppath eq '/' || $httppath eq '/index.html') {
+               if ($imgwidth && $imgheight) {
+                       $imgplace = "WIDTH=$imgwidth HEIGHT=$imgheight ";
+               } else {
+                       $imgplace = '';
+               }
+
+               &httpheader(200, $cthtml) if ($httpver);
+               return if ($httpmethod ne 'GET');
+
+               if ($refreshtimeout) {
+                       print <<EOF;
+<META HTTP-EQUIV=\"Refresh\" CONTENT=$refreshtimeout>
+EOF
+               }
+               print <<EOF;
+<HEAD><TITLE>MagicPoint Netserver</TITLE></HEAD>
+<BODY>
+<IMG SRC=\"/presentation.gif\" ALT=\"presentation image\"
+$imgplace ALIGN=left><BR>
+<TABLE border=0>
+<TR><TD NOWRAP><A HREF=/index.html>normal</A>
+<TR><TD NOWRAP><A HREF=/800x600.html>800x600</A>
+<TR><TD NOWRAP><A HREF=/640x480.html>640x480</A>
+<TR><TD NOWRAP><A HREF=/400x300.html>400x300</A>
+<TR><TD NOWRAP><A HREF=/100x75.html>100x75</A>
+</TABLE>
+<BR CLEAR=left>
+<HR>
+<TABLE border=0>
+<TR><TD NOWRAP ROWSPAN=2>
+       <FONT SIZE=+5><I>MagicPoint</I> Netserver</FONT>
+<TD>
+       Presented by <A HREF=http://www.itojun.org/>itojun.org</A>
+<TR><TD NOWRAP>
+       Supported by <A HREF=http://www.mew.org/mgp/>MagicPoint Project,</A>
+       <A HREF=http://www.wide.ad.jp/>WIDE Internet</A>
+</TABLE>
+</BODY></HTML>
+EOF
+       } elsif ($httppath eq '/presentation.gif') {
+               open(IMG, "< $imagefile") || do {
+                       $checkcontent = '';     # invalidate
+                       &httpheader(404, $cthtml) if ($httpver);
+                       return if ($httpmethod ne 'GET');
+
+                       print <<EOF;
+<HEAD><TITLE>File Not found</TITLE></HEAD>
+<BODY><H1>File Not found</H1>
+The requested URL $httppath was not found on this server.<P>
+Looks like a mitake in configuration.
+Contact the administrator.<P>
+</BODY>
+EOF
+                       return;
+               };
+               &httpheader(200, $ctgif) if ($httpver);
+               return if ($httpmethod ne 'GET');
+
+               while (0 < ($imglen = sysread(IMG, $buf, 4096))) {
+                       syswrite(NS, $buf, $imglen);
+               }
+               close(IMG);
+       } else {
+               &httpheader(404, $cthtml) if ($httpver);
+               return if ($httpmethod ne 'GET');
+
+               print <<EOF;
+<HEAD><TITLE>File Not found</TITLE></HEAD>
+<BODY><H1>File Not found</H1>
+The requested URL $httppath was not found on this server.<P>
+</BODY>
+EOF
+       }
+}
+
+sub httpheader {
+       local($code, $ct) = @_;
+       local($tmp);
+       local($date);
+
+       $date = `$httpdatestr`;
+       $date =~ s/[\r\n]+//;
+       $tmp = <<EOF;
+HTTP/1.0 $code $httpmsg{$code}
+Date: $date
+Expires: $date
+Server: MagicPointNetserver
+Pragma: no-cache
+Content-type: $ct
+EOF
+
+       $tmp .= "\n";
+       $tmp =~ s/\n/\r\n/g;
+       print $tmp;
+
+       if ($debug) {
+               $tmp =~ s/\r\n/\n/g;
+               $tmp = join("\nHTTP out> ", split(/\n/, $tmp));
+               $tmp = 'HTTP out> ' . $tmp . "\n";
+               print STDERR $tmp;
+       }
+}
+
+#------------------------------------------------------------
+
+sub guessparam {
+       local($tmpnam, $tmp, @tmp1, @tmp2);
+       local(%varnames);
+
+       %varnames = (
+'XXX1', 'AF_INET',     'XXX2', 'PF_INET',      'XXX3', 'SOL_SOCKET',
+'XXX4', 'SO_REUSEPORT',        'XXX5', 'SOCK_STREAM',  'XXX6', 'WNOHANG',
+);
+       $tmpnam = &tmpname;
+       open(CPP, "| @CPP@ >$tmpnam") || return;
+       print CPP "#include <sys/socket.h>\n";
+       print CPP "#include <sys/wait.h>\n";
+       foreach $tmp (keys %varnames) {
+               print CPP "$tmp $varnames{$tmp}\n";
+       }
+       close(CPP) || return;
+
+       $tmp = '';
+       open(CPP, "< $tmpnam") || return;
+       while (<CPP>) {
+               $tmp .= $_;
+       }
+       close(CPP);
+       unlink $tmpnam;
+
+       @tmp1 = split(/\n/, $tmp);
+
+       if (grep($_ =~ /sin_len/, @tmp1)) {
+               $havesinlen = 1; $sockaddr = 'C C n a4 x8';
+       } else {
+               $havesinlen = 0; $sockaddr = 'S n a4 x8';
+       }
+
+       foreach $i (keys %varnames) {
+               if (@tmp2 = grep($_ =~ /^$i/, @tmp1)) {
+                       $tmp = (split(/\s+/, @tmp2[0]))[1];
+                       $tmp = oct($tmp) if ($tmp =~ /^0/);
+                       next if ($tmp !~ /^[0-9]+$/);
+                       eval "\$$varnames{$i} = \$tmp;";
+               }
+       }
+}
+
+sub tmpname {
+       local($fname);
+
+       do {
+               $fname = $tmpdir . '/' . time . '.' . $$ . '.' . $tmpseed++;
+       } while (-e $fname);
+       return $fname;
+}
diff --git a/contrib/mgpnet.man b/contrib/mgpnet.man
new file mode 100644 (file)
index 0000000..3080471
--- /dev/null
@@ -0,0 +1,82 @@
+.\" Copyright (C) 1997 and 1998 WIDE Project.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the project nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\" 
+.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\" 
+.\"    $Id: mgpnet.man,v 1.3 1998/08/26 05:30:14 itojun Exp $
+.\"
+.Dd December 1997
+.Dt MGPNET 1
+.Os
+.Sh NAME
+.Nm mgpnet
+.Nd MagicPoint Netserver (provide MagicPoint presentation over the net)
+.Sh SYNOPSIS
+.Nm mgpnet
+.Op arguments to mgp
+.Sh DESCRIPTION
+.Nm mgpnet
+is a small http server to be executed on the presenter's notebook computer.
+It lets audience read MagicPoint presentation foils on her notebook computers,
+over the net.
+.Pp
+When a presenter performs a presentation, she should invoke
+.Nm mgpnet
+instead of
+.Nm mgp ,
+with the same argument.
+.Nm mgpnet
+will become an http server running on tcp port 9999 (by default),
+and invokes
+.Nm mgp
+as a child process.
+By accessing URL
+.Fa http://hostname:9999/ ,
+audience will be able to read the MagicPoint window currently displayed
+on the presenter's notebook.
+The webpage provided by
+.Nm mgpnet
+is designed in "client pull" manner;
+audience's notebook will reload the page, several times a minute.
+.Pp
+If no option is specified,
+.Nm mgpnet
+will print the URL to be accessed by the audience to the standard output.
+This is useful for indicating the URL to be accessed on the presentation,
+like:
+.Bd -literal
+%filter "mgpnet"
+%endfilter
+.Ed
+.Sh TODO
+Be network conscious.
+Current implementation is too naive about CPU/network usage.
+Presenter's notebook may be overloaded if there's too many audiences.
+.Sh SEE ALSO
+.Xr mgp 1 ,
+.Xr xwintoppm 1 .
+.Sh HISTORY
+.Nm mgpnet
+was created by Jun-ichiro itojun Itoh <itojun@itojun.org>,
+on the day before the newyear's eve, 1997.
diff --git a/contrib/xmindpath/.cvsignore b/contrib/xmindpath/.cvsignore
new file mode 100644 (file)
index 0000000..9bae16c
--- /dev/null
@@ -0,0 +1,4 @@
+config.log
+config.cache
+config.status
+Makefile
diff --git a/contrib/xmindpath/Makefile.in b/contrib/xmindpath/Makefile.in
new file mode 100644 (file)
index 0000000..a25fb35
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# $Id: Makefile.in,v 1.2 1998/08/23 04:50:14 itojun Exp $
+#
+
+srcdir=        @srcdir@
+SRCS=  main.c uucplock.c
+OBJS=  main.o uucplock.o
+CFLAGS=        @DEFS@ @X_CFLAGS@
+LDFLAGS=@LDFLAGS@
+LIBS=  @LIBS@
+CC=    @CC@
+TARGET=        xmindpath
+
+INSTALL=@INSTALL@
+prefix=        @prefix@
+exec_prefix=   @exec_prefix@
+bindir=        @bindir@
+mandir=        @mandir@
+
+all:   $(TARGET)
+$(TARGET):     $(OBJS)
+       $(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS) 
+
+main.o:        $(srcdir)/main.c
+uucplock.o:    $(srcdir)/uucplock.c
+
+install::
+       $(INSTALL) -s -o uucp -g bin -m 4755 $(TARGET) $(bindir)
+       $(INSTALL) -o bin -g bin -m 444 $(TARGET).1 $(mandir)/man1
+
+includes::
+
+clean::
+       /bin/rm -f *.o $(TARGET)
+
+distclean:: clean
+       /bin/rm -f Makefile config.cache config.log config.status .depend
+
+depend:
+       mkdep ${CFLAGS:M-[ID]*} $(srcdir)/*.c
diff --git a/contrib/xmindpath/config.guess b/contrib/xmindpath/config.guess
new file mode 100755 (executable)
index 0000000..e9e4455
--- /dev/null
@@ -0,0 +1,693 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Written by Per Bothner <bothner@cygnus.com>.
+# The master version of this file is at the FSF in /home/gd/gnu/lib.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit system type (host/target name).
+#
+# Only a few systems have been added to this list; please add others
+# (but try to keep the structure clean).
+#
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 8/24/94.)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+       PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    alpha:OSF1:*:*)
+       # A Vn.n version is a released version.
+       # A Tn.n version is a released field test version.
+       # A Xn.n version is an unreleased experimental baselevel.
+       # 1.2 uses "1.2" for uname -r.
+       echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
+       exit 0 ;;
+    21064:Windows_NT:50:3)
+       echo alpha-dec-winnt3.5
+       exit 0 ;;
+    Amiga*:UNIX_System_V:4.0:*)
+       echo m68k-cbm-sysv4
+       exit 0;;
+    amiga:NetBSD:*:*)
+      echo m68k-cbm-netbsd${UNAME_RELEASE}
+      exit 0 ;;
+    amiga:OpenBSD:*:*)
+      echo m68k-cbm-openbsd${UNAME_RELEASE}
+      exit 0 ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+       echo arm-acorn-riscix${UNAME_RELEASE}
+       exit 0;;
+    Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
+       # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+       if test "`(/bin/universe) 2>/dev/null`" = att ; then
+               echo pyramid-pyramid-sysv3
+       else
+               echo pyramid-pyramid-bsd
+       fi
+       exit 0 ;;
+    NILE:*:*:dcosx)
+       echo pyramid-pyramid-svr4
+       exit 0 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    i86pc:SunOS:5.*:*)
+       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    sun4*:SunOS:6*:*)
+       # According to config.sub, this is the proper way to canonicalize
+       # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+       # it's likely to be more like Solaris than SunOS4.
+       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    sun4*:SunOS:*:*)
+       case "`/usr/bin/arch -k`" in
+           Series*|S4*)
+               UNAME_RELEASE=`uname -v`
+               ;;
+       esac
+       # Japanese Language versions have a version number like `4.1.3-JL'.
+       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       exit 0 ;;
+    sun3*:SunOS:*:*)
+       echo m68k-sun-sunos${UNAME_RELEASE}
+       exit 0 ;;
+    aushp:SunOS:*:*)
+       echo sparc-auspex-sunos${UNAME_RELEASE}
+       exit 0 ;;
+    atari*:NetBSD:*:*)
+       echo m68k-atari-netbsd${UNAME_RELEASE}
+       exit 0 ;;
+    atari*:OpenBSD:*:*)
+       echo m68k-atari-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sun3*:NetBSD:*:*)
+       echo m68k-sun-netbsd${UNAME_RELEASE}
+       exit 0 ;;
+    sun3*:OpenBSD:*:*)
+       echo m68k-sun-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mac68k:NetBSD:*:*)
+       echo m68k-apple-netbsd${UNAME_RELEASE}
+       exit 0 ;;
+    mac68k:OpenBSD:*:*)
+       echo m68k-apple-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    powerpc:machten:*:*)
+       echo powerpc-apple-machten${UNAME_RELEASE}
+       exit 0 ;;
+    RISC*:Mach:*:*)
+       echo mips-dec-mach_bsd4.3
+       exit 0 ;;
+    RISC*:ULTRIX:*:*)
+       echo mips-dec-ultrix${UNAME_RELEASE}
+       exit 0 ;;
+    VAX*:ULTRIX*:*:*)
+       echo vax-dec-ultrix${UNAME_RELEASE}
+       exit 0 ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+       sed 's/^        //' << EOF >dummy.c
+       int main (argc, argv) int argc; char **argv; {
+       #if defined (host_mips) && defined (MIPSEB)
+       #if defined (SYSTYPE_SYSV)
+         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_SVR4)
+         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+       #endif
+       #endif
+         exit (-1);
+       }
+EOF
+       ${CC-cc} dummy.c -o dummy \
+         && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+         && rm dummy.c dummy && exit 0
+       rm -f dummy.c dummy
+       echo mips-mips-riscos${UNAME_RELEASE}
+       exit 0 ;;
+    Night_Hawk:Power_UNIX:*:*)
+       echo powerpc-harris-powerunix
+       exit 0 ;;
+    m88k:CX/UX:7*:*)
+       echo m88k-harris-cxux7
+       exit 0 ;;
+    m88k:*:4*:R4*)
+       echo m88k-motorola-sysv4
+       exit 0 ;;
+    m88k:*:3*:R3*)
+       echo m88k-motorola-sysv3
+       exit 0 ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
+       if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
+            -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+               echo m88k-dg-dgux${UNAME_RELEASE}
+       else
+               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+       fi
+        else echo i586-dg-dgux${UNAME_RELEASE}
+        fi
+       exit 0 ;;
+    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
+       echo m88k-dolphin-sysv3
+       exit 0 ;;
+    M88*:*:R3*:*)
+       # Delta 88k system running SVR3
+       echo m88k-motorola-sysv3
+       exit 0 ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+       echo m88k-tektronix-sysv3
+       exit 0 ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+       echo m68k-tektronix-bsd
+       exit 0 ;;
+    *:IRIX*:*:*)
+       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       exit 0 ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+       echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+       exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+    i?86:AIX:*:*)
+       echo i386-ibm-aix
+       exit 0 ;;
+    *:AIX:2:3)
+       if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+               sed 's/^                //' << EOF >dummy.c
+               #include <sys/systemcfg.h>
+
+               main()
+                       {
+                       if (!__power_pc())
+                               exit(1);
+                       puts("powerpc-ibm-aix3.2.5");
+                       exit(0);
+                       }
+EOF
+               ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+               rm -f dummy.c dummy
+               echo rs6000-ibm-aix3.2.5
+       elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+               echo rs6000-ibm-aix3.2.4
+       else
+               echo rs6000-ibm-aix3.2
+       fi
+       exit 0 ;;
+    *:AIX:*:4)
+       if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       else
+               IBM_ARCH=powerpc
+       fi
+       if [ -x /usr/bin/oslevel ] ; then
+               IBM_REV=`/usr/bin/oslevel`
+       else
+               IBM_REV=4.${UNAME_RELEASE}
+       fi
+       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       exit 0 ;;
+    *:AIX:*:*)
+       echo rs6000-ibm-aix
+       exit 0 ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+       echo romp-ibm-bsd4.4
+       exit 0 ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
+       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       exit 0 ;;                           # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+       echo rs6000-bull-bosx
+       exit 0 ;;
+    DPX/2?00:B.O.S.:*:*)
+       echo m68k-bull-sysv3
+       exit 0 ;;
+    9000/[34]??:4.3bsd:1.*:*)
+       echo m68k-hp-bsd
+       exit 0 ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+       echo m68k-hp-bsd4.4
+       exit 0 ;;
+    9000/[3478]??:HP-UX:*:*)
+       case "${UNAME_MACHINE}" in
+           9000/31? )            HP_ARCH=m68000 ;;
+           9000/[34]?? )         HP_ARCH=m68k ;;
+           9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
+           9000/8?? )            HP_ARCH=hppa1.0 ;;
+       esac
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       exit 0 ;;
+    3050*:HI-UX:*:*)
+       sed 's/^        //' << EOF >dummy.c
+       #include <unistd.h>
+       int
+       main ()
+       {
+         long cpu = sysconf (_SC_CPU_VERSION);
+         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+            results, however.  */
+         if (CPU_IS_PA_RISC (cpu))
+           {
+             switch (cpu)
+               {
+                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+                 default: puts ("hppa-hitachi-hiuxwe2"); break;
+               }
+           }
+         else if (CPU_IS_HP_MC68K (cpu))
+           puts ("m68k-hitachi-hiuxwe2");
+         else puts ("unknown-hitachi-hiuxwe2");
+         exit (0);
+       }
+EOF
+       ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+       rm -f dummy.c dummy
+       echo unknown-hitachi-hiuxwe2
+       exit 0 ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+       echo hppa1.1-hp-bsd
+       exit 0 ;;
+    9000/8??:4.3bsd:*:*)
+       echo hppa1.0-hp-bsd
+       exit 0 ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+       echo hppa1.1-hp-osf
+       exit 0 ;;
+    hp8??:OSF1:*:*)
+       echo hppa1.0-hp-osf
+       exit 0 ;;
+    i?86:OSF1:*:*)
+       if [ -x /usr/sbin/sysversion ] ; then
+           echo ${UNAME_MACHINE}-unknown-osf1mk
+       else
+           echo ${UNAME_MACHINE}-unknown-osf1
+       fi
+       exit 0 ;;
+    parisc*:Lites*:*:*)
+       echo hppa1.1-hp-lites
+       exit 0 ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+       echo c1-convex-bsd
+        exit 0 ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+        exit 0 ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+       echo c34-convex-bsd
+        exit 0 ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+       echo c38-convex-bsd
+        exit 0 ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+       echo c4-convex-bsd
+        exit 0 ;;
+    CRAY*X-MP:*:*:*)
+       echo xmp-cray-unicos
+        exit 0 ;;
+    CRAY*Y-MP:*:*:*)
+       echo ymp-cray-unicos${UNAME_RELEASE}
+       exit 0 ;;
+    CRAY*[A-Z]90:*:*:*)
+       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+       | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+       exit 0 ;;
+    CRAY*TS:*:*:*)
+       echo t90-cray-unicos${UNAME_RELEASE}
+       exit 0 ;;
+    CRAY-2:*:*:*)
+       echo cray2-cray-unicos
+        exit 0 ;;
+    F300:UNIX_System_V:*:*)
+        FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit 0 ;;
+    F301:UNIX_System_V:*:*)
+       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
+       exit 0 ;;
+    hp3[0-9][05]:NetBSD:*:*)
+       echo m68k-hp-netbsd${UNAME_RELEASE}
+       exit 0 ;;
+    hp3[0-9][05]:OpenBSD:*:*)
+       echo m68k-hp-openbsd${UNAME_RELEASE}
+       exit 0 ;;
+    i?86:BSD/386:*:* | *:BSD/OS:*:*)
+       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+       exit 0 ;;
+    *:FreeBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       exit 0 ;;
+    *:NetBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+       exit 0 ;;
+    *:OpenBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+       exit 0 ;;
+    i*:CYGWIN*:*)
+       echo i386-pc-cygwin32
+       exit 0 ;;
+    p*:CYGWIN*:*)
+       echo powerpcle-unknown-cygwin32
+       exit 0 ;;
+    prep*:SunOS:5.*:*)
+       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    *:GNU:*:*)
+       echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       exit 0 ;;
+    *:Linux:*:*)
+       # The BFD linker knows what the default object file format is, so
+       # first see if it will tell us.
+       ld_help_string=`ld --help 2>&1`
+       if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
+         echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
+       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
+         echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
+       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
+         echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
+       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
+         echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
+       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
+         echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
+       elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
+         echo "powerpc-unknown-linux-gnu" ; exit 0
+       elif test "${UNAME_MACHINE}" = "alpha" ; then
+         echo alpha-unknown-linux-gnu ; exit 0
+       elif test "${UNAME_MACHINE}" = "sparc" ; then
+         echo sparc-unknown-linux-gnu ; exit 0
+       else
+         # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
+         # useful --help.  Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
+         test ! -d /usr/lib/ldscripts/. \
+           && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+         # Determine whether the default compiler is a.out or elf
+         cat >dummy.c <<EOF
+main(argc, argv)
+int argc;
+char *argv[];
+{
+#ifdef __ELF__
+  printf ("%s-pc-linux-gnu\n", argv[1]);
+#else
+  printf ("%s-pc-linux-gnuaout\n", argv[1]);
+#endif
+  return 0;
+}
+EOF
+         ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+         rm -f dummy.c dummy
+       fi ;;
+# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
+# are messed up and put the nodename in both sysname and nodename.
+    i?86:DYNIX/ptx:4*:*)
+       echo i386-sequent-sysv4
+       exit 0 ;;
+    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+       if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+               echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+       else
+               echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+       fi
+       exit 0 ;;
+    i?86:*:3.2:*)
+       if test -f /usr/options/cb.name; then
+               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/dev/null >/dev/null ; then
+               UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+                       && UNAME_MACHINE=i586
+               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+       else
+               echo ${UNAME_MACHINE}-pc-sysv32
+       fi
+       exit 0 ;;
+    Intel:Mach:3*:*)
+       echo i386-pc-mach3
+       exit 0 ;;
+    paragon:*:*:*)
+       echo i860-intel-osf1
+       exit 0 ;;
+    i860:*:4.*:*) # i860-SVR4
+       if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+       else # Add other i860-SVR4 vendors below as they are discovered.
+         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+       fi
+       exit 0 ;;
+    mini*:CTIX:SYS*5:*)
+       # "miniframe"
+       echo m68010-convergent-sysv
+       exit 0 ;;
+    M68*:*:R3V[567]*:*)
+       test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+       OS_REL=''
+       test -r /etc/.relid \
+       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+         && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4 && exit 0 ;;
+    m68*:LynxOS:2.*:*)
+       echo m68k-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    mc68030:UNIX_System_V:4.*:*)
+       echo m68k-atari-sysv4
+       exit 0 ;;
+    i?86:LynxOS:2.*:*)
+       echo i386-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    TSUNAMI:LynxOS:2.*:*)
+       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       exit 0 ;;
+    SM[BE]S:UNIX_SV:*:*)
+       echo mips-dde-sysv${UNAME_RELEASE}
+       exit 0 ;;
+    RM*:SINIX-*:*:*)
+       echo mips-sni-sysv4
+       exit 0 ;;
+    *:SINIX-*:*:*)
+       if uname -p 2>/dev/null >/dev/null ; then
+               UNAME_MACHINE=`(uname -p) 2>/dev/null`
+               echo ${UNAME_MACHINE}-sni-sysv4
+       else
+               echo ns32k-sni-sysv
+       fi
+       exit 0 ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # How about differentiating between stratus architectures? -djm
+       echo hppa1.1-stratus-sysv4
+       exit 0 ;;
+    *:*:*:FTX*)
+       # From seanf@swdc.stratus.com.
+       echo i860-stratus-sysv4
+       exit 0 ;;
+    mc68*:A/UX:*:*)
+       echo m68k-apple-aux${UNAME_RELEASE}
+       exit 0 ;;
+    R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
+       if [ -d /usr/nec ]; then
+               echo mips-nec-sysv${UNAME_RELEASE}
+       else
+               echo mips-unknown-sysv${UNAME_RELEASE}
+       fi
+        exit 0 ;;
+    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                           # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+cat >dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+         ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+       printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+       printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+  printf ("vax-dec-bsd\n"); exit (0);
+#else
+  printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
+rm -f dummy.c dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+       echo c1-convex-bsd
+       exit 0 ;;
+    c2*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+       exit 0 ;;
+    c34*)
+       echo c34-convex-bsd
+       exit 0 ;;
+    c38*)
+       echo c38-convex-bsd
+       exit 0 ;;
+    c4*)
+       echo c4-convex-bsd
+       exit 0 ;;
+    esac
+fi
+
+#echo '(Unable to guess system type)' 1>&2
+
+exit 1
diff --git a/contrib/xmindpath/config.sub b/contrib/xmindpath/config.sub
new file mode 100755 (executable)
index 0000000..0432524
--- /dev/null
@@ -0,0 +1,927 @@
+#! /bin/sh
+# Configuration validation subroutine script, version 1.1.
+#   Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+if [ x$1 = x ]
+then
+       echo Configuration name missing. 1>&2
+       echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+       echo "or     $0 ALIAS" 1>&2
+       echo where ALIAS is a recognized configuration type. 1>&2
+       exit 1
+fi
+
+# First pass through any local machine types.
+case $1 in
+       *local*)
+               echo $1
+               exit 0
+               ;;
+       *)
+       ;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  linux-gnu*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+       -sun*os*)
+               # Prevent following clause from handling this invalid input.
+               ;;
+       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+       -apple)
+               os=
+               basic_machine=$1
+               ;;
+       -hiux*)
+               os=-hiuxwe2
+               ;;
+       -sco5)
+               os=sco3.2v5
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco4)
+               os=-sco3.2v4
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2v[4-9]*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco*)
+               os=-sco3.2v2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -isc)
+               os=-isc2.2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -clix*)
+               basic_machine=clipper-intergraph
+               ;;
+       -isc*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -lynx*)
+               os=-lynxos
+               ;;
+       -ptx*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+               ;;
+       -windowsnt*)
+               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+               ;;
+       -psos*)
+               os=-psos
+               ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+       # Recognize the basic CPU types without company name.
+       # Some are omitted here because they have special meanings below.
+       tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
+               | arme[lb] | pyramid \
+               | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
+               | alpha | we32k | ns16k | clipper | i370 | sh \
+               | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
+               | pdp11 | mips64el | mips64orion | mips64orionel \
+               | sparc | sparclet | sparclite | sparc64)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # We use `pc' rather than `unknown'
+       # because (1) that's what they normally are, and
+       # (2) the word "unknown" tends to confuse beginning users.
+       i[3456]86)
+         basic_machine=$basic_machine-pc
+         ;;
+       # Object if more than one company name word.
+       *-*-*)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+       # Recognize the basic CPU types with company name.
+       vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
+             | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
+             | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
+             | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
+             | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
+             | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
+             | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
+             | mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+               basic_machine=m68000-att
+               ;;
+       3b*)
+               basic_machine=we32k-att
+               ;;
+       alliant | fx80)
+               basic_machine=fx80-alliant
+               ;;
+       altos | altos3068)
+               basic_machine=m68k-altos
+               ;;
+       am29k)
+               basic_machine=a29k-none
+               os=-bsd
+               ;;
+       amdahl)
+               basic_machine=580-amdahl
+               os=-sysv
+               ;;
+       amiga | amiga-*)
+               basic_machine=m68k-cbm
+               ;;
+       amigados)
+               basic_machine=m68k-cbm
+               os=-amigados
+               ;;
+       amigaunix | amix)
+               basic_machine=m68k-cbm
+               os=-sysv4
+               ;;
+       apollo68)
+               basic_machine=m68k-apollo
+               os=-sysv
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       convex-c1)
+               basic_machine=c1-convex
+               os=-bsd
+               ;;
+       convex-c2)
+               basic_machine=c2-convex
+               os=-bsd
+               ;;
+       convex-c32)
+               basic_machine=c32-convex
+               os=-bsd
+               ;;
+       convex-c34)
+               basic_machine=c34-convex
+               os=-bsd
+               ;;
+       convex-c38)
+               basic_machine=c38-convex
+               os=-bsd
+               ;;
+       cray | ymp)
+               basic_machine=ymp-cray
+               os=-unicos
+               ;;
+       cray2)
+               basic_machine=cray2-cray
+               os=-unicos
+               ;;
+       [ctj]90-cray)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+       crds | unos)
+               basic_machine=m68k-crds
+               ;;
+       da30 | da30-*)
+               basic_machine=m68k-da30
+               ;;
+       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+               basic_machine=mips-dec
+               ;;
+       delta | 3300 | motorola-3300 | motorola-delta \
+             | 3300-motorola | delta-motorola)
+               basic_machine=m68k-motorola
+               ;;
+       delta88)
+               basic_machine=m88k-motorola
+               os=-sysv3
+               ;;
+       dpx20 | dpx20-*)
+               basic_machine=rs6000-bull
+               os=-bosx
+               ;;
+       dpx2* | dpx2*-bull)
+               basic_machine=m68k-bull
+               os=-sysv3
+               ;;
+       ebmon29k)
+               basic_machine=a29k-amd
+               os=-ebmon
+               ;;
+       elxsi)
+               basic_machine=elxsi-elxsi
+               os=-bsd
+               ;;
+       encore | umax | mmax)
+               basic_machine=ns32k-encore
+               ;;
+       fx2800)
+               basic_machine=i860-alliant
+               ;;
+       genix)
+               basic_machine=ns32k-ns
+               ;;
+       gmicro)
+               basic_machine=tron-gmicro
+               os=-sysv
+               ;;
+       h3050r* | hiux*)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       h8300hms)
+               basic_machine=h8300-hitachi
+               os=-hms
+               ;;
+       harris)
+               basic_machine=m88k-harris
+               os=-sysv3
+               ;;
+       hp300-*)
+               basic_machine=m68k-hp
+               ;;
+       hp300bsd)
+               basic_machine=m68k-hp
+               os=-bsd
+               ;;
+       hp300hpux)
+               basic_machine=m68k-hp
+               os=-hpux
+               ;;
+       hp9k2[0-9][0-9] | hp9k31[0-9])
+               basic_machine=m68000-hp
+               ;;
+       hp9k3[2-9][0-9])
+               basic_machine=m68k-hp
+               ;;
+       hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][0-9] | hp8[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hppa-next)
+               os=-nextstep3
+               ;;
+       i370-ibm* | ibm*)
+               basic_machine=i370-ibm
+               os=-mvs
+               ;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+       i[3456]86v32)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv32
+               ;;
+       i[3456]86v4*)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv4
+               ;;
+       i[3456]86v)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv
+               ;;
+       i[3456]86sol2)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-solaris2
+               ;;
+       iris | iris4d)
+               basic_machine=mips-sgi
+               case $os in
+                   -irix*)
+                       ;;
+                   *)
+                       os=-irix4
+                       ;;
+               esac
+               ;;
+       isi68 | isi)
+               basic_machine=m68k-isi
+               os=-sysv
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+       miniframe)
+               basic_machine=m68000-convergent
+               ;;
+       mips3*-*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+               ;;
+       mips3*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+               ;;
+       ncr3000)
+               basic_machine=i486-ncr
+               os=-sysv4
+               ;;
+       news | news700 | news800 | news900)
+               basic_machine=m68k-sony
+               os=-newsos
+               ;;
+       news1000)
+               basic_machine=m68030-sony
+               os=-newsos
+               ;;
+       news-3600 | risc-news)
+               basic_machine=mips-sony
+               os=-newsos
+               ;;
+       next | m*-next )
+               basic_machine=m68k-next
+               case $os in
+                   -nextstep* )
+                       ;;
+                   -ns2*)
+                     os=-nextstep2
+                       ;;
+                   *)
+                     os=-nextstep3
+                       ;;
+               esac
+               ;;
+       nh3000)
+               basic_machine=m68k-harris
+               os=-cxux
+               ;;
+       nh[45]000)
+               basic_machine=m88k-harris
+               os=-cxux
+               ;;
+       nindy960)
+               basic_machine=i960-intel
+               os=-nindy
+               ;;
+       np1)
+               basic_machine=np1-gould
+               ;;
+       pa-hitachi)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       paragon)
+               basic_machine=i860-intel
+               os=-osf
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+        pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pentium | p5)
+               basic_machine=i586-intel
+               ;;
+       pentiumpro | p6)
+               basic_machine=i686-intel
+               ;;
+       pentium-* | p5-*)
+               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumpro-* | p6-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       k5)
+               # We don't have specific support for AMD's K5 yet, so just call it a Pentium
+               basic_machine=i586-amd
+               ;;
+       nexen)
+               # We don't have specific support for Nexgen yet, so just call it a Pentium
+               basic_machine=i586-nexgen
+               ;;
+       pn)
+               basic_machine=pn-gould
+               ;;
+       power)  basic_machine=rs6000-ibm
+               ;;
+       ppc)    basic_machine=powerpc-unknown
+               ;;
+       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppcle | powerpclittle | ppc-le | powerpc-little)
+               basic_machine=powerpcle-unknown
+               ;;
+       ppcle-* | powerpclittle-*)
+               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ps2)
+               basic_machine=i386-ibm
+               ;;
+       rm[46]00)
+               basic_machine=mips-siemens
+               ;;
+       rtpc | rtpc-*)
+               basic_machine=romp-ibm
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sps7)
+               basic_machine=m68k-bull
+               os=-sysv2
+               ;;
+       spur)
+               basic_machine=spur-unknown
+               ;;
+       sun2)
+               basic_machine=m68000-sun
+               ;;
+       sun2os3)
+               basic_machine=m68000-sun
+               os=-sunos3
+               ;;
+       sun2os4)
+               basic_machine=m68000-sun
+               os=-sunos4
+               ;;
+       sun3os3)
+               basic_machine=m68k-sun
+               os=-sunos3
+               ;;
+       sun3os4)
+               basic_machine=m68k-sun
+               os=-sunos4
+               ;;
+       sun4os3)
+               basic_machine=sparc-sun
+               os=-sunos3
+               ;;
+       sun4os4)
+               basic_machine=sparc-sun
+               os=-sunos4
+               ;;
+       sun4sol2)
+               basic_machine=sparc-sun
+               os=-solaris2
+               ;;
+       sun3 | sun3-*)
+               basic_machine=m68k-sun
+               ;;
+       sun4)
+               basic_machine=sparc-sun
+               ;;
+       sun386 | sun386i | roadrunner)
+               basic_machine=i386-sun
+               ;;
+       symmetry)
+               basic_machine=i386-sequent
+               os=-dynix
+               ;;
+       tower | tower-32)
+               basic_machine=m68k-ncr
+               ;;
+       udi29k)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       ultra3)
+               basic_machine=a29k-nyu
+               os=-sym1
+               ;;
+       vaxv)
+               basic_machine=vax-dec
+               os=-sysv
+               ;;
+       vms)
+               basic_machine=vax-dec
+               os=-vms
+               ;;
+       vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+       vxworks960)
+               basic_machine=i960-wrs
+               os=-vxworks
+               ;;
+       vxworks68)
+               basic_machine=m68k-wrs
+               os=-vxworks
+               ;;
+       vxworks29k)
+               basic_machine=a29k-wrs
+               os=-vxworks
+               ;;
+       xmp)
+               basic_machine=xmp-cray
+               os=-unicos
+               ;;
+        xps | xps100)
+               basic_machine=xps100-honeywell
+               ;;
+       none)
+               basic_machine=none-none
+               os=-none
+               ;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+       mips)
+               basic_machine=mips-mips
+               ;;
+       romp)
+               basic_machine=romp-ibm
+               ;;
+       rs6000)
+               basic_machine=rs6000-ibm
+               ;;
+       vax)
+               basic_machine=vax-dec
+               ;;
+       pdp11)
+               basic_machine=pdp11-dec
+               ;;
+       we32k)
+               basic_machine=we32k-att
+               ;;
+       sparc)
+               basic_machine=sparc-sun
+               ;;
+        cydra)
+               basic_machine=cydra-cydrome
+               ;;
+       orion)
+               basic_machine=orion-highlevel
+               ;;
+       orion105)
+               basic_machine=clipper-highlevel
+               ;;
+       *)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+       *-digital*)
+               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+               ;;
+       *-commodore*)
+               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+               ;;
+       *)
+               ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+       # -solaris* is a basic system type, with this one exception.
+       -solaris1 | -solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+               ;;
+       -solaris)
+               os=-solaris2
+               ;;
+       -unixware* | svr4*)
+               os=-sysv4
+               ;;
+       -gnu/linux*)
+               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+               ;;
+       # First accept the basic system types.
+       # The portable systems comes first.
+       # Each alternative MUST END IN A *, to match a version number.
+       # -sysv* is not here because it comes later, after sysvr4.
+       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -linux-gnu* | -uxpv*)
+       # Remember, each alternative MUST END IN *, to match a version number.
+               ;;
+       -linux*)
+               os=`echo $os | sed -e 's|linux|linux-gnu|'`
+               ;;
+       -sunos5*)
+               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+               ;;
+       -sunos6*)
+               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+               ;;
+       -osfrose*)
+               os=-osfrose
+               ;;
+       -osf*)
+               os=-osf
+               ;;
+       -utek*)
+               os=-bsd
+               ;;
+       -dynix*)
+               os=-bsd
+               ;;
+       -acis*)
+               os=-aos
+               ;;
+       -ctix* | -uts*)
+               os=-sysv
+               ;;
+       -ns2 )
+               os=-nextstep2
+               ;;
+       # Preserve the version number of sinix5.
+       -sinix5.*)
+               os=`echo $os | sed -e 's|sinix|sysv|'`
+               ;;
+       -sinix*)
+               os=-sysv4
+               ;;
+       -triton*)
+               os=-sysv3
+               ;;
+       -oss*)
+               os=-sysv3
+               ;;
+       -svr4)
+               os=-sysv4
+               ;;
+       -svr3)
+               os=-sysv3
+               ;;
+       -sysvr4)
+               os=-sysv4
+               ;;
+       # This must come after -sysvr4.
+       -sysv*)
+               ;;
+       -xenix)
+               os=-xenix
+               ;;
+       -none)
+               ;;
+       *)
+               # Get rid of the `-' at the beginning of $os.
+               os=`echo $os | sed 's/[^-]*-//'`
+               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+        pdp11-*)
+               os=-none
+               ;;
+       *-dec | vax-*)
+               os=-ultrix4.2
+               ;;
+       m68*-apollo)
+               os=-domain
+               ;;
+       i386-sun)
+               os=-sunos4.0.2
+               ;;
+       m68000-sun)
+               os=-sunos3
+               # This also exists in the configure program, but was not the
+               # default.
+               # os=-sunos4
+               ;;
+       *-tti)  # must be before sparc entry or we get the wrong os.
+               os=-sysv3
+               ;;
+       sparc-* | *-sun)
+               os=-sunos4.1.1
+               ;;
+       *-ibm)
+               os=-aix
+               ;;
+       *-hp)
+               os=-hpux
+               ;;
+       *-hitachi)
+               os=-hiux
+               ;;
+       i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+               os=-sysv
+               ;;
+       *-cbm)
+               os=-amigados
+               ;;
+       *-dg)
+               os=-dgux
+               ;;
+       *-dolphin)
+               os=-sysv3
+               ;;
+       m68k-ccur)
+               os=-rtu
+               ;;
+       m88k-omron*)
+               os=-luna
+               ;;
+       *-next )
+               os=-nextstep
+               ;;
+       *-sequent)
+               os=-ptx
+               ;;
+       *-crds)
+               os=-unos
+               ;;
+       *-ns)
+               os=-genix
+               ;;
+       i370-*)
+               os=-mvs
+               ;;
+       *-next)
+               os=-nextstep3
+               ;;
+        *-gould)
+               os=-sysv
+               ;;
+        *-highlevel)
+               os=-bsd
+               ;;
+       *-encore)
+               os=-bsd
+               ;;
+        *-sgi)
+               os=-irix
+               ;;
+        *-siemens)
+               os=-sysv4
+               ;;
+       *-masscomp)
+               os=-rtu
+               ;;
+       f301-fujitsu)
+               os=-uxpv
+               ;;
+       *)
+               os=-none
+               ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+       *-unknown)
+               case $os in
+                       -riscix*)
+                               vendor=acorn
+                               ;;
+                       -sunos*)
+                               vendor=sun
+                               ;;
+                       -aix*)
+                               vendor=ibm
+                               ;;
+                       -hpux*)
+                               vendor=hp
+                               ;;
+                       -hiux*)
+                               vendor=hitachi
+                               ;;
+                       -unos*)
+                               vendor=crds
+                               ;;
+                       -dgux*)
+                               vendor=dg
+                               ;;
+                       -luna*)
+                               vendor=omron
+                               ;;
+                       -genix*)
+                               vendor=ns
+                               ;;
+                       -mvs*)
+                               vendor=ibm
+                               ;;
+                       -ptx*)
+                               vendor=sequent
+                               ;;
+                       -vxsim* | -vxworks*)
+                               vendor=wrs
+                               ;;
+                       -aux*)
+                               vendor=apple
+                               ;;
+               esac
+               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+               ;;
+esac
+
+echo $basic_machine$os
diff --git a/contrib/xmindpath/configure b/contrib/xmindpath/configure
new file mode 100755 (executable)
index 0000000..47672e3
--- /dev/null
@@ -0,0 +1,2373 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+  --with-x                use the X Window System"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he)
+    # Omit some internal or obsolete options to make the list less imposing.
+    # This message is too long to be a string in the A/UX 3.1 sh.
+    cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --program-prefix=PREFIX prepend PREFIX to installed program names
+  --program-suffix=SUFFIX append SUFFIX to installed program names
+  --program-transform-name=PROGRAM
+                          run sed PROGRAM on installed program names
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.12"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"     "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=main.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='       '
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:528: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:557: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  ac_prog_rejected=no
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+       continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# -gt 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:605: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 615 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  ac_cv_prog_cc_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:639: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:644: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+  GCC=yes
+  ac_test_CFLAGS="${CFLAGS+set}"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS=
+  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:668: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+  if test "$ac_test_CFLAGS" = set; then
+    CFLAGS="$ac_save_CFLAGS"
+  elif test $ac_cv_prog_cc_g = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-O2"
+  fi
+else
+  GCC=
+  test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:725: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS=        }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      for ac_prog in ginstall installbsd scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+         if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           # OSF/1 installbsd also uses dspmsg, but is usable.
+           :
+         else
+           ac_cv_path_install="$ac_dir/$ac_prog -c"
+           break 2
+         fi
+       fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:776: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+  cat > conftest.$ac_ext <<EOF
+#line 791 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+  cat > conftest.$ac_ext <<EOF
+#line 808 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
+fi
+  CPP="$ac_cv_prog_CPP"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+# If we find X, set shell vars x_includes and x_libraries to the
+# paths, otherwise set no_x=yes.
+# Uses ac_ vars as temps to allow command line to override cache and checks.
+# --without-x overrides everything else, but does not touch the cache.
+echo $ac_n "checking for X""... $ac_c" 1>&6
+echo "configure:841: checking for X" >&5
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+  withval="$with_x"
+  :
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+    # Both variables are already set.
+    have_x=yes
+  else
+if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=NO ac_x_libraries=NO
+rm -fr conftestdir
+if mkdir conftestdir; then
+  cd conftestdir
+  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+  cat > Imakefile <<'EOF'
+acfindx:
+       @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+        test -f $ac_im_libdir/libX11.$ac_extension; then
+        ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case "$ac_im_incroot" in
+       /usr/include) ;;
+       *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+    esac
+    case "$ac_im_usrlibdir" in
+       /usr/lib | /lib) ;;
+       *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+    esac
+  fi
+  cd ..
+  rm -fr conftestdir
+fi
+
+if test "$ac_x_includes" = NO; then
+  # Guess where to find include files, by looking for this one X11 .h file.
+  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+  # First, try using that file with no special directory specified.
+cat > conftest.$ac_ext <<EOF
+#line 903 "configure"
+#include "confdefs.h"
+#include <$x_direct_test_include>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  # Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+  for ac_dir in               \
+    /usr/X11/include          \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/include              \
+    /usr/local/include        \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    ; \
+  do
+    if test -r "$ac_dir/$x_direct_test_include"; then
+      ac_x_includes=$ac_dir
+      break
+    fi
+  done
+fi
+rm -f conftest*
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+  # Check for the libraries.
+
+  test -z "$x_direct_test_library" && x_direct_test_library=Xt
+  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS="$LIBS"
+  LIBS="-l$x_direct_test_library $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 977 "configure"
+#include "confdefs.h"
+
+int main() {
+${x_direct_test_function}()
+; return 0; }
+EOF
+if { (eval echo configure:984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+    /usr/X11/lib          \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11     \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+rm -f conftest*
+fi # $ac_x_libraries = NO
+
+if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
+  # Didn't find X anywhere.  Cache the known absence of X.
+  ac_cv_have_x="have_x=no"
+else
+  # Record where we found X for the cache.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+  fi
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  echo "$ac_t""$have_x" 1>&6
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes \
+               ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
+fi
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+  cat >> confdefs.h <<\EOF
+#define X_DISPLAY_MISSING 1
+EOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    case "`(uname -sr) 2>/dev/null`" in
+    "SunOS 5"*)
+      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
+echo "configure:1090: checking whether -R must be followed by a space" >&5
+      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
+      cat > conftest.$ac_ext <<EOF
+#line 1093 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  ac_R_nospace=yes
+else
+&nb