summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-03-28 18:04:45 +0000
committerKarl Berry <karl@freefriends.org>2011-03-28 18:04:45 +0000
commitfa87be12943833d86597c869862f00663ff7086c (patch)
tree258396699093fc519f6bc09549d807b7701493e1
parentee28d50f86cd8b9d1a3fbd3109fbea215f8f7b55 (diff)
find dvipdft in cwd for now
git-svn-id: svn://tug.org/texlive/trunk@21863 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/dvipdfmx/Makefile.am2
-rw-r--r--Build/source/texk/dvipdfmx/Makefile.in4
-rwxr-xr-xBuild/source/texk/dvipdfmx/configure3
-rwxr-xr-xBuild/source/texk/dvipdfmx/dvipdft105
4 files changed, 109 insertions, 5 deletions
diff --git a/Build/source/texk/dvipdfmx/Makefile.am b/Build/source/texk/dvipdfmx/Makefile.am
index f029d0c8fca..6bd3206c60b 100644
--- a/Build/source/texk/dvipdfmx/Makefile.am
+++ b/Build/source/texk/dvipdfmx/Makefile.am
@@ -24,7 +24,7 @@ bin_PROGRAMS = dvipdfmx
if WIN32
noinst_PROGRAMS = call_dvipdfmx
else !WIN32
-dist_bin_SCRIPTS = src/dvipdft
+dist_bin_SCRIPTS = dvipdft
endif !WIN32
dvipdfmx_SOURCES = \
diff --git a/Build/source/texk/dvipdfmx/Makefile.in b/Build/source/texk/dvipdfmx/Makefile.in
index 561db05cef9..3e60d7ebc75 100644
--- a/Build/source/texk/dvipdfmx/Makefile.in
+++ b/Build/source/texk/dvipdfmx/Makefile.in
@@ -120,7 +120,7 @@ am_dvipdfmx_OBJECTS = dvipdfmx-agl.$(OBJEXT) \
dvipdfmx-vf.$(OBJEXT) dvipdfmx-xbb.$(OBJEXT)
dvipdfmx_OBJECTS = $(am_dvipdfmx_OBJECTS)
am__DEPENDENCIES_1 =
-am__dist_bin_SCRIPTS_DIST = src/dvipdft
+am__dist_bin_SCRIPTS_DIST = dvipdft
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -306,7 +306,7 @@ top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I ../../m4
AM_CFLAGS = $(WARNING_CFLAGS)
EXTRA_DIST = $(DVIPDFMX_TREE) $(DVIPDFMX_TREE)-PATCHES
-@WIN32_FALSE@dist_bin_SCRIPTS = src/dvipdft
+@WIN32_FALSE@dist_bin_SCRIPTS = dvipdft
dvipdfmx_SOURCES = \
$(DVIPDFMX_TREE)/src/agl.c \
$(DVIPDFMX_TREE)/src/agl.h \
diff --git a/Build/source/texk/dvipdfmx/configure b/Build/source/texk/dvipdfmx/configure
index 7b55ff98663..ada68009638 100755
--- a/Build/source/texk/dvipdfmx/configure
+++ b/Build/source/texk/dvipdfmx/configure
@@ -774,8 +774,7 @@ CFLAGS
LDFLAGS
LIBS
CPPFLAGS
-CPP
-CPPFLAGS'
+CPP'
# Initialize some variables set by options.
diff --git a/Build/source/texk/dvipdfmx/dvipdft b/Build/source/texk/dvipdfmx/dvipdft
new file mode 100755
index 00000000000..3bcd0027db1
--- /dev/null
+++ b/Build/source/texk/dvipdfmx/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"