summaryrefslogtreecommitdiff
path: root/Build/source/texk/tex4htk
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-17 21:41:51 +0000
committerKarl Berry <karl@freefriends.org>2006-01-17 21:41:51 +0000
commit487ca4806cc046076293cf6cc5fbba0db282bac7 (patch)
tree847b412ab5158dd7bdd7ed7e5a4cc3fbca94be32 /Build/source/texk/tex4htk
parenta3d3111bfe26b8e5f5bc6049dfb2a4ca2edc7881 (diff)
texk 1
git-svn-id: svn://tug.org/texlive/trunk@1485 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/tex4htk')
-rw-r--r--Build/source/texk/tex4htk/ChangeLog78
-rw-r--r--Build/source/texk/tex4htk/Makefile.in66
-rw-r--r--Build/source/texk/tex4htk/acconfig.h26
-rw-r--r--Build/source/texk/tex4htk/c-auto.in130
-rw-r--r--Build/source/texk/tex4htk/config.h1
-rwxr-xr-xBuild/source/texk/tex4htk/configure7358
-rw-r--r--Build/source/texk/tex4htk/configure.in11
-rwxr-xr-xBuild/source/texk/tex4htk/dbcontext7
-rwxr-xr-xBuild/source/texk/tex4htk/dblatex9
-rwxr-xr-xBuild/source/texk/tex4htk/dbmcontext7
-rwxr-xr-xBuild/source/texk/tex4htk/dbmex9
-rwxr-xr-xBuild/source/texk/tex4htk/dbmlatex9
-rwxr-xr-xBuild/source/texk/tex4htk/dbmmex9
-rwxr-xr-xBuild/source/texk/tex4htk/dbmtex9
-rwxr-xr-xBuild/source/texk/tex4htk/dbmtexexec12
-rwxr-xr-xBuild/source/texk/tex4htk/dbmtexi10
-rwxr-xr-xBuild/source/texk/tex4htk/dbtex9
-rwxr-xr-xBuild/source/texk/tex4htk/dbtexexec12
-rwxr-xr-xBuild/source/texk/tex4htk/dbtexi10
-rw-r--r--Build/source/texk/tex4htk/demo.tex261
-rw-r--r--Build/source/texk/tex4htk/depend.mak97
-rw-r--r--Build/source/texk/tex4htk/depend.mk13
-rw-r--r--Build/source/texk/tex4htk/ht7
-rw-r--r--Build/source/texk/tex4htk/htcmd.c596
-rwxr-xr-xBuild/source/texk/tex4htk/htcontext7
-rwxr-xr-xBuild/source/texk/tex4htk/htlatex9
-rwxr-xr-xBuild/source/texk/tex4htk/htmex9
-rw-r--r--Build/source/texk/tex4htk/htperl.pl45
-rwxr-xr-xBuild/source/texk/tex4htk/httex9
-rwxr-xr-xBuild/source/texk/tex4htk/httexi10
-rwxr-xr-xBuild/source/texk/tex4htk/mk4ht153
-rwxr-xr-xBuild/source/texk/tex4htk/mzcontext7
-rwxr-xr-xBuild/source/texk/tex4htk/mzlatex9
-rwxr-xr-xBuild/source/texk/tex4htk/mzmex9
-rwxr-xr-xBuild/source/texk/tex4htk/mztex9
-rwxr-xr-xBuild/source/texk/tex4htk/mztexexec12
-rwxr-xr-xBuild/source/texk/tex4htk/mztexi10
-rwxr-xr-xBuild/source/texk/tex4htk/oocontext7
-rwxr-xr-xBuild/source/texk/tex4htk/oolatex9
-rwxr-xr-xBuild/source/texk/tex4htk/oomex9
-rwxr-xr-xBuild/source/texk/tex4htk/ootex9
-rwxr-xr-xBuild/source/texk/tex4htk/ootexexec12
-rwxr-xr-xBuild/source/texk/tex4htk/ootexi10
-rw-r--r--Build/source/texk/tex4htk/runht.c860
-rw-r--r--Build/source/texk/tex4htk/stamp-auto.in1
-rw-r--r--Build/source/texk/tex4htk/t4ht.c2946
-rwxr-xr-xBuild/source/texk/tex4htk/teicontext7
-rwxr-xr-xBuild/source/texk/tex4htk/teilatex9
-rwxr-xr-xBuild/source/texk/tex4htk/teimcontext7
-rwxr-xr-xBuild/source/texk/tex4htk/teimex9
-rwxr-xr-xBuild/source/texk/tex4htk/teimlatex9
-rwxr-xr-xBuild/source/texk/tex4htk/teimmex9
-rwxr-xr-xBuild/source/texk/tex4htk/teimtex9
-rwxr-xr-xBuild/source/texk/tex4htk/teimtexexec12
-rwxr-xr-xBuild/source/texk/tex4htk/teimtexi10
-rwxr-xr-xBuild/source/texk/tex4htk/teitex9
-rwxr-xr-xBuild/source/texk/tex4htk/teitexexec12
-rwxr-xr-xBuild/source/texk/tex4htk/teitexi10
-rw-r--r--Build/source/texk/tex4htk/test.tex261
-rw-r--r--Build/source/texk/tex4htk/test1.tex10
-rw-r--r--Build/source/texk/tex4htk/testa.tex11
-rw-r--r--Build/source/texk/tex4htk/testb.tex10
-rw-r--r--Build/source/texk/tex4htk/tex4ht.c11549
-rw-r--r--Build/source/texk/tex4htk/tex4ht.in127
-rwxr-xr-xBuild/source/texk/tex4htk/uxhcontext7
-rwxr-xr-xBuild/source/texk/tex4htk/uxhlatex9
-rwxr-xr-xBuild/source/texk/tex4htk/uxhmex9
-rwxr-xr-xBuild/source/texk/tex4htk/uxhtex9
-rwxr-xr-xBuild/source/texk/tex4htk/uxhtexi10
-rwxr-xr-xBuild/source/texk/tex4htk/wcontext7
-rw-r--r--Build/source/texk/tex4htk/win32.mak95
-rwxr-xr-xBuild/source/texk/tex4htk/wlatex9
-rwxr-xr-xBuild/source/texk/tex4htk/wmex9
-rwxr-xr-xBuild/source/texk/tex4htk/wtex9
-rwxr-xr-xBuild/source/texk/tex4htk/wtexi10
-rwxr-xr-xBuild/source/texk/tex4htk/xhcontext7
-rwxr-xr-xBuild/source/texk/tex4htk/xhcontext.unix7
-rwxr-xr-xBuild/source/texk/tex4htk/xhlatex9
-rwxr-xr-xBuild/source/texk/tex4htk/xhmcontext7
-rwxr-xr-xBuild/source/texk/tex4htk/xhmex9
-rwxr-xr-xBuild/source/texk/tex4htk/xhmlatex9
-rwxr-xr-xBuild/source/texk/tex4htk/xhmmex9
-rwxr-xr-xBuild/source/texk/tex4htk/xhmtex9
-rwxr-xr-xBuild/source/texk/tex4htk/xhmtexexec12
-rwxr-xr-xBuild/source/texk/tex4htk/xhmtexi10
-rwxr-xr-xBuild/source/texk/tex4htk/xhtex9
-rwxr-xr-xBuild/source/texk/tex4htk/xhtexexec12
-rwxr-xr-xBuild/source/texk/tex4htk/xhtexi10
-rw-r--r--Build/source/texk/tex4htk/xv4ht.java231
89 files changed, 25530 insertions, 0 deletions
diff --git a/Build/source/texk/tex4htk/ChangeLog b/Build/source/texk/tex4htk/ChangeLog
new file mode 100644
index 00000000000..fb4f3d9dd40
--- /dev/null
+++ b/Build/source/texk/tex4htk/ChangeLog
@@ -0,0 +1,78 @@
+2004-09-18 Karl Berry <karl@tug.org>
+
+ * Update for current tex4ht with all fixes, from:
+http://www.cse.ohio-state.edu/~gurari/fix/tex4ht-1.0.2004_09_01_1516.tar.gz
+
+ Amounts to new C files, new htcontext and httexexec. Fingers crossed.
+
+1998-10-22 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * tex4ht.c [__DJGPP__] (ANSI, DOS_GIF_FILE): Define.
+ (LSTAT): Define to stat for every system that doesn't define
+ S_ISLNK.
+ (WRITE_BIN_FLAGS, READ_BIN_FLAGS): Use binary mode with DJGPP.
+ (dos_file_names): New variable.
+ [WIN32] (sigint_handler): Add missing semi-colon in prototype
+ declaration.
+ (sig_err): If got fatal signal other than SIGINT or SIGQUIT, don't
+ return to caller, since the program will be aborted otherwise.
+ (search_file_ext): Allow use of both forward- and back-slashes on
+ DOS and Windows platforms.
+ (insert_ch) [DOS_GIF_FILE]: Only use butchered file name if long
+ file names aren't supported (dos_file_names is TRUE).
+ (main) [KPATHSEA]: If input is from stdin which is not a console
+ device, switch it to binary mode. Set dos_file_names to TRUE for
+ all DOS platforms, FALSE on Unix and WIN32, and compute at runtime
+ for DJGPP. Simplify logic of finding the init file by pushing
+ HOME=C: into environment if $HOME isn't defined on DOSISH systems.
+ Only use butchered file names for GIF files if long file names
+ aren't supported (dos_file_names is TRUE).
+
+Fri Oct 30 21:39:09 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * new version of tex4ht.c from Eitan. New C program t4ht.c,
+ replaces Perl processor
+
+Fri Mar 13 13:44:43 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * small changes from Eitan. added tex4ht.perl processor.
+
+Tue Feb 17 10:20:25 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * Makefile.in (install-exec): use INSTALL_DATA for shell script
+
+Mon Feb 16 13:16:07 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * Makefile.in: install-data needs to put stuff on $texmf/tex4ht,
+ not $texmf/tex/generic/tex4ht
+ * tex4ht.c: use "other text files" search path instead of TEXINPUTS
+
+Mon Feb 2 11:32:03 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * small fix in make check target of Makefile.in
+
+Fri Jan 30 13:23:22 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * tex4ht.c: changed #define STAT stat to #define STSTAT stat
+ (and use STSTAT) - Peter Breitenlohner found conflict with aix
+
+Tue Jan 27 14:32:25 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * configure etc: new configure.in, c-auto.in, Makefile.in from
+ Olaf Weber
+
+Tue Jan 27 13:48:41 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * ChangeLog: removed "check" target as people will not
+ all have "convert"
+
+Tue Jan 20 10:14:26 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * added check of function prototypes to c-auto.in
+
+Thu Jan 1 11:02:02 1998 Sebastian Rahtz <s.rahtz@elsevier.co.uk>
+
+ * Started ChangeLog for tex4htk. Added #ifdef KPATHSEA sections to
+ C program, and cleaned .env file a little. Search for .env file
+ and .htf file on TEXINPUTS path
+
diff --git a/Build/source/texk/tex4htk/Makefile.in b/Build/source/texk/tex4htk/Makefile.in
new file mode 100644
index 00000000000..0e60dfc9b93
--- /dev/null
+++ b/Build/source/texk/tex4htk/Makefile.in
@@ -0,0 +1,66 @@
+# Makefile for tex4ht in TeX Live. Public domain.
+# Originally written by S. Rahtz.
+version = 1.0
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+kpse_include ../make/texi.mk
+prog_cflags = -DUNIX -DKPATHSEA -DNeedFunctionPrototypes
+
+objects = tex4ht.o t4ht.o
+
+programs = tex4ht t4ht
+scripts = htcontext htmex httex httexi htlatex ht mk4ht
+
+
+default all: $(programs)
+
+t4ht: $(kpathsea) t4ht.o
+ $(kpathsea_link) t4ht.o $(LOADLIBES)
+
+tex4ht: $(kpathsea) tex4ht.o
+ $(kpathsea_link) tex4ht.o $(LOADLIBES)
+
+kpse_include ../make/tkpathsea.mk
+
+install: install-exec install-data
+
+uninstall: uninstall-exec uninstall-data
+
+install-exec: all
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
+ for p in $(scripts); do $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/$$p; done
+
+uninstall-exec:
+ for p in $(programs) $(scripts); do rm -f $(bindir)/$$p; done
+
+install-data:
+
+uninstall-data:
+
+distname = tex4ht
+
+kpse_include ../make/dist.mk
+kpse_include ../make/config.mk
+kpse_include ../make/clean.mk
+distclean::
+ -rm v*.tex *.txt i*.tex *.gif *.toc *.otc *.lg *.xref *.html *.idv *.log *.aux tmp.* tex4ht.env
+
+dvi info check:
+
+maybecheck:
+ TEXINPUTS=$(srcdir): $(SHELL) $(srcdir)/ht latex test
+
+
+tex4ht.env: tex4ht.in
+ sed -e "s;@texmf@;$(texmf);" < $(srcdir)/tex4ht.in \
+ | sed -e "s;@prefix@;$(prefix);g" \
+ | sed -e "s;@imbindir@.;;g" \
+ | sed -e "s/Mmove/Mmv/" \
+ | sed -e "s/Ccopy/Ccp/" \
+ > tex4ht.env
+
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/tex4htk/acconfig.h b/Build/source/texk/tex4htk/acconfig.h
new file mode 100644
index 00000000000..461e5c875f5
--- /dev/null
+++ b/Build/source/texk/tex4htk/acconfig.h
@@ -0,0 +1,26 @@
+/* Define if your compiler understands prototypes. */
+#undef HAVE_PROTOTYPES
+
+/* Define if your putenv doesn't waste space when the same environment
+ variable is assigned more than once, with different (malloced)
+ values. This is true only on NetBSD/FreeBSD, as far as I know. See
+ xputenv.c. */
+#undef SMART_PUTENV
+
+/* Define if getcwd if implemented using fork or vfork. Let me know
+ if you have to add this by hand because configure failed to detect
+ it. */
+#undef GETCWD_FORKS
+
+/* Define if you are using GNU libc or otherwise have global variables
+ `program_invocation_name' and `program_invocation_short_name'. */
+#undef HAVE_PROGRAM_INVOCATION_NAME
+
+/* all: Define to enable running scripts when missing input files. */
+#define MAKE_TEX_MF_BY_DEFAULT 0
+#define MAKE_TEX_PK_BY_DEFAULT 0
+#define MAKE_TEX_TEX_BY_DEFAULT 0
+#define MAKE_TEX_TFM_BY_DEFAULT 0
+#define MAKE_TEX_FMT_BY_DEFAULT 0
+#define MAKE_OMEGA_OFM_BY_DEFAULT 0
+#define MAKE_OMEGA_OCP_BY_DEFAULT 0
diff --git a/Build/source/texk/tex4htk/c-auto.in b/Build/source/texk/tex4htk/c-auto.in
new file mode 100644
index 00000000000..7d186ab599a
--- /dev/null
+++ b/Build/source/texk/tex4htk/c-auto.in
@@ -0,0 +1,130 @@
+/* c-auto.in. Generated automatically from configure.in by autoheader. */
+
+/* Define if the closedir function returns void instead of int. */
+#undef CLOSEDIR_VOID
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if your compiler understands prototypes. */
+#undef HAVE_PROTOTYPES
+
+/* Define if your putenv doesn't waste space when the same environment
+ variable is assigned more than once, with different (malloced)
+ values. This is true only on NetBSD/FreeBSD, as far as I know. See
+ xputenv.c. */
+#undef SMART_PUTENV
+
+/* Define if getcwd if implemented using fork or vfork. Let me know
+ if you have to add this by hand because configure failed to detect
+ it. */
+#undef GETCWD_FORKS
+
+/* Define if you are using GNU libc or otherwise have global variables
+ `program_invocation_name' and `program_invocation_short_name'. */
+#undef HAVE_PROGRAM_INVOCATION_NAME
+
+/* all: Define to enable running scripts when missing input files. */
+#define MAKE_TEX_MF_BY_DEFAULT 0
+#define MAKE_TEX_PK_BY_DEFAULT 0
+#define MAKE_TEX_TEX_BY_DEFAULT 0
+#define MAKE_TEX_TFM_BY_DEFAULT 0
+#define MAKE_TEX_FMT_BY_DEFAULT 0
+#define MAKE_OMEGA_OFM_BY_DEFAULT 0
+#define MAKE_OMEGA_OCP_BY_DEFAULT 0
+
+/* The number of bytes in a int. */
+#undef SIZEOF_INT
+
+/* Define if you have the bcmp function. */
+#undef HAVE_BCMP
+
+/* Define if you have the bcopy function. */
+#undef HAVE_BCOPY
+
+/* Define if you have the bzero function. */
+#undef HAVE_BZERO
+
+/* Define if you have the getcwd function. */
+#undef HAVE_GETCWD
+
+/* Define if you have the getwd function. */
+#undef HAVE_GETWD
+
+/* Define if you have the index function. */
+#undef HAVE_INDEX
+
+/* Define if you have the memcmp function. */
+#undef HAVE_MEMCMP
+
+/* Define if you have the memcpy function. */
+#undef HAVE_MEMCPY
+
+/* Define if you have the putenv function. */
+#undef HAVE_PUTENV
+
+/* Define if you have the rindex function. */
+#undef HAVE_RINDEX
+
+/* Define if you have the strcasecmp function. */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the strchr function. */
+#undef HAVE_STRCHR
+
+/* Define if you have the strrchr function. */
+#undef HAVE_STRRCHR
+
+/* Define if you have the strstr function. */
+#undef HAVE_STRSTR
+
+/* Define if you have the strtol function. */
+#undef HAVE_STRTOL
+
+/* Define if you have the <assert.h> header file. */
+#undef HAVE_ASSERT_H
+
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/ndir.h> header file. */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the m library (-lm). */
+#undef HAVE_LIBM
diff --git a/Build/source/texk/tex4htk/config.h b/Build/source/texk/tex4htk/config.h
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/Build/source/texk/tex4htk/config.h
@@ -0,0 +1 @@
+
diff --git a/Build/source/texk/tex4htk/configure b/Build/source/texk/tex4htk/configure
new file mode 100755
index 00000000000..21464034feb
--- /dev/null
+++ b/Build/source/texk/tex4htk/configure
@@ -0,0 +1,7358 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# 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
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+ --enable-shared[=PKGS] build shared libraries [default=yes]"
+ac_help="$ac_help
+ --enable-static[=PKGS] build static libraries [default=yes]"
+ac_help="$ac_help
+ --enable-fast-install[=PKGS] optimize for fast installation [default=yes]"
+ac_help="$ac_help
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
+
+# Find the correct PATH separator. Usually this is `:', but
+# DJGPP uses `;' like DOS.
+if test "X${PATH_SEPARATOR+set}" != Xset; then
+ UNAME=${UNAME-`uname 2>/dev/null`}
+ case X$UNAME in
+ *-DOS) lt_cv_sys_path_separator=';' ;;
+ *) lt_cv_sys_path_separator=':' ;;
+ esac
+ PATH_SEPARATOR=$lt_cv_sys_path_separator
+fi
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+ac_help="$ac_help
+ --disable-libtool-lock avoid locking (might break parallel builds)"
+ac_help="$ac_help
+ --with-pic try to use only PIC/non-PIC objects [default=use both]"
+ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
+ac_help="$ac_help
+ --without-mktexmf-default do not run mktexmf if MF source missing"
+ac_help="$ac_help
+ --without-mktexpk-default do not run mktexpk if PK font missing"
+ac_help="$ac_help
+ --without-mktextfm-default do not run mktextfm if TFM file missing"
+ac_help="$ac_help
+ --without-mkocp-default do not run mkocp if OCP file missing"
+ac_help="$ac_help
+ --without-mkofm-default do not run mkofm if OFM file missing"
+ac_help="$ac_help
+ --with-mktexfmt-default run mktexfmt if format file missing"
+ac_help="$ac_help
+ --with-mktextex-default run mktextex if TeX source missing"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+ac_config_files=
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: invalid variable name: $ac_envvar" 1>&2; exit 1; }
+ fi
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=tex4ht.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${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
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+
+
+
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:733: 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=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:764: 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_prog_rejected=no
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ 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:816: 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=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $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:849: 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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 860 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:865: \"$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
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+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:891: 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:896: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+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:924: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ case $ac_dir in
+ /*|[A-z]:/*) ac_aux_dir=$ac_dir;;
+ *) ac_aux_dir=`pwd`/$ac_dir;;
+ esac
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ case $ac_dir in
+ /*|[A-z]:/*) ac_aux_dir=$ac_dir;;
+ *) ac_aux_dir=`pwd`/$ac_dir;;
+ esac
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# 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:992: 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=":"
+ # Hack for MSDOS and descendants.
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ 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.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test $ac_x $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.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1047: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+# MS-DOS is a special case, because it sort of pretends that ln -s
+# works for executables.
+if test -z "$COMSPEC" && ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:1070: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
+## Copyright 1996, 1997, 1998, 1999, 2000, 2001
+## Free Software Foundation, Inc.
+## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+# serial 46 AC_PROG_LIBTOOL
+
+
+
+
+
+# AC_LIBTOOL_HEADER_ASSERT
+# ------------------------
+# AC_LIBTOOL_HEADER_ASSERT
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+# _LT_AC_CHECK_DLFCN
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+ # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+# ---------------------------------
+# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+# _LT_AC_PROG_ECHO_BACKSLASH
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+# _LT_AC_TRY_DLOPEN_SELF
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+# AC_LIBTOOL_DLOPEN_SELF
+
+# _LT_AC_LTCONFIG_HACK
+
+# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+
+
+# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+
+
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+
+
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+
+
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+
+
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+
+
+# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
+
+
+# AC_LIBTOOL_PICMODE - implement the --with-pic flag
+# Usage: AC_LIBTOOL_PICMODE[(MODE)]
+# Where MODE is either `yes' or `no'. If omitted, it defaults to
+# `both'.
+
+
+
+# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
+
+
+
+# AC_PATH_MAGIC - find a file program which can recognise a shared library
+
+
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+
+
+# AC_PROG_LD_GNU -
+
+
+# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+
+
+# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+
+
+
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+
+
+# AC_CHECK_LIBM - check for math library
+
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library and LTDLINCL to the include flags for
+# the libltdl header and adds --enable-ltdl-convenience to the
+# configure arguments. Note that LIBLTDL and LTDLINCL are not
+# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
+# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
+# with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library and LTDLINCL to the include flags for
+# the libltdl header and adds --enable-ltdl-install to the configure
+# arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
+# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
+# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
+# with '${top_srcdir}/' (note the single quotes!). If your package is
+# not flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+
+
+# old names
+
+
+
+
+
+
+
+
+# This is just to silence aclocal about the macro not being used
+
+
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+
+
+
+# Find the correct PATH separator. Usually this is `:', but
+# DJGPP uses `;' like DOS.
+if test "X${PATH_SEPARATOR+set}" != Xset; then
+ UNAME=${UNAME-`uname 2>/dev/null`}
+ case X$UNAME in
+ *-DOS) lt_cv_sys_path_separator=';' ;;
+ *) lt_cv_sys_path_separator=':' ;;
+ esac
+ PATH_SEPARATOR=$lt_cv_sys_path_separator
+fi
+
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:1292: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1297 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:1308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:1325: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1330 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1354: 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 1369 "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:1375: \"$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 1386 "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:1392: \"$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 1403 "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:1409: \"$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
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=yes
+fi
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_fast_install=yes
+fi
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+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:1509: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:1530: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:1559: checking for ld used by GCC" >&5
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:1589: checking for GNU ld" >&5
+else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:1592: checking for non-GNU ld" >&5
+fi
+if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ echo "$ac_t""$LD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:1627: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ lt_cv_prog_gnu_ld=yes
+else
+ lt_cv_prog_gnu_ld=no
+fi
+fi
+
+echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
+echo "configure:1644: checking for $LD option to reload object files" >&5
+if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+
+echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:1656: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+ if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ else
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+
+NM="$lt_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
+echo "configure:1694: checking for a sed that does not truncate output" >&5
+if eval "test \"`echo '$''{'lt_cv_path_SED'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_executable_p="test -f"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+
+ # Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=$TMPDIR/sed$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+ { (exit 1); exit 1; }
+}
+ _max=0
+ _count=0
+ # Add /usr/xpg4/bin/sed as it is typically found on Solaris
+ # along with /bin/sed that truncates output.
+ for _sed in $_sed_list /usr/xpg4/bin/sed; do
+ test ! -f ${_sed} && break
+ cat /dev/null > "$tmp/sed.in"
+ _count=0
+ echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
+ # Check for GNU sed and select it if it is found.
+ if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
+ lt_cv_path_SED=${_sed}
+ break
+ fi
+ while true; do
+ cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
+ mv "$tmp/sed.tmp" "$tmp/sed.in"
+ cp "$tmp/sed.in" "$tmp/sed.nl"
+ echo >>"$tmp/sed.nl"
+ ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
+ cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
+ # 40000 chars as input seems more than enough
+ test $_count -gt 10 && break
+ _count=`expr $_count + 1`
+ if test $_count -gt $_max; then
+ _max=$_count
+ lt_cv_path_SED=$_sed
+ fi
+ done
+ done
+ rm -rf "$tmp"
+
+fi
+
+if test "X$SED" != "X"; then
+ lt_cv_path_SED=$SED
+else
+ SED=$lt_cv_path_SED
+fi
+echo "$ac_t""$SED" 1>&6
+
+echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
+echo "configure:1778: checking how to recognise dependent libraries" >&5
+if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin* | mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ ;;
+
+freebsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20*|hpux11*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ irix5* | nonstopux*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ case $host_cpu in
+ alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+openbsd*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+ else
+ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+
+echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:1964: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:1970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c) ;;
+ *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+ esac
+ done
+else
+ { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1990: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:2000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+if test $host != $build; then
+ ac_tool_prefix=${host_alias}-
+else
+ ac_tool_prefix=
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
+echo "configure:2031: checking command to parse $NM output" >&5
+if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris* | sysv5*)
+ symcode='[BDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $host_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ symcode='[ABCDGISTW]'
+fi
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Write the raw and C identifiers.
+lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if { (eval echo configure:2114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { (eval echo configure:2117: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if egrep ' nm_test_var$' "$nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
+ pipe_works=yes
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -f conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ global_symbol_to_cdecl=
+ global_symbol_to_c_name_address=
+else
+ global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
+ global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
+fi
+if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
+then
+ echo "$ac_t""failed" 1>&6
+else
+ echo "$ac_t""ok" 1>&6
+fi
+
+for ac_hdr in dlfcn.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2217: 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 2222 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2227: \"$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*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
+
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
+echo "configure:2263: checking for ${ac_tool_prefix}file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$ac_t""$MAGIC_CMD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ echo $ac_n "checking for file""... $ac_c" 1>&6
+echo "configure:2325: checking for file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$ac_t""$MAGIC_CMD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2396: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_RANLIB"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2429: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ RANLIB=":"
+fi
+fi
+
+# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2465: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+ echo "$ac_t""$STRIP" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_STRIP"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2498: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test $ac_x $ac_dir/$ac_word; then
+ ac_cv_prog_STRIP="strip"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+ echo "$ac_t""$STRIP" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ STRIP=":"
+fi
+fi
+
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+ :
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 2548 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:2570: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ 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
+
+ cat > conftest.$ac_ext <<EOF
+#line 2583 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=no
+fi
+rm -f 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
+
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+
+
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+need_locks="$enable_libtool_lock"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+if test x"$host" != x"$build"; then
+ ac_tool_prefix=${host_alias}-
+else
+ ac_tool_prefix=
+fi
+
+# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+case $host_os in
+linux-gnu*) ;;
+linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+esac
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Allow CC to be a program name with arguments.
+set dummy $CC
+compiler="$2"
+
+## FIXME: this should be a separate macro
+##
+echo $ac_n "checking for objdir""... $ac_c" 1>&6
+echo "configure:2712: checking for objdir" >&5
+rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+echo "$ac_t""$objdir" 1>&6
+##
+## END FIXME
+
+
+## FIXME: this should be a separate macro
+##
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+test -z "$pic_mode" && pic_mode=default
+
+# We assume here that the value for lt_cv_prog_cc_pic will not be cached
+# in isolation, and that seeing it set (from the cache) indicates that
+# the associated values are set (in the cache) correctly too.
+echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
+echo "configure:2743: checking for $compiler option to produce PIC" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_prog_cc_pic=
+ lt_cv_prog_cc_shlib=
+ lt_cv_prog_cc_wl=
+ lt_cv_prog_cc_static=
+ lt_cv_prog_cc_no_builtin=
+ lt_cv_prog_cc_can_build_shared=$can_build_shared
+
+ if test "$GCC" = yes; then
+ lt_cv_prog_cc_wl='-Wl,'
+ lt_cv_prog_cc_static='-static'
+
+ case $host_os in
+ aix*)
+ # Below there is a dirty hack to force normal static linking with -ldl
+ # The problem is because libdl dynamically linked with both libc and
+ # libC (AIX C++ library), which obviously doesn't included in libraries
+ # list by gcc. This cause undefined symbols with -static flags.
+ # This hack allows C programs to be linked with "-static -ldl", but
+ # not sure about C++ programs.
+ lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_cv_prog_cc_pic='-fno-common'
+ ;;
+ cygwin* | mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_cv_prog_cc_pic='-DDLL_EXPORT'
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_cv_prog_cc_pic=-Kconform_pic
+ fi
+ ;;
+ *)
+ lt_cv_prog_cc_pic='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for PIC flags for the system compiler.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ lt_cv_prog_cc_wl='-Wl,'
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_cv_prog_cc_static='-Bstatic'
+ else
+ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
+ lt_cv_prog_cc_wl='-Wl,'
+ lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
+ lt_cv_prog_cc_pic='+Z'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_cv_prog_cc_wl='-Wl,'
+ lt_cv_prog_cc_static='-non_shared'
+ # PIC (with -KPIC) is the default.
+ ;;
+
+ cygwin* | mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_cv_prog_cc_pic='-DDLL_EXPORT'
+ ;;
+
+ newsos6)
+ lt_cv_prog_cc_pic='-KPIC'
+ lt_cv_prog_cc_static='-Bstatic'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ # All OSF/1 code is PIC.
+ lt_cv_prog_cc_wl='-Wl,'
+ lt_cv_prog_cc_static='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ lt_cv_prog_cc_pic='-Kpic'
+ lt_cv_prog_cc_static='-dn'
+ lt_cv_prog_cc_shlib='-belf'
+ ;;
+
+ solaris*)
+ lt_cv_prog_cc_pic='-KPIC'
+ lt_cv_prog_cc_static='-Bstatic'
+ lt_cv_prog_cc_wl='-Wl,'
+ ;;
+
+ sunos4*)
+ lt_cv_prog_cc_pic='-PIC'
+ lt_cv_prog_cc_static='-Bstatic'
+ lt_cv_prog_cc_wl='-Qoption ld '
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_cv_prog_cc_pic='-KPIC'
+ lt_cv_prog_cc_static='-Bstatic'
+ lt_cv_prog_cc_wl='-Wl,'
+ ;;
+
+ uts4*)
+ lt_cv_prog_cc_pic='-pic'
+ lt_cv_prog_cc_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_cv_prog_cc_pic='-Kconform_pic'
+ lt_cv_prog_cc_static='-Bstatic'
+ fi
+ ;;
+
+ *)
+ lt_cv_prog_cc_can_build_shared=no
+ ;;
+ esac
+ fi
+
+fi
+
+if test -z "$lt_cv_prog_cc_pic"; then
+ echo "$ac_t""none" 1>&6
+else
+ echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
+
+ # Check to make sure the pic_flag actually works.
+ echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
+echo "configure:2891: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
+ if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
+ cat > conftest.$ac_ext <<EOF
+#line 2898 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ case $host_os in
+ hpux9* | hpux10* | hpux11*)
+ # On HP-UX, both CC and GCC only warn that PIC is supported... then
+ # they create non-PIC objects. So, if there were any warnings, we
+ # assume that PIC is not supported.
+ if test -s conftest.err; then
+ lt_cv_prog_cc_pic_works=no
+ else
+ lt_cv_prog_cc_pic_works=yes
+ fi
+ ;;
+ *)
+ lt_cv_prog_cc_pic_works=yes
+ ;;
+ esac
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_prog_cc_pic_works=no
+
+fi
+rm -f conftest*
+ CFLAGS="$save_CFLAGS"
+
+fi
+
+
+ if test "X$lt_cv_prog_cc_pic_works" = Xno; then
+ lt_cv_prog_cc_pic=
+ lt_cv_prog_cc_can_build_shared=no
+ else
+ lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
+ fi
+
+ echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
+fi
+##
+## END FIXME
+
+# Check for any special shared library compilation flags.
+if test -n "$lt_cv_prog_cc_shlib"; then
+ echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
+ if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then :
+ else
+ echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
+ lt_cv_prog_cc_can_build_shared=no
+ fi
+fi
+
+## FIXME: this should be a separate macro
+##
+echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
+echo "configure:2961: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_prog_cc_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
+ cat > conftest.$ac_ext <<EOF
+#line 2969 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_prog_cc_static_works=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+
+
+# Belt *and* braces to stop my trousers falling down:
+test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
+echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
+
+pic_flag="$lt_cv_prog_cc_pic"
+special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
+wl="$lt_cv_prog_cc_wl"
+link_static_flag="$lt_cv_prog_cc_static"
+no_builtin_flag="$lt_cv_prog_cc_no_builtin"
+can_build_shared="$lt_cv_prog_cc_can_build_shared"
+##
+## END FIXME
+
+
+## FIXME: this should be a separate macro
+##
+# Check to see if options -o and -c are simultaneously supported by compiler
+echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
+echo "configure:3007: checking if $compiler supports -c -o file.$ac_objext" >&5
+if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+$rm -r conftest 2>/dev/null
+mkdir conftest
+cd conftest
+echo "int some_variable = 0;" > conftest.$ac_ext
+mkdir out
+# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+# that will create temporary files in the current directory regardless of
+# the output directory. Thus, making CWD read-only will cause this test
+# to fail, enabling locking or at least warning the user not to do parallel
+# builds.
+chmod -w .
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
+compiler_c_o=no
+if { (eval echo configure:3026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s out/conftest.err; then
+ lt_cv_compiler_c_o=no
+ else
+ lt_cv_compiler_c_o=yes
+ fi
+else
+ # Append any errors to the config.log.
+ cat out/conftest.err 1>&5
+ lt_cv_compiler_c_o=no
+fi
+CFLAGS="$save_CFLAGS"
+chmod u+w .
+$rm conftest* out/*
+rmdir out
+cd ..
+rmdir conftest
+$rm -r conftest 2>/dev/null
+
+fi
+
+compiler_c_o=$lt_cv_compiler_c_o
+echo "$ac_t""$compiler_c_o" 1>&6
+
+if test x"$compiler_c_o" = x"yes"; then
+ # Check to see if we can write to a .lo
+ echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
+echo "configure:3055: checking if $compiler supports -c -o file.lo" >&5
+ if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ lt_cv_compiler_o_lo=no
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -c -o conftest.lo"
+ save_objext="$ac_objext"
+ ac_objext=lo
+ cat > conftest.$ac_ext <<EOF
+#line 3066 "configure"
+#include "confdefs.h"
+
+int main() {
+int some_variable = 0;
+; return 0; }
+EOF
+if { (eval echo configure:3073: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ lt_cv_compiler_o_lo=no
+ else
+ lt_cv_compiler_o_lo=yes
+ fi
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ ac_objext="$save_objext"
+ CFLAGS="$save_CFLAGS"
+
+fi
+
+ compiler_o_lo=$lt_cv_compiler_o_lo
+ echo "$ac_t""$compiler_o_lo" 1>&6
+else
+ compiler_o_lo=no
+fi
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+# Check to see if we can do hard links to lock some files if needed
+hard_links="nottested"
+if test "$compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
+echo "configure:3108: checking if we can lock with hard links" >&5
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$ac_t""$hard_links" 1>&6
+ if test "$hard_links" = no; then
+ echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+if test "$GCC" = yes; then
+ # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
+ echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
+echo "configure:3131: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
+ compiler_rtti_exceptions=no
+ cat > conftest.$ac_ext <<EOF
+#line 3137 "configure"
+#include "confdefs.h"
+
+int main() {
+int some_variable = 0;
+; return 0; }
+EOF
+if { (eval echo configure:3144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ compiler_rtti_exceptions=no
+ else
+ compiler_rtti_exceptions=yes
+ fi
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ CFLAGS="$save_CFLAGS"
+ echo "$ac_t""$compiler_rtti_exceptions" 1>&6
+
+ if test "$compiler_rtti_exceptions" = "yes"; then
+ no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
+ else
+ no_builtin_flag=' -fno-builtin'
+ fi
+fi
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+# See if the linker supports building shared libraries.
+echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
+echo "configure:3175: checking whether the linker ($LD) supports shared libraries" >&5
+
+allow_undefined_flag=
+no_undefined_flag=
+need_lib_prefix=unknown
+need_version=unknown
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+archive_cmds=
+archive_expsym_cmds=
+old_archive_from_new_cmds=
+old_archive_from_expsyms_cmds=
+export_dynamic_flag_spec=
+whole_archive_flag_spec=
+thread_safe_flag_spec=
+hardcode_into_libs=no
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+hardcode_shlibpath_var=unsupported
+runpath_var=
+link_all_deplibs=unknown
+always_export_symbols=no
+export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
+# include_expsyms should be a list of space-separated symbols to be *always*
+# included in the symbol list
+include_expsyms=
+# exclude_expsyms can be an egrep regular expression of symbols to exclude
+# it will be wrapped by ` (' and `)$', so one must not match beginning or
+# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+# as well as any symbol that contains `d'.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+# platforms (ab)use it in PIC code, but their linkers get confused if
+# the symbol is explicitly referenced. Since portable code cannot
+# rely on this symbol name, it's probably fine to never include it in
+# preloaded symbol tables.
+extract_expsyms_cmds=
+
+case $host_os in
+cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX, the GNU linker is very broken
+ # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can use
+ # them.
+ ld_shlibs=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+
+ extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
+ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
+ test -f $output_objdir/impgen.exe || (cd $output_objdir && \
+ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
+ else $CC -o impgen impgen.c ; fi)~
+ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
+
+ old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
+
+ # cygwin and mingw dlls have different entry points and sets of symbols
+ # to exclude.
+ # FIXME: what about values for MSVC?
+ dll_entry=__cygwin_dll_entry@12
+ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
+ case $host_os in
+ mingw*)
+ # mingw values
+ dll_entry=_DllMainCRTStartup@12
+ dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
+ ;;
+ esac
+
+ # mingw and cygwin differ, and it's simplest to just exclude the union
+ # of the two symbol sets.
+ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
+
+ # recent cygwin and mingw systems supply a stub DllMain which the user
+ # can override, but on older systems we have to supply one (in ltdll.c)
+ if test "x$lt_cv_need_dllmain" = "xyes"; then
+ ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
+ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
+ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
+ else
+ ltdll_obj=
+ ltdll_cmds=
+ fi
+
+ # Extract the symbol export list from an `--export-all' def file,
+ # then regenerate the def file from the symbol export list, so that
+ # the compiled dll only exports the symbol export list.
+ # Be careful not to strip the DATA tag left be newer dlltools.
+ export_symbols_cmds="$ltdll_cmds"'
+ $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
+ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
+
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is.
+ # If DATA tags from a recent dlltool are present, honour them!
+ archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname-def;
+ else
+ echo EXPORTS > $output_objdir/$soname-def;
+ _lt_hint=1;
+ cat $export_symbols | while read symbol; do
+ set dummy \$symbol;
+ case \$# in
+ 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+ 4) echo " \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
+ *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
+ esac;
+ _lt_hint=`expr 1 + \$_lt_hint`;
+ done;
+ fi~
+ '"$ltdll_cmds"'
+ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
+ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
+ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = yes; then
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # dlltool doesn't understand --whole-archive et. al.
+ whole_archive_flag_spec=
+ ;;
+ *)
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ ;;
+ esac
+ fi
+else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ hardcode_direct=yes
+ archive_cmds=''
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ esac
+
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ shared_flag='${wl}-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall can do strange things, so it is better to
+ # generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='${wl}-berok'
+ # This is a bit strange, but is similar to how AIX traditionally builds
+ # it's shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ ;;
+
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+ # We need to add '_' to the symbols in $export_symbols first
+ #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ whole_archive_flag_spec='-all_load $convenience'
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd*)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ case $host_os in
+ hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
+ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
+ esac
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_minus_L=yes # Not in the search PATH, but as the default
+ # location of the library.
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ openbsd*)
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ #Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ ;;
+
+ solaris*)
+ # gcc --version < 3.0 without binutils cannot create self contained
+ # shared libraries reliably, requiring libgcc.a to resolve some of
+ # the object symbols generated in some cases. Libraries that use
+ # assert need libgcc.a to resolve __eprintf, for example. Linking
+ # a copy of libgcc.a into every shared library to guarantee resolving
+ # such symbols causes other problems: According to Tim Van Holder
+ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
+ # (to the application) exception stack for one thing.
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ case `$CC --version 2>/dev/null` in
+ [12].*)
+ cat <<EOF 1>&2
+
+*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
+*** create self contained shared libraries on Solaris systems, without
+*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
+*** -no-undefined support, which will at least allow you to build shared
+*** libraries. However, you may find that when you link such libraries
+*** into an application without using GCC, you have to manually add
+*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
+*** upgrade to a newer version of GCC. Another option is to rebuild your
+*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
+
+EOF
+ no_undefined_flag=
+ ;;
+ esac
+ fi
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv5*)
+ no_undefined_flag=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ hardcode_libdir_flag_spec=
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5uw7* | unixware7*)
+ no_undefined_flag='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+echo "$ac_t""$ld_shlibs" 1>&6
+test "$ld_shlibs" = no && can_build_shared=no
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+# Check hardcoding attributes.
+echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
+echo "configure:3878: checking how to hardcode library paths into programs" >&5
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+ test -n "$runpath_var"; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$hardcode_shlibpath_var" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+echo "$ac_t""$hardcode_action" 1>&6
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+striplib=
+old_striplib=
+echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
+echo "configure:3910: checking whether stripping libraries is possible" >&5
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+##
+## END FIXME
+
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+## FIXME: this should be a separate macro
+##
+# PORTME Fill in your ld.so characteristics
+echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
+echo "configure:3928: checking dynamic linker characteristics" >&5
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}.so$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can
+ # not hardcode correct soname into executable. Probably we can
+ # add versioning support to collect2, so additional links can
+ # be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}.so$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ hardcode_into_libs=yes
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}.so'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ export_dynamic_flag_spec=-rdynamic
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ need_version=no
+ need_lib_prefix=no
+ case $GCC,$host_os in
+ yes,cygwin*)
+ library_names_spec='$libname.dll.a'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
+ postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog .libs/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ ;;
+ yes,mingw*)
+ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
+ ;;
+ yes,pw32*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
+ ;;
+ *)
+ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes.
+ library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
+ soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd*-gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU/FreeBSD ld.so'
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ *)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ dynamic_linker="$host_os dld.sl"
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
+ soname_spec='${libname}${release}.sl$major'
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *) version_type=irix ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}.so$major'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
+ soname_spec='${libname}${release}.so$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case "$host_os" in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+os2*)
+ libname_spec='$name'
+ need_lib_prefix=no
+ library_names_spec='$libname.dll $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_version=no
+ need_lib_prefix=no
+ soname_spec='${libname}${release}.so$major'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ hardcode_into_libs=yes
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}.so$major'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
+ soname_spec='$libname.so.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$ac_t""$dynamic_linker" 1>&6
+test "$dynamic_linker" = no && can_build_shared=no
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+# Report the final consequences.
+echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
+echo "configure:4356: checking if libtool supports shared libraries" >&5
+echo "$ac_t""$can_build_shared" 1>&6
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
+echo "configure:4364: checking whether to build shared libraries" >&5
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+echo "$ac_t""$enable_shared" 1>&6
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
+echo "configure:4391: checking whether to build static libraries" >&5
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$ac_t""$enable_static" 1>&6
+##
+## END FIXME
+
+if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ *)
+ echo $ac_n "checking for shl_load""... $ac_c" 1>&6
+echo "configure:4434: checking for shl_load" >&5
+if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4439 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load(); 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 shl_load();
+
+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_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+shl_load();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_shl_load=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_shl_load=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="shl_load"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
+echo "configure:4480: checking for shl_load in -ldld" >&5
+ac_lib_var=`echo dld'_'shl_load | 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="-ldld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4488 "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 shl_load();
+
+int main() {
+shl_load()
+; return 0; }
+EOF
+if { (eval echo configure:4499: \"$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
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dlopen""... $ac_c" 1>&6
+echo "configure:4518: checking for dlopen" >&5
+if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4523 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen(); 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 dlopen();
+
+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_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+dlopen();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_dlopen=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_dlopen=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dlopen"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "configure:4564: checking for dlopen in -ldl" >&5
+ac_lib_var=`echo dl'_'dlopen | 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="-ldl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4572 "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 dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+if { (eval echo configure:4583: \"$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
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
+echo "configure:4602: checking for dlopen in -lsvld" >&5
+ac_lib_var=`echo svld'_'dlopen | 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="-lsvld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4610 "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 dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+if { (eval echo configure:4621: \"$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
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
+echo "configure:4640: checking for dld_link in -ldld" >&5
+ac_lib_var=`echo dld'_'dld_link | 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="-ldld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4648 "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 dld_link();
+
+int main() {
+dld_link()
+; return 0; }
+EOF
+if { (eval echo configure:4659: \"$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
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
+echo "configure:4715: checking whether a program can dlopen itself" >&5
+if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 4725 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo configure:4786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+
+echo "$ac_t""$lt_cv_dlopen_self" 1>&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
+echo "configure:4809: checking whether a statically linked program can dlopen itself" >&5
+if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 4819 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo configure:4880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+
+echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+## FIXME: this should be a separate macro
+##
+if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
+echo "configure:4931: checking whether -lc should be explicitly linked in" >&5
+ if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ $rm conftest*
+ echo 'static int dummy;' > conftest.$ac_ext
+
+ if { (eval echo configure:4938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_cv_prog_cc_wl
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { (eval echo configure:4951: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+fi
+
+ echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
+ ;;
+ esac
+fi
+need_lc=${lt_cv_archive_cmds_need_lc-yes}
+##
+## END FIXME
+
+## FIXME: this should be a separate macro
+##
+# The second clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ :
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
+fi
+
+if test -f "$ltmain"; then
+ trap "$rm \"${ofile}T\"; exit 1" 1 2 15
+ $rm -f "${ofile}T"
+
+ echo creating $ofile
+
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS SED \
+ AR AR_FLAGS CC LD LN_S NM SHELL \
+ reload_flag reload_cmds wl \
+ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
+ thread_safe_flag_spec whole_archive_flag_spec libname_spec \
+ library_names_spec soname_spec \
+ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
+ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
+ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
+ old_striplib striplib file_magic_cmd export_symbols_cmds \
+ deplibs_check_method allow_undefined_flag no_undefined_flag \
+ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
+ global_symbol_to_c_name_address \
+ hardcode_libdir_flag_spec hardcode_libdir_separator \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
+
+ case $var in
+ reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
+ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ cat <<__EOF__ > "${ofile}T"
+#! $SHELL
+
+# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996-2000 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="${SED} -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$need_lc
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# The default C compiler.
+CC=$lt_CC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_pic_flag
+pic_mode=$pic_mode
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_compiler_c_o
+
+# Can we write directly to a .lo ?
+compiler_o_lo=$lt_compiler_o_lo
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_link_static_flag
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "${ofile}T"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2*)
+ cat <<'EOF' >> "${ofile}T"
+ # This is a source program that is used to create dlls on Windows
+ # Don't remove nor modify the starting and closing comments
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+ # This is a source program that is used to create import libraries
+ # on Windows for dlls which lack them. Don't remove nor modify the
+ # starting and closing comments
+# /* impgen.c starts here */
+# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
+#
+# This file is part of GNU libtool.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# */
+#
+# #include <stdio.h> /* for printf() */
+# #include <unistd.h> /* for open(), lseek(), read() */
+# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
+# #include <string.h> /* for strdup() */
+#
+# /* O_BINARY isn't required (or even defined sometimes) under Unix */
+# #ifndef O_BINARY
+# #define O_BINARY 0
+# #endif
+#
+# static unsigned int
+# pe_get16 (fd, offset)
+# int fd;
+# int offset;
+# {
+# unsigned char b[2];
+# lseek (fd, offset, SEEK_SET);
+# read (fd, b, 2);
+# return b[0] + (b[1]<<8);
+# }
+#
+# static unsigned int
+# pe_get32 (fd, offset)
+# int fd;
+# int offset;
+# {
+# unsigned char b[4];
+# lseek (fd, offset, SEEK_SET);
+# read (fd, b, 4);
+# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+# }
+#
+# static unsigned int
+# pe_as32 (ptr)
+# void *ptr;
+# {
+# unsigned char *b = ptr;
+# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+# }
+#
+# int
+# main (argc, argv)
+# int argc;
+# char *argv[];
+# {
+# int dll;
+# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
+# unsigned long export_rva, export_size, nsections, secptr, expptr;
+# unsigned long name_rvas, nexp;
+# unsigned char *expdata, *erva;
+# char *filename, *dll_name;
+#
+# filename = argv[1];
+#
+# dll = open(filename, O_RDONLY|O_BINARY);
+# if (dll < 1)
+# return 1;
+#
+# dll_name = filename;
+#
+# for (i=0; filename[i]; i++)
+# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
+# dll_name = filename + i +1;
+#
+# pe_header_offset = pe_get32 (dll, 0x3c);
+# opthdr_ofs = pe_header_offset + 4 + 20;
+# num_entries = pe_get32 (dll, opthdr_ofs + 92);
+#
+# if (num_entries < 1) /* no exports */
+# return 1;
+#
+# export_rva = pe_get32 (dll, opthdr_ofs + 96);
+# export_size = pe_get32 (dll, opthdr_ofs + 100);
+# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
+# secptr = (pe_header_offset + 4 + 20 +
+# pe_get16 (dll, pe_header_offset + 4 + 16));
+#
+# expptr = 0;
+# for (i = 0; i < nsections; i++)
+# {
+# char sname[8];
+# unsigned long secptr1 = secptr + 40 * i;
+# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
+# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
+# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
+# lseek(dll, secptr1, SEEK_SET);
+# read(dll, sname, 8);
+# if (vaddr <= export_rva && vaddr+vsize > export_rva)
+# {
+# expptr = fptr + (export_rva - vaddr);
+# if (export_rva + export_size > vaddr + vsize)
+# export_size = vsize - (export_rva - vaddr);
+# break;
+# }
+# }
+#
+# expdata = (unsigned char*)malloc(export_size);
+# lseek (dll, expptr, SEEK_SET);
+# read (dll, expdata, export_size);
+# erva = expdata - export_rva;
+#
+# nexp = pe_as32 (expdata+24);
+# name_rvas = pe_as32 (expdata+32);
+#
+# printf ("EXPORTS\n");
+# for (i = 0; i<nexp; i++)
+# {
+# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
+# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
+# }
+#
+# return 0;
+# }
+# /* impgen.c ends here */
+
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
+
+ mv -f "${ofile}T" "$ofile" || \
+ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
+ chmod +x "$ofile"
+fi
+##
+## END FIXME
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
+echo "configure:5547: checking for $ac_hdr that defines DIR" >&5
+if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5552 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+int main() {
+DIR *dirp = 0;
+; return 0; }
+EOF
+if { (eval echo configure:5560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_dirent_'$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
+ ac_header_dirent=$ac_hdr; break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
+echo "configure:5585: checking for opendir in -ldir" >&5
+ac_lib_var=`echo dir'_'opendir | 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="-ldir $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5593 "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 opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:5604: \"$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 -ldir"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
+echo "configure:5626: checking for opendir in -lx" >&5
+ac_lib_var=`echo x'_'opendir | 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="-lx $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5634 "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 opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:5645: \"$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 -lx"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:5668: 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 5673 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5681: \"$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
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 5698 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 5716 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5737 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:5748: \"$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 -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6
+echo "configure:5772: checking whether closedir returns void" >&5
+if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_closedir_void=yes
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5780 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_header_dirent>
+int closedir(); main() { exit(closedir(opendir(".")) != 0); }
+EOF
+if { (eval echo configure:5786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_closedir_void=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_closedir_void=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_closedir_void" 1>&6
+if test $ac_cv_func_closedir_void = yes; then
+ cat >> confdefs.h <<\EOF
+#define CLOSEDIR_VOID 1
+EOF
+
+fi
+
+for ac_hdr in assert.h float.h limits.h memory.h pwd.h stdlib.h \
+ string.h strings.h sys/param.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:5813: 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 5818 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5823: \"$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*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+for ac_func in putenv
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5853: 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 5858 "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:5881: \"$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
+LTLIBOBJS="$LTLIBOBJS putenv.lo"
+fi
+done
+
+for ac_func in strcasecmp
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5909: 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 5914 "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:5937: \"$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
+LTLIBOBJS="$LTLIBOBJS strcasecmp.lo"
+fi
+done
+
+for ac_func in strtol
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5965: 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 5970 "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:5993: \"$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
+LTLIBOBJS="$LTLIBOBJS strtol.lo"
+fi
+done
+
+for ac_func in strstr
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:6021: 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 6026 "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:6049: \"$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
+LTLIBOBJS="$LTLIBOBJS strstr.lo"
+fi
+done
+
+
+
+for ac_func in bcmp bcopy bzero getcwd getwd index memcmp memcpy rindex strchr strrchr
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:6079: 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 6084 "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:6107: \"$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
+fi
+done
+
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:6133: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6138 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this. */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in an arm
+ of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:6187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_const=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+ cat >> confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+
+# Check whether struct stat provides high-res time.
+echo $ac_n "checking for st_mtim in struct stat""... $ac_c" 1>&6
+echo "configure:6210: checking for st_mtim in struct stat" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_st_mtim'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6215 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+int main() {
+struct stat s; s.st_mtim;
+; return 0; }
+EOF
+if { (eval echo configure:6223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_struct_st_mtim=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_struct_st_mtim=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_st_mtim" 1>&6
+if test $ac_cv_struct_st_mtim = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ST_MTIM 1
+EOF
+
+fi
+
+
+# Check whether prototypes work.
+echo $ac_n "checking whether the compiler accepts prototypes""... $ac_c" 1>&6
+echo "configure:6246: checking whether the compiler accepts prototypes" >&5
+if eval "test \"`echo '$''{'kb_cv_c_prototypes'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6251 "configure"
+#include "confdefs.h"
+#include <stdarg.h>
+int main() {
+extern void foo(int i,...);
+; return 0; }
+EOF
+if { (eval echo configure:6258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ kb_cv_c_prototypes=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ kb_cv_c_prototypes=no
+fi
+rm -f conftest*
+fi
+echo "$ac_t""$kb_cv_c_prototypes" 1>&6
+if test "$kb_cv_c_prototypes" = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PROTOTYPES 1
+EOF
+
+fi
+
+# This is a GNU libc invention.
+echo $ac_n "checking whether program_invocation_name is predefined""... $ac_c" 1>&6
+echo "configure:6279: checking whether program_invocation_name is predefined" >&5
+if eval "test \"`echo '$''{'kb_cv_var_program_inv_name'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6284 "configure"
+#include "confdefs.h"
+
+int main() {
+extern char *program_invocation_name; program_invocation_name = "love";
+; return 0; }
+EOF
+if { (eval echo configure:6291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ kb_cv_var_program_inv_name=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ kb_cv_var_program_inv_name=no
+fi
+rm -f conftest*
+fi
+echo "$ac_t""$kb_cv_var_program_inv_name" 1>&6
+if test "$kb_cv_var_program_inv_name" = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PROGRAM_INVOCATION_NAME 1
+EOF
+
+fi
+
+# Some BSD putenv's, e.g., FreeBSD, do malloc/free's on the environment.
+# This test program is due to Mike Hibler <mike@cs.utah.edu>.
+# We don't actually need to run this if we don't have putenv, but it
+# doesn't hurt.
+echo $ac_n "checking whether putenv uses malloc""... $ac_c" 1>&6
+echo "configure:6315: checking whether putenv uses malloc" >&5
+if eval "test \"`echo '$''{'kb_cv_func_putenv_malloc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ kb_cv_func_putenv_malloc=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6323 "configure"
+#include "confdefs.h"
+
+#define VAR "YOW_VAR"
+#define STRING1 "GabbaGabbaHey"
+#define STRING2 "Yow!!" /* should be shorter than STRING1 */
+extern char *getenv (); /* in case char* and int don't mix gracefully */
+extern char *malloc (); /* ditto */
+main ()
+{
+ char *str1, *rstr1, *str2, *rstr2;
+ str1 = getenv (VAR);
+ if (str1)
+ exit (1);
+ str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1);
+ if (str1 == 0)
+ exit (2);
+ strcpy (str1, VAR);
+ strcat (str1, "=");
+ strcat (str1, STRING1);
+ if (putenv (str1) < 0)
+ exit (3);
+ rstr1 = getenv (VAR);
+ if (rstr1 == 0)
+ exit (4);
+ rstr1 -= strlen (VAR) + 1;
+ if (strncmp (rstr1, VAR, strlen (VAR)))
+ exit (5);
+ str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1);
+ if (str2 == 0 || str1 == str2)
+ exit (6);
+ strcpy (str2, VAR);
+ strcat (str2, "=");
+ strcat (str2, STRING2);
+ if (putenv (str2) < 0)
+ exit (7);
+ rstr2 = getenv (VAR);
+ if (rstr2 == 0)
+ exit (8);
+ rstr2 -= strlen (VAR) + 1;
+#if 0
+ printf ("rstr1=0x%x, rstr2=0x%x\n", rstr1, rstr2);
+ /*
+ * If string from first call was reused for the second call,
+ * you had better not do a free on the first string!
+ */
+ if (rstr1 == rstr2)
+ printf ("#define SMART_PUTENV\n");
+ else
+ printf ("#undef SMART_PUTENV\n");
+#endif
+ exit (rstr1 == rstr2 ? 0 : 1);
+}
+EOF
+if { (eval echo configure:6377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ kb_cv_func_putenv_malloc=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ kb_cv_func_putenv_malloc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$kb_cv_func_putenv_malloc" 1>&6
+if test $kb_cv_func_putenv_malloc = yes; then
+ cat >> confdefs.h <<\EOF
+#define SMART_PUTENV 1
+EOF
+
+fi
+
+if test $ac_cv_func_getcwd = yes; then
+# We only need to run this if we have getcwd.
+echo $ac_n "checking whether getcwd uses fork or vfork""... $ac_c" 1>&6
+echo "configure:6401: checking whether getcwd uses fork or vfork" >&5
+if eval "test \"`echo '$''{'kb_cv_func_getcwd_forks'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ kb_cv_func_getcwd_forks=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6409 "configure"
+#include "confdefs.h"
+
+int fork() { exit(1); }
+int vfork() { exit(1); }
+extern char *getcwd();
+char path[100];
+int main() {
+getcwd(path,100);
+return 0;
+}
+EOF
+if { (eval echo configure:6421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ kb_cv_func_getcwd_forks=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ kb_cv_func_getcwd_forks=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$kb_cv_func_getcwd_forks" 1>&6
+if test $kb_cv_func_getcwd_forks = yes; then
+ cat >> confdefs.h <<\EOF
+#define GETCWD_FORKS 1
+EOF
+
+fi
+fi
+
+# Common --with and --enable options.
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:6446: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+ if test "x$USE_MAINTAINER_MODE" = xyes; then
+ MAINT=
+ else
+ MAINT='#M#'
+ fi
+
+
+
+echo $ac_n "checking for loader (symbol LD)""... $ac_c" 1>&6
+echo "configure:6465: checking for loader (symbol LD)" >&5
+if eval "test \"`echo '$''{'cf_cv_subst_LD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+test -z "$LD" && LD=ld
+cf_cv_subst_LD=$LD
+fi
+
+LD=${cf_cv_subst_LD}
+echo "$ac_t""$LD" 1>&6
+
+
+echo $ac_n "checking for archiver (symbol AR)""... $ac_c" 1>&6
+echo "configure:6479: checking for archiver (symbol AR)" >&5
+if eval "test \"`echo '$''{'cf_cv_subst_AR'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+test -z "$AR" && AR=ar
+cf_cv_subst_AR=$AR
+fi
+
+AR=${cf_cv_subst_AR}
+echo "$ac_t""$AR" 1>&6
+
+
+echo $ac_n "checking for archiver options (symbol ARFLAGS)""... $ac_c" 1>&6
+echo "configure:6493: checking for archiver options (symbol ARFLAGS)" >&5
+if eval "test \"`echo '$''{'cf_cv_subst_ARFLAGS'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+test -z "$ARFLAGS" && ARFLAGS=rc
+cf_cv_subst_ARFLAGS=$ARFLAGS
+fi
+
+ARFLAGS=${cf_cv_subst_ARFLAGS}
+echo "$ac_t""$ARFLAGS" 1>&6
+
+
+
+# Check whether --with-mktexmf-default or --without-mktexmf-default was given.
+if test "${with_mktexmf_default+set}" = set; then
+ withval="$with_mktexmf_default"
+ :
+else
+ with_mktexmf_default=yes
+fi
+
+# Check whether --with-mktexpk-default or --without-mktexpk-default was given.
+if test "${with_mktexpk_default+set}" = set; then
+ withval="$with_mktexpk_default"
+ :
+else
+ with_mktexpk_default=yes
+fi
+
+# Check whether --with-mktextfm-default or --without-mktextfm-default was given.
+if test "${with_mktextfm_default+set}" = set; then
+ withval="$with_mktextfm_default"
+ :
+else
+ with_mktextfm_default=yes
+fi
+
+# Check whether --with-mkocp-default or --without-mkocp-default was given.
+if test "${with_mkocp_default+set}" = set; then
+ withval="$with_mkocp_default"
+ :
+else
+ with_mkocp_default=yes
+fi
+
+# Check whether --with-mkofm-default or --without-mkofm-default was given.
+if test "${with_mkofm_default+set}" = set; then
+ withval="$with_mkofm_default"
+ :
+else
+ with_mkofm_default=yes
+fi
+
+# Check whether --with-mktexfmt-default or --without-mktexfmt-default was given.
+if test "${with_mktexfmt_default+set}" = set; then
+ withval="$with_mktexfmt_default"
+ :
+fi
+
+# Check whether --with-mktextex-default or --without-mktextex-default was given.
+if test "${with_mktextex_default+set}" = set; then
+ withval="$with_mktextex_default"
+ with_mktextex_default=yes
+else
+ with_mktextex_default=no
+fi
+
+
+echo $ac_n "checking where the main texmf tree is located""... $ac_c" 1>&6
+echo "configure:6563: checking where the main texmf tree is located" >&5
+texmfmain=
+if test -n "$TEXMFMAIN"; then
+ texmfmain="$TEXMFMAIN"
+ echo "$ac_t""$texmfmain (from TEXMFMAIN)" 1>&6
+
+elif test "x$datadir" != 'x${prefix}/share'; then
+ # datadir is explicitly defined, assume datadir/texmf.
+ eval p=\"$datadir\"
+ # Unconditionally set the directory, but...
+ texmfmain=`echo "$p/texmf" | sed 's,//*,/,g'`
+ # ... do complain if it wasn't found.
+ if test -d "$texmfmain"; then
+ echo "$ac_t"""$texmfmain"" 1>&6
+ else
+ echo "$ac_t""not found" 1>&6
+ echo "configure: warning: No texmf tree found at datadir/texmf ($texmfmain)" 1>&2
+ echo "configure: warning: proceeding anyway.
+ *****************************************************************
+ * Warning: The main texmf tree was not found. *
+ * If you do not have the files, you should be able to find them *
+ * at the same place you got these sources, or from one of the *
+ * CTAN hosts. Good luck. *
+ *****************************************************************
+" 1>&2
+ fi
+
+else
+ # Second case, datadir is default...
+ if test "x$prefix" = "xNONE"; then
+ p="$ac_default_prefix"
+ else
+ eval p=\"$prefix\"
+ fi
+ for e in share/texmf lib/texmf texmf; do
+ if test -d "$p/$e"; then
+ texmfmain='${prefix}'/"$e"
+ break
+ fi
+ done
+ if test -z "$texmfmain" && test "x$prefix" = "xNONE"; then
+ # Still no texmfmain found, no prefix set, perhaps kpsewhich is
+ # installed and can help us out.
+ texmfmain=`kpsewhich --expand-path='$TEXMFMAIN'` 2>/dev/null
+ fi
+ texmfmain=`echo "$texmfmain" | sed 's,//*,/,g'`
+ if test -n "$texmfmain"; then
+ echo "$ac_t"""$texmfmain"" 1>&6
+ else
+ eval texmfmain="$datadir/texmf"
+ echo "$ac_t""not found" 1>&6
+ echo "configure: warning: The main texmf tree was not found at $texmfmain.
+ *****************************************************************
+ * Warning: The main texmf tree was not found. *
+ * Use the --datadir option to specify its parent directory. *
+ * If you do not have the files, you should be able to them from *
+ * the same place you got these sources from, or from one of the *
+ * CTAN hosts. *
+ *****************************************************************
+ Winging it by pretending $texmfmain is correct." 1>&2
+ fi
+fi
+
+
+
+# Implementation of those options.
+if test "x$with_mktexmf_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_TEX_MF_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mktexpk_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_TEX_PK_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mktextex_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_TEX_TEX_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mktexfmt_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_TEX_FMT_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mktextfm_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_TEX_TFM_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mkocp_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_OMEGA_OCP_BY_DEFAULT 1
+EOF
+
+fi
+if test "x$with_mkofm_default" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define MAKE_OMEGA_OFM_BY_DEFAULT 1
+EOF
+
+fi
+
+# Is libm present. FIXME: do we need it at all?
+echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
+echo "configure:6674: checking for main in -lm" >&5
+ac_lib_var=`echo m'_'main | 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="-lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6682 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:6689: \"$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 m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lm $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+# If you're cross-compiling, these macros set up the variables in
+# ../make/cross.mk: BUILDCC, BUILDCFLAGS, BUILDCCLD etc.
+if test "$cross_compiling" = yes; then
+ if test -z "${BUILDCC}"; then
+ BUILDCC='cc'
+ fi
+ echo "$ac_t""setting \$BUILDCC to ${BUILDCC}" 1>&6
+else
+ if test -n "${BUILDCC}"; then
+ echo "configure: warning: \$BUILDCC set but not cross-compiling." 1>&2
+ fi
+ BUILDCC='$(CC)'
+fi
+
+
+if test "$cross_compiling" = yes; then
+ if test -z "${BUILDCFLAGS}"; then
+ BUILDCFLAGS='$(BUILDXCFLAGS)'
+ fi
+ echo "$ac_t""setting \$BUILDCFLAGS to ${BUILDCFLAGS}" 1>&6
+else
+ if test -n "${BUILDCFLAGS}"; then
+ echo "configure: warning: \$BUILDCFLAGS set but not cross-compiling." 1>&2
+ fi
+ BUILDCFLAGS='$(CFLAGS)'
+fi
+
+
+if test "$cross_compiling" = yes; then
+ if test -z "${BUILDCPPFLAGS}"; then
+ BUILDCPPFLAGS='$(BUILDXCPPFLAGS)'
+ fi
+ echo "$ac_t""setting \$BUILDCPPFLAGS to ${BUILDCPPFLAGS}" 1>&6
+else
+ if test -n "${BUILDCPPFLAGS}"; then
+ echo "configure: warning: \$BUILDCPPFLAGS set but not cross-compiling." 1>&2
+ fi
+ BUILDCPPFLAGS='$(CPPFLAGS)'
+fi
+
+
+if test "$cross_compiling" = yes; then
+ if test -z "${BUILDLDFLAGS}"; then
+ BUILDLDFLAGS='$(BUILDXLDFLAGS)'
+ fi
+ echo "$ac_t""setting \$BUILDLDFLAGS to ${BUILDLDFLAGS}" 1>&6
+else
+ if test -n "${BUILDLDFLAGS}"; then
+ echo "configure: warning: \$BUILDLDFLAGS set but not cross-compiling." 1>&2
+ fi
+ BUILDLDFLAGS='$(LDFLAGS)'
+fi
+
+
+if test "$cross_compiling" = yes; then
+ if test -z "${BUILDCCLD}"; then
+ BUILDCCLD='$(BUILDCC)'
+ fi
+ echo "$ac_t""setting \$BUILDCCLD to ${BUILDCCLD}" 1>&6
+else
+ if test -n "${BUILDCCLD}"; then
+ echo "configure: warning: \$BUILDCCLD set but not cross-compiling." 1>&2
+ fi
+ BUILDCCLD='$(CCLD)'
+fi
+
+
+
+
+echo $ac_n "checking size of int""... $ac_c" 1>&6
+echo "configure:6787: checking size of int" >&5
+if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6795 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+main()
+{
+ FILE *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d\n", sizeof(int));
+ exit(0);
+}
+EOF
+if { (eval echo configure:6806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_sizeof_int=`cat conftestval`
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_sizeof_int=0
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$ac_cv_sizeof_int" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+EOF
+
+
+
+ac_config_files="$ac_config_files Makefile"
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | 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 \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+
+trap 'rm -fr `echo "$ac_config_files c-auto.h:c-auto.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@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
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@LN_S@%$LN_S%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@host@%$host%g
+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%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@OBJEXT@%$OBJEXT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@ECHO@%$ECHO%g
+s%@RANLIB@%$RANLIB%g
+s%@STRIP@%$STRIP%g
+s%@CPP@%$CPP%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@LTLIBOBJS@%$LTLIBOBJS%g
+s%@MAINT@%$MAINT%g
+s%@LD@%$LD%g
+s%@AR@%$AR%g
+s%@ARFLAGS@%$ARFLAGS%g
+s%@texmfmain@%$texmfmain%g
+s%@BUILDCC@%$BUILDCC%g
+s%@BUILDCFLAGS@%$BUILDCFLAGS%g
+s%@BUILDCPPFLAGS@%$BUILDCPPFLAGS%g
+s%@BUILDLDFLAGS@%$BUILDLDFLAGS%g
+s%@BUILDCCLD@%$BUILDCCLD%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"$ac_config_files"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*|[A-z]:/*) # Absolute path.
+ srcdir="$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ case "$ac_given_INSTALL" in
+ "") ;;
+ [/$]*|[A-z]:/*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ rm -f conftest.in
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%g" -e "s%^%$ac_given_srcdir/%"`
+ cat $ac_file_inputs > conftest.in
+ #
+ # Replace lines of the form ac_include foo with the contents of foo:
+ # first, from the ac_include lines construct a list of file names.
+ # From that list, we construct a second list of those files that exist.
+ # Then we construct lists of sed commands for including those files,
+ # and a sed command that removes the ac_include lines. We don't attempt
+ # to read non-existent files because some (buggy) versions of sed choke
+ # on this. Have to use sed because old (Ultrix, SunOS) awk does not support
+ # getline or system. (Anyway, configure scripts aren't supposed to use awk.)
+ # Can't use only one -e and commands {dr foo} because foo has to be last.
+ # Be careful, because the filename may contain /. Be careful with
+ # whitespace; we need to use echo.
+ #
+ file_substs=`sed -n '/^ac_include/s%ac_include[ ]*\(.*\)%\1%p' conftest.in`
+ # Create the sed command line ...
+ if test -n "$file_substs"; then
+ echo "configure: warning: ac_include is obsolete; instead use kpse_include" 1>&2
+ file_subst_cmd="sed -e 's/^ac_include/kpse_include/'"
+ else
+ file_subst_cmd='sed'
+ fi
+ kpse_substs=`sed -n '/^kpse_include/s%kpse_include[ ]*\(.*\)%\1%p' conftest.in`
+ for ac_inc in $file_substs $kpse_substs; do
+ if test -f "$ac_given_srcdir/$ac_inc"; then
+ ac_mung=`echo $ac_inc | sed 's,/,%,g'`
+ file_subst_cmd="$file_subst_cmd -e '/^kpse_include $ac_mung$/r $ac_given_srcdir/$ac_inc'"
+ fi
+ done
+ file_subst_cmd="$file_subst_cmd -e '/^kpse_include/d'"
+ # ... and fix the whitespace and escaped slashes.
+ file_subst_cmd=`echo "$file_subst_cmd" | sed -e 's,%,\\\/,g' \
+-e 's/kpse_include /kpse_include[ ]*/g'`
+ # I can't find any way to do variable substitution in the sed commands
+ # (so the user could have, e.g., $top_srcdir in their ac_include line).
+ (eval $file_subst_cmd conftest.in) \
+ | sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s* conftest.in
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ].*$%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS=" c-auto.h:c-auto.in"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%g" -e "s%^%$ac_given_srcdir/%"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+date >stamp-auto
+
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+if test "$no_recursion" != yes; then
+
+ # Remove --cache-file and --srcdir arguments so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ for ac_arg in $ac_configure_args; do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case "$ac_arg" in
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
+ esac
+ done
+
+ for ac_config_dir in : $subdirs; do
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ if test ! -d $srcdir/$ac_config_dir; then
+ continue
+ fi
+
+ echo configuring in $ac_config_dir
+
+ case "$srcdir" in
+ .) ;;
+ *)
+ if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
+ else
+ { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
+ fi
+ ;;
+ esac
+
+ ac_popdir=`pwd`
+ cd $ac_config_dir
+
+ # A "../" for each directory in /$ac_config_dir.
+ ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+
+ case "$srcdir" in
+ .) # No --srcdir option. We are building in place.
+ ac_sub_srcdir=$srcdir ;;
+ /*|[A-z]:/*) # Absolute path.
+ ac_sub_srcdir=$srcdir/$ac_config_dir ;;
+ *) # Relative path.
+ ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
+ esac
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f ./configure; then
+ ac_sub_configure=./configure
+ elif test -f $ac_sub_srcdir/configure; then
+ ac_sub_configure=$ac_sub_srcdir/configure
+ elif test -f $ac_sub_srcdir/configure.in; then
+ ac_sub_configure=$ac_configure
+ else
+ echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+
+ # Make the cache file name correct relative to the subdirectory.
+ case "$cache_file" in
+ /*|[A-z]:/*) ac_sub_cache_file=$cache_file ;;
+ *) # Relative path.
+ ac_sub_cache_file="$ac_dots$cache_file" ;;
+ esac
+ case "$ac_given_INSTALL" in
+ "") ;;
+ [/$]*|[A-z]:/*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
+ # The eval makes quoting arguments work.
+ if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
+ then :
+ else
+ { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
+ fi
+ fi
+
+ cd $ac_popdir
+ done
+fi
+
+date >stamp-auto
diff --git a/Build/source/texk/tex4htk/configure.in b/Build/source/texk/tex4htk/configure.in
new file mode 100644
index 00000000000..dec312bbeb3
--- /dev/null
+++ b/Build/source/texk/tex4htk/configure.in
@@ -0,0 +1,11 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(tex4ht.c)
+
+sinclude(../kpathsea/common.ac)
+
+AC_CHECK_SIZEOF(int)
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+dnl Update stamp-auto, since we just remade `c-auto.h'.
+date >stamp-auto
diff --git a/Build/source/texk/tex4htk/dbcontext b/Build/source/texk/tex4htk/dbcontext
new file mode 100755
index 00000000000..1ebfaab47f4
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbcontext
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/dblatex b/Build/source/texk/tex4htk/dblatex
new file mode 100755
index 00000000000..06839a344fa
--- /dev/null
+++ b/Build/source/texk/tex4htk/dblatex
@@ -0,0 +1,9 @@
+
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,docbook]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,docbook]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,docbook]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/dbmcontext b/Build/source/texk/tex4htk/dbmcontext
new file mode 100755
index 00000000000..1ebfaab47f4
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbmcontext
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/dbmex b/Build/source/texk/tex4htk/dbmex
new file mode 100755
index 00000000000..7a7be686535
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbmex
@@ -0,0 +1,9 @@
+
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/dbmlatex b/Build/source/texk/tex4htk/dbmlatex
new file mode 100755
index 00000000000..4e88f55444f
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbmlatex
@@ -0,0 +1,9 @@
+
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,docbook-mml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,docbook-mml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,docbook-mml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/dbmmex b/Build/source/texk/tex4htk/dbmmex
new file mode 100755
index 00000000000..1dd17ca311e
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbmmex
@@ -0,0 +1,9 @@
+
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/dbmtex b/Build/source/texk/tex4htk/dbmtex
new file mode 100755
index 00000000000..99108a48a52
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbmtex
@@ -0,0 +1,9 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/dbmtexexec b/Build/source/texk/tex4htk/dbmtexexec
new file mode 100755
index 00000000000..d2d8ad431d3
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbmtexexec
@@ -0,0 +1,12 @@
+
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/dbmtexi b/Build/source/texk/tex4htk/dbmtexi
new file mode 100755
index 00000000000..42451d0b3e3
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbmtexi
@@ -0,0 +1,10 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/dbtex b/Build/source/texk/tex4htk/dbtex
new file mode 100755
index 00000000000..24231d26889
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbtex
@@ -0,0 +1,9 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/dbtexexec b/Build/source/texk/tex4htk/dbtexexec
new file mode 100755
index 00000000000..d2d8ad431d3
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbtexexec
@@ -0,0 +1,12 @@
+
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/dbtexi b/Build/source/texk/tex4htk/dbtexi
new file mode 100755
index 00000000000..52f7982e61c
--- /dev/null
+++ b/Build/source/texk/tex4htk/dbtexi
@@ -0,0 +1,10 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,docbook}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/demo.tex b/Build/source/texk/tex4htk/demo.tex
new file mode 100644
index 00000000000..d05b994669e
--- /dev/null
+++ b/Build/source/texk/tex4htk/demo.tex
@@ -0,0 +1,261 @@
+% \def\CALL{{tex}{latex}}
+% \let\PC=Y
+% \let\DOS=Y
+% \def\WWW{XXX}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% test.tex %
+% %
+% Please DON'T try to understand the code of this file---it %
+% can be harmful to your eyes and brain! %
+% %
+% gurari@cis.ohio-state.edu %
+% http://www.cis.ohio-state.edu/~gurari %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\ifx \SCRIPT\UnDef
+ \ifx \PC\UnDef
+ \def\SCRIPT{
+ \Needs{cp \FN.tex \WWW \FN.txt}
+ \Needs{chmod 644 \WWW \FN.txt}
+ \Needs{ht \TEX\space
+ \FN\space
+ \ifx\WWW\empty \else ' -d\WWW\space
+ -m644'\fi}
+ }
+ \else % dos batch file
+ \def\SCRIPT{
+ \Needs{call ht \TEX\space \FN}
+ \Needs{if exist \FN.txt del \FN.txt}
+ \Needs{ren \FN.tex \FN.txt}
+ }
+\fi\fi
+
+% \def\SCRIPT{
+% \Needs{call ht \TEX\space \FN}
+% \Needs{if exist \FN.txt del /q \FN.txt}
+% \Needs{ren /q \FN.tex \FN.txt}
+% }
+
+
+
+
+\ifx \PC\UnDef
+\else
+
+\openin15=clean.bat
+\ifeof15
+\closein15
+\immediate\openout15=clean.bat
+\immediate\write15{DEL hti.bat}
+\immediate\write15{DEL htii.bat}
+\immediate\write15{DEL htiii.bat}
+\immediate\write15{DEL htiv.bat}
+\immediate\write15{DEL htv.bat}
+\immediate\write15{DEL htvi.bat}
+\immediate\write15{DEL htvii.bat}
+\immediate\write15{DEL httest.bat}
+\immediate\write15{DEL i.*}
+\immediate\write15{DEL ia.*}
+\immediate\write15{DEL ii.*}
+\immediate\write15{DEL iia.*}
+\immediate\write15{DEL iii.*}
+\immediate\write15{DEL iiia.*}
+\immediate\write15{DEL iv.*}
+\immediate\write15{DEL iv2.*}
+\immediate\write15{DEL iva2.*}
+\immediate\write15{DEL iva.*}
+\immediate\write15{DEL test*.aux}
+\immediate\write15{DEL test*.bat}
+\immediate\write15{DEL test*.dvi}
+\immediate\write15{DEL test*.htm*}
+\immediate\write15{DEL test*.css}
+\immediate\write15{DEL test*.lg}
+\immediate\write15{DEL test*.idv}
+\immediate\write15{DEL test*.log}
+\immediate\write15{DEL test*.otc}
+\immediate\write15{DEL test*.toc}
+\immediate\write15{DEL test*.txt}
+\immediate\write15{DEL test*.xre*}
+\immediate\write15{DEL tex4ht.ps}
+\immediate\write15{DEL v.*}
+\immediate\write15{DEL va.*}
+\immediate\write15{DEL vi.*}
+\immediate\write15{DEL viIa.*}
+\immediate\write15{DEL via.*}
+\immediate\write15{DEL vii.*}
+\immediate\write15{DEL viia.*}
+\immediate\write15{DEL clean.bat}
+\immediate\closeout15
+\else \closein15 \fi
+
+\fi
+
+\ifx \DOS\UnDef
+ \def\HTML{html} \def\ARG{}
+ \else \def\HTML{htm} \def\ARG{[htm]}
+ \fi
+
+\ifx \documentclass\undef \else
+ \documentclass{article}
+\fi
+\input tex4ht.sty
+\def\temp{htm}\ifx \HTML\temp
+ \Preamble{htm,no_,no^}
+\else
+ \Preamble{html,no_,no^}
+\fi
+ \ifx \documentclass\undef \else
+ \begin{document}
+ \fi
+
+ \Configure{Needs}{l. \the\inputlineno\space--- needs --- "#1" ---}
+
+
+\newlinechar=`\^^J
+
+\ifx \WWW\UnDef \let\WWW=\empty \fi
+\ifx \DOS\UnDef\else
+% \Needs{CLS} % clear screen
+\fi
+
+
+\ifx \CALL\UnDef
+ \def\TEX{\ifx \documentclass\undef \else la\fi tex}
+\else
+ \def\TEX#1#2{\def\TEX{\ifx \documentclass\undef #1\else #2\fi}}
+ \expandafter\TEX\CALL
+\fi
+
+\edef\type{\ifx \documentclass\undef \else a\fi}
+
+\def\\#1\\{\expandafter\noexpand\csname#1\endcsname}
+\catcode`\#=11 \def\Sharp{#} \catcode`\#=6
+\def\source#1#2{
+ \def\doc##1##2##3{#2}
+ \HAdvance\FileNo by 1
+ \NextFileName
+ \immediate\openout15=\FN.tex
+ \immediate\write16{--- Writing file \FN.tex}%
+ \SCRIPT
+ \immediate\write15{\ifx \documentclass\undef
+ \noexpand \input tex4ht.sty ^^J
+ \noexpand \Preamble{\HTML#1} ^^J
+ \noexpand \EndPreamble ^^J^^J\else
+ \noexpand \documentclass{article} ^^J
+ \noexpand \usepackage\ARG{tex4ht} ^^J
+ \noexpand \begin{document} ^^J^^J\fi
+ \doc{PSALMS (131:1)}
+ {My heart is not haughty, nor ^^J
+ mine eyes lofty:}
+ {neither do I ^^J
+ exercise myself in great ^^J
+ matters, or in things too high ^^J
+ for me.} ^^J^^J
+ {\\it\\ Example \FileNo\space (out of \examples)} ^^J^^J
+ \noexpand \end\ifx \documentclass\undef \else
+ {document}\fi }
+ \immediate\closeout15
+ \Link[\jobname\FileNo\type f.\HTML\space TARGET="X"]{}{}\FileNo\EndLink
+ \File+{\jobname\FileNo\type f.\HTML}
+ \HorFrames{*,*}
+ \Frame[\romannumeral\FileNo\type.txt]{}
+ \Frame[\romannumeral\FileNo\type.\HTML]{}
+ \EndPreamble
+ \Link[\romannumeral\FileNo\type.txt]{}{}outcome\EndLink{} /
+ \Link[\romannumeral\FileNo\type.\HTML]{}{}source\EndLink{} /
+ \Link{1}{}pointers\EndLink
+ \EndFile{\jobname\FileNo\type f.\HTML}
+}
+
+\def\NextFileName{\edef\FN{\romannumeral\FileNo\type}}
+
+\HAssign\examples=0\LikeRef{count}
+\HAssign\FileNo=1 \NextFileName
+
+ \VerFrames{7*,*}
+ \Frame[\jobname\FileNo\type f.\HTML\space NAME="X"]{}
+ \Frame[ NAME="Y"]{1}
+
+\EndPreamble
+
+\Link[\FN.txt]{}{}source\EndLink{} /
+\Link[\FN.\HTML]{}{}outcome\EndLink{} /
+
+\HAssign\FileNo=0
+
+\edef\temp{\noexpand\HPage<\jobname p.\HTML>}
+\temp{Pointers}\Link{}{1}~\EndLink
+
+
+Goto to Example:
+\source{%,fonts
+}{#1^^J^^J#2^^J^^J#3}
+ \def\HR{^^J\\HCode\\{<HR>}^^J}
+\source{%,fonts
+}{\HR #1 \HR #2 \HR #3 \HR}
+\source{%,fonts
+}{{\\bf\\#1}^^J^^J{\\it\\#2}^^J^^J{\\tt\\#3}}
+\source{%,fonts
+}{\\HPage\\{#1}^^J^^J#2^^J^^J#3^^J^^J
+ \\ExitHPage\\{}\\EndHPage\\{}}
+%
+\ifx \documentclass\undef
+\source{%,fonts
+}{\\Contribute\\{halign}{BORDER<>0 1 < 0 2 - 0 3 > }^^J
+\\halign\\{&\Sharp\\cr\\#1^^J&^^J#2^^J&^^J#3\\cr\\}}
+\else
+\source{%,fonts
+}{\string\begin{tabular}{|l|c|r|}^^J
+#1^^J&^^J#2^^J&^^J#3^^J
+\string\end{tabular}}
+\fi
+%
+
+ \def\d{\\scriptstyle\\ \\diamondsuit\\
+ \\diamondsuit\\ \\diamondsuit\\ }
+\ifx \documentclass\undef
+\source{%,fonts
+}{^^J
+\\settabs\\ 6 \\columns\\^^J
+\\+\\PSALMS & (131:1)\\cr\\^^J
+\\+\\My heart & is not haughty,\\cr\\ ^^J
+\\+\\nor mine & eyes lofty:\\cr\\^^J
+\\settabs\\ \\+\\ neither & do I exercise & \\cr\\^^J
+\\+\\neither & do I exercise \\cr\\^^J
+\\+\\ & myself in & great matters, \\cr\\^^J
+\\+\\or & in things & too high for me. \\cr\\^^J
+}
+\else
+\source{%,fonts
+}{^^J
+\\begin\\{tabbing}^^J
+XXXXXXXXX \\=\\\\kill\\^^J
+PSALMS \\>\\ (131:1) \string\\^^J
+My heart \\>\\ is not haughty, \string\\^^J
+nor mine \\>\\ eyes lofty:\string\\^^J
+neither \\=\\ do I exercise \\=\\ \\kill\\^^J
+neither \\>\\ do I exercise \string\\^^J
+ \\>\\ myself in \\>\\ great matters, \string\\^^J
+or \\>\\ in things \\>\\ too high for me. \string\\^^J
+\\end\\{tabbing}^^J
+}
+\fi
+%
+\source{%,fonts
+}{\ifx \documentclass\undef\space
+ \string\def\string\(\string{\string\Picture+\string{\string}\string
+ $\string}^^J
+ \string\def\string\)\string{\string$\string\EndPicture\string}^^J
+\fi
+\\Picture\\+{ ALIGN="LEFT"}\\vtop\\{\\hsize\\=2in^^J
+ \\hrule\\\\smallskip\\ #1\\smallskip\\\\hrule\\}\string
+ \EndPicture^^J #2^^J\\(\\ \d \\)\\ ^^J#3 $\d$}
+\EndHPage{}
+
+ \Tag{count}{\FileNo}
+
+\end{document}
+\endinput
+
diff --git a/Build/source/texk/tex4htk/depend.mak b/Build/source/texk/tex4htk/depend.mak
new file mode 100644
index 00000000000..9620e320a6d
--- /dev/null
+++ b/Build/source/texk/tex4htk/depend.mak
@@ -0,0 +1,97 @@
+$(objdir)/tex4ht.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/c-fopen.h \
+ $(kpathseadir)/c-pathmx.h \
+ $(kpathseadir)/proginit.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h \
+ $(kpathseadir)/tex-make.h
+
+$(objdir)/t4ht.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/c-fopen.h \
+ $(kpathseadir)/c-pathmx.h \
+ $(kpathseadir)/proginit.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h \
+ $(kpathseadir)/tex-make.h
+
+$(objdir)/runht.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-dir.h \
+ $(kpathseadir)/c-pathmx.h \
+ $(kpathseadir)/getopt.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h
+
+$(objdir)/htcmd.obj: \
+ $(kpathseadir)/config.h \
+ $(kpathseadir)/c-auto.h \
+ $(kpathseadir)/c-std.h \
+ $(kpathseadir)/c-unistd.h \
+ $(kpathseadir)/systypes.h \
+ $(kpathseadir)/c-memstr.h \
+ $(kpathseadir)/c-errno.h \
+ $(kpathseadir)/c-minmax.h \
+ $(kpathseadir)/c-limits.h \
+ $(kpathseadir)/c-proto.h \
+ $(gnuw32dir)/win32lib.h \
+ $(kpathseadir)/debug.h \
+ $(kpathseadir)/types.h \
+ $(kpathseadir)/lib.h \
+ $(kpathseadir)/progname.h \
+ $(kpathseadir)/c-ctype.h \
+ $(gnuw32dir)/oldnames.h \
+ $(kpathseadir)/c-fopen.h \
+ $(kpathseadir)/c-pathmx.h \
+ $(kpathseadir)/proginit.h \
+ $(kpathseadir)/tex-file.h \
+ $(kpathseadir)/c-vararg.h \
+ $(kpathseadir)/tex-make.h
+
diff --git a/Build/source/texk/tex4htk/depend.mk b/Build/source/texk/tex4htk/depend.mk
new file mode 100644
index 00000000000..7c4c9b22798
--- /dev/null
+++ b/Build/source/texk/tex4htk/depend.mk
@@ -0,0 +1,13 @@
+tex4ht.o: tex4ht.c \
+ $(kpathsea_srcdir)/config.h \
+ c-auto.h $(kpathsea_srcdir)/c-std.h \
+ $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
+ $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \
+ $(kpathsea_srcdir)/c-minmax.h \
+ $(kpathsea_srcdir)/c-limits.h \
+ $(kpathsea_srcdir)/c-proto.h \
+ $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/lib.h \
+ $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/c-ctype.h \
+ $(kpathsea_srcdir)/c-fopen.h \
+ $(kpathsea_srcdir)/c-pathmx.h $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-file.h \
+ $(kpathsea_srcdir)/tex-make.h
diff --git a/Build/source/texk/tex4htk/ht b/Build/source/texk/tex4htk/ht
new file mode 100644
index 00000000000..0498e529af7
--- /dev/null
+++ b/Build/source/texk/tex4htk/ht
@@ -0,0 +1,7 @@
+#!/bin/sh
+ $1 $2
+ $1 $2
+ $1 $2
+ tex4ht $2
+ t4ht $2 $3
+
diff --git a/Build/source/texk/tex4htk/htcmd.c b/Build/source/texk/tex4htk/htcmd.c
new file mode 100644
index 00000000000..a91a85c7858
--- /dev/null
+++ b/Build/source/texk/tex4htk/htcmd.c
@@ -0,0 +1,596 @@
+
+/**********************************************************/
+/* htcmd.c 2004-12-16-16:20 */
+/* Copyright (C) 1996--2004 Eitan M. Gurari */
+/* */
+/* This work may be distributed and/or modified under the */
+/* conditions of the LaTeX Project Public License, either */
+/* version 1.3 of this license or (at your option) any */
+/* later version. The latest version of this license is */
+/* in */
+/* http://www.latex-project.org/lppl.txt */
+/* and version 1.3 or later is part of all distributions */
+/* of LaTeX version 2003/12/01 or later. */
+/* */
+/* This work has the LPPL maintenance status "maintained".*/
+/* */
+/* This Current Maintainer of this work */
+/* is Eitan M. Gurari. */
+/* */
+/* However, you are allowed to modify this program */
+/* without changing its name, if you modify its */
+/* signature. Changes to the signature can be */
+/* introduced with a directive of the form */
+/* #define PLATFORM "signature" */
+/* */
+/* gurari@cse.ohio-state.edu */
+/* http://www.cse.ohio-state.edu/~gurari */
+/**********************************************************/
+
+/* **********************************************
+ Compiler options *
+ (uncommented | command line) *
+------------------------------------------------*
+ Clasic C (CC) default
+#define ANSI ansi-c, c++
+#define DOS_C
+#define HAVE_STRING_H <string.h>
+#define HAVE_DIRENT_H <dirent.h>
+#define HAVE_SYS_NDIR_H <sys/ndir.h>
+#define HAVE_SYS_DIR_H <sys/dir.h>
+#define HAVE_NDIR_H <ndir.h>
+#define HAVE_IO_H <io.h>
+#define HAVE_UNISTD_H <unistd.h>
+#define WIN32
+#define KPATHSEA
+#define SYSTEM_FUNCTION_OK
+#define CDECL ..........
+#define BCC32 bordland c++
+
+*************************************************
+ Tex4ht variables *
+ (uncommented | command line) *
+----------------------------------------------- */
+
+/* ******************************************** */
+
+
+#ifdef BCC32
+#define WIN32
+#define ANSI
+#define HAVE_IO_H
+#define HAVE_STRING_H
+#define PLATFORM "ms-win32"
+#endif
+
+
+
+#ifdef BCC
+#define DOS_C
+#define ANSI
+#define HAVE_IO_H
+#define PLATFORM "ms-dos"
+#endif
+
+
+
+#ifdef __DJGPP__
+#define DOS_WIN32
+#define ANSI
+#endif
+
+
+#ifdef DOS_C
+#define DOS
+#endif
+#ifdef DOS
+#define DOS_WIN32
+#ifndef HAVE_STRING_H
+#define HAVE_STRING_H
+#endif
+#endif
+#ifdef WIN32
+#define DOS_WIN32
+#endif
+
+#ifdef DOS_WIN32
+#define STRUCT_DIRENT
+#endif
+
+
+
+#ifdef KPATHSEA
+#ifdef WIN32
+#define KWIN32
+#endif
+#endif
+
+
+
+#include <signal.h>
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+
+#ifdef HAVE_DIRENT_H
+
+#include <dirent.h>
+
+
+#else
+#ifndef STRUCT_DIRENT
+#define STRUCT_DIRECT
+#endif
+
+#ifdef HAVE_SYS_NDIR_H
+#include <sys/ndir.h>
+#endif
+#ifdef HAVE_SYS_DIR_H
+#include <sys/dir.h>
+#endif
+#ifdef HAVE_NDIR_H
+#include <ndir.h>
+#endif
+
+
+#endif
+
+
+
+
+#ifndef __DJGPP__
+
+#ifndef F_OK
+#ifdef DOS_WIN32
+#define F_OK 0
+#endif
+#ifndef KPATHSEA
+#ifndef DOS_WIN32
+#define HAVE_UNISTD_H
+#endif
+#endif
+#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+#ifndef KPATHSEA
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#endif
+
+
+#endif
+
+
+#ifdef KPATHSEA
+#include <kpathsea/config.h>
+#include <kpathsea/c-errno.h>
+#include <kpathsea/c-ctype.h>
+#include <kpathsea/c-fopen.h>
+#include <kpathsea/c-pathmx.h>
+#include <kpathsea/proginit.h>
+#include <kpathsea/tex-file.h>
+#include <kpathsea/tex-make.h>
+#include <signal.h>
+#if !defined(_AMIGA) && !defined(WIN32)
+#include <sys/time.h>
+#endif
+#include <fcntl.h>
+#include <setjmp.h>
+#endif
+
+#ifdef __DJGPP__
+
+#ifndef F_OK
+#ifdef DOS_WIN32
+#define F_OK 0
+#endif
+#ifndef KPATHSEA
+#ifndef DOS_WIN32
+#define HAVE_UNISTD_H
+#endif
+#endif
+#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+#ifndef KPATHSEA
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#endif
+
+
+#endif
+
+
+
+
+
+
+#ifdef DOS
+#define PROTOTYP
+#endif
+#ifdef ANSI
+#define PROTOTYP
+#endif
+#ifdef KWIN32
+#define PROTOTYP
+#endif
+
+
+#ifdef KPATHSEA
+#ifdef WIN32
+#undef CDECL
+#define CDECL __cdecl
+#else
+#define CDECL
+#endif
+#endif
+
+
+#if defined(DOS_WIN32) || defined(__MSDOS__)
+#define READ_BIN_FLAGS "rb"
+#define READ_TEXT_FLAGS "r"
+#define WRITE_BIN_FLAGS "wb"
+#define WRITE_TEXT_FLAGS "w"
+#else
+#define READ_BIN_FLAGS "r"
+#define READ_TEXT_FLAGS "r"
+#define WRITE_BIN_FLAGS "w"
+#define WRITE_TEXT_FLAGS "w"
+#endif
+
+
+
+#define Q_CHAR char
+#define U_CHAR char
+#define C_CHAR char
+#define Q_NULL (Q_CHAR *) 0
+#define U_NULL (U_CHAR *) 0
+#define C_NULL (C_CHAR *) 0
+
+
+#define IGNORED void
+
+
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+
+#ifdef PROTOTYP
+#define VOID void
+#define ARG_I(x) x
+#define ARG_II(x,y) x,y
+#define ARG_III(x,y,z) x,y,z
+#define ARG_IV(x,y,z,w) x,y,z,w
+#define ARG_V(x,y,z,w,u) x,y,z,w,u
+#else
+#define VOID
+#define ARG_I(x)
+#define ARG_II(x,y)
+#define ARG_III(x,y,z)
+#define ARG_IV(x,y,z,w)
+#define ARG_V(x,y,z,w,u)
+#endif
+
+
+struct sys_call_rec{
+ Q_CHAR * filter;
+ struct sys_call_rec *next;
+};
+
+
+struct script_struct{
+ Q_CHAR *command;
+ struct script_struct *next;
+};
+
+
+#define NULL_SCRIPT (struct script_struct *) 0
+
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef BOOL
+#define BOOL int
+#endif
+
+
+#define bad_arg err_arg(0)
+#define bad_mem err_i(1)
+
+
+#define eq_str(x,y) (!strcmp(x,y))
+
+
+
+static BOOL system_yes;
+
+
+static int system_return;
+
+
+static C_CHAR *warn_err_mssg[]={
+"\n---------------------------------------------------------------\n\
+htcmd optional-flag command-line\n\n\
+ optional-flag:\n\
+ -slash translate '/' into '\\'\n\
+ -dslash translate '/' into '\\\\'\n\n\
+Example: \n\
+ htcmd t4ht name -d/WWW/temp/ -etex4ht-32.env -m644\n\
+---------------------------------------------------------------\n"
+
+ "" };
+
+
+
+static void
+
+#ifdef CDECL
+CDECL
+#endif
+
+
+sig_err(ARG_I(int));
+
+
+static void err_i( ARG_I(int) );
+
+
+static void err_arg( ARG_I(int) );
+
+
+static void call_sys(ARG_I(Q_CHAR *));
+
+
+static void strct( ARG_II(C_CHAR *, C_CHAR *) );
+
+
+
+
+static void
+
+#ifdef CDECL
+CDECL
+#endif
+
+
+sig_err
+#ifdef ANSI
+#define SEP ,
+( int s
+)
+#undef SEP
+#else
+#define SEP ;
+(s) int s
+;
+#undef SEP
+#endif
+{
+ (void) signal(s,SIG_IGN);
+ switch( s ){
+#ifdef SIGSEGV
+ case SIGSEGV: err_i(2);
+#endif
+ case SIGFPE : err_i(3);
+#if defined(SIGINT) && !defined(WIN32)
+ case SIGINT : err_i(4);
+#endif
+ }
+
+#ifdef __DJGPP__
+ if (s != SIGINT && s != SIGQUIT)
+ exit(EXIT_FAILURE);
+#endif
+
+
+}
+
+
+
+static void err_i
+#ifdef ANSI
+#define SEP ,
+( int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n) int n
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,"--- error --- ");
+ (IGNORED) fprintf(stderr, warn_err_mssg[n]);
+ exit(EXIT_FAILURE);
+}
+
+
+
+static void err_arg
+#ifdef ANSI
+#define SEP ,
+( int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n) int n
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,"--- error --- ");
+ (IGNORED) fprintf(stderr, warn_err_mssg[n]);
+ exit(EXIT_FAILURE);
+}
+
+
+
+static void call_sys
+#ifdef ANSI
+#define SEP ,
+( Q_CHAR * command
+)
+#undef SEP
+#else
+#define SEP ;
+(command) Q_CHAR * command
+;
+#undef SEP
+#endif
+{
+ if( *command ){
+ (IGNORED) printf("htcmd calls: %s\n", command);
+ system_return = system_yes? (int) system(command) : -1;
+ (IGNORED) printf("%shtcmd returns: %d\n",
+ system_return? "--- Warning --- " : "", system_return );
+ }
+}
+
+
+
+static void strct
+#ifdef ANSI
+#define SEP ,
+(
+ Q_CHAR * str1 SEP
+ Q_CHAR * str2
+
+)
+#undef SEP
+#else
+#define SEP ;
+( str1, str2 )
+ Q_CHAR * str1 SEP
+ Q_CHAR * str2
+
+;
+#undef SEP
+#endif
+{ Q_CHAR * ch;
+ ch = str1 + (int) strlen(str1);
+ (IGNORED) strcpy( ch, str2 );
+}
+
+
+
+int
+#ifdef CDECL
+CDECL
+#endif
+
+ main
+#ifdef ANSI
+#define SEP ,
+(
+ int argc SEP
+ Q_CHAR **argv
+)
+#undef SEP
+#else
+#define SEP ;
+(argc, argv)
+ int argc SEP
+ Q_CHAR **argv
+;
+#undef SEP
+#endif
+{
+int i;
+BOOL slash, dslash;
+char *in_command, *command, *p, *q;
+
+
+
+
+#ifdef SIGSEGV
+ (void) signal(SIGSEGV,sig_err);
+#endif
+ (void) signal(SIGFPE,sig_err);
+#ifdef KWIN32
+
+SetConsoleCtrlHandler((PHANDLER_ROUTINE)sigint_handler, TRUE);
+
+
+#else
+#ifdef SIGINT
+ (void) signal(SIGINT,sig_err);
+#endif
+#endif
+
+
+#ifdef PLATFORM
+ (IGNORED) printf("htcmd.c (2004-12-16-16:20 %s)\n",PLATFORM);
+#else
+ (IGNORED) printf("htcmd.c (2004-12-16-16:20)\n");
+#endif
+
+{ C_CHAR *yes = NULL;
+ system_yes = (
+#ifdef SYSTEM_FUNCTION_OK
+0
+#else
+system( yes ) != 0
+#endif
+
+);
+}
+
+
+
+ in_command = (char *) malloc(1024);
+ command = (char *) malloc(1024);
+ in_command[0] = '\0';
+
+ if( argc == 1 ){ bad_arg; }
+ slash = eq_str(argv[1],"-slash") ;
+ dslash = eq_str(argv[1],"-dslash") ;
+ for(i=1+slash+dslash; i<argc; i++){
+ (IGNORED) printf("%s ", argv[i]);
+ (IGNORED) strct(in_command,argv[i]);
+ (IGNORED) strct(in_command," ");
+ }
+ (IGNORED) printf("\n");
+
+
+
+p = in_command;
+q = command;
+do{
+ if( (*p != '"' ) && (*p != '\'' ) && (*p != '`' ) ){
+ if(slash && (*p == '/')) {
+ *(q++) = '\\';
+ }
+ else if(dslash && (*p == '/')) {
+ *(q++) = '\\';
+ *(q++) = '\\';
+ }
+ else { *(q++) = *p; }
+ }
+} while (*(p++) != '\0');
+(IGNORED) call_sys(command);
+
+
+ return 0;
+}
+
+
diff --git a/Build/source/texk/tex4htk/htcontext b/Build/source/texk/tex4htk/htcontext
new file mode 100755
index 00000000000..190ac31f862
--- /dev/null
+++ b/Build/source/texk/tex4htk/htcontext
@@ -0,0 +1,7 @@
+#!/bin/sh
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 -cvalidatehtml ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/htlatex b/Build/source/texk/tex4htk/htlatex
new file mode 100755
index 00000000000..04713bb7794
--- /dev/null
+++ b/Build/source/texk/tex4htk/htlatex
@@ -0,0 +1,9 @@
+#!/bin/sh
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 -cvalidatehtml ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/htmex b/Build/source/texk/tex4htk/htmex
new file mode 100755
index 00000000000..7e34ac6d523
--- /dev/null
+++ b/Build/source/texk/tex4htk/htmex
@@ -0,0 +1,9 @@
+#!/bin/sh
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 -cvalidatehtml ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/htperl.pl b/Build/source/texk/tex4htk/htperl.pl
new file mode 100644
index 00000000000..347663e0bb6
--- /dev/null
+++ b/Build/source/texk/tex4htk/htperl.pl
@@ -0,0 +1,45 @@
+use File::Copy;
+use File::Path;
+use File::Basename;
+
+&main ;
+
+0;
+
+sub is_absolute {
+ my ($f) = @_;
+ return $f =~ m@^([a-zA-Z]:)?[\\/]@ ;
+}
+
+sub canonicalize {
+ my ($f) = @_;
+ $f =~ s@/@\\@g;
+ return $f;
+}
+
+sub main {
+ my $src = &canonicalize($ARGV[1]);
+ my $dst = &canonicalize($ARGV[2]);
+
+ if (&is_absolute($src)) {
+ if (-d $dst) {
+ $dst = $dst . "\\" . &basename($src);
+ }
+ }
+ else {
+ if (-d $dst) {
+ $dst = "$dst\\$src";
+ &mkpath(&dirname($dst));
+ }
+ }
+
+ if ($ARGV[0] eq 'move') {
+ &move($src, $dst);
+ }
+ elsif ($ARGV[0] eq 'copy') {
+ &copy($src, $dst);
+ }
+ else {
+ print STDERR "$0: bad verb $ARGV[0]\n";
+ }
+}
diff --git a/Build/source/texk/tex4htk/httex b/Build/source/texk/tex4htk/httex
new file mode 100755
index 00000000000..1fdf5f3d940
--- /dev/null
+++ b/Build/source/texk/tex4htk/httex
@@ -0,0 +1,9 @@
+#!/bin/sh
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 -cvalidatehtml ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/httexi b/Build/source/texk/tex4htk/httexi
new file mode 100755
index 00000000000..b3d841ed9a3
--- /dev/null
+++ b/Build/source/texk/tex4htk/httexi
@@ -0,0 +1,10 @@
+#!/bin/sh
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,html}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 -cvalidatehtml ## -d~/WWW/temp/ -m644
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/mk4ht b/Build/source/texk/tex4htk/mk4ht
new file mode 100755
index 00000000000..019d9cfc7c8
--- /dev/null
+++ b/Build/source/texk/tex4htk/mk4ht
@@ -0,0 +1,153 @@
+#!/usr/bin/env perl
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+# mk4ht 2005-09-23-22:09 %
+# Copyright (C) 2003--2005 Eitan M. Gurari %
+# %
+# %
+# This work may be distributed and/or modified under the %
+# conditions of the LaTeX Project Public License, either %
+# version 1.3 of this license or (at your option) any %
+# later version. The latest version of this license is %
+# in %
+# http://www.latex-project.org/lppl.txt %
+# and version 1.3 or later is part of all distributions %
+# of LaTeX version 2003/12/01 or later. %
+# %
+# This work has the LPPL maintenance status "maintained".%
+# %
+# This Current Maintainer of this work %
+# is Eitan M. Gurari. %
+# %
+# gurari@cse.ohio-state.edu %
+# http://www.cse.ohio-state.edu/~gurari %
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+use strict;
+$^W=1; # turn warning on
+my @options = (
+ "", "ht", "", "", "", "-cvalidatehtml",
+ "ht", "htlatex", "latex", "", "", "-cvalidatehtml",
+ "ht", "httex", "tex", "", "", "-cvalidatehtml",
+ "ht", "httexi", "texi", "", "", "-cvalidatehtml",
+ "ht", "htcontext", "texexec", "", "", "-cvalidatehtml",
+ "uxh", "uxhlatex", "latex", "xhtml,uni-html4", " -cunihtf", "-cvalidate",
+ "uxh", "uxhtex", "tex", "xhtml,uni-html4", " -cunihtf", "-cvalidate",
+ "uxh", "uxhtexi", "texi", "xhtml,uni-html4", " -cunihtf", "-cvalidate",
+ "uxh", "uxhcontext","texexec", "xhtml,uni-html4", " -cunihtf", "-cvalidate",
+ "xhm", "xhmlatex", "latex", "xhtml,mathml", " -cunihtf", "-cvalidate",
+ "xhm", "xhmtex", "tex", "xhtml,mathml", " -cunihtf", "-cvalidate",
+ "xhm", "xhmtexi", "texi", "xhtml,mathml", " -cunihtf", "-cvalidate",
+ "xhm", "xhmcontext","texexec", "xhtml,mathml", " -cunihtf", "-cvalidate",
+ "mz", "mzlatex", "latex", "xhtml,mozilla", " -cmozhtf", "-cvalidate",
+ "mz", "mztex", "tex", "xhtml,mozilla", " -cmozhtf", "-cvalidate",
+ "mz", "mztexi", "texi", "xhtml,mozilla", " -cmozhtf", "-cvalidate",
+ "mz", "mzcontext", "texexec", "xhtml,mozilla", " -cmozhtf", "-cvalidate",
+ "oo", "oolatex", "latex", "xhtml,ooffice", "ooffice/\! -cmozhtf", "-coo -cvalidate",
+ "oo", "ootex", "tex", "xhtml,ooffice", "ooffice/\! -cmozhtf", "-coo -cvalidate",
+ "oo", "ootexi", "texi", "xhtml,ooffice", "ooffice/\! -cmozhtf", "-coo -cvalidate",
+ "oo", "oocontext", "texexec", "xhtml,ooffice", "ooffice/\! -cmozhtf", "-coo -cvalidate",
+ "tei", "teilatex", "latex", "xhtml,tei", " -cunihtf", "-cvalidate",
+ "tei", "teitex", "tex", "xhtml,tei", " -cunihtf", "-cvalidate",
+ "tei", "teitexi", "texi", "xhtml,tei", " -cunihtf", "-cvalidate",
+ "tei", "teicontext","texexec", "xhtml,tei", " -cunihtf", "-cvalidate",
+ "teim", "teimlatex", "latex", "xhtml,tei-mml"," -cunihtf", "-cvalidate",
+ "teim", "teimtex", "tex", "xhtml,tei-mml"," -cunihtf", "-cvalidate",
+ "teim", "teimtexi", "texi", "xhtml,tei-mml"," -cunihtf", "-cvalidate",
+ "teim", "teimcontext","texexec","xhtml,tei-mml"," -cunihtf", "-cvalidate",
+ "db", "dblatex", "latex", "xhtml,docbook", " -cunihtf", "-cvalidate",
+ "db", "dbtex", "tex", "xhtml,docbook", " -cunihtf", "-cvalidate",
+ "db", "dbtexi", "texi", "xhtml,docbook", " -cunihtf", "-cvalidate",
+ "db", "dbcontext", "texexec", "xhtml,docbook", " -cunihtf", "-cvalidate",
+ "dbm", "dbmlatex", "latex", "xhtml,docbook-mml", " -cunihtf", "-cvalidate",
+ "dbm", "dbmtex", "tex", "xhtml,docbook-mml", " -cunihtf", "-cvalidate",
+ "dbm", "dbmtexi", "texi", "xhtml,docbook-mml", " -cunihtf", "-cvalidate",
+ "dbm", "dbmcontext","texexec", "xhtml,docbook-mml", " -cunihtf", "-cvalidate",
+ "w", "wlatex", "latex", "xhtml,word", " -csymhtf", "",
+ "w", "wtex", "tex", "xhtml,word", " -csymhtf", "",
+ "w", "wtexi", "texi", "xhtml,word", " -csymhtf", "",
+ "w", "wcontext", "texexec", "xhtml,word", " -csymhtf", "",
+ "jh", "jhlatex", "latex", "html,javahelp,3.2,unicode,jh1.0", " -cmozhtf -u10", " -d%1-doc/ -cjavahelp -cvalidate",
+ "jh", "jhtex", "tex", "html,javahelp,3.2,unicode,jh1.0", " -cmozhtf -u10", " -d%1-doc/ -cjavahelp -cvalidate",
+ "jh", "jhtexi", "texi", "html,javahelp,3.2,unicode,jh1.0", " -cmozhtf -u10", " -d%1-doc/ -cjavahelp -cvalidate",
+ "jh", "jhcontext","texexec", "html,javahelp,3.2,unicode,jh1.0", " -cmozhtf -u10", " -d%1-doc/ -cjavahelp -cvalidate",
+
+);
+
+sub showInstrucions(){
+ print " option1: mk4ht #1 \"#2\" \"#3\" \"#4\" \"#5\"\n";
+ print " \n";
+ print " #1: htlatex, mzlatex, oolatex, dblatex, dbmlatex,\n";
+ print " teilatex, teimlatex, uxhlatex, wlatex, xhlatex,\n";
+ print " xhmlatex\n";
+ print " \n";
+ print " also 'tex', 'texi', and 'context' instead of 'latex'\n";
+ print " \n";
+ print " #2: file name\n";
+ print " #3: optional arguments for latex/tex/texi/context \n";
+ print " #4: optional arguments for tex4ht.c\n";
+ print " #5: optional arguments for t4ht.c\n";
+ print " \n";
+ print " option2: mk4ht ht #2 #3 \"#4\" \"#5\"\n";
+ print " \n";
+ print " #1: ht\n";
+ print " #2: latex, tex\n";
+ print " #3: file name\n";
+ print " #4: optional arguments for tex4ht.c\n";
+ print " #5: optional arguments for t4ht.c\n";
+ print " \n";
+ print " Within the program, in column three of the options\n";
+ print " variable, the requests for the commands \"latex\",\n";
+ print " \"tex\", etc. can be replaced with other equivalent\n";
+ print " commands (e.g., \"tex -fmt=latex\").\n";
+}
+
+print "mk4ht (2005-09-23-22:09)\n";
+if( !@ARGV ){
+ print "improper command\n";
+ showInstrucions(); exit(1);
+}
+my @command=("","","","","");
+my $i=0;
+my $j=0;
+my $param;
+foreach $param (@ARGV) {
+ if( $i == 0 ){
+ for( $j=1; $j<$#options; $j+=6 ){
+ if( $param eq $options[$j] ){
+ if( $options[$j-1] eq "" ){
+ $command[0] = $options[$j];
+ } else {
+ $command[0] = "ht".$options[$j+1];
+ }
+ $command[2] = $options[$j+2];
+ $command[3] = $options[$j+3];
+ $command[4] = $options[$j+4];
+ last;
+ } }
+ if( $j>$#options ){ print "improper command: $param \n";
+ showInstrucions(); exit(1); }
+ } elsif ( $i== 1 ) {
+ $command[1] = $param;
+ } elsif ( $i== 2 ) {
+ if( $command[2] eq "" ){
+ $command[2] = $param;
+ } else {
+ $command[2] = $param. "," . $command[2];
+ }
+ } elsif ( $i== 3 ) {
+ $command[3] = $param . $command[3];
+ } else {
+ $command[4] = $param. " " .$command[4];
+ }
+ $i++;
+}
+my $commando = $command[0] . " " . $command[1] . " \"".
+ $command[2] . "\" \"". $command[3] . "\" \"" .
+ $command[4] . "\"";
+print "$commando\n";
+my $rtrn;
+if( $rtrn = system($commando) ){
+ print "--- error --- failed to execute command\n";
+} else { exit( !$rtrn ); }
+
+
diff --git a/Build/source/texk/tex4htk/mzcontext b/Build/source/texk/tex4htk/mzcontext
new file mode 100755
index 00000000000..e95d48a0bf8
--- /dev/null
+++ b/Build/source/texk/tex4htk/mzcontext
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/mzlatex b/Build/source/texk/tex4htk/mzlatex
new file mode 100755
index 00000000000..44b90be5fb1
--- /dev/null
+++ b/Build/source/texk/tex4htk/mzlatex
@@ -0,0 +1,9 @@
+
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,mozilla]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,mozilla]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,mozilla]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/mzmex b/Build/source/texk/tex4htk/mzmex
new file mode 100755
index 00000000000..c4902dc6f6c
--- /dev/null
+++ b/Build/source/texk/tex4htk/mzmex
@@ -0,0 +1,9 @@
+
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/mztex b/Build/source/texk/tex4htk/mztex
new file mode 100755
index 00000000000..73ef76cc951
--- /dev/null
+++ b/Build/source/texk/tex4htk/mztex
@@ -0,0 +1,9 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/mztexexec b/Build/source/texk/tex4htk/mztexexec
new file mode 100755
index 00000000000..bebc65d3500
--- /dev/null
+++ b/Build/source/texk/tex4htk/mztexexec
@@ -0,0 +1,12 @@
+
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/mztexi b/Build/source/texk/tex4htk/mztexi
new file mode 100755
index 00000000000..8230839ddc3
--- /dev/null
+++ b/Build/source/texk/tex4htk/mztexi
@@ -0,0 +1,10 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mozilla}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/oocontext b/Build/source/texk/tex4htk/oocontext
new file mode 100755
index 00000000000..56dae400751
--- /dev/null
+++ b/Build/source/texk/tex4htk/oocontext
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -coo
+
+
+
diff --git a/Build/source/texk/tex4htk/oolatex b/Build/source/texk/tex4htk/oolatex
new file mode 100755
index 00000000000..85cf7371e00
--- /dev/null
+++ b/Build/source/texk/tex4htk/oolatex
@@ -0,0 +1,9 @@
+
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,ooffice]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,ooffice]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,ooffice]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -coo
+
+
+
diff --git a/Build/source/texk/tex4htk/oomex b/Build/source/texk/tex4htk/oomex
new file mode 100755
index 00000000000..651f2bfc497
--- /dev/null
+++ b/Build/source/texk/tex4htk/oomex
@@ -0,0 +1,9 @@
+
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -coo
+
+
+
diff --git a/Build/source/texk/tex4htk/ootex b/Build/source/texk/tex4htk/ootex
new file mode 100755
index 00000000000..3c6252c78e0
--- /dev/null
+++ b/Build/source/texk/tex4htk/ootex
@@ -0,0 +1,9 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -coo
+
+
+
diff --git a/Build/source/texk/tex4htk/ootexexec b/Build/source/texk/tex4htk/ootexexec
new file mode 100755
index 00000000000..aac89bab513
--- /dev/null
+++ b/Build/source/texk/tex4htk/ootexexec
@@ -0,0 +1,12 @@
+
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -coo
+
+
+
diff --git a/Build/source/texk/tex4htk/ootexi b/Build/source/texk/tex4htk/ootexi
new file mode 100755
index 00000000000..bd11f4f93df
--- /dev/null
+++ b/Build/source/texk/tex4htk/ootexi
@@ -0,0 +1,10 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,ooffice}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cmozhtf
+ t4ht -f/$1 $4 -coo
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/runht.c b/Build/source/texk/tex4htk/runht.c
new file mode 100644
index 00000000000..aad6c3fb3b6
--- /dev/null
+++ b/Build/source/texk/tex4htk/runht.c
@@ -0,0 +1,860 @@
+/* runht.c: routines to call tex4ht.
+
+Copyright (C) 2000 Fabrice POPINEAU.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <kpathsea/config.h>
+#include <kpathsea/lib.h>
+#include <kpathsea/progname.h>
+#include <kpathsea/c-dir.h>
+#include <kpathsea/c-pathmx.h>
+#include <kpathsea/getopt.h>
+#include <kpathsea/tex-file.h>
+
+typedef enum {
+ MATH_BITMAP = 0,
+ MATH_BITMAP_UNICODE,
+ MATH_MATHML,
+ MATH_MOZILLA,
+ MATH_LAST
+} math_type;
+
+typedef enum {
+ DTD_HTML = 0,
+ DTD_XHTML,
+ DTD_TEI,
+ DTD_DOCBOOK,
+ DTD_EBOOK,
+ DTD_HTML4WORD,
+ DTD_XHTML4WORD,
+ DTD_LAST
+} dtd_type;
+
+char *stdcfg[MATH_LAST][DTD_LAST][4] = {
+ /* MATH_BITMAP */
+ {
+ { "html", "", "alias,iso8859", "" }, /* HTML */
+ { "xhtml", "", "alias,iso8859", "" }, /* XHTML */
+ { "", "", "", "" }, /* TEI, INVALID */
+ { "", "", "", ""}, /* DOCBOOK, INVALID */
+ { "", "", "", ""}, /* EBOOK, INVALID */
+ { "html,word", "", "symbol,alias,iso8859", "" }, /* HTML4WORD */
+ { "xhtml,word", "", "symbol,alias,iso8859", "" }, /* XHTML4WORD */
+ },
+ /* MATH_BITMAP_UNICODE */
+ {
+ { "html,uni-html4", "", "unicode", "" }, /* HTML */
+ { "xhtml,uni-html4", "", "unicode", "" }, /* XHTML */
+ { "xhtml,tei", "", "unicode", "" }, /* TEI */
+ { "xhtml,docbook", "", "unicode", ""}, /* DOCBOOK */
+ { "xhtml,ebmath", "-g.png", "unicode", ""}, /* EBOOK */
+ { "", "", "", "" }, /* HTML4WORD, INVALID */
+ { "", "", "", "" }, /* XHTML4WORD,INVALID */
+ },
+ /* MATH_MATHML */
+ {
+ { "", "", "", "" }, /* HTML, INVALID */
+ { "xhtml,mathml", "", "unicode", "" }, /* XHTML */
+ { "xhtml,tei-mml", "", "unicode", "" }, /* TEI */
+ { "xhtml,docbook-mml", "", "unicode", ""}, /* DOCBOOK */
+ { "xhtml,ebook-mml", "-g.png", "unicode", ""}, /* EBOOK */
+ { "", "", "", "" }, /* HTML4WORD, INVALID */
+ { "", "", "", "" }, /* XHTML4WORD, INVALID */
+ },
+ /* MATH_MOZILLA */
+ {
+ { "", "", "", "" }, /* HTML, INVALID */
+ { "xhtml,mozilla", "", "mozilla,unicode", "" }, /* XHTML */
+ { "", "", "", "" }, /* TEI, INVALID */
+ { "", "", "", ""}, /* DOCBOOK, INVALID */
+ { "", "", "", ""}, /* EBOOK, INVALID */
+ { "", "", "", "" }, /* HTML4WORD, INVALID */
+ { "", "", "", "" }, /* XHTML4WORD, INVALID */
+ }
+};
+
+char *long_usage_string = "Usage: %s [options] file.tex [params1] [params2] [params3]\n\
+\toptions = --math=(bitmap|mathml)\n\
+ --dtd=(html|xhtml|tei|docbook|ebook)\n\
+ --mozilla\n\
+ --unicode\n\
+ --dbcs\n\
+ --symbol\n\
+ --msword\n\
+ --output-dir=<dir>\n\
+ --output-name=<name>\n\
+ --index-file\n\
+ --force\n\
+ --dry-run\n\
+ --cleanup\n\
+ --help\n\
+\tparams1 = (html|xhtml|3.2|mathml.4ht|unicode.4ht|...)*\n\
+\tparams2 = symbol,unicode,...\n\
+\tparams3 = (-p)\n";
+
+char *long_simple_usage_string = "Usage: %s [options] file.tex [\"t4ht params\"]\n\
+\toptions = --output-dir=<dir>\n\
+ --output-name=<name>\n\
+ --index-file\n\
+ --force\n\
+ --dry-run\n\
+ --cleanup\n\
+ --help\n\
+\tt4ht params = (-p|-i|...)\n";
+
+char *runstr_simple = "%s %s %s";
+
+char *runstr_tex = "tex %s \"\\def\\Link#1.a.b.c.{\\expandafter\\def\\csname tex4ht\\endcsname{\\expandafter\\def\\csname tex4ht\\endcsname{#1,html}\\input tex4ht.sty }}\\def\\HCode{\\futurelet\\HCode\\HChar}\\def\\HChar{\\ifx\\\"\\HCode\\def\\HCode\\\"##1\\\"{\\Link##1}\\expandafter\\HCode\\else\\expandafter\\Link\\fi}\\HCode %s.a.b.c.\\input %s\"";
+
+char *runstr_latex = "latex %s \"\\makeatletter\\def\\HCode{\\futurelet\\HCode\\HChar}\\def\\HChar{\\ifx\\\"\\HCode\\def\\HCode\\\"##1\\\"{\\Link##1}\\expandafter\\HCode\\else\\expandafter\\Link\\fi}\\def\\Link#1.a.b.c.{\\g@addto@macro\\@documentclasshook{\\RequirePackage[#1,html]{tex4ht}}\\let\\HCode\\documentstyle\\def\\documentstyle{\\let\\documentstyle\\HCode\\expandafter\\def\\csname tex4ht\\endcsname{#1,html}\\def\\HCode####1{\\documentstyle[tex4ht,}\\@ifnextchar[{\\HCode}{\\documentstyle[tex4ht]}}}\\makeatother\\HCode %s.a.b.c.\\input %s\"";
+
+char *runstr_texi = "tex %s \"\\def\\Link#1.a.b.c.{\\expandafter\\def\\csname tex4ht\\endcsname{\\expandafter\\def\\csname tex4ht\\endcsname{#1,html}\\input tex4ht.sty }}\\def\\HCode{\\futurelet\\HCode\\HChar}\\def\\HChar{\\ifx\\\"\\HCode\\def\\HCode\\\"##1\\\"{\\Link##1}\\expandafter\\HCode\\else\\expandafter\\Link\\fi}\\let\\svrm=\\rm\\def\\rm{\\svrm\\ifx\\c\\comment\\def\\rm{\\let\\rm=\\svrm\\catcode`\\@=12\\catcode`\\\\=0 \\csname tex4ht\\endcsname\\catcode`\\@=0\\catcode`\\\\=13 }\\expandafter\\rm\\fi}\\HCode %s.a.b.c.\\input %s\"";
+
+boolean force = false; /* Should we force LaTeX runs ? */
+boolean dry_run = false; /* Verbose trace */
+boolean cleanup = false; /* remove unused files */
+dtd_type dtd = DTD_HTML;
+math_type math = MATH_BITMAP;
+char *texargs = NULL;
+char *output_dir = NULL;
+char *output_name = NULL;
+char *texfile = NULL;
+char *texsrc = NULL;
+char *texengine = NULL;
+boolean opt_index = false;
+boolean newdest = false;
+boolean mozilla = false;
+boolean dbcs = false;
+boolean symbol = false;
+boolean msword = false;
+boolean unicode = false;
+boolean is_ht = false;
+
+#define RUN_SYSTEM(x) \
+ { int retcode = 0; \
+ if (dry_run) \
+ fprintf(stderr, "%s: running command:\n%s\n", progname, x); \
+ else { \
+ if ((retcode = system(x)) != 0) { \
+ if (retcode == -1) \
+ perror("system() failed"); \
+ if (! force) \
+ return retcode; \
+ } \
+ } \
+ }
+
+#define TESTNZ(x) ((x != NULL) && (*(x) != 0))
+#define TESTZ(x) ((x == NULL) || (*(x) == 0))
+
+#define OPT_FORCE 'f'
+#define OPT_DRY_RUN 'r'
+#define OPT_MOZILLA 'z'
+#define OPT_MSWORD 'w'
+#define OPT_UNICODE 'u'
+#define OPT_DBCS 'd'
+#define OPT_SYMBOL 's'
+#define OPT_OUTPUT_DIR 'p'
+#define OPT_OUTPUT_NAME 'o'
+#define OPT_INDEX_FILE 'i'
+#define OPT_DTD 't'
+#define OPT_MATH 'm'
+#define OPT_CLEANUP 'c'
+#define OPT_HELP '?'
+
+const struct option long_options[] =
+{
+ "force", no_argument, 0, OPT_FORCE,
+ "dry-run", no_argument, 0, OPT_DRY_RUN,
+ "mozilla", no_argument, 0, OPT_MOZILLA,
+ "msword", no_argument, 0, OPT_MSWORD,
+ "unicode", no_argument, 0, OPT_UNICODE,
+ "dbcs", no_argument, 0, OPT_DBCS,
+ "symbol", no_argument, 0, OPT_SYMBOL,
+ "output-dir", required_argument, 0, OPT_OUTPUT_DIR,
+ "output-name", required_argument, 0, OPT_OUTPUT_NAME,
+ "index-file", no_argument, 0, OPT_INDEX_FILE,
+ "dtd", required_argument, 0, OPT_DTD,
+ "math", required_argument, 0, OPT_MATH,
+ "cleanup", no_argument, 0, OPT_CLEANUP,
+ "help", no_argument, 0, OPT_HELP,
+ 0, no_argument, 0, 0,
+};
+
+char cmd[4096];
+char *progname = NULL;
+char cwd[MAXPATHLEN];
+char *ext_to_cleanup[] = { "log", "aux", "toc", "lof", "lot", "dvi",
+ "idv", "otc", "4ct", "4tc", "lg", "tmp",
+ "xref" };
+
+void popd();
+
+void do_cleanup()
+{
+ int i;
+ char *ext;
+
+#if defined(_WIN32)
+ WIN32_FIND_DATA find_file_data;
+ HANDLE hnd;
+ char *root = xstrdup(output_name);
+ int rootlen = strlen(root);
+
+ if (rootlen > 4 && _stricmp(root + rootlen - 4, ".tex") == 0)
+ root[rootlen - 4] = '\0';
+ rootlen = strlen(root);
+
+ hnd = FindFirstFile("*", &find_file_data);
+
+ while (hnd != INVALID_HANDLE_VALUE &&
+ FindNextFile(hnd, &find_file_data) != FALSE) {
+ int len = strlen(find_file_data.cFileName);
+
+ if (_strnicmp(find_file_data.cFileName, root, rootlen) != 0)
+ continue;
+
+ if (newdest) {
+ if (dry_run) {
+ fprintf(stderr, "%s: cleaning up %s\n", progname, find_file_data.cFileName);
+ }
+ else {
+ if (unlink(find_file_data.cFileName) == -1) {
+ fprintf(stderr, "%s: can't remove %s\n", progname, find_file_data.cFileName);
+ perror(find_file_data.cFileName);
+ }
+ }
+ continue;
+ }
+
+ for (i = 0, ext = ext_to_cleanup[0];
+ i < sizeof(ext_to_cleanup)/sizeof(ext_to_cleanup[0]);
+ ext = ext_to_cleanup[++i]) {
+ if (stricmp(find_file_data.cFileName + len - strlen(ext), ext) != 0)
+ continue;
+ if (dry_run) {
+ fprintf(stderr, "%s: cleaning up %s\n", progname, find_file_data.cFileName);
+ }
+ else {
+ if (unlink(find_file_data.cFileName) == -1) {
+ fprintf(stderr, "%s: can't remove %s\n", progname, find_file_data.cFileName);
+ perror(find_file_data.cFileName);
+ }
+ }
+ }
+ }
+ FindClose(hnd);
+
+#else /* ! WIN32 */
+ /* FIXME : adapt to what win32 is doing. */
+ DIR *dp;
+ struct dirent *ep;
+
+ if ((dp = opendir("."))) {
+ while ((ep = readdir(dp))) {
+ int len = strlen(ep->d_name);
+ if ((strlen(ep->d_name) < 4) ||
+ (ep->d_name[len - 4] != '.'))
+ continue;
+ for (i = 0, ext = ext_to_cleanup[0];
+ i < sizeof(ext_to_cleanup)/sizeof(ext_to_cleanup[0]);
+ ext = ext_to_cleanup[++i]) {
+ if (strcmp(ep->d_name[len - 3], ext) != 0)
+ continue;
+ if (dry_run) {
+ fprintf(stderr, "%s: cleaning up %s\n", progname, find_file_data.cFileName);
+ }
+ else {
+ if (unlink(find_file_data.cFileName) == -1) {
+ fprintf(stderr, "%s: can't remove %s\n", progname, find_file_data.cFileName);
+ perror(find_file_data.cFileName);
+ }
+ }
+ }
+ }
+ closedir(dp);
+ }
+ else
+ perror(path);
+#endif /* WIN32 */
+}
+
+void mt_exit(int code)
+{
+#if 0
+ if (cwd) {
+ popd();
+ }
+#endif
+
+ if (cleanup) {
+ if (dry_run)
+ fprintf(stderr, "%s: doing cleanup ...\n", progname);
+ else
+ do_cleanup();
+ }
+
+ if (newdest) {
+ DeleteFile(texfile);
+ }
+
+ exit(code);
+}
+
+#ifdef _WIN32
+BOOL sigint_handler(DWORD dwCtrlType)
+{
+ /* Fix me : there is a problem if a system() command is running.
+ We should wait for the son process to be interrupted.
+ Only way I can think of to do that : rewrite system() based on
+ spawn() with parsing of the command line and set a global pid
+ Next cwait(pid) in the HandlerRoutine.
+ */
+ mt_exit(2);
+ return FALSE; /* return value mandatory */
+}
+#else
+void sigint_handler (int sig)
+{
+ mt_exit(2);
+}
+#endif
+
+#if 0
+/* pushd */
+void pushd(char *p)
+{
+ if (getcwd(cwd, MAXPATHLEN) == NULL) {
+ fprintf(stderr, "%s: pushd error, can't getcwd() !\n", progname);
+ perror(p);
+ exit(1);
+ }
+
+ if (chdir(p) == -1) {
+ fprintf(stderr, "%s: pushd error, can't chdir() !\n", progname);
+ perror(p);
+ exit(1);
+ }
+}
+
+/* popd */
+void popd()
+{
+ if (cwd == NULL || *cwd == '\0') {
+ fprintf(stderr, "%s: popd warning, cwd empty !\n", progname);
+ return;
+ }
+
+ if (chdir(cwd) == -1) {
+ fprintf(stderr, "%s: popd warning, can't chdir() !\n", progname);
+ perror(cwd);
+ return;
+ }
+
+ return;
+}
+#endif
+
+void usage()
+{
+ if (is_ht) {
+ fprintf(stderr, long_simple_usage_string, progname);
+ }
+ else {
+ fprintf(stderr, long_usage_string, progname);
+ }
+ exit(1);
+}
+
+int ht(int argc, char *argv[])
+{
+ int i;
+
+ if (argc != 2 && argc != 3) {
+ usage();
+ }
+
+ sprintf(cmd, runstr_simple, texengine, texargs, texfile);
+ for (i = 0; i < 3; i++)
+ RUN_SYSTEM(cmd);
+
+ sprintf(cmd, "tex4ht %s", output_name);
+ RUN_SYSTEM(cmd);
+
+ if (TESTNZ(argv[2])) {
+ sprintf(cmd, "t4ht %s %s", output_name, argv[2]);
+ }
+ else {
+ sprintf(cmd, "t4ht %s", output_name);
+ }
+
+ if (TESTNZ(output_dir)) {
+ strcat(cmd, " -d");
+ strcat(cmd, output_dir);
+ }
+
+ RUN_SYSTEM(cmd);
+
+ return 0;
+}
+
+int ht_engine(char *runstr, int argc, char *argv[])
+{
+ int i;
+
+ if (argc < 2 || argc > 5) {
+ usage();
+ }
+
+ sprintf(cmd, runstr, texargs, argv[2], texfile);
+ for (i = 0; i < 3; i++)
+ RUN_SYSTEM(cmd);
+
+ if (TESTNZ(argv[3])) {
+ xputenv("TEX4HTFONTSET", argv[3]);
+ }
+ else {
+ xputenv("TEX4HTFONTSET", "alias,iso8859");
+ }
+
+ if (dry_run) {
+ fprintf(stderr, "TEX4HTFONTSET = %s\n", getenv("TEX4HTFONTSET"));
+ }
+
+ sprintf(cmd, "tex4ht %s %s", stdcfg[math][dtd][1], output_name);
+ RUN_SYSTEM(cmd);
+
+ if (TESTNZ(argv[4])) {
+ sprintf(cmd, "t4ht %s %s", output_name, argv[4]);
+ }
+ else {
+ sprintf(cmd, "t4ht %s", output_name);
+ }
+
+ if (TESTNZ(output_dir)) {
+ strcat(cmd, " -d");
+ strcat(cmd, output_dir);
+ }
+
+ RUN_SYSTEM(cmd);
+
+ return 0;
+}
+
+char **addto_argv(char *arg, int *argc, char **argv, int *max_args)
+{
+ if (*argc == *max_args) {
+ max_args += 10;
+ argv = (char**)(realloc(argv, *max_args * sizeof(argv[0])));
+ }
+ argv[ *argc++ ] = strdup(arg);
+ return argv;
+}
+
+char **parse_arguments(int *argc, char *argv[])
+{
+ int option_index = 0;
+ char c;
+ int maxargs = 0;
+ int i;
+
+ char **newargv;
+
+ optind = 0;
+ while ((c = getopt_long_only(*argc, argv, "", long_options, &option_index)) != EOF) {
+ switch (c) {
+
+ case OPT_HELP:
+ usage();
+ break;
+
+ case OPT_DRY_RUN:
+ dry_run = true;
+ break;
+
+ case OPT_FORCE:
+ force = true;
+ break;
+
+ case OPT_DTD:
+ if (is_ht) {
+ fprintf(stderr, "%s: wrong option, use `--help'.\n", progname);
+ exit(1);
+ }
+ if (_strcmpi(optarg, "html") == 0) {
+ dtd = DTD_HTML;
+ }
+ else if (_strcmpi(optarg, "xhtml") == 0) {
+ dtd = DTD_XHTML;
+ }
+ else if (_strcmpi(optarg, "tei") == 0) {
+ dtd = DTD_TEI;
+ }
+ else if (_strcmpi(optarg, "docbook") == 0) {
+ dtd = DTD_DOCBOOK;
+ }
+ else if (_strcmpi(optarg, "ebook") == 0) {
+ dtd = DTD_EBOOK;
+ }
+ else {
+ fprintf(stderr, "%s: invalid --dtd=%s option.\n", progname, optarg);
+ exit(1);
+ }
+ break;
+
+ case OPT_MATH:
+ if (is_ht) {
+ fprintf(stderr, "%s: wrong option, use `--help'.\n", progname);
+ exit(1);
+ }
+ if (_strcmpi(optarg, "bitmap") == 0) {
+ math = MATH_BITMAP;
+ }
+ else if (_strcmpi(optarg, "mathml") == 0) {
+ math = MATH_MATHML;
+ }
+ else {
+ fprintf(stderr, "%s: invalid --math=%s option.\n", progname, optarg);
+ exit(1);
+ }
+ break;
+
+ case OPT_MSWORD:
+ if (is_ht) {
+ fprintf(stderr, "%s: wrong option, use `--help'.\n", progname);
+ exit(1);
+ }
+ msword = true;
+ break;
+
+ case OPT_MOZILLA:
+ if (is_ht) {
+ fprintf(stderr, "%s: wrong option, use `--help'.\n", progname);
+ exit(1);
+ }
+ mozilla = true;
+ break;
+
+ case OPT_UNICODE:
+ if (is_ht) {
+ fprintf(stderr, "%s: wrong option, use `--help'.\n", progname);
+ exit(1);
+ }
+ unicode = true;
+ break;
+
+ case OPT_DBCS:
+ if (is_ht) {
+ fprintf(stderr, "%s: wrong option, use `--help'.\n", progname);
+ exit(1);
+ }
+ dbcs = true;
+ break;
+
+ case OPT_SYMBOL:
+ if (is_ht) {
+ fprintf(stderr, "%s: wrong option, use `--help'.\n", progname);
+ exit(1);
+ }
+ symbol = true;
+ break;
+
+ case OPT_OUTPUT_DIR:
+ output_dir = xstrdup(optarg);
+ if (!dir_p(optarg)) {
+ fprintf(stderr, "%s: can't output to directory %s\n", progname, optarg);
+ exit(1);
+ }
+ output_dir = xstrdup(optarg);
+ break;
+
+ case OPT_OUTPUT_NAME:
+ output_name = xstrdup(optarg);
+ break;
+
+ case OPT_INDEX_FILE:
+ opt_index = true;
+ break;
+
+ case OPT_CLEANUP:
+ cleanup = true;
+ break;
+
+ default:
+ usage();
+ break;
+ }
+ }
+
+ if (is_ht) {
+ texengine = argv[optind++];
+ }
+ else {
+ texengine = argv[0]+2;
+ }
+
+ newargv = (char **)malloc(5 * sizeof(char *));
+
+ newargv[0] = argv[0];
+ /* shifting options from argv[] list */
+ for (i = 1; optind < *argc; i++, optind++)
+ newargv[i] = argv[optind];
+ newargv[i] = NULL;
+ *argc = i;
+ for (i = *argc; i < 5; i++)
+ newargv[i] = NULL;
+
+ if (is_ht) {
+ /* Nothing else to do */
+ }
+ else {
+
+ if (dtd == DTD_TEI || dtd == DTD_EBOOK || dtd == DTD_DOCBOOK) {
+ if (math == MATH_BITMAP && ! unicode) {
+ fprintf(stderr, "%s: warning, TEI, eBook and DocBook dtds valid only with `--unicode' option.\nTurning on option `--unicode'.\n", progname);
+ unicode = true;
+ math = MATH_BITMAP_UNICODE;
+ }
+ else if (mozilla) {
+ fprintf(stderr, "%s: warning, `--mozilla' valid only with XHTML dtd. Ignored.\n", progname);
+ mozilla = false;
+ }
+ }
+
+ if (dtd = DTD_HTML) {
+ if (math == MATH_MATHML) {
+ fprintf(stderr, "%s: warning, MathML incompatible with HTML dtd, reverting to bitmap math.\n", progname);
+ math = MATH_BITMAP;
+ }
+ if (mozilla) {
+ fprintf(stderr, "%s: warning, `--mozilla' valid only with XHTML dtd. Ignored.\n", progname);
+ mozilla = false;
+ }
+ }
+
+ if (msword) {
+ if (dtd == DTD_HTML) {
+ dtd = DTD_HTML4WORD;
+ }
+ else if (dtd == DTD_XHTML) {
+ dtd = DTD_XHTML4WORD;
+ }
+ else {
+ fprintf(stderr, "%s: error, `--msword' incompatible with dtds other than HTML or XHTML. Exiting...\n", progname);
+ mt_exit(1);
+ }
+ if (unicode) {
+ fprintf(stderr, "%s: warning, `--unicode' incompatible with `--msword'. Exiting...\n", progname);
+ mt_exit(1);
+ }
+ if (math == MATH_MATHML) {
+ fprintf(stderr, "%s: warning, MathML incompatible with `--msword'. Exiting...\n", progname);
+ mt_exit(1);
+ }
+ if (mozilla) {
+ fprintf(stderr, "%s: warning, `--mozilla' incompatible with `--msword'. Exiting...\n", progname);
+ mt_exit(1);
+ }
+ }
+
+ if (math == MATH_BITMAP && unicode)
+ math = MATH_BITMAP_UNICODE;
+
+ if (TESTNZ(newargv[2]))
+ newargv[2] = concat3(newargv[2], ",", stdcfg[math][dtd][0]);
+ else
+ newargv[2] = stdcfg[math][dtd][0];
+
+ if (TESTNZ(newargv[3]))
+ newargv[3] = concat3(newargv[3], ",", stdcfg[math][dtd][2]);
+ else
+ newargv[3] = stdcfg[math][dtd][2];
+
+ if (dbcs)
+ newargv[3] = concat("dbcs,", newargv[3]);
+ if (symbol)
+ newargv[3] = concat("symbol,", newargv[3]);
+
+ if (*argc < 4)
+ *argc = 4;
+ }
+ return newargv;
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+ int retval = 0;
+
+ kpse_set_progname(argv[0]);
+ progname = xstrdup(program_invocation_short_name);
+
+#ifdef _WIN32
+ SetConsoleCtrlHandler((PHANDLER_ROUTINE)sigint_handler, TRUE);
+#else
+# ifdef SIGHUP
+ signal (SIGHUP, sigint_handler);
+# endif
+# ifdef SIGINT
+ signal (SIGINT, sigint_handler);
+# endif
+# ifdef SIGQUIT
+ signal (SIGQUIT, sigint_handler);
+# endif
+# ifdef SIGEMT
+ signal (SIGEMT, sigint_handler);
+# endif
+# ifdef SIGPIPE
+ signal (SIGPIPE, sigint_handler);
+# endif
+# ifdef SIGTERM
+ signal (SIGTERM, sigint_handler);
+# endif
+#endif
+
+ if (strlen(progname) > 4 && FILESTRNCASEEQ(progname + strlen(progname) - 4, ".exe", 4)) {
+ *(progname + strlen(progname) - 4) = '\0';
+ }
+ is_ht = FILESTRCASEEQ(progname, "ht");
+
+ argv = parse_arguments(&argc, argv);
+
+#if 0
+ fprintf(stderr, "%s:\n", progname);
+ for (i = 1; i < argc; i++)
+ fprintf(stderr, "\t argv[%d] = %s\n", i, argv[i]);
+ fprintf(stderr, "\nconfig(%d,%d) = ", math, dtd);
+ for (i = 0; i < 3; i++)
+ fprintf(stderr, "%s ", stdcfg[math][dtd][i]);
+ fprintf(stderr, "\n");
+#endif
+
+ texargs = (force ? "--interaction=nonstopmode" : "");
+
+ if (TESTZ(argv[1])) {
+ fprintf(stderr, "%s: error, no file specified.\n", progname);
+ exit(1);
+ }
+
+ texsrc = xstrdup(argv[1]);
+
+#if 0
+ /* Rely on latex / kpathsea to find the right source file. */
+ if ((strlen(texsrc) < 4)
+ || _strnicmp(texsrc + strlen(texsrc) - 4, ".tex", 4) != 0) {
+ texsrc = concat(texsrc, ".tex");
+ }
+#endif
+
+ texfile = xstrdup(texsrc);
+
+ if ((strlen(texfile) >= 4)
+ && _strnicmp(texfile + strlen(texfile) - 4, ".tex", 4) == 0) {
+ *(texfile + strlen(texfile) - 4) = '\0';
+ }
+
+ if (TESTZ(output_name)) {
+ output_name = xstrdup(texfile);
+ }
+ else {
+ if ((strlen(output_name) >= 4)
+ && _strnicmp(output_name + strlen(output_name) - 4, ".tex", 4) == 0) {
+ *(output_name + strlen(output_name) - 4) = '\0';
+ }
+ texargs = concat3(texargs, " --jobname=", output_name);
+ }
+
+#if 0
+ // copy the original name to output name if needed
+ if (TESTNZ(output_dir)) {
+ texfile = concat3(output_dir, "\\", output_name);
+ }
+ else if (TESTNZ(output_name)) {
+ texfile = xstrdup(output_name);
+ }
+ else
+ texfile = NULL;
+
+ if (texfile) {
+ unixtodos_filename(texfile);
+
+ if (dry_run) {
+ fprintf(stderr, "%s: copying %s to %s\n", progname, texsrc, texfile);
+ }
+ else {
+ if (CopyFile(texsrc, texfile, false) == 0) {
+ fprintf(stderr, "%s: failed to copy %s to %s (Error %d)\n",
+ progname, texsrc, texfile, GetLastError());
+ }
+ }
+ free(texfile);
+ }
+
+ texfile = xstrdup(output_name);
+
+ if (TESTNZ(output_dir)) {
+ pushd(output_dir);
+ xputenv("KPSE_DOT", cwd);
+ xputenv("TEXINPUTS", concatn(cwd, "/", output_dir, ";", NULL));
+ if (dry_run) {
+ fprintf(stderr, "%s: changing directory to %s\n", progname, output_dir);
+ fprintf(stderr, "%s: setting KPSE_DOT to %s\n", progname, cwd);
+ }
+ }
+#endif
+ if (is_ht) {
+ retval = ht(argc, argv);
+ }
+ else if (FILESTRCASEEQ(progname, "httex")) {
+ retval = ht_engine(runstr_tex, argc, argv);
+ }
+ else if (FILESTRCASEEQ(progname, "htlatex")) {
+ retval = ht_engine(runstr_latex, argc, argv);
+ }
+ else if (FILESTRCASEEQ(progname, "httexi")) {
+ retval = ht_engine(runstr_texi, argc, argv);
+ }
+ else {
+ fprintf(stderr, "%s: %s is unknown, aborting.\n", argv[0], progname);
+ retval = 1;
+ }
+
+ if (opt_index) {
+ /* copy dest_dir/output_name.html to dest_dir/index.html */
+ char *destfile = output_name;
+ char *indexfile = "index.html";
+
+ if (TESTNZ(output_dir)) {
+ destfile = concat3(output_dir, "\\", output_name);
+ indexfile = concat(output_dir, "\\index.html");
+ }
+
+ if ((strlen(destfile) < 5)
+ || _strnicmp(destfile + strlen(destfile) - 5, ".html", 5) != 0) {
+ destfile = concat(destfile, ".html");
+ }
+
+ if (CopyFile(destfile, indexfile, false) == 0) {
+ fprintf(stderr, "%s: failed to copy %s to %s (Error %d)\n",
+ progname, destfile, indexfile, GetLastError());
+ }
+ }
+
+ mt_exit(retval);
+
+ /* Not Reached */
+ return retval;
+}
diff --git a/Build/source/texk/tex4htk/stamp-auto.in b/Build/source/texk/tex4htk/stamp-auto.in
new file mode 100644
index 00000000000..b5a1d2caaf3
--- /dev/null
+++ b/Build/source/texk/tex4htk/stamp-auto.in
@@ -0,0 +1 @@
+Sun Mar 21 20:47:44 CET 2004
diff --git a/Build/source/texk/tex4htk/t4ht.c b/Build/source/texk/tex4htk/t4ht.c
new file mode 100644
index 00000000000..a7245202f85
--- /dev/null
+++ b/Build/source/texk/tex4htk/t4ht.c
@@ -0,0 +1,2946 @@
+
+/**********************************************************/
+/* t4ht.c 2005-08-04-07:03 */
+/* Copyright (C) 1998--2005 Eitan M. Gurari */
+/* */
+/* This work may be distributed and/or modified under the */
+/* conditions of the LaTeX Project Public License, either */
+/* version 1.3 of this license or (at your option) any */
+/* later version. The latest version of this license is */
+/* in */
+/* http://www.latex-project.org/lppl.txt */
+/* and version 1.3 or later is part of all distributions */
+/* of LaTeX version 2003/12/01 or later. */
+/* */
+/* This work has the LPPL maintenance status "maintained".*/
+/* */
+/* This Current Maintainer of this work */
+/* is Eitan M. Gurari. */
+/* */
+/* If you modify this program your changing its signature */
+/* with a directive of the following form will be */
+/* appreciated. */
+/* #define PLATFORM "signature" */
+/* */
+/* gurari@cse.ohio-state.edu */
+/* http://www.cse.ohio-state.edu/~gurari */
+/**********************************************************/
+
+/* **********************************************
+ Compiler options *
+ (uncommented | command line) *
+------------------------------------------------*
+ Classic C (CC) default
+#define ANSI ansi-c, c++
+#define DOS_C
+#define HAVE_STRING_H <string.h>
+#define HAVE_DIRENT_H <dirent.h>
+#define HAVE_SYS_NDIR_H <sys/ndir.h>
+#define HAVE_SYS_DIR_H <sys/dir.h>
+#define HAVE_NDIR_H <ndir.h>
+#define HAVE_IO_H <io.h>
+#define HAVE_UNISTD_H <unistd.h>
+#define WIN32
+#define KPATHSEA
+#define SYSTEM_FUNCTION_OK
+#define CDECL ..........
+#define BCC32 bordland c++
+
+*************************************************
+ Tex4ht variables *
+ (uncommented | command line) *
+----------------------------------------------- */
+
+#ifndef ENVFILE
+
+#endif
+
+
+/* ******************************************** */
+
+
+#ifdef BCC32
+#define WIN32
+#define ANSI
+#define HAVE_IO_H
+#define HAVE_STRING_H
+#define PLATFORM "ms-win32"
+#endif
+
+
+
+#ifdef BCC
+#define DOS_C
+#define ANSI
+#define HAVE_IO_H
+#define PLATFORM "ms-dos"
+#endif
+
+
+
+#ifdef __DJGPP__
+#define DOS_WIN32
+#define ANSI
+#endif
+
+
+#ifdef DOS_C
+#define DOS
+#endif
+#ifdef DOS
+#define DOS_WIN32
+#ifndef HAVE_STRING_H
+#define HAVE_STRING_H
+#endif
+#endif
+#ifdef WIN32
+#define DOS_WIN32
+#endif
+
+#ifdef DOS_WIN32
+#define STRUCT_DIRENT
+#endif
+
+
+
+#ifdef KPATHSEA
+#ifdef WIN32
+#define KWIN32
+#endif
+#endif
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+
+#ifdef HAVE_DIRENT_H
+
+#include <dirent.h>
+
+
+#else
+#ifndef STRUCT_DIRENT
+#define STRUCT_DIRECT
+#endif
+
+#ifdef HAVE_SYS_NDIR_H
+#include <sys/ndir.h>
+#endif
+#ifdef HAVE_SYS_DIR_H
+#include <sys/dir.h>
+#endif
+#ifdef HAVE_NDIR_H
+#include <ndir.h>
+#endif
+
+
+#endif
+
+
+#include <signal.h>
+
+
+
+
+#ifndef __DJGPP__
+
+#ifndef F_OK
+#ifdef DOS_WIN32
+#define F_OK 0
+#endif
+#ifndef KPATHSEA
+#ifndef DOS_WIN32
+#define HAVE_UNISTD_H
+#endif
+#endif
+#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+#ifndef KPATHSEA
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#endif
+
+
+#endif
+
+
+#ifdef KPATHSEA
+#include <kpathsea/config.h>
+#include <kpathsea/c-errno.h>
+#include <kpathsea/c-ctype.h>
+#include <kpathsea/c-fopen.h>
+#include <kpathsea/c-pathmx.h>
+#include <kpathsea/proginit.h>
+#include <kpathsea/tex-file.h>
+#include <kpathsea/tex-make.h>
+#include <kpathsea/variable.h>
+#include <signal.h>
+#if !defined(_AMIGA) && !defined(WIN32)
+#include <sys/time.h>
+#endif
+#include <fcntl.h>
+#include <setjmp.h>
+#endif
+
+#ifdef __DJGPP__
+
+#ifndef F_OK
+#ifdef DOS_WIN32
+#define F_OK 0
+#endif
+#ifndef KPATHSEA
+#ifndef DOS_WIN32
+#define HAVE_UNISTD_H
+#endif
+#endif
+#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+#ifndef KPATHSEA
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#endif
+
+
+#endif
+
+
+
+
+
+
+#ifdef DOS
+#define PROTOTYP
+#endif
+#ifdef ANSI
+#define PROTOTYP
+#endif
+#ifdef KWIN32
+#define PROTOTYP
+#endif
+
+
+#ifdef KPATHSEA
+#ifdef WIN32
+#undef CDECL
+#define CDECL __cdecl
+#else
+#define CDECL
+#endif
+#endif
+
+
+#if defined(DOS_WIN32) || defined(__MSDOS__)
+#define READ_BIN_FLAGS "rb"
+#define READ_TEXT_FLAGS "r"
+#define WRITE_BIN_FLAGS "wb"
+#define WRITE_TEXT_FLAGS "w"
+#else
+#define READ_BIN_FLAGS "r"
+#define READ_TEXT_FLAGS "r"
+#define WRITE_BIN_FLAGS "w"
+#define WRITE_TEXT_FLAGS "w"
+#endif
+
+
+
+#define Q_CHAR char
+#define U_CHAR char
+#define C_CHAR char
+#define Q_NULL (Q_CHAR *) 0
+#define U_NULL (U_CHAR *) 0
+#define C_NULL (C_CHAR *) 0
+
+
+#define IGNORED void
+
+
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+
+#ifdef PROTOTYP
+#define MYVOID void
+#define ARG_I(x) x
+#define ARG_II(x,y) x,y
+#define ARG_III(x,y,z) x,y,z
+#define ARG_IV(x,y,z,w) x,y,z,w
+#define ARG_V(x,y,z,w,u) x,y,z,w,u
+#else
+#define MYVOID
+#define ARG_I(x)
+#define ARG_II(x,y)
+#define ARG_III(x,y,z)
+#define ARG_IV(x,y,z,w)
+#define ARG_V(x,y,z,w,u)
+#endif
+
+
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+#define dir_path_slash(str) (is_forward_slash(str)? '/' : '\\')
+#else
+#define dir_path_slash(str) '/'
+#endif
+
+
+struct htf_struct{
+ Q_CHAR *key, *body;
+ struct htf_struct *next;
+};
+
+
+struct empty_pic_struct{
+ long int n;
+ struct empty_pic_struct *next;
+};
+
+
+#ifndef HTFDIR
+#define HTFDIR ""
+#endif
+
+
+struct files_rec{
+ FILE* file;
+ char *name, *group, op;
+ Q_CHAR file_mode[5];
+ int loc, label;
+ struct files_rec *from_rec, *right, *left, *down, *up;
+};
+#define No_op 0
+#define From_op 1
+#define Until_op 2
+#define Skip_op 3
+#define Cont_op 4
+#define Addr_op 5
+#define Set_op 6
+
+
+struct env_c_rec{
+ Q_CHAR *option;
+ struct env_c_rec *next;
+};
+
+
+struct sys_call_rec{
+ Q_CHAR * filter;
+ struct sys_call_rec *next;
+};
+
+
+struct script_struct{
+ Q_CHAR *command;
+ struct script_struct *next;
+};
+
+
+#define NULL_SCRIPT (struct script_struct *) 0
+
+
+#define LG_EXT ".lg"
+
+
+#define bad_arg err_arg(0)
+#define bad_mem err_i(1)
+
+
+#define eq_str(x,y) (!strcmp(x,y))
+
+
+#define m_alloc(typ,n) (typ *) malloc_chk((int) ((n) * sizeof(typ)))
+
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef BOOL
+#define BOOL int
+#endif
+
+
+#define eq_str(x,y) (!strcmp(x,y))
+
+
+
+static int eoln_ch;
+
+
+static Q_CHAR *ch_mod = Q_NULL;
+static Q_CHAR *debug = Q_NULL;
+static Q_CHAR *Xfield = Q_NULL;
+static Q_CHAR *Dotfield = Q_NULL;
+static Q_CHAR *dir = Q_NULL;
+static Q_CHAR *lg_name = Q_NULL, tmp_name[255], job_name[255];
+static Q_CHAR *nopict = Q_NULL;
+static BOOL newchmod = FALSE;
+static Q_CHAR *noreuse = Q_NULL;
+
+
+U_CHAR *HOME_DIR;
+
+
+static struct htf_struct *htf_rec = (struct htf_struct *) 0;
+
+
+static struct env_c_rec *envChoice
+ = (struct env_c_rec*) 0;
+
+
+static BOOL system_yes;
+static struct sys_call_rec *system_calls = (struct sys_call_rec *) 0;
+
+
+static BOOL status;
+
+
+static char *Font_css_base = NULL,
+ *Font_css_mag = NULL;
+static int base_font_size = 10;
+
+
+static struct script_struct
+ * dvigif_script = NULL_SCRIPT,
+ * dvigif_glyp_script = NULL_SCRIPT,
+ * move_script = NULL_SCRIPT,
+ * empty_fig_script = NULL_SCRIPT,
+ * copy_script = NULL_SCRIPT,
+ *
+file_script
+
+ = NULL_SCRIPT,
+ *
+ext_script
+
+ = NULL_SCRIPT,
+ * chmod_script = NULL_SCRIPT;
+
+
+static FILE* lg_file;
+static long begin_lg_file;
+
+
+static C_CHAR warning[] = "--- warning --- ";
+
+
+static C_CHAR *warn_err_mssg[]={
+
+"\n--------------------------------------------------------------------\n"
+"t4ht [-f<dir char>]filename ...\n"
+" -c... choose named segment in env file\n"
+" -d... directory for output files (default: current)\n"
+" -e... location of tex4ht.env\n"
+" -i debugging info\n"
+" -m... chmod ... of new output files (reused bitmaps excluded)\n"
+" -p don't convert pictures (default: convert)\n"
+" -r replace bitmaps of all glyphs (default: reuse old ones)\n"
+" -M... chmod ... of all output files\n"
+" -S... permission for system calls: *-always, filter\n"
+" -X... content for field %%3 in X scripts\n"
+" -.... content for field %%2 in . scripts\n\n"
+"Example: \n"
+" t4ht name -d/WWW/temp/ -etex4ht-32.env -m644\n"
+"--------------------------------------------------------------------\n"
+
+,
+"Insufficient memory\n",
+
+"Illegal storage address\n",
+"Floating-point\n",
+"Interrupt with Cntr-C\n",
+
+
+"Can't find/open file `%s'\n",
+
+ "" };
+
+
+static Q_CHAR command[255];
+static int system_return;
+
+
+static BOOL system_yes;
+
+
+static Q_CHAR* match[10];
+static int max_match[10];
+
+
+
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+ static BOOL is_forward_slash( ARG_I(Q_CHAR *) );
+#endif
+
+
+static char * abs_addr( ARG_II( U_CHAR *, U_CHAR *) );
+
+
+static void execute_script(
+ ARG_V(struct script_struct*,Q_CHAR *,char *,Q_CHAR *,Q_CHAR *) );
+
+
+static struct script_struct * filterGifScript(
+ ARG_II( struct script_struct *, Q_CHAR *) );
+
+
+void free_script(
+ ARG_I( struct script_struct *) );
+
+
+static BOOL strpre( ARG_II(char *,char *) );
+
+
+static struct script_struct * add_script( ARG_I(struct script_struct *) );
+
+
+static FILE* f_open( ARG_II(char*,char*) );
+
+
+static FILE* f_home_open( ARG_II(char*,char*) );
+
+
+static FILE* open_file( ARG_II(C_CHAR *, C_CHAR *) );
+
+
+static void err_i( ARG_I(int) );
+
+
+static void err_arg( ARG_I(int) );
+
+
+static void warn_i_str( ARG_II(int,Q_CHAR *) );
+
+
+static void
+
+#ifdef CDECL
+CDECL
+#endif
+
+
+sig_err(ARG_I(int));
+
+
+#ifdef KWIN32
+static BOOL sigint_handler(ARG_I(DWORD));
+#endif
+
+
+static void call_sys(ARG_I(Q_CHAR *));
+
+
+static void strct( ARG_II(C_CHAR *, C_CHAR *) );
+
+
+static long int get_long_int( ARG_I(Q_CHAR *) );
+
+
+static void* malloc_chk(ARG_I(int));
+
+
+static void* r_alloc(ARG_II(void *, size_t));
+
+
+static BOOL scan_until_end_str( ARG_IV(C_CHAR *, int, BOOL, FILE *) );
+
+
+static BOOL scan_until_str( ARG_IV(C_CHAR *, int, BOOL, FILE *) );
+
+
+static BOOL scan_str( ARG_III(C_CHAR *, BOOL, FILE *) );
+
+
+
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+
+static BOOL is_forward_slash
+#ifdef ANSI
+#define SEP ,
+(
+ Q_CHAR * str
+)
+#undef SEP
+#else
+#define SEP ;
+(str)
+ Q_CHAR * str
+;
+#undef SEP
+#endif
+{
+ while( *str ){ if( *(str++) == '/' ) { return TRUE; } }
+ return FALSE;
+}
+#endif
+
+
+
+static char * abs_addr
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR *dir SEP
+ U_CHAR *base
+
+)
+#undef SEP
+#else
+#define SEP ;
+( dir, base)
+ U_CHAR *dir SEP
+ U_CHAR *base
+
+;
+#undef SEP
+#endif
+{ U_CHAR *p;
+ p = m_alloc(char, (int) strlen( dir ) +
+ (base? (int) strlen( base ):0) +
+ (int) strlen( HOME_DIR ));
+ *p = '\0';
+ if( (*(dir+1) == '~') && base ){
+ if( *base == '~' ){
+ (IGNORED) strct(p, HOME_DIR);
+ (IGNORED) strct(p, base+1);
+ } else {
+ (IGNORED) strct(p, base);
+ }
+ (IGNORED) strct(p, dir+2);
+ } else {
+ (IGNORED) strct(p, HOME_DIR);
+ (IGNORED) strct(p, dir+1);
+ }
+ return p;
+}
+
+
+
+static void execute_script
+#ifdef ANSI
+#define SEP ,
+(
+ struct script_struct* script SEP
+ Q_CHAR * match_1 SEP
+ Q_CHAR * match_2 SEP
+ Q_CHAR * match_3 SEP
+ Q_CHAR * match_4
+
+)
+#undef SEP
+#else
+#define SEP ;
+(script,match_1,match_2,match_3,match_4)
+ struct script_struct* script SEP
+ Q_CHAR * match_1 SEP
+ Q_CHAR * match_2 SEP
+ Q_CHAR * match_3 SEP
+ Q_CHAR * match_4
+
+;
+#undef SEP
+#endif
+{ struct script_struct* temp;
+ Q_CHAR *p, *q, *t;
+ temp = script; system_return = 0;
+ while( temp ){
+
+p = temp->command;
+q = command;
+while( *p != '\0' ){
+ *q = *(p++);
+ if( (*q == '%') && (*p == '%')
+ && ((*(p+1) == '%') || ( (*(p+1) >= '0') && (*(p+1) < '5') ) )
+ ){ p++;
+ switch( *(p++) ){
+ case '%':{ q++; break; }
+ case '0':{ t = job_name;
+ while( *t != '\0' ){ *(q++) = *(t++); } break; }
+ case '1':{ t = match_1;
+ while( *t != '\0' ){ *(q++) = *(t++); } break; }
+ case '2':{ t = match_2;
+ while( *t != '\0' ){ *(q++) = *(t++); } break; }
+ case '3':{ t = match_3;
+ while( *t != '\0' ){ *(q++) = *(t++); } break; }
+ case '4':{ t = match_4;
+ while( *t != '\0' ){ *(q++) = *(t++); } break; }
+ default: { }
+ }} else { q++; }
+}
+*q = '\0';
+
+
+ if( (command[0] != '\0') && !system_return ){
+
+(IGNORED) call_sys(command);
+
+ }
+ temp = temp->next;
+} }
+
+
+
+static struct script_struct * filterGifScript
+#ifdef ANSI
+#define SEP ,
+(
+ struct script_struct *script SEP
+ Q_CHAR *file
+)
+#undef SEP
+#else
+#define SEP ;
+( script, file)
+ struct script_struct *script SEP
+ Q_CHAR *file
+;
+#undef SEP
+#endif
+{
+ struct script_struct *filtered_script, *scr,
+ *old_script,
+ *new_script;
+ Q_CHAR *command, *ext;
+ if( script == (struct script_struct *) 0 ){
+ return (struct script_struct *) 0;
+ }
+ old_script = script;
+ command = old_script->command;
+ if( *command != '.' ){
+
+new_script = (struct script_struct *) 0;
+while( old_script != (struct script_struct *) 0 ){
+ command = old_script->command;
+ if( *command == '.' ){ return filtered_script; }
+ scr = (struct script_struct *)
+ m_alloc(struct script_struct, (int) 1);
+ scr->command = old_script->command;
+ scr->next = (struct script_struct *) 0;
+ if( new_script == (struct script_struct *) 0 ){
+ filtered_script = new_script = scr;
+ } else {
+ new_script = new_script->next = scr;
+ }
+ old_script = old_script->next;
+}
+return filtered_script;
+
+
+ } else {
+
+
+ext = file;
+while( *ext != '\0' ){ ext++; }
+while( (*ext != '.') && (ext != file) ){ ext--; }
+
+
+while( TRUE ){
+ if( old_script == (struct script_struct *) 0 ){
+ return (struct script_struct *) 0;
+ }
+ command = old_script->command;
+ if(*command != '.') {
+ old_script = old_script->next;
+ continue;
+ }
+ old_script = old_script->next;
+ if( (*(command+1) == '\0') || eq_str(ext,command) ){
+ break;
+ }
+}
+
+new_script = (struct script_struct *) 0;
+while( old_script != (struct script_struct *) 0 ){
+ command = old_script->command;
+ if( *command == '.' ){ return filtered_script; }
+ scr = (struct script_struct *)
+ m_alloc(struct script_struct, (int) 1);
+ scr->command = old_script->command;
+ scr->next = (struct script_struct *) 0;
+ if( new_script == (struct script_struct *) 0 ){
+ filtered_script = new_script = scr;
+ } else {
+ new_script = new_script->next = scr;
+ }
+ old_script = old_script->next;
+}
+return filtered_script;
+
+
+
+
+ }
+}
+
+
+
+void free_script
+#ifdef ANSI
+#define SEP ,
+(
+ struct script_struct *script
+)
+#undef SEP
+#else
+#define SEP ;
+(script)
+ struct script_struct *script
+;
+#undef SEP
+#endif
+{
+ struct script_struct *temp;
+ while( script != (struct script_struct *) 0 ){
+ temp = script;
+ script = script->next;
+ free( temp );
+ }
+}
+
+
+
+static BOOL strpre
+#ifdef ANSI
+#define SEP ,
+(
+ char * s1 SEP
+ char * s2
+)
+#undef SEP
+#else
+#define SEP ;
+(s1,s2)
+ char * s1 SEP
+ char * s2
+;
+#undef SEP
+#endif
+{ int i;
+ for( i=0; i < (int) strlen(s1); i++){
+ if( *(s1+i) != *(s2+i) ){ return FALSE; }
+ }
+ return TRUE;
+}
+
+
+
+static struct script_struct * add_script
+#ifdef ANSI
+#define SEP ,
+(
+ struct script_struct * script
+)
+#undef SEP
+#else
+#define SEP ;
+(script)
+ struct script_struct * script
+;
+#undef SEP
+#endif
+{
+ struct script_struct* temp, * q;
+ temp = (struct script_struct *)
+ m_alloc(struct script_struct, (int) 1);
+ temp->command = match[1];
+ if( debug ){
+ (IGNORED) printf("....... %s\n", temp->command); }
+ temp->next = NULL_SCRIPT;
+ match[1] = (Q_CHAR *) malloc(70);
+ max_match[1] = 70;
+ if( script ){
+ q = script;
+ while( q->next ){ q = q->next; }
+ q->next = temp;
+ } else {
+ script = temp;
+ }
+ return script;
+}
+
+
+#if defined(DOS_WIN32) || defined(__MSDOS__)
+
+
+char *get_env_dir
+#ifdef ANSI
+#define SEP ,
+(
+ Q_CHAR *progname
+
+)
+#undef SEP
+#else
+#define SEP ;
+(progname)
+ Q_CHAR *progname
+
+;
+#undef SEP
+#endif
+{ int i;
+ Q_CHAR *p;
+ if(! progname || ! *progname) return NULL;
+ i = (int) strlen(progname);
+ while( (progname[--i] != dir_path_slash(progname) )
+ && i > 0) ;
+ if(i == 0) return NULL;
+ p = (Q_CHAR *) malloc(i+12);
+ if(p == NULL) return NULL;
+ strncpy(p, progname, i+1);
+ (IGNORED) strcpy(&p[i+1],"tex4ht.env");
+ return p;
+}
+
+
+#endif
+
+
+
+static FILE* f_open
+#ifdef ANSI
+#define SEP ,
+(
+ char* name SEP
+ char* flags
+)
+#undef SEP
+#else
+#define SEP ;
+( name, flags )
+ char* name SEP
+ char* flags
+;
+#undef SEP
+#endif
+{ FILE* file;
+ if( (file = fopen(name,flags) ) != NULL ) {
+ (IGNORED) printf("(%s)\n",name);
+ }
+ return file;
+}
+
+
+
+static FILE* f_home_open
+#ifdef ANSI
+#define SEP ,
+(
+ char* name SEP
+ char* flags
+)
+#undef SEP
+#else
+#define SEP ;
+( name, flags )
+ char* name SEP
+ char* flags
+;
+#undef SEP
+#endif
+{ FILE* file;
+ U_CHAR *str;
+ if( *name == '~' ){
+ if( HOME_DIR ){
+ str = m_alloc(char, strlen(HOME_DIR)+strlen(name));
+ (IGNORED) sprintf(str,"%s%s", HOME_DIR, name+1);
+ file = f_open(str,flags);
+ free((void *) str);
+ return file;
+ } else { return NULL; }
+ } else { return f_open( name, flags ); }
+}
+
+
+
+static FILE* open_file
+#ifdef ANSI
+#define SEP ,
+(
+ Q_CHAR *name SEP Q_CHAR *ext
+)
+#undef SEP
+#else
+#define SEP ;
+(name,ext)
+ Q_CHAR *name SEP Q_CHAR *ext
+;
+#undef SEP
+#endif
+{ FILE* file;
+ C_CHAR filename[255], *p;
+ if( eq_str( ext,LG_EXT ) ) {
+ (IGNORED) strcpy(filename,job_name);
+ (IGNORED) strct(filename, ext);
+ } else {
+ (IGNORED) strcpy( filename,name );
+ p = filename;
+ while( TRUE ){
+ if( *p == '.' ){ break; }
+ if( *p == '\0' ){ (IGNORED) strcpy(p, ext); break; }
+ p++;
+ }
+ }
+ file = fopen(filename, READ_TEXT_FLAGS);
+ if( !file ) {
+ (IGNORED) warn_i_str(5,filename);
+ } else { (IGNORED) printf ("Entering %s\n", filename); }
+
+ return file;
+}
+
+
+
+static void err_i
+#ifdef ANSI
+#define SEP ,
+( int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n) int n
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,"--- error --- ");
+ (IGNORED) fprintf(stderr, warn_err_mssg[n]);
+ exit(EXIT_FAILURE);
+}
+
+
+
+static void err_arg
+#ifdef ANSI
+#define SEP ,
+( int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n) int n
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,"--- error --- ");
+ (IGNORED) fprintf(stderr, warn_err_mssg[n]);
+ exit(EXIT_FAILURE);
+}
+
+
+
+static void warn_i_str
+#ifdef ANSI
+#define SEP ,
+(
+ int n SEP
+ Q_CHAR *str
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n,str)
+ int n SEP
+ Q_CHAR *str
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,warning);
+ (IGNORED) fprintf(stderr,warn_err_mssg[n], str);
+}
+
+
+
+static void
+
+#ifdef CDECL
+CDECL
+#endif
+
+
+sig_err
+#ifdef ANSI
+#define SEP ,
+( int s
+)
+#undef SEP
+#else
+#define SEP ;
+(s) int s
+;
+#undef SEP
+#endif
+{
+ (void) signal(s,SIG_IGN);
+ switch( s ){
+#ifdef SIGSEGV
+ case SIGSEGV: err_i(2);
+#endif
+ case SIGFPE : err_i(3);
+#if defined(SIGINT) && !defined(WIN32)
+ case SIGINT : err_i(4);
+#endif
+ }
+
+#ifdef __DJGPP__
+ if (s != SIGINT && s != SIGQUIT)
+ exit(EXIT_FAILURE);
+#endif
+
+
+}
+
+
+#ifdef KWIN32
+
+static BOOL sigint_handler
+#ifdef ANSI
+#define SEP ,
+( DWORD dwCtrlType
+)
+#undef SEP
+#else
+#define SEP ;
+(dwCtrlType) DWORD dwCtrlType
+;
+#undef SEP
+#endif
+{
+ err_i(32);
+ return FALSE;
+}
+#endif
+
+
+
+static void call_sys
+#ifdef ANSI
+#define SEP ,
+( Q_CHAR * command
+)
+#undef SEP
+#else
+#define SEP ;
+(command) Q_CHAR * command
+;
+#undef SEP
+#endif
+{
+ if( *command ){
+ (IGNORED) printf("System call: %s\n", command);
+ system_return = system_yes? (int) system(command) : -1;
+ (IGNORED) printf("%sSystem return: %d\n",
+ system_return? "--- Warning --- " : "", system_return );
+ }
+}
+
+
+
+static void strct
+#ifdef ANSI
+#define SEP ,
+(
+ Q_CHAR * str1 SEP
+ Q_CHAR * str2
+
+)
+#undef SEP
+#else
+#define SEP ;
+( str1, str2 )
+ Q_CHAR * str1 SEP
+ Q_CHAR * str2
+
+;
+#undef SEP
+#endif
+{ Q_CHAR * ch;
+ ch = str1 + (int) strlen(str1);
+ (IGNORED) strcpy( ch, str2 );
+}
+
+
+
+static long int get_long_int
+#ifdef ANSI
+#define SEP ,
+(
+ Q_CHAR *str
+)
+#undef SEP
+#else
+#define SEP ;
+(str)
+ Q_CHAR *str
+;
+#undef SEP
+#endif
+{ long int i;
+ Q_CHAR *ch;
+ ch = str; i = 0;
+ while( (*ch>= '0') && (*ch <='9') ){
+ i = 10*i + *(ch++) - '0';
+ }
+ return i;
+}
+
+
+
+static void* malloc_chk
+#ifdef ANSI
+#define SEP ,
+( int n
+)
+#undef SEP
+#else
+#define SEP ;
+( n ) int n
+;
+#undef SEP
+#endif
+{ void* p;
+ if((p = (void *) malloc( (size_t) n)) == NULL ) bad_mem;
+ return p;
+}
+
+
+
+static void* r_alloc
+#ifdef ANSI
+#define SEP ,
+(
+ void *q SEP
+ size_t n
+)
+#undef SEP
+#else
+#define SEP ;
+( q, n )
+ void *q SEP
+ size_t n
+;
+#undef SEP
+#endif
+{ void* p;
+ if((p = (void *) realloc( q, (size_t) n)) == NULL) bad_mem;
+ return p;
+}
+
+
+
+static BOOL scan_until_end_str
+#ifdef ANSI
+#define SEP ,
+(
+ Q_CHAR *str SEP
+ int n SEP
+ BOOL flag SEP
+ FILE* file
+)
+#undef SEP
+#else
+#define SEP ;
+(str,n,flag,file)
+ Q_CHAR *str SEP
+ int n SEP
+ BOOL flag SEP
+ FILE* file
+;
+#undef SEP
+#endif
+{ Q_CHAR *p;
+ int i;
+ if( !flag ) { return flag; }
+ p = match[n]; i = 0;
+ while( TRUE ){
+ if( (i+1) >= max_match[n] ){
+ max_match[n] += 10;
+ p = match[n] = (Q_CHAR *)
+ r_alloc((void *) match[n], (size_t) max_match[n]);
+ }
+ p[i] = (char) (eoln_ch = getc(file));
+ if( (eoln_ch == (int) '\n') || (eoln_ch == EOF) ){ break; }
+ i++;
+ }
+ p[i] = '\0';
+ i -= (int) strlen(str);
+ if( i>= 0 ){ return eq_str(p+i,str); }
+ return FALSE;
+}
+
+
+
+static BOOL scan_until_str
+#ifdef ANSI
+#define SEP ,
+(
+ Q_CHAR *str SEP
+ int n SEP
+ BOOL flag SEP
+ FILE* file
+)
+#undef SEP
+#else
+#define SEP ;
+(str,n,flag,file)
+ Q_CHAR *str SEP
+ int n SEP
+ BOOL flag SEP
+ FILE* file
+;
+#undef SEP
+#endif
+{ Q_CHAR *p, ch;
+ int i, j;
+ if( !flag ) { return flag; }
+ p = match[n]; i = 0;
+ while( TRUE ){
+ ch = (char) (eoln_ch = getc(file));
+ if( (eoln_ch == (int) '\n') || (eoln_ch == EOF) ){ return FALSE; }
+ if( (i+1) >= max_match[n] ){
+ max_match[n] += 10;
+ p = match[n] = (Q_CHAR *)
+ r_alloc((void *) match[n], (size_t) max_match[n]);
+ }
+ p[i++] = ch;
+ j = i - (int) strlen(str);
+ if( j>= 0 ){
+ p[i] = '\0';
+ if( eq_str(p+j,str) ) { return TRUE; }
+ }
+ }
+}
+
+
+
+static BOOL scan_str
+#ifdef ANSI
+#define SEP ,
+(
+ Q_CHAR *str SEP
+ BOOL flag SEP
+ FILE* file
+)
+#undef SEP
+#else
+#define SEP ;
+(str,flag,file)
+ Q_CHAR *str SEP
+ BOOL flag SEP
+ FILE* file
+;
+#undef SEP
+#endif
+{ Q_CHAR *p;
+ int temp_eoln_ch;
+ if( !flag ) { return flag; }
+ p = str;
+ while( *p != '\0' ){
+ if( *(p++) != (temp_eoln_ch = getc(file)) ) {
+ while( (temp_eoln_ch != (int) '\n')
+ && (temp_eoln_ch != EOF) ){ temp_eoln_ch = getc(file); }
+ eoln_ch = temp_eoln_ch; return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+
+
+int
+#ifdef CDECL
+CDECL
+#endif
+
+ main
+#ifdef ANSI
+#define SEP ,
+(
+ int argc SEP
+ Q_CHAR **argv
+)
+#undef SEP
+#else
+#define SEP ;
+(argc, argv)
+ int argc SEP
+ Q_CHAR **argv
+;
+#undef SEP
+#endif
+{
+struct empty_pic_struct *empty_pic;
+
+
+Q_CHAR * tex4ht_env_file = (Q_CHAR *) 0;
+Q_CHAR * dos_env_file =
+#if defined(DOS_WIN32) || defined(__MSDOS__)
+
+get_env_dir(argv[0])
+
+;
+#endif
+#if !defined(DOS_WIN32) && !defined(__MSDOS__)
+ (Q_CHAR *) 0;
+#endif
+
+
+
+
+
+#ifdef SIGSEGV
+ (void) signal(SIGSEGV,sig_err);
+#endif
+ (void) signal(SIGFPE,sig_err);
+#ifdef KWIN32
+
+SetConsoleCtrlHandler((PHANDLER_ROUTINE)sigint_handler, TRUE);
+
+
+#else
+#ifdef SIGINT
+ (void) signal(SIGINT,sig_err);
+#endif
+#endif
+
+
+
+(IGNORED) printf("----------------------------\n");
+#ifndef KPATHSEA
+#ifdef PLATFORM
+ (IGNORED) printf("t4ht.c (2005-08-04-07:03 %s)\n",PLATFORM);
+#else
+ (IGNORED) printf("t4ht.c (2005-08-04-07:03)\n");
+#endif
+#else
+#ifdef PLATFORM
+ (IGNORED) printf("t4ht.c (2005-08-04-07:03 %s kpathsea)\n",PLATFORM);
+#else
+ (IGNORED) printf("t4ht.c (2005-08-04-07:03 kpathsea)\n");
+#endif
+#endif
+
+{ int i;
+ for(i=0; i<argc; i++){
+ (IGNORED) printf("%s%s ", (i>1)?"\n " : "", argv[i]); }
+ (IGNORED) printf("\n");
+}
+
+
+
+HOME_DIR = getenv("HOME");
+
+
+{ C_CHAR *yes = NULL;
+ system_yes = (
+#ifdef SYSTEM_FUNCTION_OK
+0
+#else
+system( yes ) != 0
+#endif
+
+);
+}
+
+
+{ int i;
+ for( i=0; i<=9; i++){
+ match[i] = (Q_CHAR *) malloc(70);
+ max_match[i] = 70;
+ }
+}
+
+
+
+
+{ int i;
+ Q_CHAR *p, *q;
+
+#ifdef KPATHSEA
+ kpse_set_program_name (argv[0], NULL);
+#endif
+
+
+
+ if( argc == 1 ){ bad_arg; }
+ for(i=1; i<argc; i++){
+ if( *( p=argv[i] ) == '-' ){
+if( (int) strlen( argv[i] ) == 2 ){
+ if( (*(p+1)!='i') && (*(p+1) != 'p') && (*(p+1) != 'r') )
+ { if( ++i == argc ) bad_arg; }
+ q = argv[i];
+} else q = p+2;
+switch( *(p+1) ){
+ case 'M':{ ch_mod = q; newchmod = TRUE; break; }
+ case 'S':{
+{ struct sys_call_rec *q;
+ q = m_alloc(struct sys_call_rec, 1);
+ q->next = system_calls;
+ q->filter = p + 2;
+ system_calls = q;
+}
+
+ break; }
+ case 'X':{ Xfield = q; break;}
+ case 'c':{
+struct env_c_rec *temp = (struct env_c_rec*)
+ m_alloc(struct env_c_rec, (int) 1);
+temp->option = q;
+temp->next = envChoice;
+envChoice = temp;
+
+ break;}
+ case 'd':{ dir = (*q=='~')? abs_addr(q,NULL) : q; break; }
+ case 'e':{
+tex4ht_env_file = q;
+
+ break; }
+ case 'f':{
+p = p + 2;
+lg_name = p + (int) strlen( p );
+while( *lg_name != *p ){ lg_name--; }
+lg_name++;
+
+ break; }
+ case 'i':{ debug = q-1; break;}
+ case 'm':{ ch_mod = q; break; }
+ case 'p':{ nopict = q-1; break;}
+ case 'r':{ noreuse = q-1; break;}
+ case '.':{ Dotfield = q; break;}
+ default:{ bad_arg; }
+}
+
+ }
+ else
+ { lg_name = argv[i]; }
+ }
+ if( lg_name == NULL ){ bad_arg; }
+
+{ Q_CHAR *p, *q;
+ FILE* file;
+ (IGNORED) strcpy( tmp_name, lg_name);
+ p = q = tmp_name + strlen( tmp_name );
+ while( p != tmp_name ){
+ if( *p == '.' ){
+ if( eq_str( p+1,LG_EXT ) ) { *p = '\0'; }
+ else {
+ (IGNORED) strct( tmp_name, LG_EXT);
+ file = fopen( tmp_name, READ_TEXT_FLAGS );
+ if( file ){
+ (IGNORED) fclose(file); *q = '\0';
+ } else { *p = '\0'; }
+ }
+ break;
+ }
+ p--;
+ }
+ (IGNORED) strct(tmp_name, ".tmp");
+}
+
+
+
+(IGNORED) strcpy( job_name, tmp_name);
+*(job_name + strlen(job_name) - 4) = '\0';
+
+
+}
+
+
+
+
+{ FILE* file;
+ U_CHAR env_loc[512];
+ env_loc[0] = '\0';
+
+{ Q_CHAR str[512],
+ *TEX4HTENV;
+
+if( tex4ht_env_file ){
+ if( debug ){
+ (IGNORED) printf("%s?\n", tex4ht_env_file);
+ }
+ file = f_home_open( tex4ht_env_file, READ_TEXT_FLAGS );
+} else {
+ file = NULL;
+}
+if( tex4ht_env_file ){
+ (IGNORED) strcpy(&env_loc[0],tex4ht_env_file);
+}
+if( debug && file ){
+ (IGNORED) printf(".......Open: %s\n", tex4ht_env_file); }
+
+
+
+if( !file ) {
+ if( debug ){
+ (IGNORED) printf("tex4ht.env?\n");
+ }
+ file = f_open("tex4ht.env", READ_TEXT_FLAGS);
+ (IGNORED) strcpy(&env_loc[0],"tex4ht.env");
+ if( debug && file ){
+ (IGNORED) printf(".......Open: ./tex4ht.env\n"); }
+}
+
+
+
+#ifndef DOS_WIN32
+ if( !file ) {
+ if( debug ){
+ (IGNORED) printf(".tex4ht?\n");
+ }
+ file = f_open(".tex4ht", READ_TEXT_FLAGS);
+ (IGNORED) strcpy(&env_loc[0],".tex4ht");
+ if( debug && file ){
+ (IGNORED) printf(".......Open: ./.tex4ht\n"); }
+ }
+#endif
+
+
+
+if( !file ){
+ TEX4HTENV = getenv("TEX4HTENV");
+ if( TEX4HTENV ){
+ if( debug ){
+ (IGNORED) printf("%s?\n", TEX4HTENV);
+ }
+ file = f_home_open(TEX4HTENV,READ_TEXT_FLAGS);
+ }
+}
+
+
+
+if( !file ){
+ if( HOME_DIR ){ (IGNORED) sprintf(str,
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+ is_forward_slash(HOME_DIR)? "%s/tex4ht.env" : "%s\\tex4ht.env"
+#else
+ "%s/tex4ht.env"
+#endif
+
+, HOME_DIR);
+ if( debug ){
+ (IGNORED) printf("%s?\n", str);
+ }
+ file = f_open(str,READ_TEXT_FLAGS);
+ (IGNORED) strcpy(&env_loc[0],str);
+ if( debug && file ){
+ (IGNORED) printf(".......Open: %s\n", str); }
+ }
+}
+#ifndef DOS_WIN32
+ if( !file ){
+ if( HOME_DIR ){
+ (IGNORED) sprintf(str,"%s/.tex4ht", HOME_DIR);
+ if( debug ){
+ (IGNORED) printf("%s?\n", str);
+ }
+ file = f_open(str,READ_TEXT_FLAGS);
+ (IGNORED) strcpy(&env_loc[0],str);
+ if( debug && file ){
+ (IGNORED) printf(".......Open: %s\n", str); }
+ }
+ }
+#endif
+#if defined(DOS_WIN32) || defined(__MSDOS__)
+ if( !file ){
+ if( debug ){
+ (IGNORED) printf("C:/tex4ht.env?\n");
+ }
+ file = f_open("C:/tex4ht.env",READ_TEXT_FLAGS);
+ (IGNORED) strcpy(&env_loc[0],"C:/tex4ht.env");
+ if( debug && file ){
+ (IGNORED) printf(".......Open: C:/tex4ht.env\n"); }
+ }
+#endif
+
+
+
+#ifdef ENVFILE
+ if( !file ) {
+ if( debug ){
+ (IGNORED) printf("%s?\n", ENVFILE);
+ }
+ file = f_home_open( ENVFILE,READ_TEXT_FLAGS);
+ (IGNORED) strcpy(&env_loc[0],ENVFILE);
+ if( debug && file ){
+ (IGNORED) printf(".......Open: %s\n", ENVFILE); }
+ }
+#endif
+
+
+ if( !file ) {
+if( dos_env_file ){
+ if( debug ){
+ (IGNORED) printf("%s?\n", dos_env_file);
+ }
+ file = f_open( dos_env_file, READ_TEXT_FLAGS ) ;
+ (IGNORED) strcpy(&env_loc[0],dos_env_file);
+ if( debug && file ){
+ (IGNORED) printf(".......Open: %s\n", dos_env_file); }
+}
+
+ }
+
+
+#ifdef KPATHSEA
+if( !file ) { U_CHAR * envname;
+ char *arch, *p, str[256];
+
+p = arch = (char *) kpse_var_value( "SELFAUTOLOC" );
+while( *p != '\0' ){
+ if( (*p == '/') || (*p == '\\') ){
+ arch = p;
+ }
+ p++;
+}
+
+
+ envname = (char *) 0;
+
+if( arch ){
+ (IGNORED) sprintf(str,"%s%ctex4ht.env", arch+1, *arch);
+ if( debug ){
+ (IGNORED) printf(
+ "kpse_open_file (\"%s\", kpse_program_text_format)?\n", str );
+ }
+ envname= kpse_find_file (str, kpse_program_text_format, 0);
+}
+
+
+ if ( !envname ){
+if( debug ){
+ (IGNORED) printf(
+ "kpse_open_file (\"tex4ht.env\", kpse_program_text_format)?\n");
+}
+envname= kpse_find_file ("tex4ht.env", kpse_program_text_format, 0);
+
+ }
+ if ( envname ){
+ file = kpse_open_file (envname, kpse_program_text_format);
+ (IGNORED) printf("(%s)\n", envname);
+ }
+ if( debug && file ){
+ (IGNORED) printf(".......Open kpathsea %s\n", envname);
+ }
+}
+if( debug ){
+ U_CHAR *p, *q;
+
+p = (U_CHAR *) kpse_var_value( "T4HTINPUTS" );
+if( p ){
+ (IGNORED) printf("T4HTINPUTS = %s\n", p);
+}
+q = getenv("T4HTINPUTS");
+if( q ){ (IGNORED) printf(
+ "Environmet var T4HTINPUTS: %s\n", q);
+}
+if( !p && !q ){
+ (IGNORED) printf( "Missing T4HTINPUTS for kpathsea\n" );
+}
+
+
+}
+#endif
+
+
+ if( !file ) warn_i_str( 5,
+#ifdef DOS_WIN32
+ "tex4ht.env"
+#endif
+#ifndef DOS_WIN32
+ "tex4ht.env | .tex4ht"
+#endif
+
+);
+}
+
+
+ if( file ){
+
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) { Q_CHAR ch;
+ ch = (char) (eoln_ch = getc(file));
+ if( eoln_ch != (int) '\n' ){
+ status = scan_until_end_str("", 1, TRUE, file);
+ if( status ){
+ switch( ch ){
+ case 'A':{
+if( debug ){
+ (IGNORED) printf(".......'A' script\n"); }
+chmod_script = add_script(chmod_script);
+
+ break;}
+ case 'C':{
+if( debug ){
+ (IGNORED) printf(".......'C' script\n"); }
+copy_script = add_script(copy_script);
+
+ break;}
+ case 'E':{
+if( debug ){
+ (IGNORED) printf(".......'E' script\n"); }
+empty_fig_script = add_script(empty_fig_script);
+
+ break;}
+ case 'F':{
+if( debug ){
+ (IGNORED) printf(".......'F' script\n"); }
+dvigif_glyp_script = add_script(dvigif_glyp_script);
+
+ break;}
+ case 'G':{
+if( debug ){ (IGNORED) printf(".......'G' script\n"); }
+dvigif_script = add_script(dvigif_script);
+
+ break;}
+ case 'M':{
+if( debug ){
+ (IGNORED) printf(".......'M' script\n"); }
+move_script = add_script(move_script);
+
+ break;}
+ case 'S':{
+{ struct sys_call_rec *q;
+ q = m_alloc(struct sys_call_rec, 1);
+ q->next = system_calls;
+ q->filter = match[1];
+ match[1] = (Q_CHAR *) malloc(70); max_match[1] = 70;
+ system_calls = q;
+if( debug ){
+ (IGNORED) printf(".......'S' script: '%s'\n",
+ q->filter); }
+}
+
+ break;}
+ case 'X':{
+if( debug ){
+ (IGNORED) printf(".......'X' script\n"); }
+
+file_script
+
+ = add_script(
+file_script
+
+);
+
+ break;}
+ case '.':{
+if( debug ){
+ (IGNORED) printf(".......'.' script\n"); }
+
+ext_script
+
+ = add_script(
+ext_script
+
+);
+
+ break;}
+ case '<':{
+if( *(match[1]) != '/' ){
+ U_CHAR *p;
+ BOOL env_skip;
+ for( p = match[1];
+ (*p != '>') && (*p != '\n') && (*p != EOF ) ;
+ p++ ){}
+ if( *p == '>' ){ *p = '\0'; }
+
+if( envChoice == (struct env_c_rec*) 0 ){
+ env_skip = !eq_str(match[1], "default" );
+} else {
+ struct env_c_rec *p;
+ env_skip = TRUE;
+ for( p=envChoice; p!=(struct env_c_rec*) 0 ; p = p->next ){
+ if( eq_str(match[1], p->option ) ){ env_skip = FALSE; }
+} }
+
+
+ if( env_skip ){
+
+ U_CHAR cur_block[90];
+if( debug ){
+ (IGNORED) printf("....... <%s> skipping ...\n", match[1]);
+}
+(IGNORED) strcpy( cur_block, match[1]);
+status = FALSE;
+while( !status && (eoln_ch != EOF) ){
+ status = scan_str("</", TRUE, file);
+ status = scan_until_str(">", 1, status, file);
+ status = scan_until_end_str("", 2, status, file);
+ if( status ){
+ *(match[1] + strlen(match[1]) - 1) = '\0';
+ status = eq_str(match[1], cur_block);
+ if( debug ){
+ (IGNORED) printf("....... </%s>\n", match[1]);
+} } }
+
+
+ } else {
+ if( debug ){
+ (IGNORED) printf("....... <%s>\n", match[1]);
+ }
+ }
+} else if( debug ){
+ (IGNORED) printf("....... <%s\n", match[1]);
+}
+
+ break;}
+ default:{ }
+} } } }
+
+
+ (IGNORED) fclose(file);
+} }
+
+
+lg_file = open_file(lg_name,LG_EXT);
+if( lg_file ) {
+
+begin_lg_file = ftell(lg_file);
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+{
+Q_CHAR *file_name, file_mode[5];
+int i, start_loc, end_loc, addr;
+char rec_op, *ch;
+static struct files_rec *to_rec, *from_rec,
+ *opened_files = (struct files_rec *) 0,
+ *p, *p1, *p2, *p3, *p4, *from_op, *to_op;
+FILE *in_file, *out_file;
+BOOL write_on;
+
+
+ eoln_ch = (int) 'x';
+ while( eoln_ch != EOF ) {
+ status = scan_str("CopyTo: ", TRUE, lg_file);
+ status = scan_until_str(" ", 1, status, lg_file);
+ status = scan_until_str(" ", 2, status, lg_file);
+ status = scan_until_str(" ", 3, status, lg_file);
+ status = scan_until_str(" ", 4, status, lg_file);
+ status = scan_until_end_str("", 5, status, lg_file);
+ if( status ){
+ if( debug ){
+ (IGNORED) printf("...CopyTo: %s%s%s%s%s...\n",
+ match[1], match[2], match[3], match[4], match[5]);
+ }
+ rec_op = eq_str(match[2],"From ")? From_op :
+ ( eq_str(match[2],"Until ")? Until_op :
+ ( eq_str(match[2],"Skip ")? Skip_op :
+ ( eq_str(match[2],"Cont ")? Cont_op : No_op )));
+ if( rec_op == No_op ){
+ch = match[2];
+if( (ch[0]=='S') && (ch[1]=='e') && (ch[2]=='t') ){
+ ch += 3; rec_op = Set_op;
+} else if( (ch[0]=='A') && (ch[1]=='d') && (ch[2]=='d') && (ch[3]=='r') ){
+ ch += 4; rec_op = Addr_op;
+}
+if( rec_op != No_op ){
+ addr = 0; while( (*ch>='0') && (*ch<='9') ){
+ addr = addr*10 + *ch - '0'; ch++;
+} }
+
+ }
+ if( rec_op == No_op ){
+ (IGNORED) fprintf(stderr,warning);
+ (IGNORED) fprintf(stderr,"CopyTo: %s%s%s%s%s?\n",
+ match[1], match[2], match[3], match[4], match[5]);
+ } else {
+
+file_name = match[1];
+*(file_name + (int) strlen(file_name) - 1) = '\0';
+strcpy(file_mode, WRITE_TEXT_FLAGS);
+for(i=1; i<=2; i++){
+
+for( p = opened_files; p != (struct files_rec*) 0; p = p->right ){
+ if( eq_str(file_name,p->name) ) { break; }
+}
+if( p == (struct files_rec*) 0 ){
+ p = m_alloc(struct files_rec, 1);
+ p->right = opened_files; opened_files = p;
+ p->down = (struct files_rec*) 0;
+ strcpy(p->file_mode,file_mode);
+ p->name = m_alloc(char, (int) strlen(file_name) + 1);
+ (IGNORED) strcpy( p->name, file_name );
+ if( (p->file = fopen(file_name, file_mode)) == NULL )
+ { (IGNORED) warn_i_str(5,file_name); }
+}
+to_rec = from_rec; from_rec = p;
+
+
+ file_name = match[5];
+ strcpy(file_mode,
+READ_BIN_FLAGS
+
+);
+}
+
+
+
+if( to_rec->down == (struct files_rec*) 0 ){
+
+to_rec->down = p = m_alloc(struct files_rec, 1);
+p->up = to_rec;
+p->right = p->left = p->down = (struct files_rec*) 0;
+p->name = to_rec->name;
+p->file = to_rec->file;
+p->from_rec = from_rec;
+p->loc = -1;
+p->op = No_op;
+to_rec = p;
+
+
+} else {
+ to_rec = to_rec->down;
+ for( p = to_rec->right; p != (struct files_rec*) 0; p = p->right ){
+ if( to_rec->from_rec == from_rec ){ break; }
+ to_rec = p;
+ }
+ if( to_rec->from_rec != from_rec ){
+
+to_rec->right = p = m_alloc(struct files_rec, 1);
+p->left = to_rec;
+p->right = p->down = (struct files_rec*) 0;
+p->up = to_rec->up;
+p->name = to_rec->name;
+p->file = to_rec->file;
+p->from_rec = from_rec;
+p->loc = -1;
+to_rec = p;
+
+
+} }
+
+
+
+if( to_rec->down == (struct files_rec*) 0 ){
+
+to_rec->down = p = m_alloc(struct files_rec, 1);
+p->up = to_rec;
+p->right = p->left = p->down = (struct files_rec*) 0;
+p->name = to_rec->name;
+p->file = to_rec->file;
+p->from_rec = from_rec;
+p->loc = -1;
+p->op = No_op;
+p->group = m_alloc(char, (int) strlen(match[3]) + 1);
+(IGNORED) strcpy( p->group, match[3] );
+to_rec = p;
+
+
+} else {
+ to_rec = to_rec->down;
+ for( p = to_rec->right; p != (struct files_rec*) 0; p = p->right ){
+ if( eq_str(to_rec->group,match[3]) ){ break; }
+ to_rec = p;
+ }
+ if( !eq_str(to_rec->group,match[3]) ){
+
+to_rec->right = p = m_alloc(struct files_rec, 1);
+p->left = to_rec;
+p->right = p->down = (struct files_rec*) 0;
+p->up = to_rec->up;
+p->name = to_rec->name;
+p->file = to_rec->file;
+p->from_rec = from_rec;
+p->loc = -1;
+p->group = m_alloc(char, (int) strlen(match[3]) + 1);
+(IGNORED) strcpy( p->group, match[3] );
+to_rec = p;
+
+
+} }
+
+
+
+p = m_alloc(struct files_rec, 1);
+p->down = to_rec->down; to_rec->down = p;
+p->up = to_rec;
+if( p->down != (struct files_rec*) 0 ){
+ (p->down)->up = p;
+}
+*(match[4] + (int) strlen(match[4]) - 1) = '\0';
+p->loc = (int) get_long_int(match[4]);
+p->op = rec_op;
+p->label = addr;
+
+
+
+if( rec_op == Until_op ){
+ for( to_op = p = to_rec->down;
+ p != (struct files_rec*) 0; p = p->down ){
+ if( p->op == From_op ){ from_op = p; break; }
+ }
+ if( p == (struct files_rec*) 0 ){
+
+(IGNORED) fprintf(stderr,"%sMissing `CopyTo From':\n", warning);
+for( p = to_rec->down; p != (struct files_rec*) 0; p = p->down ){
+ (IGNORED) fprintf(stderr," %s %s%d %s\n", to_rec->name,
+ p->op == From_op ? "From " :
+ ( p->op == Until_op ? "Until " :
+ ( p->op == Skip_op ? "Skip " :
+ ( p->op == Cont_op? "Cont " :
+ ( p->op == Addr_op? "Addr " :
+ ( p->op == Set_op? "Set " : "No_op " ))))),
+ p->loc, from_rec->name
+ );
+}
+
+
+ } else {
+
+in_file = from_rec->file;
+out_file = to_rec->file;
+start_loc = from_op->loc;
+write_on = TRUE;
+(IGNORED) fseek(in_file, (long) start_loc,
+0
+);
+for( p= from_op; p != to_rec; p = p->up ){
+ switch( p->op ){
+ case Until_op:{
+if( write_on ){
+ end_loc = p->loc;
+ for(; start_loc<end_loc; start_loc++) {
+ (IGNORED) putc( getc(in_file), out_file );
+} }
+
+ break; }
+ case Skip_op:{
+if( write_on ){
+ end_loc = p->loc;
+ for(; start_loc<end_loc; start_loc++) {
+ (IGNORED) putc( getc(in_file), out_file );
+ }
+}
+write_on = FALSE;
+
+ break; }
+ case Cont_op:{
+end_loc = p->loc;
+if( write_on ){
+ for(; start_loc<end_loc; start_loc++) {
+ (IGNORED) putc( getc(in_file), out_file );
+ }
+} else {
+ start_loc = end_loc;
+ (IGNORED) fseek(in_file, (long) end_loc,
+0
+);
+}
+write_on = TRUE;
+
+ break; }
+ case Set_op:{
+addr = -1;
+for( p1 = from_op->up; p1 != to_rec; p1 = p1->up ){
+ if( (p1->op == Addr_op) && (p1->label == p->label) ){
+ addr = p1->loc; break;
+} }
+if( addr != -1 ){ (p->up)->loc = addr; }
+
+ break; }
+ default: { }
+} }
+
+
+
+to_rec->down = from_op->down;
+if( from_op->down != (struct files_rec*) 0){
+ (from_op->down)->up = to_rec;
+}
+for( p = from_op; p != to_rec; ){
+ p1 = p; p = p->up; free((void *) p1);
+}
+if( to_rec->down == (struct files_rec*) 0){
+ if( to_rec->left == (struct files_rec*) 0 ){
+ (to_rec->up)->down = to_rec->right;
+ } else {
+ (to_rec->left)->right = to_rec->right;
+ }
+ if( to_rec->right != (struct files_rec*) 0 ){
+ (to_rec->right)->left = to_rec->left;
+ }
+ p1 = to_rec; to_rec = to_rec->up; free((void *) p1);
+}
+
+
+ }
+}
+
+
+ } } }
+
+for( p = opened_files; p != (struct files_rec*) 0; ){
+ (IGNORED) fclose(p->file);
+ free((void *) p->name);
+
+for( p1 = p->down; p1 != (struct files_rec*) 0; ){
+
+for( p2 = p1->down; p2 != (struct files_rec*) 0; ){
+
+for( p3 = p2->down; p3 != (struct files_rec*) 0; ){
+ p4 = p3; p3 = p3->down; free((void *) p4);
+}
+
+
+ p3 = p2; p2 = p2->right; free((void *) p3);
+}
+
+
+ p2 = p1; p1 = p1->right; free((void *) p2);
+}
+
+
+ p1= p; p = p->right; free((void *) p1);
+}
+
+
+}
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+{ struct htf_struct *last_rec, *p;
+ last_rec = (struct htf_struct *) 0;
+ eoln_ch = (int) 'x';
+ while( eoln_ch != EOF ) {
+ status = scan_str("htfcss: ", TRUE, lg_file);
+ status = scan_until_end_str("", 1, status, lg_file);
+
+if( status ){
+ Q_CHAR *s, *t;
+ int i;
+ s = t = match[1];
+ for( i=0; *s == ' '; s++ ) { i++; }
+ if( i>0 ){
+ while( *s != 0 ){
+ *(t++) = *(s++);
+ }
+ *t = 0;
+} }
+
+
+ if( status ){ Q_CHAR *key, *body;
+ body = key = match[1];
+
+while( *body && (*body != ' ') ){ body++; }
+if( *body == ' ' ){ *(body++) = '\0'; }
+if( *body ){
+ if( *key ){
+p = m_alloc(struct htf_struct, 1);
+p->next = (struct htf_struct *) 0;
+p->key = m_alloc(char, (int) strlen(key) + 1);
+(IGNORED) strcpy( p->key, key );
+p->body = m_alloc(char, (int) strlen(body) + 1);
+(IGNORED) strcpy( p->body, body );
+if( last_rec ){
+ last_rec->next = p; last_rec = p;
+} else {
+ htf_rec = last_rec = p;
+}
+if( debug ){
+ (IGNORED) printf(".......%s...%s\n", key, body);
+}
+
+ }
+ else if( last_rec ){
+last_rec->body = (Q_CHAR *) r_alloc((void *) last_rec->body,
+ (size_t) strlen(last_rec->body)
+ + (size_t) strlen(body)
+ + 2);
+(IGNORED) strct(last_rec->body,"\n");
+(IGNORED) strct(last_rec->body,body);
+if( debug ){
+ (IGNORED) printf(".......%s\n", body);
+}
+
+ }
+}
+
+
+ } }
+}
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) {
+ status = scan_str("Font_Css_Plus ", TRUE, lg_file);
+ status = scan_until_str(" ", 1, status, lg_file);
+ status = scan_until_end_str("", 2, status, lg_file);
+ if( status ){ Q_CHAR *key;
+ key = match[1];
+ *(key + (int) strlen(key) - 1) = '\0';
+
+if( (*key != '\0') && (*key != '\n') ) {
+ struct htf_struct *p;
+ p = m_alloc(struct htf_struct, 1);
+ p->next = htf_rec;
+ htf_rec = p;
+ p->key = m_alloc(char, (int) strlen(key) + 1);
+ (IGNORED) strcpy( p->key, key );
+ p->body = m_alloc(char, (int) strlen(match[2]) + 1);
+ (IGNORED) strcpy( p->body, match[2] );
+ if( debug ){
+ (IGNORED) printf(".......%s...%s\n", key, match[2]);
+} }
+
+
+} }
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+{ struct empty_pic_struct *last;
+ last = empty_pic = (struct empty_pic_struct *) 0;
+ while( TRUE ) {
+ status = scan_str("--- empty picture --- ", TRUE, lg_file);
+ status = scan_until_str( ".idv[" , 1, status, lg_file);
+ status = scan_until_end_str("] ---", 1, status, lg_file);
+ if( status ){
+if( last == (struct empty_pic_struct *) 0 ){
+ last = empty_pic = (struct empty_pic_struct *)
+ m_alloc(struct empty_pic_struct, (int) 1);
+} else {
+ last = last->next = (struct empty_pic_struct *)
+ m_alloc(struct empty_pic_struct, (int) 1);
+}
+last->next = (struct empty_pic_struct *) 0;
+last->n = get_long_int(match[1]);
+
+ }
+ if ( eoln_ch == EOF ){ break; }
+ }
+
+if( last == (struct empty_pic_struct *) 0 ){
+ last = empty_pic = (struct empty_pic_struct *)
+ m_alloc(struct empty_pic_struct, (int) 1);
+} else {
+ last = last->next = (struct empty_pic_struct *)
+ m_alloc(struct empty_pic_struct, (int) 1);
+}
+last->next = (struct empty_pic_struct *) 0;
+last->n = get_long_int(match[1]);
+
+
+ last->next = (struct empty_pic_struct *) 0;
+ last->n = 100000;
+}
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+{ BOOL characters, skip;
+ characters = skip = FALSE;
+ while( TRUE ) {
+ status = scan_until_str("--- ", 1, TRUE, lg_file);
+ status = scan_until_str( " ---" , 2, status, lg_file);
+ if( status ) {
+ if( eq_str(match[1],"--- ") ){
+ if( eq_str(match[2],"needs ---") ){
+
+status = scan_until_str(" ", 1, status, lg_file);
+status = scan_until_str(".idv", 1, status, lg_file);
+status = scan_until_str("[", 2, status, lg_file);
+status = scan_until_str("] ==> ", 2, status, lg_file);
+status = scan_until_str(" ", 3, status, lg_file);
+ *(match[3] + (int) strlen(match[3]) - 1) = '\0';
+status = scan_until_end_str("---", 4, status, lg_file);
+if( status ) {
+
+struct script_struct
+ * filtered_dvigif_script = NULL_SCRIPT;
+
+
+ long int gif_i;
+ Q_CHAR *p;
+ gif_i = get_long_int(match[2]);
+ p = match[2];
+ *(p + (int) strlen(p) - 6) = '\0';
+ if( characters ){
+
+ Q_CHAR filename[255];
+ FILE* file;
+(IGNORED) strcpy(filename, "");
+if( dir ){ (IGNORED) strct(filename, dir); }
+(IGNORED) strct(filename, match[3]);
+file = fopen(filename, READ_TEXT_FLAGS);
+if( !file || noreuse ){
+
+filtered_dvigif_script = dvigif_glyp_script?
+ filterGifScript(dvigif_glyp_script, match[3]):
+ filterGifScript(dvigif_script, match[3]);
+(void) execute_script(
+ filtered_dvigif_script,match[1],match[2],match[3],job_name);
+(void) free_script( filtered_dvigif_script );
+if( dir && !system_return ){
+ (void) execute_script(move_script,match[3],dir,".","");
+
+if( ch_mod && !system_return ){
+ (void) execute_script(chmod_script, ch_mod, dir?dir:"",match[3], "");
+}
+
+
+}
+
+
+} else {
+ (IGNORED) fclose(file);
+ if( newchmod )
+ {
+if( ch_mod && !system_return ){
+ (void) execute_script(chmod_script, ch_mod, dir?dir:"",match[3], "");
+}
+
+ }
+ (IGNORED) printf("%s already in %s\n", match[3],
+ dir? dir : "current directory" );
+}
+
+
+ } else {
+if( gif_i ==
+empty_pic->n
+
+ ) {
+
+if( !skip ){
+ (void) execute_script(empty_fig_script,
+ dir? dir :"", match[3],"","");
+ if( ch_mod && !system_return ){
+ (void) execute_script(chmod_script, ch_mod,
+ dir?dir:"",match[3], "");
+ }
+}
+empty_pic = empty_pic->next;
+
+
+} else {
+if( !nopict && !skip ){
+
+filtered_dvigif_script = filterGifScript(dvigif_script, match[3]);
+(void) execute_script(
+ filtered_dvigif_script,match[1],match[2],match[3],job_name);
+(void) free_script( filtered_dvigif_script );
+if( dir && !system_return ){
+ (void) execute_script(move_script,match[3],dir,".","");
+}
+if( ch_mod && !system_return ){
+ (void) execute_script(chmod_script, ch_mod, dir?dir:"",match[3], "");
+}
+
+
+}
+
+ }
+
+ }
+}
+
+
+ } else if( eq_str(match[2],"characters ---") ){
+
+status = scan_until_end_str("", 1, status, lg_file);
+characters = eq_str(match[1],"");
+
+
+ } else {
+status = scan_until_end_str("", 1, status, lg_file);
+
+ }
+ } else {
+status = scan_until_end_str(" ignore ---", 2, status, lg_file);
+if( status ){
+ skip = eq_str(match[2]," ignore ---") ? TRUE :
+ ( eq_str(match[2]," end ignore ---") ? FALSE : skip );
+}
+
+ }
+ }
+ if ( eoln_ch == EOF ){ break; }
+} }
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+{
+ Q_CHAR css_name[255];
+ FILE *css_file, *tmp_file;
+ BOOL css_sty;
+
+(IGNORED) strcpy( css_name, job_name);
+(IGNORED) strct(css_name, ".css");
+css_file = fopen(css_name, READ_TEXT_FLAGS);
+
+
+ if( css_file ){
+ (IGNORED) printf ("Entering %s\n", css_name);
+ tmp_file = fopen(tmp_name, WRITE_TEXT_FLAGS);
+ if( !tmp_file ) {
+ (IGNORED) warn_i_str(5,tmp_name);
+ } else {
+ int ch;
+while( (ch = getc(css_file)) != EOF ) {
+ (IGNORED) putc( ch, tmp_file );
+}
+(IGNORED) fclose(tmp_file);
+(IGNORED) fclose(css_file);
+
+ }
+ tmp_file = open_file(tmp_name, ".tmp");
+ css_file = fopen(css_name, WRITE_TEXT_FLAGS);
+ if( !tmp_file ) {
+ (IGNORED) warn_i_str(5,tmp_name);
+ } else if( !css_file ) {
+ (IGNORED) warn_i_str(5,css_name);
+ } else {
+
+css_sty = FALSE;
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) {
+ status = scan_until_end_str("", 1, TRUE, tmp_file);
+
+{ Q_CHAR *p, *q;
+ int n;
+ n = 0; p = match[1]; q = match[2];
+ while ( (*p != '\0') ){
+ if (n == 13) { *(q-10) = '\0'; break;}
+ if( *p != ' ' ){ *(q++) = *p; n++; }
+ p++;
+ }
+ *q = '\0';
+}
+
+
+ if( eq_str(match[2], "/*css.sty*/") ){ css_sty = TRUE; break; }
+ (IGNORED) fprintf(css_file, "%s\n", match[1]);
+}
+
+
+ if( css_sty ){
+
+(IGNORED) fprintf(css_file, "/* start css.sty */\n");
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) {
+ status = scan_str("Font_css_base: ", TRUE, lg_file);
+ status = scan_until_str("Font_css_mag: ", 1, status, lg_file);
+ status = scan_until_end_str("", 2, status, lg_file);
+ if( status ){
+ Font_css_base = match[1];
+ *(Font_css_base + (int) strlen(Font_css_base) - 14) = '\0';
+ match[1] = (Q_CHAR *) malloc(70); max_match[1] = 70;
+ Font_css_mag = match[2];
+ match[2] = (Q_CHAR *) malloc(70); max_match[2] = 70;
+} }
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) {
+ status = scan_str("Font_Size: ", TRUE, lg_file);
+ status = scan_until_end_str("", 1, status, lg_file);
+ if( status ){
+ base_font_size = (int) get_long_int(match[1]);
+} }
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) {
+ status = scan_str("Font(\"", TRUE, lg_file);
+ status = scan_until_str("\",\"", 1, status, lg_file);
+ status = scan_until_str("\",\"", 2, status, lg_file);
+ status = scan_until_str("\",\"", 3, status, lg_file);
+ status = scan_until_end_str("\")", 4, status, lg_file);
+ if( status ){
+ Q_CHAR *p;
+ struct htf_struct *font_sty;
+ int second;
+ p = match[1];
+ *(p + (int) strlen(p) - 3) = '\0';
+ p = match[2];
+ *(p + (int) strlen(p) - 3) = '\0';
+ p = match[3];
+ *(p + (int) strlen(p) - 3) = '\0';
+ p = match[4];
+ *(p + (int) strlen(p) - 2) = '\0';
+
+font_sty = htf_rec;
+while ( font_sty ) {
+ if( eq_str(font_sty->key,match[1]) ){ break; }
+ font_sty = font_sty->next;
+}
+
+
+
+{ Q_CHAR *p;
+ second = (int)
+ ( (int) get_long_int(match[3])
+ * (int) get_long_int(match[4])
+ / base_font_size
+ );
+ while( second > 700 ){ second /= 10; }
+ p = match[3];
+ while( *p != '\0' ){
+ if( (*p < '0') || (*p > '9') ){ second = 100; break; }
+ p++;
+ }
+}
+
+
+ if( font_sty || (second != 100) ){
+
+(IGNORED) fprintf(css_file,
+ (Font_css_base == NULL)? ".%s-%s" : Font_css_base,
+ match[1], match[2]);
+if( !eq_str(match[4],"100") ){
+ (IGNORED) fprintf(css_file,
+ (Font_css_mag == NULL)? "x-x-%s" : Font_css_mag,
+ match[4]);
+}
+(IGNORED) fprintf(css_file, "{");
+if( (second < 98) || (second > 102) ){
+ (IGNORED) fprintf(css_file, "font-size:%d%c;", second, '%');
+}
+if( font_sty ) {
+ (IGNORED) fprintf(css_file, font_sty->body);
+}
+(IGNORED) fprintf(css_file, "}\n");
+
+
+} } }
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+{ char *font_class [256];
+ int last_class;
+
+last_class = 0;
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) {
+ status = scan_str("Font_Class(", TRUE, lg_file);
+ status = scan_until_str(",\"", 1, status, lg_file);
+ status = scan_until_str("\"): ", 1, status, lg_file);
+ status = scan_until_end_str("", 2, status, lg_file);
+ if( status ){
+ font_class[last_class++] = match[1];
+ match[1] = (Q_CHAR *) malloc(7); max_match[1] = 7;
+} }
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+
+
+ eoln_ch = (int) 'x';
+ while( eoln_ch != EOF ) {
+ status = scan_str("Font_Css(\"", TRUE, lg_file);
+ status = scan_until_str("\"): ", 1, status, lg_file);
+ status = scan_until_end_str("", 2, status, lg_file);
+ if( status ){ int i;
+ for(i=0; i<last_class; i++){
+ if( eq_str(match[1],font_class[i]) ){
+ (IGNORED) fprintf(css_file, "%s\n", match[2]);
+ break;
+} } } } }
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) {
+ status = scan_str("Css: ", TRUE, lg_file);
+ status = scan_until_end_str("", 1, status, lg_file);
+ if( status ){
+ (IGNORED) fprintf(css_file, "%s\n", match[1]);
+} }
+
+
+(IGNORED) fprintf(css_file, "/* end css.sty */\n");
+
+
+
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) {
+ status = scan_until_end_str("", 1, TRUE, tmp_file);
+
+{ Q_CHAR *p, *q;
+ int n;
+ n = 0; p = match[1]; q = match[2];
+ while ( (*p != '\0') ){
+ if (n == 13) { *(q-10) = '\0'; break;}
+ if( *p != ' ' ){ *(q++) = *p; n++; }
+ p++;
+ }
+ *q = '\0';
+}
+
+
+ if( !eq_str(match[2], "/*css.sty*/") ){
+ (IGNORED) fprintf(css_file, "%s\n", match[1]);
+ }
+}
+
+
+ }
+ }
+ (IGNORED) fclose(tmp_file);
+ (IGNORED) fclose(css_file);
+} }
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+if(
+ext_script
+
+ ){
+ eoln_ch = (int) 'x';
+ while( eoln_ch != EOF ) {
+ status = scan_str("File: ", TRUE, lg_file);
+ status = scan_until_str(".", 1, status, lg_file);
+ status = scan_until_end_str("", 2, status, lg_file);
+ if( status ){ Q_CHAR *ext;
+ struct script_struct *cur_script;
+ ext = match[1];
+ (IGNORED) strct( ext, match[2] );
+ ext += strlen(ext);
+ while( *(--ext) != '.' ){ ; }
+ *ext = '\0'; ext++;
+
+{
+ struct script_struct *cur, *add, *temp;
+ Q_CHAR extPlus[256];
+ cur =
+ext_script
+
+;
+ add = cur_script = NULL_SCRIPT;
+ while( cur ){
+
+(IGNORED) strcpy(extPlus, ext);
+/*
+ if ( envChoice ) {
+ (IGNORED) strct ( extPlus, envChoice );
+ }
+*/
+(IGNORED) strct ( extPlus, " " );
+
+
+ if( strpre(extPlus, cur->command) ){
+
+temp = (struct script_struct *)
+ m_alloc(struct script_struct, (int) 1);
+temp->command = m_alloc(char, (int) strlen(cur->command) + 1);
+temp->next = NULL_SCRIPT;
+(IGNORED) strcpy(temp->command, cur->command + (int) strlen(extPlus) );
+
+
+ if( cur_script == NULL_SCRIPT ){
+ cur_script = add = temp;
+ } else {
+ add = add->next = temp;
+ } }
+ cur = cur->next;
+} }
+
+
+ (void) execute_script(cur_script,
+ match[1], Dotfield? Dotfield : "", "", "");
+
+while( cur_script != (struct script_struct*) 0 ){
+ struct script_struct *temp;
+ temp = cur_script; cur_script = cur_script->next; free((void *) temp);
+}
+
+
+} } }
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+if(
+file_script
+
+ ){
+ eoln_ch = (int) 'x';
+ while( eoln_ch != EOF ) {
+ status = scan_str("File: ", TRUE, lg_file);
+ status = scan_until_str(".", 1, status, lg_file);
+ status = scan_until_end_str("", 2, status, lg_file);
+ if( status ){ Q_CHAR *p;
+ p = match[1];
+ (IGNORED) strct( p, match[2] );
+ p += strlen(p);
+ while( *(--p) != '.' ){ ; }
+ *p = '\0'; p++;
+ (void) execute_script(file_script, match[1],
+ p, Xfield? Xfield : "", "");
+} } }
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) {
+ status = scan_str("File: ", TRUE, lg_file);
+ status = scan_until_end_str("", 1, status, lg_file);
+ status = status && !eq_str(match[1],tmp_name);
+ if( status ){
+ FILE* file;
+ file = fopen(match[1], READ_TEXT_FLAGS);
+ if( file ){
+ (IGNORED) fclose(file);
+ } else { status = FALSE; }
+ }
+ if( status ){
+ if( dir ){
+ (void) execute_script(copy_script, match[1],
+ dir? dir :"",".","");
+ }
+ if( ch_mod ){
+ (void) execute_script(chmod_script, ch_mod,
+ dir? dir:"",match[1], "");
+ }
+} }
+
+
+
+(IGNORED) fseek(lg_file, begin_lg_file,
+0
+);
+
+
+eoln_ch = (int) 'x';
+while( eoln_ch != EOF ) { Q_CHAR *command, ch;
+ int n;
+ struct sys_call_rec *p;
+ BOOL flag;
+ status = scan_str("l. ", TRUE, lg_file);
+ status = scan_until_str(" --- needs --- \"", 1, status, lg_file);
+ status = scan_until_str("\" ---", 2, status, lg_file);
+ if( status ){
+ command = match[2];
+ *(command + (int) strlen(command) - 5) = '\0';
+
+flag = FALSE;
+p = system_calls;
+while( p ){
+ if( (n = (int) strlen(p->filter)) == 1 ) {
+ if( *(p->filter) == '*' ){
+ flag = TRUE; break;
+ }
+ }
+ if( strlen(command) >= (unsigned int) n ) {
+ ch = command[n]; command[n] = '\0';
+ flag = flag || eq_str(p->filter,command);
+ command[n] = ch;
+ }
+ p = p->next;
+}
+
+
+ if( flag ){
+
+(IGNORED) call_sys(command);
+
+
+ } else { (IGNORED) printf(
+ "No permission for system call: %s\n", command); }
+} }
+
+
+ (IGNORED) fclose(lg_file);
+}
+
+
+ return 0;
+}
+
+
diff --git a/Build/source/texk/tex4htk/teicontext b/Build/source/texk/tex4htk/teicontext
new file mode 100755
index 00000000000..1ebfaab47f4
--- /dev/null
+++ b/Build/source/texk/tex4htk/teicontext
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/teilatex b/Build/source/texk/tex4htk/teilatex
new file mode 100755
index 00000000000..c18bec0291e
--- /dev/null
+++ b/Build/source/texk/tex4htk/teilatex
@@ -0,0 +1,9 @@
+
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,tei]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,tei]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,tei]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/teimcontext b/Build/source/texk/tex4htk/teimcontext
new file mode 100755
index 00000000000..1ebfaab47f4
--- /dev/null
+++ b/Build/source/texk/tex4htk/teimcontext
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/teimex b/Build/source/texk/tex4htk/teimex
new file mode 100755
index 00000000000..d43a950ef5b
--- /dev/null
+++ b/Build/source/texk/tex4htk/teimex
@@ -0,0 +1,9 @@
+
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/teimlatex b/Build/source/texk/tex4htk/teimlatex
new file mode 100755
index 00000000000..c665c3f405e
--- /dev/null
+++ b/Build/source/texk/tex4htk/teimlatex
@@ -0,0 +1,9 @@
+
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,tei-mml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,tei-mml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,tei-mml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/teimmex b/Build/source/texk/tex4htk/teimmex
new file mode 100755
index 00000000000..b5d1d903ab9
--- /dev/null
+++ b/Build/source/texk/tex4htk/teimmex
@@ -0,0 +1,9 @@
+
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/teimtex b/Build/source/texk/tex4htk/teimtex
new file mode 100755
index 00000000000..4582ce42d0c
--- /dev/null
+++ b/Build/source/texk/tex4htk/teimtex
@@ -0,0 +1,9 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/teimtexexec b/Build/source/texk/tex4htk/teimtexexec
new file mode 100755
index 00000000000..d2d8ad431d3
--- /dev/null
+++ b/Build/source/texk/tex4htk/teimtexexec
@@ -0,0 +1,12 @@
+
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/teimtexi b/Build/source/texk/tex4htk/teimtexi
new file mode 100755
index 00000000000..c8e52000716
--- /dev/null
+++ b/Build/source/texk/tex4htk/teimtexi
@@ -0,0 +1,10 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei-mml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/teitex b/Build/source/texk/tex4htk/teitex
new file mode 100755
index 00000000000..b083067afba
--- /dev/null
+++ b/Build/source/texk/tex4htk/teitex
@@ -0,0 +1,9 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/teitexexec b/Build/source/texk/tex4htk/teitexexec
new file mode 100755
index 00000000000..d2d8ad431d3
--- /dev/null
+++ b/Build/source/texk/tex4htk/teitexexec
@@ -0,0 +1,12 @@
+
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/teitexi b/Build/source/texk/tex4htk/teitexi
new file mode 100755
index 00000000000..8df760149c0
--- /dev/null
+++ b/Build/source/texk/tex4htk/teitexi
@@ -0,0 +1,10 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,tei}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/test.tex b/Build/source/texk/tex4htk/test.tex
new file mode 100644
index 00000000000..d05b994669e
--- /dev/null
+++ b/Build/source/texk/tex4htk/test.tex
@@ -0,0 +1,261 @@
+% \def\CALL{{tex}{latex}}
+% \let\PC=Y
+% \let\DOS=Y
+% \def\WWW{XXX}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% test.tex %
+% %
+% Please DON'T try to understand the code of this file---it %
+% can be harmful to your eyes and brain! %
+% %
+% gurari@cis.ohio-state.edu %
+% http://www.cis.ohio-state.edu/~gurari %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\ifx \SCRIPT\UnDef
+ \ifx \PC\UnDef
+ \def\SCRIPT{
+ \Needs{cp \FN.tex \WWW \FN.txt}
+ \Needs{chmod 644 \WWW \FN.txt}
+ \Needs{ht \TEX\space
+ \FN\space
+ \ifx\WWW\empty \else ' -d\WWW\space
+ -m644'\fi}
+ }
+ \else % dos batch file
+ \def\SCRIPT{
+ \Needs{call ht \TEX\space \FN}
+ \Needs{if exist \FN.txt del \FN.txt}
+ \Needs{ren \FN.tex \FN.txt}
+ }
+\fi\fi
+
+% \def\SCRIPT{
+% \Needs{call ht \TEX\space \FN}
+% \Needs{if exist \FN.txt del /q \FN.txt}
+% \Needs{ren /q \FN.tex \FN.txt}
+% }
+
+
+
+
+\ifx \PC\UnDef
+\else
+
+\openin15=clean.bat
+\ifeof15
+\closein15
+\immediate\openout15=clean.bat
+\immediate\write15{DEL hti.bat}
+\immediate\write15{DEL htii.bat}
+\immediate\write15{DEL htiii.bat}
+\immediate\write15{DEL htiv.bat}
+\immediate\write15{DEL htv.bat}
+\immediate\write15{DEL htvi.bat}
+\immediate\write15{DEL htvii.bat}
+\immediate\write15{DEL httest.bat}
+\immediate\write15{DEL i.*}
+\immediate\write15{DEL ia.*}
+\immediate\write15{DEL ii.*}
+\immediate\write15{DEL iia.*}
+\immediate\write15{DEL iii.*}
+\immediate\write15{DEL iiia.*}
+\immediate\write15{DEL iv.*}
+\immediate\write15{DEL iv2.*}
+\immediate\write15{DEL iva2.*}
+\immediate\write15{DEL iva.*}
+\immediate\write15{DEL test*.aux}
+\immediate\write15{DEL test*.bat}
+\immediate\write15{DEL test*.dvi}
+\immediate\write15{DEL test*.htm*}
+\immediate\write15{DEL test*.css}
+\immediate\write15{DEL test*.lg}
+\immediate\write15{DEL test*.idv}
+\immediate\write15{DEL test*.log}
+\immediate\write15{DEL test*.otc}
+\immediate\write15{DEL test*.toc}
+\immediate\write15{DEL test*.txt}
+\immediate\write15{DEL test*.xre*}
+\immediate\write15{DEL tex4ht.ps}
+\immediate\write15{DEL v.*}
+\immediate\write15{DEL va.*}
+\immediate\write15{DEL vi.*}
+\immediate\write15{DEL viIa.*}
+\immediate\write15{DEL via.*}
+\immediate\write15{DEL vii.*}
+\immediate\write15{DEL viia.*}
+\immediate\write15{DEL clean.bat}
+\immediate\closeout15
+\else \closein15 \fi
+
+\fi
+
+\ifx \DOS\UnDef
+ \def\HTML{html} \def\ARG{}
+ \else \def\HTML{htm} \def\ARG{[htm]}
+ \fi
+
+\ifx \documentclass\undef \else
+ \documentclass{article}
+\fi
+\input tex4ht.sty
+\def\temp{htm}\ifx \HTML\temp
+ \Preamble{htm,no_,no^}
+\else
+ \Preamble{html,no_,no^}
+\fi
+ \ifx \documentclass\undef \else
+ \begin{document}
+ \fi
+
+ \Configure{Needs}{l. \the\inputlineno\space--- needs --- "#1" ---}
+
+
+\newlinechar=`\^^J
+
+\ifx \WWW\UnDef \let\WWW=\empty \fi
+\ifx \DOS\UnDef\else
+% \Needs{CLS} % clear screen
+\fi
+
+
+\ifx \CALL\UnDef
+ \def\TEX{\ifx \documentclass\undef \else la\fi tex}
+\else
+ \def\TEX#1#2{\def\TEX{\ifx \documentclass\undef #1\else #2\fi}}
+ \expandafter\TEX\CALL
+\fi
+
+\edef\type{\ifx \documentclass\undef \else a\fi}
+
+\def\\#1\\{\expandafter\noexpand\csname#1\endcsname}
+\catcode`\#=11 \def\Sharp{#} \catcode`\#=6
+\def\source#1#2{
+ \def\doc##1##2##3{#2}
+ \HAdvance\FileNo by 1
+ \NextFileName
+ \immediate\openout15=\FN.tex
+ \immediate\write16{--- Writing file \FN.tex}%
+ \SCRIPT
+ \immediate\write15{\ifx \documentclass\undef
+ \noexpand \input tex4ht.sty ^^J
+ \noexpand \Preamble{\HTML#1} ^^J
+ \noexpand \EndPreamble ^^J^^J\else
+ \noexpand \documentclass{article} ^^J
+ \noexpand \usepackage\ARG{tex4ht} ^^J
+ \noexpand \begin{document} ^^J^^J\fi
+ \doc{PSALMS (131:1)}
+ {My heart is not haughty, nor ^^J
+ mine eyes lofty:}
+ {neither do I ^^J
+ exercise myself in great ^^J
+ matters, or in things too high ^^J
+ for me.} ^^J^^J
+ {\\it\\ Example \FileNo\space (out of \examples)} ^^J^^J
+ \noexpand \end\ifx \documentclass\undef \else
+ {document}\fi }
+ \immediate\closeout15
+ \Link[\jobname\FileNo\type f.\HTML\space TARGET="X"]{}{}\FileNo\EndLink
+ \File+{\jobname\FileNo\type f.\HTML}
+ \HorFrames{*,*}
+ \Frame[\romannumeral\FileNo\type.txt]{}
+ \Frame[\romannumeral\FileNo\type.\HTML]{}
+ \EndPreamble
+ \Link[\romannumeral\FileNo\type.txt]{}{}outcome\EndLink{} /
+ \Link[\romannumeral\FileNo\type.\HTML]{}{}source\EndLink{} /
+ \Link{1}{}pointers\EndLink
+ \EndFile{\jobname\FileNo\type f.\HTML}
+}
+
+\def\NextFileName{\edef\FN{\romannumeral\FileNo\type}}
+
+\HAssign\examples=0\LikeRef{count}
+\HAssign\FileNo=1 \NextFileName
+
+ \VerFrames{7*,*}
+ \Frame[\jobname\FileNo\type f.\HTML\space NAME="X"]{}
+ \Frame[ NAME="Y"]{1}
+
+\EndPreamble
+
+\Link[\FN.txt]{}{}source\EndLink{} /
+\Link[\FN.\HTML]{}{}outcome\EndLink{} /
+
+\HAssign\FileNo=0
+
+\edef\temp{\noexpand\HPage<\jobname p.\HTML>}
+\temp{Pointers}\Link{}{1}~\EndLink
+
+
+Goto to Example:
+\source{%,fonts
+}{#1^^J^^J#2^^J^^J#3}
+ \def\HR{^^J\\HCode\\{<HR>}^^J}
+\source{%,fonts
+}{\HR #1 \HR #2 \HR #3 \HR}
+\source{%,fonts
+}{{\\bf\\#1}^^J^^J{\\it\\#2}^^J^^J{\\tt\\#3}}
+\source{%,fonts
+}{\\HPage\\{#1}^^J^^J#2^^J^^J#3^^J^^J
+ \\ExitHPage\\{}\\EndHPage\\{}}
+%
+\ifx \documentclass\undef
+\source{%,fonts
+}{\\Contribute\\{halign}{BORDER<>0 1 < 0 2 - 0 3 > }^^J
+\\halign\\{&\Sharp\\cr\\#1^^J&^^J#2^^J&^^J#3\\cr\\}}
+\else
+\source{%,fonts
+}{\string\begin{tabular}{|l|c|r|}^^J
+#1^^J&^^J#2^^J&^^J#3^^J
+\string\end{tabular}}
+\fi
+%
+
+ \def\d{\\scriptstyle\\ \\diamondsuit\\
+ \\diamondsuit\\ \\diamondsuit\\ }
+\ifx \documentclass\undef
+\source{%,fonts
+}{^^J
+\\settabs\\ 6 \\columns\\^^J
+\\+\\PSALMS & (131:1)\\cr\\^^J
+\\+\\My heart & is not haughty,\\cr\\ ^^J
+\\+\\nor mine & eyes lofty:\\cr\\^^J
+\\settabs\\ \\+\\ neither & do I exercise & \\cr\\^^J
+\\+\\neither & do I exercise \\cr\\^^J
+\\+\\ & myself in & great matters, \\cr\\^^J
+\\+\\or & in things & too high for me. \\cr\\^^J
+}
+\else
+\source{%,fonts
+}{^^J
+\\begin\\{tabbing}^^J
+XXXXXXXXX \\=\\\\kill\\^^J
+PSALMS \\>\\ (131:1) \string\\^^J
+My heart \\>\\ is not haughty, \string\\^^J
+nor mine \\>\\ eyes lofty:\string\\^^J
+neither \\=\\ do I exercise \\=\\ \\kill\\^^J
+neither \\>\\ do I exercise \string\\^^J
+ \\>\\ myself in \\>\\ great matters, \string\\^^J
+or \\>\\ in things \\>\\ too high for me. \string\\^^J
+\\end\\{tabbing}^^J
+}
+\fi
+%
+\source{%,fonts
+}{\ifx \documentclass\undef\space
+ \string\def\string\(\string{\string\Picture+\string{\string}\string
+ $\string}^^J
+ \string\def\string\)\string{\string$\string\EndPicture\string}^^J
+\fi
+\\Picture\\+{ ALIGN="LEFT"}\\vtop\\{\\hsize\\=2in^^J
+ \\hrule\\\\smallskip\\ #1\\smallskip\\\\hrule\\}\string
+ \EndPicture^^J #2^^J\\(\\ \d \\)\\ ^^J#3 $\d$}
+\EndHPage{}
+
+ \Tag{count}{\FileNo}
+
+\end{document}
+\endinput
+
diff --git a/Build/source/texk/tex4htk/test1.tex b/Build/source/texk/tex4htk/test1.tex
new file mode 100644
index 00000000000..3eba9e1a077
--- /dev/null
+++ b/Build/source/texk/tex4htk/test1.tex
@@ -0,0 +1,10 @@
+
+\documentclass {article}
+ \usepackage {tex4ht}
+\begin {document}
+
+A single $\heartsuit$ and a full
+suit: \( \clubsuit \diamondsuit
+\heartsuit \spadesuit \).
+
+\end {document}
diff --git a/Build/source/texk/tex4htk/testa.tex b/Build/source/texk/tex4htk/testa.tex
new file mode 100644
index 00000000000..755ec27f9f7
--- /dev/null
+++ b/Build/source/texk/tex4htk/testa.tex
@@ -0,0 +1,11 @@
+\documentclass {article}
+ \usepackage {tex4ht}
+\begin {document}
+
+A single $\heartsuit$ and a full
+suit: \( \clubsuit \diamondsuit
+\heartsuit \spadesuit \).
+
+\end {document}
+\endinput
+
diff --git a/Build/source/texk/tex4htk/testb.tex b/Build/source/texk/tex4htk/testb.tex
new file mode 100644
index 00000000000..dac78522b0a
--- /dev/null
+++ b/Build/source/texk/tex4htk/testb.tex
@@ -0,0 +1,10 @@
+\documentclass {article}
+\begin {document}
+
+A single $\heartsuit$ and a full
+suit: \( \clubsuit \diamondsuit
+\heartsuit \spadesuit \).
+
+\end {document}
+\endinput
+
diff --git a/Build/source/texk/tex4htk/tex4ht.c b/Build/source/texk/tex4htk/tex4ht.c
new file mode 100644
index 00000000000..619c6cff9e2
--- /dev/null
+++ b/Build/source/texk/tex4htk/tex4ht.c
@@ -0,0 +1,11549 @@
+
+/**********************************************************/
+/* tex4ht.c 2005-05-29-09:42 */
+/* Copyright (C) 1996--2005 Eitan M. Gurari */
+/* */
+/* This work may be distributed and/or modified under the */
+/* conditions of the LaTeX Project Public License, either */
+/* version 1.3 of this license or (at your option) any */
+/* later version. The latest version of this license is */
+/* in */
+/* http://www.latex-project.org/lppl.txt */
+/* and version 1.3 or later is part of all distributions */
+/* of LaTeX version 2003/12/01 or later. */
+/* */
+/* This work has the LPPL maintenance status "maintained".*/
+/* */
+/* This Current Maintainer of this work */
+/* is Eitan M. Gurari. */
+/* */
+/* If you modify this program your changing its signature */
+/* with a directive of the following form will be */
+/* appreciated. */
+/* #define PLATFORM "signature" */
+/* */
+/* gurari@cse.ohio-state.edu */
+/* http://www.cse.ohio-state.edu/~gurari */
+/**********************************************************/
+
+/* **********************************************
+ Compiler options *
+ (uncommented | command line) *
+------------------------------------------------*
+ Classic C (CC) default
+#define ANSI ansi-c, c++
+#define DOS_C
+#define HAVE_STRING_H <string.h>
+#define HAVE_DIRENT_H <dirent.h>
+#define HAVE_SYS_NDIR_H <sys/ndir.h>
+#define HAVE_SYS_DIR_H <sys/dir.h>
+#define HAVE_NDIR_H <ndir.h>
+#define HAVE_IO_H <io.h>
+#define HAVE_UNISTD_H <unistd.h>
+#define WIN32
+#define KPATHSEA
+#define CDECL .......
+#define BCC32 bordland c++
+
+*************************************************
+ Tex4ht variables *
+ (uncommented | command line) *
+----------------------------------------------- */
+
+#ifndef LGFNT
+#define LGFNT "Font(\"%s\",\"%s\",\"%d\",\"%d\")\n"
+#endif
+
+
+#ifndef LGCLS
+#define LGCLS "Font_Class(%d,\"%s\"): %s\n"
+#endif
+
+
+#ifndef LGPIC
+#define LGPIC "--- needs --- %%1.idv[%%2] ==> %%3 ---\n%"
+#endif
+
+
+#ifndef LGSEP
+#define LGSEP "--- characters ---\n"
+#endif
+
+
+#ifndef LGTYP
+#define LGTYP ".png"
+#endif
+
+
+#ifndef ENVFILE
+
+#endif
+
+
+#ifndef TFMDIR
+
+#endif
+
+
+#ifndef HTFDIR
+
+#endif
+
+
+/* ******************************************** */
+
+
+#ifdef BCC32
+#define DOS_WIN32
+#define ANSI
+#define HAVE_DIRENT_H
+#define PLATFORM "ms-win32"
+#endif
+
+
+
+#ifdef BCC
+#define DOS_C
+#define ANSI
+#define HAVE_DIRENT_H
+#define PLATFORM "ms-dos"
+#ifndef PATH_MAX
+#define PATH_MAX 256
+#endif
+#endif
+
+
+
+#ifdef __DJGPP__
+#define DOS_WIN
+#define ANSI
+#ifndef HAVE_STRING_H
+#define HAVE_STRING_H 1
+#endif
+#endif
+
+
+#ifdef DOS_C
+#define DOS
+#endif
+#ifdef DOS
+#define DOS_WIN32
+#define HAVE_STRING_H <string.h>
+#endif
+#ifdef WIN32
+#define DOS_WIN32
+#ifndef KPATHSEA
+#define HAVE_STRING_H <string.h>
+#endif
+#endif
+
+#ifdef DOS_WIN32
+#define STRUCT_DIRENT
+#endif
+
+
+
+#ifdef KPATHSEA
+#ifdef WIN32
+#define KWIN32
+#endif
+#endif
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+
+#ifdef WIN32
+#include <windows.h>
+#ifdef KPATHSEA
+#undef CDECL
+#define CDECL __cdecl
+#endif
+#else
+#ifdef KPATHSEA
+#define CDECL
+#endif
+#endif
+
+
+#include <limits.h>
+
+
+#include <signal.h>
+
+
+#ifndef F_OK
+#ifdef DOS_WIN32
+#define F_OK 0
+#endif
+#ifndef KPATHSEA
+#ifndef DOS_WIN32
+#define HAVE_UNISTD_H
+#endif
+#endif
+#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+#ifndef KPATHSEA
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#endif
+
+
+
+#ifdef KPATHSEA
+#include <kpathsea/config.h>
+#include <kpathsea/c-errno.h>
+#include <kpathsea/c-ctype.h>
+#include <kpathsea/c-fopen.h>
+#include <kpathsea/c-pathmx.h>
+#include <kpathsea/proginit.h>
+#include <kpathsea/tex-file.h>
+#include <kpathsea/tex-make.h>
+#include <kpathsea/variable.h>
+#include <signal.h>
+#if !defined(_AMIGA) && !defined(WIN32)
+#include <sys/time.h>
+#endif
+#include <fcntl.h>
+#include <setjmp.h>
+#endif
+
+
+
+
+#ifdef DOS_WIN32
+#include <io.h>
+#endif
+
+
+#include <sys/stat.h>
+
+
+
+#ifdef HAVE_DIRENT_H
+
+#include <dirent.h>
+
+
+#else
+#ifndef STRUCT_DIRENT
+#define STRUCT_DIRECT
+#endif
+
+#ifdef HAVE_SYS_NDIR_H
+#include <sys/ndir.h>
+#endif
+#ifdef HAVE_SYS_DIR_H
+#include <sys/dir.h>
+#endif
+#ifdef HAVE_NDIR_H
+#include <ndir.h>
+#endif
+
+
+#endif
+
+
+
+#ifdef DOS
+#define HTM
+#endif
+
+
+
+
+#ifdef DOS
+#define PROTOTYP
+#endif
+#ifdef ANSI
+#define PROTOTYP
+#endif
+#ifdef KWIN32
+#define PROTOTYP
+#endif
+
+
+
+
+
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+
+#if INT_MAX < 2147483647L
+#define LONG L
+#endif
+
+
+#ifdef LONG
+#define INTEGER long
+#else
+#define INTEGER int
+#endif
+#define U_CHAR char
+
+
+#define m_alloc(typ,n) (typ *) malloc_chk((int) ((n) * sizeof(typ)))
+
+
+#ifndef PATH_MAX
+#define PATH_MAX 512
+#endif
+
+
+#define IGNORED void
+
+
+struct files_rec{
+ FILE *file, *prev_file;
+ char* name;
+ struct files_rec *next, *prev;
+};
+
+
+struct sys_call_rec{
+ char* filter;
+ struct sys_call_rec *next;
+};
+
+
+#define HEIGHT 120
+
+
+#define NULL_MAP (struct map_line_type*) 0
+
+
+#define XRESOLUTION MARGINSP
+#ifdef LONG
+#define YRESOLUTION 786432L
+#else
+#define YRESOLUTION 786432
+#endif
+
+
+#define MAX_MAP_LINE 500
+
+
+#define idv_int(val) int_to_dvi((long int) val,4)
+
+
+struct halign_rec{
+ char * str;
+ int refs;
+};
+
+
+#define design_size_to_pt(n) ((double)n / (double)(1L<<20))
+
+
+#define new_font font_tbl[font_tbl_size]
+
+
+#ifdef LONG
+#define MARGINSP 344061L
+#else
+#define MARGINSP 344061
+#endif
+
+
+#define ignore_ch 0
+
+
+#define HTF_ALIAS 10000000
+
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef BOOL
+#define BOOL int
+#endif
+
+
+#define GIF_I "-%x%s"
+#define GIF_II "-%x-%x%s"
+#define GIF_VII "%s"
+
+
+#ifdef HTM
+#define DOS_GIF_FILE
+#endif
+
+
+#define BASE 36
+
+
+#define store_bit_I(ch,i) ch[(i)/8]|=(1<<((i)%8));
+#define store_bit_Z(ch,i) ch[(i)/8]&=~(1<<((i)%8))
+#define add_bit(ch,i,b) ch[(i)/8] |= ((b) << ((i)%8))
+#define get_bit(ch,i) ((ch[(i)/8] >> ((i)%8)) & 1)
+
+
+#define gif_open span_open
+#define gif_alt span_name
+#define gif_class span_size
+#define gif_size span_mag
+#define gif_mag span_ord
+#define gif_ord span_ch
+#define gif_end end_span
+
+
+struct env_c_rec{
+ char *option;
+ struct env_c_rec *next;
+};
+
+
+#ifndef MAXFDIRS
+#define MAXFDIRS 100
+#endif
+
+
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+#define dir_path_slash(str) (is_forward_slash(str)? '/' : '\\')
+#else
+#define dir_path_slash(str) '/'
+#endif
+
+
+#ifndef S_ISDIR
+#define S_ISDIR(M) (((M) & _S_IFMT)==_S_IFDIR)
+#endif
+
+#ifndef _S_IFDIR
+#define _S_IFDIR S_IFDIR
+#endif
+
+#ifndef _S_IFMT
+#define _S_IFMT S_IFMT
+#endif
+
+
+#if defined(DOS_WIN32) || !defined(S_ISLNK)
+#define LSTAT stat
+#else
+#define LSTAT lstat
+#endif
+#define STSTAT stat
+
+
+#define MAX_UNI_CODE 20
+
+
+#define BASE_A 55
+#define BASE_a 87
+
+
+#define get_unt(n) fget_unt(dvi_file,n)
+
+
+#define get_int(n) fget_int(dvi_file,n)
+
+
+#define eq_str(x,y) (!strcmp(x,y))
+#define gt_str(x,y) (strcmp(x,y)>0)
+
+
+#define bad_arg err_i(0)
+#define bad_in_file(name) err_i_str(1,name)
+#define bad_out_file(name) err_i_str(2,name)
+#define bad_special(name) warn_i_str(3,name)
+#define bad_mem err_i(4)
+#define bad_char(chr) warn_i_int(5,chr)
+#define bad_dvi err_i(7)
+
+
+#if defined(DOS_WIN32) || defined(__MSDOS__)
+#define READ_BIN_FLAGS "rb"
+#define READ_TEXT_FLAGS "r"
+#define WRITE_BIN_FLAGS "wb"
+#define WRITE_TEXT_FLAGS "w"
+#else
+#define READ_BIN_FLAGS "r"
+#define READ_TEXT_FLAGS "r"
+#define WRITE_BIN_FLAGS "w"
+#define WRITE_TEXT_FLAGS "w"
+#endif
+
+
+#ifdef PROTOTYP
+#define MYVOID void
+#define ARG_I(x) x
+#define ARG_II(x,y) x,y
+#define ARG_III(x,y,z) x,y,z
+#define ARG_IV(x,y,z,w) x,y,z,w
+#define ARG_V(x,y,z,w,v) x,y,z,w,v
+#define ARG_VI(x,y,z,w,v,u) x,y,z,w,v,u
+#define ARG_VII(x,y,z,w,v,u,t) x,y,z,w,v,u,t
+#else
+#define MYVOID
+#define ARG_I(x)
+#define ARG_II(x,y)
+#define ARG_III(x,y,z)
+#define ARG_IV(x,y,z,w)
+#define ARG_V(x,y,z,w,v)
+#define ARG_VI(x,y,z,w,v,u)
+#define ARG_VII(x,y,z,w,v,u,t)
+#endif
+
+
+
+struct hcode_repl_typ { char *str;
+ struct hcode_repl_typ *next; };
+
+
+struct count_rec{
+ char* str;
+ int i, depth, max;
+ int* stack;
+ struct count_rec* next;
+};
+
+
+struct ch_map_rec{
+ char* line;
+ int max, chars;
+};
+
+
+struct stack_entry{
+ long int x_val, y_val;
+ INTEGER dx_1, dx_2, dy_1, dy_2;
+ BOOL text_on
+, accented
+
+;
+
+struct halign_rec *halign[8];
+BOOL halign_on, halign_info, row_no, col_no;
+
+
+int stack_id;
+struct group_info * begin;
+struct stack_end_entry * end;
+
+
+struct group_path * path_start, * path_end;
+
+
+char *class_open, *class_close,
+ *temp_class_open, *temp_class_close;
+BOOL temp_class_del, ignore_subclass_del, active_class_del,
+ no_left_del, sv_no_left_del;
+
+
+};
+
+
+struct group_info{
+ int stack_id;
+ U_CHAR *info;
+ struct group_info* next;
+};
+
+
+struct stack_end_entry{
+ struct stack_end_entry *next;
+ U_CHAR *send;
+};
+
+
+struct del_stack_entry{
+ struct del_stack_entry *next;
+ U_CHAR ch;
+ int fnt, id;
+};
+
+
+struct send_back_entry{
+ struct send_back_entry *next;
+ U_CHAR *send;
+ int id;
+};
+
+
+struct group_path{
+ U_CHAR action;
+ U_CHAR *path;
+ U_CHAR *info;
+ struct group_path * next;
+};
+
+
+struct font_entry {
+ INTEGER num;
+ INTEGER scale;
+ INTEGER design_sz;
+
+INTEGER mag;
+
+
+
+char *family_name, *font_size;
+
+
+
+ INTEGER design_pt;
+ int char_f, char_l;
+ U_CHAR *char_wi;
+ U_CHAR *char_hidp;
+ int wtbl_n;
+ int htbl_n;
+ int dtbl_n;
+ INTEGER *wtbl;
+ INTEGER *htbl;
+ INTEGER *dtbl;
+ INTEGER word_sp;
+ INTEGER it;
+ INTEGER ex;
+
+
+
+char *name, *gif_on, *ch_str, ch255;
+unsigned U_CHAR **str, *ch, *gif1;
+
+
+unsigned U_CHAR *accent, *accented;
+unsigned int *accent_array, *accented_array, accent_N, accented_N;
+
+
+
+char *math, *math_closing;
+
+
+};
+
+
+struct html_font_rec{ char* name;
+ int i; };
+
+
+
+struct gif_file_rec{
+ U_CHAR code[4];
+ U_CHAR *name;
+ struct gif_file_rec *next; };
+
+
+
+struct env_var_rec{ char* base;
+ struct env_var_rec *next; };
+
+
+struct cache_font_rec{ char* dir;
+ struct cache_file_rec * cache_file;
+ struct cache_font_rec* next; };
+struct cache_file_rec{ struct cache_file_rec* next;
+ U_CHAR * file; };
+
+
+struct htf_com_rec{ char* name;
+ struct htf_com_rec* next; };
+
+
+struct charset_rec{ int ch;
+ char* str; };
+
+
+struct htf_4hf_rec { int ch, type1, type2;
+ char* str; };
+
+
+
+#ifdef WIN32
+static U_CHAR dirname[PATH_MAX];
+#endif
+
+
+static BOOL dos_file_names =
+#ifdef DOS_GIF_FILE
+ TRUE
+#else
+ FALSE
+#endif
+;
+
+
+static FILE* dot_file;
+
+
+static FILE* dvi_file;
+
+
+static char* job_name;
+static int job_name_n;
+
+
+static U_CHAR *no_root_file;
+
+
+static FILE *out_file = (FILE *) 0,
+ *root_file = (FILE *) 0,
+ *cur_o_file = (FILE *) 0;
+
+
+static int stack_len;
+
+
+static BOOL start_span = FALSE, in_span_ch = FALSE;
+
+
+static BOOL in_trace_char = FALSE, block_start = FALSE;
+static int trace_dvi_P = 0, trace_dvi_C = 0,
+ trace_dvi_H = 0, trace_dvi_R = 0, trace_dvi_V = 0;
+static U_CHAR *trace_dvi_del_P, *end_trace_dvi_del_P,
+ *trace_dvi_del_p, *end_trace_dvi_del_p,
+ *trace_dvi_del_C, *end_trace_dvi_del_C,
+ *trace_dvi_del_c, *end_trace_dvi_del_c,
+ *trace_dvi_del_H, *end_trace_dvi_del_H,
+ *trace_dvi_del_h, *end_trace_dvi_del_h,
+ *trace_dvi_del_R, *end_trace_dvi_del_R,
+ *trace_dvi_del_r, *end_trace_dvi_del_r,
+ *trace_dvi_del_V, *end_trace_dvi_del_V,
+ *trace_dvi_del_v, *end_trace_dvi_del_v;
+static int push_depth=0, push_id=0, push_st[256];
+
+
+static long int x_val = 0, max_x_val = -10000,
+ max_y_val = 0, prev_y_val = 0;
+
+
+static BOOL text_on = FALSE;
+
+
+static INTEGER dx_1 = 0, dx_2 = 0;
+
+
+static INTEGER dy_1 = 0, dy_2 = 0;
+static long int y_val = 0;
+
+
+static U_CHAR *eoln_str = (char *)0;
+
+
+static U_CHAR *space_str = (char *)0;
+
+
+static int ignore_chs=0, ignore_spaces=0, recover_spaces=0;
+
+
+static U_CHAR rule_ch = '_';
+static BOOL
+rule_ch_off
+
+ = FALSE;
+
+
+static int cur_fnt = -1;
+
+
+static U_CHAR special_hd[10];
+
+
+static struct hcode_repl_typ *hcode_repl
+ = (struct hcode_repl_typ*) 0;
+
+
+static BOOL nomargin = FALSE;
+static int next_char = -1;
+static U_CHAR *next_str = (char *) 0;
+
+
+static BOOL keepChar = FALSE;
+
+
+static struct files_rec
+ *opened_files = (struct files_rec *) 0, *p;
+
+
+static BOOL system_yes;
+static struct sys_call_rec *system_calls = (struct sys_call_rec *) 0;
+
+
+static struct count_rec *counter = (struct count_rec *) 0;
+
+
+static struct ch_map_rec ch_map[HEIGHT];
+static int max_map_line, min_map_line;
+
+
+static BOOL ch_map_flag = FALSE;
+
+
+static INTEGER xresolution, yresolution;
+
+
+static U_CHAR ok_map = TRUE;
+
+
+static int prevcol = -1, prevrow;
+static double prev_x;
+
+
+static BOOL dvi_flag = FALSE, dvi_page = FALSE;
+static FILE *idv_file;
+
+
+static FILE* log_file;
+
+
+static INTEGER mid_page_y, mid_page_x;
+
+
+static int page_n, file_n;
+
+
+static struct halign_rec *halign[8];
+
+
+static BOOL new_halign = FALSE;
+
+
+static BOOL group_dvi = FALSE;
+
+
+static int stack_n = 0;
+static struct stack_entry* stack;
+
+
+static int ignore_end_group;
+
+
+static struct del_stack_entry *del_stack;
+
+
+static int ch_id, sv_id, id_latex, back_id_off;
+
+
+static struct send_back_entry *back_token, *back_group;
+
+
+static BOOL pos_dvi = FALSE;
+static U_CHAR *pos_body, * pos_text, * pos_line,
+ *end_pos_body, * end_pos_text;
+static double pos_x_A, pos_x_B, pos_y_C, pos_y_D, pos_y_E;
+static long int base_pos_x, base_pos_y, min_pos_x,
+ max_pos_x, min_pos_y, max_pos_y;
+static short rect_pos;
+
+
+static struct font_entry* font_tbl;
+static int font_tbl_size = 0;
+
+
+static char* new_font_name;
+
+
+static U_CHAR *lg_font_fmt = NULL;
+
+
+static double word_sp = 999999.0, margin_sp;
+
+
+static unsigned U_CHAR null_str = '\0';
+
+
+static short dump_htf_files = 0;
+static BOOL dump_env_files = FALSE;
+
+
+static BOOL dumped_env = FALSE;
+
+
+static BOOL verb_ch = FALSE;
+
+
+static U_CHAR *class_fmt = NULL;
+
+
+static U_CHAR *font_gif = NULL;
+
+
+static U_CHAR *begin_char_gif = NULL;
+
+
+static U_CHAR *gif = NULL;
+
+
+
+static struct gif_file_rec * gif_file = (struct gif_file_rec *) 0;
+
+
+
+
+static U_CHAR xeh[]="0123456789abcdefghijklmnopqrstuvxyz";
+
+
+
+static BOOL gif_ch = TRUE;
+static int design_ch = 0;
+
+
+static int pause_style = 0, default_font = -1, base_font_size=6533;
+static BOOL
+ span_name_on = FALSE,
+ span_on = FALSE;
+
+
+static BOOL not_notify = FALSE;
+
+
+static U_CHAR * span_name[256], * span_open[256], * span_size[256],
+ * span_mag[256], * span_ch[256], * end_span[256],
+ * span_ord[256], * gif_id[256];
+static U_CHAR class_on[32];
+
+
+static BOOL needs_accent_sym = FALSE, needs_end_accent = FALSE;
+static char * t_accent_template = (char *) 0,
+ * t_accent_first, * t_accent_second,
+ * t_accent_third, * t_accent_fourth, * t_accent_fifth,
+ * m_accent_template = (char *) 0,
+ * m_accent_first, * m_accent_second,
+ * m_accent_third, * m_accent_fourth, * m_accent_fifth;
+
+
+static BOOL needs_accented_sym = 0;
+static char * a_accent_template = (char *) 0,
+ * a_accent_first, * a_accent_second,
+ * a_accent_third, * a_accent_fourth, * a_accent_fifth;
+
+
+static char * i_accent_template = (char *) 0,
+ * i_accent_first, * i_accent_second,
+ * i_accent_third, * i_accent_fourth, * i_accent_fifth;
+
+
+static BOOL math_class_on = FALSE, show_class = FALSE;
+static int open_del = 256, math_class, pause_class, ignore_subclass_del;
+
+
+static int sv_group_dvi, sv_trace_dvi_C, sv_in_trace_char, sv_span_on,
+ sv_in_span_ch;
+
+
+static U_CHAR *open_class[
+82
+
+],
+ *close_class[
+82
+
+];
+
+
+static BOOL dump_env_search = FALSE;
+
+
+static struct env_c_rec *envChoice
+ = (struct env_c_rec*) 0;
+
+
+static U_CHAR *fontdir[MAXFDIRS];
+static int fontdir_count = 0;
+
+
+static struct cache_font_rec *cache_font, *cur_cache_font;
+
+
+#ifndef KPATHSEA
+static BOOL tex4ht_fls = FALSE;
+static char *tex4ht_fls_name = (char *) 0;
+#endif
+
+
+static U_CHAR *HOME_DIR;
+
+
+#ifndef KPATHSEA
+static FILE* cache_files;
+#endif
+
+
+
+#ifdef KPATHSEA
+static char * export_str_chars = (char *) 0;
+#endif
+
+
+static BOOL dump_htf_search = FALSE;
+
+
+static FILE* put_4ht_file = (FILE *) 0;
+static int put_4ht_off = 1;
+static char uni_code[MAX_UNI_CODE];
+static short uni_code_p = 0;
+
+
+static int charset_n = 0, max_charset_n;
+static struct charset_rec *charset;
+
+
+static BOOL u10 = FALSE;
+
+
+static BOOL utf8 = FALSE;
+
+
+static int htf_4hf_n = 0, max_htf_4hf_n;
+static struct htf_4hf_rec *htf_4hf;
+
+
+static BOOL special_on = FALSE;
+
+
+static U_CHAR *warn_err_mssg[]={
+
+"improper command line\ntex4ht [-f<dir char>]in-file[.dvi]\n"
+" [-c<tag name>] choose named segment in env file\n"
+" [-e<env-file>]\n"
+" [-g<bitmap-file-ext>]\n"
+" [-h(e|f|F|g|s|v|V)] trace: e-errors/warnings, f-htf, F-htf search\n"
+" g-groups, s-specials, v-env, V-env search\n"
+" [-i<htf-font-dir>]\n"
+" [-l<bookkeeping-file>]\n"
+" [-P(*|<filter>)] permission for system calls: *-always, filter\n"
+" [-t<tfm-font-dir>]\n"
+" [-u10] base 10 for unicode characters\n"
+" [-utf8] utf-8 encoding for unicode characters\n"
+" [-xs] ms-dos file names for automatically generated gifs\n"
+
+,
+"Can't find/open file `%s'\n",
+"Can't open output file for `%s'\n",
+"Can't close file `%s' (file is not open)\n",
+"Insufficient memory\n",
+"Bad character code: %d\n",
+"Can't find font number %d\n",
+"Improper dvi file\n",
+"Improper op while scanning font defs in postamble\n",
+"Problem with command line\n",
+"Font definition repeated in postamble\n",
+"Empty entry in font environment variable\n",
+"Can't access directory `%s\n'",
+"Too many directories in font environment variable\n",
+"Missing fonts, can't proceed\n",
+"Invalid header in file `%s'\n",
+"Checksum inconsistent\n",
+"MAXFONTS too small: %d\n",
+"Improper signature at end of file `%s.htf'\n",
+"Improper signature at start of file `%s.htf'\n",
+"Improper file `%s.htf'\n",
+"Couldn't find font `%s.htf' (char codes: ",
+"File `%s.htf' starts/ends with character code %d (instead of %d)\n",
+"Implementation problem\n",
+"Improper groups in \\special{t4ht+}... idv[%d]\n",
+"Too many characters (> %d) for map line: `%c'\n",
+"Extra characters in \\special{t4ht%c...",
+"Page break within a ch map/picture\n",
+"Char code >255 in htf file: %d\n",
+"Improper char for code in htf file: %c\n",
+
+"Illegal storage address\n",
+"Floating-point\n",
+"Interrupt with Cntr-C\n",
+
+
+#ifdef DOS_WIN32
+"%c-script too long in tex4ht.env \n",
+#else
+"%c-script too long in tex4ht.env (.tex4ht)\n",
+#endif
+"Too many rows (> %d) for map: `%c'\n",
+"More than 256 strings in font\n",
+"\\special{t4ht;%c...}?\n",
+"\\special{t4ht;|%s}?\n",
+"\\special{t4ht~!%s}?\n",
+"\\special{t4ht\"...%s}?\n",
+"System error 40\n",
+"`%c' in \\special{t4ht@...} or \\special{t4ht@-...}?\n",
+"\\special{t4ht~...} without \\special{t4ht~}\n",
+"Ignoring \\special{t4ht.%s}\n",
+"PUSH for \\special{t4ht<...%s}?\n",
+"Bad character code (%d) in \\special{t4h~}...\n",
+"Page break in \\special{t4h~}...\n",
+"tex4ht.fls: Couldn't find file `%s'\n",
+"Improper entry (line %d)\n",
+"Improper environment variable %s: `%s'\n",
+"Missing %s\n",
+"Can't back from file `%s\n'",
+"\\special{t4ht%s}?\n",
+
+ "" };
+
+
+static U_CHAR warning[] = "--- warning --- ";
+
+
+static BOOL err_context = FALSE;
+
+
+static U_CHAR *err_mark = (char *) 0;
+
+
+static BOOL trace_special = FALSE;
+
+
+
+#ifdef WIN32
+static BOOL sigint_handler(ARG_I(DWORD));
+#endif
+
+
+static void
+
+#ifdef CDECL
+CDECL
+#endif
+
+
+sig_err(ARG_I(int));
+
+
+static void* malloc_chk(ARG_I(int));
+
+
+static void* r_alloc(ARG_II(void *, size_t));
+
+
+static void strct( ARG_II(char *, U_CHAR *) );
+
+
+static void open_o_file( ARG_I(void) );
+
+
+static FILE* open_html_file( ARG_I(char*) );
+
+
+static void set_del( ARG_II(char **, U_CHAR **) );
+
+
+static void try_new_line( ARG_I(void) );
+
+
+static INTEGER move_x( ARG_I(register INTEGER) );
+
+
+static INTEGER move_y( ARG_I(register INTEGER) );
+
+
+static void rule_x( ARG_I(BOOL) );
+
+
+static BOOL tex4ht_special( ARG_II( int*, long int*) );
+
+
+static void init_ch_map( ARG_I(void) );
+
+
+static void insert_ch_map( ARG_II(char,BOOL) );
+
+
+static void dump_ch_map( ARG_I(void) );
+
+
+static void set_loc( ARG_II(int, long int) );
+
+
+static void idv_char( ARG_I(int) );
+
+
+static void cond_idv_char( ARG_I(int) );
+
+
+static void idv_copy( ARG_I(void) );
+
+
+static void cond_idv_int( ARG_II(long int, int) );
+
+
+static void int_to_dvi( ARG_II(long int, int) );
+
+
+static void cond_string( ARG_II(int, int) );
+
+
+static INTEGER advance_idv_page( ARG_II( INTEGER,char*) );
+
+
+static void store_mv( ARG_II( int, INTEGER) );
+
+
+static void push_stack( ARG_I(void) );
+
+
+static void pop_stack( ARG_I(void) );
+
+
+static struct del_stack_entry* push_del( ARG_II(char, int) );
+
+
+static struct del_stack_entry* pop_del( ARG_III(char,int,int) );
+
+
+static
+struct send_back_entry * rev_list( ARG_I(struct send_back_entry *) );
+
+
+static struct send_back_entry *
+ back_insert( ARG_II(struct send_back_entry *, int) );
+
+
+static double pos_dbl( ARG_I(long int *) );
+
+
+static int search_font_tbl( ARG_I(int) );
+
+
+static int get_html_ch( ARG_I(FILE*) );
+
+
+static FILE* f_open( ARG_II(char*,char*) );
+
+
+static void dump_htf( ARG_I(FILE*) );
+
+
+static void dump_env( ARG_I(void) );
+
+
+static void htf_to_lg( ARG_IV(struct html_font_rec*,char*,int,FILE*));
+
+
+static INTEGER get_html_file_id( ARG_IV(FILE*, int, int, int) );
+
+
+static void notify_class_info( ARG_I(int) );
+
+
+static void script( ARG_IV(char *, U_CHAR *, int, U_CHAR *) );
+
+
+
+static void dos_gif_file( ARG_III(char *, int, int) );
+
+
+
+static void put_alt_ch( ARG_II( int, BOOL) );
+
+
+static void get_open_accent(
+ ARG_VII(char**, char**, char**, char**, char**, char**, long int*));
+
+
+static int scan_class( ARG_I(int) );
+
+
+static INTEGER set_ch_class( ARG_I(int) );
+
+
+static int math_class_of( ARG_II(int,int) );
+
+
+static char* get_script( ARG_III(char *, U_CHAR *, int) );
+
+
+static BOOL search_dot_file( ARG_I( int) );
+
+
+static struct env_var_rec * get_env_var( ARG_I(char *) );
+
+
+static void com_dir( ARG_I(char*) );
+
+
+#ifdef KPATHSEA
+static void export_htf( ARG_II(char**, char[]) );
+#endif
+
+
+static FILE* search_in_dot_file( ARG_IV( int, U_CHAR *, U_CHAR *,
+ struct env_var_rec *) );
+
+
+static FILE* search_file_base( ARG_IV( U_CHAR *, U_CHAR *, U_CHAR *,
+ struct env_var_rec *) );
+
+
+static char * abs_addr( ARG_II( U_CHAR *, U_CHAR *) );
+
+
+static FILE* search_file( ARG_III(char *, U_CHAR *, U_CHAR *) );
+
+
+static void add_to_cache( ARG_III(char*,char*,int) );
+
+
+static FILE* search_file_ext( ARG_III(char *, U_CHAR *, U_CHAR *) );
+
+
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+ static BOOL is_forward_slash( ARG_I(char*) );
+#endif
+
+
+static FILE* f_open_pathed_filename( ARG_II(char*,char*) );
+
+
+static INTEGER put_4ht_ch( ARG_II(int,FILE *) );
+
+
+static void flush_uni( ARG_I(void) );
+
+
+static INTEGER insert_ch( ARG_I(int) );
+
+
+static void put_char( ARG_I(int) );
+
+
+static void print_f( ARG_I(char*) );
+
+
+static void print_f_4ht( ARG_I(char*) );
+
+
+static int get_char( ARG_I(void) );
+
+
+static int get_noop( ARG_I(void) );
+
+
+static char* get_str( ARG_I(int) );
+
+
+static long fget_unt( ARG_II(FILE*, int) );
+
+
+static long fget_int( ARG_II(FILE *, int) );
+
+
+static long cond_int( ARG_I(register INTEGER) );
+
+
+static void warn_i( ARG_I(int) );
+
+
+static void warn_i_int( ARG_II(int,int) );
+
+
+static void warn_i_int_2( ARG_III(int,int,int) );
+
+
+static void warn_i_str( ARG_II(int,char *) );
+
+
+static void warn_i_str2( ARG_III(int,char *,char *) );
+
+
+static void err_i( ARG_I(int) );
+
+
+static void err_i_int( ARG_II(int,int) );
+
+
+static void err_i_str( ARG_II(int,char *) );
+
+
+static void show_err_context( ARG_I(void) );
+
+
+
+#ifdef WIN32
+
+
+
+static BOOL sigint_handler
+#ifdef ANSI
+#define SEP ,
+( DWORD dwCtrlType
+)
+#undef SEP
+#else
+#define SEP ;
+(dwCtrlType) DWORD dwCtrlType
+;
+#undef SEP
+#endif
+{
+ err_i(32);
+ return FALSE;
+}
+#endif
+
+
+
+static void
+
+#ifdef CDECL
+CDECL
+#endif
+
+
+sig_err
+#ifdef ANSI
+#define SEP ,
+( int s
+)
+#undef SEP
+#else
+#define SEP ;
+(s) int s
+;
+#undef SEP
+#endif
+{
+ (void) signal(s,SIG_IGN);
+ switch( s ){
+#ifdef SIGSEGV
+ case SIGSEGV: err_i(30);
+#endif
+ case SIGFPE : err_i(31);
+#if defined(SIGINT) && !defined(WIN32)
+ case SIGINT : err_i(32);
+#endif
+ }
+
+#ifdef __DJGPP__
+ if (s != SIGINT && s != SIGQUIT)
+ exit(EXIT_FAILURE);
+#endif
+
+
+}
+
+
+
+static void* malloc_chk
+#ifdef ANSI
+#define SEP ,
+( int n
+)
+#undef SEP
+#else
+#define SEP ;
+( n ) int n
+;
+#undef SEP
+#endif
+{ void* p;
+ if((p = (void *) malloc( (size_t) n)) == NULL ) bad_mem;
+ return p;
+}
+
+
+
+static void* r_alloc
+#ifdef ANSI
+#define SEP ,
+(
+ void *q SEP
+ size_t n
+)
+#undef SEP
+#else
+#define SEP ;
+( q, n )
+ void *q SEP
+ size_t n
+;
+#undef SEP
+#endif
+{ void* p;
+ if((p = (void *) realloc( q, (size_t) n)) == NULL) bad_mem;
+ return p;
+}
+
+
+
+static void strct
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR * str1 SEP
+ U_CHAR * str2
+
+)
+#undef SEP
+#else
+#define SEP ;
+( str1, str2 )
+ U_CHAR * str1 SEP
+ U_CHAR * str2
+
+;
+#undef SEP
+#endif
+{ U_CHAR * ch;
+ ch = str1 + (int) strlen(str1);
+ (IGNORED) strcpy( ch, str2 );
+}
+
+
+static void open_o_file(MYVOID)
+{
+
+ struct files_rec* p;
+p = m_alloc(struct files_rec, 1);
+if( opened_files != (struct files_rec*) 0 ) opened_files->prev = p;
+p->prev = (struct files_rec *) 0;
+p->next = opened_files; opened_files = p;
+p->name = no_root_file;
+p->file =
+
+
+ cur_o_file = root_file = open_html_file(no_root_file);
+ no_root_file = (char *) 0;
+}
+
+
+
+static FILE* open_html_file
+#ifdef ANSI
+#define SEP ,
+(
+ char* name
+)
+#undef SEP
+#else
+#define SEP ;
+(name)
+ char* name
+;
+#undef SEP
+#endif
+{ FILE* file;
+ char* str;
+ str = m_alloc(char, (int) strlen(name) + 1);
+ (IGNORED) strcpy(str, name);
+ (IGNORED) printf(" file %s\n", str);
+ (IGNORED) fprintf(log_file, "File: %s\n", str);
+ if( (file = fopen(str, WRITE_TEXT_FLAGS)) == NULL ) bad_in_file(str);
+ free((void *) str);
+ return file;
+}
+
+
+
+static void set_del
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR ** del SEP
+ U_CHAR ** end_del
+)
+#undef SEP
+#else
+#define SEP ;
+( del, end_del )
+ U_CHAR ** del SEP
+ U_CHAR ** end_del
+;
+#undef SEP
+#endif
+{
+ *del = m_alloc(char, 1); **del = '\0';
+ *end_del = m_alloc(char, 1); **end_del = '\0';
+}
+
+
+static void try_new_line(MYVOID)
+{ long int v;
+ double dy;
+ dy = (cur_fnt == -1)? 0.0 : (
+(
+design_size_to_pt( 1.7 * (double) font_tbl[cur_fnt].ex )
+* (double) font_tbl[cur_fnt].scale
+
+ < 0? -1 : 1)
+
+ *
+design_size_to_pt( 1.7 * (double) font_tbl[cur_fnt].ex )
+* (double) font_tbl[cur_fnt].scale
+
+) ;
+ v = y_val - prev_y_val;
+ if( !text_on && (y_val > max_y_val) ){
+ if( v > dy/2.5 ){
+
+if( !no_root_file ){
+
+if( needs_end_accent && t_accent_template ){
+
+if( span_on && in_span_ch ){
+ if( *end_span[0] ){
+ in_span_ch = FALSE;
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, end_span[0]);
+} }
+
+
+ (IGNORED) fprintf(cur_o_file, t_accent_fifth);
+ needs_end_accent = FALSE;
+needs_accented_sym--;
+
+
+}
+
+
+ if( !
+rule_ch_off
+
+ ){ put_char('\n'); }
+}
+
+ max_x_val = -10000;
+ prev_y_val = max_y_val = stack_n? y_val : 0;
+ }
+ }else{
+ if( v > dy ){
+if( !no_root_file ){
+
+if( needs_end_accent && t_accent_template ){
+
+if( span_on && in_span_ch ){
+ if( *end_span[0] ){
+ in_span_ch = FALSE;
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, end_span[0]);
+} }
+
+
+ (IGNORED) fprintf(cur_o_file, t_accent_fifth);
+ needs_end_accent = FALSE;
+needs_accented_sym--;
+
+
+}
+
+
+ if( !
+rule_ch_off
+
+ ){ put_char('\n'); }
+}
+
+ max_x_val = x_val;
+ prev_y_val = stack_n? y_val : 0;
+ }else if( v < -(dy / 1.4) ) prev_y_val = stack_n? y_val : 0;
+} }
+
+
+
+static INTEGER move_x
+#ifdef ANSI
+#define SEP ,
+(
+ register INTEGER d
+)
+#undef SEP
+#else
+#define SEP ;
+( d )
+ register INTEGER d
+;
+#undef SEP
+#endif
+{ register long i, dx;
+ x_val += d;
+ if( (x_val > max_x_val) && x_val ){
+ if( max_x_val == -10000) max_x_val = x_val - d;
+
+i = (INTEGER) ( (double) (dx = x_val - max_x_val)
+ / (text_on? word_sp : margin_sp)
+ + 0.5 );
+if( i<0 ) i=0;
+if( !i ){
+ long curr_pos;
+ BOOL done;
+ int ch, cr_fnt;
+curr_pos = ftell(dvi_file);
+done = FALSE;
+while( !done ){
+ ch = get_char();
+ switch( ch ){
+
+
+
+case
+246
+: (void) get_char();
+case
+245
+: (void) get_char();
+case
+244
+: (void) get_char();
+case
+243
+: {
+ for( i=0; i<14; i++ ) ch = get_char();
+ for( i=ch + get_char(); i>0; i--) (void) get_char();
+ break;
+}
+
+
+ case
+141
+:
+ case
+142
+: { break; }
+ default: {
+ if( (ch <
+171
+) || (ch >
+234
+) ){
+ done = TRUE;
+ } else {
+
+ double word_sp;
+cr_fnt = ch -
+171
+;
+cr_fnt = search_font_tbl( cr_fnt );
+word_sp = design_size_to_pt( font_tbl[cr_fnt].word_sp )
+ * (double) font_tbl[cr_fnt].scale;
+i = (INTEGER) ( (double) dx
+ / (text_on? word_sp : margin_sp)
+ + 0.5 );
+if( i>0 ){ i =1; }
+
+
+} } } }
+(IGNORED) fseek(dvi_file, curr_pos,
+0
+);
+
+ }
+if( i ){
+if( trace_dvi_H && !ch_map_flag ){
+ if( *trace_dvi_del_H != '\0' ){
+ (IGNORED) fprintf(cur_o_file, "%s%d", trace_dvi_del_H, (int) dx);
+ }
+ (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_H);
+}
+
+ }
+if( !ignore_spaces ){
+
+if( needs_end_accent && t_accent_template ){
+
+if( span_on && in_span_ch ){
+ if( *end_span[0] ){
+ in_span_ch = FALSE;
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, end_span[0]);
+} }
+
+
+ (IGNORED) fprintf(cur_o_file, t_accent_fifth);
+ needs_end_accent = FALSE;
+needs_accented_sym--;
+
+
+}
+
+
+ while( i-- ) { text_on=TRUE; put_char(' '); }
+} else { recover_spaces = (int) i; }
+max_x_val = x_val;
+
+
+ } else if( d && text_on && (x_val != max_x_val) ){
+
+i = (INTEGER) ( (double) (dx = d) / word_sp + 0.5 );
+if( i<0 ) i=0;
+if( !i ) i = dx>99999L;
+if( i ){ put_char(' '); }
+
+
+ }
+ return d;
+}
+
+
+
+static INTEGER move_y
+#ifdef ANSI
+#define SEP ,
+( register INTEGER d
+)
+#undef SEP
+#else
+#define SEP ;
+( d ) register INTEGER d
+;
+#undef SEP
+#endif
+{ y_val += d;
+
+if( trace_dvi_V && !ch_map_flag ){
+ if( *trace_dvi_del_V != '\0' ){
+ (IGNORED) fprintf(cur_o_file, "%s%d", trace_dvi_del_V, d);
+ }
+ (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_V);
+}
+
+
+ return d;
+}
+
+
+
+static void rule_x
+#ifdef ANSI
+#define SEP ,
+(
+ BOOL tag
+)
+#undef SEP
+#else
+#define SEP ;
+( tag )
+ BOOL tag
+;
+#undef SEP
+#endif
+{ long i, right, up;
+ up = (INTEGER) get_int(4);
+ right = (INTEGER) get_int(4);
+ if( ch_map_flag ){
+ long int sv_x_val, sv_y_val, sv_right, sv;
+ int ch;
+sv_x_val = x_val;
+sv_y_val = y_val;
+sv_right = right;
+y_val-=up;
+if( right < 0 ){ x_val += right; right = -right; }
+if( up < 0 ){ y_val += up; up = -up; }
+ch = ( (right > xresolution) && (up > yresolution) ) ?
+
+3
+ : ( ( right > up )?
+1
+ :
+2
+ );
+right += x_val;
+up += sv = y_val;
+for( ; x_val < right; x_val += xresolution )
+ for( y_val = sv ; y_val < up; y_val += yresolution )
+ insert_ch_map((char) ch, FALSE);
+x_val = sv_x_val;
+y_val = sv_y_val;
+if( sv_x_val + sv_right > max_x_val ) max_x_val = sv_x_val + sv_right;
+if(
+tag
+ ) x_val += sv_right;
+
+ }
+ else if( pos_dvi ){
+
+ long int d;
+if( (up > 0) && (right > 0) ){
+ if( *pos_line ){
+ double from_x, from_y;
+
+if( no_root_file ){ open_o_file(); }
+
+
+ from_x = pos_x_A * (x_val - base_pos_x) + pos_x_B;
+ from_y = pos_y_C * (y_val - pos_y_E * up - base_pos_y) + pos_y_D;
+ switch (rect_pos){
+ case 1: {
+ (IGNORED) fprintf(cur_o_file, pos_line,
+ from_x, from_y,
+ pos_x_A * right + pos_x_B + from_x,
+ pos_y_C * up + pos_y_D + from_y );
+ break; }
+ case 2: {
+ (IGNORED) fprintf(cur_o_file, pos_line,
+ from_x, from_y,
+ pos_x_A * right + pos_x_B + from_x,
+ from_y,
+ pos_y_C * up + pos_y_D );
+ break; }
+ default: {
+ (IGNORED) fprintf(cur_o_file, pos_line,
+ from_x, from_y,
+ pos_x_A * right,
+ pos_y_C * up);
+ }
+ }
+ }
+ if( x_val < min_pos_x ) min_pos_x = x_val;
+ if( (d = x_val + right) > max_pos_x ) max_pos_x = d;
+ if( (d = y_val - up) < min_pos_y ) min_pos_y = d;
+ if( y_val > max_pos_y ) max_pos_y = y_val;
+}
+
+
+ if( tag ) x_val += right;
+ } else if( (up>0) && (right>0) ) {
+
+if( (x_val + right) &&
+ ( ((x_val + right) > max_x_val)
+ || ( !text_on && !ignore_chs )
+ )
+){
+ if( (max_x_val == -10000) || ((x_val + right) <= max_x_val) )
+ { max_x_val = x_val; }
+ i = (INTEGER) ( (double) (x_val + right - max_x_val)
+ / (text_on? word_sp : margin_sp)
+ + 0.5 );
+ if( i && !text_on ) try_new_line();
+
+if( trace_dvi_R && !ch_map_flag ){
+ if( *trace_dvi_del_R != '\0' ){
+ (IGNORED) fprintf(cur_o_file, "%s%d %d",
+ trace_dvi_del_R, (int) x_val, (int) y_val);
+ }
+ (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_R);
+}
+
+
+ while( i-- ) { text_on=TRUE;
+ if( rule_ch && !
+rule_ch_off
+
+ ){ put_char(rule_ch); }
+ }
+
+if( trace_dvi_R && !ch_map_flag ){
+ if( *trace_dvi_del_r != '\0' ){
+ (IGNORED) fprintf(cur_o_file, "%s%d %d",
+ trace_dvi_del_R, (int) right, (int) up);
+ }
+ (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_r);
+}
+
+
+ max_x_val = x_val + right;
+}
+
+
+ if( tag ) x_val += right;
+ } else {
+
+
+if( trace_dvi_R && !ch_map_flag ){
+ if( *trace_dvi_del_R != '\0' ){
+ (IGNORED) fprintf(cur_o_file, "%s%d %d",
+ trace_dvi_del_R, (int) x_val, (int) y_val);
+ }
+ (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_R);
+}
+
+
+
+if( trace_dvi_R && !ch_map_flag ){
+ if( *trace_dvi_del_r != '\0' ){
+ (IGNORED) fprintf(cur_o_file, "%s%d %d",
+ trace_dvi_del_R, (int) right, (int) up);
+ }
+ (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_r);
+}
+
+
+
+
+ if( tag ) x_val += right;
+} }
+
+
+
+static BOOL tex4ht_special
+#ifdef ANSI
+#define SEP ,
+(
+ int *chr SEP
+ long int *special_n
+
+)
+#undef SEP
+#else
+#define SEP ;
+( chr, special_n)
+ int *chr SEP
+ long int *special_n
+
+;
+#undef SEP
+#endif
+{ BOOL tex4ht;
+ int i;
+ long unsigned N;
+ tex4ht = FALSE;
+
+*special_n = (long int) (N = get_unt(*chr -
+239
+ + 1));
+for(i=4; i--; ){
+ special_hd[i] = (unsigned char) (N & 0xFF);
+ N = N >> 8; }
+
+
+ if( *special_n > (long int) 4 ){
+ for(i=4; i<9; i++) special_hd[i]=get_char();
+ special_hd[9]='\0';
+
+tex4ht = (special_hd[4] == 't') || (special_hd[4] == 'T');
+tex4ht = tex4ht && special_hd[5] == '4';
+tex4ht = tex4ht && ((special_hd[6] == 'h') || (special_hd[6] == 'H'));
+tex4ht = tex4ht && ((special_hd[7] == 't') || (special_hd[7] == 'T'));
+if( tex4ht && trace_special ){
+
+{ long curr_pos;
+ int n, i;
+ U_CHAR ch;
+
+ curr_pos = ftell(dvi_file);
+ print_f("\nSPECIAL: "); ch = special_hd[8]; i=60;
+ for( n=*special_n - 3; n--;){
+ if( !i ){ (IGNORED) putc( '\n', cur_o_file ); i=70; }
+ else i--;
+ (IGNORED) putc(( (ch>31) && (ch<127))? ch : ' ', cur_o_file);
+ ch = get_char();
+ }
+ (IGNORED) putc( '\n', cur_o_file );
+ (IGNORED) fseek(dvi_file, curr_pos,
+0
+);
+}
+
+
+}
+
+
+ *chr = special_hd[8];
+ tex4ht = tex4ht && ( (*chr == '=') || (*chr == '<') ||
+ (*chr == '>') || (*chr == '*') || (*chr == '@') ||
+ (*chr == ':') || (*chr == '"') || (*chr == '~') ||
+ (*chr == ';') || (*chr == '.') || (*chr == '^') ||
+ (*chr == '|') || (*chr == '+') || (*chr == '!') );
+ *special_n -= 5; }
+ else{ special_hd[4]='\0'; }
+ return tex4ht;
+}
+
+
+static void init_ch_map(MYVOID)
+{ int i;
+ for( i=0; i<HEIGHT; i++ ){
+ ch_map[i].max = 0; ch_map[i].chars = 0; ch_map[i].line = NULL; }
+ max_map_line = -1;
+ min_map_line = HEIGHT;
+}
+
+
+
+static void insert_ch_map
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR ch SEP
+ BOOL
+tag
+
+
+)
+#undef SEP
+#else
+#define SEP ;
+( ch,
+tag
+ )
+ U_CHAR ch SEP
+ BOOL
+tag
+
+
+;
+#undef SEP
+#endif
+{ int row, col;
+
+{ double x;
+ row = (int) ( (y_val>0? y_val : 0.0) / (double) yresolution + 0.5);
+ if( row >= HEIGHT ){
+ if( ok_map ){ warn_i_int_2( 34, row, ch); ok_map = FALSE; }
+ return; }
+ x = (x_val>0? x_val : 0.0 ) / (double) xresolution + 0.75;
+ col = (int) x;
+ if( (ch > ' ') && (ch != '-') && (ch != '|') ){
+ if( row == prevrow ){
+ if( (col == prevcol + 1) && (x > prev_x + 0.5) )
+ insert_ch_map(' ', TRUE);
+ else if( (col > prevcol + 1) && (x < prev_x+0.2)
+ && ( ch != '&' ))
+ col = prevcol + 1;
+ }else prevrow = -1;
+ prev_x = x
+ + (
+design_size_to_pt( *(font_tbl[cur_fnt].wtbl
+ + (int) (
+*(font_tbl[cur_fnt].char_wi + (int)
+ ( (design_ch? design_ch : ch) - font_tbl[cur_fnt].char_f)% 256)
+
+)) )
+ * (double) font_tbl[cur_fnt].scale
+
+)
+ / (double) xresolution;
+ prevcol = col;
+ }else prevrow = -1;
+ prevrow = row;
+}
+
+
+ if(ch != 10){
+ if( (ch_map[row].max > MAX_MAP_LINE) || (col > MAX_MAP_LINE) ){
+ if( ok_map ){ warn_i_int_2( 25, MAX_MAP_LINE, ch);
+ ok_map = FALSE; }
+ }else{
+ if( row < min_map_line ) min_map_line = row;
+ if( row > max_map_line ) max_map_line = row;
+ if( ch_map[row].max ){
+ int n;
+ char* p;
+if( ch_map[row].chars > col ){
+
+if(
+tag
+ ){
+ if( *(ch_map[row].line + ch_map[row].max - 1)
+ || (ch_map[row].chars - col == 1) ){
+ch_map[row].max += 5;
+ch_map[row].line = (char *)
+ r_alloc((void *) ch_map[row].line,
+ (size_t) ch_map[row].max + 1 );
+for( n = 0; n<5; n++ )
+ *(ch_map[row].line + ch_map[row].max - n) = 0;
+ch_map[row].chars += 5;
+
+ }
+ col = (ch_map[row].chars--) - col;
+ p = ch_map[row].line + ch_map[row].max;
+ while( col ){ unsigned char temp_ch;
+ if( ((unsigned char) (*p)) <
+4
+ ) col--;
+ temp_ch = *(--p); *(p+1) = temp_ch; }
+} else {
+ col = ch_map[row].chars - col;
+ p = ch_map[row].line + ch_map[row].max;
+ while( col ){
+ if( ((unsigned char) (*p)) <
+4
+ ) col--; p--; }
+}
+*(++p) = ch;
+
+ }
+else{
+n = (col - ch_map[row].chars + 8) / 5 * 5;
+ch_map[row].chars += n -
+tag
+;
+ch_map[row].max += n;
+ch_map[row].line = (char *)
+ r_alloc((void *) ch_map[row].line,
+ (size_t) ch_map[row].max + 1);
+while( n-- ) *(ch_map[row].line + ch_map[row].max - n) = 0;
+*(ch_map[row].line + ch_map[row].max
+ - (ch_map[row].chars - col) + !
+tag
+ ) = ch;
+
+ }
+
+ }
+ else {
+ int n;
+ char* p;
+ch_map[row].chars = (n = (col + 2 + 5) / 5 * 5) -
+tag
+;
+ch_map[row].max = n - 1;
+ch_map[row].line = p = m_alloc(char, n);
+while( n-- ){ *(p++) = 0; }
+*(ch_map[row].line + col) = ch;
+
+ }
+} } }
+
+
+static void dump_ch_map(MYVOID)
+{ int n, i, min, k, extra_sp;
+ U_CHAR *p;
+
+
+{ int max;
+ min = 100; max = 0;
+ for( i=min_map_line; i<=max_map_line; i++ ){
+ p = ch_map[i].line;
+ n = ch_map[i].max; if( max < n ) max = n;
+ k = 0; while( n-- ){ if(*(p++)) break; k++; }
+ if( ch_map[i].max && (k < min) ) min = k; }
+ if( (max < 78) && !nomargin ) min = 0;
+}
+
+
+ for( i=min_map_line; i<=max_map_line; i++ ){
+ if( ( n = ch_map[i].max) > 0 ){
+ p = ch_map[i].line; k = min; extra_sp = 0;
+
+{ U_CHAR *s;
+ s = p + n;
+ while( n && !(*s) && !(*(s-1)) ){ n--; s--; }
+ if( n && !(*s) && (((unsigned char) *(s-1)) <
+4
+) ) n--;
+}
+
+
+ while( 1 + n-- ){
+ if( --k < 0 ){
+ if( extra_sp && (((unsigned char) *p) <
+4
+)
+ && (((unsigned char) *(p+1)) <
+4
+) )
+ { extra_sp--;
+ } else { switch( *p ){
+ case 0: { put_char(' '); break; }
+ case
+1
+: { put_char('-'); break; }
+ case
+2
+: { put_char('|'); break; }
+case
+3
+: { put_char('#'); break; }
+ case ' ': { extra_sp++; }
+ default: {
+ BOOL tag;
+ INTEGER count;
+tag = TRUE; count = 0;
+do{ if( *p == '<' ) tag = FALSE;
+ else if( *p == '>' ) tag = TRUE;
+ else count += tag;
+ put_char( *p ); n--;
+}while( ((unsigned char) *(++p)) >=
+4
+ );
+if( !count ){ n++; p--; }
+
+ break; }
+
+ } }
+ }
+ p++;
+ }
+ free((void *) ch_map[i].line );
+ }
+ if( i<max_map_line ) put_char('\n');
+ }
+ nomargin = FALSE;
+}
+
+
+
+static void set_loc
+#ifdef ANSI
+#define SEP ,
+(
+ int op SEP
+ long int d
+
+)
+#undef SEP
+#else
+#define SEP ;
+( op, d )
+ int op SEP
+ long int d
+
+;
+#undef SEP
+#endif
+{
+ idv_char( op + 3 ); int_to_dvi( d, 4 ); file_n += 5;
+}
+
+
+
+static void idv_char
+#ifdef ANSI
+#define SEP ,
+( int n
+)
+#undef SEP
+#else
+#define SEP ;
+( n ) int n
+;
+#undef SEP
+#endif
+{ (IGNORED) putc( n, idv_file ); }
+
+
+
+static void cond_idv_char
+#ifdef ANSI
+#define SEP ,
+( int n
+)
+#undef SEP
+#else
+#define SEP ;
+( n ) int n
+;
+#undef SEP
+#endif
+{
+ if( dvi_flag ){ (IGNORED) putc( n, idv_file ); file_n++; }
+}
+
+
+static void idv_copy( MYVOID )
+{ idv_char( get_char() ); file_n++; }
+
+
+
+static void cond_idv_int
+#ifdef ANSI
+#define SEP ,
+( long int val SEP
+ int n
+)
+#undef SEP
+#else
+#define SEP ;
+( val, n ) long int val SEP
+ int n
+;
+#undef SEP
+#endif
+{
+ if( dvi_flag ){ int_to_dvi((long int) val, n ); file_n += n; }
+}
+
+
+
+static void int_to_dvi
+#ifdef ANSI
+#define SEP ,
+( long int val SEP
+ int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+( val, n ) long int val SEP
+ int n
+
+;
+#undef SEP
+#endif
+{ unsigned U_CHAR ch2, ch3, ch4;
+ ch4 = (unsigned char) (val & 0xFF); val = val >> 8;
+ ch3 = (unsigned char) (val & 0xFF); val = val >> 8;
+ ch2 = (unsigned char) (val & 0xFF); val = val >> 8;
+ switch( n ){
+ case 4: idv_char( (int) val );
+ case 3: idv_char( ch2 );
+ case 2: idv_char( ch3 );
+ case 1: idv_char( ch4 ); }
+
+}
+
+
+
+static void cond_string
+#ifdef ANSI
+#define SEP ,
+( int ch SEP int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+(ch, n) int ch SEP int n
+
+;
+#undef SEP
+#endif
+{ cond_idv_char( ch );
+ while( n-- ) cond_idv_char( get_char() );
+}
+
+
+
+static INTEGER advance_idv_page
+#ifdef ANSI
+#define SEP ,
+(
+ INTEGER bop_addr SEP
+ char* cur_font
+
+)
+#undef SEP
+#else
+#define SEP ;
+( bop_addr, cur_font )
+ INTEGER bop_addr SEP
+ char* cur_font
+
+;
+#undef SEP
+#endif
+{ int i;
+ if( page_n++ ){
+ idv_char(
+142
+); file_n++;
+ idv_char(
+140
+); file_n++;
+ idv_char(
+139
+ );
+ idv_int( page_n ); for( i=36; i--; ) idv_char( 0);
+ idv_int( bop_addr ); bop_addr = file_n; file_n += 45;
+ idv_char(
+141
+); file_n++;
+ for( i=1; i<=cur_font[0]; i++ ){
+ idv_char( cur_font[i] ); file_n++;
+ } }
+
+store_mv(
+151
+, dx_1);
+store_mv(
+156
+, dx_2);
+store_mv(
+165
+, dy_1);
+store_mv(
+170
+, dy_2);
+
+
+ return bop_addr;
+}
+
+
+
+static void store_mv
+#ifdef ANSI
+#define SEP ,
+( int op SEP INTEGER d
+
+)
+#undef SEP
+#else
+#define SEP ;
+(op, d) int op SEP INTEGER d
+
+;
+#undef SEP
+#endif
+{
+ if( dvi_flag ){
+ cond_idv_char(op); idv_int( (INTEGER) -d);
+ cond_idv_char(op); idv_int( (INTEGER) d); file_n += 8; }
+}
+
+
+static void push_stack(MYVOID)
+{
+ stack[stack_n].x_val = x_val;
+ stack[stack_n].dx_1 = dx_1;
+ stack[stack_n].dx_2 = dx_2;
+ stack[stack_n].y_val = y_val;
+ stack[stack_n].dy_1 = dy_1;
+ stack[stack_n].dy_2 = dy_2;
+
+stack[stack_n+1].sv_no_left_del = stack[stack_n+1].no_left_del;
+stack[stack_n+1].no_left_del = stack[stack_n].no_left_del;
+
+
+ stack_n++;
+if( stack_n >
+((int) stack_len + 2)
+
+ ){
+ warn_i(40);
+}
+
+stack[stack_n].accented = FALSE;
+
+
+}
+
+
+static void pop_stack(MYVOID)
+{
+
+if( stack[stack_n].accented ){
+
+needs_accented_sym--;
+
+
+ stack[stack_n].accented=FALSE;
+}
+
+
+
+stack[stack_n].no_left_del = stack[stack_n].sv_no_left_del;
+
+
+ --stack_n;
+ x_val = stack[stack_n].x_val;
+ dx_1 = stack[stack_n].dx_1;
+ dx_2 = stack[stack_n].dx_2;
+ y_val = stack[stack_n].y_val;
+ dy_1 = stack[stack_n].dy_1;
+ dy_2 = stack[stack_n].dy_2;
+}
+
+
+
+static struct del_stack_entry* push_del
+#ifdef ANSI
+#define SEP ,
+( U_CHAR ch SEP
+ int cr_fnt
+)
+#undef SEP
+#else
+#define SEP ;
+(ch, cr_fnt) U_CHAR ch SEP
+ int cr_fnt
+;
+#undef SEP
+#endif
+{ struct del_stack_entry *p;
+ p = m_alloc(struct del_stack_entry,1);
+ p->next = del_stack;
+ p->ch = ch;
+ p->fnt = cr_fnt;
+ p->id = ch_id;
+ return p;
+}
+
+
+
+static struct del_stack_entry* pop_del
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR ch SEP
+ int id_hide SEP
+ int cr_fnt
+)
+#undef SEP
+#else
+#define SEP ;
+(ch, id_hide, cr_fnt)
+ U_CHAR ch SEP
+ int id_hide SEP
+ int cr_fnt
+;
+#undef SEP
+#endif
+{
+ if( del_stack != (struct del_stack_entry*) 0 ){
+ if( (cr_fnt == del_stack->fnt) &&
+ ( *(font_tbl[cr_fnt].math + (ch - font_tbl[cr_fnt].char_f))
+ == del_stack->ch) ){
+ struct del_stack_entry * p;
+ if( !id_hide && !id_latex ){ sv_id = del_stack->id; }
+ del_stack = (p = del_stack)->next; free((void *) p );
+ } }
+ return del_stack;
+}
+
+
+
+static struct send_back_entry * rev_list
+#ifdef ANSI
+#define SEP ,
+(
+ struct send_back_entry *back_group
+)
+#undef SEP
+#else
+#define SEP ;
+(back_group)
+ struct send_back_entry *back_group
+;
+#undef SEP
+#endif
+{ struct send_back_entry *p, *q, *t;
+ if( back_group->id == -1 ){ return back_group; }
+ p = back_group; q = p->next;
+ while( p->id != -1 ){
+ t = q->next; q->next = p; p = q; q = t;
+ }
+ back_group->next = p;
+ return p->next;
+}
+
+
+
+static struct send_back_entry * back_insert
+#ifdef ANSI
+#define SEP ,
+(
+ struct send_back_entry *back SEP
+ int id
+)
+#undef SEP
+#else
+#define SEP ;
+(back, id)
+ struct send_back_entry *back SEP
+ int id
+;
+#undef SEP
+#endif
+{
+ while( back->id == id ){
+ struct send_back_entry *p;
+ print_f( back->send );
+ back = (p = back)->next;
+ free((void *) p->send );
+ free((void *) p );
+ }
+ return back;
+}
+
+
+
+static double pos_dbl
+#ifdef ANSI
+#define SEP ,
+( long int * special_n
+)
+#undef SEP
+#else
+#define SEP ;
+( special_n ) long int * special_n
+;
+#undef SEP
+#endif
+{
+ U_CHAR ch;
+ double v;
+ int d;
+ v = 0.0; d = 10;
+ while( --(*special_n) > 0 ){
+ ch = get_char();
+ if( ('0' <= ch ) && (ch <= '9' ) ){
+ v += (double) (ch -'0') / d; d *= 10; }
+ else break;
+ }
+ return v;
+}
+
+
+
+static int search_font_tbl
+#ifdef ANSI
+#define SEP ,
+(
+ int cur_fnt
+)
+#undef SEP
+#else
+#define SEP ;
+( cur_fnt )
+ int cur_fnt
+;
+#undef SEP
+#endif
+{ int i;
+ for( i=0; i<font_tbl_size; i++)
+ if( font_tbl[i].num == cur_fnt ) return i;
+ err_i_int( 6,cur_fnt );
+ return 0;
+}
+
+
+
+static int get_html_ch
+#ifdef ANSI
+#define SEP ,
+( FILE* file
+
+)
+#undef SEP
+#else
+#define SEP ;
+( file ) FILE* file
+
+;
+#undef SEP
+#endif
+{ int ch;
+ if( (ch = (int) getc(file)) == EOF ) {
+ dump_htf( file );
+ err_i_str(20, new_font_name);
+ }
+ return ch;
+}
+
+
+
+static FILE* f_open
+#ifdef ANSI
+#define SEP ,
+(
+ char* name SEP
+ char* flags
+)
+#undef SEP
+#else
+#define SEP ;
+( name, flags )
+ char* name SEP
+ char* flags
+;
+#undef SEP
+#endif
+{ FILE* file;
+ if( (file = fopen(name,flags) ) != NULL ) {
+ (IGNORED) printf("(%s)\n",name);
+ }
+ return file;
+}
+
+
+
+static void dump_htf
+#ifdef ANSI
+#define SEP ,
+( FILE* file
+
+)
+#undef SEP
+#else
+#define SEP ;
+( file ) FILE* file
+
+;
+#undef SEP
+#endif
+{ int i, j, ch, chr;
+ (IGNORED) fseek(file, 0L, 0);
+ i=-1; j=0;
+ while( (ch = getc(file)) != EOF ){
+ if( !j ){ chr = ch; }
+ j += ch==chr;
+ (IGNORED) putc(ch,stderr);
+ if( ch == '\n' ){
+ if( (i>-1 ) && (j<4) && (dump_htf_files<2) ){
+ (IGNORED) printf("missing delimiter \n");
+ }
+ (IGNORED) fprintf(stderr,"%d: ",++i);
+ j=0;
+} } }
+
+
+static void dump_env( MYVOID )
+{
+ int ch;
+ if( !dumped_env ){
+ dumped_env = TRUE;
+ (IGNORED) fseek(dot_file, 0L,
+0
+);
+ (IGNORED) fprintf(stderr,
+ "\n----------------------------------------------------\n");
+ (IGNORED) fprintf(stderr, "environment file\n");
+ (IGNORED) fprintf(stderr,
+ "----------------------------------------------------\n");
+ while( (ch = getc(dot_file)) != EOF ){
+ (IGNORED) putc(ch,stderr);
+ }
+ (IGNORED) fprintf(stderr,
+ "----------------------------------------------------\n");
+} }
+
+
+
+static void htf_to_lg
+#ifdef ANSI
+#define SEP ,
+(
+
+ struct html_font_rec* html_font SEP
+ char* new_font_name SEP
+ int fonts_n SEP
+ FILE* file
+)
+#undef SEP
+#else
+#define SEP ;
+(html_font, new_font_name, fonts_n, file)
+
+ struct html_font_rec* html_font SEP
+ char* new_font_name SEP
+ int fonts_n SEP
+ FILE* file
+;
+#undef SEP
+#endif
+{
+ int ch, i;
+ for( i = 0 ; i<fonts_n; ){
+ if( eq_str(html_font[i].name, new_font_name) ){ break; }
+ i++;
+ }
+ if( i == fonts_n ){
+ BOOL content;
+ int prev_ch;
+ prev_ch = '\n'; content = FALSE;
+ while( (ch = (int) getc(file)) != EOF ) {
+ if( (ch != '\n') || (prev_ch != '\n') ){
+ (void) putc( ch, log_file );
+ prev_ch = ch; content = TRUE;
+ } }
+ if( content && (prev_ch != '\n') ){
+ (void) putc( '\n', log_file );
+ }
+} }
+
+
+
+static INTEGER get_html_file_id
+#ifdef ANSI
+#define SEP ,
+(
+ FILE* file SEP
+ int first SEP int last SEP int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+(file, first, last, n)
+ FILE* file SEP
+ int first SEP int last SEP int n
+
+;
+#undef SEP
+#endif
+{ int ch, i, bound, cnt;
+ INTEGER diff;
+ char* name;
+ name = new_font_name;
+ while( *name == (ch = get_html_ch(file)) ) name++;
+
+if( ( name == new_font_name ) && (n == 19) && (ch=='.') ){
+ return HTF_ALIAS;
+}
+
+
+ if( (*name != '\0') || (ch != ' ') ) warn_i_str(n, name);
+ bound = first; diff = 0;
+ for( cnt = 0; cnt < 2; cnt++ ){
+ while( ch == ' ' ) ch = get_html_ch(file);
+ i = 0;
+ while( (ch >= '0') && (ch <= '9') ){
+ i = i * 10 + ch - '0'; ch = get_html_ch(file); }
+ if( i != bound ){
+
+(IGNORED) fprintf(stderr,warning);
+(IGNORED) fprintf(stderr,warn_err_mssg[22]
+
+, new_font_name, i, bound); show_err_context();
+ diff = diff * 1000 + i - bound; }
+ bound = last; }
+ while( ch != '\n' ) ch = get_html_ch(file);
+ return diff;
+}
+
+
+
+static void notify_class_info
+#ifdef ANSI
+#define SEP ,
+( int gif_flag
+)
+#undef SEP
+#else
+#define SEP ;
+( gif_flag ) int gif_flag
+;
+#undef SEP
+#endif
+{ U_CHAR str[256], *p;
+ str[0] = '\0';
+ p = gif_open[gif_flag];
+ if( p )
+ if( *p ) (IGNORED) strct(str,p);
+ p = gif_alt[gif_flag];
+ if( p )
+ if( *p ) (IGNORED) strct(str,p);
+ p = gif_class[gif_flag];
+ if( p )
+ if( *p ) (IGNORED) strct(str,p);
+ p = gif_size[gif_flag];
+ if( p )
+ if( *p ) (IGNORED) strct(str,p);
+ p = gif_mag[gif_flag];
+ if( p )
+ if( *p ) (IGNORED) strct(str,p);
+ p = gif_ord[gif_flag];
+ if( p )
+ if( *p ) (IGNORED) strct(str,p);
+ p = gif_end[gif_flag];
+ if( p )
+ if( *p ) (IGNORED) strct(str,p);
+ p = str;
+ while( *p ){
+ if( *p == '\n' ) *p = ' ';
+ p++;
+ }
+ (IGNORED) fprintf(log_file, class_fmt,
+ gif_flag,
+ gif_id[gif_flag]? gif_id[gif_flag] : "",
+ str);
+}
+
+
+
+static void script
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR *templt SEP
+ U_CHAR *job SEP
+ int page SEP
+ U_CHAR *font
+
+)
+#undef SEP
+#else
+#define SEP ;
+(templt, job, page, font)
+ U_CHAR *templt SEP
+ U_CHAR *job SEP
+ int page SEP
+ U_CHAR *font
+
+;
+#undef SEP
+#endif
+{ U_CHAR *ch, *p;
+ U_CHAR fmt[256];
+ job[ (int) strlen(job) - 1 ] ='\0';
+ p = ch = templt;
+ while( TRUE ){
+ if( *ch == '%' ){
+
+*ch = '\0'; (IGNORED) fprintf(log_file, "%s", p);
+*(ch++) = '%';
+
+
+
+p=fmt; *(p++) = '%';
+if( *ch == '\0' ){ job[ (int) strlen(job) ] ='.'; return; }
+while( *ch != '%' ){ *(p++) = *(ch ++); }
+*(p+1) = '\0';
+
+
+ switch( *(++ch) ){
+ case '1':{ *p = 's';
+ (IGNORED) fprintf(log_file, fmt, job); break;}
+ case '2':{ *p = 'd';
+ (IGNORED) fprintf(log_file, fmt, page); break;}
+ case '3':{ *p = 's';
+ (IGNORED) fprintf(log_file, fmt, font); break;}
+ case '%':{ *p = 'c';
+ (IGNORED) fprintf(log_file, fmt, '%'); break;}
+ default:{ job[ (int) strlen(job) ] ='.'; return;}
+ }
+ p = ++ch;
+ }else ch++;
+} }
+
+
+
+
+static void dos_gif_file
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR *str SEP
+ int mag SEP
+ int design_ch
+
+)
+#undef SEP
+#else
+#define SEP ;
+(str, mag, design_ch)
+ U_CHAR *str SEP
+ int mag SEP
+ int design_ch
+
+;
+#undef SEP
+#endif
+{ int n, m, i;
+ struct gif_file_rec * p, * q;
+ U_CHAR *ch;
+ m = n = (int) strlen(str);
+ if( n > 4 ){
+
+if( (p = gif_file) != NULL ){
+ while( TRUE ){
+ if( eq_str( str, p->name ) ) break;
+ if( (p = p->next) == gif_file ){ p = NULL; break; }
+} }
+
+
+ if( p == NULL ){
+p = m_alloc(struct gif_file_rec, 1);
+
+for(i=str[n]; n; ){ i+=str[--n]; if( i > (INT_MAX / 8) ) i/=2; }
+if( (n=i % BASE) <10 ) n+= 10 + i%(BASE-20);
+*(ch = p->code)= n; n += i;
+ch[1] = n%BASE; n += i;
+ch[2] = n%BASE; n += i;
+ch[3] = n%BASE;
+
+
+
+if( gif_file ){
+ q = gif_file->next;
+ while( TRUE ){
+ if( (*(q->code) == *ch) && (*(q->code+1) == ch[1]) &&
+ (*(q->code) == ch[2]) && (*(q->code+2) == ch[3]) ){
+ ch[3] ++; ch[2] += ch[3]/ BASE; ch[3] = ch[3] % BASE;
+ ch[1] += ch[2]/ BASE; ch[2] = ch[2] % BASE;
+ ch[1] = ch[1] % BASE;
+ q = gif_file;
+ } else if( q == gif_file ) break;
+ q = q->next;
+} }
+
+
+(IGNORED) printf("\nRenaming `%s____.png' to `%c%c%c%c____.png'\n",
+ str, xeh[(int)(ch[0])], xeh[(int)(ch[1])],
+ xeh[(int)(ch[2])], xeh[(int)(ch[3])]);
+p->name = m_alloc(char,m+1);
+(IGNORED) strcpy( p->name, str );
+if( gif_file ){ p->next = gif_file->next; gif_file->next = p; }
+ else p->next = p;
+
+ }
+ gif_file = p;
+ for( n=0; n<4; n++ ) str[n] = xeh[(int)(*(p->code + n))];
+ }
+ str[n++] = xeh[mag<16? 0: mag / 16];
+ str[n++] = xeh[mag % 16];
+ str[n++] = xeh[design_ch<16? 0: design_ch / 16];
+ str[n++] = xeh[design_ch % 16];
+ str[n] = '\0';
+}
+
+
+
+
+static void put_alt_ch
+#ifdef ANSI
+#define SEP ,
+(
+ int chr SEP
+ BOOL ch_str_flag
+)
+#undef SEP
+#else
+#define SEP ;
+(chr,ch_str_flag)
+ int chr SEP
+ BOOL ch_str_flag
+;
+#undef SEP
+#endif
+{
+ if( !ch_str_flag ) put_char( chr );
+ else if( chr > 0 ){
+ unsigned U_CHAR * p;
+p = font_tbl[cur_fnt].str[chr-1];
+if( gif_ch ) print_f( (char *) p );
+else while( *p ){
+ switch( *p ){
+ case '<': { while( *p && (*p != '>') ) p++; break; }
+ case '>':
+ case '"': { p++; break; }
+ case '\'': { p++; break; }
+ default: { put_char( (int) *p ) ; p++; }
+} }
+
+ }
+}
+
+
+
+static void get_open_accent
+#ifdef ANSI
+#define SEP ,
+(
+ char **all SEP
+ char **first SEP
+ char **second SEP
+ char **third SEP
+ char **fourth SEP
+ char **fifth SEP
+ long int *n
+)
+#undef SEP
+#else
+#define SEP ;
+(all,first,second,third,fourth,fifth,n)
+ char **all SEP
+ char **first SEP
+ char **second SEP
+ char **third SEP
+ char **fourth SEP
+ char **fifth SEP
+ long int *n
+;
+#undef SEP
+#endif
+{ char *p, *q;
+ int i;
+ if( *all ){ free((void *) *all); }
+ *all = p = get_str( (int) *n ); *n=0;
+ i = 2;
+ *first = q = p + 1;
+ while ( TRUE ){
+ if( *q == *p ){
+ *q = '\0';
+ switch( i ){
+ case 2:{ *second = q+1; break; }
+ case 3:{ *third = q+1; break; }
+ case 4:{ *fourth = q+1; break; }
+ case 5:{ *fifth = q+1; break; }
+ }
+ if( i++ == 5 ){ break; }
+ } else if( !*q ){
+ free((void *) *all); *all = (char *) 0; break;
+ }
+ q++;
+} }
+
+
+
+static int scan_class
+#ifdef ANSI
+#define SEP ,
+(
+ int flag
+)
+#undef SEP
+#else
+#define SEP ;
+( flag )
+ int flag
+;
+#undef SEP
+#endif
+{ int math_class;
+ math_class = get_char();
+ if( (math_class >= '0' )
+ && (math_class < '0' +
+79
+
+) ){
+ { math_class -= '0'; }
+ } else {
+ if( flag== 1 ) {
+ switch( math_class ){
+ case '-': { math_class =
+79
+
+;
+ pause_class++; break; }
+ case '+': { math_class =
+79
+
+;
+ pause_class--; break; }
+ default: { math_class = 0; }
+ } } else if( flag== 2 ) {
+ switch( math_class ){
+ case
+')'
+
+: {
+ math_class =
+(
+79
+
+ + 1)
+
+; break; }
+ case
+'('
+
+:
+ { math_class =
+(
+79
+
+ + 2)
+
+; break; }
+ default: { math_class = 0; }
+ }
+ } else { math_class = 0; }
+ }
+ return math_class;
+}
+
+
+
+static INTEGER set_ch_class
+#ifdef ANSI
+#define SEP ,
+( int ch
+)
+#undef SEP
+#else
+#define SEP ;
+(ch) int ch
+;
+#undef SEP
+#endif
+{ int r_ch;
+ r_ch = ch - font_tbl[cur_fnt].char_f;
+ if( math_class ==
+5
+
+ ){
+ store_bit_I( font_tbl[cur_fnt].math_closing, r_ch );
+ *(font_tbl[cur_fnt].math + r_ch) =
+ (char) ((open_del == 256)? ch : open_del);
+ } else {
+ store_bit_Z( font_tbl[cur_fnt].math_closing, r_ch );
+ *(font_tbl[cur_fnt].math + r_ch) = math_class;
+ }
+ open_del = ( math_class ==
+4
+
+ )? ch : 256;
+
+return (INTEGER)(
+
+design_size_to_pt( *(font_tbl[cur_fnt].wtbl
+ + (int) (
+*(font_tbl[cur_fnt].char_wi + (int)
+ ( ch - font_tbl[cur_fnt].char_f)% 256)
+
+) )
+ )
+* (double) font_tbl[cur_fnt].scale
+
+
+ );
+
+
+}
+
+
+
+static int math_class_of
+#ifdef ANSI
+#define SEP ,
+( int ch SEP int cur_fnt
+)
+#undef SEP
+#else
+#define SEP ;
+(ch,cur_fnt) int ch SEP int cur_fnt
+;
+#undef SEP
+#endif
+{ int math_class;
+ math_class = ch - font_tbl[cur_fnt].char_f;
+ return ((get_bit( font_tbl[cur_fnt].math_closing, math_class))?
+
+5
+
+ : *( math_class + font_tbl[cur_fnt].math));
+
+}
+
+
+#if defined(DOS_WIN32) || defined(__MSDOS__)
+
+
+char *get_env_dir
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR *progname
+
+)
+#undef SEP
+#else
+#define SEP ;
+(progname)
+ U_CHAR *progname
+
+;
+#undef SEP
+#endif
+{ int i;
+ U_CHAR *p;
+ if(! progname || ! *progname) return NULL;
+ i = (int) strlen(progname);
+ while( (progname[--i] != dir_path_slash(progname) )
+ && (i > 0) ) ;
+ if(i == 0) return NULL;
+ p = (char *) malloc(i+12);
+ if(p == NULL) return NULL;
+ strncpy(p, progname, i+1);
+ (IGNORED) strcpy(&p[i+1],"tex4ht.env");
+ return p;
+}
+
+
+#endif
+
+
+
+static char* get_script
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR * name SEP
+ U_CHAR * inln SEP
+ int x
+
+)
+#undef SEP
+#else
+#define SEP ;
+(name, inln,x)
+ U_CHAR * name SEP
+ U_CHAR * inln SEP
+ int x
+
+;
+#undef SEP
+#endif
+{
+ if( !name )
+ { U_CHAR str[256], *ch;
+ (IGNORED) fseek(dot_file, 0L,
+0
+);
+ if( search_dot_file( x ) ){
+
+ch = str; str[254] = '\0';
+do{ int int_ch;
+ while((*(ch++) = (char)
+ (int_ch = (int) getc(dot_file))
+ ) != '\n'){
+ if( int_ch == EOF ){ *(ch-1)='\n'; break; }
+ if( str[254] ){ warn_i_int(33, x); break; }
+ }
+}while( (int) getc(dot_file) == x );
+*ch = '\0';
+
+
+ } else {(IGNORED) strcpy(str, inln); }
+ ch = m_alloc(char, (int) strlen(str)+2);
+ (IGNORED) strcpy(ch, str);
+ return ch;
+ }else return name;
+}
+
+
+
+static BOOL search_dot_file
+#ifdef ANSI
+#define SEP ,
+(
+ int ch
+)
+#undef SEP
+#else
+#define SEP ;
+( ch )
+ int ch
+;
+#undef SEP
+#endif
+{ int chr;
+
+ while( TRUE ){
+ chr = getc(dot_file);
+ if( chr == ch ){ return TRUE; }
+ if( chr == '<' ) {
+
+ U_CHAR match[256];
+ int i;
+for( i = 0; (chr != '\n') && (chr != EOF ) ; i++){
+ chr = (int) getc(dot_file);
+ match[i] = (U_CHAR) chr;
+}
+match[i-1] = '\0';
+if( match[0] != '/' ){
+ BOOL env_skip;
+ for( i = 0;
+ (match[i] != '>') && (match[i] != '\n') && (match[i] != EOF );
+ i++){}
+ if( match[i] == '>' ){ match[i] = '\0'; }
+
+if( envChoice == (struct env_c_rec*) 0 ){
+ env_skip = !eq_str(match, "default" );
+} else {
+ struct env_c_rec *p;
+ env_skip = TRUE;
+ for( p=envChoice; p!=(struct env_c_rec*) 0 ; p = p->next ){
+ if( eq_str(match, p->option ) ){ env_skip = FALSE; }
+} }
+
+
+ if( env_skip ){
+
+ U_CHAR cur_block[90];
+ BOOL status;
+(IGNORED) strcpy( cur_block, match);
+status = FALSE;
+while( !status && (chr != EOF) ){
+ chr = 'x';
+ for( i = 0; (chr != '\n') && (chr != EOF ) ; i++){
+ chr = (int) getc(dot_file);
+ match[i] = (U_CHAR) chr;
+ }
+ match[i-1] = '\0';
+ for(i=0; match[i]!='\0'; i++){
+ if( match[i] == '>' ){ break; }
+ }
+ if( (match[0] == '<') && (match[1] == '/')
+ && (match[i] == '>') ){
+ match[i]='\0';
+ status = eq_str(match+2, cur_block);
+ } else { status = FALSE; }
+}
+
+
+} }
+
+
+ continue;
+ }
+ if( chr == '\n' ){ continue; }
+ do
+ if( chr == EOF ) return FALSE;
+ while( (chr = getc(dot_file)) != '\n' );
+} }
+
+
+
+static struct env_var_rec * get_env_var
+#ifdef ANSI
+#define SEP ,
+(
+ char *env_var
+)
+#undef SEP
+#else
+#define SEP ;
+( env_var )
+ char *env_var
+;
+#undef SEP
+#endif
+{ U_CHAR *TEX4HTTFM, *from;
+ struct env_var_rec *tfm_dirs, *p;
+ int env_var_len;
+ tfm_dirs = (struct env_var_rec *) 0;
+ TEX4HTTFM = getenv( env_var );
+ if( TEX4HTTFM ){
+ env_var_len = (int) strlen(TEX4HTTFM);
+ if ( *TEX4HTTFM == *(TEX4HTTFM + env_var_len - 1 ) ){
+ from = TEX4HTTFM + env_var_len - 1;
+ *from = '\0';
+ do{
+ from--;
+ if( *from == *TEX4HTTFM ){ char * base;
+ *from = '\0';
+ base = from + 1;
+
+{ U_CHAR *str;
+ if( *(from+1) == '~' ){
+ if( HOME_DIR ){
+ str = m_alloc(char, strlen(HOME_DIR)+strlen(base));
+ (IGNORED) sprintf(str,"%s%s", HOME_DIR, base+1);
+ if( access(str,F_OK) ) {
+ warn_i_str2(49, env_var, str); base = NULL; }
+ free((void *) str);
+ } else {
+ if( access(base,F_OK) ) {
+ warn_i_str2(49, env_var, base); base = NULL; }
+ }
+ } else {
+ if( access(base,F_OK) ) {
+ warn_i_str2(49, env_var, base); base = NULL; }
+} }
+
+
+ if( base ){
+
+p = m_alloc(struct env_var_rec, 1);
+p->next = tfm_dirs;
+p->base = base;
+tfm_dirs = p;
+
+
+ } }
+ } while (from > TEX4HTTFM );
+ } else { warn_i_str2( 49, env_var, TEX4HTTFM); }
+ }
+ return tfm_dirs;
+}
+
+
+
+static void com_dir
+#ifdef ANSI
+#define SEP ,
+(
+ char* p
+)
+#undef SEP
+#else
+#define SEP ;
+(p)
+ char* p
+;
+#undef SEP
+#endif
+{ int i; U_CHAR str[256];
+ (IGNORED) strcpy( str, p+2 );
+ i = (int) strlen(str) - 1;
+ if( str[i] == '!' ) str[i] = '\0';
+}
+
+
+#ifdef KPATHSEA
+
+static void export_htf
+#ifdef ANSI
+#define SEP ,
+(
+ char** export_str SEP
+ char str[]
+)
+#undef SEP
+#else
+#define SEP ;
+(export_str, str)
+ char** export_str SEP
+ char str[]
+;
+#undef SEP
+#endif
+{ int i;
+ char* p;
+ BOOL found;
+ i = (int) strlen(str) - 1;
+ while( (i>=0) && (str[i] == '\n') ){ str[i--] = '\0'; }
+ while( (i>=0) && (str[i] == ' ') ) { str[i--] = '\0'; }
+ if( (i>=0) && (str[i] == '!') ){ str[i--] = '\0'; }
+ if( (i>=0) && ((str[i] == '/') || (str[i] == '\\')) ){
+ str[i--] = '\0'; }
+ i -= 8; found = FALSE;
+ while( --i>=0 ){
+ if( ((str[i] == '/') || (str[i] == '\\')) && (str[i+1]== 'h')
+ && (str[i+2]=='t') && (str[i+3]=='-')
+ && (str[i+4]=='f') && (str[i+5]=='o')
+ && (str[i+6]=='n') && (str[i+7]=='t')
+ && (str[i+8]=='s')
+ && ((str[i+9] == '/') || (str[i+9] == '\\'))
+ ){
+ p = str + i + 10; i=0;
+ while( *p ){ str[i++] = *(p++); }
+ str[i] = '\0';
+ found = TRUE; break;
+ } }
+ if( found ){
+ *export_str = (char *) r_alloc((void *) *export_str,
+ (int) strlen(*export_str) + (int) strlen(str) + 2 );
+ if( (int) strlen(*export_str) > 0 ){
+ (IGNORED) strcat(*export_str,",");
+ }
+ (IGNORED) strcat(*export_str,str);
+ }
+}
+#endif
+
+
+
+static FILE* search_in_dot_file
+#ifdef ANSI
+#define SEP ,
+(
+ int typ SEP
+ U_CHAR *name SEP
+ U_CHAR *flags SEP
+ struct env_var_rec *env_dirs
+
+)
+#undef SEP
+#else
+#define SEP ;
+( typ, name, flags, env_dirs)
+ int typ SEP
+ U_CHAR *name SEP
+ U_CHAR *flags SEP
+ struct env_var_rec *env_dirs
+
+;
+#undef SEP
+#endif
+{ U_CHAR *ch, dir[256];
+ FILE* file;
+#ifndef KPATHSEA
+ if( cache_files != (FILE *) 0 ){
+
+ U_CHAR cache_dir[256], dot_dir[256], *p, *q;
+ BOOL flag;
+ int n, ch;
+(IGNORED) fseek(cache_files, 0L,
+0
+);
+ch = (int) getc(cache_files);
+while ( ch != EOF ){
+ if ( ch == ' ' ) {
+q = cache_dir;
+do
+ *(q++) = ch = (int) getc(cache_files);
+while( (ch !='\n') && (ch != EOF) );
+*(q-1 - (*(q-2) ==
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+ '\\'
+#else
+ '/'
+#endif
+
+)
+#ifdef DOS_WIN32
+ - (*(q-2) == '/')
+#endif
+ ) = '\0';
+
+ }
+ else {
+p = name; flag = FALSE;
+while( *(p++) == ch ){
+ ch = (int) getc(cache_files);
+}
+if( (*(p-1) == '\0') && ((ch == '\n') || (ch == EOF)) ){ flag = TRUE; }
+else{
+ while( (ch != '\n') && (ch != EOF) ) { ch = (int) getc(cache_files); }
+}
+
+
+ if( flag ){
+
+flag = FALSE;
+(IGNORED) fseek(dot_file, 0L,
+0
+);
+while( search_dot_file( typ ) && !flag ){ U_CHAR *q, save_ch;
+ int n, m;
+ q = dot_dir;
+ do
+ *(q++) = ch = (int) getc(dot_file);
+ while( (ch !='\n') && (ch != EOF) );
+ flag = *(q - 2) = '!';
+ q -= (flag? 2 : 1);
+ *(q - (*(q-1) ==
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+ '\\'
+#else
+ '/'
+#endif
+
+)
+#ifdef DOS_WIN32
+ - (*(q-1) == '/')
+#endif
+ ) = '\0';
+ if( (n = strlen(dot_dir)) > (m = strlen(cache_dir)) ){ flag = FALSE; }
+ else {
+ save_ch = *(cache_dir + n);
+ *(cache_dir + n) = '\0';
+ flag = eq_str(dot_dir,cache_dir) && ( flag || (m == n) );
+ *(cache_dir + n) = save_ch;
+ }
+}
+
+
+ if( flag ){
+n = (int) strlen(cache_dir);
+cache_dir[n] = dir_path_slash(cache_dir);
+cache_dir[n+1] = '\0';
+(IGNORED) strcat(cache_dir,name);
+
+ }
+ } }
+ if ( ch != EOF ){ ch = (int) getc(cache_files); }
+}
+
+
+ }
+#endif
+ (IGNORED) fseek(dot_file, 0L,
+0
+);
+ while( search_dot_file( typ ) ){
+ ch = dir;
+ while((*(ch++) = (int) getc(dot_file)) > ' ');
+ while(*(ch-1) != '\n'){
+ *(ch-1) = (int) getc(dot_file);
+ }
+ *(ch-1) = '\0';
+ file = search_file_base(name, dir, flags, env_dirs);
+ if( file != NULL ){
+#ifndef KPATHSEA
+ tex4ht_fls = TRUE;
+#endif
+ return file;
+ } }
+ return NULL;
+}
+
+
+
+static FILE* search_file_base
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR *name SEP
+ U_CHAR *dir SEP
+ U_CHAR *flags SEP
+ struct env_var_rec *env_dirs
+
+)
+#undef SEP
+#else
+#define SEP ;
+( name, dir, flags, env_dirs)
+ U_CHAR *name SEP
+ U_CHAR *dir SEP
+ U_CHAR *flags SEP
+ struct env_var_rec *env_dirs
+
+;
+#undef SEP
+#endif
+{ U_CHAR *p;
+ FILE* file;
+ if( *dir == '~' ){
+ while( TRUE ){
+ p = abs_addr(dir, env_dirs? env_dirs->base : NULL);
+ file = search_file(name, p, flags);
+ free((void *) p);
+ if( file || !env_dirs ){ return file; }
+ env_dirs = env_dirs->next;
+ }
+ } else {
+ file = search_file(name, dir, flags);
+ }
+ return file;
+}
+
+
+
+static char * abs_addr
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR *dir SEP
+ U_CHAR *base
+
+)
+#undef SEP
+#else
+#define SEP ;
+( dir, base)
+ U_CHAR *dir SEP
+ U_CHAR *base
+
+;
+#undef SEP
+#endif
+{ U_CHAR *p;
+ p = m_alloc(char, (int) strlen( dir ) +
+ (base? (int) strlen( base ):0) +
+ (int) strlen( HOME_DIR ) + 1 );
+ *p = '\0';
+ if( (*(dir+1) == '~') && base ){
+ if( *base == '~' ){
+ (IGNORED) strct(p, HOME_DIR);
+ (IGNORED) strct(p, base+1);
+ } else {
+ (IGNORED) strct(p, base);
+ }
+ (IGNORED) strct(p, dir+2);
+ } else {
+ (IGNORED) strct(p, HOME_DIR);
+ (IGNORED) strct(p, dir+1);
+ }
+ return p;
+}
+
+
+
+static FILE* search_file
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR *name SEP
+ U_CHAR *dir SEP
+ U_CHAR *flags
+
+)
+#undef SEP
+#else
+#define SEP ;
+( name, dir, flags )
+ U_CHAR *name SEP
+ U_CHAR *dir SEP
+ U_CHAR *flags
+
+;
+#undef SEP
+#endif
+{ FILE* file;
+ U_CHAR str[256];
+ int i;
+ BOOL subs;
+
+if( (file = f_open(name, flags)) != NULL ){
+ return file; }
+
+
+ (IGNORED) strcpy(str, dir);
+ i = (int) strlen(str) - 1;
+ subs = str[i] == '!';
+ if( subs ) str[i] = '\0'; else i++;
+
+(IGNORED) strct(str,
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+ (( dir[i-1] == '/') || ( dir[i-1] == '\\'))
+ ? ""
+ : (is_forward_slash(dir)? "/" : "\\" )
+#else
+ (dir[i-1] == '/')? "" : "/"
+#endif
+ );
+
+
+
+
+(IGNORED) strct(str,name);
+if( (file = f_open(str, flags)) != NULL ){
+ str[i] = '\0'; add_to_cache(str,name,i);
+ return file; }
+
+
+ str[i] = '\0';
+ return subs? search_file_ext( name, str, flags):
+ FALSE;
+}
+
+
+
+static void add_to_cache
+#ifdef ANSI
+#define SEP ,
+(
+ char* dir SEP char* name SEP int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+(dir,name,n)
+ char* dir SEP char* name SEP int n
+
+;
+#undef SEP
+#endif
+{
+ struct cache_font_rec *cur_cache_font;
+
+
+{ int found;
+ found = FALSE;
+ for( cur_cache_font = cache_font;
+ cur_cache_font;
+ cur_cache_font = cur_cache_font->next )
+ { found = found || eq_str(cur_cache_font->dir, dir ) ;
+ if( found ) break; }
+ if( !found ){
+ cur_cache_font = m_alloc(struct cache_font_rec, 1);
+
+cur_cache_font->cache_file = (struct cache_file_rec *) 0;
+
+
+ cur_cache_font->dir = m_alloc(char, n+1);
+ (IGNORED) strcpy(cur_cache_font->dir, dir);
+ if( !cache_font ){
+ cur_cache_font->next = cache_font;
+ cache_font = cur_cache_font;
+ } else if ( gt_str(cache_font->dir, dir) ) {
+ cur_cache_font->next = cache_font;
+ cache_font = cur_cache_font;
+ } else {
+ struct cache_font_rec * after_cache_font;
+ after_cache_font = cache_font;
+ while( after_cache_font->next ){
+ if ( gt_str(after_cache_font->next->dir, dir) ) { break; }
+ after_cache_font = after_cache_font->next;
+ }
+ cur_cache_font->next = after_cache_font->next;
+ after_cache_font->next = cur_cache_font;
+} } }
+
+
+
+{
+ struct cache_file_rec *file_rec, *prev_file_rec;
+ prev_file_rec = (struct cache_file_rec *) 0;
+ file_rec = cur_cache_font->cache_file;
+ while( file_rec ) {
+ if( !gt_str(name,file_rec->file) ) break;
+ prev_file_rec = file_rec;
+ file_rec = file_rec->next;
+ }
+ {
+ struct cache_file_rec * file_entry;
+ BOOL flag;
+ flag = TRUE;
+ if( file_rec ) {
+ if( eq_str(name,file_rec->file) ){ flag = FALSE; }
+ }
+ if( flag ) {
+
+file_entry = m_alloc(struct cache_file_rec, 1);
+file_entry->file = m_alloc(char, strlen(name)+1);
+(IGNORED) strcpy(file_entry->file,name);
+if( ! cur_cache_font->cache_file ){
+ cur_cache_font->cache_file = file_entry;
+ file_entry->next = (struct cache_file_rec *) 0;
+} else if( !prev_file_rec ){
+ file_entry->next = cur_cache_font->cache_file;
+ cur_cache_font->cache_file = file_entry;
+} else {
+ file_entry->next = prev_file_rec->next;
+ prev_file_rec->next = file_entry;
+}
+
+
+ }
+ }
+}
+
+
+}
+
+
+
+static FILE* search_file_ext
+#ifdef ANSI
+#define SEP ,
+(
+ U_CHAR *name SEP
+ U_CHAR *dir SEP
+ U_CHAR *flags
+
+)
+#undef SEP
+#else
+#define SEP ;
+( name, dir, flags )
+ U_CHAR *name SEP
+ U_CHAR *dir SEP
+ U_CHAR *flags
+
+;
+#undef SEP
+#endif
+{ U_CHAR str[256];
+ FILE* file;
+ int n;
+ n = (int) strlen(dir);
+ (IGNORED) sprintf(str,
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+ (( dir[n-1] == '/') || ( dir[n-1] == '\\'))
+ ? "%s%s"
+ : (is_forward_slash(dir)? "%s/%s" : "%s\\%s" )
+#else
+ (dir[n-1] == '/')? "%s%s" : "%s/%s"
+#endif
+ , dir, name);
+ if( (file = f_open(str,flags)) != NULL ){
+ add_to_cache(dir,name,n);
+ return file;
+ }
+ if( (str[n] ==
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+ '\\'
+#else
+ '/'
+#endif
+
+)
+#ifdef DOS_WIN32
+ || (str[n] == '/' )
+#endif
+ ) n++;
+ str[n-1] = '\0';
+#ifndef NOSUBDIR
+#ifdef WIN32
+
+{
+ WIN32_FIND_DATA find_file_data;
+ HANDLE hnd;
+ int proceed;
+ (IGNORED) strcpy(dirname, str);
+ strct(dirname, (is_forward_slash(dirname)? "/" : "\\") );
+ strct(dirname, "*.*");
+ hnd = FindFirstFile(dirname, &find_file_data);
+ if (hnd != INVALID_HANDLE_VALUE) {
+
+proceed = 1;
+while (proceed) {
+ if( !eq_str(find_file_data.cFileName, ".") &&
+ !eq_str(find_file_data.cFileName, "..") )
+ {
+ (IGNORED) strcpy( str+n, find_file_data.cFileName );
+ str[n-1] = dir_path_slash(str);
+ if (find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ if( (file = search_file_ext(name, str, flags)) != NULL ){
+ FindClose(hnd);
+ return file; }
+ }
+ }
+ proceed = FindNextFile(hnd, &find_file_data);
+}
+FindClose(hnd);
+
+
+ }
+}
+
+
+#else
+
+{ DIR *dp;
+
+
+#ifdef STRUCT_DIRECT
+ struct direct
+#else
+ struct dirent
+#endif
+
+ *dirp;
+ struct STSTAT buf;
+ if( (dp = opendir( str )) != NULL ){
+ while( (dirp = readdir(dp)) != NULL ){
+ if( !eq_str(dirp->d_name, ".") &&
+ !eq_str(dirp->d_name, "..") )
+ {
+(IGNORED) strcpy( str+n, dirp->d_name );
+str[n-1] = dir_path_slash(str);
+if( LSTAT(str, &buf) >= 0 )
+ if( S_ISDIR( buf.st_mode ) )
+ if( (file = search_file_ext(name, str, flags)) != NULL ){
+ (void) closedir(dp);
+ return file; }
+
+
+ } }
+ (void) closedir(dp);
+} }
+
+
+#endif
+#endif
+ return NULL;
+}
+
+
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+
+static BOOL is_forward_slash
+#ifdef ANSI
+#define SEP ,
+(
+ char* str
+)
+#undef SEP
+#else
+#define SEP ;
+(str)
+ char* str
+;
+#undef SEP
+#endif
+{
+ while( *str ){ if( *(str++) == '/' ) { return TRUE; } }
+ return FALSE;
+}
+#endif
+
+
+
+static FILE* f_open_pathed_filename
+#ifdef ANSI
+#define SEP ,
+(
+ char* name SEP
+ char* flags
+)
+#undef SEP
+#else
+#define SEP ;
+( name, flags )
+ char* name SEP
+ char* flags
+;
+#undef SEP
+#endif
+{ FILE* file;
+ U_CHAR *str;
+ file = NULL;
+ if( *name == '~' ){
+ if( HOME_DIR ){
+ str = m_alloc(char, strlen(HOME_DIR)+strlen(name));
+ (IGNORED) sprintf(str,"%s%s", HOME_DIR, name+1);
+ file = f_open(str,flags);
+ free((void *) str);
+ }
+ } else { file = f_open( name, flags ); }
+ return file;
+}
+
+
+
+static INTEGER put_4ht_ch
+#ifdef ANSI
+#define SEP ,
+( int ch SEP FILE* htFile
+)
+#undef SEP
+#else
+#define SEP ;
+(ch,htFile) int ch SEP FILE* htFile
+;
+#undef SEP
+#endif
+{
+ int c;
+ c = ch;
+ if( ch=='&' ){
+ if( !uni_code_p ){
+
+flush_uni();
+
+
+ }
+ if( put_4ht_off ){
+ c = putc( ch, htFile );
+ } else {
+ uni_code[0] = '&';
+ uni_code_p = 1;
+ put_4ht_file = htFile;
+ }
+ } else
+ if( uni_code_p ){
+ if( ch == ';' ){
+if( uni_code[1] != '#' ){
+
+flush_uni();
+
+
+ (IGNORED) putc( ch, htFile );
+}
+else{
+ int i, base, value, digit;
+ if( (uni_code[2] == 'x') || (uni_code[2] == 'X') ){
+ base =16; i=3;
+ } else { base=10; i=2; }
+ value = 0;
+ for( ; i<uni_code_p; i++ ){
+ digit = uni_code[i];
+ if( (digit>='0') && (digit<='9') ){ digit -= '0'; }
+ else if( (digit>='A') && (digit<='F') ){ digit -= BASE_A; }
+ else if( (digit>='a') && (digit<='f') ){ digit -= BASE_a; }
+ else { value = -1; break; }
+ if( digit >= base ){ value=-1; break; }
+ value = value*base + digit;
+ }
+ if( value<0 ){
+flush_uni();
+
+
+ (IGNORED) putc( ch, htFile );
+ } else {
+
+ int bottom, mid, top;
+ BOOL found=FALSE;
+bottom = 0; top = charset_n;
+while( !found ){
+ mid = (bottom + top) / 2;
+ if( value == charset[mid].ch ){
+
+{ U_CHAR *p;
+ p = charset[mid].str;
+ while( *p != '\0' ){
+ if( *p=='\\' ){
+ p++;
+ if( *p=='\\' ){
+ (IGNORED) putc( '\\', htFile );
+ } else {
+ int i;
+ i = *p - '0';
+ while( *(++p) != '\\' ){ i = 10*i + *p - '0'; }
+ (IGNORED) putc( i, htFile );
+ } }
+ else {
+ (IGNORED) putc( *p, htFile );
+ if ( (*p=='&') && u10 ){
+if ( *(p+1) == '#' ){
+ p++;
+ (IGNORED) putc( '#', htFile );
+ if ( (*(p+1) == 'x') || (*(p+1) == 'X') ){
+ int value, digit;
+ U_CHAR *q;
+ q = p+2;
+ value = 0;
+ digit = *(q++);
+ while( digit!=0 ){
+ if( (digit>='0') && (digit<='9') ){
+ value = value*16 + digit - '0';
+ }
+ else if( (digit>='A') && (digit<='F') ){
+ value = value*16 + digit - 'A'+10;
+ }
+ else if( (digit>='a') && (digit<='f') ){
+ value = value*16 + digit - 'a'+10; }
+ else {
+ if( digit == ';' ){
+
+ char uni_10[MAX_UNI_CODE];
+ int n;
+n = 0;
+while( value>0 ){
+ uni_10[ n++ ] = value % 10 + '0';
+ value /= 10;
+}
+while( n>0 ){
+ (IGNORED) putc( uni_10[--n], htFile );
+}
+
+
+ p=q-2;
+ }
+ break;
+ }
+ digit = *(q++);
+ }
+} }
+
+ }
+ }
+ p++;
+} }
+
+
+ found = TRUE;
+ } else if( value < charset[mid].ch ){
+ if( bottom == top ){ break; }
+ top = mid;
+ }
+ else {
+ if ( bottom < mid ){ bottom = mid; }
+ else if ( bottom<top ){ bottom++; }
+ else{ break; }
+ }
+}
+if( ! found ){
+ if( u10 || utf8 ){
+ short n;
+ long dec;
+ int ch;
+ char uni_10[MAX_UNI_CODE];
+if( (uni_code[2] == 'x') || (uni_code[2] == 'X') ) {
+ dec = 0;
+ for( n=3; n<uni_code_p; n++ ){
+ ch = uni_code[n];
+ dec = 16*dec +
+ ((ch > '9')?
+ ( 10 + ((ch > 'Z')? (ch-'a') : (ch-'A')) )
+ : (ch-'0'));
+ }
+ if( u10 ){
+ if( dec == 0 ){
+ uni_code_p = 3; uni_code[2] = '0';
+ } else {
+ n = 0;
+ while( dec > 0 ){ uni_10[ n++ ] = dec % 10 + '0'; dec /= 10; }
+ uni_code_p = 2;
+ while( n>0 ){ uni_code[ uni_code_p++ ] = uni_10[ --n ]; }
+ }
+
+ }
+ else {
+
+if( dec < 0x80 ){
+ uni_code_p = 1; uni_code[0] = dec;
+}
+else if( dec < 0x800 ){
+ uni_code_p = 2;
+ uni_code[0] = (dec >> 6) | 0xC0;
+ uni_code[1] = (dec & 0x3F) | 0x80;
+}
+else if( dec < 0x10000 ){
+ uni_code_p = 3;
+ uni_code[0] = (dec >> 12) | 0xE0;
+ uni_code[1] = ((dec >> 6) & 0x3F) | 0x80;
+ uni_code[2] = (dec & 0x3F) | 0x80;
+}
+else if( dec < 0x200000 ){
+ uni_code_p = 4;
+ uni_code[0] = (dec >> 18) | 0xF0;
+ uni_code[1] = ((dec >> 12) & 0x3F) | 0x80;
+ uni_code[2] = ((dec >> 6) & 0x3F) | 0x80;
+ uni_code[3] = (dec & 0x3F) | 0x80;
+}
+else if( dec < 0x4000000 ){
+ uni_code_p = 5;
+ uni_code[0] = (dec >> 24) | 0xF8;
+ uni_code[1] = ((dec >> 18) & 0x3F) | 0x80;
+ uni_code[2] = ((dec >> 12) & 0x3F) | 0x80;
+ uni_code[3] = ((dec >> 6) & 0x3F) | 0x80;
+ uni_code[4] = (dec & 0x3F) | 0x80;
+}
+else if( dec <= 0x7FFFFFFF ){
+ uni_code_p = 6;
+ uni_code[0] = (dec >> 30) | 0xFC;
+ uni_code[1] = ((dec >> 24) & 0x3F) | 0x80;
+ uni_code[2] = ((dec >> 18) & 0x3F) | 0x80;
+ uni_code[3] = ((dec >> 12) & 0x3F) | 0x80;
+ uni_code[4] = ((dec >> 6) & 0x3F) | 0x80;
+ uni_code[5] = (dec & 0x3F) | 0x80;
+}
+
+
+else {
+ n = 0;
+ while( dec > 0 ){ uni_10[ n++ ] = dec % 10 + '0'; dec /= 10; }
+ uni_code_p = 2;
+ while( n>0 ){ uni_code[ uni_code_p++ ] = uni_10[ --n ]; }
+}
+
+ }
+}
+
+ }
+
+flush_uni();
+
+
+ if( !utf8 ){ (IGNORED) putc( ch, htFile ); }
+}
+
+
+} }
+
+ uni_code_p = 0; }
+ else if ( ((uni_code_p+1) == MAX_UNI_CODE)
+ ||
+ ( ((ch<'0') || (ch>'9'))
+ && ((ch<'a') || (ch>'f'))
+ && ((ch<'A') || (ch>'F'))
+ && (ch!='#')
+ && (ch!='x')
+ && (ch!='X')
+ )
+ )
+ {
+flush_uni();
+
+
+ c = putc( ch, htFile );
+ } else { uni_code[ uni_code_p++ ] = ch; }
+ } else { c = putc( ch, htFile ); }
+ return c;
+}
+
+
+static void flush_uni( MYVOID )
+{
+ int i;
+ for( i=0; i<uni_code_p; i++ ){
+ (IGNORED) putc( uni_code[i], put_4ht_file );
+ }
+ uni_code_p = 0;
+ put_4ht_file = (FILE *) 0;
+}
+
+
+
+static INTEGER insert_ch
+#ifdef ANSI
+#define SEP ,
+( int ch
+)
+#undef SEP
+#else
+#define SEP ;
+(ch) int ch
+;
+#undef SEP
+#endif
+{
+ if( !ignore_chs ){
+ BOOL flag;
+
+flag = FALSE;
+if(
+next_str
+
+ ) {
+ if( eq_str(next_str, "") ) {
+ flag = TRUE;
+ free((void *) next_str);
+ next_str = (char *) 0;
+} }
+
+
+ if( !flag ){
+ try_new_line();
+
+
+if( x_val > needs_end_accent ){
+
+if( needs_end_accent && t_accent_template ){
+
+if( span_on && in_span_ch ){
+ if( *end_span[0] ){
+ in_span_ch = FALSE;
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, end_span[0]);
+} }
+
+
+ (IGNORED) fprintf(cur_o_file, t_accent_fifth);
+ needs_end_accent = FALSE;
+needs_accented_sym--;
+
+
+}
+
+
+}
+
+
+
+if( span_on && (default_font != font_tbl[cur_fnt].num) ){
+ if( !ch_map_flag && start_span ){
+ if( span_name_on ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ if( span_open[0] ) if( *span_open[0] )
+ (IGNORED) fprintf(cur_o_file, span_open[0]);
+ if( span_name[0] ) if( *span_name[0] )
+ (IGNORED) fprintf(cur_o_file,
+ span_name[0], font_tbl[cur_fnt].family_name);
+ if( span_size[0] ) if( *span_size[0] )
+ (IGNORED) fprintf(cur_o_file,
+ span_size[0], font_tbl[cur_fnt].font_size);
+ if( span_mag[0] )
+ if( *span_mag[0] && (font_tbl[cur_fnt].mag != 100))
+ (IGNORED) fprintf(cur_o_file,
+ span_mag[0], font_tbl[cur_fnt].mag);
+ if( span_ch[0] ) if( *span_ch[0] )
+ (IGNORED) fprintf(cur_o_file, span_ch[0]);
+ }
+ start_span = FALSE;
+ }
+}
+
+
+if( trace_dvi_C ){
+ if( !ch_map_flag ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ if( *trace_dvi_del_C != '\0' ){
+ (IGNORED) fprintf(cur_o_file,
+ block_start? "%s%s %d B" : "%s%s %d",
+ trace_dvi_del_C, font_tbl[cur_fnt].name, ch);
+ }
+ (IGNORED) fprintf(cur_o_file,"%s", end_trace_dvi_del_C);
+ }
+ block_start = FALSE;
+}
+
+
+
+if( show_class && !pause_class && !ignore_subclass_del){
+ if( !stack[stack_n].no_left_del && stack[stack_n+1].active_class_del ){
+
+(IGNORED) print_f( (stack[stack_n+1].temp_class_del)?
+ stack[stack_n+1].temp_class_open
+ : stack[stack_n+1].class_open);
+
+
+ if( !stack[stack_n+1].ignore_subclass_del ){
+
+math_class = math_class_of( ch, cur_fnt );
+(IGNORED) print_f( open_class[math_class]);
+
+
+ }
+ } else {
+
+math_class = math_class_of( ch, cur_fnt );
+(IGNORED) print_f( open_class[math_class]);
+
+
+} }
+
+
+if( pos_dvi ){ long int d;
+ if( *pos_text ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, pos_text,
+ pos_x_A * (x_val - base_pos_x) + pos_x_B,
+ pos_y_C * (y_val - base_pos_y) + pos_y_D);
+ }
+ if( x_val < min_pos_x ) min_pos_x = x_val;
+ if( (d = x_val +
+(int)(
+design_size_to_pt( *(font_tbl[cur_fnt].wtbl
+ + (int) (
+*(font_tbl[cur_fnt].char_wi + (int)
+ ( ch - font_tbl[cur_fnt].char_f)% 256)
+
+) )
+ )
+* (double) font_tbl[cur_fnt].scale
+
+)
+
+) > max_pos_x ) max_pos_x = d;
+ if( (d = y_val -
+(int)(
+design_size_to_pt( *(font_tbl[cur_fnt].htbl
+ + (int) (
+( *(font_tbl[cur_fnt].char_hidp + (int)
+ ( ch - font_tbl[cur_fnt].char_f)% 256)
+ >> 4
+) & 0x0F
+
+)) )
+ * (double) font_tbl[cur_fnt].scale
+
+)
+
+) < min_pos_y ) min_pos_y = d;
+ if( (d = y_val +
+(int)(
+design_size_to_pt( *(font_tbl[cur_fnt].dtbl
+ + (int) (
+( *(font_tbl[cur_fnt].char_hidp + (int)
+ ( ch - font_tbl[cur_fnt].char_f)% 256)
+) & 0x0F
+
+)) )
+* (double) font_tbl[cur_fnt].scale
+
+)
+
+) > max_pos_y ) max_pos_y = d;
+}
+
+
+
+if( a_accent_template && needs_accented_sym ){
+ (IGNORED) fprintf(cur_o_file, "%s%s%s%d%s%d%s",
+ a_accent_first, font_tbl[cur_fnt].family_name,
+ a_accent_second, ch, a_accent_third,
+ font_tbl[cur_fnt].accented[ch]?
+ font_tbl[cur_fnt].accented_array[font_tbl[cur_fnt].accented[ch]-1]
+ : 0,
+ a_accent_fourth);
+}
+
+
+if(
+next_char
+
+ != -1 ) {
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) put_4ht_ch(
+next_char
+
+, cur_o_file );
+
+next_char
+
+ = -1;
+} else if(
+next_str
+
+ ) {
+
+if( keepChar ){
+ keepChar=FALSE;
+ {
+ int gif_flag, chr, r_ch;
+ BOOL ch_str_flag;
+r_ch = ch - font_tbl[cur_fnt].char_f;
+gif_flag = font_tbl[cur_fnt].gif1[r_ch];
+ch_str_flag = get_bit( font_tbl[cur_fnt].ch_str, r_ch);
+chr = ((r_ch == 255) && font_tbl[cur_fnt].ch255 )? 256 :
+ *(font_tbl[cur_fnt].ch + r_ch);
+if( (gif_flag % 2) || ch_str_flag ){ design_ch = ch;
+ {
+ U_CHAR str[256], *p;
+ BOOL sv;
+ int mag;
+sv = special_on; special_on = TRUE;
+if( gif_ch && (gif_flag % 2) ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ if( !gif_open[gif_flag] ){
+
+(IGNORED) sprintf(str,
+ "configuration for htf class %d (char %d of %s.htf)",
+ gif_flag, ch,font_tbl[cur_fnt].name
+ );
+warn_i_str(50,str);
+
+
+gif_open[gif_flag] = m_alloc(char,
+
+29
+
+);
+(IGNORED) strcpy(gif_open[gif_flag],
+
+"<img src=\"+\" alt=\"+++++\" />+"
+
+);
+gif_alt[gif_flag] = gif_open[gif_flag]+11;
+ *(gif_alt[gif_flag] - 1) = '\0';
+gif_class[gif_flag] = gif_open[gif_flag]+19;
+ *(gif_class[gif_flag] - 1) = '\0';
+gif_size[gif_flag] = gif_open[gif_flag]+20;
+ *(gif_size[gif_flag] - 1) = '\0';
+gif_mag[gif_flag] = gif_open[gif_flag]+21;
+ *(gif_mag[gif_flag] - 1) = '\0';
+gif_ord[gif_flag] = gif_open[gif_flag]+22;
+ *(gif_ord[gif_flag] - 1) = '\0';
+gif_end[gif_flag] = gif_open[gif_flag]+23;
+ *(gif_end[gif_flag] - 1) = '\0';
+gif_id[gif_flag] = gif_open[gif_flag]+28;
+ *(gif_id[gif_flag] - 1) = '\0';
+
+
+ } else if( !get_bit( class_on, gif_flag ) ) {
+ notify_class_info(gif_flag);
+ store_bit_I( class_on, gif_flag );
+ }
+
+p= gif_open[gif_flag];
+if( p )
+if( *p ){
+ print_f(p); (IGNORED) strcpy(str, font_tbl[cur_fnt].name);
+ mag = (int) ((double) font_tbl[cur_fnt].scale /
+ font_tbl[cur_fnt].design_sz * 10 );
+
+if( !dos_file_names ){
+ print_f(font_tbl[cur_fnt].name);
+ if( mag == 10 ) (IGNORED) sprintf(str, GIF_I, design_ch, gif);
+ else (IGNORED) sprintf(str, GIF_II, mag, design_ch, gif);
+}
+
+
+
+if( dos_file_names ){
+ dos_gif_file(str, mag, design_ch);
+ print_f(str);
+ (IGNORED) sprintf(str, GIF_VII, gif);
+}
+
+
+
+ print_f(str);
+ add_bit( font_tbl[cur_fnt].gif_on, r_ch, 1 );
+}
+
+
+
+p = gif_alt[gif_flag];
+if( p )
+ if( *p ){
+ print_f(p); put_alt_ch(chr,ch_str_flag);
+}
+
+
+
+p = gif_class[gif_flag];
+if( p )
+ if( *p ){
+ (IGNORED) fprintf(cur_o_file, p,
+ font_tbl[cur_fnt].family_name); }
+
+
+
+p = gif_size[gif_flag];
+if( p )
+ if( *p ){
+ (IGNORED) fprintf(cur_o_file, p,
+ font_tbl[cur_fnt].font_size); }
+
+
+
+p = gif_mag[gif_flag];
+if( p )
+ if( *p && (font_tbl[cur_fnt].mag != 100) ){
+ (IGNORED) fprintf(cur_o_file, p, font_tbl[cur_fnt].mag);
+}
+
+
+
+p = gif_ord[gif_flag];
+if( p )
+ if( *p ){
+ (IGNORED) fprintf(cur_o_file, p, ch);
+}
+
+
+
+p = gif_end[gif_flag];
+if( p )
+ if( *p ){ print_f( p ); }
+
+
+} else {
+if( !gif_flag || (gif_flag % 2) || ch_map_flag ) {
+ put_alt_ch(chr,ch_str_flag); }
+else{
+
+if( gif_flag && !get_bit( class_on, gif_flag ) ) {
+ notify_class_info(gif_flag);
+ store_bit_I( class_on, gif_flag );
+}
+
+
+if( span_on ){
+
+if( span_open[gif_flag] )
+ if( *span_open[gif_flag] ){
+ print_f( span_open[gif_flag] );
+}
+
+
+
+if( span_name[gif_flag] )
+ if( *span_name[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_name[gif_flag],
+ font_tbl[cur_fnt].family_name);
+}
+
+
+
+if( span_size[gif_flag] )
+ if( *span_size[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_size[gif_flag],
+ font_tbl[cur_fnt].font_size);
+}
+
+
+
+if( span_mag[gif_flag] )
+ if( *span_mag[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_mag[gif_flag],
+ font_tbl[cur_fnt].mag);
+}
+
+
+
+if( span_ord[gif_flag] )
+ if( *span_ord[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_ord[gif_flag], chr);
+}
+
+
+
+if( span_ch[gif_flag] )
+ if( *span_ch[gif_flag] ){
+ print_f( span_ch[gif_flag] );
+}
+
+
+}
+put_alt_ch(chr,ch_str_flag);
+if( span_on ){
+
+if( end_span[gif_flag] )
+ if( *end_span[gif_flag] ){
+ print_f( end_span[gif_flag] );
+}
+
+
+}
+
+ }
+
+ }
+special_on = sv;
+
+ } design_ch = 0; }
+else {
+if( !gif_flag || (gif_flag % 2) || ch_map_flag ) { put_char(chr);
+} else{
+
+if( no_root_file ){ open_o_file(); }
+
+
+
+if( gif_flag && !get_bit( class_on, gif_flag ) ) {
+ notify_class_info(gif_flag);
+ store_bit_I( class_on, gif_flag );
+}
+
+
+if( span_on ){
+
+if( span_open[gif_flag] )
+ if( *span_open[gif_flag] ){
+ print_f( span_open[gif_flag] );
+}
+
+
+
+if( span_name[gif_flag] )
+ if( *span_name[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_name[gif_flag],
+ font_tbl[cur_fnt].family_name);
+}
+
+
+
+if( span_size[gif_flag] )
+ if( *span_size[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_size[gif_flag],
+ font_tbl[cur_fnt].font_size);
+}
+
+
+
+if( span_mag[gif_flag] )
+ if( *span_mag[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_mag[gif_flag],
+ font_tbl[cur_fnt].mag);
+}
+
+
+
+if( span_ord[gif_flag] )
+ if( *span_ord[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_ord[gif_flag], chr);
+}
+
+
+
+if( span_ch[gif_flag] )
+ if( *span_ch[gif_flag] ){
+ print_f( span_ch[gif_flag] );
+}
+
+
+}
+put_char(chr);
+if( span_on ){
+
+if( end_span[gif_flag] )
+ if( *end_span[gif_flag] ){
+ print_f( end_span[gif_flag] );
+}
+
+
+}
+
+ }
+
+ }
+
+ }
+}
+
+
+ print_f_4ht(next_str); free((void *) next_str);
+ next_str = (char *) 0;
+} else {
+ if( verb_ch ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) put_4ht_ch( ch, cur_o_file );
+ } else {
+ int gif_flag, chr, r_ch;
+ BOOL ch_str_flag;
+r_ch = ch - font_tbl[cur_fnt].char_f;
+gif_flag = font_tbl[cur_fnt].gif1[r_ch];
+ch_str_flag = get_bit( font_tbl[cur_fnt].ch_str, r_ch);
+chr = ((r_ch == 255) && font_tbl[cur_fnt].ch255 )? 256 :
+ *(font_tbl[cur_fnt].ch + r_ch);
+if( (gif_flag % 2) || ch_str_flag ){ design_ch = ch;
+ {
+ U_CHAR str[256], *p;
+ BOOL sv;
+ int mag;
+sv = special_on; special_on = TRUE;
+if( gif_ch && (gif_flag % 2) ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ if( !gif_open[gif_flag] ){
+
+(IGNORED) sprintf(str,
+ "configuration for htf class %d (char %d of %s.htf)",
+ gif_flag, ch,font_tbl[cur_fnt].name
+ );
+warn_i_str(50,str);
+
+
+gif_open[gif_flag] = m_alloc(char,
+
+29
+
+);
+(IGNORED) strcpy(gif_open[gif_flag],
+
+"<img src=\"+\" alt=\"+++++\" />+"
+
+);
+gif_alt[gif_flag] = gif_open[gif_flag]+11;
+ *(gif_alt[gif_flag] - 1) = '\0';
+gif_class[gif_flag] = gif_open[gif_flag]+19;
+ *(gif_class[gif_flag] - 1) = '\0';
+gif_size[gif_flag] = gif_open[gif_flag]+20;
+ *(gif_size[gif_flag] - 1) = '\0';
+gif_mag[gif_flag] = gif_open[gif_flag]+21;
+ *(gif_mag[gif_flag] - 1) = '\0';
+gif_ord[gif_flag] = gif_open[gif_flag]+22;
+ *(gif_ord[gif_flag] - 1) = '\0';
+gif_end[gif_flag] = gif_open[gif_flag]+23;
+ *(gif_end[gif_flag] - 1) = '\0';
+gif_id[gif_flag] = gif_open[gif_flag]+28;
+ *(gif_id[gif_flag] - 1) = '\0';
+
+
+ } else if( !get_bit( class_on, gif_flag ) ) {
+ notify_class_info(gif_flag);
+ store_bit_I( class_on, gif_flag );
+ }
+
+p= gif_open[gif_flag];
+if( p )
+if( *p ){
+ print_f(p); (IGNORED) strcpy(str, font_tbl[cur_fnt].name);
+ mag = (int) ((double) font_tbl[cur_fnt].scale /
+ font_tbl[cur_fnt].design_sz * 10 );
+
+if( !dos_file_names ){
+ print_f(font_tbl[cur_fnt].name);
+ if( mag == 10 ) (IGNORED) sprintf(str, GIF_I, design_ch, gif);
+ else (IGNORED) sprintf(str, GIF_II, mag, design_ch, gif);
+}
+
+
+
+if( dos_file_names ){
+ dos_gif_file(str, mag, design_ch);
+ print_f(str);
+ (IGNORED) sprintf(str, GIF_VII, gif);
+}
+
+
+
+ print_f(str);
+ add_bit( font_tbl[cur_fnt].gif_on, r_ch, 1 );
+}
+
+
+
+p = gif_alt[gif_flag];
+if( p )
+ if( *p ){
+ print_f(p); put_alt_ch(chr,ch_str_flag);
+}
+
+
+
+p = gif_class[gif_flag];
+if( p )
+ if( *p ){
+ (IGNORED) fprintf(cur_o_file, p,
+ font_tbl[cur_fnt].family_name); }
+
+
+
+p = gif_size[gif_flag];
+if( p )
+ if( *p ){
+ (IGNORED) fprintf(cur_o_file, p,
+ font_tbl[cur_fnt].font_size); }
+
+
+
+p = gif_mag[gif_flag];
+if( p )
+ if( *p && (font_tbl[cur_fnt].mag != 100) ){
+ (IGNORED) fprintf(cur_o_file, p, font_tbl[cur_fnt].mag);
+}
+
+
+
+p = gif_ord[gif_flag];
+if( p )
+ if( *p ){
+ (IGNORED) fprintf(cur_o_file, p, ch);
+}
+
+
+
+p = gif_end[gif_flag];
+if( p )
+ if( *p ){ print_f( p ); }
+
+
+} else {
+if( !gif_flag || (gif_flag % 2) || ch_map_flag ) {
+ put_alt_ch(chr,ch_str_flag); }
+else{
+
+if( gif_flag && !get_bit( class_on, gif_flag ) ) {
+ notify_class_info(gif_flag);
+ store_bit_I( class_on, gif_flag );
+}
+
+
+if( span_on ){
+
+if( span_open[gif_flag] )
+ if( *span_open[gif_flag] ){
+ print_f( span_open[gif_flag] );
+}
+
+
+
+if( span_name[gif_flag] )
+ if( *span_name[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_name[gif_flag],
+ font_tbl[cur_fnt].family_name);
+}
+
+
+
+if( span_size[gif_flag] )
+ if( *span_size[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_size[gif_flag],
+ font_tbl[cur_fnt].font_size);
+}
+
+
+
+if( span_mag[gif_flag] )
+ if( *span_mag[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_mag[gif_flag],
+ font_tbl[cur_fnt].mag);
+}
+
+
+
+if( span_ord[gif_flag] )
+ if( *span_ord[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_ord[gif_flag], chr);
+}
+
+
+
+if( span_ch[gif_flag] )
+ if( *span_ch[gif_flag] ){
+ print_f( span_ch[gif_flag] );
+}
+
+
+}
+put_alt_ch(chr,ch_str_flag);
+if( span_on ){
+
+if( end_span[gif_flag] )
+ if( *end_span[gif_flag] ){
+ print_f( end_span[gif_flag] );
+}
+
+
+}
+
+ }
+
+ }
+special_on = sv;
+
+ } design_ch = 0; }
+else {
+if( !gif_flag || (gif_flag % 2) || ch_map_flag ) { put_char(chr);
+} else{
+
+if( no_root_file ){ open_o_file(); }
+
+
+
+if( gif_flag && !get_bit( class_on, gif_flag ) ) {
+ notify_class_info(gif_flag);
+ store_bit_I( class_on, gif_flag );
+}
+
+
+if( span_on ){
+
+if( span_open[gif_flag] )
+ if( *span_open[gif_flag] ){
+ print_f( span_open[gif_flag] );
+}
+
+
+
+if( span_name[gif_flag] )
+ if( *span_name[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_name[gif_flag],
+ font_tbl[cur_fnt].family_name);
+}
+
+
+
+if( span_size[gif_flag] )
+ if( *span_size[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_size[gif_flag],
+ font_tbl[cur_fnt].font_size);
+}
+
+
+
+if( span_mag[gif_flag] )
+ if( *span_mag[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_mag[gif_flag],
+ font_tbl[cur_fnt].mag);
+}
+
+
+
+if( span_ord[gif_flag] )
+ if( *span_ord[gif_flag] ){
+ (IGNORED) fprintf(cur_o_file, span_ord[gif_flag], chr);
+}
+
+
+
+if( span_ch[gif_flag] )
+ if( *span_ch[gif_flag] ){
+ print_f( span_ch[gif_flag] );
+}
+
+
+}
+put_char(chr);
+if( span_on ){
+
+if( end_span[gif_flag] )
+ if( *end_span[gif_flag] ){
+ print_f( end_span[gif_flag] );
+}
+
+
+}
+
+ }
+
+ }
+
+ }
+}
+
+if( a_accent_template && needs_accented_sym ){
+ (IGNORED) fprintf(cur_o_file, a_accent_fifth);
+}
+
+
+
+if( pos_dvi ){
+ print_f(end_pos_text);
+}
+
+
+if( show_class && !pause_class && !ignore_subclass_del ){
+ if( !stack[stack_n].no_left_del && stack[stack_n+1].active_class_del ){
+ if( !stack[stack_n+1].ignore_subclass_del ){
+
+(IGNORED) print_f( close_class[math_class]);
+
+
+ }
+
+(IGNORED) print_f( (stack[stack_n+1].temp_class_del)?
+ stack[stack_n+1].temp_class_close
+ : stack[stack_n+1].class_close);
+
+
+ stack[stack_n+1].active_class_del = FALSE;
+ } else {
+
+(IGNORED) print_f( close_class[math_class]);
+
+
+ stack[stack_n+1].active_class_del = FALSE;
+ }
+}
+
+
+
+if( trace_dvi_C && !ch_map_flag ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, "%s%s",
+ trace_dvi_del_c, end_trace_dvi_del_c);
+}
+
+
+
+
+
+
+
+if( needs_end_accent && t_accent_template ){
+
+if( span_on && in_span_ch ){
+ if( *end_span[0] ){
+ in_span_ch = FALSE;
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, end_span[0]);
+} }
+
+
+ (IGNORED) fprintf(cur_o_file, t_accent_fifth);
+ needs_end_accent = FALSE;
+needs_accented_sym--;
+
+
+}
+
+
+
+
+
+
+ text_on = TRUE;
+ } }
+
+return (INTEGER)(
+
+design_size_to_pt( *(font_tbl[cur_fnt].wtbl
+ + (int) (
+*(font_tbl[cur_fnt].char_wi + (int)
+ ( ch - font_tbl[cur_fnt].char_f)% 256)
+
+) )
+ )
+* (double) font_tbl[cur_fnt].scale
+
+
+ );
+
+
+}
+
+
+
+static void put_char
+#ifdef ANSI
+#define SEP ,
+( int ch
+)
+#undef SEP
+#else
+#define SEP ;
+( ch ) int ch
+;
+#undef SEP
+#endif
+{
+ if( !ignore_chs
+ && !( ((ch==' ') || (ch=='\n')) && no_root_file )
+ ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ if( ch_map_flag ){
+ if( special_on || ((ch != '\n') && (ch != ' ')) ){
+
+insert_ch_map((char) ch, TRUE);
+
+ }
+ }else {
+ if ( ch == '\n' ){
+if( eoln_str ){ print_f(eoln_str); }
+else { (IGNORED) put_4ht_ch( ch, cur_o_file ); }
+recover_spaces = 0;
+
+ }
+ else if ( ch == ' ' ){
+if( space_str ){ print_f(space_str); }
+else { (IGNORED) put_4ht_ch( ch, cur_o_file ); }
+
+ }
+ else { (IGNORED) put_4ht_ch( ch, cur_o_file ); }
+} } }
+
+
+
+static void print_f
+#ifdef ANSI
+#define SEP ,
+( char* str
+)
+#undef SEP
+#else
+#define SEP ;
+(str) char* str
+;
+#undef SEP
+#endif
+{
+
+if( no_root_file ){ open_o_file(); }
+
+
+ if( ch_map_flag ){
+ while( *str ){ put_char( *str ); str++; }
+ }else {
+ (IGNORED) print_f_4ht( str );
+} }
+
+
+
+static void print_f_4ht
+#ifdef ANSI
+#define SEP ,
+( char* str
+)
+#undef SEP
+#else
+#define SEP ;
+(str) char* str
+;
+#undef SEP
+#endif
+{
+
+if( no_root_file ){ open_o_file(); }
+
+
+ if( ch_map_flag ){
+ while( *str ){ put_char( *str ); str++; }
+ } else {
+ while( *str ){
+ (IGNORED) put_4ht_ch( *str, cur_o_file );
+ str++;
+} } }
+
+
+static int get_char(MYVOID)
+{
+ return (int) getc(dvi_file);
+}
+
+
+static int get_noop(MYVOID)
+{ int ch;
+ while( (ch = get_char()) ==
+138
+ ){;}
+ return ch;
+}
+
+
+
+static char* get_str
+#ifdef ANSI
+#define SEP ,
+( int n
+)
+#undef SEP
+#else
+#define SEP ;
+(n) int n
+;
+#undef SEP
+#endif
+{ U_CHAR *q, *p;
+ p = q = m_alloc(char,n+1);
+ while( n-- ) *q++ = get_char();
+ *q = '\0';
+ return p;
+}
+
+
+
+static long fget_unt
+#ifdef ANSI
+#define SEP ,
+(
+ FILE* file SEP
+ register int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+( file, n )
+ FILE* file SEP
+ register int n
+
+;
+#undef SEP
+#endif
+{ register long val = 0;
+ while( n-- ){ val = (val << 8) + (unsigned INTEGER) getc(file) ; }
+ return val;
+}
+
+
+
+static long fget_int
+#ifdef ANSI
+#define SEP ,
+(
+ FILE *file SEP
+ int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+( file, n )
+ FILE *file SEP
+ int n
+
+;
+#undef SEP
+#endif
+{ register long val;
+ val = (unsigned INTEGER) getc(file);
+ if( val & 0x80 ) val -= 0x100;
+ while( --n ){ val = (val << 8) + (unsigned INTEGER) getc(file); }
+ return val;
+}
+
+
+
+static long cond_int
+#ifdef ANSI
+#define SEP ,
+(
+ register INTEGER n
+)
+#undef SEP
+#else
+#define SEP ;
+( n )
+ register INTEGER n
+;
+#undef SEP
+#endif
+{ register long val;
+ int ch;
+ val = (unsigned int) (ch = get_char());
+ cond_idv_char( ch );
+ if( val & 0x80 ) val -= 0x100;
+ while( --n ){
+ val = (val << 8) + (unsigned int) (ch = get_char());
+ cond_idv_char( ch );
+ }
+ return val;
+}
+
+
+
+static void warn_i
+#ifdef ANSI
+#define SEP ,
+( int n
+)
+#undef SEP
+#else
+#define SEP ;
+(n) int n
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,warning);
+ (IGNORED) fprintf(stderr,warn_err_mssg[n]);
+ show_err_context();
+}
+
+
+
+static void warn_i_int
+#ifdef ANSI
+#define SEP ,
+( int n SEP int i
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n,i) int n SEP int i
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,warning);
+ (IGNORED) fprintf(stderr, warn_err_mssg[n], i);
+ show_err_context();
+}
+
+
+
+static void warn_i_int_2
+#ifdef ANSI
+#define SEP ,
+( int n SEP int i SEP int j
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n,i,j) int n SEP int i SEP int j
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,warning);
+ (IGNORED) fprintf(stderr, warn_err_mssg[n], i, j);
+ show_err_context();
+}
+
+
+
+static void warn_i_str
+#ifdef ANSI
+#define SEP ,
+(
+ int n SEP
+ U_CHAR *str
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n,str)
+ int n SEP
+ U_CHAR *str
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,warning);
+ (IGNORED) fprintf(stderr,warn_err_mssg[n], str);
+ show_err_context();
+}
+
+
+
+static void warn_i_str2
+#ifdef ANSI
+#define SEP ,
+(
+ int n SEP
+ U_CHAR *str1 SEP
+ U_CHAR *str2
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n,str1,str2)
+ int n SEP
+ U_CHAR *str1 SEP
+ U_CHAR *str2
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,warning);
+ (IGNORED) fprintf(stderr,warn_err_mssg[n], str1,str2);
+ show_err_context();
+}
+
+
+
+static void err_i
+#ifdef ANSI
+#define SEP ,
+( int n
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n) int n
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,"--- error --- ");
+ (IGNORED) fprintf(stderr, warn_err_mssg[n]);
+ show_err_context();
+ exit(EXIT_FAILURE);
+}
+
+
+
+static void err_i_int
+#ifdef ANSI
+#define SEP ,
+( int n SEP int i
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n,i) int n SEP int i
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,"--- error --- ");
+ (IGNORED) fprintf(stderr, warn_err_mssg[n], i);
+ show_err_context();
+ exit(EXIT_FAILURE);
+}
+
+
+
+static void err_i_str
+#ifdef ANSI
+#define SEP ,
+(
+ int n SEP
+ U_CHAR *str
+
+)
+#undef SEP
+#else
+#define SEP ;
+(n,str)
+ int n SEP
+ U_CHAR *str
+
+;
+#undef SEP
+#endif
+{ (IGNORED) fprintf(stderr,"--- error --- ");
+ (IGNORED) fprintf(stderr, warn_err_mssg[n], str);
+ show_err_context();
+ exit(EXIT_FAILURE);
+}
+
+
+static void show_err_context(MYVOID)
+{ long curr_pos;
+ int n, i;
+ U_CHAR ch;
+ if( err_context ){
+ curr_pos = ftell(dvi_file);
+ for(n=6; n--;){
+ (IGNORED) putc( '\n', stderr );
+ for(i=70; i--;){
+ ch = get_char();
+ (IGNORED) putc(( (ch>31) && (ch<127))? ch : ' ', stderr);
+ }
+ }
+ (IGNORED) fseek(dvi_file, curr_pos,
+0
+);
+ (IGNORED) putc( '\n', stderr ); (IGNORED) putc( '\n', stderr );
+ if( err_mark ){ print_f( err_mark ); }
+} }
+
+
+
+int
+#ifdef CDECL
+CDECL
+#endif
+
+ main
+#ifdef ANSI
+#define SEP ,
+(
+ int argc SEP
+ U_CHAR **argv
+)
+#undef SEP
+#else
+#define SEP ;
+(argc, argv)
+ int argc SEP
+ U_CHAR **argv
+;
+#undef SEP
+#endif
+{
+register INTEGER i;
+int ch;
+
+
+int unread_pages;
+
+
+long int eof_op_n, begin_postamble;
+int dis_pages;
+
+
+int stack_id;
+
+
+BOOL in_accenting;
+
+
+char* tex4ht_env_file = (char *) 0;
+char* dos_env_file =
+#if defined(DOS_WIN32) || defined(__MSDOS__)
+
+get_env_dir(argv[0])
+
+;
+#endif
+#if !defined(DOS_WIN32) && !defined(__MSDOS__)
+ (char *) 0;
+#endif
+
+
+
+struct htf_com_rec* htf_font_dir = (struct htf_com_rec *) 0;
+
+
+
+
+#ifdef SIGSEGV
+ (void) signal(SIGSEGV,sig_err);
+#endif
+ (void) signal(SIGFPE,sig_err);
+#ifdef WIN32
+
+SetConsoleCtrlHandler((PHANDLER_ROUTINE)sigint_handler, TRUE);
+
+
+#else
+#ifdef SIGINT
+ (void) signal(SIGINT,sig_err);
+#endif
+#endif
+
+
+
+(IGNORED) printf("----------------------------\n");
+#ifndef KPATHSEA
+#ifdef PLATFORM
+ (IGNORED) printf("tex4ht.c (2005-05-29-09:42 %s)\n",PLATFORM);
+#else
+ (IGNORED) printf("tex4ht.c (2005-05-29-09:42)\n");
+#endif
+#else
+#ifdef PLATFORM
+ (IGNORED) printf("tex4ht.c (2005-05-29-09:42 %s kpathsea)\n",PLATFORM);
+#else
+ (IGNORED) printf("tex4ht.c (2005-05-29-09:42 kpathsea)\n");
+#endif
+#endif
+for(i=0; i<argc; i++){
+ (IGNORED) printf("%s%s ", (i>1)?"\n " : "", argv[i]); }
+(IGNORED) printf("\n");
+
+
+
+set_del( &trace_dvi_del_P, &end_trace_dvi_del_P);
+set_del( &trace_dvi_del_p, &end_trace_dvi_del_p);
+set_del( &trace_dvi_del_C, &end_trace_dvi_del_C);
+set_del( &trace_dvi_del_c, &end_trace_dvi_del_c);
+set_del( &trace_dvi_del_H, &end_trace_dvi_del_H);
+set_del( &trace_dvi_del_h, &end_trace_dvi_del_h);
+set_del( &trace_dvi_del_R, &end_trace_dvi_del_R);
+set_del( &trace_dvi_del_r, &end_trace_dvi_del_r);
+set_del( &trace_dvi_del_V, &end_trace_dvi_del_V);
+set_del( &trace_dvi_del_v, &end_trace_dvi_del_v);
+
+
+
+dvi_file = stdin;
+
+
+{ U_CHAR *yes = NULL;
+ system_yes = (system( yes ) != 0);
+}
+
+
+{ int i;
+ for( i=8; i--; ){
+ halign[i] = m_alloc(struct halign_rec, 1);
+ halign[i]->str = m_alloc(char, 1);
+ *(halign[i]->str) = '\0';
+ halign[i]->refs = 1;
+ }
+}
+
+
+del_stack = (struct del_stack_entry *) 0;
+
+
+back_id_off = 1; id_latex = 0;
+
+
+back_token = back_group = m_alloc(struct send_back_entry,1);
+back_token->id = -1;
+
+
+pos_text = pos_line = end_pos_body = end_pos_text = pos_body =
+ m_alloc(char, (int) 1);
+(IGNORED) strcpy(pos_text, "" );
+
+
+margin_sp = (double) MARGINSP;
+
+
+{ int i; i=256; while( i-- ) {
+ span_name[i] = span_open[i] = span_size[i] =
+ span_mag[i] = span_ch[i] = end_span[i] =
+ span_ord[i] = gif_id[i] = NULL;
+ if( (i>0) && !(i%2) ) { store_bit_Z( class_on, i ); }
+ else { store_bit_I( class_on, i ); }
+ }
+}
+
+
+in_accenting = FALSE;
+
+
+for( math_class=0; math_class<
+79
+
+; math_class++ ){
+ open_class[math_class] = m_alloc(char, 1);
+ close_class[math_class] = m_alloc(char, 1);
+ *(open_class[math_class]) = *(close_class[math_class]) = '\0';
+}
+
+
+HOME_DIR = getenv("HOME");
+
+
+
+{ long file_len;
+
+{ int i;
+ U_CHAR *p, *in_name = "", *out_name = "";
+
+
+#ifdef KPATHSEA
+ kpse_set_program_name (argv[0], NULL);
+#endif
+
+
+
+#if !defined(DOS_GIF_FILE) && !defined(WIN32) && defined(__DJGPP__)
+ dos_file_names = !_use_lfn(NULL);
+#endif
+
+
+ if( argc == 1 ){ bad_arg; }
+ for(i=1; i<argc; i++) {
+ if( *( p=argv[i] ) == '-' ){
+if( (int) strlen( argv[i] ) == 2 ){
+ if( ++i == argc ) bad_arg;
+}
+switch( *(p+1) ){
+ case 'b':{
+begin_char_gif = p+2;
+
+ break; }
+ case 'c':{
+struct env_c_rec *temp = (struct env_c_rec*)
+ m_alloc(struct env_c_rec, (int) 1);
+temp->option = p+2;
+temp->next = envChoice;
+envChoice = temp;
+
+ break;}
+ case 'e':{
+tex4ht_env_file = p+2;
+
+break; }
+ case 'f':{
+p = p + 2;
+in_name = p + (int) strlen( p );
+while( *in_name != *p ){ in_name--; }
+in_name++;
+
+break; }
+ case 'g':{
+gif = p+2;
+
+ break; }
+ case 'h':{
+switch( *(p+2) ){
+ case 'e':{
+err_context = TRUE;
+
+ break; }
+ case 'f':{
+dump_htf_files = 1;
+
+ break; }
+ case 'F':{
+dump_htf_search = TRUE;
+
+ break; }
+ case 's':{
+trace_special = TRUE;
+
+ break;}
+ case 'g':{
+trace_dvi_P++;
+if( !( *trace_dvi_del_P || *end_trace_dvi_del_P
+ || *trace_dvi_del_p || *end_trace_dvi_del_p
+ )
+ ){
+ trace_dvi_del_P =
+ (char *) r_alloc((void *) trace_dvi_del_P,
+ (size_t) 4);
+ (IGNORED) strcpy(trace_dvi_del_P, "[G " );
+ end_trace_dvi_del_P =
+ (char *) r_alloc((void *) end_trace_dvi_del_P,
+ (size_t) 2);
+ (IGNORED) strcpy(end_trace_dvi_del_P, "]" );
+ trace_dvi_del_p =
+ (char *) r_alloc((void *) trace_dvi_del_p,
+ (size_t) 5);
+ (IGNORED) strcpy(trace_dvi_del_p, "[/G " );
+ end_trace_dvi_del_p =
+ (char *) r_alloc((void *) end_trace_dvi_del_p,
+ (size_t) 2);
+ (IGNORED) strcpy(end_trace_dvi_del_p, "]" );
+}
+
+ break;}
+ case 'v':{
+dump_env_files = TRUE;
+
+ break; }
+ case 'V':{
+dump_env_search = TRUE;
+
+ break; }
+ default:{ bad_arg; }
+}
+
+ break; }
+ case 'i':{
+ com_dir(p);
+ {
+ struct htf_com_rec *q, *t;
+ q = m_alloc( struct htf_com_rec, 1);
+ q->name = p+2;
+ q->next = (struct htf_com_rec *) 0;
+ if( htf_font_dir ){
+ t = htf_font_dir;
+ while( t->next ){ t = t->next; }
+ t->next = q;
+ } else {
+ htf_font_dir = q;
+ }
+}
+
+ break; }
+ case 'l':{
+#ifndef KPATHSEA
+tex4ht_fls_name = p+2;
+#endif
+
+ break; }
+ case 'P':{
+{ struct sys_call_rec *q;
+ q = m_alloc(struct sys_call_rec, 1);
+ q->next = system_calls;
+ q->filter = p + 2;
+ system_calls = q;
+}
+
+ break; }
+ case 's':{
+font_gif = p+2;
+
+ break; }
+ case 't':{
+com_dir(p); fontdir[fontdir_count++] = p+2;
+
+ break; }
+ case 'u':{
+if( eq_str(p+2, "10") ){ u10 = TRUE; }
+
+else if( eq_str(p+2, "tf8") ){ utf8 = TRUE; }
+
+
+else{ bad_arg;}
+
+ break; }
+ case 'x':{
+switch( *(p+2) ){
+ case 's':{ dos_file_names = TRUE; break; }
+ default:{ bad_arg; }
+}
+
+ break; }
+ default:{ bad_arg; }
+}
+
+ }
+ else in_name = argv[i];
+ }
+
+if( *in_name != '\0' ){
+ BOOL tag;
+job_name_n = (int) strlen( in_name );
+job_name = m_alloc(char, job_name_n+6);
+(IGNORED) strcpy(job_name, in_name);
+tag = job_name_n < 5;
+if( !tag ) tag = !eq_str( job_name+job_name_n-4,".dvi");
+if( tag ){ job_name_n+=4; (IGNORED) strct(job_name, ".dvi"); }
+if( (dvi_file = fopen(job_name, READ_BIN_FLAGS)) == NULL )
+ {
+{ int i;
+ for(i=job_name_n-5; i; i--){
+ if( job_name[i] == '.' ){
+ job_name[i] = '\0';
+ job_name_n = i + 4;
+ (IGNORED) strct(job_name, ".dvi");
+ break;
+ } }
+ if( (dvi_file = fopen(job_name, READ_BIN_FLAGS)) == NULL ){
+ warn_i(9); bad_in_file(job_name);
+} }
+
+ }
+
+job_name[job_name_n-1] = 'v';
+job_name[job_name_n-2] = 'd';
+job_name[job_name_n-3] = 'i';
+if( (idv_file = fopen(job_name, WRITE_BIN_FLAGS)) == NULL )
+ bad_in_file(job_name);
+
+
+
+
+ }
+#ifdef KPATHSEA
+#ifdef KWIN32
+ else if (!isatty(fileno(stdin))) SET_BINARY(fileno(stdin));
+#endif
+#endif
+
+
+ {
+ U_CHAR *name;
+if( *out_name == '\0' )
+ { if( *in_name == '\0' ){
+bad_arg;
+
+ }
+ else {
+int n = (int) strlen( job_name );
+name = m_alloc(char, 6 + n);
+(IGNORED) strcpy(name,job_name);
+n -= 4; *(name + n) = '\0';
+(IGNORED) strct(name,".html");
+#ifdef HTM
+name[n+4] ='\0';
+#endif
+
+ }
+ }
+else{
+ int tag = 1;
+ int n = (int) strlen( out_name );
+name = m_alloc(char, 6 + n);
+(IGNORED) strcpy(name,out_name);
+while( n-- ) tag = tag && (*(name+n) != '.') ;
+if( tag ) (IGNORED) strct(name,".html");
+#ifdef HTM
+name[n+4] = '\0';
+#endif
+
+ }
+no_root_file = name;
+
+ }
+}
+
+
+
+{ U_CHAR str[PATH_MAX], *TEX4HTENV;
+
+if( dump_env_search && tex4ht_env_file ){
+ (IGNORED) printf("-e: %s?\n", tex4ht_env_file);
+}
+dot_file = tex4ht_env_file?
+ f_open_pathed_filename( tex4ht_env_file, READ_TEXT_FLAGS ) : NULL;
+
+
+
+if( !dot_file ){
+ if( dump_env_search ){ (IGNORED) printf("%s?\n", "tex4ht.env"); }
+ dot_file = f_open("tex4ht.env", READ_TEXT_FLAGS);
+}
+#ifndef DOS_WIN32
+ if( !dot_file ){
+ if( dump_env_search ){ (IGNORED) printf("%s?\n", ".tex4ht"); }
+ dot_file = f_open(".tex4ht", READ_TEXT_FLAGS);
+ if( dot_file ){
+ printf("(%s)\n", ".tex4ht");
+ } }
+#endif
+
+
+ if( !dot_file ){
+
+TEX4HTENV = getenv("TEX4HTENV");
+if( TEX4HTENV ){
+ if( dump_env_search ){
+ (IGNORED) printf("TEX4HTENV: %s?\n", TEX4HTENV); }
+ dot_file = f_open_pathed_filename(TEX4HTENV,READ_TEXT_FLAGS);
+} else {
+ if( dump_env_search ){
+ (IGNORED) printf("getenv(\"TEX4HTENV\")=\n");
+} }
+
+
+ }
+
+if( !dot_file ){
+ if( HOME_DIR ){
+ (IGNORED) sprintf(str,
+#if defined(DOS_WIN32) || defined(__DJGPP__)
+ is_forward_slash(HOME_DIR)? "%s/tex4ht.env" : "%s\\tex4ht.env"
+#else
+ "%s/tex4ht.env"
+#endif
+
+, HOME_DIR);
+ if( dump_env_search ){ (IGNORED) printf("%s?\n", str); }
+ dot_file = f_open(str,READ_TEXT_FLAGS);
+} }
+#ifndef DOS_WIN32
+ if( !dot_file ){
+ if( HOME_DIR ){
+ (IGNORED) sprintf(str,"%s/.tex4ht", HOME_DIR);
+ if( dump_env_search ){ (IGNORED) printf("%s?\n", str); }
+ dot_file = f_open(str,READ_TEXT_FLAGS);
+ } }
+#endif
+#if defined(DOS_WIN32) || defined(__MSDOS__)
+ if( !dot_file ){
+ if( dump_env_search ){ (IGNORED) printf("%s?\n", "C:/tex4ht.env"); }
+ dot_file = f_open("C:/tex4ht.env",READ_TEXT_FLAGS);
+ }
+#endif
+
+
+
+#ifdef ENVFILE
+ if( !dot_file ){
+ if( dump_env_search ){ (IGNORED) printf("ENVFILE: %s?\n", ENVFILE); }
+ dot_file = f_open_pathed_filename( ENVFILE,READ_TEXT_FLAGS);
+ }
+#else
+ if( dump_env_search ){
+ (IGNORED) printf("tex4ht compiled without ENVFILE\n");
+ }
+#endif
+
+
+
+if( !dot_file && dos_env_file){
+ if( dump_env_search ){ (IGNORED) printf("%s?\n", dos_env_file); }
+ dot_file = f_open( dos_env_file, READ_TEXT_FLAGS );
+}
+
+
+
+
+#ifdef KPATHSEA
+if( !dot_file ) { U_CHAR * envname;
+ char *arch, *p, str[256];
+
+p = arch = (char *) kpse_var_value( "SELFAUTOLOC" );
+while( *p != '\0' ){
+ if( (*p == '/') || (*p == '\\') ){
+ arch = p;
+ }
+ p++;
+}
+
+
+ envname = (char *) 0;
+
+if( arch ){
+ (IGNORED) sprintf(str,"%s%ctex4ht.env", arch+1, *arch);
+ if( dump_env_search ){
+ (IGNORED) printf("kpse_open_file (\"%s\", ...)?\n", str );
+ }
+ envname= kpse_find_file (str, kpse_program_text_format, 0);
+}
+
+
+ if ( !envname ){
+if( dump_env_search ){
+ (IGNORED) printf("kpse_open_file (\"tex4ht.env\", ...)?\n");
+}
+envname= kpse_find_file ("tex4ht.env", kpse_program_text_format, 0);
+
+ }
+ if ( envname ){
+ dot_file = kpse_open_file (envname,
+ kpse_program_text_format);
+ (IGNORED) printf("(%s)\n", envname);
+ } else if( dump_env_search ){
+ p = (char *) kpse_var_value( "TEX4HTINPUTS" );
+ if( p ){
+ (IGNORED) printf( "TEX4HTINPUTS = %s\n", p );
+ } else { warn_i_str( 50, "kpathsea variable TEX4HTINPUTS"); }
+ }
+}
+#endif
+
+
+ if( !dot_file ) warn_i_str( 1,
+#ifdef DOS_WIN32
+ "tex4ht.env"
+#endif
+#ifndef DOS_WIN32
+ "tex4ht.env | .tex4ht"
+#endif
+
+);
+}
+
+
+
+(IGNORED) fseek(dot_file, 0L,
+0
+);
+while ( search_dot_file( 'P' ) ){ struct sys_call_rec *q;
+ U_CHAR *p, str[256];
+ q = m_alloc(struct sys_call_rec, 1);
+ q->next = system_calls;
+ system_calls = q;
+ p = str;
+ do
+ *(p++) = ch = (int) getc(dot_file);
+ while( (ch !='\n') && (ch != EOF) );
+ p--;
+ *p = '\0';
+ q->filter = m_alloc(char, (int) strlen(str)+1);
+ (IGNORED) strcpy(q->filter,str);
+}
+
+
+lg_font_fmt = (char *) get_script(lg_font_fmt,LGFNT,'f');
+
+
+class_fmt = (char *) get_script(class_fmt,LGCLS,'c');
+
+
+font_gif = (char *) get_script(font_gif,LGPIC,'s');
+
+{ int n;
+ n = (int) strlen(font_gif);
+ if( font_gif[n-1] != '%' ){ font_gif[n] = '%'; font_gif[n+1] = '\0'; }
+}
+
+
+
+
+begin_char_gif = (char *) get_script(begin_char_gif,LGSEP,'b');
+
+
+gif = (char *) get_script(gif,LGTYP,'g');
+{ int n;
+ n = (int) strlen(gif) - 1;
+ if( gif[n] == '%' ){ gif[n] = '%'; }
+ else if( gif[n] == '\n' ) { gif[n] = '\0'; }
+}
+
+
+
+{ long curr_pos;
+ curr_pos = ftell(dvi_file);
+ (IGNORED) fseek(dvi_file, 0, SEEK_END);
+ file_len = ftell(dvi_file);
+ (IGNORED) fseek(dvi_file, curr_pos,
+0
+);
+ if( (file_len % 4) != 0 ) bad_dvi;
+}
+
+
+
+{ U_CHAR str[256];
+ (IGNORED) strcpy(str,job_name);
+ str[job_name_n-1] = '\0';
+ str[job_name_n-2] = 'g';
+ str[job_name_n-3] = 'l';
+ if( (log_file = fopen(str, WRITE_TEXT_FLAGS)) == NULL )
+ bad_in_file(str);
+}
+
+
+
+#ifdef KPATHSEA
+{ char str [256], *export_str, *postfix;
+ export_str = m_alloc(char, 1);
+ *export_str = '\0';
+
+{
+ struct htf_com_rec *q;
+ q = htf_font_dir;
+ while( q != (struct htf_com_rec *) 0 ){
+ (IGNORED) strcpy(str,q->name);
+ export_htf( &export_str, str );
+ q = q->next;
+} }
+(IGNORED) fseek(dot_file, 0L,
+0
+);
+while ( search_dot_file( 'i' ) ){
+ int ch;
+ char* p;
+ p = str;
+ do {
+ ch = (int) getc(dot_file);
+ if( ch != EOF) { *(p++) = ch;}
+ } while( (ch !='\n') && (ch != EOF) );
+ *p = '\0';
+ export_htf( &export_str, str );
+}
+#ifdef HTFDIR
+ (IGNORED) strcpy(str, HTFDIR);
+ export_htf( &export_str, str );
+#endif
+
+{ U_CHAR * q;
+ q = (U_CHAR *) kpse_var_value( "TEX4HTFONTSET" );
+ if( q ){
+ if( (int) strlen(q) > 0 ){
+ export_str = (char *) r_alloc((void *) export_str,
+ (int) strlen(export_str) + (int) strlen(q) + 2);
+ if( (int) strlen(export_str) > 0 ){
+ (IGNORED) strcat(export_str, ",");
+ }
+ (IGNORED) strcat(export_str, q);
+} } }
+
+
+
+
+ if( (int) strlen(export_str) > 0 ){
+ (IGNORED) strcpy(str, "%%12");
+ export_str = (char *) r_alloc((void *) export_str,
+ (int) strlen(export_str) + (int) strlen(str) + 1 );
+ postfix = str - 1;
+ while( *(++postfix) != '\0' ){
+ if( (*postfix=='%') && (*(postfix+1)=='%') &&
+ (*(postfix+2)=='1') && (*(postfix+3)=='2') ){
+ *postfix='\0'; postfix += 4; break;
+ } }
+ if( (int) strlen(export_str) != 0 ){
+
+{ char *from_ch;
+ int i, n, m;
+ n = (int) strlen(str);
+ m = (int) strlen(export_str);
+ from_ch = export_str + m;
+ for( i = 0; i<=m; i++){
+ *(from_ch + n) = *(from_ch);
+ from_ch--;
+ }
+ for( i = 0; i<n; i++){
+ export_str[i] = str[i];
+ }
+ (IGNORED) strcat(export_str,postfix);
+}
+
+
+
+{ U_CHAR * q;
+ if( dump_htf_search ) { U_CHAR *p, *q;
+
+p = (U_CHAR *) kpse_var_value( "TEX4HTFONTSET" );
+if( p ){
+ (IGNORED) printf("given TEX4HTFONTSET = %s\n", p);
+}
+q = getenv("TEX4HTFONTSET");
+if( q ){ (IGNORED) printf(
+ "Environmet var TEX4HTFONTSET: %s\n", q);
+}
+if( !p && !q ){
+ (IGNORED) printf( "Missing TEX4HTFONTSET for kpathsea\n" );
+}
+
+
+ }
+ q = (U_CHAR *) kpse_var_value( "TEX4HTFONTSET" );
+ if( q ){
+ xputenv("TEX4HTFONTSET", export_str);
+ if( dump_htf_search ){
+ (IGNORED) printf("setting TEX4HTFONTSET={%s}\n", export_str);
+ }
+ } else if( dump_htf_search ) {
+ warn_i_str( 50, "TEX4HTFONTSET for kpathsea" );
+ }
+}
+
+
+ }
+ }
+
+{ int n;
+ n = (int) strlen(export_str);
+ if( n > 0 ){
+ export_str_chars = m_alloc(char, n+1);
+ (IGNORED) strcpy(export_str_chars, export_str);
+} }
+
+
+ free((void *) export_str);
+
+if( dump_htf_search || dump_env_search ) {
+ U_CHAR *p, *q;
+
+p = kpse_find_file ( "texmf.cnf", kpse_cnf_format, 0);
+if( p ){
+ (IGNORED) printf( "texmf.cnf = %s\n", p);
+} else { warn_i_str(1, "texmf.cnf" ); }
+p = (U_CHAR *) kpse_var_value( "TEX4HTINPUTS" );
+if( p ){
+ (IGNORED) printf("TEX4HTINPUTS = %s\n", p);
+}
+q = getenv("TEX4HTINPUTS");
+if( q ){ (IGNORED) printf(
+ "Environment var TEX4HTINPUTS: %s\n", q);
+}
+if( !p && !q ){
+ (IGNORED) printf( "Missing TEX4HTINPUTS for kpathsea\n" );
+}
+
+
+}
+
+
+}
+#endif
+
+
+
+i=0;
+do{
+ i++; file_len -= 1;
+ (IGNORED) fseek(dvi_file, file_len,
+0
+);
+} while( (ch=get_char()) ==
+223
+ );
+eof_op_n = file_len;
+if( (i<4) || (ch !=
+2
+) ) bad_dvi;
+
+
+file_len -= 5;
+(IGNORED) fseek(dvi_file, file_len,
+0
+);
+if( get_char() !=
+249
+ ) bad_dvi;
+eof_op_n -= begin_postamble = get_unt(4);
+(IGNORED) fseek(dvi_file, begin_postamble,
+0
+);
+
+
+if( get_char() !=
+248
+ ) bad_dvi;
+(IGNORED) fseek(dvi_file, 16L,
+1
+);
+
+mid_page_y = (INTEGER) get_unt(4) / 2;
+mid_page_x = (INTEGER) get_unt(4) / 2;
+
+
+if( (stack_len = (int) get_unt(2)) < 1) bad_dvi;
+
+stack = m_alloc(struct stack_entry,
+((int) stack_len + 2)
+
+);
+
+{ int i;
+ for( i=stack_len; i>=0; i--){
+ stack[i].begin = (struct group_info *) 0;
+ stack[i].end = (struct stack_end_entry *) 0;
+ stack[i].stack_id = -1;
+
+stack[i].halign_info = FALSE;
+stack[i].halign_on = FALSE;
+
+
+stack[i].path_start = (struct group_path *) 0;
+stack[i].path_end = (struct group_path *) 0;
+
+
+stack[i].class_open = stack[i].class_close
+ = (char *) 0;
+stack[i].temp_class_open = m_alloc(char, 1 );
+stack[i].temp_class_close = m_alloc(char, 1 );
+stack[i].ignore_subclass_del = stack[i].temp_class_del
+ = stack[i].active_class_del
+ = FALSE;
+
+
+} }
+
+
+
+
+unread_pages = (int) get_unt(2);
+
+
+{
+int fonts_n;
+struct html_font_rec *html_font;
+
+
+struct env_var_rec *tfm_dirs, *htf_dirs;
+
+
+
+#ifdef KPATHSEA
+
+int cardinality;
+char ** fontset;
+
+
+#endif
+
+
+ BOOL missing_fonts;
+#ifndef KPATHSEA
+
+U_CHAR files_cache[PATH_MAX];
+
+
+
+{ U_CHAR *p;
+ if( !tex4ht_fls_name ){
+ tex4ht_fls_name = p = files_cache;
+ (IGNORED) fseek(dot_file, 0L,
+0
+);
+ if ( search_dot_file( 'l' ) ){
+ do
+ *(p++) = ch = (int) getc(dot_file);
+ while( (ch !='\n') && (ch != EOF) );
+ p--; *p = '\0';
+ } else { (IGNORED) strcpy(p,
+ getenv("TEX4HTWR")? "~~/tex4ht.fls" : "tex4ht.fls");
+ }
+ }
+
+if( *tex4ht_fls_name == '~' ){
+ tex4ht_fls_name = abs_addr(tex4ht_fls_name,getenv("TEX4HTWR"));
+}
+
+
+}
+
+
+
+cache_files = f_open(tex4ht_fls_name, READ_BIN_FLAGS);
+
+
+#endif
+
+fonts_n = 0;
+
+
+cache_font = (struct cache_font_rec *) 0;
+cur_cache_font = (struct cache_font_rec *) 0;
+
+
+ missing_fonts = FALSE;
+
+tfm_dirs = get_env_var("TEX4HTTFM");
+htf_dirs = get_env_var("TEX4HTHTF");
+
+
+
+
+#ifdef KPATHSEA
+if( export_str_chars ){
+
+{ U_CHAR *p;
+ int n;
+ cardinality = 1;
+ p = (U_CHAR *) export_str_chars;
+ while( *p != '\0' ){
+ if( *p == ',' ){ cardinality++; }
+ p++;
+ }
+ fontset = m_alloc(char *, cardinality);
+ p = (U_CHAR *) export_str_chars;
+ fontset[0] = p;
+ n=1;
+ while( *p != '\0' ){
+ if( *p == ',' ){ fontset[n++] = p+1; *p = '\0'; }
+ p++;
+} }
+
+
+}
+#endif
+
+
+
+{ U_CHAR name[256];
+ FILE* file;
+ (IGNORED) sprintf(name, "%s.4hf", "unicode");
+
+ file = NULL;
+
+{
+ struct htf_com_rec *p;
+ p = htf_font_dir;
+ while( p ){
+ file = search_file_base(name, p->name, READ_TEXT_FLAGS, htf_dirs);
+ if( file ){
+#ifndef KPATHSEA
+ tex4ht_fls = TRUE;
+#endif
+ break;
+ }
+ p = p->next;
+ }
+}
+
+
+ if( !file ){
+ if( ((file = f_open(name, READ_TEXT_FLAGS)) == NULL) && dot_file )
+ file = search_in_dot_file( 'i', name, READ_TEXT_FLAGS, htf_dirs);
+#ifdef HTFDIR
+ if( !file ) file = search_file_base(name, HTFDIR,
+ READ_TEXT_FLAGS, htf_dirs);
+#endif
+
+
+#ifdef KPATHSEA
+ if( !file ){ U_CHAR * htfname;
+ htfname= kpse_find_file (name, kpse_program_text_format, 0);
+ if ( htfname ){
+
+{ U_CHAR * head, * tail, *p;
+ int n;
+
+n = (int) strlen(htfname);
+tail = head = m_alloc(char, n+1);
+(IGNORED) strcpy(head, htfname);
+while( n>11 ){
+ if( (*tail=='\\') || (*tail=='/') ){
+ if( (*tail == *(tail+9)) && (*(tail+1) == 'h')
+ && (*(tail+2) == 't') && (*(tail+3) == '-')
+ && (*(tail+4) == 'f') && (*(tail+5) == 'o')
+ && (*(tail+6) == 'n') && (*(tail+7) == 't')
+ && (*(tail+8) == 's') ){
+ p = tail + 9; *(tail + 10) = '\0'; tail += 11;
+ while( (*tail != *p) && (*tail != '\0') ){ tail++; }
+ break;
+ } }
+ tail++; n--;
+}
+
+
+ htfname = (U_CHAR *) 0;
+
+for( n = 0 ; (n < cardinality) && !htfname ; n++){
+ p = tail;
+ while( *p != '\0' ){
+ char * s, *nm;
+ s = m_alloc(char, (int) strlen( head ) +
+ (int) strlen( fontset[n] ) +
+ (int) strlen( p ) + 1);
+ (IGNORED) strcpy(s,head);
+ (IGNORED) strcat(s,fontset[n]);
+ (IGNORED) strcat(s,p);
+ nm = kpse_find_file (s, kpse_program_text_format, 0);
+ free((void *) s);
+ if ( nm ){
+ htfname = nm; break;
+ }
+ p++;
+ while( (*p != '\\') && (*p != '/') && (*p != '\0') ){ p++; }
+} }
+
+
+}
+
+
+ if ( htfname ){
+ (IGNORED) printf("(%s)\n", htfname);
+ file= fopen(htfname,READ_TEXT_FLAGS);
+ } }
+ }
+#endif
+
+
+ }
+
+
+ if( file ){
+
+int chr, delimiter, delimiter_n, line_no, digit, i, j;
+U_CHAR in[512], *in_p, * start[4], *p;
+BOOL char_on, err;
+int value;
+
+
+
+max_charset_n = 256;
+charset = m_alloc(struct charset_rec, 256);
+
+
+max_htf_4hf_n = 256;
+htf_4hf = m_alloc(struct htf_4hf_rec, 256);
+
+
+
+err = FALSE;
+line_no = 0;
+while( TRUE ){
+ line_no++;
+ chr = (int) getc(file);
+ if( chr == EOF ){ break; }
+ if( (chr>32) && (chr<127) ){
+
+delimiter = chr;
+delimiter_n = 1;
+char_on = TRUE;
+in_p = in;
+while( TRUE ) {
+ chr = (int) getc(file);
+ if( (chr == EOF) || (chr=='\n') ){ break; }
+ if( chr == delimiter ){
+ if( char_on ){ *(in_p++) = '\0'; }
+ else{ start[ delimiter_n/2 ] = in_p; }
+ char_on = !char_on;
+ delimiter_n++;
+ } else if (char_on ) {
+ *(in_p++) = chr;
+ }
+ if( delimiter_n==8 ){ break; }
+}
+
+
+ if( delimiter_n == 8 ){
+ if( *in != '?' ) {
+ if(
+ (*in != '&')
+|| (*(in+1) != '#')
+|| ( (*(in+2) != 'x') && (*(in+2) != 'X'))
+|| (*(start[1] - 2) != ';')
+
+ ){ err = TRUE; }
+ else {
+
+value = 0;
+for( p=in+3; *p!=';'; p++){
+ digit = (int) *p;
+ if( (digit>='0') && (digit<='9') ){ digit -= '0'; }
+ else if( (digit>='A') && (digit<='F') ){ digit -= BASE_A; }
+ else if( (digit>='a') && (digit<='f') ){ digit -= BASE_a; }
+ else { digit=0; err = TRUE; }
+ value = 16*value + digit;
+}
+
+
+ if( start[3] == (in_p-1) ){
+ if( !err ){
+
+if( (charset_n+1) == max_charset_n){
+ max_charset_n += 10;
+ charset = (struct charset_rec *) r_alloc((void *) charset,
+ (size_t) ((max_charset_n) * sizeof(struct charset_rec) ));
+}
+
+
+p = m_alloc(char, (int) (start[3] - start[2]) );
+(IGNORED) strcpy(p, start[2] );
+i = charset_n;
+while( i-- > 0 ){
+ if( charset[i].ch == value ){
+ free((void *) charset[i].str);
+ break;
+ } else {
+ if( (charset[i].ch < value)
+ || ((charset[i].ch > value) && (i==0)) ){
+ if( charset[i].ch < value ){ i++; }
+ charset_n++;
+ for( j=charset_n; j>i; j-- ){
+ charset[j].ch = charset[j-1].ch;
+ charset[j].str = charset[j-1].str;
+ }
+ break;
+ } }
+}
+if(i == -1){ i = charset_n; }
+if( i==charset_n ){ charset_n++; }
+charset[i].str = p;
+charset[i].ch = value;
+
+ }
+ } else {
+
+if( (htf_4hf_n+1) == max_htf_4hf_n){
+ max_htf_4hf_n += 10;
+ htf_4hf = (struct htf_4hf_rec *) r_alloc((void *) htf_4hf,
+ (size_t) ((max_htf_4hf_n) * sizeof(struct htf_4hf_rec) ));
+}
+p = m_alloc(char, (int) (start[3] - start[2]) );
+
+
+(IGNORED) strcpy(p, start[2] );
+i = htf_4hf_n;
+while( i-- > 0 ){
+ if( htf_4hf[i].ch == value ){
+ free((void *) htf_4hf[i].str);
+ break;
+ } else {
+ if( (htf_4hf[i].ch < value)
+ || ((htf_4hf[i].ch > value) && (i==0)) ){
+ if( htf_4hf[i].ch < value ){ i++; }
+ htf_4hf_n++;
+ for( j=htf_4hf_n; j>i; j-- ){
+ htf_4hf[j].ch = htf_4hf[j-1].ch;
+ htf_4hf[j].str = htf_4hf[j-1].str;
+ htf_4hf[j].type1 = htf_4hf[j-1].type1;
+ htf_4hf[j].type2 = htf_4hf[j-1].type2;
+ }
+ break;
+} } }
+if(i == -1){ i = htf_4hf_n; }
+if(i == htf_4hf_n){ htf_4hf_n++; }
+htf_4hf[i].str = p;
+htf_4hf[i].ch = value;
+
+value = 0;
+p = start[1];
+while( *p != '\0' ){
+ if( (*p < '0') || (*p > '9') ) break;
+ value = value * 10 + *p - '0';
+ p++;
+}
+htf_4hf[i].type1 = value;
+
+
+value = 0;
+p = start[3];
+while( *p != '\0' ){
+ if( (*p < '0') || (*p > '9') ) break;
+ value = value * 10 + *p - '0';
+ p++;
+}
+htf_4hf[i].type2 = value;
+
+
+
+
+ }
+ } } }
+ else { err = TRUE; }
+
+if( err ){
+ warn_i_int(48,line_no);
+ (IGNORED) printf( "%c", delimiter );
+ for( p=in; p != in_p; p++ ){
+ if( *p=='\0' ){
+ (IGNORED) printf("%c", delimiter);
+ if( p != in_p-1 ){ (IGNORED) printf(" %c", delimiter); }
+ }
+ else { (IGNORED) printf( "%c", *p ); }
+ }
+ (IGNORED) printf( "\n" );
+ err = FALSE;
+}
+
+
+ }
+ while( (chr != EOF) && (chr!='\n') ){
+ chr = (int) getc(file);
+ }
+ if( chr == EOF ){ break; }
+}
+
+
+ put_4ht_off = 0;
+ } else{ put_4ht_off = 1;
+max_charset_n = 0;
+
+
+max_htf_4hf_n = 0;
+
+ }
+}
+
+
+ while( (ch = get_char()) !=
+249
+ ){
+
+#ifdef MAXFONTS
+if( (font_tbl_size + 1) < MAXFONTS )
+#endif
+{
+ INTEGER new_font_checksum;
+ int font_name_n;
+ font_tbl = font_tbl_size?
+ (struct font_entry *) r_alloc((void *) font_tbl,
+ (size_t) ((font_tbl_size+1)*sizeof(struct font_entry)))
+ : m_alloc(struct font_entry, 1);
+
+switch( ch ){
+ case
+243
+:
+ case
+244
+:
+ case
+245
+: {
+ new_font.num = (INTEGER)
+ get_unt(ch -
+243
+ + 1); break; }
+ case
+246
+: {
+ new_font.num = (INTEGER) get_int(4); break; }
+ default: err_i(8);
+}
+
+
+ new_font_checksum = (INTEGER) get_int(4);
+ new_font.scale = (INTEGER) get_unt(4);
+ new_font.design_sz = (INTEGER) get_unt(4);
+
+{ int n, area_ln;
+ U_CHAR *ch;
+ area_ln = (int) get_unt(1);
+ n = area_ln + (font_name_n = (int) get_unt(1)) + 1;
+ ch = new_font_name = m_alloc(char, n);
+ while( --n ){ *ch = (int) get_unt(1); ch++; }
+ *ch = '\0';
+}
+
+
+
+
+{ int i;
+ for( i=font_tbl_size-1; i>0; i-- )
+ if( new_font.num == font_tbl[i].num ) warn_i(10); }
+
+
+
+{ FILE *font_file;
+ U_CHAR file_name[256];
+
+{
+ font_file = NULL;
+ (IGNORED) sprintf(file_name, "%s.tfm", new_font_name);
+
+#ifdef KPATHSEA
+{
+ U_CHAR * tfmname;
+ tfmname = kpse_find_file (file_name, kpse_tfm_format, 0);
+ if ( tfmname ){
+ (IGNORED) printf("(%s)\n", tfmname);
+ font_file = kpse_open_file (tfmname, kpse_tfm_format);
+ }
+}
+#else
+
+
+
+for( cur_cache_font = cache_font;
+ cur_cache_font;
+ cur_cache_font = cur_cache_font->next )
+ if( (font_file = search_file(file_name,
+ cur_cache_font->dir,
+ READ_BIN_FLAGS))
+ != NULL) break;
+
+
+ if( !font_file ){ int i;
+ for( i = fontdir_count; i--; ){
+ if( (font_file = search_file_base(file_name, fontdir[i],
+ READ_BIN_FLAGS, tfm_dirs))
+ != NULL ) break; }
+ }
+ if( !font_file ) font_file = f_open(file_name, READ_BIN_FLAGS);
+ if( !font_file && dot_file )
+ font_file = search_in_dot_file( 't', file_name,
+ READ_BIN_FLAGS, tfm_dirs);
+
+#ifdef TFMDIR
+ if( !font_file )
+ font_file = search_file_base(file_name, TFMDIR,
+ READ_BIN_FLAGS, tfm_dirs);
+#endif
+
+
+
+#endif
+
+
+}
+
+
+ if( font_file == NULL ){
+ dump_env(); err_i_str(1,file_name);
+ missing_fonts = TRUE;
+ new_font.char_f = 2;
+ new_font.char_l = 1;
+ } else {
+
+{
+ INTEGER file_length;
+ int header_length,
+ it_correction_table_length,
+ lig_kern_table_length,
+ kern_table_length,
+ extensible_char_table_length,
+ num_font_parameters;
+
+
+
+file_length = (INTEGER) fget_int(font_file,2);
+header_length = (int) fget_int(font_file,2);
+new_font.char_f = (int) fget_int(font_file,2);
+new_font.char_l = (int) fget_int(font_file,2);
+new_font.wtbl_n = (int) fget_int(font_file,2);
+new_font.htbl_n = (int) fget_int(font_file,2);
+new_font.dtbl_n = (int) fget_int(font_file,2);
+it_correction_table_length = (int) fget_int(font_file,2);
+lig_kern_table_length = (int) fget_int(font_file,2);
+kern_table_length = (int) fget_int(font_file,2);
+extensible_char_table_length = (int) fget_int(font_file,2);
+num_font_parameters = (int) fget_int(font_file,2);
+if( file_length != ( 6 + header_length
+ - new_font.char_f + new_font.char_l + 1
+ + new_font.wtbl_n + new_font.htbl_n
+ + new_font.dtbl_n + it_correction_table_length
+ + lig_kern_table_length + kern_table_length
+ + extensible_char_table_length + num_font_parameters )
+ ) err_i_str(15,file_name);
+
+
+
+
+{ INTEGER checksum;
+ checksum = ( INTEGER) fget_int(font_file,4);
+ if( checksum && new_font_checksum
+ && (checksum != new_font_checksum) )
+ { warn_i(16);
+ (IGNORED) fprintf(stderr,"%s: %d\ndvi file: %d\n",file_name,
+ checksum, new_font_checksum);
+} }
+
+
+
+new_font.design_pt = ( INTEGER) fget_int(font_file,4);
+
+
+(IGNORED) fseek(font_file, (long) ((header_length - 2) * 4),
+1
+);
+
+
+
+{ U_CHAR *ch, *hidp;
+ int i;
+ ch = new_font.char_wi = m_alloc(char, new_font.char_l
+ - new_font.char_f + 1);
+ hidp = new_font.char_hidp = m_alloc(char, new_font.char_l
+ - new_font.char_f + 1);
+ for( i = new_font.char_f; i <= new_font.char_l; i++ ){
+ *(ch++) = (int) fget_unt(font_file,1);
+ *(hidp++) = (int) fget_unt(font_file,1);
+ (IGNORED) fseek(font_file, 2L,
+1
+);
+ }
+}
+
+
+
+{ INTEGER *p;
+ int i;
+ p = new_font.wtbl = m_alloc( INTEGER, new_font.wtbl_n);
+ for( i = 0; i < new_font.wtbl_n; i++ ){
+ *(p++) = ( INTEGER) fget_int(font_file,4);
+} }
+
+
+
+{ INTEGER *p;
+ int i;
+ p = new_font.htbl = m_alloc( INTEGER, new_font.htbl_n);
+ for( i = 0; i < new_font.htbl_n; i++ ){
+ *(p++) = ( INTEGER) fget_int(font_file,4);
+} }
+
+
+{ INTEGER *p;
+ int i;
+ p = new_font.dtbl = m_alloc( INTEGER, new_font.dtbl_n);
+ for( i = 0; i < new_font.dtbl_n; i++ ){
+ *(p++) = ( INTEGER) fget_int(font_file,4);
+} }
+
+
+
+
+
+(IGNORED) fseek(font_file, (long) (it_correction_table_length * 4),
+
+1
+);
+
+
+
+(IGNORED) fseek(font_file, (long) (lig_kern_table_length * 4),
+
+1
+);
+
+
+
+
+(IGNORED) fseek(font_file, (long) (kern_table_length * 4),
+
+1
+);
+
+
+
+(IGNORED) fseek(font_file, (long) (extensible_char_table_length * 4),
+
+1
+);
+
+
+
+
+new_font.it = ( INTEGER) fget_int(font_file,4);
+
+
+
+new_font.word_sp = ( INTEGER) fget_int(font_file,4);
+
+if( new_font.word_sp == 0 ) {
+ int i;
+ for( i = new_font.char_f; i <= new_font.char_l; i++ ){
+ new_font.word_sp =
+ ( new_font.word_sp
+ +
+ *(new_font.wtbl + (int)(*(new_font.char_wi + i - new_font.char_f)))
+ ) / (new_font.char_f<i? 2:1);
+ } }
+if( new_font.word_sp == 0 ) new_font.word_sp = MARGINSP;
+
+
+
+
+
+(IGNORED) fseek(font_file, 4L,
+1
+);
+
+
+
+(IGNORED) fseek(font_file, 4L,
+1
+);
+
+
+
+new_font.ex = (INTEGER) fget_int(font_file,4);
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+ (IGNORED) fclose(font_file);
+} }
+
+
+new_font_name[font_name_n] = '\0';
+new_font.name = m_alloc(char, font_name_n + 1);
+(IGNORED) strcpy( new_font.name, new_font_name );
+
+{ int n, i;
+ for( n=0; n<font_name_n; n++ ){
+ if( ( '0' <= new_font_name[n] ) && ( new_font_name[n] <= '9' )){
+ break;
+ }
+ }
+
+{ int m;
+ for( m=n; m<font_name_n; m++ ){
+ if( ( new_font_name[m] < '0' ) || ( new_font_name[m] > '9' )){
+ n=font_name_n;
+ break;
+} } }
+
+
+ new_font.family_name = m_alloc(char, n + 2);
+ new_font.font_size = m_alloc(char, font_name_n - n + 1 );
+ for( i=0; i<n; i++ ){
+ new_font.family_name[i] = new_font_name[i];
+ }
+ new_font.family_name[i] = '\0'; i = 0;
+ while( n<font_name_n ){
+ new_font.font_size[i++] = new_font_name[n++];
+ }
+ new_font.font_size[i] = '\0';
+}
+
+
+
+new_font.mag = new_font.scale / (new_font.design_sz / 100);
+
+
+
+
+
+{ U_CHAR str[256];
+ int i, design_n, n_gif;
+
+int loopBound = 0;
+U_CHAR loopName[256];
+loopName[0] = '\0';
+
+
+ n_gif = new_font.char_l - new_font.char_f + 1;
+ new_font.ch255 = 0;
+
+{ int n_gif_bytes;
+ n_gif_bytes = (n_gif + 7) / 8;
+ new_font.gif_on = m_alloc(char, n_gif_bytes );
+ new_font.ch_str = m_alloc(char, n_gif_bytes );
+
+new_font.math_closing = m_alloc(char, n_gif_bytes );
+new_font.math = m_alloc(char, n_gif );
+
+
+ for( i=n_gif_bytes; i--; ) {
+
+new_font.math_closing[i] =
+
+ new_font.ch_str[i] = new_font.gif_on[i] = 0;
+ }
+ new_font.gif1 = m_alloc(unsigned char, n_gif );
+ for( i=n_gif; i--; ) {
+
+new_font.math[i] =
+
+ new_font.gif1[i] = 0;
+} }
+
+
+
+new_font.accent = m_alloc(unsigned char, n_gif );
+new_font.accented = m_alloc(unsigned char, n_gif );
+new_font.accent_array = (unsigned int *) 0;
+new_font.accented_array = (unsigned int *) 0;
+new_font.accent_N = new_font.accented_N = 0;
+for( i=n_gif; i--; ) {
+ new_font.accent[i] = new_font.accented[i] = 0;
+}
+
+
+ new_font.ch = m_alloc(unsigned char, n_gif );
+
+for( i = new_font.char_f; i <= new_font.char_l ; i++ ){
+ new_font.ch[i - new_font.char_f] =
+ (char) (((31<i) && (i<128))? i : ignore_ch);
+}
+
+
+ new_font.str = m_alloc(unsigned char*, n_gif);
+ new_font.str[0] = &null_str;
+ design_n = 0;
+
+while( 1 ){ BOOL flag;
+
+if( eq_str( new_font_name, loopName) ){
+ U_CHAR name[256];
+ (IGNORED) sprintf(name, "%s.htf", new_font_name);
+ err_i_str(1, name);
+} else {
+ (IGNORED) strcpy(loopName,new_font_name);
+}
+loopBound++;
+if( loopBound > 10 ){
+ U_CHAR name[256];
+ (IGNORED) sprintf(name, "%s.htf", new_font_name);
+ err_i_str(1, name);
+}
+
+
+ flag = TRUE;
+ for( ; font_name_n; font_name_n-- ){ FILE* file;
+ int char_f, char_l;
+ new_font_name[font_name_n] = '\0';
+
+{ U_CHAR name[256];
+ (IGNORED) sprintf(name, "%s.htf", new_font_name);
+
+ file = NULL;
+
+{
+ struct htf_com_rec *p;
+ p = htf_font_dir;
+ while( p ){
+ file = search_file_base(name, p->name, READ_TEXT_FLAGS, htf_dirs);
+ if( file ){
+#ifndef KPATHSEA
+ tex4ht_fls = TRUE;
+#endif
+ break;
+ }
+ p = p->next;
+ }
+}
+
+
+ if( !file ){
+ if( ((file = f_open(name, READ_TEXT_FLAGS)) == NULL) && dot_file )
+ file = search_in_dot_file( 'i', name, READ_TEXT_FLAGS, htf_dirs);
+#ifdef HTFDIR
+ if( !file ) file = search_file_base(name, HTFDIR,
+ READ_TEXT_FLAGS, htf_dirs);
+#endif
+
+
+#ifdef KPATHSEA
+ if( !file ){ U_CHAR * htfname;
+ htfname= kpse_find_file (name, kpse_program_text_format, 0);
+ if ( htfname ){
+
+{ U_CHAR * head, * tail, *p;
+ int n;
+
+n = (int) strlen(htfname);
+tail = head = m_alloc(char, n+1);
+(IGNORED) strcpy(head, htfname);
+while( n>11 ){
+ if( (*tail=='\\') || (*tail=='/') ){
+ if( (*tail == *(tail+9)) && (*(tail+1) == 'h')
+ && (*(tail+2) == 't') && (*(tail+3) == '-')
+ && (*(tail+4) == 'f') && (*(tail+5) == 'o')
+ && (*(tail+6) == 'n') && (*(tail+7) == 't')
+ && (*(tail+8) == 's') ){
+ p = tail + 9; *(tail + 10) = '\0'; tail += 11;
+ while( (*tail != *p) && (*tail != '\0') ){ tail++; }
+ break;
+ } }
+ tail++; n--;
+}
+
+
+ htfname = (U_CHAR *) 0;
+
+for( n = 0 ; (n < cardinality) && !htfname ; n++){
+ p = tail;
+ while( *p != '\0' ){
+ char * s, *nm;
+ s = m_alloc(char, (int) strlen( head ) +
+ (int) strlen( fontset[n] ) +
+ (int) strlen( p ) + 1);
+ (IGNORED) strcpy(s,head);
+ (IGNORED) strcat(s,fontset[n]);
+ (IGNORED) strcat(s,p);
+ nm = kpse_find_file (s, kpse_program_text_format, 0);
+ free((void *) s);
+ if ( nm ){
+ htfname = nm; break;
+ }
+ p++;
+ while( (*p != '\\') && (*p != '/') && (*p != '\0') ){ p++; }
+} }
+
+
+}
+
+
+ if ( htfname ){
+ (IGNORED) printf("(%s)\n", htfname);
+ file= fopen(htfname,READ_TEXT_FLAGS);
+ } }
+ }
+#endif
+
+
+ }
+
+
+ if( file ){
+if( (strlen (new_font.family_name) +
+ strlen (new_font.font_size) + 4) == strlen (name) ){
+ new_font.family_name = (char *) r_alloc((void *) new_font.family_name,
+ (size_t) (strlen (name)+1));
+ (IGNORED) strcat(new_font.family_name,new_font.font_size);
+ *(new_font.font_size)='\0';
+}
+
+ }
+}
+
+
+ if( file != NULL){
+ INTEGER x_char_l;
+
+x_char_l =
+ get_html_file_id(file, new_font.char_f, new_font.char_l, 19);
+if( x_char_l != HTF_ALIAS) {
+ char_f = (int) (x_char_l / 1000.0 + 0.5) + new_font.char_f;
+ x_char_l -= (char_f-new_font.char_f) * 1000 - new_font.char_l;
+ char_l = (int) x_char_l;
+}
+
+
+ if( x_char_l == HTF_ALIAS) {
+
+{ int chr;
+ char str[256];
+ font_name_n=0;
+ while( (chr = get_html_ch(file)) != '\n' ){
+ if( chr != ' ' ) str[font_name_n++] = chr;
+ }
+ str[font_name_n] = '\0';
+ if( eq_str( str, new_font_name) ){ err_i_str(20, new_font_name); }
+ (IGNORED) printf("Searching `%s.htf' for `%s.htf'\n",
+ str, new_font.name);
+ htf_to_lg(html_font, new_font_name, fonts_n, file);
+ new_font_name = (char *) r_alloc((void *) new_font_name,
+ (size_t) (font_name_n+1));
+ (IGNORED) strcpy(new_font_name,str);
+ font_name_n = strlen (new_font_name);
+}
+
+
+ (IGNORED) fclose(file); flag = FALSE; break;
+ }
+
+if( char_f <= new_font.char_l ){ U_CHAR del;
+ int j, n;
+
+while( char_f < new_font.char_f ){
+ while( get_html_ch(file) != '\n' );
+ char_f++; }
+
+
+ n = ((char_l < new_font.char_l)? char_l : new_font.char_l)
+ - char_f + 1;
+ for( i = char_f - new_font.char_f; i < n; i++ ){
+
+{ int indirect_ch, base, value, digit, ch1;
+ indirect_ch = 0;
+ del = get_html_ch(file); j=0;
+ while( (str[j++] = get_html_ch(file)) != del )
+ {
+if( (digit=str[j-1]) == '\\' )
+ if( (indirect_ch = !indirect_ch) != 0) {
+ switch( value=get_html_ch(file) ){
+ case 'x': { base = 16; value = 0; j--; break; }
+ case 'o': { base = 8; value = 0; j--; break; }
+ default: {
+ if( (value < '0') || (value > '9') ) {
+ indirect_ch = !indirect_ch; str[j-1] = value;
+ } else { value -= '0'; base = 10; j--; }
+ } } }
+ else{ if( value>255 ){
+ warn_i_int(28,value);
+ value = 32; dump_htf( file );
+ }
+ str[j-1] = value;
+ }
+else if ( indirect_ch ){
+ j--; digit -= (digit>'9')? 'A'-10 : '0';
+ if( (digit<0) || (digit>=base) ){
+ warn_i_int(29, str[j]);
+ digit = 0; dump_htf( file );
+ }
+ value = value*base + digit;
+} else if ( str[j-1]==10 ){
+ dump_htf( file );
+ err_i_int(48, i+1);
+}
+
+ };
+ str[j-1] = '\0';
+ while( get_html_ch(file) != del );
+ ch1 = 0;
+ while( ((ch = (int) get_html_ch(file)) != del) ){
+ if( (ch < '0') || (ch > '9') ) break;
+ ch1 = ch1 * 10 + ch - '0'; }
+
+if(
+ (*str == '&')
+ && (*(str+1) == '#')
+ && ( (*(str+2) == 'x') || (*(str+2) == 'X'))
+ && (*(str + strlen(str) - 1) == ';')
+) {
+ char* p;
+ int value = 0;
+ BOOL err = FALSE;
+ for( p=str+3; *p!=';'; p++){
+ int digit = (int) *p;
+ if( (digit>='0') && (digit<='9') ){ digit -= '0'; }
+ else if( (digit>='A') && (digit<='F') ){ digit -= BASE_A; }
+ else if( (digit>='a') && (digit<='f') ){ digit -= BASE_a; }
+ else { digit=0; err = TRUE; }
+ value = 16*value + digit;
+ }
+ if( !err ){
+
+ int bottom, mid, top;
+ BOOL found=FALSE;
+bottom = 0; top = htf_4hf_n;
+while( !found ){
+ mid = (bottom + top) / 2;
+ if( value == htf_4hf[mid].ch ){
+
+if( htf_4hf[mid].type1 == ch1 ){
+ ch1 = htf_4hf[mid].type2;
+ (IGNORED) strcpy(str, htf_4hf[mid].str );
+}
+
+
+ found = TRUE;
+ } else if( value < htf_4hf[mid].ch ){
+ if( bottom == top ){ break; }
+ top = mid;
+ }
+ else {
+ if ( bottom < mid ){ bottom = mid; }
+ else if ( bottom<top ){ bottom++; }
+ else{ break; }
+ }
+}
+
+
+
+} }
+
+
+ new_font.gif1[i] = ch1 % 256;
+ do{
+ if( (ch = get_html_ch(file)) == del ){
+
+ch1 = 0;
+while( ((ch = (int) get_html_ch(file)) != del) ){
+ if( (ch < '0') || (ch > '9') ){ warn_i_int(48,i); break; }
+ ch1 = ch1 * 10 + ch - '0'; }
+new_font.accent_array = new_font.accent_N++?
+ (unsigned int *) r_alloc((void *) new_font.accent_array,
+ (size_t) (new_font.accent_N * sizeof(unsigned int)))
+ : m_alloc(unsigned int, 1);
+new_font.accent_array[new_font.accent_N - 1] = ch1;
+new_font.accent[i] = new_font.accent_N;
+
+ break;
+ }
+ } while( ch != '\n' );
+ if( ch != '\n' ){
+ do{
+ if( (ch = get_html_ch(file)) == del ){
+
+ch1 = 0;
+while( ((ch = (int) get_html_ch(file)) != del) ){
+ if( (ch < '0') || (ch > '9') ){ warn_i_int(48,i); break; }
+ ch1 = ch1 * 10 + ch - '0'; }
+new_font.accented_array = new_font.accented_N++?
+ (unsigned int *) r_alloc((void *) new_font.accented_array,
+ (size_t) (new_font.accented_N * sizeof(unsigned int)))
+ : m_alloc(unsigned int, 1);
+new_font.accented_array[new_font.accented_N - 1] = ch1;
+new_font.accented[i] = new_font.accented_N;
+
+ break;
+ }
+ } while( ch != '\n' );
+ }
+ if( ch != '\n' )
+ { while( get_html_ch(file) != '\n' ); }
+}
+
+
+
+add_bit( new_font.ch_str, i, j!=2 );
+switch( j ){
+ case 1: { new_font.ch[i] = 0; break; }
+ case 2: { new_font.ch[i] = *str; break; }
+ default: { unsigned U_CHAR *p;
+ new_font.str[design_n] = p = m_alloc(unsigned char, j);
+ if( design_n>255 ){ design_n--; warn_i(35);}
+ if( i==255 ){
+ if( design_n == 255 ){
+ new_font.ch[i] = 0; new_font.ch255 = 1;
+ } else { new_font.ch[i] = ++design_n; }
+ } else { new_font.ch[i] = ++design_n; }
+ while( j-- ) p[j] = str[j];
+} }
+
+ }
+
+while( char_l > new_font.char_l ){
+ while( get_html_ch(file) != '\n' );
+ char_l--; }
+
+
+}
+
+
+
+(void) get_html_file_id(file, new_font.char_f, new_font.char_l, 18);
+
+
+ htf_to_lg(html_font, new_font_name, fonts_n, file);
+
+if( dump_htf_files ){
+ dump_htf_files++; dump_htf( file ); dump_htf_files--;
+}
+
+
+ (IGNORED) fclose(file); break;
+ } }
+ if( flag ){ break; }
+}
+if( font_name_n == 0 ){
+ warn_i_str(21,new_font.name);
+ (IGNORED) fprintf(stderr,
+ "%d--%d)\n", new_font.char_f, new_font.char_l);
+ dump_env();
+} else {
+if( dump_env_files ){ dump_env(); }
+
+ }
+
+
+ new_font.str = (unsigned U_CHAR **) r_alloc((void *) new_font.str,
+ (size_t) ( (design_n?design_n:1) * sizeof(char *)) );
+
+for( i = fonts_n; i--; )
+ if( eq_str(html_font[i].name, new_font_name) ){ int k;
+ k = html_font[i].i;
+ free((void *) new_font.gif1 ); new_font.gif1= font_tbl[ k ].gif1;
+ free((void *) new_font.ch ); new_font.ch = font_tbl[ k ].ch;
+ free((void *) new_font.str ); new_font.str = font_tbl[ k ].str;
+ free((void *) new_font.ch_str );
+ new_font.ch_str = font_tbl[ k ].ch_str;
+
+free((void *) new_font.math_closing );
+ new_font.math_closing = font_tbl[ k ].math_closing;
+free((void *) new_font.math );
+ new_font.math = font_tbl[ k ].math;
+
+
+ break; }
+if( i < 0 ){
+html_font = fonts_n? (struct html_font_rec *) r_alloc((void *) html_font,
+ (size_t) ((fonts_n+1) * sizeof(struct html_font_rec) ))
+ : m_alloc(struct html_font_rec, 1);
+html_font[fonts_n].name = m_alloc(char, font_name_n + 1);
+(IGNORED) strcpy(html_font[fonts_n].name, new_font_name);
+html_font[fonts_n].i = font_tbl_size;
+fonts_n++;
+
+ }
+
+
+}
+
+
+ free((void *) new_font_name); font_tbl_size++;
+}
+#ifdef MAXFONTS
+ else err_i_int(17, MAXFONTS);
+#endif
+
+
+ }
+
+
+#ifdef KPATHSEA
+if( export_str_chars ){
+ free((void *) export_str_chars);
+ free((void *) fontset);
+}
+#endif
+
+
+for( i = 0; i<htf_4hf_n; i++){
+ free((void *) htf_4hf[i].str);
+}
+free((void *) htf_4hf);
+
+
+ if( missing_fonts ) err_i(14);
+#ifndef KPATHSEA
+
+if( cache_files != (FILE *) 0 ){ (IGNORED) fclose(cache_files); }
+
+
+
+if( tex4ht_fls ){
+ FILE *in_file, *out_file;
+ U_CHAR temp_file[256];
+
+(IGNORED) strcpy(temp_file,job_name);
+temp_file[job_name_n] = '\0';
+temp_file[job_name_n-1] = 'p';
+temp_file[job_name_n-2] = 'm';
+temp_file[job_name_n-3] = 't';
+
+
+
+if( (out_file = fopen(temp_file, WRITE_TEXT_FLAGS)) == NULL )
+{ bad_in_file(temp_file);
+} else {
+ if( (in_file = fopen(tex4ht_fls_name, READ_TEXT_FLAGS)) != NULL ){
+ int ch;
+ while( (ch = getc(in_file)) != EOF ) {
+ (IGNORED) putc( ch, out_file );
+ }
+ (IGNORED) fclose(in_file);
+ }
+ (IGNORED) fclose(out_file);
+}
+
+
+ if( (out_file = fopen(tex4ht_fls_name, WRITE_TEXT_FLAGS)) == NULL )
+ { bad_in_file(tex4ht_fls_name);
+ } else {
+ if( (in_file = fopen(temp_file, READ_TEXT_FLAGS)) != NULL ){
+
+ U_CHAR dir[255], prev_dir[255], file[255], *p;
+ int ch;
+ BOOL is_dir;
+ struct cache_file_rec *file_rec, *prev_file_rec;
+cur_cache_font = cache_font;
+ch = 'n'; prev_dir[0] = '\0';
+while( ch != EOF ){
+ ch = getc(in_file);
+ is_dir = (ch == ' ');
+ p = is_dir? dir : file;
+ while( ch != '\n' ) {
+ if( ch == EOF ) break;
+ if( ch != ' ' ) { *p++ = ch; }
+ ch = getc(in_file);
+ }
+ *p = '\0';
+ if( is_dir && (dir[0] != '\0') ){
+
+while( cur_cache_font != (struct cache_font_rec *)0 ){
+ if( gt_str(dir,cur_cache_font->dir) ){
+
+file_rec = cur_cache_font->cache_file;
+if( file_rec ){
+ if( !eq_str( prev_dir, cur_cache_font->dir) ){
+ (IGNORED) fprintf(out_file, " %s\n", cur_cache_font->dir);
+ (IGNORED) strcpy(prev_dir,dir);
+ }
+ cur_cache_font->cache_file = (struct cache_file_rec *) 0;
+ while( file_rec ) {
+ prev_file_rec = file_rec;
+ file_rec = file_rec->next;
+ (IGNORED) fprintf(out_file, "%s\n", prev_file_rec->file);
+ free((void *) prev_file_rec );
+ }
+}
+
+
+ } else break;
+ cur_cache_font = cur_cache_font->next;
+}
+
+
+ (IGNORED) fprintf(out_file," %s\n", dir);
+ (IGNORED) strcpy(prev_dir,dir);
+ } else if( !is_dir && (file[0] != '\0') ){
+
+if( cur_cache_font != (struct cache_font_rec *)0 ){
+ if( eq_str(dir,cur_cache_font->dir) ){
+ file_rec = cur_cache_font->cache_file;
+ while( file_rec ) {
+ if( gt_str(file_rec->file,file) ){ break; }
+ else if( gt_str(file,file_rec->file) ){
+ (IGNORED) fprintf(out_file, "%s\n", file_rec->file);
+ }
+ prev_file_rec = file_rec;
+ file_rec = file_rec->next;
+ free((void *) prev_file_rec );
+ }
+ cur_cache_font->cache_file = file_rec;
+ }
+}
+
+
+ (IGNORED) fprintf(out_file,"%s\n", file);
+ }
+}
+
+while( cur_cache_font != (struct cache_font_rec *)0 ){
+
+file_rec = cur_cache_font->cache_file;
+if( file_rec ){
+ if( !eq_str( prev_dir, cur_cache_font->dir) ){
+ (IGNORED) fprintf(out_file, " %s\n", cur_cache_font->dir);
+ (IGNORED) strcpy(prev_dir,dir);
+ }
+ cur_cache_font->cache_file = (struct cache_file_rec *) 0;
+ while( file_rec ) {
+ prev_file_rec = file_rec;
+ file_rec = file_rec->next;
+ (IGNORED) fprintf(out_file, "%s\n", prev_file_rec->file);
+ free((void *) prev_file_rec );
+ }
+}
+
+
+ cur_cache_font = cur_cache_font->next;
+}
+
+
+
+
+ (IGNORED) fclose(in_file);
+ }
+ (IGNORED) fclose(out_file);
+} }
+
+
+#endif
+
+if( html_font ){
+ while( fonts_n-- ) free((void *) html_font[fonts_n].name);
+ free((void *) html_font );
+}
+
+
+while( (cur_cache_font = cache_font) != (struct cache_font_rec *)0 ){
+ cache_font = cache_font->next;
+ free((void *) cur_cache_font->dir );
+ free((void *) cur_cache_font ); }
+
+
+}
+
+
+ (IGNORED) fclose(dot_file);
+}
+
+(IGNORED) fseek(dvi_file, 0L,
+0
+);
+ch = get_noop();
+if( ch !=
+247
+ ) bad_dvi;
+if( get_char() !=
+2
+ ) bad_dvi;
+(void) get_unt(4);
+(void) get_unt(4);
+ (void) get_unt(4);
+for( i= get_char(); i>0; i-- ) ch = get_char();
+
+
+
+{
+ dis_pages = unread_pages;
+ while( unread_pages-- ){
+ (IGNORED) printf("[%d", dis_pages - unread_pages);
+
+x_val = dx_1 = dx_2 = 0; max_x_val = -10000;
+y_val = max_y_val = prev_y_val = dy_1 = dy_2 = 0;
+
+
+ if( get_noop() !=
+139
+ ) bad_dvi;
+ for( i = 1; i<45; i++ )
+ if( get_char() == EOF ) bad_dvi;
+ while( (ch = get_char()) !=
+140
+ ){
+
+{ register int ch_1;
+ ch_1 = ch;
+
+if( stack[stack_n].halign_on )
+{
+ switch( ch ){
+ case
+157
+: { ; }
+ case
+158
+: { ; }
+ case
+159
+: { ; }
+ case
+160
+: { ; }
+ case
+161
+: { ; }
+ case
+162
+: { ; }
+ case
+163
+: { ; }
+ case
+164
+: { ; }
+ case
+165
+: { ; }
+ case
+166
+: { ; }
+ case
+167
+: { ; }
+ case
+168
+: { ; }
+ case
+169
+: { ; }
+ case
+170
+: { ; }
+ case
+132
+: { ; }
+ case
+137
+: { ; }
+ case
+235
+: { ; }
+ case
+236
+: { ; }
+ case
+237
+: { ; }
+ case
+238
+: { ; }
+ case
+141
+:
+ { break; }
+ default: {
+print_f( stack[stack_n].halign[1]->str );
+stack[stack_n].halign_on = FALSE;
+
+ }
+} }
+
+
+
+if( (ch > 127) && (ch < 137) && (ch !=
+132
+) ){
+ ch_1 = (int) get_unt( (ch - (ch>132)) % 4 +1);
+}
+
+
+
+if( group_dvi ){
+ if( ( ch < 132 ) ||
+ ( (ch > 127) && (ch < 137) && (ch !=
+132
+ ) )
+ ){
+ ch_id++;
+ back_token = back_insert ( back_token, ch_id);
+} }
+
+
+
+if( trace_dvi_C && !in_trace_char ){
+ if( (ch < 137) && (ch !=
+132
+) ){
+ in_trace_char = TRUE; block_start = TRUE;
+} }
+else if ( in_trace_char ){
+ if( !trace_dvi_C || (ch > 136) || (ch ==
+132
+) ){
+ in_trace_char = FALSE;
+} }
+
+
+
+if( span_on && !in_span_ch && !ignore_chs && !in_accenting
+ && (default_font != font_tbl[cur_fnt].num) ){
+ if( (ch < 137) && (ch !=
+132
+) ){
+ in_span_ch = TRUE; start_span = TRUE;
+} }
+else if ( in_span_ch ){
+ if( !span_on ||
+ (ch ==
+132
+) ||
+ ((136 < ch) && (ch <
+143
+)) ||
+ (ch >
+156
+)
+ ){
+ in_span_ch = FALSE;
+ if( *end_span[0] ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, end_span[0]);
+ }
+} }
+
+
+
+if( in_accenting ){
+
+ long int width;
+if( i_accent_template ){
+ (IGNORED) fprintf(cur_o_file, i_accent_second); }
+needs_end_accent = (needs_accent_sym == 2 * TRUE);
+if( needs_end_accent && t_accent_template )
+{
+needs_accented_sym++;
+
+ }
+else if( m_accent_template )
+{
+needs_accented_sym++;
+
+ stack[stack_n-1].accented = TRUE; }
+needs_accent_sym = FALSE;
+width = (INTEGER)(
+design_size_to_pt( *(font_tbl[cur_fnt].wtbl
+ + (int) (
+*(font_tbl[cur_fnt].char_wi + (int)
+ ( ch - font_tbl[cur_fnt].char_f)% 256)
+
+) )
+ )
+* (double) font_tbl[cur_fnt].scale
+
+ );
+if( needs_end_accent ){ needs_end_accent = x_val + 9 * width / 10; }
+in_accenting = FALSE;
+
+
+} else if(
+needs_accent_sym && (ch < 128)
+
+ ){
+ if( needs_accent_sym ){
+ BOOL needs_end_accent;
+ needs_end_accent = (needs_accent_sym == 2 * TRUE);
+ if( needs_end_accent && t_accent_template ){
+ (IGNORED) fprintf(cur_o_file, "%s%s%s%d%s%d%s",
+ t_accent_first, font_tbl[cur_fnt].family_name,
+ t_accent_second, ch, t_accent_third,
+ font_tbl[cur_fnt].accent[ch]?
+ font_tbl[cur_fnt].accent_array[font_tbl[cur_fnt].accent[ch]-1]
+ : 0,
+ t_accent_fourth);
+ } else if( m_accent_template ){
+ (IGNORED) fprintf(cur_o_file, "%s%s%s%d%s%d%s",
+ m_accent_first, font_tbl[cur_fnt].family_name,
+ m_accent_second, ch, m_accent_third,
+ font_tbl[cur_fnt].accent[ch]?
+ font_tbl[cur_fnt].accent_array[font_tbl[cur_fnt].accent[ch]-1]
+ : 0,
+ m_accent_fourth);
+ }
+ if( i_accent_template ){
+ (IGNORED) fprintf(cur_o_file, i_accent_first); }
+ in_accenting = TRUE;
+ }
+}
+
+
+ if( ch < 132 ) {
+ x_val += math_class_on?
+set_ch_class(ch_1)
+
+
+ : insert_ch(ch_1);
+ if( max_x_val < x_val ) max_x_val = x_val;
+ } else switch( ch ) {
+ case 133: case 134: case 135: case 136: {
+ INTEGER w;
+ w = math_class_on?
+set_ch_class(ch_1)
+
+ : insert_ch(ch_1);
+ max_x_val = ( x_val + w > max_x_val )? x_val + w : max_x_val;
+ break;
+ }
+
+case
+143
+: {;}
+case
+144
+: {;}
+case
+145
+: {;}
+case
+146
+: {
+ try_new_line();
+ (void) move_x((INTEGER) get_int(ch -
+143
+ + 1 ));
+ break; }
+
+
+case
+147
+: {
+ (void) move_x( dx_1 ); break; }
+case
+148
+: {;}
+case
+149
+: {;}
+case
+150
+: {;}
+case
+151
+: {
+ try_new_line();
+ dx_1 = move_x((INTEGER) get_int(ch -
+147
+ ));
+ break; }
+
+
+case
+152
+: {
+ (void) move_x( dx_2 ); break; }
+case
+153
+: {;}
+case
+154
+: {;}
+case
+155
+: {;}
+case
+156
+: {
+ try_new_line();
+ dx_2 = move_x((INTEGER) get_int(ch -
+152
+ ));
+ break; }
+
+
+case
+157
+: {;}
+case
+158
+: {;}
+case
+159
+: {;}
+case
+160
+: {
+ (void) move_y( (INTEGER) get_int(ch -
+157
+ + 1 ));
+ break; }
+
+
+case
+161
+: { (void) move_y( dy_1 ); break; }
+case
+162
+: {;}
+case
+163
+: {;}
+case
+164
+: {;}
+case
+165
+: {
+ dy_1 = move_y( (INTEGER) get_int(ch -
+161
+ ));
+ break; }
+
+
+case
+166
+: { (void) move_y( dy_2 ); break; }
+case
+167
+: {;}
+case
+168
+: {;}
+case
+169
+: {;}
+case
+170
+: {
+ dy_2 = move_y( (INTEGER) get_int(ch -
+166
+ ));
+ break; }
+
+
+case
+132
+: {
+ (void) rule_x( TRUE ); break;
+}
+case
+137
+: {
+ (void) rule_x( FALSE ); break;
+}
+
+
+
+case
+246
+: (void) get_char();
+case
+245
+: (void) get_char();
+case
+244
+: (void) get_char();
+case
+243
+: {
+ for( i=0; i<14; i++ ) ch = get_char();
+ for( i=ch + get_char(); i>0; i--) (void) get_char();
+ break;
+}
+
+
+
+
+default: {
+ if( (ch <
+171
+) || (ch >
+234
+) ) {
+ bad_char(ch);
+ } else { cur_fnt = ch -
+171
+;
+
+cur_fnt = search_font_tbl( cur_fnt );
+word_sp =
+design_size_to_pt( font_tbl[cur_fnt].word_sp )
+ * (double) font_tbl[cur_fnt].scale
+
+;
+
+ }
+ break;
+}
+
+
+case
+235
+ :
+case
+236
+:
+case
+237
+:
+case
+238
+ : {
+ INTEGER n;
+ n = ch -
+235
+ + 1;
+ cur_fnt = (int) ((n==4)? get_int(4) : get_unt((int) n));
+
+cur_fnt = search_font_tbl( cur_fnt );
+word_sp =
+design_size_to_pt( font_tbl[cur_fnt].word_sp )
+ * (double) font_tbl[cur_fnt].scale
+
+;
+
+
+ break; }
+
+
+case
+239
+: {;}
+case
+240
+: {;}
+case
+241
+: {;}
+case
+242
+: {
+long int special_n;
+
+if( needs_end_accent && t_accent_template ){
+
+if( span_on && in_span_ch ){
+ if( *end_span[0] ){
+ in_span_ch = FALSE;
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, end_span[0]);
+} }
+
+
+ (IGNORED) fprintf(cur_o_file, t_accent_fifth);
+ needs_end_accent = FALSE;
+needs_accented_sym--;
+
+
+}
+
+
+ if( tex4ht_special( &ch, &special_n) ) { int sv; sv = ch;
+ special_on = TRUE;
+try_new_line();
+switch( ch ){
+ case '*': {
+if( special_n ){
+ special_n--;
+ switch ( get_char() ){
+ case '<': {
+ U_CHAR name[256];
+ int i=0;
+ FILE* file;
+name[(int) special_n] = '\0';
+while( special_n-- > 0 ){ name[i++] = get_char(); }
+file = f_open(name, READ_TEXT_FLAGS);
+if( file ) {
+
+if( no_root_file ){ open_o_file(); }
+
+
+ while( (ch = getc(file)) >=0 ){
+ (IGNORED) put_4ht_ch(ch,cur_o_file);
+ }
+ (IGNORED) fclose(file);
+} else { warn_i_str( 1, name ); }
+
+ break; }
+ case '>': {
+if( special_n > 0 ){
+
+ static struct files_rec *p, *q;
+ U_CHAR name[256];
+ int i;
+
+i = 0;
+name[(int) special_n] = '\0';
+while( special_n-- > 0 ){ name[i++] = get_char(); }
+for( p = opened_files; p != (struct files_rec*) 0; p = p->next ){
+ if( eq_str(p->name, name) ){ break; }
+}
+
+
+if( p != (struct files_rec*) 0 ){
+
+for( q = p; q->next != (struct files_rec*) 0; q = q->next ){ }
+if( q != p ){
+ q->next = p;
+ (p->next)->prev = p->prev;
+ if( opened_files == p ){ opened_files = p->next; }
+ else { (p->prev)->next = p->next; }
+ p->prev = q;
+ p->next = (struct files_rec*) 0;
+}
+
+
+}
+
+
+} else {
+
+
+ static struct files_rec *p, *q;
+for( p = opened_files; p != (struct files_rec*) 0; p = p->next ){
+ if( (p->file == cur_o_file) && p->prev_file ){
+
+for( q = opened_files; q != (struct files_rec*) 0; q = q->next ){
+ if( q->file == p->prev_file ){
+ break;
+ }
+}
+if( q == (struct files_rec*) 0 ){
+ warn_i_str(51,q->name);
+ break;
+}
+
+
+ cur_o_file = p->prev_file;
+ p->prev_file = (FILE *) 0;
+ break;
+ }
+}
+
+
+
+
+}
+
+ break; }
+ case '!': {
+ U_CHAR name[256], ch;
+ int i=0, n;
+ struct sys_call_rec *p;
+ BOOL flag;
+name[(int) special_n] = '\0';
+while( special_n-- > 0 ){ name[i++] = get_char(); }
+(IGNORED) printf("System call: %s\n", name);
+
+flag = FALSE;
+p = system_calls;
+while( p ){
+ if( (n = (int) strlen(p->filter)) == 1 ) {
+ flag = flag || (*(p->filter) == '*');
+ } if( strlen(name) >= (unsigned int) n ) {
+ ch = name[n]; name[n] = '\0';
+ flag = flag || eq_str(p->filter,name);
+ name[n] = ch;
+ }
+ p = p->next;
+}
+
+
+if( flag ){
+ (IGNORED) printf("System return: %d\n",
+ system_yes? (int) system(name) : -1 );
+} else { (IGNORED) printf("No permission for system call\n"); }
+
+ break; }
+ case '^': {
+special_n--;
+switch ( get_char() ){
+ case 't': { if( special_n ){
+
+(IGNORED) get_open_accent(&t_accent_template,
+ &t_accent_first, &t_accent_second,
+ &t_accent_third, &t_accent_fourth,
+ &t_accent_fifth, &special_n);
+
+
+ } else {
+needs_accent_sym = TRUE * 2;
+
+ }
+ break;
+ }
+ case 'm': { if( special_n ){
+
+(IGNORED) get_open_accent(&m_accent_template,
+ &m_accent_first, &m_accent_second,
+ &m_accent_third, &m_accent_fourth,
+ &m_accent_fifth, &special_n);
+
+
+ } else {
+needs_accent_sym = TRUE;
+
+ }
+ break;
+ }
+ case 'a': {
+(IGNORED) get_open_accent(&a_accent_template,
+ &a_accent_first, &a_accent_second,
+ &a_accent_third, &a_accent_fourth,
+ &a_accent_fifth, &special_n);
+
+
+ break;
+ }
+ case 'i': {
+(IGNORED) get_open_accent(&i_accent_template,
+ &i_accent_first, &i_accent_second,
+ &i_accent_third, &i_accent_fourth,
+ &i_accent_fifth, &special_n);
+
+
+ break;
+ }
+ default: {
+while( special_n-- ) (void) get_char();
+
+ }
+}
+
+ break; }
+ case '@': {
+ int i;
+i = 0;
+special_n--;
+switch ( get_char() ){
+ case '8': { i++; }
+ case '7': { i++; }
+ case '6': { i++; }
+ case '5': { i++; }
+ case '4': { i++; }
+ case '3': { i++; }
+ case '2': { i++; }
+ case '1': {
+if( halign[i]->refs == 1 ){
+ free((void *) halign[i]->str );
+} else {
+ (halign[i]->refs)--;
+ halign[i] = m_alloc(struct halign_rec, 1);
+ halign[i]->refs = 1;
+}
+halign[i]->str = get_str( (int) special_n );
+special_n=0;
+
+ break; }
+ case '/': { if( special_n ){
+
+while( special_n-- ) (void) get_char();
+
+
+ } else {
+if( stack[stack_n].halign_on )
+{
+print_f( stack[stack_n].halign[1]->str );
+stack[stack_n].halign_on = FALSE;
+
+ }
+
+ }
+ break;
+ }
+ case '&': { i++; }
+ case '@': { i++;
+ if( special_n ){
+
+while( special_n-- ) (void) get_char();
+
+
+ } else {
+
+new_halign = i * TRUE;
+
+
+ }
+ break;
+ }
+ default: {
+while( special_n-- ) (void) get_char();
+
+ }
+}
+
+ break; }
+ case '=': {
+ char *str, *repl;
+ struct hcode_repl_typ *p, *q;
+ BOOL flag;
+if( special_n ){
+ repl = str = m_alloc(char, (int) special_n + 1);
+ while( special_n-- > 0 ){
+ *str = get_char(); str++;
+ }
+ *str = 0;
+
+if( hcode_repl != (struct hcode_repl_typ*) 0 ){
+ if( *(hcode_repl->str) == *repl ){
+ p = hcode_repl;
+ hcode_repl = hcode_repl->next;
+ free((void *) p->str);
+ free((void *) p);
+ } else {
+ p = hcode_repl;
+ while( TRUE ){
+ q = p->next;
+ if( q == (struct hcode_repl_typ*) 0 ){ break; }
+ if( *(q->str) == *repl ){
+ p->next = q->next;
+ free((void *) q->str);
+ free((void *) q);
+ break;
+ }
+ p = q;
+} } }
+
+
+
+flag = *repl != *(repl+1);
+if( !flag ){ flag = *(repl+2) != 0; }
+if( flag ){
+ p = (struct hcode_repl_typ *) m_alloc(struct hcode_repl_typ, 1);
+ p->str = repl;
+ p->next = hcode_repl;
+ hcode_repl = p;
+}
+
+
+} else {
+
+while( hcode_repl != (struct hcode_repl_typ*) 0 ){
+ p = hcode_repl;
+ hcode_repl = hcode_repl->next;
+ free((void *) p->str);
+ free((void *) p);
+}
+
+
+}
+
+ break; }
+ default: {
+while( special_n-- ) (void) get_char();
+
+ }
+ }
+} else {
+;
+
+ }
+
+ break; }
+ case '@': {
+ int code, digit;
+special_n--;
+switch ( code = get_char() ){
+ case '%': {
+if( special_n>1 ) {
+ special_n--;
+ if ( get_char() == '%' ) {
+ if( special_n>2 ) {
+ U_CHAR type, ch, *p, *q, *pp, *qq, pre[256], post[256];
+special_n -= 2; type = get_char(); ch = get_char();
+p = pre;
+while( special_n-- > 0 ) {
+ if ( (*(p++)=get_char() ) == ch ) { p--; break; }
+}
+*p = '\0';
+p = post;
+while( special_n-- > 0 ) { *(p++)=get_char(); } *p='\0';
+
+
+p = m_alloc(char, 1 + (int) strlen(pre));
+(IGNORED) strcpy(p, pre );
+q = m_alloc(char, 1 + (int) strlen(post));
+(IGNORED) strcpy(q, post );
+
+
+switch ( type ){
+ case 'P': {
+ pp = trace_dvi_del_P; trace_dvi_del_P = p;
+ qq = end_trace_dvi_del_P; end_trace_dvi_del_P = q;
+ break; }
+ case 'C': {
+ pp = trace_dvi_del_C; trace_dvi_del_C = p;
+ qq = end_trace_dvi_del_C; end_trace_dvi_del_C = q;
+ break; }
+ case 'V': {
+ pp = trace_dvi_del_V; trace_dvi_del_V = p;
+ qq = end_trace_dvi_del_V; end_trace_dvi_del_V = q;
+ break; }
+ case 'H': {
+ pp = trace_dvi_del_H; trace_dvi_del_H = p;
+ qq = end_trace_dvi_del_H; end_trace_dvi_del_H = q;
+ break; }
+ case 'R': {
+ pp = trace_dvi_del_R; trace_dvi_del_R = p;
+ qq = end_trace_dvi_del_R; end_trace_dvi_del_R = q;
+ break; }
+ case 'p': {
+ pp = trace_dvi_del_p; trace_dvi_del_p = p;
+ qq = end_trace_dvi_del_p; end_trace_dvi_del_p = q;
+ break; }
+ case 'c': {
+ pp = trace_dvi_del_c; trace_dvi_del_c = p;
+ qq = end_trace_dvi_del_c; end_trace_dvi_del_c = q;
+ break; }
+ case 'v': {
+ pp = trace_dvi_del_v; trace_dvi_del_v = p;
+ qq = end_trace_dvi_del_v; end_trace_dvi_del_v = q;
+ break; }
+ case 'h': {
+ pp = trace_dvi_del_h; trace_dvi_del_h = p;
+ qq = end_trace_dvi_del_h; end_trace_dvi_del_h = q;
+ break; }
+ case 'r': {
+ pp = trace_dvi_del_r; trace_dvi_del_r = p;
+ qq = end_trace_dvi_del_r; end_trace_dvi_del_r = q;
+ break; }
+ default: { ; }
+}
+free((void *) pp);
+free((void *) qq);
+
+ }
+ else {
+while( special_n-- ) (void) get_char();
+
+ }
+ } else {
+while( special_n-- ) (void) get_char();
+
+ }
+} else if( special_n ) {
+ special_n--;
+ switch ( get_char() ){
+ case 'P': { trace_dvi_P++; break; }
+ case 'C': { trace_dvi_C++; break; }
+ case 'V': { trace_dvi_V++; break; }
+ case 'H': { trace_dvi_H++; break; }
+ case 'R': { trace_dvi_R++; break; }
+ case 'p': { trace_dvi_P--; break; }
+ case 'c': { trace_dvi_C--; break; }
+ case 'v': { trace_dvi_V--; break; }
+ case 'h': { trace_dvi_H--; break; }
+ case 'r': { trace_dvi_R--; break; }
+ default: { ; }
+} }
+
+ break; }
+ case '@': { verb_ch = !verb_ch; break; }
+ case '/': {
+trace_special = !trace_special;
+
+ break; }
+ case 'e': {
+if( err_mark ){ free((void *) err_mark); }
+if( special_n ){
+ err_mark = get_str( (int) special_n ); special_n=0;
+} else { err_mark = (char *) 0; }
+
+ break; }
+ case '!': {
+while( recover_spaces-- ){ text_on=TRUE; put_char(' '); }
+recover_spaces = 0;
+
+ break; }
+ case '(': {
+ignore_spaces++;
+
+ break; }
+ case ')': {
+ignore_spaces--;
+
+ break; }
+ case '[': {
+if( special_n ){
+
+U_CHAR *unhskip_mark;
+long retract_addr;
+BOOL unhskip;
+int cr_fnt, ch, unskip_depth;
+
+
+ cr_fnt = cur_fnt;
+ unskip_depth = 0;
+ unhskip_mark = get_str( (int) special_n ); special_n=0;
+ retract_addr = ftell(dvi_file);
+
+unhskip = TRUE;
+while( unhskip ){
+ if( (ch = get_char()) >= 128 ) {
+ switch( ch ){
+
+case
+246
+: (void) get_char();
+case
+245
+: (void) get_char();
+case
+244
+: (void) get_char();
+case
+243
+: { int i;
+ for( i=14; i; i-- ){ ch = get_char(); }
+ i = ch + get_char();
+ (IGNORED) fseek(dvi_file, (long) i,
+1
+);
+ break; }
+
+
+
+case
+132
+:
+case
+137
+:{
+ (IGNORED) fseek(dvi_file, 8L,
+1
+);
+ break;
+}
+
+
+case
+139
+: {
+ (IGNORED) fseek(dvi_file, 44L,
+1
+); break; }
+
+
+case
+143
+: case
+144
+:
+case
+145
+: case
+146
+: {
+ (IGNORED) (get_int( ch -
+143
+ + 1 )); break; }
+case
+148
+:
+case
+149
+:
+case
+150
+:
+case
+151
+: {
+ (IGNORED) (get_int( ch -
+148
+ + 1));
+ break; }
+case
+153
+:
+case
+154
+:
+case
+155
+:
+case
+156
+: {
+ (IGNORED) (get_int( ch -
+153
+ + 1));
+ break; }
+case
+157
+: case
+158
+:
+case
+159
+: case
+160
+: {
+ (IGNORED) (get_int( ch -
+157
+ + 1));
+ break; }
+case
+162
+:
+case
+163
+:
+case
+164
+:
+case
+165
+: {
+ (IGNORED) (get_int( ch -
+162
+ + 1));
+ break; }
+case
+167
+:
+case
+168
+:
+case
+169
+:
+case
+170
+: {
+ (IGNORED) (get_int( ch -
+167
+ + 1));
+ break; }
+
+
+case
+147
+:
+case
+152
+:
+case
+161
+:
+case
+166
+:
+ { break; }
+
+
+
+case 128: case 129: case 130: case 131: case 133:
+case 134: case 135: case 136: {
+ (void) get_unt( (ch-(ch>132)) % 4 +1);
+ break;
+}
+
+
+
+case
+141
+:
+case
+142
+: { break; }
+
+
+
+case
+239
+: case
+240
+:
+case
+241
+: case
+242
+: { long int i;
+ if( tex4ht_special( &ch, &i ) ){ char *mark;
+ mark = get_str( (int) i );
+ if( i ){
+ if( (ch=='@') && eq_str(mark+1,unhskip_mark) ){
+ switch( *mark ){
+ case '[': { unskip_depth++; break; }
+ case ']': {
+ unhskip = !(--unskip_depth);
+ break;
+ }
+ default: { ; }
+ } } }
+ }else{
+ U_CHAR *ch;
+ch = special_hd + 4;
+while( *ch ){ ch++; }
+(IGNORED) fseek(dvi_file, (long) i,
+1
+);
+
+ }
+ break;
+}
+
+
+
+case
+235
+:
+case
+236
+:
+case
+237
+:
+case
+238
+: {
+ INTEGER n;
+ n = ch -
+235
+ + 1;
+ cr_fnt = (int) ((n==4)? get_int(4) : get_unt((int) n));
+ cr_fnt = search_font_tbl( cr_fnt );
+ break; }
+default: {
+ if( (ch <
+171
+) || (ch >
+234
+) ) {
+ if( ch ==
+140
+ ) { warn_i(46); }
+ else { warn_i_int(45,ch); }
+ } else { cr_fnt = ch -
+171
+;
+ cr_fnt = search_font_tbl( cr_fnt );
+ }
+ break;
+}
+
+
+ }
+} }
+
+do{
+ long int i;
+ char *mark;
+ ch = get_char();
+ if(
+ ( ch==
+239
+) || ( ch==
+240
+) ||
+ ( ch==
+241
+) || ( ch==
+242
+)
+ )
+ {
+ if( tex4ht_special( &ch, &i ) ){
+ mark = get_str( (int) i );
+ if( (ch=='@') && ( *mark=='?') && eq_str(mark+1,unhskip_mark)){
+ break;
+ } }
+ }
+ (IGNORED) fseek(dvi_file, (long) retract_addr,
+0
+);
+} while(FALSE);
+
+
+
+
+ cur_fnt = cr_fnt;
+ free((void *) unhskip_mark);
+} else { ignore_chs++;; }
+
+ break; }
+ case ']': {
+if( special_n ){
+ while( special_n-- > 0 ){ (void) get_char(); }
+} else { ignore_chs--; }
+
+ break; }
+ case '?': {
+while( special_n-- > 0 ){ (void) get_char(); }
+
+ break; }
+ case '-': {
+ if( special_n ) { code = 0;
+while( special_n-- > 0 ){
+ digit = get_char() - '0';
+ if ( (digit < 0) || (digit > 9) ) { warn_i_int(41,digit+'0') ; }
+ else { code = code * 10 + digit; }
+}
+if ( (code < 0) || (code > 255) ) { code = '?'; warn_i_int(41,'?') ; }
+
+
+ put_char( code );
+ } else { nomargin = TRUE; }
+ break; }
+ case '*': {
+keepChar=1;
+
+ }
+ case '+': {
+if(
+next_char
+
+ != -1 ) {
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) put_4ht_ch(
+next_char
+
+ , cur_o_file );
+
+next_char
+
+ = -1;
+}
+if(
+next_str
+
+ ){ print_f(next_str);
+ free((void *) next_str); next_str = (char *) 0; }
+next_str = get_str( (int) special_n ); special_n = 0;
+
+{ char *front, *back;
+ int i;
+ back = front = next_str;
+ while( *front != '\0' ){
+ if( *front == '{' ){
+ i = *(++front) - '0';
+ while( *(++front) != '}' ){ i = i*10 + (*front - '0'); }
+ *front = (char) i;
+ }
+ *(back++) = *(front++);
+ }
+ *back = '\0';
+}
+
+
+
+ break; }
+ case '.': {
+if( eoln_str ){ free((void *) eoln_str); }
+if( special_n ){
+ eoln_str = get_str( (int) special_n ); special_n=0;
+} else { eoln_str = (char *) 0; }
+
+ break; }
+ case ',': {
+if( space_str ){ free((void *) space_str); }
+if( special_n ){
+ space_str = get_str( (int) special_n ); special_n=0;
+} else { space_str = (char *) 0; }
+
+ break; }
+ case '_': {
+if( !special_n ){ rule_ch = '\0'; }
+else { while( special_n-- > 0 ){ rule_ch = get_char(); }
+ }
+
+ break; }
+ case 'D': {
+ struct files_rec *p;
+while( special_n-- > 0 ) (void) putc( get_char(), log_file );
+for( p = opened_files; p != (struct files_rec*) 0; p = p->next ){
+ if( p->file == cur_o_file) {
+ (IGNORED) fprintf(log_file, "%d %s\n",
+ (int) ftell(cur_o_file), p->name);
+ break;
+} }
+
+ break; }
+ case 'u': {
+special_n--;
+switch ( code = get_char() ){
+ case '+': { put_4ht_off++;
+flush_uni();
+
+ break; }
+ case '-': { if( put_4ht_off>0 ){ put_4ht_off--; }
+ else { warn_i_str(52, "@u-"); }
+ break; }
+}
+
+ break; }
+ default: {
+code -= '0';
+while( special_n-- > 0 ){
+ digit = get_char() - '0';
+ if ( (digit < 0) || (digit > 9) ) { warn_i_int(41,digit+'0') ; }
+ else { code = code * 10 + digit; }
+}
+if ( (code < 0) || (code > 255) ) { code = '?'; warn_i_int(41,'?') ; }
+
+ next_char = code;
+if(
+next_str
+
+ ){ print_f(next_str);
+ free((void *) next_str); next_str = (char *) 0; }
+
+ }
+}
+
+ break; }
+ case '+': {
+while( special_n-- > 0 ) (void) get_char();
+
+ break; }
+ case '=': {
+while( special_n-- > 0 ){
+ int ch;
+ BOOL flag;
+ struct hcode_repl_typ *q;
+ ch = get_char();
+ q = hcode_repl;
+ flag = FALSE;
+ while( q != (struct hcode_repl_typ*) 0 ){
+ if( ch == *(q->str) ){ flag = TRUE; break; }
+ q = q->next;
+ }
+ if( flag ){
+ char *chr;
+ chr = (q->str) + 1;
+ while( *chr != 0 ){ put_char( *chr ); chr++; }
+ } else { put_char( ch ); }
+}
+
+ break; }
+ case '<':
+ case '>': {
+
+ int i=0;
+ U_CHAR *name;
+name = m_alloc(char, (int) special_n+1);
+*(name + (int) special_n) = '\0';
+while( special_n-- > 0 ) *(name + i++) = get_char();
+
+
+
+if( no_root_file ){ open_o_file(); }
+
+
+
+for( p = opened_files; p != (struct files_rec*) 0; p = p->next )
+ { if( eq_str(p->name, name) ) break; }
+
+
+if( ch == '>' ){
+if( p != (struct files_rec*) 0 ){
+ out_file = p->file;
+ p->prev_file = cur_o_file;
+ free((void *) name );
+} else {
+ if( !(*name) ) out_file = (FILE *) 0;
+ else {
+p = m_alloc(struct files_rec, 1);
+if( opened_files != (struct files_rec*) 0 ) opened_files->prev = p;
+p->prev = (struct files_rec *) 0;
+p->next = opened_files; opened_files = p;
+p->name = name;
+p->file = out_file = open_html_file(name);
+p->prev_file = cur_o_file;
+
+ }
+}
+
+ }
+else {
+if( p == (struct files_rec *) 0 ) bad_special( name );
+
+if( p->prev != (struct files_rec*) 0 ) (p->prev)->next = p->next;
+else opened_files = p->next;
+if( p->next != (struct files_rec*) 0 ) (p->next)->prev = p->prev;
+
+
+if( opened_files != (struct files_rec*) 0 )
+ { if( out_file == p->file ) out_file = opened_files->file; }
+else out_file = (FILE *) 0;
+(IGNORED) fclose( p->file ); free((void *) p->name );
+free((void *) p );
+
+ }
+cur_o_file = ( out_file == (FILE *) 0 )? root_file
+ : out_file;
+
+ break; }
+ case '!': {
+ch_map_flag = !ch_map_flag;
+if( ch_map_flag ){
+init_ch_map();
+xresolution = yresolution = 0;
+while( special_n-- > 0 ){
+ ch = get_char();
+ if( (ch >= '0') && (ch <= '9') )
+ { yresolution = yresolution * 10 + ch - '0'; }
+ else if( (ch == ',') && !xresolution && yresolution )
+ { xresolution = yresolution; yresolution = 0; }
+ else {
+xresolution = yresolution = 0;
+
+warn_i_int( 26, '!');
+(IGNORED) putc( ch, stderr);
+while( special_n-- ) (IGNORED) putc( get_char(), stderr);
+
+
+
+ }
+}
+if( !xresolution ) xresolution = yresolution;
+if( !xresolution ){ xresolution = XRESOLUTION;
+ yresolution = YRESOLUTION; }
+else { xresolution = xresolution * (INTEGER) (XRESOLUTION / 100);
+ yresolution = yresolution * (INTEGER) (YRESOLUTION / 100); }
+
+ }
+else {
+dump_ch_map();
+
+ }
+
+ break; }
+ case '|': { gif_ch = !gif_ch; break; }
+ case ':': {
+if( special_n-- ){
+ int code, n;
+ U_CHAR str [255], *p;
+ struct count_rec *q;
+ code = get_char();
+ while( special_n > 254 ){ (void) get_char(); special_n--; }
+ p = str; n = special_n;
+ while( special_n-- ) { *(p++) = get_char(); }
+ *p = '\0';
+
+q = counter;
+while( q ){
+ if( eq_str(str,q->str) ) break; q = q->next;
+}
+if( !q ){
+ q = m_alloc(struct count_rec, 1);
+ q->i = q->depth = 0; q->max = 10;
+ q->next = counter; counter = q;
+ q->str = m_alloc(char, (int) n+1);
+ (IGNORED) strcpy( q->str, str );
+ q->stack = m_alloc(int, q->max);
+}
+
+
+
+switch ( code ){
+ case '+': { (q->i)++; break; }
+ case '-': { (q->i)--; break; }
+ case '>': {
+if( q->depth == q->max ){
+ q->max += 10;
+ if( (q->stack = (int *) r_alloc( (void *) q->stack,
+ (size_t) (q->max * sizeof(int)))) == NULL) bad_mem;
+}
+q->stack[q->depth++] = q->i;
+
+ break; }
+ case '<': { if( q->depth ){
+q->depth--;
+if( q->max > q->depth + 20 ){ q->max -= 15;
+ if( (q->stack = (int *) r_alloc( (void *) q->stack,
+ (size_t) (q->max * sizeof(int)))) == NULL) bad_mem;
+}
+
+ }
+ break; }
+ case '!': {
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, "%d", q->i); break; }
+ case '|': { if( q->depth ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ (IGNORED) fprintf(cur_o_file, "%d", q->stack[q->depth - 1] );
+ }
+ break; }
+ default: { ; }
+}
+
+
+}
+
+ break; }
+ case ';': {
+ int n, code;
+ U_CHAR *p, *q;
+code = get_char();
+n = 1 + ((--special_n>254)? 254 : special_n);
+q = p = m_alloc(char, (int) n);
+while( special_n > 254 ){ (void) get_char(); special_n--; }
+while( special_n-- ) { *(q++) = get_char(); }
+*q = '\0'; q = p;
+switch ( code ){
+ case '8': { pause_style--; break; }
+ case '9': { pause_style++; break; }
+ case '-': { default_font = font_tbl[cur_fnt].num;
+ base_font_size = font_tbl[cur_fnt].scale / 100;
+ break; }
+ case '+': { default_font = -1; break; }
+ case '%': {
+ int f;
+f = 0; while( *p ){ f = 10*f + *(p++) - '0'; }
+
+if( no_root_file ){ open_o_file(); }
+
+
+(IGNORED) fprintf(cur_o_file, "%d",
+ (font_tbl[cur_fnt].scale / base_font_size - 100) * f / 100 +100
+ );
+
+ break; }
+ case '=': {
+
+if( no_root_file ){ open_o_file(); }
+
+
+(IGNORED) fprintf(cur_o_file, "%s", font_tbl[cur_fnt].name);
+if( font_tbl[cur_fnt].mag != 100 ){
+ (IGNORED) fprintf(cur_o_file,"_%d", font_tbl[cur_fnt].mag);
+}
+
+ break; }
+ case '|': {
+{ int bad_str, m;
+ U_CHAR ch, *t[
+8
+], err_str[256];
+bad_str=
+7
+; (IGNORED) strcpy(err_str,p);
+if( n>
+10
+ ){
+ m = 100*( *p-'0' ) + 10*( *(p+1)-'0' )+ *(p+2)-'0';
+ if( (m>-1) && (m<256) ){
+ ch = *(p + 3); t[0]=p;
+ while( (*p = *(p+4)) != '\0' ){
+ if( ch == *p ){ *p = '\0';
+ if( bad_str-- > 0 ) t[
+7
+ - bad_str] = p+1;
+ }
+ p++;
+ } }
+ if( !bad_str ){
+ if( m==0 ){ span_name_on = n>
+11
+; }
+ q = span_open[m]; span_open[m] = t[0];
+ span_name[m] = t[1]; span_size[m] = t[2];
+ span_mag[m] = t[3]; span_ord[m] = t[4];
+ span_ch[m] = t[5]; end_span[m] = t[6];
+ gif_id[m] = t[7];
+ if( not_notify ) {
+ store_bit_I( class_on, m );
+ not_notify = FALSE;
+ } else store_bit_Z( class_on, m );
+ }
+}
+if( bad_str ){ warn_i_str(37,err_str); }
+}
+
+ break; }
+ case ',': {
+not_notify = TRUE;
+
+ break; }
+ default: { warn_i_int( 36, code); }
+}
+span_on = span_name_on && !pause_style;
+if( q ) free((void *) q);
+
+ break; }
+ case '"': {
+if( special_n ){
+
+{ U_CHAR * p, ch, i;
+ ch = get_char();
+ p = pos_text = pos_line = end_pos_text
+ = end_pos_body = pos_body
+ = (char *) r_alloc((void *) pos_body,(size_t) special_n + 1);
+ i = 0;
+{ BOOL after_star;
+ while( special_n-- > 0 ){
+ if( (*p = get_char()) == ch ){
+ *p = '\0'; i++;
+ if( i==1 ){ end_pos_body = p + 1; after_star = FALSE; }
+ else if( i==2 ){ pos_text = p + 1;
+ if( !after_star ){ i--; after_star = TRUE; }
+ }
+ else if( i==3 ){ end_pos_text = p + 1; }
+ else if( i==4 ){ pos_line = p + 1; }
+ else { p++; break; }
+ } else { after_star = FALSE; }
+ p++;
+ }
+}
+
+
+
+{ long int v;
+ double w[5];
+ int j;
+ U_CHAR ch, sign;
+ BOOL done;
+ for(j=0;j<5;j++){
+
+done = FALSE; sign = 1;
+if( --special_n > 0 ){
+ if( (ch = get_char()) == '-' ){ sign = -1; v=0; }
+ else v = ch - '0';
+ if( (v<0) || (v>9) ) done = TRUE;
+}
+if( !done )
+ while( --special_n > 0 ){
+ ch = get_char();
+ if( ('0' <= ch ) && (ch <= '9' ) ){
+ v = v * 10 + ch - '0'; }
+ else{ done = TRUE; break; }
+ }
+
+
+ if( done ){
+ i++;
+ w[j] = sign * ((double) v + pos_dbl( &special_n ));
+ }
+ }
+ pos_x_A = w[0]; pos_x_B = w[1];
+ pos_y_C = w[2]; pos_y_D = w[3]; pos_y_E = w[4];
+}
+rect_pos = (special_n == 2);
+if( rect_pos ){ special_n -= 2; rect_pos = get_char() - '0';}
+
+
+ if( (i != 10) || special_n ){
+ warn_i_str(39,pos_text);
+ *(pos_text = end_pos_body = pos_line =
+ end_pos_text = pos_body) = '\0';
+ }
+}
+
+
+} else if( (pos_dvi = !pos_dvi) == TRUE ){
+ print_f(pos_body);
+ min_pos_x = max_pos_x = base_pos_x = x_val;
+ min_pos_y = max_pos_y = base_pos_y = y_val ;
+} else { U_CHAR *p;
+ double dim;
+ BOOL dim_on;
+
+if( no_root_file ){ open_o_file(); }
+
+
+ p = end_pos_body;
+ while( *p ){
+ dim_on = TRUE;
+ switch( *p ){
+
+case 'X': { dim = pos_x_A * (max_pos_x - base_pos_x) + pos_x_B;
+ break; }
+case 'x': { dim = pos_x_A * (base_pos_x - min_pos_x) + pos_x_B;
+ break; }
+case 'd': { dim = pos_x_A * (max_pos_x - min_pos_x) + pos_x_B;
+ break; }
+case 'y': { dim = pos_y_C * (base_pos_y - min_pos_y - 1) + pos_y_D;
+ break; }
+case 'Y': { dim = pos_y_C * (max_pos_y - base_pos_y) + pos_y_D;
+ break; }
+case 'D': { dim = pos_y_C * (max_pos_y - min_pos_y) + pos_y_D;
+ break; }
+
+
+ default: { dim_on = FALSE; }
+ }
+ p++;
+ if( dim_on ){ (IGNORED) fprintf(cur_o_file, p, dim); }
+ else { (IGNORED) fprintf(cur_o_file, p); }
+ while( * (p++) );
+ }
+}
+
+ break; }
+ case '~': {
+if( special_n ){
+
+ U_CHAR in_ch;
+if( (in_ch = get_char()) == '>' ) {
+
+if( special_n == 1 ){
+ special_n--;
+ switch( get_char() ){
+ case '[': { ignore_end_group++; break; }
+ case ']': { ignore_end_group--; break; }
+ default: {
+;
+
+ }
+ }
+} else {
+ struct stack_end_entry *p;
+ U_CHAR *q;
+ int j;
+ j = get_char() - '0' + stack_n - 1;
+ if( --special_n ){
+ if (j >= stack_len ) { j = stack_len - 1; }
+ p = m_alloc(struct stack_end_entry,1);
+ p->next = stack[ j ].end;
+ stack[ j ].end = p;
+ q = p->send = m_alloc(char,special_n+1);
+ while( --special_n ) *q++ = get_char();
+ *q = '\0';
+} }
+
+
+} else if( in_ch == '!' ) {
+
+ struct group_path *p, *t;
+ U_CHAR *q, str[256];
+ int n;
+p = m_alloc(struct group_path,1);
+
+n = 0;
+while( --special_n ) {
+ str[n] = get_char();
+ if( ( str[n] != 'e') && (str[n] != 's') ){ break; }
+ n++;
+}
+if((
+ ( str[n] != '<') && (str[n] != '>') &&
+ ( str[n] != '/') && (str[n] != '-')
+ ) || (n==0) ){
+ str[n+1] = '\0';
+ err_i_str(38,str);
+}
+p->action = str[n]; str[n] = '\0';
+p->path = m_alloc(char,n+1);
+(IGNORED) strcpy(p->path,str);
+
+
+
+q = p->info = m_alloc(char,special_n+1);
+while( --special_n ) *q++ = get_char();
+*q = '\0';
+
+
+n = stack_n - 1;
+if( p->action == '>' ){
+ p->next = stack[ n ].path_end;
+ stack[ n ].path_end = p;
+} else {
+ p->next = (struct group_path *) 0;
+ if( stack[n].path_start == (struct group_path *) 0 ) {
+ stack[n].path_start = p;
+ } else {
+ t = stack[n].path_start;
+ while( t->next != (struct group_path *) 0 ) { t = t->next; }
+ t->next = p;
+} }
+
+
+} else {
+ if( !group_dvi ){ warn_i(42); }
+ (IGNORED) fseek(dvi_file, (long) --special_n,
+
+1
+);
+ special_n = 0;
+}
+
+
+} else if( (group_dvi = !group_dvi) == TRUE ){
+ long curr_pos;
+ int ch, sv_stack_n;
+
+int cr_fnt;
+
+
+BOOL ch_token;
+int id_hide;
+
+
+
+cr_fnt = cur_fnt;
+
+
+sv_id = 0;
+ch_id = 0;
+
+
+id_hide = 0; ch_token = TRUE;
+while( del_stack != (struct del_stack_entry*) 0 ){
+ struct del_stack_entry* p;
+ del_stack = (p = del_stack)->next;
+ free((void *) p );
+}
+
+ stack_id = 0;
+ curr_pos = ftell(dvi_file); sv_stack_n = stack_n;
+
+while( group_dvi ){
+
+if( (ch = get_char()) >= 128 ) {
+ switch( ch ){
+
+case 128: case 129: case 130: case 131: case 133:
+case 134: case 135: case 136: {
+ ch = (int) get_unt( (ch-(ch>132)) % 4 +1);
+
+ch_id++;
+if(!back_id_off ){
+ if( !id_hide ){ ch_token = TRUE; sv_id = ch_id; }
+ switch( math_class_of( ch, cr_fnt ) ){
+ case
+4
+
+: { del_stack = push_del( (char) ch, cr_fnt);
+ break; }
+ case
+5
+
+: {
+ del_stack = pop_del( (char) ch, id_hide, cr_fnt); break; }
+ default:{ ; }
+} }
+
+
+ break;
+}
+
+
+
+case
+246
+: (void) get_char();
+case
+245
+: (void) get_char();
+case
+244
+: (void) get_char();
+case
+243
+: { int i;
+ for( i=14; i; i-- ){ ch = get_char(); }
+ i = ch + get_char();
+ (IGNORED) fseek(dvi_file, (long) i,
+1
+);
+ break; }
+
+
+
+case
+132
+:
+case
+137
+:{
+ (IGNORED) fseek(dvi_file, 8L,
+1
+);
+ break;
+}
+
+
+case
+139
+: {
+ (IGNORED) fseek(dvi_file, 44L,
+1
+); break; }
+
+
+case
+143
+: case
+144
+:
+case
+145
+: case
+146
+: {
+ (IGNORED) (get_int( ch -
+143
+ + 1 )); break; }
+case
+148
+:
+case
+149
+:
+case
+150
+:
+case
+151
+: {
+ (IGNORED) (get_int( ch -
+148
+ + 1));
+ break; }
+case
+153
+:
+case
+154
+:
+case
+155
+:
+case
+156
+: {
+ (IGNORED) (get_int( ch -
+153
+ + 1));
+ break; }
+case
+157
+: case
+158
+:
+case
+159
+: case
+160
+: {
+ (IGNORED) (get_int( ch -
+157
+ + 1));
+ break; }
+case
+162
+:
+case
+163
+:
+case
+164
+:
+case
+165
+: {
+ (IGNORED) (get_int( ch -
+162
+ + 1));
+ break; }
+case
+167
+:
+case
+168
+:
+case
+169
+:
+case
+170
+: {
+ (IGNORED) (get_int( ch -
+167
+ + 1));
+ break; }
+
+
+case
+147
+:
+case
+152
+:
+case
+161
+:
+case
+166
+:
+ { break; }
+
+
+
+case
+141
+: {
+
+{ struct group_info *p, *last;
+ if( (last = p = stack[ stack_n ].begin) != (struct group_info *)0 )
+ if( p->stack_id == -1 ){
+
+while( p ){
+ if( p->stack_id != -1 ){ break; }
+ p->stack_id = stack_id;
+ last = p;
+ p = p->next;
+}
+
+
+
+while ( stack[ stack_n ].begin != last ){
+ p = (stack[ stack_n ].begin) -> next;
+ (stack[ stack_n ].begin) -> next = last->next;
+ last->next = stack[ stack_n ].begin;
+ stack[ stack_n ].begin = p;
+}
+
+
+ }
+}
+
+
+ stack[stack_n].stack_id = stack_id++;
+
+if( !back_id_off )
+{ struct del_stack_entry *p;
+ p = m_alloc(struct del_stack_entry,1);
+ p->next = del_stack;
+ p->id = p->fnt = -1;
+ del_stack = p;
+}
+
+ stack_n++;
+ if( stack_n >
+((int) stack_len + 2)
+
+ ){ warn_i(40); }
+ break;
+}
+case
+142
+: {
+ stack_n--;
+if( !back_id_off ){
+ if( !id_hide ){ ch_token = FALSE;
+ sv_id = stack[stack_n].stack_id; }
+ while( del_stack != (struct del_stack_entry*) 0 ){
+ struct del_stack_entry* p;
+ int id;
+ del_stack = (p = del_stack)->next;
+ id = p->id;
+ free((void *) p );
+ if( id == -1 ) break;
+} }
+
+
+ stack[stack_n].stack_id = -1;
+ break;
+}
+
+
+
+case
+239
+: case
+240
+:
+case
+241
+: case
+242
+: { long int i;
+ if( tex4ht_special( &ch, &i ) ){
+ if( ch == '~' ){
+
+if( i==0 ){
+ group_dvi = FALSE ;
+}else{
+ switch( get_char() ){
+ case '<': {
+ if( i-- ){ U_CHAR ch;
+ if( (ch = get_char()) == '*' )
+ {
+ struct send_back_entry *p, *q, *t;
+if( back_id_off ){
+ while( i-- ){ (IGNORED) get_char(); }
+} else {
+ p = m_alloc(struct send_back_entry,1);
+ p->send = get_str( (int)( i - 1 ));
+ if( ch_token ){
+
+p->id = sv_id;
+if( sv_id > back_token->id ){
+ p->next = back_token; back_token = p;
+} else {
+ q = back_token;
+ while( sv_id <= q->id ){ t = q; q = q->next; }
+ p->next = t->next; t->next = p;
+}
+
+
+ } else {
+ p->id = (sv_id<0? 0 : sv_id) + push_id;
+ if( back_group->id < p->id )
+ { p->next = back_group; back_group = p; }
+ else
+ { q = back_group;
+ while( q->id >= p->id ) { t = q; q = q->next; }
+ p->next = t->next; t->next = p;
+ }
+ }
+}
+
+ }
+ else if( (ch == '[') && (i==1) ){
+ i--;
+id_hide++;
+
+
+ }
+ else if( (ch == ']') && (i==1) ){
+ i--;
+id_hide--;
+
+
+ }
+ else if( (ch == '-') && (i==1) ){
+ i--;
+id_latex++;
+
+
+ }
+ else if( (ch == '+') && (i==1) ){
+ i--;
+id_latex--;
+
+
+ }
+ else if( (ch == '(') && (i==1) ){
+ i--;
+back_id_off++;
+
+
+ }
+ else if( (ch == ')') && (i==1) ){
+ i--;
+back_id_off--;
+
+
+ }
+ else {
+ struct group_info *p;
+ U_CHAR *q;
+ int j;
+j = ch - '0' + stack_n - 1;
+if (j >= stack_len ) { j = stack_len - 1; }
+p = m_alloc(struct group_info,1);
+p->next = stack[ j ].begin; stack[ j ].begin = p;
+p->stack_id = stack[ j ].stack_id;
+q = p->info = m_alloc(char,i+1);
+while( --i ) *q++ = get_char();
+*q = '\0';
+
+ }
+ }
+ break; }
+ default: { (IGNORED) fseek(dvi_file, (long) --i,
+
+1
+); break; }
+} }
+
+
+ } else {
+ (IGNORED) fseek(dvi_file, (long) i,
+1
+);
+ }
+ }else{
+ U_CHAR *ch;
+ch = special_hd + 4;
+while( *ch ){ ch++; }
+(IGNORED) fseek(dvi_file, (long) i,
+1
+);
+
+ }
+ break;
+}
+
+
+
+case
+235
+:
+case
+236
+:
+case
+237
+:
+case
+238
+: {
+ INTEGER n;
+ n = ch -
+235
+ + 1;
+ cr_fnt = (int) ((n==4)? get_int(4) : get_unt((int) n));
+ cr_fnt = search_font_tbl( cr_fnt );
+ break; }
+default: {
+ if( (ch <
+171
+) || (ch >
+234
+) ) {
+ if( ch ==
+140
+ ) { warn_i(46); }
+ else { warn_i_int(45,ch); }
+ } else { cr_fnt = ch -
+171
+;
+ cr_fnt = search_font_tbl( cr_fnt );
+ }
+ break;
+}
+
+
+ }
+} else {
+ch_id++;
+if(!back_id_off ){
+ if( !id_hide ){ ch_token = TRUE; sv_id = ch_id; }
+ switch( math_class_of( ch, cr_fnt ) ){
+ case
+4
+
+: { del_stack = push_del( (char) ch, cr_fnt);
+ break; }
+ case
+5
+
+: {
+ del_stack = pop_del( (char) ch, id_hide, cr_fnt); break; }
+ default:{ ; }
+} }
+
+ }
+
+
+}
+
+
+
+{ struct group_info *first, *second, *temp;
+ int i;
+for(i = stack_len; i >= 0; i--){
+ first = stack[i].begin;
+ if( first ) {
+ second = first->next;
+ while( second ){
+ temp = second->next;
+ second->next = first;
+ first = second;
+ second = temp;
+ }
+ (stack[i].begin)->next = (struct group_info *) 0;
+ stack[i].begin = first;
+} } }
+
+
+back_group = rev_list( back_group );
+back_token = rev_list( back_token );
+back_token = back_insert ( back_token, 0);
+
+ch_id = 0;
+
+
+
+
+ (IGNORED) fseek(dvi_file, curr_pos,
+0
+);
+ group_dvi = TRUE; stack_n = sv_stack_n; stack_id = 0;
+} else {
+{ int stack_n;
+ for( stack_n=
+((int) stack_len + 2)
+
+;
+ stack_n>0; stack_n--){
+ group_dvi = TRUE;
+while( stack[stack_n-1].end ){
+
+ struct stack_end_entry *q, *p, *t;
+q = stack[ stack_n-1 ].end;
+p = stack[ stack_n-1 ].end = (struct stack_end_entry *) 0;
+while( q ){
+ t = q->next; q->next = p; p = q; q = t;
+}
+while( p ){
+ if( ! ignore_end_group ){ print_f( p->send ); }
+ free((void *) p->send );
+ q = p; p = p->next; free((void *) q );
+}
+
+
+}
+
+
+ group_dvi =FALSE;
+
+while( stack[stack_n-1].begin ){
+ struct group_info *p;
+ warn_i_str(44, stack[stack_n-1].begin->info);
+ p = stack[stack_n-1].begin;
+ stack[stack_n-1].begin = p->next;
+ free((void *) p );
+}
+stack[stack_n-1].stack_id = -1;
+
+
+} }
+
+ }
+
+ break; }
+ case '.': {
+if( no_root_file ){
+ U_CHAR *name;
+ name = m_alloc(char, 256);
+ (IGNORED) strcpy( name, no_root_file );
+ free((void *) no_root_file);
+ no_root_file = name;
+ name += (size_t) strlen(name); while( *(--name) != '.' ); name++;
+ while( special_n-- ){
+ if( (no_root_file+253) == name ) name--;
+ *name++ = get_char();
+ }
+ *name = '\0';
+} else {
+ U_CHAR str[256], *p;
+ p = str; while( special_n-- ){ *p++ = get_char(); } *p = '\0';
+ warn_i_str(43,str);
+}
+
+ break; }
+ case '^': {
+switch( special_n ){
+ case 0:{ if( math_class_on ){
+ open_del = 256; pause_class = ignore_subclass_del = 0;
+ math_class_on = FALSE;
+group_dvi = sv_group_dvi;
+trace_dvi_C = sv_trace_dvi_C;
+in_trace_char = sv_in_trace_char;
+span_on = sv_span_on;
+in_span_ch = sv_in_span_ch;
+
+
+ } else { show_class = !show_class; }
+ break;
+ }
+ case 1:{
+sv_group_dvi = group_dvi;
+sv_trace_dvi_C = trace_dvi_C;
+sv_in_trace_char = in_trace_char;
+sv_span_on = span_on;
+sv_in_span_ch = in_span_ch;
+
+
+ special_n--;
+ if( (math_class = scan_class(1)) ==
+79
+
+ )
+ { math_class = 0; }
+ else math_class_on = TRUE;
+ break;
+ }
+ case 2:{
+special_n -= 2; math_class = scan_class(0);
+stack[stack_n+1].ignore_subclass_del =
+ (
+')'
+
+ == get_char());
+stack[stack_n+1].active_class_del = TRUE;
+stack[stack_n+1].temp_class_del = FALSE;
+stack[stack_n+1].no_left_del = TRUE;
+stack[stack_n+1].class_open = open_class[math_class];
+stack[stack_n+1].class_close = close_class[math_class];
+
+
+ break; }
+ default:{
+{ U_CHAR str[256], *p, ch, **q;
+ math_class = scan_class(2); ch = get_char();
+ special_n -= 2; p = str;
+ while( special_n-- > 0 ){
+ if( (*(p++) = get_char()) == ch ){ p--; break; }
+ }
+ *p = '\0';
+ q = (math_class >
+78
+
+)? &(
+stack[stack_n+1].temp_class_open
+
+)
+ : &(open_class[math_class]);
+ *q = (char *) r_alloc((void *) open_class[math_class],
+ 1 + (size_t) strlen(str));
+ (IGNORED) strcpy(*q, str);
+ q = (math_class >
+78
+
+) ? &(
+stack[stack_n+1].temp_class_close
+
+)
+ : &(close_class[math_class]);
+ p = *q = (char *) r_alloc((void *) *q, 1 + (size_t) special_n);
+ while( special_n-- > 0 ){ *(p++) = get_char(); }
+ *p = '\0';
+ if( math_class >
+78
+
+){
+stack[stack_n+1].ignore_subclass_del =
+ (math_class ==
+(
+79
+
+ + 1)
+
+);
+stack[stack_n+1].temp_class_del = TRUE;
+stack[stack_n+1].active_class_del = TRUE;
+
+ }
+}
+
+ }
+}
+
+ break; }
+}
+
+ special_on = FALSE;
+
+if( special_n > 0 ){
+ warn_i_int( 26, sv);
+ while( special_n-- ) (IGNORED) putc( get_char(), stderr);
+}
+
+
+ } else {
+while( special_n-- ) (void) get_char();
+
+ }
+
+ break; }
+
+
+case
+141
+: {
+
+if( new_halign ){
+
+stack[stack_n].halign_on = new_halign;
+if( stack[stack_n].halign_info )
+{ int j;
+ for( j=8; j--; ){
+ if( stack[stack_n].halign[j] != halign[j] ){
+ if( ! (--(stack[stack_n].halign[j]->refs) ) ){
+ free((void *) stack[stack_n].halign[j]->str );
+ free((void *) stack[stack_n].halign[j] );
+ }
+ stack[stack_n].halign[j] = halign[j];
+ (halign[j]->refs)++;
+ }
+ }
+} else { int j;
+ stack[stack_n].halign_info = TRUE;
+ for( j=8; j--; ){
+ stack[stack_n].halign[j] = halign[j];
+ (halign[j]->refs)++;
+} }
+print_f( stack[stack_n].halign[0]->str );
+stack[stack_n].row_no = 0;
+new_halign = FALSE;
+
+
+}
+if( stack[stack_n].halign_on )
+{
+ print_f( stack[stack_n].halign[2]->str );
+ if( stack[stack_n].halign_on > TRUE ){
+ stack[stack_n].row_no++;
+ stack[stack_n].col_no = 0;
+ (IGNORED) fprintf(cur_o_file, "%d%s",
+ stack[stack_n].row_no, stack[stack_n].halign[6]->str );
+} }
+if( stack_n ){
+ if( stack[stack_n-1].halign_on )
+ {
+ print_f( stack[stack_n-1].halign[4]->str );
+ if( stack[stack_n-1].halign_on > TRUE ){
+ stack[stack_n-1].col_no ++;
+ (IGNORED) fprintf(cur_o_file, "%d%s",
+ stack[stack_n-1].col_no, stack[stack_n-1].halign[7]->str );
+ }
+} }
+
+
+
+{ struct group_info *p;
+ if( group_dvi &&
+ ( (p = stack[stack_n].begin ) != (struct group_info *)0)
+ ){
+ while( p ){
+ if( p->stack_id != stack_id ) break;
+ print_f(p->info);
+ stack[stack_n].begin = p->next;
+ free((void *) p );
+ p = stack[stack_n].begin;
+ }
+ }
+ stack_id++;
+}
+
+
+stack[stack_n].text_on = text_on;
+push_stack();
+if( group_dvi ) {
+ back_group = back_insert ( back_group, push_id);
+}
+
+
+
+{
+
+struct group_path *start_head, *start_tail,
+ *parent_start_head, *parent_start_tail,
+ *end_head, *end_tail,
+ *parent_end_head, *parent_end_tail,
+ *p, *q;
+int place;
+start_head = start_tail = parent_start_head = parent_start_tail
+ = end_head = end_tail = parent_end_head
+ = parent_end_tail = (struct group_path *) 0;
+
+
+ if(
+rule_ch_off
+
+ ){
+
+ignore_spaces--;
+
+
+
+rule_ch_off
+
+ = FALSE;
+ }
+ if( stack_n > 1 ){
+ p = stack[stack_n - 2].path_start;
+ if( p != (struct group_path *) 0 ){
+
+while( p != (struct group_path *) 0 ){
+
+if( *(p->path ) == 'e' ) {
+ (IGNORED) strcpy(p->path,p->path+1);
+ if( *(p->path) == '\0' ) {
+ switch( p->action ){
+ case '<': print_f( p->info );
+ place =
+4
+;
+ break;
+ case '/': ignore_chs++;
+ place =
+2
+; break;
+ case '-':
+rule_ch_off
+
+ = TRUE;
+
+ignore_spaces++;
+
+
+ place =
+4
+; break;
+ }
+ } else {
+ place =
+2
+;
+ }
+} else {
+ if( *(p->path ) == 's' ) {
+ (IGNORED) strcpy(p->path,p->path+1);
+ }
+ place =
+0
+;
+}
+
+
+ q = p;
+ p = p->next;
+ q->next = (struct group_path *) 0;
+
+switch( place ){
+ case
+0
+:
+ if( parent_start_head == (struct group_path *) 0 ){
+ parent_start_head = parent_start_tail = q;
+ } else {
+ parent_start_tail = parent_start_tail->next = q;
+ }
+ break;
+ case
+2
+:
+ if( start_head == (struct group_path *) 0 ){
+ start_head = start_tail = q;
+ } else {
+ start_tail = start_tail->next = q;
+ }
+ break;
+ case
+4
+:
+
+free((void *) q->path );
+free((void *) q->info );
+free((void *) q );
+
+
+ break;
+}
+
+
+}
+
+
+ }
+ p = stack[stack_n - 2].path_end;
+ if( p != (struct group_path *) 0 ){
+
+while( p != (struct group_path *) 0 ){
+
+if( *(p->path ) == 'e' ) {
+ (IGNORED) strcpy(p->path,p->path+1);
+ place =
+3
+;
+} else {
+ if( *(p->path ) == 's' ) {
+ (IGNORED) strcpy(p->path,p->path+1);
+ }
+ place =
+1
+;
+}
+
+
+ q = p;
+ p = p->next;
+ q->next = (struct group_path *) 0;
+
+switch( place ){
+ case
+1
+:
+ if( parent_end_head == (struct group_path *) 0 ){
+ parent_end_head = parent_end_tail = q;
+ } else {
+ parent_end_tail = parent_end_tail->next = q;
+ }
+ break;
+ case
+3
+:
+ if( end_head == (struct group_path *) 0 ){
+ end_head = end_tail = q;
+ } else {
+ end_tail = end_tail->next = q;
+ }
+ break;
+ case
+4
+:
+
+free((void *) q->path );
+free((void *) q->info );
+free((void *) q );
+
+
+ break;
+}
+
+
+}
+
+
+ }
+
+ stack[stack_n - 1].path_start = start_head;
+ stack[stack_n - 1].path_end = end_head;
+ stack[stack_n - 2].path_start = parent_start_head;
+ stack[stack_n - 2].path_end = parent_end_head;
+
+
+} }
+
+
+
+if( push_depth<256 ) { push_st[push_depth] = push_id++; }
+if( trace_dvi_P && !ch_map_flag ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ if( *trace_dvi_del_P != '\0' ){
+ (IGNORED) fprintf(cur_o_file, "%s%d %d",
+ trace_dvi_del_P, push_depth,
+ push_st[(push_depth<256)? push_depth:256]);
+ }
+ (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_P);
+}
+push_depth++;
+
+
+
+if( stack[stack_n].active_class_del ){
+ if( show_class && !pause_class && !ignore_subclass_del ){
+
+(IGNORED) print_f( (stack[stack_n].temp_class_del)?
+ stack[stack_n].temp_class_open
+ : stack[stack_n].class_open);
+
+
+ }
+ ignore_subclass_del = ignore_subclass_del
+ + stack[stack_n].ignore_subclass_del;
+ stack[stack_n+1].no_left_del= FALSE;
+}
+
+
+
+ break; }
+case
+142
+: {
+
+if( stack[stack_n].active_class_del ){
+ ignore_subclass_del = ignore_subclass_del
+ - stack[stack_n].ignore_subclass_del;
+ if( show_class && !pause_class && !ignore_subclass_del ){
+
+(IGNORED) print_f( (stack[stack_n].temp_class_del)?
+ stack[stack_n].temp_class_close
+ : stack[stack_n].class_close);
+
+
+ }
+ stack[stack_n].active_class_del = FALSE;
+}
+
+
+
+{
+ struct group_path *p, *q;
+ if( stack_n > 1 ){
+ p = stack[stack_n - 1].path_start;
+ if( p != (struct group_path *) 0 ){
+
+while( p != (struct group_path *) 0 ){
+
+if( *(p->path) != '\0' ) {
+
+ char str[256];
+(IGNORED) strcpy(str,"...."); *(str+3) = p->action;
+(IGNORED) strct(str,p->info); warn_i_str(38,str);
+
+
+} else {
+ switch( p->action ){
+ case '/': ignore_chs--; break;
+ default: {
+
+ char str[256];
+(IGNORED) strcpy(str,"...."); *(str+3) = p->action;
+(IGNORED) strct(str,p->info); warn_i_str(38,str);
+
+
+ break;
+} } }
+
+
+ q = p;
+ p = p->next;
+
+free((void *) q->path );
+free((void *) q->info );
+free((void *) q );
+
+
+}
+
+
+ }
+ p = stack[stack_n - 1].path_end;
+ if( p != (struct group_path *) 0 ){
+
+while( p != (struct group_path *) 0 ){
+
+if( *(p->path) != '\0' ) {
+
+ char str[256];
+(IGNORED) strcpy(str,"...."); *(str+3) = p->action;
+(IGNORED) strct(str,p->info); warn_i_str(38,str);
+
+
+} else {
+ switch( p->action ){
+ case '>': print_f( p->info ); break;
+ default: {
+
+ char str[256];
+(IGNORED) strcpy(str,"...."); *(str+3) = p->action;
+(IGNORED) strct(str,p->info); warn_i_str(38,str);
+
+
+ break;
+} } }
+
+
+ q = p;
+ p = p->next;
+
+free((void *) q->path );
+free((void *) q->info );
+free((void *) q );
+
+
+}
+
+
+} } }
+
+
+
+while( stack[stack_n-1].end ){
+
+ struct stack_end_entry *q, *p, *t;
+q = stack[ stack_n-1 ].end;
+p = stack[ stack_n-1 ].end = (struct stack_end_entry *) 0;
+while( q ){
+ t = q->next; q->next = p; p = q; q = t;
+}
+while( p ){
+ if( ! ignore_end_group ){ print_f( p->send ); }
+ free((void *) p->send );
+ q = p; p = p->next; free((void *) q );
+}
+
+
+}
+
+
+
+push_depth--;
+if( trace_dvi_P && !ch_map_flag ){
+
+if( no_root_file ){ open_o_file(); }
+
+
+ if( *trace_dvi_del_p != '\0' ){
+ (IGNORED) fprintf(cur_o_file, "%s%d %d",
+ trace_dvi_del_p, push_depth,
+ push_st[(push_depth<256)? push_depth:256]);
+ }
+ (IGNORED) fprintf(cur_o_file, "%s", end_trace_dvi_del_p);
+}
+
+
+
+
+if( stack[stack_n].halign_on )
+{
+print_f( stack[stack_n].halign[1]->str );
+stack[stack_n].halign_on = FALSE;
+
+ }
+
+
+
+if( stack_n ){
+ if( stack[stack_n-1].halign_on )
+ {
+ print_f( stack[stack_n-1].halign[3]->str );
+} }
+
+
+
+if( stack_n-1 ){
+ if( stack[stack_n-2].halign_on )
+ {
+ print_f( stack[stack_n-2].halign[5]->str );
+} }
+
+
+if( stack[stack_n].halign_info )
+{ int j;
+ for( j=8; j--; ){
+ if( ! (--(stack[stack_n].halign[j]->refs) ) ){
+ free((void *) stack[stack_n].halign[j]->str );
+ free((void *) stack[stack_n].halign[j] );
+ } }
+ stack[stack_n].halign_info = FALSE;
+}
+
+
+pop_stack();
+if( ((x_val+0.6*word_sp) < stack[stack_n].x_val) ) put_char(' ');
+text_on = stack[stack_n].text_on;
+
+ break; }
+
+
+ }
+}
+
+ }
+
+if( ch_map_flag ){
+ warn_i(27); init_ch_map(); }
+
+
+ (IGNORED) printf("]%c",unread_pages % 10 == 0? '\n' : ' ');
+ put_char('\n');
+} }
+
+
+put_char('\n');put_char('\n');
+
+while( opened_files != (struct files_rec*) 0 )
+{
+ (IGNORED) fclose( opened_files->file );
+ opened_files = opened_files->next;
+}
+
+
+{
+INTEGER bop_addr;
+
+
+int stack_depth;
+
+
+char cur_font[6];
+BOOL visible_cnt;
+
+
+
+job_name[job_name_n-3] = '\0';
+
+file_n = 14;
+(IGNORED) fseek(dvi_file, 0L,
+0
+);
+do{ ch = get_char();
+ idv_char( ch );
+ file_n++;
+}while( ch ==
+138
+ );
+for( i=13; i ; i-- ) idv_char( get_char() );
+i = get_char();
+idv_char( (int) i ); while( i-- ) idv_copy();
+
+
+page_n = 0;
+
+x_val = 0; y_val = 0; stack_n = 0;
+idv_char(
+139
+ );
+idv_int( page_n + 1 ); for( i=36; i--; ) idv_char( 0);
+idv_int( -1 ); bop_addr = file_n; file_n += 45;
+idv_char(
+141
+); file_n++;
+
+
+while( dis_pages ){
+if( (ch = get_char()) < 128 ) { visible_cnt = TRUE; cond_idv_char( ch );}
+else switch( ch ){
+case 128: case 129: case 130: case 131: case 133:
+case 134: case 135: case 136: {
+ visible_cnt = TRUE; cond_string( ch, (ch - (ch>132)) % 4 +1 );
+ break;
+}
+
+
+case
+139
+: {
+ x_val = 0; y_val = 0; stack_n = 0;
+ (IGNORED) fseek(dvi_file, 44L,
+1
+); break; }
+case
+140
+: { dis_pages--; }
+case
+138
+: { break; }
+
+
+case
+147
+: {
+ cond_idv_char( ch ); x_val += dx_1; break; }
+case
+152
+: {
+ cond_idv_char( ch ); x_val += dx_2; break; }
+case
+161
+: {
+ cond_idv_char( ch ); y_val += dy_1; break; }
+case
+166
+: {
+ cond_idv_char( ch ); y_val += dy_2; break; }
+
+
+case
+143
+: case
+144
+:
+case
+145
+: case
+146
+: {
+ cond_idv_char( ch );
+ x_val += cond_int( ch -
+143
+ + 1 ); break; }
+case
+148
+:
+case
+149
+:
+case
+150
+:
+case
+151
+: {
+ cond_idv_char( ch );
+ dx_1 = (INTEGER) cond_int( ch -
+148
+ + 1);
+ x_val += dx_1; break; }
+case
+153
+:
+case
+154
+:
+case
+155
+:
+case
+156
+: {
+ cond_idv_char( ch );
+ dx_2 = (INTEGER) cond_int( ch -
+153
+ + 1);
+ x_val += dx_2; break; }
+
+
+case
+157
+: case
+158
+:
+case
+159
+: case
+160
+: {
+ cond_idv_char( ch );
+ y_val += cond_int( ch -
+157
+ + 1);
+ break; }
+case
+162
+:
+case
+163
+:
+case
+164
+:
+case
+165
+: {
+ cond_idv_char( ch );
+ dy_1 = (INTEGER) cond_int( ch -
+162
+ + 1);
+ y_val += dy_1; break; }
+case
+167
+:
+case
+168
+:
+case
+169
+:
+case
+170
+: {
+ cond_idv_char( ch );
+ dy_2 = (INTEGER) cond_int( ch -
+167
+ + 1);
+ y_val += dy_2; break; }
+
+
+case
+132
+:{
+ visible_cnt = TRUE; cond_string( ch,4 ); x_val += cond_int(4);
+ break;
+}
+case
+137
+:{
+ visible_cnt = TRUE; cond_string( ch, 8 );
+ break;
+}
+
+
+case
+239
+: case
+240
+:
+case
+241
+: case
+242
+: { long int i;
+ int special_nr;
+ special_nr = ch;
+ if( tex4ht_special( &ch, &i ) ){
+ if( ch == '+' ){
+
+if( i==0 ){ if( dvi_flag ){ dvi_flag = 0;
+if( !visible_cnt ) { U_CHAR str[256];
+ (IGNORED) sprintf(str, "--- empty picture --- %sidv[%d] ---\n",
+ job_name,page_n);
+ (IGNORED) printf("%s", str); (IGNORED) fprintf(log_file, "%s",str); }
+while( stack_depth-- > 0 ){
+ idv_char(
+142
+); file_n++; }
+
+ } }
+else{
+ if( dvi_flag ){
+cond_idv_char( special_nr );
+cond_idv_int( i, special_nr -
+239
+ + 1 );
+while( i-- ) cond_idv_char( get_char() );
+visible_cnt = TRUE;
+
+ }
+ else switch( get_char() ){
+ case '+': {
+{ U_CHAR str[256], *ch;
+ ch = str; while( --i ) *(ch++) = get_char(); *ch = '\0';
+ script(font_gif, job_name ,page_n+1, str);
+}
+
+
+ dvi_flag = TRUE; dvi_page = TRUE;
+
+visible_cnt = FALSE;
+bop_addr = advance_idv_page( bop_addr, cur_font );
+stack_depth = 0;
+set_loc(
+143
+, x_val );
+set_loc(
+157
+, y_val );
+
+ break; }
+ case '@': {
+while( --i ) (void) putc( get_char(), log_file );
+(IGNORED) putc( '\n', log_file );
+
+ break; }
+ default: { while( --i ) (void) get_char(); break; }
+} }
+
+ }
+ else while( i-- ) (void) get_char();
+ }else if( dvi_flag ){
+visible_cnt = TRUE;
+{
+ U_CHAR *ch;
+ int j;
+ ch = special_hd;
+ (IGNORED) putc( (unsigned)
+242
+, idv_file ); file_n++;
+ for(j=4; j--; ){ (IGNORED) putc( *ch, idv_file ); file_n++; ch++; }
+ while( *ch ){ (IGNORED) putc( *ch, idv_file ); file_n++; ch++; }
+ file_n += (int) i;
+ while( i-- ) (IGNORED) putc( get_char(), idv_file );
+}
+
+
+
+
+ }else {
+if( dvi_page || !page_n ){ dvi_page = FALSE;
+visible_cnt = FALSE;
+bop_addr = advance_idv_page( bop_addr, cur_font );
+stack_depth = 0;
+set_loc(
+143
+, x_val );
+set_loc(
+157
+, y_val );
+
+ }
+dvi_flag = TRUE;
+
+{
+ U_CHAR *ch;
+ int j;
+ ch = special_hd;
+ (IGNORED) putc( (unsigned)
+242
+, idv_file ); file_n++;
+ for(j=4; j--; ){ (IGNORED) putc( *ch, idv_file ); file_n++; ch++; }
+ while( *ch ){ (IGNORED) putc( *ch, idv_file ); file_n++; ch++; }
+ file_n += (int) i;
+ while( i-- ) (IGNORED) putc( get_char(), idv_file );
+}
+
+
+dvi_flag = FALSE;
+
+ }
+ break;
+}
+
+
+case
+141
+: {
+ push_stack();
+ stack_depth++;
+ cond_idv_char( ch );
+ break; }
+case
+142
+: { INTEGER cur_x, cur_y;
+ stack_depth--;
+ cur_x = (INTEGER) x_val; cur_y = (INTEGER) y_val; pop_stack();
+ if( dvi_flag ){
+ if( stack_depth<0 ){ warn_i_int( 24, page_n );
+
+cond_idv_char(
+146
+ );
+idv_int( x_val - cur_x - dx_1 - dx_2 );
+cond_idv_char(
+151
+ );
+idv_int( dx_1 );
+cond_idv_char(
+156
+ );
+idv_int( dx_2 );
+cond_idv_char(
+160
+ );
+idv_int( y_val - cur_y - dy_1 - dy_2 );
+cond_idv_char(
+165
+ );
+idv_int( dy_1 );
+cond_idv_char(
+170
+ );
+idv_int( dy_2 );
+cond_idv_char(
+141
+ ); file_n += 24;
+
+ }
+ cond_idv_char( ch );
+ }
+ break; }
+
+
+case
+246
+:
+case
+245
+:
+case
+244
+:
+case
+243
+: { idv_char( ch ); file_n++;
+ for( i=14; i; i-- ){ ch = get_char(); idv_char( ch ); file_n++; }
+ i = ch; i += ch = get_char(); idv_char( ch ); file_n++;
+ while( i-- ){ idv_copy(); }
+ break; }
+
+
+case
+235
+:
+case
+236
+:
+case
+237
+:
+case
+238
+: { int i;
+ idv_char( ch ); file_n++;
+ cur_font[0] = ch -
+235
+ + 2;
+ cur_font[1] = ch;
+ for( i=2; i <= cur_font[0]; i++ ){
+ ch = get_char(); idv_char( ch );
+ cur_font[i] = ch; file_n++; }
+ break; }
+
+
+default: {
+ if( (ch <
+171
+) || (ch >
+234
+) ) err_i(23);
+ else { idv_char( ch ); file_n++;
+ cur_font[0] = 1; cur_font[1] = ch; }
+ break;
+}
+
+ }
+
+ }
+
+{ int ch, i, mag;
+ U_CHAR str[256];
+ (IGNORED) fprintf(log_file, begin_char_gif);
+ dvi_flag = TRUE;
+ for( cur_fnt = font_tbl_size; cur_fnt--; ){
+
+(IGNORED) fprintf(log_file, lg_font_fmt,
+ font_tbl[cur_fnt].family_name,
+ font_tbl[cur_fnt].font_size,
+ (int)( font_tbl[cur_fnt].design_sz * 100 / 655360 / 10),
+ font_tbl[cur_fnt].mag);
+
+
+ for( i = font_tbl[cur_fnt].char_l - font_tbl[cur_fnt].char_f + 1;
+ i--; )
+ if( get_bit( font_tbl[cur_fnt].gif_on, i) ){
+ bop_addr = advance_idv_page( bop_addr, cur_font );
+ set_loc(
+143
+, (long int) mid_page_x );
+ set_loc(
+157
+, (long int) mid_page_y );
+
+{ INTEGER num;
+ num = font_tbl[cur_fnt].num;
+ if( num <=
+63
+ )
+ cond_idv_char( (int) (num +
+171
+) );
+ else if( dvi_flag ){
+ if( (num < 0) || (num > 16777215L) ) idv_int(
+238
+);
+ else if( num < 256 ) { idv_char(
+235
+); file_n++; }
+ else if( num < 65536L ) int_to_dvi((long int)
+236
+,2);
+ else int_to_dvi((long int)
+237
+,3);
+ cond_idv_char( (int) num );
+} }
+
+
+
+if( (ch = i + font_tbl[cur_fnt].char_f) > 127 ) {
+ if( ch < 256 ) cond_idv_char(133); else warn_i(23); }
+cond_idv_char( ch );
+mag = (int) ((double) font_tbl[cur_fnt].scale /
+ font_tbl[cur_fnt].design_sz * 10 );
+
+if( !dos_file_names ){
+ if( mag == 10 ) (IGNORED) sprintf(str, "%s-%x%s",
+ font_tbl[cur_fnt].name, ch, gif);
+ else (IGNORED) sprintf(str, "%s-%x-%x%s",
+ font_tbl[cur_fnt].name, mag, ch, gif);
+}
+
+
+
+if( dos_file_names ){
+ (IGNORED) strcpy(str, font_tbl[cur_fnt].name);
+ dos_gif_file(str, mag, ch);
+ strct(str,gif);
+}
+
+
+
+script(font_gif, job_name ,page_n, str);
+
+ }
+ }
+ (IGNORED) printf("Execute script `%slg'\n",
+ job_name);
+ (IGNORED) fclose( log_file );
+}
+
+
+
+idv_char(
+142
+); file_n += 2;
+idv_char(
+140
+ );
+(IGNORED) fseek(dvi_file, begin_postamble,
+0
+);
+begin_postamble = file_n;
+idv_char(
+248
+ ); file_n += 5;
+idv_int( bop_addr ); (IGNORED) fseek(dvi_file, 5L,
+1
+);
+for( i = 20; i; i-- ) idv_copy();
+
+
+i = (INTEGER) get_int(2) + 1; idv_char( (int) i >> 8 );
+idv_char( (int) i & 0xFF ); file_n += 2;
+if( !page_n ) page_n++; idv_char( page_n >> 8 );
+idv_char( (int) page_n & 0xFF ); file_n += 2;
+(IGNORED) fseek(dvi_file, 2L,
+1
+);
+
+
+eof_op_n -= 32;
+while( --eof_op_n ) idv_copy();
+idv_int(begin_postamble);
+(IGNORED) fseek(dvi_file, 4L,
+1
+); file_n += 4;
+idv_copy();
+for( i = 8 - file_n % 4; i; i-- ) idv_char(
+223
+ );
+
+
+
+ }
+
+
+ return 0;
+}
+
+
diff --git a/Build/source/texk/tex4htk/tex4ht.in b/Build/source/texk/tex4htk/tex4ht.in
new file mode 100644
index 00000000000..ab09ee6f80c
--- /dev/null
+++ b/Build/source/texk/tex4htk/tex4ht.in
@@ -0,0 +1,127 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% tex4ht.env / .tex4ht unix %
+% %
+% Notes: %
+% 1. Empty lines might be harmful %
+% 2. Tagged script segments <tag>...</tag> are scanned only if %
+% their names are specified within -ctag switches of tex4ht.c %
+% and t4ht.c. When -c switches are not supplied, a -cdefault %
+% is implicitly assumed. %
+% 3. Place this file in your work directory and/or root directory %
+% and/or in directory `xxx' of your choice. In the latest case, %
+% compile tex4ht.c and t4ht.c with `#define ENVFILE xxx', or %
+% provide the address of the file to tex4ht and t4ht throught %
+% the -e switch %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% * Replace `path', and possibly what follows, with appropriate %
+% content %
+% * A path may start with: %
+% ~ for environment variable HOME %
+% ~~ for environment variable TEX4HTTFM %
+% * A ! requests recursive search into subdirectories %
+% * Multiple t and i entries are allowed %
+% * When supported by kpathsea %
+% + t entries are ignored %
+% + the path before /ht-font/ is ignored in i records that don't %
+% represent real addresses %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+ tpath/fonts/tfm/!
+%
+<default>
+ipath/tex4ht/ht-fonts/iso8859/!
+ipath/tex4ht/ht-fonts/alias/!
+</default>
+%
+<mozhtf>
+ipath/tex4ht/ht-fonts/mozilla/!
+ipath/tex4ht/ht-fonts/unicode/!
+ipath/tex4ht/ht-fonts/iso8859/!
+ipath/tex4ht/ht-fonts/alias/!
+</mozhtf>
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% dvi-to-gif %
+% dvips options %
+% magnification: -x mag (e.g., -x 1200) %
+% page size: -T x,y (e.g., -T 14in,14in) %
+% ======== Using ImageMagick's convert is default here ======== %
+% for NetPBM use -cnetpbm in the command line for t4ht run, %
+% or exchange <default> </default> tags below, giving %
+% <convert> </convert> tags for ImageMagick section %
+<default>
+Gdvips -Ppdf -mode ibmvga -D 110 -f %%1 -pp %%2 > zz%%4.ps
+Gconvert -crop 0x0 -density 110x110 -transparent '#FFFFFF' zz%%4.ps %%3
+%% alternative for older ImageMagick, instead of the above line
+% Ggs -dNOPAUSE -sDEVICE=ppmraw -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r110x110 -sOutputFile=zz%%4.ppm -q zz%%4.ps -c quit
+% Gconvert -crop 0x0 -density 110x110 -transparent '#FFFFFF' zz%%4.ppm %%3
+% Grm zz%%4.ppm
+Grm zz%%4.ps
+</default>
+% ======== Using NetPBM ========
+<netpbm>
+Gdvips -Ppdf -mode ibmvga -D 110 -f %%1 -pp %%2 > zz%%4.ps
+Ggs -sDEVICE=ppm -r110 -sOutputFile=zz%%4.ppm -q -dbatch -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dNOPAUSE zz%%4.ps -c quit
+Gmv zz%%4.ppm temp.ppm
+Gpnmcrop temp.ppm > zz%%4.ppm
+Gppmtogif -interlace -transparent 1,1,1 zz%%4.ppm > %%3
+Grm zz%%4.ps
+Grm zz%%4.ppm
+Grm temp.ppm
+</netpbm>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Default scripts, shifted rightward 1 pos
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ s--- needs --- %%1.idv[%%2] ==> %%3 ---
+ b--- characters ---
+ g.gif
+% empty gifs %
+ Ecp empty.gif %%1%%2
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% t4ht -d%%2 %
+Mmv %%1 %%2%%3
+Ccp %%1 %%2%%3
+% t4ht -d%%2 -m%%1 %
+Achmod %%1 %%2%%3
+% removed protection %
+S*
+%
+% * Address for an automatically created bookkeeping file %
+% * Remove leading space to activate the record %
+% * The work directory is assumed for a default %
+ lpath/tex4ht.dir/tex4ht.fls
+%
+% validations, XSTL tranformations,... %
+ Xmake -f NSGMLS name=%%1 ext=%%2
+%
+<oo>
+%%% openoffice %
+.4os mkdir sxw-%%0.dir
+.4os mkdir sxw-%%0.dir/Pictures
+.4os mv %%1.4os sxw-%%0.dir/settings.xml
+.4os mv %%0.xml sxw-%%0.dir/content.xml
+% %
+.4om mkdir sxw-%%0.dir/%%1
+.4om mv %%1.4om sxw-%%0.dir/%%1/content.xml
+.4om cp sxw-%%0.dir/settings.xml sxw-%%0.dir/%%1/settings.xml
+% %
+.4of mkdir sxw-%%0.dir/META-INF
+.4of mv %%1.4of sxw-%%0.dir/META-INF/manifest.xml
+% %
+.4ot mv %%1.4ot sxw-%%0.dir/meta.xml
+.4oy mv %%1.4oy sxw-%%0.dir/styles.xml
+.4og mv %%1 sxw-%%0.dir/Pictures/%%1
+% %
+.4ox cd sxw-%%0.dir; zip -r %%0.sxw * ; cd ..
+% %
+.4ox mv sxw-%%0.dir/%%0.sxw .
+% %
+.4ox rm %%1.4ox
+.4ox rm -r -f sxw-%%0.dir
+%%% end openoffice %
+</oo>
+%
+% end of file %
+
+
diff --git a/Build/source/texk/tex4htk/uxhcontext b/Build/source/texk/tex4htk/uxhcontext
new file mode 100755
index 00000000000..1ebfaab47f4
--- /dev/null
+++ b/Build/source/texk/tex4htk/uxhcontext
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/uxhlatex b/Build/source/texk/tex4htk/uxhlatex
new file mode 100755
index 00000000000..2b18683d477
--- /dev/null
+++ b/Build/source/texk/tex4htk/uxhlatex
@@ -0,0 +1,9 @@
+
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,uni-html4]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,uni-html4]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,uni-html4]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/uxhmex b/Build/source/texk/tex4htk/uxhmex
new file mode 100755
index 00000000000..a22cf2c37fb
--- /dev/null
+++ b/Build/source/texk/tex4htk/uxhmex
@@ -0,0 +1,9 @@
+
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/uxhtex b/Build/source/texk/tex4htk/uxhtex
new file mode 100755
index 00000000000..8b726e9f43f
--- /dev/null
+++ b/Build/source/texk/tex4htk/uxhtex
@@ -0,0 +1,9 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/uxhtexi b/Build/source/texk/tex4htk/uxhtexi
new file mode 100755
index 00000000000..f1fc425ac76
--- /dev/null
+++ b/Build/source/texk/tex4htk/uxhtexi
@@ -0,0 +1,10 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,uni-html4}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/wcontext b/Build/source/texk/tex4htk/wcontext
new file mode 100755
index 00000000000..72b5b2d0acb
--- /dev/null
+++ b/Build/source/texk/tex4htk/wcontext
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -csymhtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/win32.mak b/Build/source/texk/tex4htk/win32.mak
new file mode 100644
index 00000000000..1db4eed9ff2
--- /dev/null
+++ b/Build/source/texk/tex4htk/win32.mak
@@ -0,0 +1,95 @@
+################################################################################
+#
+# Makefile : TeX4ht(k)
+# Author : Fabrice Popineau <Fabrice.Popineau@supelec.fr>
+# Platform : Win32, Microsoft VC++ 6.0, depends upon fpTeX 0.5 sources
+# Time-stamp: <04/03/20 00:36:48 popineau>
+#
+################################################################################
+root_srcdir = ..\..
+INCLUDE=$(INCLUDE);$(root_srcdir)\texk
+
+version = 1.15
+
+USE_KPATHSEA = 1
+USE_GNUW32 = 1
+
+!include <msvc/common.mak>
+
+# See INSTALL for compilation options.
+DEFS = $(DEFS) -DANSI
+
+objects = $(objdir)\tex4ht.obj
+
+programs = $(objdir)\tex4ht.exe $(objdir)\t4ht.exe $(objdir)\runht.exe
+
+perlscripts = htperl.pl # mk4ht.pl
+
+default: all
+
+all: $(objdir) $(programs) # tex4ht.bat
+
+$(objdir)\tex4ht.exe: $(objdir)\tex4ht.obj $(kpathsealib)
+ $(link) $(**) $(conlibs)
+
+$(objdir)\t4ht.exe: $(objdir)\t4ht.obj $(kpathsealib)
+ $(link) $(**) $(conlibs)
+
+$(objdir)\runht.exe: $(objdir)\runht.obj $(kpathsealib)
+ $(link) $(**) $(conlibs)
+
+tex4ht.env: tex4ht.in
+ sed -e "s;@texmf@;$(texmf:\=\\);" < tex4ht.in \
+ | sed -e "s;@prefix@;$(prefix:\=\\);g" \
+ | sed -e "s;@imbindir@;$(prefix:\=\\)\\ImageMagick;g" \
+ > tex4ht.env
+
+mk4ht.pl: mk4ht
+ -$(copy) mk4ht mk4ht.pl $(redir_stdout)
+
+#tex4ht.bat: tex4ht.perl
+# pl2bat -s .perl tex4ht.perl
+
+installdirs = $(texmf)\tex4ht\config $(prefix)\setupw32
+
+!include <msvc/config.mak>
+!include <msvc/install.mak>
+
+install:: install-dirs install-exec install-data
+
+install-exec:: $(programs)
+ -@echo $(verbose) & ( \
+ for %i in (ht httex htlatex httexi) do \
+ $(copy) $(objdir)\runht.exe $(bindir)\%i.exe \
+ ) $(redir_stdout)
+# we don't need it
+ -@$(del) $(bindir)\runht.exe
+ -@echo $(verbose) & ( \
+ if not "$(perlscripts)"=="" ( \
+ for %%s in ($(perlscripts)) do \
+ $(copy) %%s $(texmf)\perl\tex4ht\%%s $(redir_stdout) \
+ & $(perlcomp) $(perlcompflags) %%s >> $(win32perldir)\perlfiles.lst \
+ & $(runperl) -f %%s $(bindir)\%%~ns.exe $(redir_stderr) \
+ ) \
+ )
+
+install-data:: tex4ht.env
+# xcopy .\texmf $(texmf) /r/i/e/d/k/y
+# $(copy) .\tex4ht.env $(texmf)\tex4ht\config
+# $(copy) tex4ht.imagick $(prefix)\setupw32
+ $(copy) tex4ht.imagick $(texmf)\tex4ht\config
+# $(copy) tex4ht.netpbm $(prefix)\setupw32
+ $(copy) tex4ht.netpbm $(texmf)\tex4ht\config
+
+!include <msvc/clean.mak>
+
+extraclean::
+ -@$(del) tex4ht.env mk4ht.pl
+
+!include <msvc/rdepend.mak>
+!include "./depend.mak"
+
+#
+# Local Variables:
+# mode: makefile
+# End:
diff --git a/Build/source/texk/tex4htk/wlatex b/Build/source/texk/tex4htk/wlatex
new file mode 100755
index 00000000000..9a576c84a17
--- /dev/null
+++ b/Build/source/texk/tex4htk/wlatex
@@ -0,0 +1,9 @@
+
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,word]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,word]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,word]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -csymhtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/wmex b/Build/source/texk/tex4htk/wmex
new file mode 100755
index 00000000000..03bc3c01c99
--- /dev/null
+++ b/Build/source/texk/tex4htk/wmex
@@ -0,0 +1,9 @@
+
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -csymhtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/wtex b/Build/source/texk/tex4htk/wtex
new file mode 100755
index 00000000000..92d45352b6a
--- /dev/null
+++ b/Build/source/texk/tex4htk/wtex
@@ -0,0 +1,9 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -csymhtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/wtexi b/Build/source/texk/tex4htk/wtexi
new file mode 100755
index 00000000000..8be956ff6bf
--- /dev/null
+++ b/Build/source/texk/tex4htk/wtexi
@@ -0,0 +1,10 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,word}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -csymhtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/xhcontext b/Build/source/texk/tex4htk/xhcontext
new file mode 100755
index 00000000000..cc08a24cbb0
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhcontext
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhcontext.unix b/Build/source/texk/tex4htk/xhcontext.unix
new file mode 100755
index 00000000000..dcea73d8c16
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhcontext.unix
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhlatex b/Build/source/texk/tex4htk/xhlatex
new file mode 100755
index 00000000000..50681fc9c8c
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhlatex
@@ -0,0 +1,9 @@
+
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhmcontext b/Build/source/texk/tex4htk/xhmcontext
new file mode 100755
index 00000000000..1ebfaab47f4
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhmcontext
@@ -0,0 +1,7 @@
+
+ texexec --arg="opt-arg=$2" --use=tex4ht $5 $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhmex b/Build/source/texk/tex4htk/xhmex
new file mode 100755
index 00000000000..48f0149c7d4
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhmex
@@ -0,0 +1,9 @@
+
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhmlatex b/Build/source/texk/tex4htk/xhmlatex
new file mode 100755
index 00000000000..d33bc74e6a1
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhmlatex
@@ -0,0 +1,9 @@
+
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,mathml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,mathml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ latex $5 '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,xhtml,mathml]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhmmex b/Build/source/texk/tex4htk/xhmmex
new file mode 100755
index 00000000000..52338ffdc0c
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhmmex
@@ -0,0 +1,9 @@
+
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ mex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhmtex b/Build/source/texk/tex4htk/xhmtex
new file mode 100755
index 00000000000..dc731575895
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhmtex
@@ -0,0 +1,9 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhmtexexec b/Build/source/texk/tex4htk/xhmtexexec
new file mode 100755
index 00000000000..d2d8ad431d3
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhmtexexec
@@ -0,0 +1,12 @@
+
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhmtexi b/Build/source/texk/tex4htk/xhmtexi
new file mode 100755
index 00000000000..77f9ee6c72d
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhmtexi
@@ -0,0 +1,10 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml,mathml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3 -cunihtf
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/xhtex b/Build/source/texk/tex4htk/xhtex
new file mode 100755
index 00000000000..a159c9fd355
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhtex
@@ -0,0 +1,9 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhtexexec b/Build/source/texk/tex4htk/xhtexexec
new file mode 100755
index 00000000000..e2cec28146e
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhtexexec
@@ -0,0 +1,12 @@
+
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ echo '\\expandafter\\def\\csname tex4ht\\endcsname {'$2',xhtml}\\input tex4ht.sty \\input' $1 > $1.tmp
+ texexec $1.tmp
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 ## -d~/WWW/temp/ -m644
+
+
+
diff --git a/Build/source/texk/tex4htk/xhtexi b/Build/source/texk/tex4htk/xhtexi
new file mode 100755
index 00000000000..20919f0a38f
--- /dev/null
+++ b/Build/source/texk/tex4htk/xhtexi
@@ -0,0 +1,10 @@
+
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex $5 '\def\Link#1.a.b.c.{\expandafter\def\csname tex4ht\endcsname{\expandafter\def\csname tex4ht\endcsname{#1,xhtml}\input tex4ht.sty }}\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\let\svrm=\rm\def\rm{\svrm\ifx\c\comment\def\rm{\let\rm=\svrm\catcode`\@=12\catcode`\\=0 \csname tex4ht\endcsname\catcode`\@=0\catcode`\\=13 }\expandafter\rm\fi}\HCode '$2'.a.b.c.\input ' $1
+ tex4ht -f/$1 -i~/tex4ht.dir/texmf/tex4ht/ht-fonts/$3
+ t4ht -f/$1 $4 -cvalidate ## -d~/WWW/temp/ -m644
+# texindex ?
+
+
+
diff --git a/Build/source/texk/tex4htk/xv4ht.java b/Build/source/texk/tex4htk/xv4ht.java
new file mode 100644
index 00000000000..d83d7be5854
--- /dev/null
+++ b/Build/source/texk/tex4htk/xv4ht.java
@@ -0,0 +1,231 @@
+/**********************************************************/
+/* xv4ht.java 2005-02-23-01:05 */
+/* Copyright (C) 2005 Eitan M. Gurari */
+/* */
+/* This work may be distributed and/or modified under the */
+/* conditions of the LaTeX Project Public License, either */
+/* version 1.3 of this license or (at your option) any */
+/* later version. The latest version of this license is */
+/* in */
+/* http://www.latex-project.org/lppl.txt */
+/* and version 1.3 or later is part of all distributions */
+/* of LaTeX version 2003/12/01 or later. */
+/* */
+/* This work has the LPPL maintenance status "maintained".*/
+/* */
+/* This Current Maintainer of this work */
+/* is Eitan M. Gurari. */
+/* */
+/* If you modify this program your changing its signature */
+/* with a directive of the following form will be */
+/* appreciated. */
+/* #define PLATFORM "signature" */
+/* */
+/* gurari@cse.ohio-state.edu */
+/* http://www.cse.ohio-state.edu/~gurari */
+/**********************************************************/
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Hashtable;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.DefaultHandler;
+
+class Xv4htContentHandler extends DefaultHandler {
+
+ String catalog;
+ boolean withinDTD = false;
+ Xv4htErrorHandler errHandler;
+ Xv4htLexicalHandler lexicalHandler;
+
+ public Xv4htContentHandler(XMLReader xmlReader, String catalog){
+ super();
+ this.catalog = catalog;
+ lexicalHandler = new Xv4htLexicalHandler();
+try {
+ xmlReader.setProperty(
+ "http://xml.org/sax/properties/lexical-handler",
+ lexicalHandler
+ );
+}
+catch (SAXNotRecognizedException e) {
+ System.err.println(
+ "err 1");
+ return;
+}
+catch (SAXNotSupportedException e) {
+ System.err.println(
+ "err 2");
+ return;
+}
+
+ errHandler = new Xv4htErrorHandler();
+xmlReader.setErrorHandler( errHandler );
+
+ xmlReader.setEntityResolver( new Xv4htEntityResolver() );
+
+ }
+
+ public void startPrefixMapping(String prefix, String uri){
+ }
+
+ public void endPrefixMapping(String prefix) {
+ }
+
+ public void ignorableWhitespace(
+ char[] ch, int start, int length) {
+ }
+
+ public void notationDecl(
+ String name, String publicId, String systemId) {
+ }
+ public class Xv4htEntityResolver implements EntityResolver {
+
+ private Hashtable entities = new Hashtable();
+
+ public Xv4htEntityResolver() {
+ try{
+ FileReader myIn = new FileReader( catalog );
+ while( true ){
+ int c;
+ String publicID = "";
+ String systemID = "";
+
+ while( (c = myIn.read()) != '\"' ){
+ if( c == -1 ){ break; }
+ }
+ if( c == -1 ){ break; }
+ while( (c = myIn.read()) != '\"' ){
+ publicID += (char) c;
+ if( c == -1 ){ break; }
+ }
+ if( c == -1 ){ break; }
+
+ while( (c = myIn.read()) != '\"' ){
+ if( c == -1 ){ break; }
+ }
+ if( c == -1 ){ break; }
+ while( (c = myIn.read()) != '\"' ){
+ systemID += (char) c;
+ if( c == -1 ){ break; }
+ }
+ if( c == -1 ){ break; }
+
+ entities.put(publicID, systemID);
+ }
+} catch(java.io.IOException e){ }
+
+ }
+
+ public InputSource resolveEntity(String publicID,
+ String systemID) throws SAXException {
+ if( publicID== null ){ return null; }
+ if( entities.containsKey(publicID) ){
+ String url = (String) entities.get(publicID);
+ InputSource local = new InputSource(url);
+ return local;
+ }
+ return null;
+ }
+
+}
+
+ class Xv4htLexicalHandler implements LexicalHandler {
+ public void startDTD(String name, String publicId, String systemId)
+ throws SAXException {
+ withinDTD = true;
+ errHandler.errorOff();
+ }
+
+ public void endDTD() throws SAXException {
+ withinDTD = false;
+ errHandler.errorOn();
+ }
+public void comment (char[] text, int start, int length)
+ throws SAXException {
+}
+ public void startEntity(String name) throws SAXException {}
+ public void endEntity(String name) throws SAXException {}
+ public void startCDATA() throws SAXException {}
+ public void endCDATA() throws SAXException {}
+}
+
+
+}
+
+class Xv4htErrorHandler extends DefaultHandler {
+ private boolean errOn = true;
+
+ public void warning(SAXParseException e) {
+ showError( e, "Warning" );
+ }
+
+ public void error(SAXParseException e) {
+ showError( e, "Warning" );
+ }
+
+ public void fatalError(SAXParseException e) {
+ showError( e, "Warning" );
+ }
+
+ public void errorOff() {
+ errOn = false;
+ }
+
+ public void errorOn() {
+ errOn = true;
+ }
+
+ private void showError(SAXParseException e, String m){
+ if( errOn ){
+ int c = e.getColumnNumber();
+ System.out.println(
+ m + ": " + e.getSystemId() + " " + e.getLineNumber()
+ + ((c==-1)? "" : ("," + c))
+ + ": " + e.getMessage()
+ );
+ } }
+}
+
+public class xv4ht{
+ static public void main (String[] args)
+ throws SAXException,
+ ParserConfigurationException,
+ IOException
+ {
+ SAXParserFactory factory =
+ SAXParserFactory.newInstance();
+ factory.setValidating( true );
+ factory.setNamespaceAware( true );
+ SAXParser saxParser = factory.newSAXParser();
+ XMLReader xmlReader = saxParser.getXMLReader();
+ if( args.length != 2 ){
+ System.out.print(
+ "--- A command line of the following form is required ---"
+ + "\n java [-cp <path>] xv4ht <filename> <catalog>"
+ + "\nreceived:\n java"
+ );
+ for(int i=0; i<args.length; i++ ){
+ System.out.print( " " + args[i] );
+ }
+ System.out.println();
+ System.exit( 1 );
+}
+
+ xmlReader.setContentHandler( new Xv4htContentHandler(xmlReader, args[1])
+ );
+ xmlReader.parse ( new File(args[0]).toURL().toString() );
+ }
+}
+