mgp_1.09a.orig.tar.gz mgp-1.09a
authormirabilos <t.glaser@tarent.de>
Wed, 22 May 2019 18:47:44 +0000 (20:47 +0200)
committermirabilos <mirabilos@evolvis.org>
Wed, 22 May 2019 18:47:44 +0000 (20:47 +0200)
identical to magicpoint-1.09a.tar.gz (upstream, MirPorts)

60 files changed:
FAQ
Imakefile.in
README
README.fonts
README.fonts.jp
README.lang
RELNOTES [new file with mode: 0644]
SYNTAX
TODO.jp
USAGE
USAGE.jp
background.c
configure
configure.in
contrib/mgp-mode.el
contrib/xmindpath/Makefile.in
contrib/xmindpath/configure
contrib/xmindpath/configure.in
draw.c
font.c
globals.c
grammar.y
image/Imakefile.in
image/faces.c
image/gif.c
image/gif.h [deleted file]
image/imagetypes.c
image/imagetypes.h
image/imlib_loader.c [new file with mode: 0644]
image/png.c [new file with mode: 0644]
mgp.c
mgp.h
mgp.man
mgp.spec [new file with mode: 0644]
mgp2ps.man
mng.c [new file with mode: 0644]
parse.c
print.c
sample/README
sample/README.jp
sample/default.mgp
sample/dns-jp.mgp [deleted file]
sample/embed-jp.mgp
sample/embed.mgp
sample/gradation.mgp
sample/mgp.mng [new file with mode: 0644]
sample/multilingual.mgp
sample/sample-fr.mgp
sample/sample-jp.mgp
sample/sample.mgp
sample/sendmail6-jp.mgp
sample/sendmail6.mgp
sample/tutorial.mgp
sample/v6-jp.mgp
sample/v6.mgp
scanner.l
tfont.c
unimap.c
x11.c
x11dummy.c

diff --git a/FAQ b/FAQ
index a887dcc..47da2d5 100644 (file)
--- a/FAQ
+++ b/FAQ
-MagicPoint FAQ
-$Id: FAQ,v 1.2 1999/06/17 05:21:23 kazu Exp $
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+                           MagicPoint FAQ
 
-Q: When I incorporate postscript in MagicPoint presentation, "ghostscript"
-   dies with "WARN: cannot generate pnmraw+ file from test.eps".
-A:     install more recent version of "ghostscript", which supports "pnmraw"
-       output driver.
-A:     give the -X option to "mgp", with name of "ghostscript" output driver
-       which is configured into your "ghostscript".
+                           April 16, 2001
 
-Q: Background image will not be reflected to postscript output from "mgp2ps".
-A:     This is a feature (or known bug).
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Q: I'm using European language for presentations and line-breaks are not
-   correct.
-Q: I'm using European language for presentations and accented characters
-   will not be generated on postscript output.
-A:     see README.lang for detail.
+Q: When I incorporate postscript in MagicPoint presentation,
+   "ghostscript" dies with "WARN: cannot generate pnmraw+ file from
+   test.eps".
+
+A: Install more recent version of "ghostscript", which supports
+   "pnmraw" output driver.
+
+A: Give the -X option to "mgp", with name of "ghostscript" output
+   driver which is configured into your "ghostscript".
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Q: Background image will not be reflected to postscript output from
+   "mgp2ps".
+
+A: This is a feature (or known bug).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Q: I'm using European language for presentations and line-breaks are
+   not correct.
+
+Q: I'm using European language for presentations and accented
+   characters will not be generated on postscript output.
+
+A: See README.lang for detail.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 Q: I would like to try a more-recent snapshot version of MagicPoint.
-A:     ftp://sh.wide.ad.jp/WIDE/free-ware/mgp-snap/
+
+A: ftp://sh.wide.ad.jp/WIDE/free-ware/mgp-snap/
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 Q: I'm trouble finding scalable fonts.
+
 Q: Presentations using X11 font looks awful.
-A:     see README.fonts for detail.
+
+A: See README.fonts for detail.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 Q: I have special Adobe type 1 font installed to my X11 configuration,
    and I cannot use that font with postscript output.
-A:     (1) modify print.c to include the font into fontname mapping table,
-       (2) regenerate postscript file,
-       (3) download your font to your printer,
-       (4) try printing the file.
+
+A: (1) Modify print.c to include the font into fontname mapping table,
+   (2) Regenerate postscript file,
+   (3) Download your font to your printer,
+   (4) Try printing the file.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Q: Compilation with png library fails.
+
+A: Check the version number of your png library.  in most cases, the
+   library you are using is too old.  note that, some of Linux rpms
+   uses different version numbering scheme from the original png
+   library.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Q: %system or %xsystem does not work.
+
+Q: If i use %system or %xsystem, X server (or window manager) dies.
+
+A: The behavior of %system/xsystem command heavily depends on the
+   behavior of your window manager, and they may not work right for
+   some of those.  as there are so many window managers, we have
+   trouble supporting them.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Q: What is MNG?
+
+A: MNG (Multiple-image Network Graphics) is the animation extension of
+   the popular PNG image-format. See http://www.libpng.org/pub/mng and
+   http://www.mng.com/
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Q: Can I convert my animation gif files into mng format?
+
+A: Yes. I would like to recommand you to use the convert command in
+   ImageMagick. See http://www.simplesystems.org/ImageMagick/ for more
+   information.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Q: Can I write Magicpoint presentation with an XML based language?
+
+A: The sdoc2mgp.xsl can convert an XML based language into mgp syntax.
+   See
+
+   http://xml.da-cha.org/ for more information.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Q: My projector cuts the edge of my computer's output. How can I
+   enlarge the margins?
+
+A: Execute MagicPoint with the "-o" option specifying a smaller window
+   size then that of the root window.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 5e52435..2f810f8 100644 (file)
@@ -1,13 +1,13 @@
-# $Id: Imakefile.in,v 1.49 1999/08/18 12:13:01 kazu Exp $
+# $Id: Imakefile.in,v 1.51 2001/02/03 18:46:49 nishida 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 unimap.c
+       embed.c unimap.c mng.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 unimap.o
+       scanner.o grammar.o postscript.o tfont.o embed.o unimap.o mng.o
 PROBJS=        print.o parse.o globals.o x11dummy.o scanner.o grammar.o postscript.o \
        embed.o 
 LIBOBJS=       @LIBOBJS@
@@ -68,6 +68,7 @@ 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))
+SpecialObjectRule(mng.o,mng.c, $(DEFS) $(OPTFLAGS))
 
 #define PassCDebugFlags
 #define IHaveSubdirs
@@ -127,7 +128,7 @@ snprintf.o: 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 scanner.c grammar.c tokdefs.h mgp.0 mgp2ps.0 mgpembed.pl
        -/bin/rm -f contrib/mgp2html.pl contrib/mgp2latex.pl
        for i in $(SUBDIRS); do \
                (cd $$i; if [ -f Makefile ]; then make distclean; fi); \
diff --git a/README b/README
index 9ebbc72..167cc7c 100644 (file)
--- a/README
+++ b/README
@@ -1,6 +1,10 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
             MagicPoint - an X11 based presentation tool
 
-                           June 10, 1999
+                           April 12, 2001
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 MagicPoint is an X11 based presentation tool.  It is designed to make
 simple presentations easy while to make complicated presentations
@@ -20,78 +24,77 @@ and may have different distribution policies.  Be sure to check the
 comments in the source codes.
 
 
-                            INSTALLATION
-
-Since MagicPoint extensively uses fonts in various sizes, we recommend
-you to install good font rendering systems 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 the X11 server with good outline font capabilities.
+                            INSTALLATION
 
-The former one is recommended.  For the latter case, it should be okay
-if you have the adobe Type1 font in your X11 font directory.  There
-are some advanced methods, such as modified X11 servers.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-- Short summary to Japanese readers:
+Since MagicPoint extensively uses fonts in various sizes, we recommend
+you to install good font rendering systems in your system.  
 
-We recommend you to either:
+THIS DOCUMENT ASSUMES THAT YOU WILL USE MAGICPOINT WITH **TRUETYPE**
+FONTS. YOU SHOULD INSTALL *FREETYPE* BEFORE YOU INSTALL MAGICPOINT.
 
-    (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 an X11 server with outline English/Japanese font capabilities.
+To install "libttf.a", see:
+       http://www.freetype.org/
 
-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 a standard X11 server will not
-render Japanese scalable font files.
+ If you want to use other rendering systems, read "README.fonts" or
+"README.fonts.jp".
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 Follow the steps below to make MagicPoint:
 
+English or European:
        % ./configure
+
+Japanese:
+       % ./configure --enable-freetype-charset16
+
        % xmkmf
        % make Makefiles
        % make
 
-Note 1: if you have vflib installed AND you do NOT want to compile the
-vflib support into the binary, try the following option: 
+Invoking `configure' updates Imakefile.  So, do NOT forget to invoke
+`xmkmf' everytime you update Imakefile.
 
-       % ./configure --disable-vflib
+Note: if you have to use a non-standard compiler, you must declare
+      your compiler by using "env" command, like:
 
-Note 2: if you have FreeType installed AND you do NOT want to compile the
-FreeType support into the binary, try the following option: 
+       % env CC=gcc ./configure                # force gcc
+       % env CC=shlicc2 ./configure            # force shlicc2 (bsdi3)
 
-       % ./configure --disable-freetype
+      We cannot make a guess in the configure script, since "imake"
+      may dislike the compiler that was guessed by configure.  This
+      applies to, for example, Solaris without the Sun compiler
+      license (gcc-only environment).
 
-Note 3: if you have to use a non-standard compiler, you must declare
-your compiler by using "env" command, like:
 
-       % env CC=gcc ./configure                # force gcc
-       % env CC=shlicc2 ./configure            # force shlicc2 (bsdi3)
+Note: If you are willing to use the iso-8859-x character set (i.e. you
+      would like setlocale() to be called at startup), specify the
+      "--enable-locale" option.
 
-We cannot make a guess in the configure script, since "imake" may
-dislike the compiler that was guessed by configure.  This applies to,
-for example, Solaris without the Sun compiler license (gcc-only
-environment).
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Note 4: If you are willing to use the iso-8859-x character set
-(i.e. you would like setlocale() to be called at startup), specify 
-the --enable-locale option.
+It's a good idea to preview sample files before installation. For more
+information, see "sample/README" or "sample/README.jp", which
+describes how to install TrueType fonts.
 
-Invoking `configure' updates Imakefile.  So, do NOT forget to invoke
-`xmkmf' everytime you update Imakefile.
+To visualize the sample{,-jp}.mgp file, type:
+
+       % ./mgp sample/sample.mgp
+       % ./mgp sample/sample-jp.mgp
 
-It's a good idea to preview a sample file before installation.
+To visualize the tutorial{,-jp}.mgp file, type:
 
        % ./mgp sample/tutorial.mgp
+       % ./mgp sample/tutorial-jp.mgp
+
+WE STRONGLY RECOMMEND TO BUY TRUETYPE FONTS IF YOU WANT TO GIVE YOUR
+PRESENTATION WITH BEAUTIFUL FONTS.
 
-For more information, see sample/README or sample/README.jp.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 When you believe that everything is OK, install MagicPoint as follows:
 
@@ -102,24 +105,22 @@ When you believe that everything is OK, install MagicPoint as follows:
 If you want to paste EPS figures 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/".
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+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.
+Stable release packages are available from:
+       ftp://ftp.Mew.org/pub/mgp/
 
-Pre-release snapshots are generated weekly, to
-"ftp://sh.wide.ad.jp/WIDE/free-ware/mgp-snap/".  These snapshots MAY
-NOT WORK AT ALL. Keep in your mind that these are just for people who
-would like to hack.
+You can use anonymous CVS to catch up the latest. See:
+       http://www.Mew.org/mgp/anoncvs.html
 
-Please send comments to the developer mailing-list "mgp@Mew.org".
+To join the mailing-list for MagicPoint, See:
+       http://www.Mew.org/mgp/ml.html
 
-There are two mailing lists 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).
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 3ced304..648eeae 100644 (file)
@@ -1,6 +1,10 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
            Configuring fonts for MagicPoint presentation
 
-$Id: README.fonts,v 1.24 1999/06/17 04:26:07 kazu Exp $
+                           March 15, 2001
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 For better presentations with the "MagicPoint" presentation tool, it
 is necessary to configure your MagicPoint, and maybe your X11 server
@@ -8,11 +12,15 @@ to handle large-size fonts.  The document tries to summarize steps to
 make use of large-size fonts with MagicPoint.
 
 
-Standard methods
-================
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+                          Standard methods
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+- Scalable English fonts, with the FreeType library
 
-Scalable English fonts, with the FreeType library
----------------------------------------------
 FreeType project, a free software project for TrueType scalable font
 renderer, provides the FreeType library at:
        http://www.freetype.org/
@@ -30,9 +38,10 @@ the --disable-freetype option to the "configure" script, as below:
 If you want to get Free/Commercial TrueType fonts, read the section
 "How to get TrueType fonts" below.
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+- Scalable English fonts, with a standard X11 server
 
-Scalable English fonts, with a standard X11 server
-------------------------------------------------
 A 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,
@@ -53,8 +62,10 @@ You can query these fonts by using XLFD (X11 font specification
 string) starting with "-adobe-".  Use "xfontsel" to see whether or not
 it is installed.
 
-Scalable Japanese fonts, with VFLib
------------------------------------
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+- 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/.
@@ -73,8 +84,10 @@ not very suitable for western readers since this approach usually uses
 Japanese font files.  The Japanese font files include several thousand
 of letters and will occupies several megabytes on your disk.
 
-Scalable Japanese fonts, with FreeType
----------------------------------
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+- Scalable Japanese fonts, with FreeType
+
 Recent MagicPoint can use the FreeType library for rendering Japanese
 fonts.  You can use this function by executing configure script as
 below:
@@ -92,12 +105,14 @@ VFlib as below:
 
        ./configure --disable-vflib --enable-freetype-charset16
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-Advanced/complex methods
-========================
+                      Advanced/complex methods
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+- Scalable fonts, with a FreeType-ready X11 server
 
-Scalable fonts, with a FreeType-ready X11 server
-------------------------------------------------------
 There seems to be several projects for implementing FreeType into X11
 server, or X11 font servers (xfs).  By using these kind of
 implementation, a X11 server will be able to render wide variety of
@@ -117,8 +132,10 @@ MagicPoint.  You may have to modify some of the FreeType-X11 font
 specification file as well.
 
 
-Scalable Japanese/English fonts, with a VFlib-ready X11 server
-------------------------------------------------------------
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+- Scalable Japanese/English fonts, with a 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
@@ -128,8 +145,10 @@ MagicPoint.  You may have to modify some of the VFlib-X11 font
 specification file as well.
 
 
-Scalable Japanese fonts, with the VFlib/FreeType-hetero library
------------------------------------------------------------
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+- Scalable Japanese fonts, with the 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
@@ -142,17 +161,20 @@ servers or X11 font servers (xfs).  In this case, you can use scalable
 font by using proper XLFD.
 
 
-Miscellaneous 
-=============
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+                           Miscellaneous
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+- How to get TrueType fonts.
 
-How to get TrueType fonts.
----------------------------------
 You can get freely available TrueType fonts 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
-       http://www.linux.or.jp/~ishikawa/linux/X-TT/
+       ftp://www.mew.org/MagicPoint/xtt-fonts_0.19981020-3.tar.gz
                Freely redistributable Japanese fonts are converted into
                TrueType format.  (Wadalab gothic and Watanabe mincho)
 
@@ -187,3 +209,5 @@ store near you.
 NOTE: TeX-deribed fonts (including computer modern fonts) places marks
 like "<" or ">" in strange places.  Therefore, you may have some trouble
 writing formulas and other non-plain text.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 80f1c9e..8d3880c 100644 (file)
@@ -1,24 +1,33 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
         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.12 1999/05/27 03:22:47 nishida Exp $
+                           March 15, 2001
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+           %%% \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
 
-       -----\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
+X \e$B%U%)%s%H$N<hF@$r$O$8$a$H$7!"\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
--------------------------------------------------------
+                            \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/
@@ -29,16 +38,19 @@ FreeType \e$B%i%$%V%i%j$O!"\e(BFreeType \e$B%W%m%8%'%/%H\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
 
 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$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)
