summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfmx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-06-03 22:54:21 +0000
committerKarl Berry <karl@freefriends.org>2009-06-03 22:54:21 +0000
commit37f7f3460f7d20564974e440e873a84ca4570529 (patch)
tree6b1b60420fb168e22a806aa343dcc7fe262df0b2 /Build/source/texk/dvipdfmx
parent27473cf1907bae702dd7df5f0d58b789c9284a99 (diff)
revised dvipdft script for dvipdfmx, from matthias
git-svn-id: svn://tug.org/texlive/trunk@13619 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfmx')
-rw-r--r--Build/source/texk/dvipdfmx/ChangeLog.TL6
-rw-r--r--Build/source/texk/dvipdfmx/src/Makefile.am1
-rw-r--r--Build/source/texk/dvipdfmx/src/Makefile.in90
-rwxr-xr-xBuild/source/texk/dvipdfmx/src/dvipdft105
4 files changed, 187 insertions, 15 deletions
diff --git a/Build/source/texk/dvipdfmx/ChangeLog.TL b/Build/source/texk/dvipdfmx/ChangeLog.TL
index c479ac5c195..0ab7893e3fb 100644
--- a/Build/source/texk/dvipdfmx/ChangeLog.TL
+++ b/Build/source/texk/dvipdfmx/ChangeLog.TL
@@ -1,6 +1,12 @@
ChangeLog.TL: Changes for dvipdfmx (teTeX / TeX Live)
=====================================================
+2009-06-04 Karl Berry <karl@tug.org>
+
+ * src/Makefile.am (dist_bin_SCRIPTS): dvipdft.
+ * src/dvipdft: revised script from Matthias to replace
+ version in dvipdfm.
+
2009-05-27 Peter Breitenlohner <peb@mppmu.mpg.de>
Adapt to TL2009 build system.
diff --git a/Build/source/texk/dvipdfmx/src/Makefile.am b/Build/source/texk/dvipdfmx/src/Makefile.am
index bdd8e9ecf38..08f51dccff8 100644
--- a/Build/source/texk/dvipdfmx/src/Makefile.am
+++ b/Build/source/texk/dvipdfmx/src/Makefile.am
@@ -7,6 +7,7 @@ INCLUDES = $(KPATHSEA_INCLUDES) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES)
AM_CPPFLAGS =
bin_PROGRAMS = dvipdfmx
+dist_bin_SCRIPTS = dvipdft
dvipdfmx_SOURCES = \
agl.c bmpimage.c cff.c cff_dict.c cid.c cidtype0.c cidtype2.c \
diff --git a/Build/source/texk/dvipdfmx/src/Makefile.in b/Build/source/texk/dvipdfmx/src/Makefile.in
index 8cc0fd2b5b0..480ba54de30 100644
--- a/Build/source/texk/dvipdfmx/src/Makefile.in
+++ b/Build/source/texk/dvipdfmx/src/Makefile.in
@@ -15,6 +15,7 @@
@SET_MAKE@
+
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -36,7 +37,8 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = dvipdfmx$(EXEEXT)
subdir = src
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../m4/cho-kpse.m4 \
$(top_srcdir)/../../m4/cho-libs.m4 \
@@ -56,7 +58,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/../../build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_dvipdfmx_OBJECTS = agl.$(OBJEXT) bmpimage.$(OBJEXT) cff.$(OBJEXT) \
cff_dict.$(OBJEXT) cid.$(OBJEXT) cidtype0.$(OBJEXT) \
@@ -84,6 +86,28 @@ am_dvipdfmx_OBJECTS = agl.$(OBJEXT) bmpimage.$(OBJEXT) cff.$(OBJEXT) \
dvipdfmx_OBJECTS = $(am_dvipdfmx_OBJECTS)
dvipdfmx_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+SCRIPTS = $(dist_bin_SCRIPTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp
am__depfiles_maybe = depfiles
@@ -224,6 +248,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = $(KPATHSEA_INCLUDES) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES)
AM_CPPFLAGS =
+dist_bin_SCRIPTS = dvipdft
dvipdfmx_SOURCES = \
agl.c bmpimage.c cff.c cff_dict.c cid.c cidtype0.c cidtype2.c \
cmap.c cmap_read.c cmap_write.c cs_type2.c \
@@ -331,6 +356,40 @@ clean-binPROGRAMS:
dvipdfmx$(EXEEXT): $(dvipdfmx_OBJECTS) $(dvipdfmx_DEPENDENCIES)
@rm -f dvipdfmx$(EXEEXT)
$(LINK) $(dvipdfmx_OBJECTS) $(dvipdfmx_LDADD) $(LIBS)
+install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-dist_binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -519,9 +578,9 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
-all-am: Makefile $(PROGRAMS)
+all-am: Makefile $(PROGRAMS) $(SCRIPTS)
installdirs:
- for dir in "$(DESTDIR)$(bindir)"; do \
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -577,7 +636,7 @@ install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-binPROGRAMS
+install-exec-am: install-binPROGRAMS install-dist_binSCRIPTS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-html: install-html-am
@@ -618,7 +677,7 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-binPROGRAMS
+uninstall-am: uninstall-binPROGRAMS uninstall-dist_binSCRIPTS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
.MAKE: install-am install-exec-am install-strip uninstall-am
@@ -627,15 +686,16 @@ uninstall-am: uninstall-binPROGRAMS
clean-generic clean-libtool ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-exec-hook \
- install-html install-html-am install-info install-info-am \
- install-man install-pdf install-pdf-am install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-binPROGRAMS uninstall-hook
+ install-binPROGRAMS install-data install-data-am \
+ install-dist_binSCRIPTS install-dvi install-dvi-am \
+ install-exec install-exec-am install-exec-hook install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-dist_binSCRIPTS uninstall-hook
@KPATHSEA_RULE@
diff --git a/Build/source/texk/dvipdfmx/src/dvipdft b/Build/source/texk/dvipdfmx/src/dvipdft
new file mode 100755
index 00000000000..3bcd0027db1
--- /dev/null
+++ b/Build/source/texk/dvipdfmx/src/dvipdft
@@ -0,0 +1,105 @@
+#!/bin/sh
+# dvipdft, completely rewritten by Thomas Esser for teTeX after an
+# original script by Mark A. Wicks
+#
+# Thomas Esser. Public Domain.
+#
+# Modified by Matthias Franz for dvipdfmx (when running as dvipdfm) and
+# TeX Live.
+
+# This script makes a first (fast) run with dvipdfm, then calls gs on
+# the resulting pdf file to get the thumbnails and finally calls dvipdfm.
+
+progname=dvipdft
+version=20090604.0046
+
+# set trap for error
+trap '
+ echo "$progname: fatal error." >&2
+ exit 1
+' 1
+
+test -f /bin/sh5 && test -z "$RUNNING_SH5" \
+ && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \
+ && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; }
+unset RUNNING_SH5
+
+test -f /bin/bsh && test -z "$RUNNING_BSH" \
+ && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \
+ && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; }
+unset RUNNING_BSH
+
+# hack around a bug in zsh:
+test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
+
+help="Usage: $progname [options] dvifile
+ $progname --help
+ $progname --version"
+
+quoteit()
+{
+ echo "x$1" | sed "s@.@@; s@'@'\\\\''@; s@^@'@; s@\$@'@"
+}
+
+# process args 1 to (n-1) and scan for a -o argument keep a properly
+# quoted backup of the options, so that they can be restored later
+unset s outfile
+while test $# -gt 1; do
+ case $1 in
+ -o) outfile=$2;;
+ esac
+ s="$s${s+ }"`quoteit "$1"`
+ shift
+done
+
+# check for last argument
+case $1 in
+ --help)
+ echo "$help"
+ exit 0
+ ;;
+ --version)
+ echo "$progname version $version by Thomas Esser and others"
+ exit 0
+ ;;
+ "")
+ echo "$help"
+ exit 1
+ ;;
+esac
+
+# args 1 to (n-1) are gone, last one must be the dvifile
+dvifile="$1"
+
+# outfile comes from -o argument, else it is derived from the input file
+test -n "$outfile" \
+ || outfile=`echo "$dvifile" | sed 's@.*/@@; s@\.dvi$@@; s@$@.pdf@'`
+
+# outBase is part of the thumbname files just as dvipdfm expects them:
+outBase=`echo "$outfile" | sed 's@\.pdf$@@'`
+
+ls "$outBase".[1-9]* >/dev/null 2>&1 && {
+ echo "$progname: Please move the following files out of the way:" >&2
+ ls "$outBase".[1-9]* >&2
+ exit 1
+}
+
+# restore args 1 to (n-1):
+eval set x "$s"; shift
+
+# set trap for cleanup
+trap '
+ rm -f "$outBase".[1-9]*
+' 0
+
+# Run dvipdfm with the fastest options for the first pass
+echo "$progname: running dvipdfm $@ -z0 $dvifile" >&2
+dvipdfm ${1+"$@"} -z0 "$dvifile"
+
+# run gs
+echo "$progname: running gs" >&2
+gs -r10 -dNOPAUSE -dBATCH -sDEVICE=png256 -sOutputFile="$outBase.%d" "$outfile"
+
+# run dvipdfm with the users specified options for the last pass
+echo "$progname: running dvipdfm -t $@ $dvifile" >&2
+dvipdfm ${1+"$@"} -t "$dvifile"