@@ -69,9 +81,13 @@ X11\e$BI8=`G[IU$K$D$$$F$$$k$b$N0J30$K$b!"$$$/$D$+$N\e(BAdobe Type1\e$B7A<0$N%U%)%s%
 \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]
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+- \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/
@@ -92,7 +108,9 @@ 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
 \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
 
-[FreeType\e$B$NMxMQ\e(B]
+%%%%
+
+- FreeType\e$B$NMxMQ\e(B
 
 \e$B8=:_$N\e(BMagicPoint\e$B$G$O\e(BFreeType(http://www.freetype.org/)\e$B$rMxMQ$7$F\e(B TrueType
 \e$B$NF|K\8l$rI=<($9$k$3$H$,$G$-$^$9!#\e(BFreeType\e$B$,%$%s%9%H!<%k$5$l$F$$$k\e(B
@@ -114,13 +132,17 @@ tmfont directive\e$B$N\e(BSYNTAX\e$B$K$D$$$F$O!"\e(BSYNTAX\e$B%U%!%$%k$r;2>H$7$F$/$@$
 \e$B$7$F2<$5$$!#\e(B
 
 
-\e$B9g$o$;5;\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$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)
@@ -140,8 +162,9 @@ 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$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
@@ -155,8 +178,9 @@ 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$&$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$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
@@ -168,9 +192,9 @@ 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$
 \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/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
@@ -183,18 +207,20 @@ VFlib \e$B$H\e(B FreeType \e$B$r9g$o$;$?%i%$%V%i%j$,B8:_$7$^$9!#\e(BVFlib API \e$B$rM
 \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
-================
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+                          \e$B$=$NB>;(B?$J$3$H\e(B
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-TrueType \e$B%U%)%s%H$N<hF@J}K!\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
-       http://www.linux.or.jp/~ishikawa/linux/X-TT/
+       ftp://www.mew.org/MagicPoint/xtt-fonts_0.19981020-3.tar.gz
                \e$BG[I[<+M3$J%U%)%s%H$,\e(BTrueType\e$B%U%)!<%^%C%H$KJQ49$5$l$F\e(B
                \e$BCV$$$F$"$j$^$9!#\e(B(\e$BOBED8&%4%7%C%/$HEOJUL@D+\e(B)
 
@@ -226,7 +252,8 @@ TrueType \e$B%U%)%s%H$N<hF@J}K!\e(B
 \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
 
-NOTE: TeX\e$B5/8;$N%U%)%s%H\e(B(computer modern font\e$B$b$3$NCg4V\e(B)\e$B$G$O!"\e(B"<"\e$B$d\e(B">"\e$B$J$I$N\e(B
-\e$B5-9fN`$,\e(BASCII\e$B$H0c$&G[Ns$K$J$C$F$$$^$9!#$3$N$?$a!"?t<0$d$=$NB>$N5-9fF~$j$N\e(B
-\e$BJ8$r=q$/$H$-$K6lO+$9$k$+$b$7$l$^$;$s!#\e(B
+NOTE: TeX \e$B5/8;$N%U%)%s%H\e(B(computer modern font\e$B$b$3$NCg4V\e(B)\e$B$G$O!"\e(B"<" \e$B$d\e(B 
+">" \e$B$J$I$N5-9fN`$,\e(B ASCII \e$B$H0c$&G[Ns$K$J$C$F$$$^$9!#$3$N$?$a!"?t<0$d$=\e(B
+\e$B$NB>$N5-9fF~$j$NJ8$r=q$/$H$-$K6lO+$9$k$+$b$7$l$^$;$s!#\e(B
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index fdb1279..82c7262 100644 (file)
@@ -1,16 +1,24 @@
-Making multilingual presentations with MagicPoint
-$Id: README.lang,v 1.3 1999/06/17 04:26:08 kazu Exp $
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+         Making multilingual presentations with MagicPoint
+
+                           March 15, 2001
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 MagicPoint has no idea about what kind of character set you are using
 with your presentation file, or what kind of language you are using.
 For example, if you use Latin-1 (iso-8859-1) you MUST tell that explicitly
 to MagicPoint.
 
-In the future, we will be adding a MagicPoint directive to specify
-the encoding of the file explicitly, like:
-       %charset "iso-8859-1"
-       %charset "iso-2022-jp"
+If you want to use Latin-[1-4] (iso-8859-[1-4]), you can specify the
+encoding of the file explisitly with charset directive, like: 
+
+       %charset "iso8859-1"
+
+In the future, we will add more encodings to charset directive, like
+"iso2022-jp", or "euc-jp"
+
 
 Making MagicPoint presentations in European languages
 - Use "/configure  --enable-locale" before compilation.
@@ -24,3 +32,5 @@ Making MagicPoint presentations in European languages
 Making MagicPoint presentations in Asian languages
 - Use iso-2022 family encoding (iso-2022-jp, iso-2022-cn and others).
   Or, the X11 ctext encoding for your file.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/RELNOTES b/RELNOTES
new file mode 100644 (file)
index 0000000..a4a8232
--- /dev/null
+++ b/RELNOTES
@@ -0,0 +1,55 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+                    Release Notes for MagicPoint
+
+                           Sep 21, 2001
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+<<<1.09a>>>
+
+New features:
+       - The "area" directive: specifying drawing area in the window.
+               it can be used for siide-by-side positioning or logo displaying, etc.
+       - Enhance "prefix" directive 
+               you can specify prefix spacing by percentage of the drawing area width.
+
+Bugs fixed:
+       - Security fix:
+               fix a seculity hole inherited from xloadimage.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+<<<1.08a>>>
+
+New features:
+       - The "charset" directive: you can use iso-8859-[1-4]
+       - MNG support: animation without "mark" and "again"
+       - Enhancing "mgp2ps"
+               * Supporting "cont", "mark", "again"
+               * Resizing image
+
+Bugs fixed:
+       - Some. :-)
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+<<<1.07a>>>
+
+New features:
+       - PNG support
+       - Adding a dither algorithm to the gradation mechanism
+       - Pre-drawing
+               (Pages which contain text only is cached before
+               displayed.)
+       - mgp2ps produces much closer PS image to display image.
+
+Bugs fixed:
+       - If bgrad and/or bimage were used, display speed was getting
+          slower and slower. This has been fixed.
+       - Freeing color resources used anti-alias was wrong.
+         This has been fixed.
+       - Cleaned up the code for background image handling.
+       - mgp was core-dumped if reloaded during caching. This has 
+         been fixed.
+       - Fixed some small bugs.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/SYNTAX b/SYNTAX
index b963c27..943a3ec 100644 (file)
--- a/SYNTAX
+++ b/SYNTAX
@@ -1,4 +1,4 @@
-$Id: SYNTAX,v 1.29 1999/08/18 03:18:23 itojun Exp $
+$Id: SYNTAX,v 1.34 2001/09/25 08:25:13 nishida Exp $
 
 placement restriction for directives:
                .mgprc          preamble        main pages
@@ -9,7 +9,7 @@ placement restriction for directives:
 %default       x               okay            x
 %tab           x               okay            x
 %deffont       x               okay            x
-%include       x               okay            okay
+%include       x               okay            x
 others         x               x               okay
 
 
@@ -192,6 +192,12 @@ others             x               x               okay
        The effect of %prefix command in %tab command is local to
        tab-indented line.
 
+%prefix <percentage>
+       specify prefix spacing by <percentage> of the drawing area width.
+
+       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.
@@ -330,3 +336,22 @@ TEXT
                        1 means caching is executed immediately.
        <effect> :: type of 'special effect' for the forward page cache (0-2)
        <value> ::  speed of 'special effect'. value 1 means the highest speed.
+
+%anim "filename"
+       display animation file. (currently, only mng format is supported.)
+
+%charset "registry"
+       Specify the encoding of the document.
+       At this moment, the following charset are supported.
+               iso8859-1
+               iso8859-2
+               iso8859-3
+               iso8859-4
+
+%area <width> <height> [<xoffset> <yoffset>]
+       Specify the drawing area within the window.  All parameters are
+       translated as relative value of the window.  If offset is not
+       specified, the drawing area will be put center.
+       Note that all relative size specified in other directive after
+       "%area" will be affected, i.e. it will be relative to the
+       width/height of the drawing area instead of the window.
diff --git a/TODO.jp b/TODO.jp
index bf63ea7..f9531af 100644 (file)
--- a/TODO.jp
+++ b/TODO.jp
@@ -1,5 +1,5 @@
 TODOs
-$Id: TODO.jp,v 1.21 1998/07/20 17:50:15 itojun Exp $
+$Id: TODO.jp,v 1.22 2001/07/05 02:14:22 itojun Exp $
 
 mgp2ps
 - gif\e$B2hA|$r\e(Bsubroutine\e$B2=$7$F\e(Bps\e$B$r$A$$$5$/\e(B
@@ -21,6 +21,8 @@ mgp2ps
        %image\e$B$NG[CV\e(B
        shrink
        lcutin/rcutin\e$B$NGX7J2hA|\e(B
+- X font registry\e$B$NA*Br$r$b$C$H\e(Bflexible\e$B$K!#\e(Bexample: ESC $ ( C\e$B$N$H$-$O\e(B
+  ksc5601.1987-0\e$B$H\e(Bksx1001.1997-0\e$B$NN>J}$rC5$9$Y$-!#\e(B
 
 === done, partially.
 - \e$BGX7J%0%i%G!<%7%g%s\e(B
diff --git a/USAGE b/USAGE
index ce5d269..1f84caf 100644 (file)
--- a/USAGE
+++ b/USAGE
@@ -1,8 +1,12 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
                 How to make .mgp files (cheat sheet)
 
                      Kazu Yamamoto (with Chaki)
 
-                           June 17, 1999
+                           March 14, 2001
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 All .mgp commands start with "%". After making sure that
 /usr/X11R6/lib/X11/mgp/default.mgp exists, add the following line to
@@ -29,7 +33,7 @@ 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
+       %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
@@ -39,7 +43,7 @@ how a line looks.
        text color                      %fore
        background color                %back
        text size                       %size
-       text placement                  %center, %left, %right
+       text placement                  %center, %leftfill, %rightfill
        space between characters        %hgap
        space between lines             %vgap
        Font                            %font
@@ -99,20 +103,23 @@ By using this, it's easy to itemize. Let's take a look at an example:
        Emacs and friends
 
                Emacs
-                       19 is currently the main stream
-                       20 has been released
+                       20.7 is currently the main stream
+                       21 is coming
                Mule
                        2.3 is most used
                        Integrated to Emacs and XEmacs 
                XEmacs
-                       19 is the English version
-                       20 is the International version
+                       21.1 is most used
+                       21.2 is coming
 
 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.
@@ -124,6 +131,8 @@ get around this.
 (2) If you have "ghostscript":
     - craete an EPS file from a "tgif" obj file and use that for both cases
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 (1) If you cannot use "ghostscript":
 
 The image created by "tgif" is displayed "as is" on MagicPoint's
@@ -132,12 +141,17 @@ 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*FontSizes: 14 16 24 26
+Tgif.WhereToPrint:             GIF
 Tgif.XpmToGif: xpmtoppm %s | ppmtogif -transparent black
+Tgif.FontSizes:                        8 10 12 14 16 18 20 24 26 32 40 48 64
+Tgif.PreeditType:              overthespot
+Tgif.InitialPrintInColor:      false
+%%%%
+
 
 EPS files can be created just by typing:
        tgif -print -eps *.obj
@@ -150,6 +164,8 @@ creating the EPS file using "tgif".
 If corresponding filename.eps exists for filename.{gif,jpg,...},
 "mgp2ps" uses filename.eps when creating a PS file.
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 (2) If you can "ghostscript":
 
 Generate an EPS file, again by using
@@ -161,6 +177,8 @@ Paste the EPS file into your presentation by adding
 then, mgp will render the EPS file on-the-fly, by invoking "ghostscript".
 "mgp2ps" will properly include the EPS file into the output.
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 (3) Distributing presentation materials
 
 If you want to bundle two pages into one, you could try this:
@@ -169,32 +187,41 @@ If you want to bundle two pages into one, you could try this:
 "psnup" is included the "psutils"
 package(ftp://ftp.dcs.ed.ac.uk/pub/ajcd).
 
-                       Tips for better presentation
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+                    Tips for better presentation
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 
 (1) Refrain from using "vfont", "xfont" and "tfont" directive
-directly.  Use "deffont" in preamble and "font" in body instead.  This
-should allow people to view your presentation in all the configuration
-of the renderer.  (i.e. with/without FreeType, with/without VFlib)
+    directly.  Use "deffont" in preamble and "font" in body instead.
+    This should allow people to view your presentation in all the
+    configuration of the renderer.  (i.e. with/without FreeType,
+    with/without VFlib)
 
 (2) Use EPS files for vector image.
 
 (3)Install the latest "ghostscript".  Configure so that it can
-generate grayscaled image as output.
+   generate grayscaled image as output.
 
 (4) Before the actual presentation, go through the presentation in the
-same configuration as "the real thing".  It will make rendering
-faster.  (For the included EPS images, pixel image will be generated
-and be cached).  If you execute "mgp" with the "-F" option, "mgp"
-fetches and caches the next page so that it makes faster to visualize
-the next page.
+    same configuration as "the real thing".  It will make rendering
+    faster.  (For the included EPS images, pixel image will be
+    generated and be cached).  If you execute "mgp" with the "-F"
+    option, "mgp" fetches and caches the next page so that it makes
+    faster to visualize the next page.
 
 (5) Check/practice the connection with the VGA projector.
 
 (6) Practice your oral presentation well :-)
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
                        Mathematical Formulas
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 There are, at least, three way to include mathematical formulas in 
 .mgp file.
 
@@ -232,17 +259,21 @@ e.g. latex foo.tex ; dvips -f -E foo.dvi > foo.eps
 
        %image "foo.pbm"
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+                     Pasting foils onto the web
 
-                       Pasting foils onto the web
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 If you wish to paste your MagicPoint presentation, you have three options.
 
 (1) If you can assume that the client-side has MagicPoint, you can
-paste a presentation file after processing that by "mgpembed" program.
+    paste a presentation file after processing that by "mgpembed"
+    program.
 
 (1.1) Merge images into presentation file, by using "mgpembed".
-"mgpembed" generates single archive-like presentation file, which
-includes images (encoded by "uuencode").
+      "mgpembed" generates single archive-like presentation file,
+      which includes images (encoded by "uuencode").
 
 (1.2) Paste the generated file onto the web, under name "foo.mgp".
 
@@ -257,11 +288,11 @@ content-type for ".mgp", use "application/x-magicpoint".  I believe
 "text/plain" would be a last resort.
 
 (2) If you cannot asuume that there's no MagicPoint at the client's
-site, you'll need to convert presentation into a html file.  Use the
--D option for this.
+    site, you'll need to convert presentation into a html file.  Use
+    the -D option for this.
 
 (3) 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.
+    processing it with "mgp2ps".  It would be nice if you would like
+    nobody to reuse your work at ease.
 
-END
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 97a32b6..91e8756 100644 (file)
--- a/USAGE.jp
+++ b/USAGE.jp
@@ -1,8 +1,12 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
                   .mgp \e$B%U%!%$%k$N$$$$2C8:$J=q$-J}\e(B
 
                               \e$B;3K\OBI'\e(B
 
-                           1999\e$BG/\e(B6\e$B7n\e(B17\e$BF|\e(B
+                           2001\e$BG/\e(B3\e$B7n\e(B14\e$BF|\e(B
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 .mgp \e$B%U%!%$%k$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
@@ -26,7 +30,7 @@ MagicPoint \e$B$O9T;X8~$G$9!#%G%U%)%k%H$N%9%?%$%k$G$O!"\e(B1 \e$B9TL\$r2hLL>e$NM>\e(
 \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
+       %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
@@ -35,7 +39,7 @@ MagicPoint \e$B$O9T;X8~$G$9!#%G%U%)%k%H$N%9%?%$%k$G$O!"\e(B1 \e$B9TL\$r2hLL>e$NM>\e(
        \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;z$N0LCV\e(B                %center, %leftfill, %rightfill
        \e$BJ8;z4V\e(B                    %hgap
        \e$B9T4V\e(B                      %vgap
        \e$B%U%)%s%H\e(B          %font
@@ -55,7 +59,7 @@ default.mgp \e$B$G$O0J2<$N$h$&$KDj5A$5$l$F$$$^$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$B$l$J$$B0@-$O!"A0$N9T$NCM$r0z$-7Q$.$^$9!#\e(B
 
 \e$BNc$r8+$F$_$^$7$g$&\e(B
 
@@ -92,20 +96,24 @@ MagicPoint \e$B$O$"$k9T$rI=<($9$k:]$K!"$^$:$=$N9T$N\e(B %default \e$B$N@_Dj$rH?1G\e(
        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 2\e$B$b%j%j!<%9$5$l$F$$$k\e(B
+                       \e$B8=:_$O\e(B 20.7 \e$B$,<gN.\e(B
+                       \e$B$G$b\e(B 2\e$B$,$b$&$9$0%j%j!<%9$5$l$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
+                       21.1 \e$B$,$h$/;H$o$l$F$$$k\e(B
+                       \e$B$G$b\e(B 21.2 \e$B$,$b$&$9$0%j%j!<%9$5$l$k\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%U%!%$%k$rD>@\I=<($G$-$J$$$1$l$I!"9,$;$K$J\e(B
 \e$B$l$kJ}K!$O$"$j$^$9!#\e(B
@@ -117,6 +125,8 @@ MagicPoint \e$B$O\e(B tgif \e$B$N\e(B .obj \e$B%U%!%$%k$rD>@\I=<($G$-$J$$$1$l$I!"9,$;
 (2) \e$B2hLLI=<($K\e(B ghostscript \e$B$rMxMQ$9$k$J$i\e(B
     - \e$B2hLLI=<(\e(B/\e$B0u:~6&$K\e(B tgif \e$B$,EG$$$?\e(B EPS \e$B$r;H$&\e(B
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 (1) GIF and EPS
 
 tgif \e$B$GI=<($5$l$?%$%a!<%8$,$=$N$^$^!"\e(Bmgp \e$B$N2hLL$KI=<($5$l$^$9!#$@$+$i!"\e(B
@@ -125,26 +135,39 @@ tgif \e$B$GI=<($5$l$?%$%a!<%8$,$=$N$^$^!"\e(Bmgp \e$B$N2hLL$KI=<($5$l$^$9!#$@$+$i!"
 \e$B$G!"0J2<$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$+$;\e(B
 \e$B$k$H$$$$$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
+Tgif.WhereToPrint:             GIF
 Tgif.XpmToGif: xpmtoppm %s | ppmtogif -transparent black
+Tgif.FontSizes:                        8 10 12 14 16 18 20 24 26 32 40 48 64
+!Tgif.DoubleByteInputMethod:   xim
+Tgif.PreeditType:              overthespot
+Tgif.SquareDoubleByteFonts:    \n\
+  -*-fixed-medium-r-*--%d-*-*-*-*-*-jisx0208.1983-*,H,Ryumin-Light-EUC-H \n\
+  -*-fixed-medium-r-*--%d-*-*-*-*-*-jisx0208.1983-*,H,Ryumin-Light-EUC-H \n\
+  -*-fixed-medium-r-*--%d-*-*-*-*-*-jisx0208.1983-*,H,Ryumin-Light-EUC-H \n\
+  -*-fixed-medium-r-*--%d-*-*-*-*-*-jisx0208.1983-*,H,Ryumin-Light-EUC-H \n\
+  \n\
+  -*-fixed-medium-r-*--%d-*-*-*-*-*-jisx0208.1983-*,V,Ryumin-Light-EUC-V \n\
+  -*-fixed-medium-r-*--%d-*-*-*-*-*-jisx0208.1983-*,V,Ryumin-Light-EUC-V \n\
+  -*-fixed-medium-r-*--%d-*-*-*-*-*-jisx0208.1983-*,V,Ryumin-Light-EUC-V \n\
+  -*-fixed-medium-r-*--%d-*-*-*-*-*-jisx0208.1983-*,V,Ryumin-Light-EUC-V \n\
+  \n\
+  -*-fixed-bold-r-*--%d-*-*-*-*-*-jisx0208.1983-*,H,GothicBBB-Medium-EUC-H \n\
+  -*-fixed-bold-r-*--%d-*-*-*-*-*-jisx0208.1983-*,H,GothicBBB-Medium-EUC-H \n\
+  -*-fixed-bold-r-*--%d-*-*-*-*-*-jisx0208.1983-*,H,GothicBBB-Medium-EUC-H \n\
+  -*-fixed-bold-r-*--%d-*-*-*-*-*-jisx0208.1983-*,H,GothicBBB-Medium-EUC-H \n\
+  \n\
+  -*-fixed-bold-r-*--%d-*-*-*-*-*-jisx0208.1983-*,V,GothicBBB-Medium-EUC-V \n\
+  -*-fixed-bold-r-*--%d-*-*-*-*-*-jisx0208.1983-*,V,GothicBBB-Medium-EUC-V \n\
+  -*-fixed-bold-r-*--%d-*-*-*-*-*-jisx0208.1983-*,V,GothicBBB-Medium-EUC-V \n\
+  -*-fixed-bold-r-*--%d-*-*-*-*-*-jisx0208.1983-*,V,GothicBBB-Medium-EUC-V
+Tgif.RyuminShowFontChar:       \314\300
+Tgif.GothicBBBShowFontChar:    \245\264
+Tgif.InitialPrintInColor:      false
+%%%%
 
 EPS \e$B$O!"\e(B
        tgif -print -eps *.obj
@@ -156,6 +179,8 @@ 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) EPS only
 
 EPS \e$B$r$D$/$j$^$9!#7+$jJV$7$K$J$j$^$9$,!"\e(B
@@ -169,6 +194,7 @@ EPS \e$B$r$D$/$j$^$9!#7+$jJV$7$K$J$j$^$9$,!"\e(B
 
 \e$B0u:~$9$k>l9g$O!"\e(B(1) \e$B$HF1MM$K\e(B mgp2ps \e$B$rMxMQ$7$F2<$5$$!#\e(B
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 (3) \e$B;qNA$NG[I[\e(B
 
@@ -178,36 +204,46 @@ EPS \e$B$r$D$/$j$^$9!#7+$jJV$7$K$J$j$^$9$,!"\e(B
 
 psnup \e$B$O\e(B psutils (ftp://ftp.dcs.ed.ac.uk/pub/ajcd) \e$B$KF~$C$F$$$^$9!#\e(B
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
                        \e$B>e<j$J%W%l%<%s$N$?$a$K\e(B
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 (1) "vfont"\e$B!"\e(B"xfont"\e$B!"\e(B"tfont"\e$B$rK\J8Cf$GD>@\;H$&$N$OHr$1$^$7$g$&!#@k8@\e(B
-\e$BNN0h$G\e(B"deffont"\e$B$7$F!"K\J8Cf$G$O\e(B"font"\e$B$r;H$$$^$7$g$&!#$3$&$9$k$H!"\e(B
-MagicPoint\e$B$N%U%)%s%HE83+%(%s%8%s$K0MB8$7$J$$\e(B .mgp \e$B%U%!%$%k$r:n@.$G$-$^\e(B
-\e$B$9!#\e(B
+    \e$BNN0h$G\e(B"deffont"\e$B$7$F!"K\J8Cf$G$O\e(B"font"\e$B$r;H$$$^$7$g$&!#$3$&$9$k$H!"\e(B
+    MagicPoint\e$B$N%U%)%s%HE83+%(%s%8%s$K0MB8$7$J$$\e(B .mgp \e$B%U%!%$%k$r:n@.$G\e(B
+    \e$B$-$^$9!#\e(B
 
 (2) \e$B%Y%/%H%k2hA|$K$O6KNO\e(B EPS \e$B%U%!%$%k$r;H$$$^$7$g$&!#\e(B
 
 (3) \e$B%0%l%$%9%1!<%k2hA|$r=PNO$G$-$k\e(B ghostscript \e$B$r%$%s%9%H!<%k$7$^$7$g\e(B
-\e$B$&!#\e(B
+    \e$B$&!#\e(B
 
 (4) \e$BK\HV$N%W%l%<%sA0$K!"0lEYK\HV$HF1$8@_Dj$G%W%l%<%s$rI=<($7$F$*$/$H!"\e(B
-EPS \e$B%U%!%$%k$,E83+$5$l$F%-%c%C%7%e$5$l$^$9$N$GK\HV$G$N2hA|I=<($,B.$/$J\e(B
-\e$B$j$^$9!#\e(BMagicPoint \e$B$K\e(B -F \e$B$r;XDj$9$k$H!"<!$N%Z!<%8$r@hFI$_$7$^$9$N$G!"\e(B
-\e$BI=<($,B.$/$J$j$^$9!#\e(B
+    EPS \e$B%U%!%$%k$,E83+$5$l$F%-%c%C%7%e$5$l$^$9$N$GK\HV$G$N2hA|I=<($,B.\e(B
+    \e$B$/$J$j$^$9!#\e(BMagicPoint \e$B$K\e(B -F \e$B$r;XDj$9$k$H!"<!$N%Z!<%8$r@hFI$_$7$^\e(B
+    \e$B$9$N$G!"I=<($,B.$/$J$j$^$9!#\e(B
 
 (5) VGA\e$B%W%m%8%'%/%?$H$N@\B3$r$A$c$s$H3N$+$a$^$7$g$&!#$^$?!"Aa$a$K$&$^\e(B
-\e$B$/7Q$k$+3NG'$7$F$*$-$^$7$g$&!#\e(B
+    \e$B$/7Q$k$+3NG'$7$F$*$-$^$7$g$&!#\e(B
 
 (6) \e$B$A$c$s$HH/I=N}=,$7$^$7$g$&\e(B :-)
 
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
                                 \e$B?t<0\e(B
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 .mgp \e$B%U%!%$%k$K?t<0$rKd$a9~$`J}K!$K$OBg$-$/J,$1$F!"\e(B
        1) \e$B;vA0$K$J$s$i$+$NJ}K!$G?^7A%U%!%$%k$KJQ49$7$F$*$/\e(B
        2) \e$B%U%#%k%?%3%^%s%I$rMxMQ$7$F!"F0E*$K:n@.$9$k\e(B
 \e$B$N\e(B2\e$B$D$,$"$j$^$9!#\e(B
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 [\e$B@EE*$JJ}K!\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
@@ -231,6 +267,7 @@ EPS \e$B%U%!%$%k$,E83+$5$l$F%-%c%C%7%e$5$l$^$9$N$GK\HV$G$N2hA|I=<($,B.$/$J\e(B
 
        %image "foo.pbm"
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 [\e$BF0E*$JJ}K!\e(B]
   (1) TeX
@@ -265,16 +302,20 @@ EPS \e$B%U%!%$%k$,E83+$5$l$F%-%c%C%7%e$5$l$^$9$N$GK\HV$G$N2hA|I=<($,B.$/$J\e(B
          \e$BMW$G$9!#\e(B
 
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
                   \e$B%W%l%<%s%U%!%$%k$r\e(B Web \e$B$KE=$m$&\e(B
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 MagicPoint \e$B$N%W%l%<%s%F!<%7%g%s%U%!%$%k$r\e(B Web \e$B$KE=$k>l9g!"\e(B3\e$B$D$NJ}K!$,\e(B
 \e$B$"$j$^$9!#\e(B
 
 (1) \e$B%/%i%$%"%s%HB&$K\e(B MagicPoint \e$B$,$"$k$H2>Dj$G$-$k>l9g$K$O!"\e(Bmgpembed 
-\e$B$G:n@.$7$?%U%!%$%k$r$=$N$^$^\e(B Web \e$B%5!<%P$GDs6!$9$l$P\e(B OK \e$B$G$9!#\e(B
+    \e$B$G:n@.$7$?%U%!%$%k$r$=$N$^$^\e(B Web \e$B%5!<%P$GDs6!$9$l$P\e(B OK \e$B$G$9!#\e(B
 
 (1.1) mgpembed \e$B%3%^%s%I$r;H$C$F!"2hA|%U%!%$%k$r\e(B .mgp \e$B%U%!%$%kCf$KKd$a\e(B
-\e$B9~$_$^$9!#7k2L$H$7$FC10l$N%U%!%$%k$,$G$-$"$,$j$^$9!#\e(B
+      \e$B9~$_$^$9!#7k2L$H$7$FC10l$N%U%!%$%k$,$G$-$"$,$j$^$9!#\e(B
 
 (1.2) \e$B$G$-$"$,$C$?%U%!%$%k$N3HD%;R$r\e(B .mgp \e$B$K$7$F\e(B Web \e$B%5!<%P$KCV$-$^$9!#\e(B
 
@@ -289,11 +330,12 @@ MagicPoint \e$B$N%W%l%<%s%F!<%7%g%s%U%!%$%k$r\e(B Web \e$B$KE=$k>l9g!"\e(B3\e$B$D$NJ}
 \e$B$F$/$@$5$$!#\e(B
 
 (2) \e$BG$0U$N%/%i%$%"%s%H$G8+$?$$>l9g!"3F2hLL$N%@%s%W$r\e(B GIF \e$B$KMn$7!"$=$l\e(B
-\e$B$>$l$N\e(B GIF \e$B%U%!%$%k$r\e(B HTML \e$B$+$i\e(B "IMG" \e$B$G;2>H$7$^$9!#\e(BMagicPoint \e$B$O$3$N\e(B
-\e$B$h$&$J%F%s%W%l!<%H$r4JC1$K:n@.$7$F$/$l$^$9!#\e(Bmgp -D \e$B$rMxMQ$7$F2<$5$$!#\e(B
+    \e$B$>$l$N\e(B GIF \e$B%U%!%$%k$r\e(B HTML \e$B$+$i\e(B "IMG" \e$B$G;2>H$7$^$9!#\e(BMagicPoint \e$B$O\e(B
+    \e$B$3$N$h$&$J%F%s%W%l!<%H$r4JC1$K:n@.$7$F$/$l$^$9!#\e(Bmgp -D \e$B$rMxMQ$7$F\e(B
+    \e$B2<$5$$!#\e(B
 
 (3) \e$B%W%l%<%s%U%!%$%k$r\e(B PS \e$B%U%!%$%k$KJQ49$7$F$+$iE=$k$N$b$$$$$+$b$7$l$^\e(B
-\e$B$;$s!#$3$N>l9g\e(B mgp2ps \e$B$G:n@.$7$?\e(B PS \e$B%U%!%$%k$r\e(B Web \e$B%5!<%P$KCV$/$3$H$K\e(B
-\e$B$J$j$^$9!#\e(B
+    \e$B$;$s!#$3$N>l9g\e(B mgp2ps \e$B$G:n@.$7$?\e(B PS \e$B%U%!%$%k$r\e(B Web \e$B%5!<%P$KCV$/$3\e(B
+    \e$B$H$K$J$j$^$9!#\e(B
 
-\e$B$*$7$^$$\e(B
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index f865f7c..3c2b756 100644 (file)
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: background.c,v 1.12 1998/12/28 08:22:22 itojun Exp $
+ * $Id: background.c,v 1.14 2000/03/05 07:26:29 nishida Exp $
  */
 
 #include <math.h>
@@ -83,8 +83,16 @@ draw_gradation0(x1, x2, y1, y2, z1, z2, p1, p2, dpy, dpz, mask)
                                y1 += step;
                                p += (dpy * step);
                        }
+#ifdef DITHERED_BGRAD
+                       for (z = z1; z < z2; z+=3){
+                               *(p + z * dpz) =     x1 * (30 + (y1 % 3)) / 32 & mask;
+                               *(p + (z+1) * dpz) = x1 * (30 + ((y1 + 2) % 3)) / 32 & mask;
+                               *(p + (z+2) * dpz) = x1 * (30 + ((y1 + 1) % 3)) / 32 & mask;
+                       }
+#else
                        for (z = z1; z < z2; z++)
                                *(p + z * dpz) = x1 & mask;
+#endif
                }
        } else {
                if (y1 > y2) {
@@ -106,8 +114,16 @@ draw_gradation0(x1, x2, y1, y2, z1, z2, p1, p2, dpy, dpz, mask)
                                s += dy;
                                x1 += step;
                        }
+#ifdef DITHERED_BGRAD
+                       for (z = z1; z < z2; z+=3){
+                               *(p + z * dpz) =     x1 * (30 + (y1 % 3)) / 32 & mask;
+                               *(p + (z+1) * dpz) = x1 * (30 + ((y1 + 2) % 3)) / 32 & mask;
+                               *(p + (z+2) * dpz) = x1 * (30 + ((y1 + 1) % 3)) / 32 & mask;
+                       }
+#else
                        for (z = z1; z < z2; z++)
                                *(p + z * dpz) = x1 & mask;
+#endif
                }
        }
 }
index af43341..53c5bf0 100755 (executable)
--- a/configure
+++ b/configure
@@ -14,8 +14,6 @@ ac_default_prefix=/usr/local
 ac_help="$ac_help
   --enable-debug          compile debugging information in."
 ac_help="$ac_help
-  --enable-gif            compile gif support in."
-ac_help="$ac_help
   --enable-locale         perform setlocale() on invocation."
 ac_help="$ac_help
   --disable-freetype      DON'T use freetype routines."
@@ -27,6 +25,10 @@ ac_help="$ac_help
   --enable-freetype-charset16         use freetype for chaset16."
 ac_help="$ac_help
   --with-x                use the X Window System"
+ac_help="$ac_help
+  --enable-gif            compile gif support in (need libungif)."
+ac_help="$ac_help
+  --enable-imlib          use imlib exclusively to load images."
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -539,7 +541,7 @@ fi
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:543: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:545: 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
@@ -591,7 +593,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:595: checking host system type" >&5
+echo "configure:597: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -611,12 +613,92 @@ host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:618: 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 633 "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:639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+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 650 "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:656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+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} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 667 "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:673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+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*
+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
+
 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:620: checking for $ac_word" >&5
+echo "configure:702: 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
@@ -650,7 +732,7 @@ 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:654: checking for $ac_word" >&5
+echo "configure:736: 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
@@ -683,7 +765,7 @@ 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:687: checking for $ac_word" >&5
+echo "configure:769: 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
@@ -717,7 +799,7 @@ then
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:721: checking for yywrap in -l$ac_lib" >&5
+echo "configure:803: 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
@@ -725,7 +807,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 729 "configure"
+#line 811 "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
@@ -736,7 +818,7 @@ int main() {
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -763,7 +845,7 @@ 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:767: checking for $ac_word" >&5
+echo "configure:849: 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
@@ -805,7 +887,7 @@ 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:809: checking for $ac_word" >&5
+echo "configure:891: 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
@@ -847,7 +929,7 @@ 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:851: checking for $ac_word" >&5
+echo "configure:933: 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
@@ -889,7 +971,7 @@ 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:893: checking for $ac_word" >&5
+echo "configure:975: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_mgp_cv_path_uudecode'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -930,7 +1012,7 @@ 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:934: checking for $ac_word" >&5
+echo "configure:1016: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_mgp_cv_path_gunzip'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -981,7 +1063,7 @@ OPTFLAGS="$OPTFLAGS -DUUDECODE=\\\"$mgp_cv_path_uudecode\\\""
 OPTFLAGS="$OPTFLAGS -DGUNZIP=\\\"$mgp_cv_path_gunzip\\\""
 
 echo $ac_n "checking if --enable-debug option specified""... $ac_c" 1>&6
-echo "configure:985: checking if --enable-debug option specified" >&5
+echo "configure:1067: 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"
@@ -992,23 +1074,8 @@ fi
 
 echo "$ac_t""$mgp_debug" 1>&6
 
-echo $ac_n "checking if --enable-gif option specified""... $ac_c" 1>&6
-echo "configure:997: checking if --enable-gif option specified" >&5
-# Check whether --enable-gif or --disable-gif was given.
-if test "${enable_gif+set}" = set; then
-  enableval="$enable_gif"
-  mgp_gif="yes"; cat >> confdefs.h <<\EOF
-#define USE_GIF 1
-EOF
-
-else
-  mgp_gif="no"
-fi
-
-echo "$ac_t""$mgp_gif" 1>&6
-
 echo $ac_n "checking if --enable-locale option specified""... $ac_c" 1>&6
-echo "configure:1012: checking if --enable-locale option specified" >&5
+echo "configure:1079: checking if --enable-locale option specified" >&5
 # Check whether --enable-locale or --disable-locale was given.
 if test "${enable_locale+set}" = set; then
   enableval="$enable_locale"
 
 echo "$ac_t""$mgp_locale" 1>&6
 
-LIBS="-lm $LIBS"
-
-echo $ac_n "checking if --disable-freetype option specified""... $ac_c" 1>&6
-echo "configure:1026: 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
-if test "$mgp_use_freetype" = "yes"; then
-       echo $ac_n "checking for freetype library/header""... $ac_c" 1>&6
-echo "configure:1039: checking for freetype library/header" >&5
-       for dir in /usr/local/freetype /usr/local /opt/freetype /usr/pkg /usr; do
-               ac_cv_ft_lib=no
-               ac_cv_ft_include=no
-               shlib1=`echo $dir/lib/libttf.so* | head -1 | sed -e 's/.*\///'`
-               if test x$shlib1 = x; then
-                       $shlib1=no
-               fi
-               if test -d $dir/lib -a -f $dir/lib/$shlib1; then
-                       ac_cv_ft_lib="$dir/lib"
-                       ac_cv_ft_libpath="$shlib1"
-               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"
-               elif test -d $dir/include/freetype -a -f $dir/include/freetype/freetype.h; then
-                       ac_cv_ft_include="$dir/include/freetype"
-               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:1077: 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 "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1091: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lttf  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1085 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 1096 "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; }
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 EOF
-if { (eval echo configure:1096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_cv_header_stdc=yes
 else
+  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_header_stdc=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
+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 1121 "configure"
+#include "confdefs.h"
+#include <string.h>
 EOF
-
-  LIBS="-lttf $LIBS"
-
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
 else
-  echo "$ac_t""no" 1>&6
-echo "Fatal: libttf.a not found"
-               exit 1
+  rm -rf conftest*
+  ac_cv_header_stdc=no
 fi
+rm -f conftest*
 
-       cat > conftest.$ac_ext <<EOF
-#line 1126 "configure"
-#include "confdefs.h"
-#include <freetype.h>
-int main() {
+fi
 
-; return 0; }
+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 1139 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
 EOF
-if { (eval echo configure:1133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-               echo "Fatal: freetype.h not found"
-               exit 1
+  ac_cv_header_stdc=no
 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:1148: checking for num_CharMaps field in TT_Face_Properties" >&5
-       cat > conftest.$ac_ext <<EOF
-#line 1150 "configure"
+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 1160 "configure"
 #include "confdefs.h"
-#include <freetype.h>
-int main() {
-TT_Face_Properties x; return x.num_CharMaps;
-; return 0; }
-EOF
-if { (eval echo configure:1157: \"$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
+#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:1171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  :
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  result=no
+  rm -fr conftest*
+  ac_cv_header_stdc=no
 fi
-rm -f conftest*
-       echo "$ac_t""$result" 1>&6
+rm -fr conftest*
 fi
 
-echo $ac_n "checking if --disable-vflib option specified""... $ac_c" 1>&6
-echo "configure:1174: 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
 fi
 
-echo "$ac_t""$mgp_skip_vflib" 1>&6
+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
 
-if test "$mgp_use_vflib" = "yes"; then
-       echo $ac_n "checking for VFlib library/header""... $ac_c" 1>&6
-echo "configure:1187: checking for VFlib library/header" >&5
-       for dir in /usr/local/VFlib /usr/local/vflib /usr/local /usr/pkg /usr; do
-               ac_cv_vf_libname=VFlib
-               ac_cv_vf_libdir=no
-               ac_cv_vf_hdrdir=no
-               shlib1=`echo $dir/lib/libVFlib.so* | head -1 | sed -e 's/.*\///'`
-               shlib2=`echo $dir/lib/libVFlib2.so* | head -1 | sed -e 's/.*\///'`
-               if test x$shlib1 = x; then
-                       $shlib1=no
-               fi
-               if test x$shlib2 = x; then
-                       $shlib2=no
-               fi
-               if test -d $dir/lib -a -f $dir/lib/$shlib1; then
-                       ac_cv_vf_libdir="$dir/lib"
-                       ac_cv_vf_libpath=$shlib1
-               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/$shlib2; then
-                       ac_cv_vf_libname=VFlib2
-                       ac_cv_vf_libdir="$dir/lib"
-                       ac_cv_vf_libpath=$shlib2
-               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:1236: 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 "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
+echo "configure:1195: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-l$ac_cv_vf_libname  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1244 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 1200 "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();
-
+#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() {
-VF_Init()
+int s;
+wait (&s);
+s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:1255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_cv_header_sys_wait_h=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_header_sys_wait_h=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
+
+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
 
-       cat > conftest.$ac_ext <<EOF
-#line 1278 "configure"
+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 locale.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1240: 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 1245 "configure"
 #include "confdefs.h"
-#include <VF.h>
-int main() {
-
-; return 0; }
+#include <$ac_hdr>
 EOF
-if { (eval echo configure:1285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  :
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+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*
-               echo "Fatal: VF.h not found"
-               exit 1
+  eval "ac_cv_header_$ac_safe=no"
 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:1301: 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 \
-                   /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"
+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
-
-       
-fi
-
-if test "$mgp_use_freetype" = "yes"; then
-       echo $ac_n "checking if --enable-freetype-charset16 option specified""... $ac_c" 1>&6
-echo "configure:1339: checking if --enable-freetype-charset16 option specified" >&5
-       # Check whether --enable-freetype-charset16 or --disable-freetype-charset16 was given.
-if test "${enable_freetype_charset16+set}" = set; then
-  enableval="$enable_freetype_charset16"
-  mgp_use_freetype_c16="yes"
 else
-  mgp_use_freetype_c16="no"
+  echo "$ac_t""no" 1>&6
 fi
+done
 
-       echo "$ac_t""$mgp_use_freetype_c16" 1>&6
-
-       if test "$mgp_use_freetype_c16" = "yes"; then
-               cat >> confdefs.h <<\EOF
-#define FREETYPE_CHARSET16 1
-EOF
-
-       fi
-fi
 
-for i in /usr/pkg /usr/local; do
-       if test -f $i/include/png.h -a -f $i/lib/libpng.a; then
-               LIBS="$LIBS -L$i/lib"
-               OPTFLAGS="$OPTFLAGS -I$i/include"
-               DEPLIBS="$DEPLIBS $i/lib/libpng.a"
-               echo $ac_n "checking for png_write_init in -lpng""... $ac_c" 1>&6
-echo "configure:1364: checking for png_write_init in -lpng" >&5
-ac_lib_var=`echo png'_'png_write_init | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:1278: 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
-  ac_save_LIBS="$LIBS"
-LIBS="-lpng  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1372 "configure"
+  cat > conftest.$ac_ext <<EOF
+#line 1283 "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 png_write_init();
 
 int main() {
-png_write_init()
+
+/* 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:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  ac_cv_c_const=yes
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  ac_cv_c_const=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 png | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+  cat >> confdefs.h <<\EOF
+#define const 
 EOF
 
-  LIBS="-lpng $LIBS"
+fi
 
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:1353: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  echo "$ac_t""no" 1>&6
-fi
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat > conftest.$ac_ext <<EOF
+#line 1360 "configure"
+#include "confdefs.h"
 
-               cat >> confdefs.h <<\EOF
-#define USE_PNG 1
+int main() {
+} $ac_kw foo() {
+; return 0; }
 EOF
-
-               break
-       fi
+if { (eval echo configure:1367: \"$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
 
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1419: 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_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:1393: 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
-    # 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 1434 "configure"
+#line 1398 "configure"
 #include "confdefs.h"
-#include <assert.h>
-Syntax Error
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_pid_t=yes
 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"
+  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:1426: 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 1451 "configure"
+#line 1431 "configure"
 #include "confdefs.h"
-#include <assert.h>
-Syntax Error
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_size_t=yes
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  CPP="${CC-cc} -nologo -E"
+  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:1459: 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 1468 "configure"
+#line 1464 "configure"
 #include "confdefs.h"
-#include <assert.h>
-Syntax Error
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+int main() {
+struct tm *tp;
+; return 0; }
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+if { (eval echo configure:1473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_header_time=yes
 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_header_time=no
 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:1503: checking for X" >&5
+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
 
-# 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 "checking for u_int""... $ac_c" 1>&6
+echo "configure:1494: 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
-  # 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}"'
+  cat > conftest.$ac_ext <<EOF
+#line 1499 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
 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
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])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*
 
-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
+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
 
-  # First, try using that file with no special directory specified.
-cat > conftest.$ac_ext <<EOF
-#line 1565 "configure"
+fi
+
+echo $ac_n "checking for u_char""... $ac_c" 1>&6
+echo "configure:1527: 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 1532 "configure"
 #include "confdefs.h"
-#include <$x_direct_test_include>
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1570: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])u_char[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
-  # We can compile using X headers with no special include directory.
-ac_x_includes=
+  ac_cv_type_u_char=yes
 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
+  ac_cv_type_u_char=no
 fi
 rm -f conftest*
-fi # $ac_x_includes = NO
 
-if test "$ac_x_libraries" = NO; then
-  # Check for the libraries.
+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
 
-  test -z "$x_direct_test_library" && x_direct_test_library=Xt
-  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+fi
 
-  # 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 1639 "configure"
+
+echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
+echo "configure:1561: 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 1569 "configure"
 #include "confdefs.h"
 
-int main() {
-${x_direct_test_function}()
-; return 0; }
+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:1646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  LIBS="$ac_save_LIBS"
-# We can link X programs with no special library path.
-ac_x_libraries=
+if { (eval echo configure:1579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./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 -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"
+  rm -fr conftest*
+  ac_cv_func_memcmp_clean=no
 fi
+rm -fr conftest*
 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:1733: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
+
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:1597: 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 1738 "configure"
+#line 1602 "configure"
 #include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.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
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:1619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-  ac_cv_header_stdc=yes
+  ac_cv_type_signal=void
 else
-  echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ac_cv_header_stdc=no
+  ac_cv_type_signal=int
 fi
 rm -f conftest*
+fi
 
-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 1763 "configure"
+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 _setbufend
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1640: 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 1645 "configure"
 #include "confdefs.h"
-#include <string.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 "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
-  :
+if { (eval echo configure:1668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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*
-  ac_cv_header_stdc=no
+  eval "ac_cv_func_$ac_func=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 1781 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
+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
-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*
-
+  echo "$ac_t""no" 1>&6
 fi
+done
 
-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
-  :
+for ac_func in usleep strsep strdup mkstemp snprintf memcmp
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1695: 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 1802 "configure"
+#line 1700 "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); }
+/* 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:1813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  :
+if { (eval echo configure:1723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_header_stdc=no
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
 fi
-rm -fr conftest*
+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}.${ac_objext}"
 fi
-fi
+done
 
-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
 
+
+LIBS="-lm $LIBS"
+
+echo $ac_n "checking if --disable-freetype option specified""... $ac_c" 1>&6
+echo "configure:1753: 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_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1837: 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_t""$mgp_skip_freetype" 1>&6
+if test "$mgp_use_freetype" = "yes"; then
+       echo $ac_n "checking for freetype library/header""... $ac_c" 1>&6
+echo "configure:1766: checking for freetype library/header" >&5
+       for dir in /usr/local/freetype /usr/local /opt/freetype /usr/pkg /usr; do
+               ac_cv_ft_lib=no
+               ac_cv_ft_include=no
+               shlib1=`echo $dir/lib/libttf.so* | head -1 | sed -e 's/.*\///'`
+               if test x$shlib1 = x; then
+                       shlib1=no
+               fi
+               if test -d $dir/lib -a -f $dir/lib/$shlib1; then
+                       ac_cv_ft_lib="$dir/lib"
+                       ac_cv_ft_libpath="$shlib1"
+               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"
+               elif test -d $dir/include/freetype -a -f $dir/include/freetype/freetype.h; then
+                       ac_cv_ft_include="$dir/include/freetype"
+               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 dgettext in -lintl""... $ac_c" 1>&6
+echo "configure:1804: checking for dgettext in -lintl" >&5
+ac_lib_var=`echo intl'_'dgettext | 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
-  cat > conftest.$ac_ext <<EOF
-#line 1842 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lintl  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1812 "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
+/* 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 dgettext();
+
 int main() {
-int s;
-wait (&s);
-s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+dgettext()
 ; return 0; }
 EOF
-if { (eval echo configure:1858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ac_cv_header_sys_wait_h=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ac_cv_header_sys_wait_h=no
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
 
-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
+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 intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
 EOF
 
+  LIBS="-lintl $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
 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 locale.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1882: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+       echo $ac_n "checking for TT_Init_FreeType in -lttf""... $ac_c" 1>&6
+echo "configure:1851: 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
-  cat > conftest.$ac_ext <<EOF
-#line 1887 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lttf  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1859 "configure"
 #include "confdefs.h"
-#include <$ac_hdr>
+/* 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
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+  eval "ac_cv_lib_$ac_lib_var=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"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
+
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+    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_hdr 1
+#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
-done
 
+       cat > conftest.$ac_ext <<EOF
+#line 1900 "configure"
+#include "confdefs.h"
+#include <freetype.h>
+int main() {
 
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1920: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+; return 0; }
+EOF
+if { (eval echo configure:1907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  :
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1925 "configure"
-#include "confdefs.h"
+  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:1922: checking for num_CharMaps field in TT_Face_Properties" >&5
+       cat > conftest.$ac_ext <<EOF
+#line 1924 "configure"
+#include "confdefs.h"
+#include <freetype.h>
 int main() {
+TT_Face_Properties x; return x.num_CharMaps;
+; return 0; }
+EOF
+if { (eval echo configure:1931: \"$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
 
-/* 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:1974: \"$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
+  result=no
 fi
 rm -f conftest*
+       echo "$ac_t""$result" 1>&6
 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
-
+echo $ac_n "checking if --disable-vflib option specified""... $ac_c" 1>&6
+echo "configure:1948: 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_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1995: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
+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:1961: checking for VFlib library/header" >&5
+       for dir in /usr/local/VFlib /usr/local/vflib /usr/local /usr/pkg /usr; do
+               ac_cv_vf_libname=VFlib
+               ac_cv_vf_libdir=no
+               ac_cv_vf_hdrdir=no
+               shlib1=`echo $dir/lib/libVFlib.so* | head -1 | sed -e 's/.*\///'`
+               shlib2=`echo $dir/lib/libVFlib2.so* | head -1 | sed -e 's/.*\///'`
+               if test x$shlib1 = x; then
+                       $shlib1=no
+               fi
+               if test x$shlib2 = x; then
+                       $shlib2=no
+               fi
+               if test -d $dir/lib -a -f $dir/lib/$shlib1; then
+                       ac_cv_vf_libdir="$dir/lib"
+                       ac_cv_vf_libpath=$shlib1
+               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/$shlib2; then
+                       ac_cv_vf_libname=VFlib2
+                       ac_cv_vf_libdir="$dir/lib"
+                       ac_cv_vf_libpath=$shlib2
+               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" -o "$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:2010: 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_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat > conftest.$ac_ext <<EOF
-#line 2002 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-l$ac_cv_vf_libname  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2018 "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() {
-} $ac_kw foo() {
+VF_Init()
 ; return 0; }
 EOF
-if { (eval echo configure:2009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ac_cv_c_inline=$ac_kw; break
+  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*
-done
+LIBS="$ac_save_LIBS"
 
 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:2035: 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
+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
-  cat > conftest.$ac_ext <<EOF
-#line 2040 "configure"
+  echo "$ac_t""no" 1>&6
+echo "Fatal: $ac_cv_vf_libpath not found"
+               exit 1
+fi
+
+       cat > conftest.$ac_ext <<EOF
+#line 2052 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
+#include <VF.h>
+int main() {
+
+; return 0; }
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_pid_t=yes
+if { (eval echo configure:2059: \"$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*
-  ac_cv_type_pid_t=no
+               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:2075: 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
-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
+
+       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 \
+                   /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 for size_t""... $ac_c" 1>&6
-echo "configure:2068: 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 2073 "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 "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_size_t=yes
+if test "$mgp_use_freetype" = "yes"; then
+       echo $ac_n "checking if --enable-freetype-charset16 option specified""... $ac_c" 1>&6
+echo "configure:2113: checking if --enable-freetype-charset16 option specified" >&5
+       # Check whether --enable-freetype-charset16 or --disable-freetype-charset16 was given.
+if test "${enable_freetype_charset16+set}" = set; then
+  enableval="$enable_freetype_charset16"
+  mgp_use_freetype_c16="yes"
 else
-  rm -rf conftest*
-  ac_cv_type_size_t=no
+  mgp_use_freetype_c16="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
+       echo "$ac_t""$mgp_use_freetype_c16" 1>&6
+
+       if test "$mgp_use_freetype_c16" = "yes"; then
+               cat >> confdefs.h <<\EOF
+#define FREETYPE_CHARSET16 1
 EOF
 
+       fi
 fi
 
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2101: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+for i in /usr/pkg /usr/local /usr; do
+       if test -f $i/include/png.h; then 
+               if test -f $i/lib/libpng.a ; then
+                       DEPLIBS="$DEPLIBS $i/lib/libpng.a"
+               elif test -f $i/lib/libpng.so ; then
+                       DEPLIBS="$DEPLIBS $i/lib/libpng.so"
+               else
+                       break;
+               fi
+               LIBS="$LIBS -L$i/lib"
+               OPTFLAGS="$OPTFLAGS -I$i/include"
+               echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
+echo "configure:2144: checking for png_read_image in -lpng" >&5
+ac_lib_var=`echo png'_'png_read_image | 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
-  cat > conftest.$ac_ext <<EOF
-#line 2106 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lpng  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2152 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.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 png_read_image();
+
 int main() {
-struct tm *tp;
+png_read_image()
 ; return 0; }
 EOF
-if { (eval echo configure:2115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ac_cv_header_time=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ac_cv_header_time=no
+  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
+  LIBS="$LIBS -lpng"
+                        cat >> confdefs.h <<\EOF
+#define USE_PNG 1
+EOF
 
-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
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for png_set_gray_1_2_4_to_8 in -lpng""... $ac_c" 1>&6
+echo "configure:2186: checking for png_set_gray_1_2_4_to_8 in -lpng" >&5
+ac_lib_var=`echo png'_'png_set_gray_1_2_4_to_8 | 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="-lpng -lz $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2194 "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 png_set_gray_1_2_4_to_8();
+
+int main() {
+png_set_gray_1_2_4_to_8()
+; return 0; }
 EOF
+if { (eval echo configure:2205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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
+  LIBS="$LIBS -lpng -lz"
+                        cat >> confdefs.h <<\EOF
+#define USE_PNG 1
+EOF
 
-echo $ac_n "checking for u_int""... $ac_c" 1>&6
-echo "configure:2136: checking for u_int" >&5
-if eval "test \"`echo '$''{'ac_cv_type_u_int'+set}'`\" = set"; then
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+               break
+       fi
+done
+
+for i in /usr/pkg /usr/local /usr; do
+       if test -f $i/include/libmng.h; then 
+               if test -f $i/lib/libmng.a ; then
+                       DEPLIBS="$DEPLIBS $i/lib/libmng.a"
+               elif test -f $i/lib/libmng.so ; then
+                       DEPLIBS="$DEPLIBS $i/lib/libmng.so"
+               else
+                       break;
+               fi
+               LIBS="$LIBS -L$i/lib"
+               OPTFLAGS="$OPTFLAGS -I$i/include"
+               echo $ac_n "checking for mng_initialize in -lmng""... $ac_c" 1>&6
+echo "configure:2247: checking for mng_initialize in -lmng" >&5
+ac_lib_var=`echo mng'_'mng_initialize | 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
-  cat > conftest.$ac_ext <<EOF
-#line 2141 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lmng  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2255 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
+/* 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 mng_initialize();
+
+int main() {
+mng_initialize()
+; return 0; }
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])u_int[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+if { (eval echo configure:2266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ac_cv_type_u_int=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ac_cv_type_u_int=no
+  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
+  LIBS="$LIBS -Wl,-rpath,$i/lib -lmng"
+                        cat >> confdefs.h <<\EOF
+#define MNG 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for mng_readdisplay in -lmng""... $ac_c" 1>&6
+echo "configure:2289: checking for mng_readdisplay in -lmng" >&5
+ac_lib_var=`echo mng'_'mng_readdisplay | 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="-lmng -ljpeg $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2297 "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 mng_readdisplay();
+
+int main() {
+mng_readdisplay()
+; return 0; }
+EOF
+if { (eval echo configure:2308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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
+  LIBS="$LIBS -lmng -ljpeg"
+                        cat >> confdefs.h <<\EOF
+#define MNG 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+               break
+       fi
+done
+
+# 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:2343: 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 2405 "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:2410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+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 2479 "configure"
+#include "confdefs.h"
+
+int main() {
+${x_direct_test_function}()
+; return 0; }
+EOF
+if { (eval echo configure:2486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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_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
 
+echo $ac_n "checking if --enable-gif option specified""... $ac_c" 1>&6
+echo "configure:2573: checking if --enable-gif option specified" >&5
+# Check whether --enable-gif or --disable-gif was given.
+if test "${enable_gif+set}" = set; then
+  enableval="$enable_gif"
+  mgp_gif="yes"
+else
+  mgp_gif="no"
 fi
 
-echo $ac_n "checking for u_char""... $ac_c" 1>&6
-echo "configure:2169: checking for u_char" >&5
-if eval "test \"`echo '$''{'ac_cv_type_u_char'+set}'`\" = set"; then
+echo "$ac_t""$mgp_gif" 1>&6
+if test $mgp_gif = "yes"; then
+       echo $ac_n "checking for DGifOpenFileHandle in -lungif""... $ac_c" 1>&6
+echo "configure:2585: checking for DGifOpenFileHandle in -lungif" >&5
+ac_lib_var=`echo ungif'_'DGifOpenFileHandle | 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
-  cat > conftest.$ac_ext <<EOF
-#line 2174 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lungif  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2593 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
+/* 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 DGifOpenFileHandle();
+
+int main() {
+DGifOpenFileHandle()
+; return 0; }
 EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])u_char[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+if { (eval echo configure:2604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ac_cv_type_u_char=yes
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ac_cv_type_u_char=no
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
+LIBS="$ac_save_LIBS"
 
 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
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  gif_ok=yes
+               GIFLIB="-lungif"
+               cat >> confdefs.h <<\EOF
+#define USE_GIF 1
 EOF
 
-fi
-
-
-echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:2203: 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
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for DGifOpenFileHandle in -lgif""... $ac_c" 1>&6
+echo "configure:2628: checking for DGifOpenFileHandle in -lgif" >&5
+ac_lib_var=`echo gif'_'DGifOpenFileHandle | 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
-  cat > conftest.$ac_ext <<EOF
-#line 2211 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lgif  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2636 "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 DGifOpenFileHandle();
 
-main()
-{
-  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
-  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
-}
-
+int main() {
+DGifOpenFileHandle()
+; return 0; }
 EOF
-if { (eval echo configure:2221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  ac_cv_func_memcmp_clean=yes
+if { (eval echo configure:2647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 -fr conftest*
-  ac_cv_func_memcmp_clean=no
-fi
-rm -fr conftest*
+  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
+  gif_ok=yes
+               GIFLIB="-lgif"
+               cat >> confdefs.h <<\EOF
+#define USE_GIF 1
+EOF
 
-echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
-test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
-
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2239: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for DGifOpenFileName in -lungif""... $ac_c" 1>&6
+echo "configure:2671: checking for DGifOpenFileName in -lungif" >&5
+ac_lib_var=`echo ungif'_'DGifOpenFileName | 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
-  cat > conftest.$ac_ext <<EOF
-#line 2244 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lungif -L$x_libraries -lX11 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2679 "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
+/* 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 DGifOpenFileName();
 
 int main() {
-int i;
+DGifOpenFileName()
 ; return 0; }
 EOF
-if { (eval echo configure:2261: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  ac_cv_type_signal=void
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  ac_cv_type_signal=int
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
 
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  gif_ok=yes
+               GIFLIB="-lungif"
+               cat >> confdefs.h <<\EOF
+#define USE_GIF 1
 EOF
 
-
-for ac_func in poll strstr _setbufend
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2282: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for DGifOpenFilename in -lgif""... $ac_c" 1>&6
+echo "configure:2714: checking for DGifOpenFilename in -lgif" >&5
+ac_lib_var=`echo gif'_'DGifOpenFilename | 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
-  cat > conftest.$ac_ext <<EOF
-#line 2287 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lgif -L$x_libraries -lX11 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2722 "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();
+char DGifOpenFilename();
 
 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
-
+DGifOpenFilename()
 ; return 0; }
 EOF
-if { (eval echo configure:2310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+  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_func_$ac_func=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = 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
+  gif_ok=yes
+               GIFLIB="-lgif"
+               cat >> confdefs.h <<\EOF
+#define USE_GIF 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:2337: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+fi
+
+fi
+
+fi
+
+       if test "x$gif_ok" != "xyes"; then
+               echo 'FATAL: You need libungif to use gif images.  pass proper LIBS to configure.'
+               exit 1
+       fi
+       for i in /usr/pkg /usr/local /usr; do
+               if test -f $i/include/gif_lib.h; then
+                       gif_h_ok=yes
+                       OPTFLAGS="$OPTFLAGS -I$i/include"
+                       break
+               fi
+       done
+       if test -f /usr/include/gif_lib.h; then
+               gif_h_ok=yes
+       fi
+       if test "x$gif_h_ok" != "xyes"; then
+               echo 'FATAL: can not find gif_lib.h.  pass proper CPPFLAGS to configure.'
+               exit 1
+       fi
+fi
+
+USE_IMLIB=0
+
+echo $ac_n "checking if --enable-imlib option specified""... $ac_c" 1>&6
+echo "configure:2787: checking if --enable-imlib option specified" >&5
+# Check whether --enable-imlib or --disable-imlib was given.
+if test "${enable_imlib+set}" = set; then
+  enableval="$enable_imlib"
+  mgp_imlib="yes"
+else
+  mgp_imlib="no"
+fi
+
+echo "$ac_t""$mgp_imlib" 1>&6
+if test $mgp_imlib = "yes"; then
+       echo $ac_n "checking for Imlib_init in -lImlib""... $ac_c" 1>&6
+echo "configure:2799: checking for Imlib_init in -lImlib" >&5
+ac_lib_var=`echo Imlib'_'Imlib_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
-  cat > conftest.$ac_ext <<EOF
-#line 2342 "configure"
+  ac_save_LIBS="$LIBS"
+LIBS="-lImlib -L$x_libraries -lX11 -lXext $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2807 "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();
+char Imlib_init();
 
 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
-
+Imlib_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+  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_func_$ac_func=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = 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
+  imlib_ok=yes
+               LIBS="$LIBS -lImlib"
+               cat >> confdefs.h <<\EOF
+#define USE_IMLIB 1
 EOF
+
+               USE_IMLIB=1
 else
   echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
 fi
-done
 
+       if test "x$imlib_ok" != "xyes"; then
+               echo 'FATAL: You need libImlib to use Imlib loading.  pass proper LIBS to configure.'
+               exit 1
+       fi
+       for i in /usr/pkg /usr/local; do
+               if test -f $i/include/Imlib.h; then
+                       imlib_h_ok=yes
+                       OPTFLAGS="$OPTFLAGS -I$i/include"
+                       break
+               fi
+       done
+       if test -f /usr/include/Imlib.h; then
+               imlib_h_ok=yes
+       fi
+       if test "x$imlib_h_ok" != "xyes"; then
+               echo 'FATAL: can not find Imlib.h.  pass proper CPPFLAGS to configure.'
+               exit 1
+       fi
+fi
 
+if test -n "$GIFLIB"; then
+       LIBS="$LIBS $GIFLIB"
+fi
 
 mgp_keywords=`$mgp_cv_path_perl $srcdir/keywords.pl $srcdir/globals.c`
 
@@ -2542,6 +3018,7 @@ s%@host_alias@%$host_alias%g
 s%@host_cpu@%$host_cpu%g
 s%@host_vendor@%$host_vendor%g
 s%@host_os@%$host_os%g
+s%@CPP@%$CPP%g
 s%@AWK@%$AWK%g
 s%@YACC@%$YACC%g
 s%@LEX@%$LEX%g
@@ -2553,9 +3030,9 @@ s%@mgp_cv_path_uudecode@%$mgp_cv_path_uudecode%g
 s%@mgp_cv_path_gunzip@%$mgp_cv_path_gunzip%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_cv_vflib_a@%$mgp_cv_vflib_a%g
+s%@USE_IMLIB@%$USE_IMLIB%g
 s%@mgp_keywords@%$mgp_keywords%g
 
 CEOF
index 9a007f0..dfeb798 100644 (file)
@@ -3,7 +3,7 @@ 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.62 1999/11/28 14:35:01 nishida Exp $
+dnl $Id: configure.in,v 1.81 2001/05/22 06:09:42 nishida Exp $
 AC_INIT(image/imagetypes.c)
 
 dnl Checks for programs.
@@ -12,6 +12,7 @@ AC_CANONICAL_HOST
 dnl  AC_PROG_CC cannot be specified here, since imake may not like the
 dnl  compiler probed by AC_PROG_CC (i.e. gcc).
 dnl AC_PROG_CC
+AC_PROG_CPP
 AC_PROG_AWK
 AC_PROG_YACC
 AC_PROG_LEX
@@ -45,14 +46,6 @@ AC_ARG_ENABLE(debug,
        [mgp_debug="no"])
 AC_MSG_RESULT($mgp_debug)
 
-dnl Checks for gif support.
-AC_MSG_CHECKING(if --enable-gif option specified)
-AC_ARG_ENABLE(gif,
-       [  --enable-gif            compile gif support in.],
-       [mgp_gif="yes"; AC_DEFINE(USE_GIF)],
-       [mgp_gif="no"])
-AC_MSG_RESULT($mgp_gif)
-
 dnl Checks for locale option.
 AC_MSG_CHECKING(if --enable-locale option specified)
 AC_ARG_ENABLE(locale,
@@ -61,6 +54,25 @@ AC_ARG_ENABLE(locale,
        [mgp_locale="no"])
 AC_MSG_RESULT($mgp_locale)
 
+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 locale.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 _setbufend)
+AC_REPLACE_FUNCS(usleep strsep strdup mkstemp snprintf memcmp)
+
 dnl Checks for libraries.
 LIBS="-lm $LIBS"
 
@@ -78,7 +90,7 @@ if test "$mgp_use_freetype" = "yes"; then
                ac_cv_ft_include=no
                shlib1=`echo $dir/lib/libttf.so* | head -1 | sed -e 's/.*\///'`
                if test x$shlib1 = x; then
-                       $shlib1=no
+                       shlib1=no
                fi
                if test -d $dir/lib -a -f $dir/lib/$shlib1; then
                        ac_cv_ft_lib="$dir/lib"
@@ -109,6 +121,7 @@ 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(intl, dgettext)
        AC_CHECK_LIB(ttf, TT_Init_FreeType, [],
                [echo "Fatal: libttf.a not found"
                exit 1])
@@ -169,7 +182,7 @@ if test "$mgp_use_vflib" = "yes"; then
                        break
                fi
        done
-       if test "$ac_cv_vf_libdir" = "no" -a "$ac_cv_vf_hdrdir" = "no"; then
+       if test "$ac_cv_vf_libdir" = "no" -o "$ac_cv_vf_hdrdir" = "no"; then
                AC_MSG_RESULT(no - not using VFlib)
                mgp_use_vflib=no
        else
@@ -230,37 +243,135 @@ if test "$mgp_use_freetype" = "yes"; then
        fi
 fi
 
-for i in /usr/pkg /usr/local; do
-       if test -f $i/include/png.h -a -f $i/lib/libpng.a; then
+for i in /usr/pkg /usr/local /usr; do
+       if test -f $i/include/png.h; then 
+               if test -f $i/lib/libpng.a ; then
+                       DEPLIBS="$DEPLIBS $i/lib/libpng.a"
+               elif test -f $i/lib/libpng.so ; then
+                       DEPLIBS="$DEPLIBS $i/lib/libpng.so"
+               else
+                       break;
+               fi
+               LIBS="$LIBS -L$i/lib"
+               OPTFLAGS="$OPTFLAGS -I$i/include"
+               AC_CHECK_LIB(png, png_read_image, 
+                       [LIBS="$LIBS -lpng"
+                        AC_DEFINE(USE_PNG)], 
+               [AC_CHECK_LIB(png, png_set_gray_1_2_4_to_8,
+                       [LIBS="$LIBS -lpng -lz"
+                        AC_DEFINE(USE_PNG)],
+                       [], [-lz])])
+               break
+       fi
+done
+
+for i in /usr/pkg /usr/local /usr; do
+       if test -f $i/include/libmng.h; then 
+               if test -f $i/lib/libmng.a ; then
+                       DEPLIBS="$DEPLIBS $i/lib/libmng.a"
+               elif test -f $i/lib/libmng.so ; then
+                       DEPLIBS="$DEPLIBS $i/lib/libmng.so"
+               else
+                       break;
+               fi
                LIBS="$LIBS -L$i/lib"
                OPTFLAGS="$OPTFLAGS -I$i/include"
-               DEPLIBS="$DEPLIBS $i/lib/libpng.a"
-               AC_CHECK_LIB(png, png_write_init)
-               AC_DEFINE(USE_PNG)
+               AC_CHECK_LIB(mng, mng_initialize, 
+                       [LIBS="$LIBS -Wl,-rpath,$i/lib -lmng"
+                        AC_DEFINE(MNG)], 
+               [AC_CHECK_LIB(mng, mng_readdisplay,
+                       [LIBS="$LIBS -lmng -ljpeg"
+                        AC_DEFINE(MNG)],
+                       [], [-ljpeg])])
                break
        fi
 done
 
 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 locale.h)
+AC_MSG_CHECKING(if --enable-gif option specified)
+AC_ARG_ENABLE(gif,
+       [  --enable-gif            compile gif support in (need libungif).],
+       [mgp_gif="yes"],
+       [mgp_gif="no"])
+AC_MSG_RESULT($mgp_gif)
+if test $mgp_gif = "yes"; then
+       AC_CHECK_LIB(ungif, DGifOpenFileHandle,
+               [gif_ok=yes
+               GIFLIB="-lungif"
+               AC_DEFINE(USE_GIF)],
+       [AC_CHECK_LIB(gif, DGifOpenFileHandle,
+               [gif_ok=yes
+               GIFLIB="-lgif"
+               AC_DEFINE(USE_GIF)],
+       [AC_CHECK_LIB(ungif, DGifOpenFileName,
+               [gif_ok=yes
+               GIFLIB="-lungif"
+               AC_DEFINE(USE_GIF)],
+       [AC_CHECK_LIB(gif, DGifOpenFilename,
+               [gif_ok=yes
+               GIFLIB="-lgif"
+               AC_DEFINE(USE_GIF)], 
+               [], [-L$x_libraries -lX11])], [-L$x_libraries -lX11])])])
+       if test "x$gif_ok" != "xyes"; then
+               echo 'FATAL: You need libungif to use gif images.  pass proper LIBS to configure.'
+               exit 1
+       fi
+       for i in /usr/pkg /usr/local /usr; do
+               if test -f $i/include/gif_lib.h; then
+                       gif_h_ok=yes
+                       OPTFLAGS="$OPTFLAGS -I$i/include"
+                       break
+               fi
+       done
+       if test -f /usr/include/gif_lib.h; then
+               gif_h_ok=yes
+       fi
+       if test "x$gif_h_ok" != "xyes"; then
+               echo 'FATAL: can not find gif_lib.h.  pass proper CPPFLAGS to configure.'
+               exit 1
+       fi
+fi
 
-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)
+USE_IMLIB=0
+AC_SUBST(USE_IMLIB)
+AC_MSG_CHECKING(if --enable-imlib option specified)
+AC_ARG_ENABLE(imlib,
+       [  --enable-imlib          use imlib exclusively to load images.],
+       [mgp_imlib="yes"],
+       [mgp_imlib="no"])
+AC_MSG_RESULT($mgp_imlib)
+if test $mgp_imlib = "yes"; then
+       AC_CHECK_LIB(Imlib, Imlib_init,
+               [imlib_ok=yes
+               LIBS="$LIBS -lImlib"
+               AC_DEFINE(USE_IMLIB)
+               USE_IMLIB=1],
+               [], [-L$x_libraries -lX11 -lXext])
+       if test "x$imlib_ok" != "xyes"; then
+               echo 'FATAL: You need libImlib to use Imlib loading.  pass proper LIBS to configure.'
+               exit 1
+       fi
+       for i in /usr/pkg /usr/local; do
+               if test -f $i/include/Imlib.h; then
+                       imlib_h_ok=yes
+                       OPTFLAGS="$OPTFLAGS -I$i/include"
+                       break
+               fi
+       done
+       if test -f /usr/include/Imlib.h; then
+               imlib_h_ok=yes
+       fi
+       if test "x$imlib_h_ok" != "xyes"; then
+               echo 'FATAL: can not find Imlib.h.  pass proper CPPFLAGS to configure.'
+               exit 1
+       fi
+fi
 
-dnl Checks for library functions.
-AC_FUNC_MEMCMP
-AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(poll strstr _setbufend)
-AC_REPLACE_FUNCS(usleep strsep strdup mkstemp snprintf memcmp)
+dnl add GIFLIB to LIBS
+if test -n "$GIFLIB"; then
+       LIBS="$LIBS $GIFLIB"
+fi
 
 dnl keyword substitution.
 mgp_keywords=`$mgp_cv_path_perl $srcdir/keywords.pl $srcdir/globals.c`
index dacae5b..32d088c 100644 (file)
 ;;   2 Apr 1999 1.10  Added jumping to error line in MagicPoint file
 ;;   4 Apr 1999 1.20  Added directive completion input feature
 ;;   5 Apr 1999 1.21  Added starting MagicPoint at the current page 
+;;   9 Apr 1999 1.22  Changed mistakes in software license.
+;;   8 Dec 1999 1.30  Added syntax hilighting. Carlos Puchol (cpg@puchol.com)
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; This software 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, or (at your option)
 ;; any later version.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; This software 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.
 ;;    (autoload 'mgp-mode "mgp-mode")
 ;;    (setq mgp-options "-g 800x600")
 ;;    (setq mgp-window-height 6)
-;;
+;;    (cond 
+;;     ((= emacs-major-version 19)     ;; Emacs 19, Mule 2.3
+;;      (setq mgp-mode-hook
+;;     (function (lambda () 
+;;                 (set-file-coding-system '*iso-2022-jp*unix)))))
+;;     ((= emacs-major-version 20)     ;; Emacs 20
+;;      (setq mgp-mode-hook
+;;     (function (lambda ()
+;;                 (set-file-coding-system-for-read 'iso-2022-jp-unix))))))
+
 
 
 ;; Editting Commands:
 (defvar mgp-emph-color-normal "black"
   "The text color name for non-emphasized words, for mgp-direc-emph function.")
 
+(cond ((= emacs-major-version 19)
+       ;; Emacs 19 settings
+       (cond ((fboundp 'copy-face)
+             (require 'hilit19)
+             (hilit-set-mode-patterns
+              '(mgp-mode)
+              '(
+                ("^%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*" nil Yellow)
+                ("^#.*" nil comment)
+                ("\"" "[^\\]\"" string)
+                ("\\<\\(size\\|fore\\|back\\|bgrad\\|ccolor\\|left\\|leftfill\\|center\\|right\\|shrink\\|lcutin\\|rcutin\\|cont\\|nodefault\\|xfont\\|vfont\\|tfont\\|tfont0\\|bar\\|image\\|prefix\\|icon\\|bimage\\|default\\|tab\\|tabprefix\\|page\\|vgap\\|hgap\\|pause\\|mark\\|again\\|system\\|xsystem\\|filter\\|endfilter\\|vfcap\\|tfdir\\|deffont\\|font\\|embed\\|endembed\\|noop\\|linestart\\|lineend\\|quality\\)\\>" nil keyword)
+                ("^%.*" nil defun)
+                ))))))
 
 
 ;; History
index a25fb35..08da624 100644 (file)
@@ -1,10 +1,9 @@
 #
-# $Id: Makefile.in,v 1.2 1998/08/23 04:50:14 itojun Exp $
+# $Id: Makefile.in,v 1.3 2000/01/31 05:04:30 itojun Exp $
 #
 
 srcdir=        @srcdir@
-SRCS=  main.c uucplock.c
-OBJS=  main.o uucplock.o
+OBJS=  main.o @LIBOBJS@
 CFLAGS=        @DEFS@ @X_CFLAGS@
 LDFLAGS=@LDFLAGS@
 LIBS=  @LIBS@
index 47672e3..dcd23a1 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -51,6 +51,7 @@ mandir='${prefix}/man'
 # Initialize some other variables.
 subdirs=
 MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
 # Maximum number of lines to put in a shell here document.
 ac_max_here_lines=12
 
@@ -334,7 +335,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -504,9 +505,11 @@ 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'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 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
@@ -524,15 +527,16 @@ 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
+echo "configure:531: 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
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -553,16 +557,17 @@ 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
+echo "configure:561: 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}:"
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; 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
@@ -597,25 +602,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:612: 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=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      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
+ ;;
+    esac
+  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
+echo "configure:644: 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'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 615 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 655 "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
+if { (eval echo configure:660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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
@@ -629,18 +670,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 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 "configure:686: 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
+echo "configure:691: 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
@@ -649,7 +696,7 @@ else
   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
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:700: \"$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
@@ -660,11 +707,15 @@ 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
+else
+  GCC=
+fi
+
+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:719: 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
@@ -679,16 +730,20 @@ 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
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
 
 ac_aux_dir=
@@ -717,28 +772,30 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # 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
+echo "configure:781: 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}:"
+    IFS="${IFS=        }"; ac_save_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
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall 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"
@@ -768,11 +825,13 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 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
+echo "configure:835: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -787,14 +846,14 @@ else
   # 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"
+#line 850 "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`
+{ (eval echo configure:856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -804,14 +863,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 808 "configure"
+#line 867 "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:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+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} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 884 "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`
+{ (eval echo configure:890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -824,6 +900,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -837,7 +915,7 @@ echo "$ac_t""$CPP" 1>&6
 # 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
+echo "configure:919: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -899,13 +977,13 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 903 "configure"
+#line 981 "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`
+{ (eval echo configure:986: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   # We can compile using X headers with no special include directory.
@@ -973,14 +1051,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 977 "configure"
+#line 1055 "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
+if { (eval echo configure:1062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -1086,17 +1164,17 @@ else
     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
+echo "configure:1168: 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"
+#line 1171 "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
+if { (eval echo configure:1178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -1112,14 +1190,14 @@ rm -f conftest*
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat > conftest.$ac_ext <<EOF
-#line 1116 "configure"
+#line 1194 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -1151,7 +1229,7 @@ rm -f conftest*
     # libraries were built with DECnet support.  And karl@cs.umb.edu says
     # the Alpha needs dnet_stub (dnet does not exist).
     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:1155: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:1233: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1159,7 +1237,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1163 "configure"
+#line 1241 "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
@@ -1170,7 +1248,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:1174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1192,7 +1270,7 @@ fi
 
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:1196: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:1274: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1200,7 +1278,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1204 "configure"
+#line 1282 "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
@@ -1211,7 +1289,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:1215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1240,12 +1318,12 @@ fi
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1244: checking for gethostbyname" >&5
+echo "configure:1322: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1249 "configure"
+#line 1327 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -1268,7 +1346,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -1289,7 +1367,7 @@ fi
 
     if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:1293: checking for gethostbyname in -lnsl" >&5
+echo "configure:1371: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1297,7 +1375,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1301 "configure"
+#line 1379 "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
@@ -1308,7 +1386,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:1312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1338,12 +1416,12 @@ fi
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:1342: checking for connect" >&5
+echo "configure:1420: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1347 "configure"
+#line 1425 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -1366,7 +1444,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -1387,7 +1465,7 @@ fi
 
     if test $ac_cv_func_connect = no; then
       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:1391: checking for connect in -lsocket" >&5
+echo "configure:1469: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1395,7 +1473,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1399 "configure"
+#line 1477 "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
@@ -1406,7 +1484,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1430,12 +1508,12 @@ fi
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:1434: checking for remove" >&5
+echo "configure:1512: checking for remove" >&5
 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1439 "configure"
+#line 1517 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -1458,7 +1536,7 @@ remove();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -1479,7 +1557,7 @@ fi
 
     if test $ac_cv_func_remove = no; then
       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:1483: checking for remove in -lposix" >&5
+echo "configure:1561: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1487,7 +1565,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1491 "configure"
+#line 1569 "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
@@ -1498,7 +1576,7 @@ int main() {
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:1502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1522,12 +1600,12 @@ fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:1526: checking for shmat" >&5
+echo "configure:1604: checking for shmat" >&5
 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1531 "configure"
+#line 1609 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -1550,7 +1628,7 @@ shmat();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -1571,7 +1649,7 @@ fi
 
     if test $ac_cv_func_shmat = no; then
       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:1575: checking for shmat in -lipc" >&5
+echo "configure:1653: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1579,7 +1657,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1583 "configure"
+#line 1661 "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
@@ -1590,7 +1668,7 @@ int main() {
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:1594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1623,15 +1701,15 @@ fi
   # libraries we check for below, so use a different variable.
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:1627: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:1705: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | 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="-lICE  $LIBS"
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1635 "configure"
+#line 1713 "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
@@ -1642,7 +1720,7 @@ int main() {
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:1646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1669,7 +1747,7 @@ fi
 CFLAGS="$CFLAGS $X_CFLAGS"
 LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
 echo $ac_n "checking for XextAddDisplay in -lXext""... $ac_c" 1>&6
-echo "configure:1673: checking for XextAddDisplay in -lXext" >&5
+echo "configure:1751: checking for XextAddDisplay in -lXext" >&5
 ac_lib_var=`echo Xext'_'XextAddDisplay | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1677,7 +1755,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXext  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1681 "configure"
+#line 1759 "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
@@ -1688,7 +1766,7 @@ int main() {
 XextAddDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:1692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1716,7 +1794,7 @@ else
 fi
 
 echo $ac_n "checking for XTestFakeKeyEvent in -lXtst""... $ac_c" 1>&6
-echo "configure:1720: checking for XTestFakeKeyEvent in -lXtst" >&5
+echo "configure:1798: checking for XTestFakeKeyEvent in -lXtst" >&5
 ac_lib_var=`echo Xtst'_'XTestFakeKeyEvent | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1724,7 +1802,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXtst  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1728 "configure"
+#line 1806 "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
@@ -1735,7 +1813,7 @@ int main() {
 XTestFakeKeyEvent()
 ; return 0; }
 EOF
-if { (eval echo configure:1739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1763,22 +1841,127 @@ else
 fi
 
 
+echo $ac_n "checking for uu_lock in -lutil""... $ac_c" 1>&6
+echo "configure:1846: checking for uu_lock in -lutil" >&5
+ac_lib_var=`echo util'_'uu_lock | 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="-lutil  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1854 "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 uu_lock();
+
+int main() {
+uu_lock()
+; return 0; }
+EOF
+if { (eval echo configure:1865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 util | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lutil $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+for ac_func in uu_lock
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1896: 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 1901 "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:1924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 uucplock.o"
+fi
+done
+
+
 for ac_hdr in fcntl.h paths.h sys/file.h sys/time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1771: checking for $ac_hdr" >&5
+echo "configure:1954: 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 1776 "configure"
+#line 1959 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1805,12 +1988,12 @@ done
 
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1809: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1992: 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 1814 "configure"
+#line 1997 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1819,7 +2002,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -1840,12 +2023,12 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1844: checking for ANSI C header files" >&5
+echo "configure:2027: 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 1849 "configure"
+#line 2032 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1853,8 +2036,8 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   ac_cv_header_stdc=yes
@@ -1870,7 +2053,7 @@ 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 1874 "configure"
+#line 2057 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1888,7 +2071,7 @@ 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 1892 "configure"
+#line 2075 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1909,7 +2092,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1913 "configure"
+#line 2096 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1920,7 +2103,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1944,12 +2127,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1948: checking for off_t" >&5
+echo "configure:2131: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1953 "configure"
+#line 2136 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1958,7 +2141,7 @@ else
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_off_t=yes
 else
@@ -1977,12 +2160,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:1981: checking for uid_t in sys/types.h" >&5
+echo "configure:2164: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1986 "configure"
+#line 2169 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -2012,12 +2195,12 @@ fi
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2016: checking return type of signal handlers" >&5
+echo "configure:2199: 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 2021 "configure"
+#line 2204 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -2034,7 +2217,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:2038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -2055,12 +2238,12 @@ EOF
 for ac_func in select setreuid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2059: checking for $ac_func" >&5
+echo "configure:2242: 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 2064 "configure"
+#line 2247 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2083,7 +2266,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2131,7 +2314,7 @@ EOF
 # 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
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -2210,7 +2393,7 @@ do
     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"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -2230,9 +2413,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
 $ac_vpsub
 $extrasub
+s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -2253,12 +2438,14 @@ s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
 s%@CC@%$CC%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@CPP@%$CPP%g
 s%@X_CFLAGS@%$X_CFLAGS%g
 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
 s%@X_LIBS@%$X_LIBS%g
 s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
+s%@LIBOBJS@%$LIBOBJS%g
 
 CEOF
 EOF
index 9c8ce07..6a386bf 100644 (file)
@@ -12,6 +12,11 @@ LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
 AC_CHECK_LIB(Xext, XextAddDisplay)
 AC_CHECK_LIB(Xtst, XTestFakeKeyEvent)
 
+dnl freebsd
+AC_CHECK_LIB(util, uu_lock)
+AC_SUBST(LIBOBJS)
+AC_CHECK_FUNCS(uu_lock, [], [LIBOBJS="$LIBOBJS uucplock.o"])
+
 dnl Checks for header files.
 AC_CHECK_HEADERS(fcntl.h paths.h sys/file.h sys/time.h unistd.h)
 
diff --git a/draw.c b/draw.c
index 883473f..ffffcfb 100644 (file)
--- a/draw.c
+++ b/draw.c
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.160 1999/12/05 17:28:39 nishida Exp $
+ * $Id: draw.c,v 1.191 2001/09/17 14:48:29 nishida Exp $
  */
 
 #include "mgp.h"
 
 /* state associated with the window - how should we treat this? */
-static struct ctrl *bg_ctl, *bg_ctl_last;
+static struct ctrl *bg_ctl, *bg_ctl_last, *bg_ctl_cache;
 static int bgindex = 0;
 struct render_state cache_state;
 
@@ -75,7 +75,7 @@ static void shrink __P((char *, u_int));
 #endif
 
 static void draw_string __P((struct render_state *, char *));
-static void draw_fragment __P((struct render_state *, u_char *, u_int, char *, int));
+static char *draw_fragment __P((struct render_state *, u_char *, u_int, char *, int));
 static int iskinsokuchar __P((u_int));
 static struct render_object *obj_alloc __P((struct render_state *state));
 static void obj_free __P((struct render_state *, struct render_object *));
@@ -118,18 +118,21 @@ static void x_registerseed __P((struct render_state *, char *, char *));
 static char *x_findseed __P((struct render_state *, char *));
 
 static void XClearPixmap __P((Display *, Drawable));
-static void XSetPixmapBackgroundPixmap __P((Display *, Drawable, Pixmap, 
-       int, int));
-static void XSetPixmapBackground __P((Display *, Drawable, u_long));
 static void cache_page __P((struct render_state *, int));
 static void cache_effect1 __P((void));
 static void cache_effect2 __P((void));
 static void set_from_cache __P((struct render_state *));
 static void pcache_process __P((int));
-static void regist_bgcache __P((XImageInfo *, Image *));
-static int check_bgcache __P((void));
-static int regist_bgpixmap __P((void));
-static void set_bgwindow __P((struct ctrl *));
+static void predraw __P((struct render_state *));
+static void set_background_pixmap __P((struct ctrl *));
+static void get_background_pixmap __P((struct ctrl *, struct render_state *));
+static void regist_background_pixmap __P((XImageInfo *, Image *));
+#ifdef MNG
+static void process_anim __P((struct render_state *, struct ctrl *));
+static void obj_draw_anim __P((struct render_state *, 
+       u_int, u_int, struct render_object *));
+#endif
+static int valign = VL_BOTTOM;
 
 #define CHECK_CACHE {if (caching){caching = -1; return;}}
 
@@ -163,12 +166,17 @@ state_goto(state, page, repaint)
        if (!repaint)
                purgechild(state->page);
 
-       free_alloc_colors(&image_clr);
-       free_alloc_colors(&font_clr);
        state->page = page;
        state->line = 0;
        state->cp = NULL;
        state->phase = P_NONE;
+       free_alloc_colors(&image_clr);
+       free_alloc_colors(&font_clr);
+
+#ifdef COLOR_BUGFIX
+       colormap = XCopyColormapAndFree(display, colormap);
+#endif
+       predraw(state);
 }
 
 void
@@ -252,6 +260,13 @@ state_newpage(state)
 {
        state->ypos = 0;
        state->have_mark = 0;
+       free_alloc_colors(&image_clr);
+       free_alloc_colors(&font_clr);
+
+#ifdef COLOR_BUGFIX
+       colormap = XCopyColormapAndFree(display, colormap);
+#endif
+       predraw(state);
 }
 
 /*
@@ -411,6 +426,10 @@ draw_one(state, e)
                remapchild();
                /* always cache next page */
                if ((mgp_flag & FL_FRDCACHE) && cache_mode){
+#if 1/*ONOE*/
+                       if (XCheckMaskEvent(display, emask, e) == True) 
+                               goto got_event;
+#endif
                        cache_page(&cache_state, state->page +1);
                        /* check if we got some events during caching */
                        if (XCheckMaskEvent(display, emask, e) == True) 
@@ -496,6 +515,12 @@ process_direc(state, seenpause)
                break;
 
        case CTL_BACK:
+               if (state->line){
+                       fprintf(stderr, 
+                               "warning: %%back directive should be put in the first line of the page. ignored.\n");
+                       break;
+               }
+               back_color[caching] = cp->ctl_value;
                bg_ctl = cp;    /*update later*/
                break;
 
@@ -530,11 +555,11 @@ process_direc(state, seenpause)
 
 #ifdef FREETYPE
        case CTL_TFONT:
-               tfc_setfont(cp->ctc_value, 0);
+               tfc_setfont(cp->ctc2_value1, 0, cp->ctc2_value2);
                break;
 
        case CTL_TMFONT:
-               tfc_setfont(cp->ctc_value, 1);
+               tfc_setfont(cp->ctc_value, 1, NULL);
                break;
 
 #endif /*FREETYPE*/
@@ -564,6 +589,7 @@ process_direc(state, seenpause)
                                cp->ctm_ximagesize, cp->ctm_yimagesize, 0,
                                cp->ctm_zoomflag, 0);
                }
+               state->brankline = 0;
            }
                break;
 
@@ -598,10 +624,18 @@ process_direc(state, seenpause)
                state->curprefix = cp->ctc_value;
                break;
 
+       case CTL_PREFIXN:
+               state->xprefix = state->width * cp->ctf_value / 100;
+               break;
+
        case CTL_TABPREFIX:
                state->tabprefix = cp->ctc_value;
                break;
 
+       case CTL_TABPREFIXN:
+               state->tabxprefix = state->width * cp->ctf_value / 100;
+               break;
+
        case CTL_PREFIXPOS:
            {
                char *p;
@@ -625,42 +659,38 @@ process_direc(state, seenpause)
 
        case CTL_LINESTART:
                if (state->line == 0) {
+                       /*
+                        * set background of target 
+                        */
                        if (bg_ctl) {
-                               if (check_bgcache()){
-                                       if (!caching)  set_bgwindow(bg_ctl);
-                                       ; /* same as the last time */
-                               } else if (bg_ctl->ct_op == CTL_BIMAGE) {
-                                   image_load(state, bg_ctl->ctm_fname,
-                                       bg_ctl->ctm_numcolor,
-                                       bg_ctl->ctm_ximagesize,
-                                       bg_ctl->ctm_yimagesize, 1,
-                                       bg_ctl->ctm_zoomflag, 0);
-                               } else if (bg_ctl->ct_op == CTL_BGRAD) {
-                                       back_gradation(state,
-                                               &bg_ctl->ct_val.ctrl_grad);
-                               } else if (bg_ctl->ct_op == CTL_BACK) {
-                                       if (!caching){
-                                               bg_ctl_last = bg_ctl;
-                                               XSetWindowBackground(display,
-                                                       state->target, bg_ctl->ctl_value);
+                               if (!caching){
+                                       /* target is window, so we need care bg_ctl_last */
+                                       if (bg_ctl_last && !ctlcmp(bg_ctl, bg_ctl_last)){
+                                               /* same as last time, we do nothing  */
+                                               ;
                                        } else {
-                                               XSetPixmapBackground(display,
-                                                       state->target, bg_ctl->ctl_value);
+                                               /* we have to change background */
+                                               get_background_pixmap(bg_ctl, state);
+
+                                               /* set window background */
+                                               set_background_pixmap(bg_ctl);
+
+                                               bg_ctl_last = bg_ctl;
                                        }
-                                       back_color[caching] = bg_ctl->ctl_value;
+                                       XClearWindow(display, state->target);
                                } else {
-                                       fprintf(stderr, "internal error: "
-                                               "bogus background\n");
-                                       cleanup(-1);
+                                       get_background_pixmap(bg_ctl, state);
+                                       bg_ctl_cache = bg_ctl;
+
+                                       XClearPixmap(display, state->target);
                                }
+                       } else {
+                               if (!caching)
+                                       XClearWindow(display, state->target);
+                               else
+                                       XClearPixmap(display, state->target);
                        }
 
-                       if (!caching) { 
-                               XClearWindow(display, state->target);
-                               bg_ctl_last = bg_ctl;
-                       } else 
-                               XClearPixmap(display, state->target);
-
                        if (t_fin)
                                timebar(state);
                }
@@ -669,13 +699,14 @@ process_direc(state, seenpause)
 
        case CTL_LINEEND:
                /* blank lines */
-               if (state->maxascent + state->maxdescent < 3) { /*XXX*/
+               if (state->brankline) { /*XXX*/
                        state->maxascent = char_size[caching];
                        state->maxdescent = VERT_GAP(char_size[caching]);
                }
                draw_line_end(state);
                /* reset single-line oriented state */
                state->tabprefix = NULL;
+               state->tabxprefix = 0;
                state->special = 0;
                if (state->align == AL_LEFTFILL1) {
                        state->align = AL_LEFTFILL0;
@@ -752,6 +783,37 @@ process_direc(state, seenpause)
                }
                break;
 
+       case CTL_CHARSET:
+               if (get_regid(cp->ctc_value) < 0){
+                       fprintf(stderr, "invalid charset \"%s\". ignored\n", 
+                               cp->ctc_value);
+                       break;
+               }
+               strcpy(mgp_charset, cp->ctc_value);
+               break;
+
+#ifdef MNG
+       case CTL_ANIM:
+               if (state->align == AL_LEFTFILL0) {
+                       state->align = AL_LEFTFILL1;
+                       state->leftfillpos = state->linewidth;
+               }
+               process_anim(state, cp);
+               break;
+#endif
+
+       case CTL_VALIGN:
+               valign = cp->cti_value;
+               break;
+
+       case CTL_AREA:
+               state->width = window_width * cp->ctar_width / 100;
+               state->height = window_height * cp->ctar_height / 100;
+               state->xoff = window_width * cp->ctar_xoff / 100;
+               state->yoff = window_height * cp->ctar_yoff / 100;
+               state->ypos = 0;
+               break;
+
        default:
                fprintf(stderr,
                        "undefined directive %d at page %d line %d:\n\t",
@@ -799,6 +861,7 @@ draw_line_start(state)
        state->maxascent = 0;
        state->maxdescent = 0;
        state->linewidth = 0;
+       state->brankline = 1;
        while ((obj = state->obj))
                obj_free(state, obj);
 }
@@ -855,10 +918,15 @@ draw_line_end(state)
        }
 
        state->ypos += state->maxascent;
-       if (VERT_GAP(state->maxascent) < state->maxdescent)
+
+       /* 
+        * we should ignore height of images to calculate line gap.
+        * suggested by Toru Terao 
+        */ 
+       if (VERT_GAP(char_size[caching]) < state->maxdescent)
                state->ypos += state->maxdescent;
        else
-               state->ypos += VERT_GAP(state->maxascent);
+               state->ypos += VERT_GAP(char_size[caching]);
        state->ypos += 2;
 }
 
@@ -869,7 +937,7 @@ cutin(state, lx, ly, dir)
        int ly;
        int dir;
 {
-       u_int step, x;
+       u_int step, x, xoff, yoff;
        int i;
        int sx;
        int round;
@@ -899,6 +967,9 @@ cutin(state, lx, ly, dir)
        XSetWindowBackgroundPixmap(display, cutinWin, None);
        XMapSubwindows(display, state->target);
 
+       xoff = state->xoff;     
+       yoff = state->yoff;     
+       state->xoff = state->yoff = 0;
        if (state->obj) {
                obj_draw(state, cutinWin, 0, 0);
        }
@@ -906,13 +977,15 @@ cutin(state, lx, ly, dir)
 
        x = sx;
        for (i = 0; i < round; i++) {
-               XMoveWindow(display, cutinWin, x, ly);
+               XMoveWindow(display, cutinWin, x + xoff, ly + yoff);
                XFlush(display);
                usleep(CUTIN_DELAY);
                x += step;
        }
 
        XDestroyWindow(display, cutinWin);
+       state->xoff = xoff;     
+       state->yoff = yoff;     
 }
 
 #if 0
@@ -976,10 +1049,23 @@ draw_string(state, data)
        };
 #define RTAB96_MAX     (sizeof(rtab96)/sizeof(rtab96[0]))
        static char *rtab9494[] = {
-               "jisx0208.1983-*",      /* ESC $ @ or ESC $ ( @ */
+               "jisx0208.1978-*",      /* ESC $ @ or ESC $ ( @ */
                "gb2312.1980-*",        /* ESC $ A or ESC $ ( A */
                "jisx0208.1983-*",      /* ESC $ B or ESC $ ( B */
                "ksc5601.1987-*",       /* ESC $ ( C */
+               NULL,                   /* D */
+               NULL,                   /* E */
+               NULL,                   /* F */
+               NULL,                   /* G */
+               NULL,                   /* H */
+               NULL,                   /* I */
+               NULL,                   /* J */
+               NULL,                   /* K */
+               NULL,                   /* L */
+               NULL,                   /* M */
+               NULL,                   /* N */
+               "jisx0213.2000-1",      /* ESC $ ( O */
+               "jisx0213.2000-2",      /* ESC $ ( P */
        };
 #define RTAB9494_MAX   (sizeof(rtab9494)/sizeof(rtab9494[0]))
        int charset16 = 0;
@@ -1054,13 +1140,13 @@ draw_string(state, data)
                        }
                }
 
-               draw_fragment(state, p, q - p, registry, charset16);
+               q = draw_fragment(state, p, q - p, registry, charset16);
 
                p = q;
        }
 }
 
-static void
+static char *
 draw_fragment(state, p, len, registry, charset16)
        struct render_state *state;
        u_char *p;
@@ -1068,7 +1154,7 @@ draw_fragment(state, p, len, registry, charset16)
        char *registry;
        int charset16;  /*2-octet charset?*/
 {
-       u_int char_len;
+       u_int char_len, i;
        u_short code;
        struct render_object *tail;
        struct render_object *thisline;
@@ -1086,6 +1172,8 @@ draw_fragment(state, p, len, registry, charset16)
 
        while (len) {
                code = charset16 ? p[0] * 256 + p[1] : p[0];
+               if (code != ' ') 
+                       state->brankline = 0; /* This isn't brankline */
 
 #if 0
                if (code == ' ') {
@@ -1127,7 +1215,8 @@ draw_fragment(state, p, len, registry, charset16)
 #endif
 #ifdef FREETYPE_CHARSET16
                        if (!(mgp_flag & FL_NOFREETYPE)
-                        && strncmp(registry, "jisx0208.1983-", 14) == 0) {
+                        && (strncmp(registry, "jisx0208.1983-", 14) == 0 ||
+                            strncmp(registry, "jisx0213.2000-", 14) == 0)) {
                                if (tfc_get(code, char_size[caching], 1, registry,
                                                charset16)){
                                        mode = MODE_FREETYPE;
@@ -1205,7 +1294,6 @@ draw_fragment(state, p, len, registry, charset16)
                        /* fall through */
                case MODE_UNKNOWN:
                case MODE_X:
-break;
                        char_len = draw_onechar_x(state, code,
                                state->linewidth, 0, char_size[caching],
                                registry, (len == (charset16 ? 2 : 1)) ? 1 : 0);
@@ -1214,7 +1302,7 @@ break;
                                        "(nor font in similar size) for "
                                        "font <%s:%d:%s>, glyph 0x%04x\n",
                                        char_size[caching], x_findseed(state, registry),
-                                       char_size[caching], registry, code);
+                                       char_size[caching], registry?registry:"NULL", code);
                        }
                        break;
                }
@@ -1223,6 +1311,15 @@ break;
                len -= (charset16 ? 2 : 1);
 
                state->linewidth += HORIZ_STEP(char_size[caching], char_len);
+               /* ukai */
+               if (!charset16 && state->linewidth + HORIZ_STEP(char_size[caching], 
+                               char_len) > state->width) {
+                       if (len >= 20) break; /* too long word */
+                       for (i = 0; i < len; i ++){
+                               if (isspace(*(p +i))) break;    
+                       }
+                       if (i == len) break;
+               }
        }
 
        if (state->width - state->leftfillpos / 2 < state->linewidth
@@ -1271,6 +1368,7 @@ break;
                        draw_line_itemsize(state, tail->ascent, tail->descent);
                }
        }
+       return p;
 }
 
 static int
@@ -1343,6 +1441,10 @@ obj_free(state, obj)
                if (obj->data.icon.xpoint)
                        free(obj->data.icon.xpoint);
                break;
+#ifdef MNG
+       case O_ANIM:
+               break;
+#endif /* MNG */
        }
        free(obj);
 }
@@ -1611,8 +1713,8 @@ obj_image_trans(image, x, y)
                bw = bh = 0;    /* for lint */
                goto end;
        }
-       bh = bgcache[bgindex].image->height;
-       bw = bgcache[bgindex].image->width;
+       bh = bgpixmap[bgindex].image->height;
+       bw = bgpixmap[bgindex].image->width;
        j = 0;
        if (image->type == IBITMAP) {
   expand:
@@ -1625,7 +1727,7 @@ obj_image_trans(image, x, y)
        }
        pl = image->pixlen;
        p = image->data + image->width * j * pl;
-       bpl = bgcache[bgindex].image->pixlen;
+       bpl = bgpixmap[bgindex].image->pixlen;
        pd = -1;
        n = 0;  /* for lint */
        trans = image->trans;
@@ -1633,19 +1735,21 @@ obj_image_trans(image, x, y)
        for ( ; j < image->height; j++) {
                by = (y + j) % bh;
                bx = x % bw;
-               b = bgcache[bgindex].image->data + (bgcache[bgindex].image->width * by + bx) * bpl;
+               b = bgpixmap[bgindex].image->data + 
+                       (bgpixmap[bgindex].image->width * by + bx) * bpl;
                for (i = 0; i < image->width; i++, p += pl, b += bpl, bx++) {
                        if (bx == bw) {
                                bx = 0;
-                               b = bgcache[bgindex].image->data + 
-                                       bgcache[bgindex].image->width * by * bpl;
+                               b = bgpixmap[bgindex].image->data + 
+                                       bgpixmap[bgindex].image->width * by * bpl;
                        }
                        if (memToVal(p, pl) != trans)
                                continue;
                        d = memToVal(b, bpl);
                        if (d != pd) {
                                pd = d;
-                               n = obj_image_color(image, bgcache[bgindex].image, d, &inithist);
+                               n = obj_image_color(image, 
+                                               bgpixmap[bgindex].image, d, &inithist);
                                if (n == -1)
                                        goto expand;
                        }
@@ -1667,7 +1771,7 @@ obj_image_trans(image, x, y)
                fprintf(stderr, "  image=%dx%d+%d+%d",
                        image->width, image->height, x, y);
                if (COMPLEX_BGIMAGE)
-                       fprintf(stderr, "  bgcache[bgindex].image=%dx%d", bw, bh);
+                       fprintf(stderr, "  bgpixmap[bgindex].image=%dx%d", bw, bh);
                fprintf(stderr, "\n");
        }
        image->trans = -1;      /* XXX: need recalculation to redraw? */
@@ -1740,7 +1844,7 @@ obj_draw(state, target, xpos, ypos)
        }\
        drawarea[areaindex].x = x;\
        drawarea[areaindex].y = y - obj->data.X->ascent;\
-       drawarea[areaindex].width = obj->data.X->charlen+1;\
+       drawarea[areaindex].width = obj->data.X->xmax+1;\
        drawarea[areaindex].height = obj->data.X->height+1;\
        areaindex ++;\
 }
@@ -1761,10 +1865,13 @@ obj_draw(state, target, xpos, ypos)
         *                      leftmost and uppermost dot.
         *      state->ypos     absolute y position in main window.
         */
+       xpos += state->tabxprefix ? state->tabxprefix : state->xprefix;
        width = (state->linewidth <= state->width - xpos)
                        ? state->linewidth
                        : state->width - xpos;
        height = state->maxascent + state->maxdescent + 1;
+       xpos += state->xoff;
+       ypos += state->yoff;
        fore = fore_color[caching];
 
 #ifdef RASTERLIB
@@ -1798,31 +1905,31 @@ obj_draw(state, target, xpos, ypos)
                        int bpl;
                        XColor col;
 
-                       bim = bgcache[bgindex].ximageinfo->ximage;
+                       bim = bgpixmap[bgindex].ximageinfo->ximage;
                        bw = bim->width;
                        bh = bim->height;
                        ox = xpos;
-                       oy = state->ypos;
+                       oy = state->ypos + state->yoff;
                        bcolor = (u_long)-1; /* tell vfc_image() to calculate */
                        by = oy % bh;
                        if (bw == 1) {
                                r = g = b = 0;
-                               bpl = bgcache[bgindex].image->pixlen;
-                               bp = bgcache[bgindex].image->data + by * bpl;
+                               bpl = bgpixmap[bgindex].image->pixlen;
+                               bp = bgpixmap[bgindex].image->data + by * bpl;
                                for (y = 0;
                                     y < height;
                                     y++, by++, bp += bpl) {
                                        if (by == bh)
                                                by = 0;
                                        p = memToVal(bp, bpl);
-                                       if (TRUEP(bgcache[bgindex].image)) {
+                                       if (TRUEP(bgpixmap[bgindex].image)) {
                                                r += TRUE_RED(p) << 8;
                                                g += TRUE_GREEN(p) << 8;
                                                b += TRUE_BLUE(p) << 8;
                                        } else {
-                                               r += bgcache[bgindex].image->rgb.red[p];
-                                               g += bgcache[bgindex].image->rgb.green[p];
-                                               b += bgcache[bgindex].image->rgb.blue[p];
+                                               r += bgpixmap[bgindex].image->rgb.red[p];
+                                               g += bgpixmap[bgindex].image->rgb.green[p];
+                                               b += bgpixmap[bgindex].image->rgb.blue[p];
                                        }
                                        p = XGetPixel(bim, 0, by);
                                        for (x = 0; x < width; x++)
@@ -1841,7 +1948,7 @@ obj_draw(state, target, xpos, ypos)
 #if 0
                        fprintf(stderr, "bim=%dx%d, r=%x, g=%x, b=%x, "
                                "bcolor=%x\n",
-                               bgcache[bgindex].image->width, bgcache[bgindex].image->height,
+                               bgpixmap[bgindex].image->width, bgpixmap[bgindex].image->height,
                                col.red, col.green, col.blue, bcolor);
 #endif
                        } else {
@@ -1905,18 +2012,20 @@ obj_draw(state, target, xpos, ypos)
 #endif
                XDestroyImage(xim);
                if (mgp_flag & FL_GLYPHEDGE) {
-                       XDrawLine(display, target, gcfore, 0, ypos,
-                               state->width - 1, ypos);
+                       XDrawLine(display, target, gcfore, state->xoff, ypos,
+                               state->xoff + state->width - 1, ypos);
                        XDrawLine(display, target, gcfore,
-                               0, ypos + state->maxascent,
-                               state->width - 1, ypos + state->maxascent);
+                               state->xoff, ypos + state->maxascent,
+                               state->xoff + state->width - 1,
+                               ypos + state->maxascent);
                        XDrawLine(display, target, gcgreen,
-                               0, ypos + state->maxascent + state->maxdescent,
-                               state->width - 1,
+                               state->xoff,
+                               ypos + state->maxascent + state->maxdescent,
+                               state->xoff + state->width - 1,
                                ypos + state->maxascent + state->maxdescent);
                        XDrawLine(display, target, gcred,
-                               0, ypos + height,
-                               state->width - 1, ypos + height);
+                               state->xoff, ypos + height,
+                               state->xoff + state->width - 1, ypos + height);
                }
 
        }
@@ -1947,6 +2056,11 @@ obj_draw(state, target, xpos, ypos)
                y += ypos;
 #endif
                switch (obj->type) {
+#ifdef MNG
+               case O_ANIM:
+                       obj_draw_anim(state, x, y, obj);
+                       break;
+#endif MNG /* MNG */
                case O_IMAGE:
                        obj_draw_image(target, x, y, obj);
                        break;
@@ -2210,7 +2324,7 @@ x_setfont(xfont, csize, registry, truescalable)
 
        if (verbose) {
                fprintf(stderr, "need font <%s:%d:%s>\n",
-                       xfont, csize, registry);
+                       xfont, csize, registry?registry:"NULL");
        }
 
        /*
@@ -2363,12 +2477,12 @@ x_setfont(xfont, csize, registry, truescalable)
 }
 
 static u_int
-draw_onechar_x(state, code, x, y, size, registry, lastchar)
+draw_onechar_x(state, code, x, y, size, argregistry, lastchar)
        struct render_state *state;
        u_int code;
        int x, y;
        int size;
-       char *registry;
+       char *argregistry;
        int lastchar;
 {
        u_int charlen;
@@ -2377,9 +2491,15 @@ draw_onechar_x(state, code, x, y, size, registry, lastchar)
        XCharStruct *cs;
        char *metricsource;
        char *seed;
+       char *registry;
 
+       if (code >= 0xa0 && ((!argregistry || !argregistry[0]) && mgp_charset))
+               registry = mgp_charset;
+       else 
+               registry = argregistry;
        seed = x_findseed(state, registry);
        xfontstruct = x_setfont(seed, char_size[caching], registry, NULL);
+
        if (xfontstruct == NULL)
                return 0;
 
@@ -2411,7 +2531,7 @@ draw_onechar_x(state, code, x, y, size, registry, lastchar)
                        fprintf(stderr, "X11 font %s:%d:%s has bogus "
                                "font metric for glyph 0x%04x\n"
                                "\tcs->width=%d, source=%s, coffset=0x%04x\n",
-                               seed, char_size, registry,
+                               seed, char_size, registry?registry:"NULL",
                                code, cs->width, metricsource, coffset);
                }
                cs = &xfontstruct->max_bounds;
@@ -2491,8 +2611,8 @@ back_gradation(state, cg0)
                int t;
                int i;
 
-               dstwidth = state->width * cg->ct_width / 100;
-               dstheight = state->height * cg->ct_height / 100;
+               dstwidth = window_width * cg->ct_width / 100;
+               dstheight = window_height * cg->ct_height / 100;
                srcwidth = dstwidth;
                srcheight = dstheight;
 
@@ -2517,8 +2637,8 @@ back_gradation(state, cg0)
                srcheight = t;
 #undef TOOSMALLFACTOR
        } else {
-               dstwidth = state->width;
-               dstheight = state->height;
+               dstwidth = window_width;
+               dstheight = window_height;
                srcwidth = state->width * cg->ct_width / 100;
                srcheight = state->height * cg->ct_height / 100;
 
@@ -2553,9 +2673,14 @@ back_gradation(state, cg0)
                r = (dir % 180 == 0) ? &dstwidth : &dstheight;
 
                /* rely upon use X11 background image tiling. */
-               *p = 1;
                *q = (float) 100.0;
+#ifndef DITHERED_BGRAD
+               *p = 1;
                *r = 1;
+#else
+               *p = 3;
+               *r = 3;
+#endif
        }
 
        if (verbose) {
@@ -2595,7 +2720,9 @@ back_gradation(state, cg0)
                freeImage(image);
        }
 
+#ifndef COLOR_BUGFIX
        if (private) free_alloc_colors(&back_clr);
+#endif
        ximageinfo = imageToXImage(display, screen, visual, depth, myimage,
                private, 0, 1, verbose);
        if (!ximageinfo) {
@@ -2603,25 +2730,7 @@ back_gradation(state, cg0)
                cleanup(-1);
        }
 
-       mypixmap = ximageToPixmap(display, DefaultRootWindow(display),
-               ximageinfo);
-       if (mypixmap == None) {
-               fprintf(stderr, "Cannot create image in server\n");
-               cleanup(-1);
-       }
-
-       /* draw background */
-       if (!caching){ 
-               bg_ctl_last = bg_ctl;
-               XSetWindowBackgroundPixmap(display, state->target, mypixmap);
-       }
-
-       XSetPixmapBackgroundPixmap(display, state->target, 
-               mypixmap, ximageinfo->ximage->width, ximageinfo->ximage->height);
-
-       /* finish */
-       XFreePixmap(display, mypixmap);
-       regist_bgcache(ximageinfo, myimage);
+       regist_background_pixmap(ximageinfo, myimage);
 
        XUndefineCursor(display, window);
        XFlush(display);
@@ -2663,7 +2772,7 @@ image_load(state, filename, numcolor, ximagesize, yimagesize, backflag, zoomflag
        width = myimage->width;
        height = myimage->height;
 
-       if (myimage->depth == 1) {
+       if (myimage->depth == 1 && myimage->trans < 0) {
                XColor xc;
 
                xc.flags = DoRed | DoGreen | DoBlue;
@@ -2730,42 +2839,32 @@ image_load(state, filename, numcolor, ximagesize, yimagesize, backflag, zoomflag
                        freeImage(image);
                }
 
+#ifndef COLOR_BUGFIX
                if (private) free_alloc_colors(&back_clr);
+#endif
                ximageinfo= imageToXImage(display, screen, visual, depth,
                                myimage, private, 0, 1, verbose);
                if (ximageinfo == NULL) {
                        fprintf(stderr, "Cannot convert Image to XImage\n");
                        cleanup(-1);
                }
-
-               mypixmap = ximageToPixmap(display,
-                               RootWindow(display, screen), ximageinfo);
-               if (mypixmap == None) {
-                       fprintf(stderr, "Cannot create image in server\n");
-                       cleanup(-1);
-               }
-
-               if (!caching){
-                       bg_ctl_last = bg_ctl;
-                       XSetWindowBackgroundPixmap(display, state->target, mypixmap);
-               } 
-
-               XSetPixmapBackgroundPixmap(display, state->target, mypixmap,
-                       ximageinfo->ximage->width, ximageinfo->ximage->height);
-
-               XFreePixmap(display, mypixmap);
-               strcpy(backfile, filename);
-               backnumcolor = numcolor;
-               backzoom = zoomflag;
-               backx = ximagesize;
-               backy = yimagesize;
-
-               regist_bgcache(ximageinfo, myimage);
-
+               regist_background_pixmap(ximageinfo, myimage);
                goto end;
        }
 
-       draw_line_itemsize(state, 0, height * yzoomrate / 100);
+       switch(valign){
+       case VL_TOP:
+               draw_line_itemsize(state, 0, height * yzoomrate / 100);
+               break;
+       case VL_BOTTOM:
+               draw_line_itemsize(state, height * yzoomrate / 100, 0);
+               break;
+       case VL_CENTER:
+               draw_line_itemsize(state, height * yzoomrate / 200, 
+                       height * yzoomrate / 200);
+               break;
+       }
+
        if (centerflag)
                image_posx = char_size[caching] / 2 - (width * xzoomrate / 100) / 2;
        else
@@ -3028,6 +3127,7 @@ process_icon(state, cp)
        }
 
        cp = NULL;
+       state->brankline = 0;
 }
 
 static void
@@ -3064,13 +3164,15 @@ draw_bar(state, cp)
        width = cp->ctb_width * state->height / 1000;
        swidth = width / 2;
        width -= swidth;
-       st = cp->ctb_start * state->width / 100;
+       st = cp->ctb_start * state->width / 100 + state->xoff;
        len = cp->ctb_length * state->width / 100;
-       XFillRectangle(display, state->target, gcbar, st, state->ypos, len, width);
-       XFillRectangle(display, state->target, gcsbar, st, state->ypos + width, len, swidth);
+       XFillRectangle(display, state->target, gcbar, st, state->ypos + state->yoff, len, width);
+       XFillRectangle(display, state->target, gcsbar, st, state->ypos + state->yoff + width, len, swidth);
 
        state->ypos += width + swidth + VERT_GAP(char_size[caching]) / 2;
-       state->maxascent = width + swidth;
+       if (state->maxascent < width + swidth)
+               state->maxascent = width + swidth;
+       state->brankline = 0;
 }
 
 static void
@@ -3155,7 +3257,7 @@ process_system(state, cp)
                                yloc = rootysiz - myypos + state->height - yloc;
                        else
                                yloc += myypos;
-                       sprintf(q, "+%d+%d", xloc, yloc);
+                       sprintf(q, "+%d+%d", xloc + state->xoff, yloc + state->yoff);
                }
 
                if (mgp_flag & FL_VERBOSE) {
@@ -3282,13 +3384,6 @@ fail:
                argv[cp->cta_argc+1] = geom_arg2;
        }
 
-#if 0
-       xloc = state->linewidth;
-#endif
-       state->linewidth = xsiz;
-       xloc = set_position(state);
-       yloc = state->ypos;
-
        if ((window_id = checkchildwin(cp)) != (Window)-1)
                goto finish;    /*already running*/
 
@@ -3314,7 +3409,7 @@ fail:
                regchild(pid, cp, window_id, cp->cta_flag);
 
        if (window_id != -1)
-               reparent_child_window(window_id, xloc, yloc);
+               reparent_child_window(window_id, window_width, window_height);
        else {
                if (mgp_flag & FL_VERBOSE) {
                        fprintf(stderr, "WARN: %%xsystem can not find child window:");
@@ -3327,15 +3422,20 @@ fail:
                return;
        }
 
-#if 0
-       state->linewidth += xsiz;
-       state->maxascent += ysiz;
-#endif
-
 finish:
        XGetGeometry(display, window_id, &dumwin, 
                &xloc, &yloc, &xsiz, &ysiz, &dumint, &dumint);
+       state->linewidth = xsiz;
+       xloc = set_position(state) + state->xoff 
+               + state->tabxprefix ? state->tabxprefix : state->xprefix;
+       yloc = state->ypos + state->yoff;
+       XMoveWindow(display, window_id, xloc, yloc);
        state->ypos += ysiz;
+
+#if 0 /* not implemented yet */
+       state->linewidth += xsiz;
+       state->maxascent += ysiz;
+#endif
 }
 
 
@@ -3399,7 +3499,9 @@ reparent_child_window(child_window, x, y)
                target = parent;
        }
        XReparentWindow(display, child_window, window, x, y);
+#if 0
        XDestroyWindow(display, target);
+#endif
 }
 
 void
@@ -3408,7 +3510,7 @@ draw_reinit(state)
 {
        /* invalidate the background image cache */
 
-       bg_ctl_last = NULL;
+       bg_ctl_last = bg_ctl_cache = NULL;
        x_registerseed(state, NULL, NULL);
 }
 
@@ -3426,6 +3528,7 @@ epstoimage(state, epsfile, x, y, width, height, xzoom, yzoom)
        char *cp;
        int scale = 1;
        struct stat stbuf;
+       XColor back;
        char geom[32], device[64], scalebuf[32];
        static char imagefile[MAXPATHLEN];
        void (*sigpipe_handler)();
@@ -3595,7 +3698,7 @@ epstoimage(state, epsfile, x, y, width, height, xzoom, yzoom)
        fprintf(fp, "(%s) run\n", epsfile);
        fprintf(fp, "showpage\n");
        fprintf(fp, "quit\n");
-       fsync(fd);
+       fflush(fp);
        fclose(fp);
        signal(SIGPIPE, sigpipe_handler);
 
@@ -3677,20 +3780,21 @@ image_setcolor(state)
                        Pixel d;
 
                        /* XXX: use background color of center position */
-                       x = (obj->x + image->width/2) % bgcache[bgindex].image->width;
-                       y = (state->ypos + image->height/2) % bgcache[bgindex].image->height;
-                       bpl = bgcache[bgindex].image->pixlen;
-                       p = bgcache[bgindex].image->data 
-                               + (bgcache[bgindex].image->width * y + x) * bpl;
+                       x = (obj->x + image->width/2) % bgpixmap[bgindex].image->width;
+                       y = (state->ypos + image->height/2) 
+                                       % bgpixmap[bgindex].image->height;
+                       bpl = bgpixmap[bgindex].image->pixlen;
+                       p = bgpixmap[bgindex].image->data 
+                               + (bgpixmap[bgindex].image->width * y + x) * bpl;
                        d = memToVal(p, bpl);
-                       if (bgcache[bgindex].image->type == ITRUE) {
+                       if (bgpixmap[bgindex].image->type == ITRUE) {
                                back.red   = TRUE_RED(d) << 8;
                                back.green = TRUE_GREEN(d) << 8;
                                back.blue  = TRUE_BLUE(d) << 8;
                        } else {
-                               back.red   = bgcache[bgindex].image->rgb.red  [d];
-                               back.green = bgcache[bgindex].image->rgb.green[d];
-                               back.blue  = bgcache[bgindex].image->rgb.blue [d];
+                               back.red   = bgpixmap[bgindex].image->rgb.red  [d];
+                               back.green = bgpixmap[bgindex].image->rgb.green[d];
+                               back.blue  = bgpixmap[bgindex].image->rgb.blue [d];
                        }
                }
                for (i = 0; i < image->rgb.used; i++) {
@@ -3706,12 +3810,8 @@ image_setcolor(state)
                break;
 
        case ITRUE:
-#ifdef notdef
-               /* How to inverse black & white? */
-               image->trans =
-                   RGB_TO_TRUE((Intensity)-1, (Intensity)-1, (Intensity)-1);
-#endif
-               break;
+               /* XXX: assume background color is on the left right corner */
+               image->trans = memToVal(image->data, image->pixlen);
        }
 }
 
@@ -3830,6 +3930,7 @@ x_registerseed(state, seed, registry)
 
        cp = NULL;
        for (cp = state->xfont; cp; cp = cp->ct_next) {
+               if (!cp->ctc2_value2) continue;
                if (strcmp(cp->ctc2_value2, registry) == 0)
                        break;
        }
@@ -3862,121 +3963,21 @@ x_findseed(state, registry)
        return "*-*-*";         /*anything, canonicalized*/
 }
 
-static void 
-XSetPixmapBackground(display, target, bgcolor)
-       Display *display;
-       Drawable target;
-       u_long  bgcolor;
-{
-       int     i;
-
-       if ((i = regist_bgpixmap()) < 0) return;
-
-       XSetForeground(display, gc_cache, bgcolor);
-       XFillRectangle(display, bgpixmap[i].pixmap,
-               gc_cache, 0, 0, window_width, window_height);
-}
-
-static void 
-XSetPixmapBackgroundPixmap(display, target, pixmap, width, height)
-       Display *display;
-       Drawable target;
-       Pixmap  pixmap;
-       int     width, height;
-{
-       int     x, y, i;
-
-       if ((i = regist_bgpixmap()) < 0) return;
-
-       for (y = 0; y < window_height; y += height)
-               for (x = 0; x < window_width; x += width){
-                       XCopyArea(display, pixmap, bgpixmap[i].pixmap, gc_cache, 0, 0,
-                               width, height, x, y);
-               }
-}
-
-static int
-regist_bgpixmap()
-{
-       int     i, j;
-
-       for (i = 0; i < MAXBGPIXMAP; i ++){
-               if (bgpixmap[i].ctl && ctlcmp(bg_ctl, bgpixmap[i].ctl) == 0) 
-                       return -1;
-       }
-
-       /* search empty slot */ 
-       for (i = 0; i < MAXBGPIXMAP; i ++){
-               if (bgpixmap[i].ctl == NULL)
-                       break;
-       }
-       if (i == MAXBGPIXMAP){
-               for (j = 0; j < MAXBGPIXMAP -1; j ++){  
-                       bgpixmap[j].ctl = bgpixmap[j+1].ctl;    
-                       bgpixmap[j].pixmap = bgpixmap[j+1].pixmap;      
-               }
-               i = 0;
-       }
-       bgpixmap[i].ctl = bg_ctl;
-
-       return i;
-}
-
-static void
-set_bgwindow(ctl)
-       struct ctrl *ctl;
-{
-       int     i;
-
-       if (!ctl || !ctlcmp(bg_ctl_last, ctl)) return;  
-
-       bg_ctl_last = ctl;
-       if (ctl->ct_op == CTL_BIMAGE || ctl->ct_op == CTL_BGRAD) {
-               for (i = 0; i < MAXBGPIXMAP; i ++){
-                       if (bgpixmap[i].ctl && ctlcmp(bg_ctl, bgpixmap[i].ctl) == 0) {
-                               XSetWindowBackgroundPixmap(display, window, bgpixmap[i].pixmap);
-                               return;
-                       }
-               }
-       } else {
-               if (ctl->ct_op == CTL_BACK) 
-                       XSetWindowBackground(display, window, ctl->ctl_value);
-               else {
-                       fprintf(stderr, "internal error: set_bgwindow()\n"); 
-                       cleanup(-1);
-               }
-       }
-}
-
-static void 
-XClearPixmap(display, target)
-       Display *display;
-       Drawable target;
-{
-       int     i;
-
-       for (i = 0; i < MAXBGPIXMAP; i ++){
-               if (bgpixmap[i].ctl && ctlcmp(bg_ctl, bgpixmap[i].ctl) == 0){ 
-                       XCopyArea(display, bgpixmap[i].pixmap, cachewin, gc_cache, 
-                               0, 0, window_width, window_height, 0, 0);
-                       return;
-               }
-       }
-
-       fprintf(stderr, "internal error: XClearPixmap()\n"); 
-       cleanup(-1);
-}
-
 /* cache specified page */
 static void
 cache_page(state, page)
        struct render_state *state;
        int page;
 {
+       struct ctrl *tmp_bg_ctl;
+       int tmp_bgindex;
+
        /* we don't need caching */
        if (cached_page == page || page > maxpage || page <= 0)
                return;
 
+       if (!page_attribute[page].pg_linenum) return;
+
        XFlush(display);
        memset(state, 0, sizeof(struct render_state));
        state->target = cachewin;  /*XXX*/
@@ -3984,6 +3985,8 @@ cache_page(state, page)
        state->height = window_height;
        state->page = page;
        caching = 1;
+       tmp_bg_ctl = bg_ctl;
+       tmp_bgindex = bgindex;
        if (verbose){
                printf("now caching %d page ...\n", page);
                fflush(stdout);
@@ -3994,6 +3997,8 @@ cache_page(state, page)
        }
        caching = 0;
        cached_page = page;
+       bg_ctl = tmp_bg_ctl;
+       bgindex = tmp_bgindex;
 }
 
 static void
@@ -4015,7 +4020,14 @@ set_from_cache(state)
 
        XSetForeground(display, gcfore, fore_color[0]);
        XSetBackground(display, gcfore, back_color[0]);
-       set_bgwindow(bgcache[bgindex].ctl);
+       bg_ctl = bg_ctl_last = bg_ctl_cache;
+       if (bg_ctl){
+               for (i = 0; i < MAXBGPIXMAP; i ++){
+                       if (bgpixmap[i].ctl && ctlcmp(bg_ctl, bgpixmap[i].ctl) == 0)
+                               bgindex = i;
+               }
+               set_background_pixmap(bg_ctl);
+       }
 
        switch(cache_effect){
                case 1:
@@ -4033,58 +4045,23 @@ set_from_cache(state)
 }
 
 void
-reset_cache_bgimage()
+reset_background_pixmap()
 {
        int     i = 0;
 
        bg_ctl_last = NULL;
+       bg_ctl_cache = NULL;
 
-       for (i = 0; i < MAXBGCACHE; i ++) {
-               if (bgcache[i].image){
-                       freeXImage(bgcache[i].image, bgcache[i].ximageinfo);
-                       freeImage(bgcache[i].image);
-               }
-               bgcache[i].ctl = NULL;
-               bgcache[i].image = NULL;
-               bgcache[i].ximageinfo = NULL;
-       }
-}
-
-static void
-regist_bgcache(ximageinfo, image)
-XImageInfo     *ximageinfo;
-Image  *image;
-{
-       int     i;
-       /* search empty slot */ 
-       for (i = 0; i < MAXBGCACHE; i ++){
-               if (bgcache[i].ctl == NULL)
-                       break;
-       }
-       if (i == MAXBGCACHE){
-               /* no empty slot, we need to make one  */
-               freeXImage(bgcache[0].image, bgcache[0].ximageinfo);
-               freeImage(bgcache[0].image);
-               i = 0;
-       }
-
-       bgcache[i].ctl = bg_ctl;
-       bgcache[i].image = image;
-       bgcache[i].ximageinfo = ximageinfo;
-       bgindex = i;
-}
-
-static int
-check_bgcache()
-{
-       int     i;
-       for (i = 0; i < MAXBGCACHE; i ++){
-               if (bgcache[i].ctl && ctlcmp(bg_ctl, bgcache[i].ctl) == 0) { 
-                       bgindex = i;
-                       return 1;
+       for (i = 0; i < MAXBGPIXMAP; i ++) {
+               if (bgpixmap[i].image){
+                       XFreePixmap(display, bgpixmap[i].pixmap); 
+                       freeXImage(bgpixmap[i].image, bgpixmap[i].ximageinfo);
+                       freeImage(bgpixmap[i].image);
                }
+               bgpixmap[i].ctl = NULL;
+               bgpixmap[i].image = NULL;
+               bgpixmap[i].ximageinfo = NULL;
        }
-       return 0;
 }
 
 static void
@@ -4102,8 +4079,20 @@ cache_effect1()
                XCopyArea(display, cachewin, window, gc_cache,
                        window_width - x, 0, step, window_height, 
                        window_width - step, 0);
-
+#if 1
+               XSync(display, False);
+#else
                XFlush(display);
+#endif
+#if 1/*ONOE*/
+           { XEvent e;
+               if (XCheckMaskEvent(display, ~NoEventMask, &e) == True) {
+                       printf("event type=%d\n", e.type);
+                       XPutBackEvent(display, &e);
+                       break;
+               }
+           }
+#endif
        }
 }
 
@@ -4148,3 +4137,266 @@ int     page;
        cache_value  =  pcache.value;
        pcache.flag  = 0;
 }
+
+
+/*
+       predraw: if this page contains texts only, 
+                          draw page in pixmap once, then copy to window.
+*/
+static void
+predraw(state)
+       struct render_state *state;
+{
+       if (!caching && cached_page != state->page 
+                       && page_attribute[state->page].pg_text
+                       && page_attribute[state->page].pg_linenum){
+               cache_page(&cache_state, state->page);
+               set_from_cache(state);
+               pcache_process(state->page);
+       }
+}
+
+
+static void
+get_background_pixmap(ctl, state)
+       struct ctrl *ctl;
+       struct render_state *state;
+{
+       int     i;
+
+       /*
+        * check if background is already cached
+        */
+       for (i = 0; i < MAXBGPIXMAP; i ++){
+               if (bgpixmap[i].ctl && ctlcmp(ctl, bgpixmap[i].ctl) == 0){
+                       bgindex = i;
+                       return;                 
+               }
+       }
+
+       if (i == MAXBGPIXMAP){
+               /* this background is not cached, we have to generate one */
+               switch(ctl->ct_op){
+               case CTL_BIMAGE: 
+                       image_load(state, ctl->ctm_fname, ctl->ctm_numcolor,
+                                               ctl->ctm_ximagesize, ctl->ctm_yimagesize, 1,
+                                               ctl->ctm_zoomflag, 0);
+                       break;
+               case CTL_BGRAD:
+                       back_gradation(state, &ctl->ct_val.ctrl_grad);
+                       break;
+               case CTL_BACK:
+                       break;
+               default:
+                       fprintf(stderr, "fatal error in get_background_pixmap()\n");
+                       cleanup(-1);
+                       break;
+               }
+       }
+}
+
+static void
+regist_background_pixmap(ximageinfo, image)
+       XImageInfo      *ximageinfo;
+       Image           *image;
+{
+       Pixmap  pixmap;
+       int     i, j;
+
+       /* search empty slot */ 
+       for (i = 0; i < MAXBGPIXMAP; i ++){
+               if (bgpixmap[i].ctl == NULL)
+                       break;
+       }
+
+       if (i == MAXBGPIXMAP){
+               /* no empty slot, we need to make one  */
+               XFreePixmap(display, bgpixmap[MAXBGPIXMAP -1].pixmap); 
+               freeXImage(bgpixmap[MAXBGPIXMAP -1].image, 
+                                       bgpixmap[MAXBGPIXMAP -1].ximageinfo);
+               freeImage(bgpixmap[MAXBGPIXMAP -1].image);
+               for (j = MAXBGPIXMAP -2; j >= 0; j --){
+                       bgpixmap[j +1].ctl = bgpixmap[j].ctl;
+                       bgpixmap[j +1].pixmap = bgpixmap[j].pixmap;
+                       bgpixmap[j +1].image = bgpixmap[j].image;
+                       bgpixmap[j +1].ximageinfo = bgpixmap[j].ximageinfo;
+               }
+               bg_ctl_last = NULL;
+               i = 0;
+       }
+
+       pixmap = ximageToPixmap(display, 
+                       RootWindow(display, screen), ximageinfo);
+       bgpixmap[i].ctl = bg_ctl;
+       bgpixmap[i].pixmap = pixmap;
+       bgpixmap[i].image = image;
+       bgpixmap[i].ximageinfo = ximageinfo;
+       bgindex = i;
+}
+
+static void
+set_background_pixmap(ctl)
+       struct ctrl *ctl;
+{
+       int     i;
+
+       switch(ctl->ct_op){
+       case CTL_BIMAGE: 
+       case CTL_BGRAD:
+               for (i = 0; i < MAXBGPIXMAP; i ++){
+                       if (bgpixmap[i].ctl && ctlcmp(ctl, bgpixmap[i].ctl) == 0)
+                               break;  
+               }
+               if (i == MAXBGPIXMAP){
+                       fprintf(stderr, "fatal error in set_background_pixmap()\n");
+                       cleanup(-1);
+               }
+               XSetWindowBackgroundPixmap(display, window, bgpixmap[i].pixmap);
+               break;
+       case CTL_BACK:
+               XSetWindowBackground(display, window, ctl->ctl_value);
+               break;
+       default:
+               fprintf(stderr, "fatal error in set_background_pixmap() op=%d\n", 
+                       ctl->ct_op);
+               cleanup(-1);
+               break;
+       }
+}
+
+/*
+ * Clear target pixmap 
+ */
+static void
+XClearPixmap(display, target)
+       Display *display;
+       Drawable target;
+{
+       int     i; 
+       int x, y, width, height;
+       XImage *xim;
+
+       switch(bg_ctl->ct_op){
+       case CTL_BIMAGE: 
+       case CTL_BGRAD:
+               for (i = 0; i < MAXBGPIXMAP; i ++){
+                       if (bgpixmap[i].ctl && ctlcmp(bg_ctl, bgpixmap[i].ctl) == 0)
+                               break;  
+               }
+               if (i == MAXBGPIXMAP){
+                       fprintf(stderr, "fatal error in XClearPixmap()\n");
+                       cleanup(-1);
+               }
+
+               xim = bgpixmap[i].ximageinfo->ximage;
+               for (y = 0; y < window_height; y += xim->height)
+                       for (x = 0; x < window_width; x += xim->width)
+                               XPutImage(display, target, gc_cache, 
+                                       xim, 0, 0, x, y, 
+                                       xim->width, xim->height);
+               break;
+       case CTL_BACK:
+               XSetForeground(display, gc_cache, bg_ctl->ctl_value);
+               XFillRectangle(display, target,
+                       gc_cache, 0, 0, window_width, window_height);
+               break;
+       default:
+               fprintf(stderr, "fatal error in XClearPixmap()\n");
+               cleanup(-1);
+               break;
+       }
+}
+
+int
+get_regid(registry)
+    char *registry;
+{
+       char *p;
+
+       if (!registry || registry[0] == '\0') return 0;
+       if (strlen(registry) == 9 && !strncmp("iso8859-", registry, 8) &&
+               registry[8] >= '1' && registry[8] <= '4') {
+                       p = registry + 8;
+                       return atoi(p) -1;
+       } else
+               return -1;
+}
+
+#ifdef MNG
+int
+obj_new_anim(state, x, y, width, height, filename, key)
+    struct render_state *state;
+    int x, y;
+    int width, height;
+    char *filename;
+       void *key;
+{
+       struct render_object *obj;
+
+       obj = obj_alloc(state);
+       if (obj == NULL)
+               return 0;
+       obj->x = x;
+       obj->y = y;
+       obj->type = O_ANIM;
+       obj->data.anim.width = width;
+       obj->data.anim.height = height;
+       obj->data.anim.filename = strdup(filename);
+       obj->data.anim.key = key;       /* for regchild */
+       obj->ascent = 0;        /*XXX*/
+       obj->descent = height;  /*XXX*/
+       obj->vertloc = VL_CENTER;
+
+       return 1;
+}
+
+static void
+obj_draw_anim(state, x, y, obj)
+    struct render_state *state;
+       u_int x, y;
+       struct render_object *obj;
+{
+       pid_t   pid;
+
+       if (!(pid = fork())){
+               mngload(obj->data.anim.filename, x, y, 
+                       obj->data.anim.width, obj->data.anim.height);
+               while(1) sleep(1);
+       }
+       regchild(pid, obj->data.anim.key, -1, state->page);
+}
+
+static void
+process_anim(state, cp)
+    struct render_state *state;
+       struct ctrl *cp;
+{
+       int width, height;
+
+       width = 200;
+       height = 100;
+
+       /*
+        * we support only mng so far
+        */
+       mngpreload(state, cp->ctc_value, &width, &height);
+
+       obj_new_anim(state, state->linewidth, - height, 
+               width, height, cp->ctc_value, cp);
+
+       switch(valign){
+       case VL_TOP:
+               draw_line_itemsize(state, 0, height);
+               break;
+       case VL_BOTTOM:
+               draw_line_itemsize(state, height, 0);
+               break;
+       case VL_CENTER:
+               draw_line_itemsize(state, height /2 , height /2);
+               break;
+       }
+
+       state->linewidth += width;
+       state->brankline = 0;
+}
+#endif
diff --git a/font.c b/font.c
index 0228845..d8290e6 100644 (file)
--- a/font.c
+++ b/font.c
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: font.c,v 1.24 1999/07/03 15:52:41 nishida Exp $
+ * $Id: font.c,v 1.26 2000/12/04 09:21:27 nishida Exp $
  */
 
 #include "mgp.h"
@@ -326,7 +326,7 @@ vfc_alloc(code, width, height, fontname)
        /* horizontal gap of 1 dot is included by default */
        char_len = max_x - min_x + 2;
        vfc->xoff = min_x;
-       vfc->charlen = char_len;
+       vfc->charlen = vfc->xmax = char_len;
        vfc->descent = height / VF_DESCENT;
        vfc->ascent = vfc->height - vfc->descent;
 
@@ -379,6 +379,10 @@ vfc_setfont(fontname)
 {
        static char *prev_vfcap;
 
+       if ((mgp_flag & FL_NOVFLIB)) {
+               return;
+       }
+
        if (prev_vfcap != vfcap_name) {
                /*
                 * Because the string specified by %vfcap is stored in
index c1e0556..f072a9d 100644 (file)
--- a/globals.c
+++ b/globals.c
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: globals.c,v 1.40 1999/09/10 07:13:50 itojun Exp $
+ * $Id: globals.c,v 1.46 2001/09/17 14:48:30 nishida Exp $
  */
 
 #include "mgp.h"
@@ -69,7 +69,6 @@ Pixmap pixmap;
 Pixmap cachewin;
 Pixmap cachetmp;
 struct bgpixmap bgpixmap[MAXBGPIXMAP];
-struct bgcache bgcache[MAXBGCACHE];
 Colormap colormap;
 int free_clr_num;
 u_long *free_clr = NULL;
@@ -84,6 +83,8 @@ u_long ctrl_color[2];
 u_int b_quality[2] = {DEFAULT_BQUALITY, DEFAULT_BQUALITY};
 u_int quality_flag = 0;
 
+char mgp_charset[256];
+
 struct alloc_color image_clr = {0, NULL};
 struct alloc_color back_clr = {0, NULL};
 struct alloc_color font_clr = {0, NULL};
@@ -116,7 +117,9 @@ const struct ctl_words ctl_words[] = {
 /*CTL*/        { CTL_GAP,              T_INT,  "gap", 3 },
 /*CTL*/        { CTL_PAUSE,            T_SP,   "pause", 5 },
 /*CTL*/        { CTL_PREFIX,           T_STR,  "prefix", 6 },
+/*CTL*/        { CTL_PREFIXN,          T_STR,  "*prefixn*", 9 },
 /*CTL*/        { CTL_TABPREFIX,        T_STR,  "*tabprefix*", 11 },
+/*CTL*/        { CTL_TABPREFIXN,       T_STR,  "*tabprefixn*", 12 },
 /*CTL*/        { CTL_PREFIXPOS,        T_VOID, "*prefixpos*", 11 },
 /*CTL*/        { CTL_AGAIN,            T_VOID, "again", 5 },
 /*CTL*/        { CTL_CCOLOR,           T_LONG, "ccolor", 6 },
@@ -144,5 +147,8 @@ const struct ctl_words ctl_words[] = {
 /*CTL*/        { CTL_TMFONT,           T_STR,  "tmfont", 6 },
 /*CTL*/        { CTL_TMFONT0,          T_STR,  "tmfont0", 7 },
 /*CTL*/        { CTL_PCACHE,           T_SP,   "pcache", 6 },
+/*CTL*/        { CTL_ANIM,             T_STR,  "anim", 4 },
+/*CTL*/        { CTL_VALIGN,           T_STR,  "valign", 6 },
+/*CTL*/        { CTL_AREA,             T_STR,  "area", 4 },
        { 0, 0, NULL, 0 },
 };
index 593ae65..35081c0 100644 (file)
--- a/grammar.y
+++ b/grammar.y
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: grammar.y,v 1.33 1999/09/10 07:13:41 itojun Exp $
+ * $Id: grammar.y,v 1.41 2001/09/17 14:48:30 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -376,6 +376,11 @@ gen_newimage(arg)
                }
        }
 
+       if (!p) {
+               yyerror("no filename specified to newimage");
+               return ct;
+       }
+
        if (p->ct_next) {
                yyerror("multiple filename specified to newimage");
                return ct;
@@ -513,6 +518,68 @@ gen_pcache(flag, mode, effect, value)
        return ct;
 }
 
+static struct ctrl *
+gen_valign(align)
+       char *align;
+{
+       struct ctrl *ct;
+
+       if (!(ct = ctlalloc1(CTL_VALIGN))) {
+               yyerror("cannot allocate node (op=VALIGN)");
+               return ct;
+       }
+       if (!strcmp(align, "center")) 
+               ct->cti_value = VL_CENTER;
+       else { 
+               if (!strcmp(align, "top")) 
+                       ct->cti_value = VL_TOP;
+               else {
+                       if (!strcmp(align, "bottom")) 
+                               ct->cti_value = VL_BOTTOM;
+                       else {
+                               yyerror("%valign center|top|bottom");
+                               ctlfree(ct);
+                               return NULL;
+                       }
+               }
+       }
+       return ct;
+}
+
+static struct ctrl *
+gen_area(width, height, xoff, yoff)
+       int width;
+       int height;
+       int xoff;
+       int yoff;
+{
+       struct ctrl *ct;
+
+       if (!(ct = ctlalloc1(CTL_AREA))) {
+               yyerror("cannot allocate node (op=AREA)");
+               return ct;
+       }
+       if (width < 0 || width > 100)
+               width = 100;
+       if (height < 0 || height > 100)
+               height = 100;
+       if (xoff < 0)
+               xoff = (100 - width) / 2;
+       else if (width + xoff > 100)
+               xoff = 100 - width;
+       if (yoff < 0)
+               yoff = (100 - height) / 2;
+#ifdef notdef  /* mgp doesn't check overflow in y axis, anyway. */
+       else if (height + yoff > 100)
+               yoff = 100 - height;
+#endif
+       ct->ctar_width = width;
+       ct->ctar_height = height;
+       ct->ctar_xoff = xoff;
+       ct->ctar_yoff = yoff;
+       return ct;
+}
+
 #if 0
 
 static struct ctrl *
@@ -664,7 +731,7 @@ pcap_parse()
 %token KW_LINESTART KW_LINEEND KW_MARK KW_SYSTEM KW_FILTER KW_ENDFILTER
 %token KW_QUALITY KW_ICON KW_LEFTFILL KW_XSYSTEM KW_VFCAP KW_TFONT KW_TFDIR
 %token KW_DEFFONT KW_FONT KW_TFONT0 KW_EMBED KW_ENDEMBED KW_NEWIMAGE
-%token KW_CHARSET KW_TMFONT KW_PCACHE KW_TMFONT0
+%token KW_CHARSET KW_TMFONT KW_PCACHE KW_TMFONT0 KW_ANIM KW_VALIGN KW_AREA
 
 %type <ct> toplevel
 %type <ct> line defaultline tabline shellline deffontline
@@ -801,13 +868,23 @@ cmd:        KW_NOOP       { $$ = gen_void(CTL_NOOP); }
                                }
        | KW_TFONT STRorID      {
 #ifdef FREETYPE
-                                 $$ = gen_str(CTL_TFONT, $2);
+                                 $$ = gen_str2(CTL_TFONT, $2, "iso8859-1");
 #else
-                                 $$ = gen_str(CTL_NOOP, $2);
+                                 $$ = gen_str2(CTL_NOOP, $2, "iso8859-1");
                                  yywarn("directive \"tfont\" not supported "
                                        "in this configuration");
 #endif
                                }
+       | KW_TFONT STRorID      STRorID {
+#ifdef FREETYPE
+                                 $$ = gen_str2(CTL_TFONT, $2, $3);
+#else
+                                 $$ = gen_str2(CTL_NOOP, $2, $3);
+                                 yywarn("directive \"tfont\" not supported "
+                                       "in this configuration");
+#endif
+                               }
+
        | KW_TMFONT STRorID     {
 #ifdef FREETYPE
                                  $$ = gen_str(CTL_TMFONT, $2);
@@ -843,6 +920,8 @@ cmd:          KW_NOOP       { $$ = gen_void(CTL_NOOP); }
                          }
                        }
        | KW_PREFIX STR { $$ = gen_str(CTL_PREFIX, $2); }
+       | KW_PREFIX NUM { $$ = gen_double_int(CTL_PREFIXN, $2); }
+       | KW_PREFIX DOUBLE      { $$ = gen_double(CTL_PREFIXN, $2); }
        | KW_NEWIMAGE args
                        { $$ = gen_newimage($2); }
        | KW_IMAGE STRorID WINSIZ
@@ -896,10 +975,25 @@ cmd:        KW_NOOP       { $$ = gen_void(CTL_NOOP); }
        | KW_FONT STR   { $$ = gen_str(CTL_FONT, $2); }
        | KW_TEXT STR   { $$ = gen_str(CTL_TEXT, $2); } /*easter egg*/
        | KW_CHARSET STR        { $$ = gen_str(CTL_CHARSET, $2); }
+       | KW_AREA NUM NUM { $$ = gen_area($2, $3, -1, -1); }
+       | KW_AREA NUM NUM NUM NUM { $$ = gen_area($2, $3, $4, $5); }
        | KW_PCACHE NUM NUM NUM NUM
                        { $$ = gen_pcache($2, $3, $4, $5); }
        | KW_PCACHE NUM
                        { $$ = gen_pcache($2, 0, 0, 0); }
+       | KW_ANIM STRorID       {
+#ifdef MNG
+                       $$ = gen_str(CTL_ANIM, $2);
+                       chkfile($2);
+#else
+                       $$ = gen_str(CTL_NOOP, $2);
+                       yywarn("directive \"anim\" not supported "
+                                       "in this configuration");
+#endif
+       }
+       | KW_VALIGN STRorID     {
+                       $$ = gen_valign($2);
+       }
        ;
 tabcmd:          KW_TAB NUM    { $$ = gen_int(CTL_TAB, $2); }
        | KW_TAB ID     { $$ = gen_str(CTL_TAB, $2); }
index cd8f83d..cdbff6f 100644 (file)
@@ -1,16 +1,26 @@
 TARGET0=       mgpimage
 TARGET=        lib$(TARGET0).a
+#if @USE_IMLIB@
+SRCS=  imagetypes.c send.c zio.c zoom.c new.c compress.c reduce.c\
+       value.c misc.c rotate.c rle.c rlelib.c smooth.c halftone.c clip.c\
+       dither.c path.c bright.c window.c imlib_loader.c
+
+OBJS=  imagetypes.o send.o zio.o zoom.o new.o compress.o reduce.o\
+       value.o misc.o rotate.o rle.o rlelib.o smooth.o halftone.o clip.o\
+       dither.o path.o bright.o window.o imlib_loader.o
+#else
 SRCS=  imagetypes.c gif.c send.c zio.c zoom.c new.c compress.c reduce.c\
        value.c misc.c rotate.c rle.c rlelib.c smooth.c halftone.c clip.c\
        dither.c xbitmap.c xpixmap.c pbm.c pcx.c xwd.c mac.c jpeg.c g3.c\
        path.c sunraster.c mcidas.c fbm.c faces.c cmuwmraster.c bright.c\
-       img.c mc_tables.c window.c
+       img.c mc_tables.c window.c png.c
 
 OBJS=  imagetypes.o gif.o send.o zio.o zoom.o new.o compress.o reduce.o\
        value.o misc.o rotate.o rle.o rlelib.o smooth.o halftone.o clip.o\
        dither.o xbitmap.o xpixmap.o pbm.o pcx.o xwd.o mac.o jpeg.o g3.o\
        path.o sunraster.o mcidas.o fbm.o faces.o cmuwmraster.o bright.o\
-       img.o mc_tables.o window.o
+       img.o mc_tables.o window.o png.o
+#endif
 
 DEFS=  @DEFS@
 OPTFLAGS=@OPTFLAGS@
@@ -18,9 +28,10 @@ OPTFLAGS=@OPTFLAGS@
 AllTarget($(TARGET))
 DependTarget()
 SpecialObjectRule(window.o,window.c,$(DEFS))
-SpecialObjectRule(gif.o,gif.c,$(DEFS))
+SpecialObjectRule(gif.o,gif.c,$(DEFS) $(OPTFLAGS))
 SpecialObjectRule(imagetypes.o,imagetypes.c,$(DEFS))
 #SpecialObjectRule(png.o,png.c,$(DEFS) $(OPTFLAGS))
+SpecialObjectRule(imlib_loader.o,imlib_loader.c,$(DEFS))
 
 #ifndef NullParameter
 #define  NullParameter 
index cf78157..1c90b83 100644 (file)
+++ b/