diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-10-25 12:33:38 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-10-25 12:33:38 +0000 |
commit | 30b7bdb81416c44fcd47a9b0a57e0c0f810a725f (patch) | |
tree | 27efce7f4ed350b50d35c51f545aaa226b8c1afe /Build/source/utils | |
parent | edc3291a11eb0048e750f5861e9dd447a7e959a4 (diff) |
psutils 1.21
git-svn-id: svn://tug.org/texlive/trunk@31995 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils')
108 files changed, 6850 insertions, 5419 deletions
diff --git a/Build/source/utils/README b/Build/source/utils/README index 97ec85b5ad0..a8c922d1fda 100644 --- a/Build/source/utils/README +++ b/Build/source/utils/README @@ -18,12 +18,8 @@ pmx 2.7.0 - checked 11apr13 ps2eps 1.68 - checked 10may12 http://tm.uka.de/~bless/ps2eps -psutils p17 - checked 10may12 - http://www.tardis.ed.ac.uk/~ajcd/psutils/index.html - -> http://mirror.ctan.org/support/psutils/ - https://savannah.nongnu.org/bugs/?30782 - -> http://www.connochaetos.org/misc/psutils-libre-1.17.tar.gz - (Fabrice made small modifications for Windows, it seems) +psutils 1.21 - checked 25oct13 + https://github.com/rrthomas/psutils/archive/v1.21.tar.gz t1utils 1.38 - checked 3oct13 http://www.lcdf.org/type/ diff --git a/Build/source/utils/configure b/Build/source/utils/configure index 731266b0185..a9d42569a38 100755 --- a/Build/source/utils/configure +++ b/Build/source/utils/configure @@ -3435,6 +3435,10 @@ $as_echo "$as_me: Assuming \`--enable-psutils=$enable_psutils'" >&6;} ;; esac +test "x$enable_psutils" = xno || { + need_paper=yes +} + ## utils/t1utils/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/t1utils/ ## configure options and TL libraries required for t1utils # Check whether --enable-t1utils was given. diff --git a/Build/source/utils/psutils/ChangeLog b/Build/source/utils/psutils/ChangeLog index 52e7aad99db..aa61498cd2b 100644 --- a/Build/source/utils/psutils/ChangeLog +++ b/Build/source/utils/psutils/ChangeLog @@ -1,3 +1,13 @@ +2013-10-25 Peter Breitenlohner <peb@mppmu.mpg.de> + + Import psutils-1.21. + * version.ac: New file. + * Makefile.am, ac/withenable.ac, configure.ac: Adapt. + + * psutils.test: Add paper size (-pa4) for psnup and pstops. + * tests/playnup.2, tests/playps.2, tests/playres.ps: + Test results for Version 1.21. + 2013-07-05 Peter Breitenlohner <peb@mppmu.mpg.de> * Makefile.am: Moved Makefile fragments to ../../am/. diff --git a/Build/source/utils/psutils/Makefile.am b/Build/source/utils/psutils/Makefile.am index 983519af11a..47801d0bd0e 100644 --- a/Build/source/utils/psutils/Makefile.am +++ b/Build/source/utils/psutils/Makefile.am @@ -3,8 +3,6 @@ ## Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. ## -ACLOCAL_AMFLAGS = -I ../../m4 - ## We want to re-distribute the whole original psutils source tree. EXTRA_DIST = $(PSUTILS_TREE) ## Patches applied to the original source tree @@ -14,84 +12,39 @@ EXTRA_DIST += $(PSUTILS_TREE)-PATCHES dist-hook: rm -rf `find $(distdir) -name .svn -o -name .deps -o -name .dirstamp -o -name '*.$(OBJEXT)'` -OS = UNIX -PAPER = a4 - -AM_CPPFLAGS = -DUNIX -DPAPER=\"$(PAPER)\" +AM_CPPFLAGS = $(PAPER_INCLUDES) -D_Noreturn= -D_GL_ATTRIBUTE_CONST= AM_CFLAGS = $(WARNING_CFLAGS) -bin_PROGRAMS = epsffit psbook psnup psresize psselect pstops +noinst_LIBRARIES = libpsutils.a -epsffit_SOURCES = \ - @PSUTILS_TREE@/config.h \ - @PSUTILS_TREE@/epsffit.c \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h - -psbook_SOURCES = \ - @PSUTILS_TREE@/config.h \ - @PSUTILS_TREE@/psbook.c \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h \ - @PSUTILS_TREE@/psutil.c \ - @PSUTILS_TREE@/psutil.h - -psnup_SOURCES = \ - @PSUTILS_TREE@/config.h \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h \ - @PSUTILS_TREE@/psnup.c \ +libpsutils_a_SOURCES = \ @PSUTILS_TREE@/psspec.c \ @PSUTILS_TREE@/psspec.h \ @PSUTILS_TREE@/psutil.c \ @PSUTILS_TREE@/psutil.h -psresize_SOURCES = \ - @PSUTILS_TREE@/config.h \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h \ - @PSUTILS_TREE@/psresize.c \ - @PSUTILS_TREE@/psspec.c \ - @PSUTILS_TREE@/psspec.h \ - @PSUTILS_TREE@/psutil.c \ - @PSUTILS_TREE@/psutil.h +$(libpsutils_a_OBJECTS): $(PAPER_DEPEND) -psselect_SOURCES = \ - @PSUTILS_TREE@/config.h \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h \ - @PSUTILS_TREE@/psselect.c \ - @PSUTILS_TREE@/psutil.c \ - @PSUTILS_TREE@/psutil.h +bin_PROGRAMS = epsffit psbook psnup psresize psselect pstops -pstops_SOURCES = \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h \ - @PSUTILS_TREE@/psspec.c \ - @PSUTILS_TREE@/psspec.h \ - @PSUTILS_TREE@/pstops.c \ - @PSUTILS_TREE@/psutil.c \ - @PSUTILS_TREE@/psutil.h +epsffit_SOURCES = @PSUTILS_TREE@/epsffit.c + +psbook_SOURCES = @PSUTILS_TREE@/psbook.c + +psnup_SOURCES = @PSUTILS_TREE@/psnup.c + +psresize_SOURCES = @PSUTILS_TREE@/psresize.c + +psselect_SOURCES = @PSUTILS_TREE@/psselect.c + +pstops_SOURCES = @PSUTILS_TREE@/pstops.c + +LDADD = libpsutils.a $(PAPER_LIBS) -## Omitted fixmacps depending on removed non-free files -## $(PSUTILS_TREE)/md{68,71}_0.ps. perl_scripts = \ extractres \ - fixdlsrps \ - fixfmps \ - fixpsditps \ - fixpspps \ - fixscribeps \ - fixtpps \ - fixwfwps \ - fixwpps \ - fixwwps \ includeres \ - psmerge - -sh_scripts = \ - getafm \ - showchar + psjoin scriptsdir = texmf-dist/scripts/psutils nodist_bin_SCRIPTS = @@ -99,30 +52,26 @@ nodist_bin_SCRIPTS = include $(srcdir)/../../am/script_links.am texmfdir = $(datarootdir)/$(scriptsdir) -nodist_texmf_SCRIPTS = $(perl_scripts:=.pl) -texmf_SCRIPTS = \ - $(PSUTILS_TREE)/getafm.sh \ - $(PSUTILS_TREE)/showchar.sh +texmf_SCRIPTS = $(perl_scripts:=.pl) -install-data-hook: install-perl-links install-sh-links +install-data-hook: install-perl-links uninstall-hook: uninstall-links -nodist_man1_MANS = \ - $(bin_PROGRAMS:$(EXEEXT)=.1) \ - $(perl_scripts:=.1) \ - getafm.1 - -CLEANFILES = $(nodist_bin_SCRIPTS) $(nodist_texmf_SCRIPTS) $(nodist_man1_MANS) - -PERL = /usr/bin/env perl -MAKETEXT = $(AM_V_GEN)$(PERL) $(srcdir)/$(PSUTILS_TREE)/maketext - -%.pl: $(PSUTILS_TREE)/%.pl patchlev.h - $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $< >$@ - -%.1: $(PSUTILS_TREE)/%.man patchlev.h - $(MAKETEXT) PAPER=$(PAPER) "MAN=$(nodist_man1_MANS)" $< >$@ +man1_MANS = \ + @PSUTILS_TREE@/epsffit.1 \ + @PSUTILS_TREE@/extractres.1 \ + @PSUTILS_TREE@/includeres.1 \ + @PSUTILS_TREE@/psbook.1 \ + @PSUTILS_TREE@/psjoin.1 \ + @PSUTILS_TREE@/psnup.1 \ + @PSUTILS_TREE@/psresize.1 \ + @PSUTILS_TREE@/psselect.1 \ + @PSUTILS_TREE@/pstops.1 \ + @PSUTILS_TREE@/psutils.1 + +## Rebuild libpaper +@PAPER_RULE@ ## Tests ## diff --git a/Build/source/utils/psutils/Makefile.in b/Build/source/utils/psutils/Makefile.in index 0786b3ed0fb..59baeb1aff9 100644 --- a/Build/source/utils/psutils/Makefile.in +++ b/Build/source/utils/psutils/Makefile.in @@ -15,6 +15,7 @@ @SET_MAKE@ + VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -81,7 +82,9 @@ bin_PROGRAMS = epsffit$(EXEEXT) psbook$(EXEEXT) psnup$(EXEEXT) \ psresize$(EXEEXT) psselect$(EXEEXT) pstops$(EXEEXT) DIST_COMMON = $(srcdir)/../../am/script_links.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(top_srcdir)/psutils-1.17/patchlev.h.in \ + $(am__configure_deps) $(srcdir)/config.h.in \ + $(top_srcdir)/psutils-1.21/extractres \ + $(top_srcdir)/psutils-1.21/psjoin \ $(top_srcdir)/../../build-aux/depcomp \ $(top_srcdir)/../../build-aux/test-driver ChangeLog \ ../../build-aux/compile ../../build-aux/config.guess \ @@ -96,52 +99,59 @@ DIST_COMMON = $(srcdir)/../../am/script_links.am $(srcdir)/Makefile.in \ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ + $(top_srcdir)/../../m4/kpse-paper-flags.m4 \ $(top_srcdir)/../../m4/kpse-warnings.m4 \ - $(top_srcdir)/../../m4/kpse-win32.m4 \ + $(top_srcdir)/../../m4/kpse-win32.m4 $(top_srcdir)/version.ac \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = patchlev.h +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = extractres.pl includeres.pl psjoin.pl CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libpsutils_a_AR = $(AR) $(ARFLAGS) +libpsutils_a_LIBADD = +am__dirstamp = $(am__leading_dot)dirstamp +am_libpsutils_a_OBJECTS = @PSUTILS_TREE@/psspec.$(OBJEXT) \ + @PSUTILS_TREE@/psutil.$(OBJEXT) +libpsutils_a_OBJECTS = $(am_libpsutils_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(texmfdir)" \ - "$(DESTDIR)$(man1dir)" + "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) -am__dirstamp = $(am__leading_dot)dirstamp -am_epsffit_OBJECTS = @PSUTILS_TREE@/epsffit.$(OBJEXT) \ - @PSUTILS_TREE@/pserror.$(OBJEXT) +am_epsffit_OBJECTS = @PSUTILS_TREE@/epsffit.$(OBJEXT) epsffit_OBJECTS = $(am_epsffit_OBJECTS) epsffit_LDADD = $(LDADD) -am_psbook_OBJECTS = @PSUTILS_TREE@/psbook.$(OBJEXT) \ - @PSUTILS_TREE@/pserror.$(OBJEXT) \ - @PSUTILS_TREE@/psutil.$(OBJEXT) +am__DEPENDENCIES_1 = +epsffit_DEPENDENCIES = libpsutils.a $(am__DEPENDENCIES_1) +am_psbook_OBJECTS = @PSUTILS_TREE@/psbook.$(OBJEXT) psbook_OBJECTS = $(am_psbook_OBJECTS) psbook_LDADD = $(LDADD) -am_psnup_OBJECTS = @PSUTILS_TREE@/pserror.$(OBJEXT) \ - @PSUTILS_TREE@/psnup.$(OBJEXT) @PSUTILS_TREE@/psspec.$(OBJEXT) \ - @PSUTILS_TREE@/psutil.$(OBJEXT) +psbook_DEPENDENCIES = libpsutils.a $(am__DEPENDENCIES_1) +am_psnup_OBJECTS = @PSUTILS_TREE@/psnup.$(OBJEXT) psnup_OBJECTS = $(am_psnup_OBJECTS) psnup_LDADD = $(LDADD) -am_psresize_OBJECTS = @PSUTILS_TREE@/pserror.$(OBJEXT) \ - @PSUTILS_TREE@/psresize.$(OBJEXT) \ - @PSUTILS_TREE@/psspec.$(OBJEXT) \ - @PSUTILS_TREE@/psutil.$(OBJEXT) +psnup_DEPENDENCIES = libpsutils.a $(am__DEPENDENCIES_1) +am_psresize_OBJECTS = @PSUTILS_TREE@/psresize.$(OBJEXT) psresize_OBJECTS = $(am_psresize_OBJECTS) psresize_LDADD = $(LDADD) -am_psselect_OBJECTS = @PSUTILS_TREE@/pserror.$(OBJEXT) \ - @PSUTILS_TREE@/psselect.$(OBJEXT) \ - @PSUTILS_TREE@/psutil.$(OBJEXT) +psresize_DEPENDENCIES = libpsutils.a $(am__DEPENDENCIES_1) +am_psselect_OBJECTS = @PSUTILS_TREE@/psselect.$(OBJEXT) psselect_OBJECTS = $(am_psselect_OBJECTS) psselect_LDADD = $(LDADD) -am_pstops_OBJECTS = @PSUTILS_TREE@/pserror.$(OBJEXT) \ - @PSUTILS_TREE@/psspec.$(OBJEXT) \ - @PSUTILS_TREE@/pstops.$(OBJEXT) \ - @PSUTILS_TREE@/psutil.$(OBJEXT) +psselect_DEPENDENCIES = libpsutils.a $(am__DEPENDENCIES_1) +am_pstops_OBJECTS = @PSUTILS_TREE@/pstops.$(OBJEXT) pstops_OBJECTS = $(am_pstops_OBJECTS) pstops_LDADD = $(LDADD) +pstops_DEPENDENCIES = libpsutils.a $(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/||"`;; \ @@ -169,8 +179,7 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -SCRIPTS = $(nodist_bin_SCRIPTS) $(nodist_texmf_SCRIPTS) \ - $(texmf_SCRIPTS) +SCRIPTS = $(nodist_bin_SCRIPTS) $(texmf_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -199,10 +208,12 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(epsffit_SOURCES) $(psbook_SOURCES) $(psnup_SOURCES) \ - $(psresize_SOURCES) $(psselect_SOURCES) $(pstops_SOURCES) -DIST_SOURCES = $(epsffit_SOURCES) $(psbook_SOURCES) $(psnup_SOURCES) \ - $(psresize_SOURCES) $(psselect_SOURCES) $(pstops_SOURCES) +SOURCES = $(libpsutils_a_SOURCES) $(epsffit_SOURCES) $(psbook_SOURCES) \ + $(psnup_SOURCES) $(psresize_SOURCES) $(psselect_SOURCES) \ + $(pstops_SOURCES) +DIST_SOURCES = $(libpsutils_a_SOURCES) $(epsffit_SOURCES) \ + $(psbook_SOURCES) $(psnup_SOURCES) $(psresize_SOURCES) \ + $(psselect_SOURCES) $(pstops_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -210,8 +221,9 @@ am__can_run_installinfo = \ esac man1dir = $(mandir)/man1 NROFF = nroff -MANS = $(nodist_man1_MANS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +MANS = $(man1_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -433,6 +445,7 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -440,7 +453,9 @@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ +EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -462,8 +477,12 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAPER_DEPEND = @PAPER_DEPEND@ +PAPER_INCLUDES = @PAPER_INCLUDES@ +PAPER_LIBS = @PAPER_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PSUTILS_TREE = @PSUTILS_TREE@ +RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ @@ -511,84 +530,31 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -ACLOCAL_AMFLAGS = -I ../../m4 EXTRA_DIST = $(PSUTILS_TREE) $(PSUTILS_TREE)-PATCHES \ $(top_builddir)/../../build-aux/relpath $(TESTS) tests/play.ps \ tests/playbook.2 tests/playnup.2 tests/playps.2 \ tests/playres.ps tests/playsel.2 tests/plot.eps \ tests/ploth.eps tests/plotm.eps tests/plotv.eps -OS = UNIX -PAPER = a4 -AM_CPPFLAGS = -DUNIX -DPAPER=\"$(PAPER)\" +AM_CPPFLAGS = $(PAPER_INCLUDES) -D_Noreturn= -D_GL_ATTRIBUTE_CONST= AM_CFLAGS = $(WARNING_CFLAGS) -epsffit_SOURCES = \ - @PSUTILS_TREE@/config.h \ - @PSUTILS_TREE@/epsffit.c \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h - -psbook_SOURCES = \ - @PSUTILS_TREE@/config.h \ - @PSUTILS_TREE@/psbook.c \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h \ - @PSUTILS_TREE@/psutil.c \ - @PSUTILS_TREE@/psutil.h - -psnup_SOURCES = \ - @PSUTILS_TREE@/config.h \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h \ - @PSUTILS_TREE@/psnup.c \ - @PSUTILS_TREE@/psspec.c \ - @PSUTILS_TREE@/psspec.h \ - @PSUTILS_TREE@/psutil.c \ - @PSUTILS_TREE@/psutil.h - -psresize_SOURCES = \ - @PSUTILS_TREE@/config.h \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h \ - @PSUTILS_TREE@/psresize.c \ - @PSUTILS_TREE@/psspec.c \ - @PSUTILS_TREE@/psspec.h \ - @PSUTILS_TREE@/psutil.c \ - @PSUTILS_TREE@/psutil.h - -psselect_SOURCES = \ - @PSUTILS_TREE@/config.h \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h \ - @PSUTILS_TREE@/psselect.c \ - @PSUTILS_TREE@/psutil.c \ - @PSUTILS_TREE@/psutil.h - -pstops_SOURCES = \ - @PSUTILS_TREE@/pserror.c \ - @PSUTILS_TREE@/pserror.h \ +noinst_LIBRARIES = libpsutils.a +libpsutils_a_SOURCES = \ @PSUTILS_TREE@/psspec.c \ @PSUTILS_TREE@/psspec.h \ - @PSUTILS_TREE@/pstops.c \ @PSUTILS_TREE@/psutil.c \ @PSUTILS_TREE@/psutil.h +epsffit_SOURCES = @PSUTILS_TREE@/epsffit.c +psbook_SOURCES = @PSUTILS_TREE@/psbook.c +psnup_SOURCES = @PSUTILS_TREE@/psnup.c +psresize_SOURCES = @PSUTILS_TREE@/psresize.c +psselect_SOURCES = @PSUTILS_TREE@/psselect.c +pstops_SOURCES = @PSUTILS_TREE@/pstops.c +LDADD = libpsutils.a $(PAPER_LIBS) perl_scripts = \ extractres \ - fixdlsrps \ - fixfmps \ - fixpsditps \ - fixpspps \ - fixscribeps \ - fixtpps \ - fixwfwps \ - fixwpps \ - fixwwps \ includeres \ - psmerge - -sh_scripts = \ - getafm \ - showchar + psjoin scriptsdir = texmf-dist/scripts/psutils nodist_bin_SCRIPTS = $(am__append_1) @@ -596,22 +562,23 @@ all_scripts = $(lua_scripts) $(perl_scripts) $(shell_scripts) @WIN32_TRUE@@WIN32_WRAP_TRUE@wrappers = $(all_scripts:=.exe) @WIN32_TRUE@@WIN32_WRAP_TRUE@runscript = $(top_srcdir)/../../texk/texlive/w32_wrapper/runscript.exe texmfdir = $(datarootdir)/$(scriptsdir) -nodist_texmf_SCRIPTS = $(perl_scripts:=.pl) -texmf_SCRIPTS = \ - $(PSUTILS_TREE)/getafm.sh \ - $(PSUTILS_TREE)/showchar.sh - -nodist_man1_MANS = \ - $(bin_PROGRAMS:$(EXEEXT)=.1) \ - $(perl_scripts:=.1) \ - getafm.1 - -CLEANFILES = $(nodist_bin_SCRIPTS) $(nodist_texmf_SCRIPTS) $(nodist_man1_MANS) -PERL = /usr/bin/env perl -MAKETEXT = $(AM_V_GEN)$(PERL) $(srcdir)/$(PSUTILS_TREE)/maketext +texmf_SCRIPTS = $(perl_scripts:=.pl) +man1_MANS = \ + @PSUTILS_TREE@/epsffit.1 \ + @PSUTILS_TREE@/extractres.1 \ + @PSUTILS_TREE@/includeres.1 \ + @PSUTILS_TREE@/psbook.1 \ + @PSUTILS_TREE@/psjoin.1 \ + @PSUTILS_TREE@/psnup.1 \ + @PSUTILS_TREE@/psresize.1 \ + @PSUTILS_TREE@/psselect.1 \ + @PSUTILS_TREE@/pstops.1 \ + @PSUTILS_TREE@/psutils.1 + TESTS = psutils.test DISTCLEANFILES = play*.2 play*.ps plot*.eps -all: all-am +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs @@ -650,8 +617,39 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): -patchlev.h: $(top_builddir)/config.status $(top_srcdir)/psutils-1.17/patchlev.h.in - cd $(top_builddir) && $(SHELL) ./config.status $@ + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +@PSUTILS_TREE@/$(am__dirstamp): + @$(MKDIR_P) @PSUTILS_TREE@ + @: > @PSUTILS_TREE@/$(am__dirstamp) +@PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) @PSUTILS_TREE@/$(DEPDIR) + @: > @PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp) +@PSUTILS_TREE@/psspec.$(OBJEXT): @PSUTILS_TREE@/$(am__dirstamp) \ + @PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp) +@PSUTILS_TREE@/psutil.$(OBJEXT): @PSUTILS_TREE@/$(am__dirstamp) \ + @PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp) + +libpsutils.a: $(libpsutils_a_OBJECTS) $(libpsutils_a_DEPENDENCIES) $(EXTRA_libpsutils_a_DEPENDENCIES) + $(AM_V_at)-rm -f libpsutils.a + $(AM_V_AR)$(libpsutils_a_AR) libpsutils.a $(libpsutils_a_OBJECTS) $(libpsutils_a_LIBADD) + $(AM_V_at)$(RANLIB) libpsutils.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -694,32 +692,20 @@ uninstall-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -@PSUTILS_TREE@/$(am__dirstamp): - @$(MKDIR_P) @PSUTILS_TREE@ - @: > @PSUTILS_TREE@/$(am__dirstamp) -@PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) @PSUTILS_TREE@/$(DEPDIR) - @: > @PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp) @PSUTILS_TREE@/epsffit.$(OBJEXT): @PSUTILS_TREE@/$(am__dirstamp) \ @PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp) -@PSUTILS_TREE@/pserror.$(OBJEXT): @PSUTILS_TREE@/$(am__dirstamp) \ - @PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp) epsffit$(EXEEXT): $(epsffit_OBJECTS) $(epsffit_DEPENDENCIES) $(EXTRA_epsffit_DEPENDENCIES) @rm -f epsffit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(epsffit_OBJECTS) $(epsffit_LDADD) $(LIBS) @PSUTILS_TREE@/psbook.$(OBJEXT): @PSUTILS_TREE@/$(am__dirstamp) \ @PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp) -@PSUTILS_TREE@/psutil.$(OBJEXT): @PSUTILS_TREE@/$(am__dirstamp) \ - @PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp) psbook$(EXEEXT): $(psbook_OBJECTS) $(psbook_DEPENDENCIES) $(EXTRA_psbook_DEPENDENCIES) @rm -f psbook$(EXEEXT) $(AM_V_CCLD)$(LINK) $(psbook_OBJECTS) $(psbook_LDADD) $(LIBS) @PSUTILS_TREE@/psnup.$(OBJEXT): @PSUTILS_TREE@/$(am__dirstamp) \ @PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp) -@PSUTILS_TREE@/psspec.$(OBJEXT): @PSUTILS_TREE@/$(am__dirstamp) \ - @PSUTILS_TREE@/$(DEPDIR)/$(am__dirstamp) psnup$(EXEEXT): $(psnup_OBJECTS) $(psnup_DEPENDENCIES) $(EXTRA_psnup_DEPENDENCIES) @rm -f psnup$(EXEEXT) @@ -777,41 +763,6 @@ uninstall-nodist_binSCRIPTS: files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) -install-nodist_texmfSCRIPTS: $(nodist_texmf_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(nodist_texmf_SCRIPTS)'; test -n "$(texmfdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(texmfdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(texmfdir)" || exit 1; \ - fi; \ - 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)$(texmfdir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(texmfdir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-nodist_texmfSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(nodist_texmf_SCRIPTS)'; test -n "$(texmfdir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(texmfdir)'; $(am__uninstall_files_from_dir) install-texmfSCRIPTS: $(texmf_SCRIPTS) @$(NORMAL_INSTALL) @list='$(texmf_SCRIPTS)'; test -n "$(texmfdir)" || list=; \ @@ -857,7 +808,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@@PSUTILS_TREE@/$(DEPDIR)/epsffit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@@PSUTILS_TREE@/$(DEPDIR)/psbook.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@@PSUTILS_TREE@/$(DEPDIR)/pserror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@@PSUTILS_TREE@/$(DEPDIR)/psnup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@@PSUTILS_TREE@/$(DEPDIR)/psresize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@@PSUTILS_TREE@/$(DEPDIR)/psselect.Po@am__quote@ @@ -880,9 +830,9 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` -install-man1: $(nodist_man1_MANS) +install-man1: $(man1_MANS) @$(NORMAL_INSTALL) - @list1='$(nodist_man1_MANS)'; \ + @list1='$(man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ @@ -916,7 +866,7 @@ install-man1: $(nodist_man1_MANS) uninstall-man1: @$(NORMAL_UNINSTALL) - @list='$(nodist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ @@ -1305,9 +1255,9 @@ distcleancheck: distclean check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) +all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(man1dir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1335,7 +1285,6 @@ mostlyclean-generic: -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -1349,14 +1298,15 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ + mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf @PSUTILS_TREE@/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags + distclean-hdr distclean-tags dvi: dvi-am @@ -1370,8 +1320,7 @@ info: info-am info-am: -install-data-am: install-man install-nodist_texmfSCRIPTS \ - install-texmfSCRIPTS +install-data-am: install-man install-texmfSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am @@ -1420,39 +1369,41 @@ ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man \ - uninstall-nodist_binSCRIPTS uninstall-nodist_texmfSCRIPTS \ - uninstall-texmfSCRIPTS + uninstall-nodist_binSCRIPTS uninstall-texmfSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 -.MAKE: check-am install-am install-data-am install-strip uninstall-am +.MAKE: all check-am install-am install-data-am install-strip \ + uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \ check-am clean clean-binPROGRAMS clean-cscope clean-generic \ - cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ - dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-data-hook install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-man1 \ - install-nodist_binSCRIPTS install-nodist_texmfSCRIPTS \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip install-texmfSCRIPTS installcheck \ - installcheck-am installdirs maintainer-clean \ + clean-noinstLIBRARIES cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ + dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am \ + install-data-hook install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-man1 \ + install-nodist_binSCRIPTS install-pdf install-pdf-am \ + install-ps install-ps-am install-strip install-texmfSCRIPTS \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am uninstall-binPROGRAMS uninstall-hook \ uninstall-man uninstall-man1 uninstall-nodist_binSCRIPTS \ - uninstall-nodist_texmfSCRIPTS uninstall-texmfSCRIPTS + uninstall-texmfSCRIPTS # in case of an SVN repository dist-hook: rm -rf `find $(distdir) -name .svn -o -name .deps -o -name .dirstamp -o -name '*.$(OBJEXT)'` + +$(libpsutils_a_OBJECTS): $(PAPER_DEPEND) .PHONY: install-lua-links install-perl-links install-shell-links install-sh-links \ install-links uninstall-links @WIN32_TRUE@@WIN32_WRAP_TRUE@$(wrappers): $(runscript) @@ -1496,15 +1447,11 @@ uninstall-links: @WIN32_FALSE@ rm -f "$(DESTDIR)$(bindir)/$$f"; \ @WIN32_FALSE@ done -install-data-hook: install-perl-links install-sh-links +install-data-hook: install-perl-links uninstall-hook: uninstall-links -%.pl: $(PSUTILS_TREE)/%.pl patchlev.h - $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $< >$@ - -%.1: $(PSUTILS_TREE)/%.man patchlev.h - $(MAKETEXT) PAPER=$(PAPER) "MAN=$(nodist_man1_MANS)" $< >$@ +@PAPER_RULE@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/Build/source/utils/psutils/ac/withenable.ac b/Build/source/utils/psutils/ac/withenable.ac index 2a30553663b..e8c78f874f2 100644 --- a/Build/source/utils/psutils/ac/withenable.ac +++ b/Build/source/utils/psutils/ac/withenable.ac @@ -1,7 +1,7 @@ ## utils/psutils/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/psutils/ dnl -dnl Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org> +dnl Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org> dnl You may freely use, modify and/or distribute this file. dnl ## configure options and TL libraries required for psutils -KPSE_ENABLE_PROG([psutils]) +KPSE_ENABLE_PROG([psutils], [paper]) diff --git a/Build/source/utils/psutils/aclocal.m4 b/Build/source/utils/psutils/aclocal.m4 index 57198ddc758..b9ce4cba813 100644 --- a/Build/source/utils/psutils/aclocal.m4 +++ b/Build/source/utils/psutils/aclocal.m4 @@ -1184,5 +1184,6 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([../../m4/kpse-common.m4]) +m4_include([../../m4/kpse-paper-flags.m4]) m4_include([../../m4/kpse-warnings.m4]) m4_include([../../m4/kpse-win32.m4]) diff --git a/Build/source/utils/psutils/config.h.in b/Build/source/utils/psutils/config.h.in new file mode 100644 index 00000000000..984d2f843a0 --- /dev/null +++ b/Build/source/utils/psutils/config.h.in @@ -0,0 +1,87 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE diff --git a/Build/source/utils/psutils/configure b/Build/source/utils/psutils/configure index f00eb8763b8..32cf09eeac5 100755 --- a/Build/source/utils/psutils/configure +++ b/Build/source/utils/psutils/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for psutils (TeX Live) 1.17. +# Generated by GNU Autoconf 2.69 for psutils (TeX Live) 1.21. # # Report bugs to <tex-k@tug.org>. # @@ -197,7 +197,8 @@ test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else @@ -579,12 +580,48 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='psutils (TeX Live)' PACKAGE_TARNAME='psutils--tex-live-' -PACKAGE_VERSION='1.17' -PACKAGE_STRING='psutils (TeX Live) 1.17' +PACKAGE_VERSION='1.21' +PACKAGE_STRING='psutils (TeX Live) 1.21' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' -ac_unique_file="psutils-1.17/psutil.c" +ac_unique_file="psutils-1.21/psutil.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -594,6 +631,14 @@ WIN32_WRAP_FALSE WIN32_WRAP_TRUE WIN32_FALSE WIN32_TRUE +PAPER_RULE +PAPER_DEPEND +PAPER_LIBS +PAPER_INCLUDES +EGREP +GREP +CPP +RANLIB LN_S WARNING_CFLAGS am__fastdepCC_FALSE @@ -688,6 +733,9 @@ enable_silent_rules enable_maintainer_mode enable_dependency_tracking enable_compiler_warnings +with_system_paper +with_paper_includes +with_paper_libdir ' ac_precious_vars='build_alias host_alias @@ -696,7 +744,8 @@ CC CFLAGS LDFLAGS LIBS -CPPFLAGS' +CPPFLAGS +CPP' # Initialize some variables set by options. @@ -1237,7 +1286,7 @@ if test "$ac_init_help" = "long"; then # 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 <<_ACEOF -\`configure' configures psutils (TeX Live) 1.17 to adapt to many kinds of systems. +\`configure' configures psutils (TeX Live) 1.21 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1304,7 +1353,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of psutils (TeX Live) 1.17:";; + short | recursive ) echo "Configuration of psutils (TeX Live) 1.21:";; esac cat <<\_ACEOF @@ -1325,6 +1374,14 @@ Optional Features: Turn on compiler warnings [default: yes if maintainer-mode, min otherwise] +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-system-paper use installed paper headers and library + --with-paper-includes=DIR + paper headers installed in DIR + --with-paper-libdir=DIR paper library installed in DIR + Some influential environment variables: CC C compiler command CFLAGS C compiler flags @@ -1333,6 +1390,7 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> + CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1400,7 +1458,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -psutils (TeX Live) configure 1.17 +psutils (TeX Live) configure 1.21 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1497,11 +1555,212 @@ fi as_fn_set_status $ac_retval } # ac_fn_c_try_link + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ---------------------------- ## +## Report this to tex-k@tug.org ## +## ---------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by psutils (TeX Live) $as_me 1.17, which was +It was created by psutils (TeX Live) $as_me 1.21, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3424,7 +3683,7 @@ fi # Define the identity of the package. PACKAGE='psutils--tex-live-' - VERSION='1.17' + VERSION='1.21' cat >>confdefs.h <<_ACEOF @@ -4362,6 +4621,98 @@ else $as_echo "no, using $LN_S" >&6; } fi +if test -n "$ac_tool_prefix"; then + # 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +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_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +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_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} @@ -4394,6 +4745,511 @@ $as_echo "no" >&6; } fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#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)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + +ac_config_headers="$ac_config_headers config.h" + + +kpse_save_CPPFLAGS=$CPPFLAGS +kpse_save_LIBS=$LIBS + +## _KPSE_INIT: Initialize TL infrastructure +kpse_BLD=`(cd "./../../." && pwd)` +kpse_SRC=`(cd "$srcdir/../../." && pwd)` + +## _KPSE_LIB_FLAGS: Setup paper (-lpaper) flags + +# Check whether --with-system-paper was given. +if test "${with_system_paper+set}" = set; then : + withval=$with_system_paper; +fi + +# Check whether --with-paper-includes was given. +if test "${with_paper_includes+set}" = set; then : + withval=$with_paper_includes; +fi + +# Check whether --with-paper-libdir was given. +if test "${with_paper_libdir+set}" = set; then : + withval=$with_paper_libdir; +fi +if test "x$with_system_paper" = xyes; then + if test "x$with_paper_includes" != x && test "x$with_paper_includes" != xyes; then + PAPER_INCLUDES="-I$with_paper_includes" +fi +PAPER_LIBS="-lpaper" +if test "x$with_paper_libdir" != x && test "x$with_paper_libdir" != xyes; then + PAPER_LIBS="-L$with_paper_libdir $PAPER_LIBS" +fi +else + PAPER_INCLUDES="-I$kpse_BLD/libs/paper/include" + PAPER_LIBS="$kpse_BLD/libs/paper/libpaper.a" + PAPER_DEPEND='${top_builddir}/../../libs/paper/libpaper.a' + PAPER_RULE='# Rebuild libpaper +$(PAPER_DEPEND): ${top_builddir}/../../libs/paper/include/paper.h + cd ${top_builddir}/../../libs/paper && $(MAKE) $(AM_MAKEFLAGS) rebuild +${top_builddir}/../../libs/paper/include/paper.h: + cd ${top_builddir}/../../libs/paper && $(MAKE) $(AM_MAKEFLAGS) rebuild' +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for native WIN32 or MINGW32" >&5 $as_echo_n "checking for native WIN32 or MINGW32... " >&6; } if ${kpse_cv_have_win32+:} false; then : @@ -4459,10 +5315,17 @@ fi -PSUTILS_TREE=psutils-1.17 +PSUTILS_TREE=psutils-1.21 + + +ac_config_files="$ac_config_files Makefile" -ac_config_files="$ac_config_files Makefile patchlev.h:psutils-1.17/patchlev.h.in" +ac_config_links="$ac_config_links extractres.pl:psutils-1.21/extractres" + +ac_config_links="$ac_config_links includeres.pl:psutils-1.21/extractres" + +ac_config_links="$ac_config_links psjoin.pl:psutils-1.21/psjoin" cat >confcache <<\_ACEOF @@ -4555,43 +5418,7 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - +DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= @@ -5047,7 +5874,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by psutils (TeX Live) $as_me 1.17, which was +This file was extended by psutils (TeX Live) $as_me 1.21, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5065,11 +5892,16 @@ case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_links="$ac_config_links" config_commands="$ac_config_commands" _ACEOF @@ -5091,10 +5923,18 @@ Usage: $0 [OPTION]... [TAG]... --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files +Configuration headers: +$config_headers + +Configuration links: +$config_links + Configuration commands: $config_commands @@ -5104,7 +5944,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -psutils (TeX Live) config.status 1.17 +psutils (TeX Live) config.status 1.21 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -5161,7 +6001,18 @@ do esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) @@ -5223,8 +6074,11 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "patchlev.h") CONFIG_FILES="$CONFIG_FILES patchlev.h:psutils-1.17/patchlev.h.in" ;; + "extractres.pl") CONFIG_LINKS="$CONFIG_LINKS extractres.pl:psutils-1.21/extractres" ;; + "includeres.pl") CONFIG_LINKS="$CONFIG_LINKS includeres.pl:psutils-1.21/extractres" ;; + "psjoin.pl") CONFIG_LINKS="$CONFIG_LINKS psjoin.pl:psutils-1.21/psjoin" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac @@ -5237,6 +6091,8 @@ done # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi @@ -5425,8 +6281,116 @@ fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. -eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' <confdefs.h | sed ' +s/'"$ac_delim"'/"\\\ +"/g' >>$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #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. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" shift for ac_tag do @@ -5645,8 +6609,96 @@ which seems to be undefined. Please make sure it is defined" >&2;} esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + :L) + # + # CONFIG_LINK + # + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 +$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + as_fn_error $? "$ac_source: file not found" "$LINENO" 5 + fi + rm -f "$ac_file" + # Try a relative symlink, then a hard link, then a copy. + case $ac_source in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 + fi + ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; diff --git a/Build/source/utils/psutils/configure.ac b/Build/source/utils/psutils/configure.ac index 4502b619b99..5ff1b0b155f 100644 --- a/Build/source/utils/psutils/configure.ac +++ b/Build/source/utils/psutils/configure.ac @@ -6,7 +6,7 @@ dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -m4_define([psutils_version], [1.17])[]dnl using unmodified psutils source tree +m4_include([version.ac])[] dnl define psutils_version AC_INIT([psutils (TeX Live)], psutils_version, [tex-k@tug.org]) AC_PREREQ([2.65]) AC_CONFIG_SRCDIR([psutils-]psutils_version[/psutil.c]) @@ -18,14 +18,23 @@ KPSE_BASIC([psutils]) AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S +AC_PROG_RANLIB AC_PROG_MAKE_SET +AC_USE_SYSTEM_EXTENSIONS + +AC_CONFIG_HEADERS([config.h]) + +KPSE_PAPER_FLAGS + KPSE_COND_WIN32_WRAP -PSUTILS_TREE=psutils-[]psutils_version -AC_SUBST([PSUTILS_TREE]) +AC_SUBST([PSUTILS_TREE], [psutils-]psutils_version) + +AC_CONFIG_FILES([Makefile]) -AC_CONFIG_FILES([Makefile - patchlev.h:psutils-]psutils_version[/patchlev.h.in]) +AC_CONFIG_LINKS([extractres.pl:psutils-]psutils_version[/extractres]) +AC_CONFIG_LINKS([includeres.pl:psutils-]psutils_version[/extractres]) +AC_CONFIG_LINKS([psjoin.pl:psutils-]psutils_version[/psjoin]) AC_OUTPUT diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/TL-Changes b/Build/source/utils/psutils/psutils-1.17-PATCHES/TL-Changes deleted file mode 100644 index 19ab64a7cda..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/TL-Changes +++ /dev/null @@ -1,14 +0,0 @@ -Changes applied to the psutils-1.17 tree as obtained from: - http://mirror.ctan.org/support/psutils/psutils-p17.tar.gz - -Remove non-free files: - md68_0.ps - md71_0.ps - -Rename: - patchlev.h -> patchlev.h.in - -Add execute permissions: - getafm.sh - showchar.sh - diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-01-WIN32 b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-01-WIN32 deleted file mode 100644 index 056fb4852dc..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-01-WIN32 +++ /dev/null @@ -1,127 +0,0 @@ -diff -ur psutils-1.17.orig/config.h psutils-1.17/config.h ---- psutils-1.17.orig/config.h 1997-03-11 23:52:52.000000000 +0100 -+++ psutils-1.17/config.h 2012-08-26 15:44:12.000000000 +0200 -@@ -4,13 +4,13 @@ - * OS specific configuration for PSUtils - */ - --#if defined(MSDOS) || defined(WINNT) --#define TMPDIR "\\tmp" -+#if defined(MSDOS) || defined(WINNT) || defined(WIN32) -+#define TMPDIR "." - #define OPEN_READ "rb" - #define OPEN_WRITE "wb" - #include <fcntl.h> - #include <io.h> --#else /* ! MSDOS && ! WINNT */ -+#else /* ! MSDOS && ! WINNT && ! WIN32 */ - #if defined(OS2) - #define TMPDIR "." - #define OPEN_READ "rb" -@@ -26,5 +26,5 @@ - #define TMPDIR "/tmp" - #endif /* ! VMS */ - #endif /* ! OS2 */ --#endif /* ! MSDOS && ! WINNT */ -+#endif /* ! MSDOS && ! WINNT && !WIN32 */ - -diff -ur psutils-1.17.orig/epsffit.c psutils-1.17/epsffit.c ---- psutils-1.17.orig/epsffit.c 1997-03-11 23:52:52.000000000 +0100 -+++ psutils-1.17/epsffit.c 2006-01-17 22:16:42.000000000 +0100 -@@ -75,7 +75,7 @@ - if(!(input = fopen(argv[4], OPEN_READ))) - message(FATAL, "can't open input file %s\n", argv[4]); - } else { --#if defined(MSDOS) || defined(WINNT) -+#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdin to binary mode\n"); -@@ -87,7 +87,7 @@ - if(!(output = fopen(argv[5], OPEN_WRITE))) - message(FATAL, "can't open output file %s\n", argv[5]); - } else { --#if defined(MSDOS) || defined(WINNT) -+#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - int fd = fileno(stdout) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdout to binary mode\n"); -diff -ur psutils-1.17.orig/psbook.c psutils-1.17/psbook.c ---- psutils-1.17.orig/psbook.c 1997-03-11 23:53:01.000000000 +0100 -+++ psutils-1.17/psbook.c 2006-01-17 22:16:42.000000000 +0100 -@@ -62,7 +62,7 @@ - message(FATAL, "can't open output file %s\n", *argv); - } else usage(); - } --#if defined(MSDOS) || defined(WINNT) -+#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) -diff -ur psutils-1.17.orig/psnup.c psutils-1.17/psnup.c ---- psutils-1.17.orig/psnup.c 1997-03-11 23:53:02.000000000 +0100 -+++ psutils-1.17/psnup.c 2006-01-17 22:16:42.000000000 +0100 -@@ -190,7 +190,7 @@ - message(FATAL, "can't open output file %s\n", *argv); - } else usage(); - } --#if defined(MSDOS) || defined(WINNT) -+#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) -diff -ur psutils-1.17.orig/psresize.c psutils-1.17/psresize.c ---- psutils-1.17.orig/psresize.c 1997-03-11 23:53:03.000000000 +0100 -+++ psutils-1.17/psresize.c 2006-01-17 22:16:42.000000000 +0100 -@@ -114,7 +114,7 @@ - message(FATAL, "can't open output file %s\n", *argv); - } else usage(); - } --#if defined(MSDOS) || defined(WINNT) -+#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) -diff -ur psutils-1.17.orig/psselect.c psutils-1.17/psselect.c ---- psutils-1.17.orig/psselect.c 1997-03-11 23:53:03.000000000 +0100 -+++ psutils-1.17/psselect.c 2006-01-17 22:16:42.000000000 +0100 -@@ -133,7 +133,7 @@ - message(FATAL, "can't open output file %s\n", *argv); - } else usage(); - } --#if defined(MSDOS) || defined(WINNT) -+#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) -diff -ur psutils-1.17.orig/pstops.c psutils-1.17/pstops.c ---- psutils-1.17.orig/pstops.c 1997-03-11 23:53:04.000000000 +0100 -+++ psutils-1.17/pstops.c 2006-01-17 22:16:42.000000000 +0100 -@@ -177,7 +177,7 @@ - } - if (specs == NULL) - usage(); --#if defined(MSDOS) || defined(WINNT) -+#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) -diff -ur psutils-1.17.orig/psutil.c psutils-1.17/psutil.c ---- psutils-1.17.orig/psutil.c 1997-03-11 23:53:04.000000000 +0100 -+++ psutils-1.17/psutil.c 2006-01-17 22:16:42.000000000 +0100 -@@ -85,13 +85,13 @@ - #endif - char *p; - char buffer[BUFSIZ] ; --#if defined(WINNT) -+#if defined(WINNT) || defined(WIN32) - struct _stat fs ; - #else - long fpos; - #endif - --#if defined(WINNT) -+#if defined(WINNT) || defined(WIN32) - if (_fstat(fileno(fp), &fs) == 0 && (fs.st_mode&_S_IFREG) != 0) - return (fp); - #else diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-02-PERL b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-02-PERL deleted file mode 100644 index 2887e44e7eb..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-02-PERL +++ /dev/null @@ -1,93 +0,0 @@ -diff -ur psutils-1.17.orig/fixmacps.man psutils-1.17/fixmacps.man ---- psutils-1.17.orig/fixmacps.man 1997-03-11 23:52:54.000000000 +0100 -+++ psutils-1.17/fixmacps.man 2006-01-17 22:16:42.000000000 +0100 -@@ -16,7 +16,7 @@ - .B psutils - package. - .SH FILES --@INCLUDE@/md68_0.ps, @INCLUDE@/md71_0.ps - sanitised versions of the md -+md68_0.ps, md71_0.ps - sanitised versions of the md - prologue. - .SH AUTHOR - Copyright (C) Angus J. C. Duggan 1991-1995 -diff -ur psutils-1.17.orig/fixmacps.pl psutils-1.17/fixmacps.pl ---- psutils-1.17.orig/fixmacps.pl 1997-03-11 23:52:54.000000000 +0100 -+++ psutils-1.17/fixmacps.pl 2010-12-13 15:04:50.000000000 +0100 -@@ -4,8 +4,11 @@ - # Copyright (C) Angus J. C. Duggan 1991-1995 - # See file LICENSE for details. - -+use File::Basename; -+ - $line = 0; # keep line count --$dir = "@INCLUDE@"; -+$predir = `kpsewhich -progname=dvips -format="other text files" md71_0.ps`; -+$dir=`dirname $predir`; - $prefix = "md"; - $default = "md71_0.ps"; - -diff -ur psutils-1.17.orig/includeres.man psutils-1.17/includeres.man ---- psutils-1.17.orig/includeres.man 1997-03-11 23:52:57.000000000 +0100 -+++ psutils-1.17/includeres.man 2006-01-17 22:16:42.000000000 +0100 -@@ -26,8 +26,6 @@ - or - .I pstops - safely. --.SH FILES --@INCLUDE@ - system resource directory. - .SH AUTHOR - Copyright (C) Angus J. C. Duggan 1991-1995 - .SH "SEE ALSO" -diff -ur psutils-1.17.orig/includeres.pl psutils-1.17/includeres.pl ---- psutils-1.17.orig/includeres.pl 1997-03-11 23:52:58.000000000 +0100 -+++ psutils-1.17/includeres.pl 2006-01-17 22:16:42.000000000 +0100 -@@ -4,6 +4,11 @@ - # Copyright (C) Angus J. C. Duggan 1991-1995 - # See file LICENSE for details. - -+use File::Basename; -+ -+$predir = `kpsewhich -progname=dvips -format="other text files" md71_0.ps`; -+$inc=`dirname $predir`; -+ - $prog = ($0 =~ s=.*/==); - - %extn = ("font", ".pfa", "file", ".ps", "procset", ".ps", # resource extns -@@ -28,7 +33,6 @@ - local($comment, @res) = split(/\s+/); - local($type) = defined($type{$comment}) ? $type{$comment} : shift(@res); - local($name) = &filename(@res); -- local($inc) = "@INCLUDE@"; # system include directory - if (open(RES, $name) || open(RES, "$name$extn{$type}") || - open(RES, "$inc/$name") || open(RES, "$inc/$name$extn{$type}")) { - while (<RES>) { -diff -ur psutils-1.17.orig/maketext psutils-1.17/maketext ---- psutils-1.17.orig/maketext 1997-03-11 23:52:59.000000000 +0100 -+++ psutils-1.17/maketext 2006-01-17 22:16:42.000000000 +0100 -@@ -1,7 +1,4 @@ --eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' -- & eval 'exec perl -S $0 $argv:q' -- if 0; -- -+#!/usr/bin/env perl - # maketext: perl filter to substitute names in scripts and man pages. - - %change = (); # names -> substitutions -@@ -15,14 +12,16 @@ - - $os = "" ; - --%perlstart = ("UNIX", "\#!PERL\neval 'exec perl -S \$0 \"\$\@\"'\n\tif \$running_under_some_shell;\n", -+%perlstart = ("UNIX", "\#!PERL", - "DOS", "\@rem = '-*- Perl -*-\n\@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n", - "WINNT", "\@rem = '-*- Perl -*-\n\@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n", -+ "Win32", "\@rem = '-*- Perl -*-\n\@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n", - "OS2", "extproc PERL -x\n\#! PERL\n", - "", "PSUTILS MAKEFILE CONFIGURATION ERROR") ; - %perlend = ("UNIX", "", - "DOS", "__END__\n:endofperl\n", - "WINNT", "__END__\n:endofperl\n", -+ "Win32", "__END__\n:endofperl\n", - "OS2", "\# End of Script", - "", "PSUTILS MAKEFILE CONFIGURATION ERROR"); - diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-03-main-is-int b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-03-main-is-int deleted file mode 100644 index c36e61686ce..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-03-main-is-int +++ /dev/null @@ -1,128 +0,0 @@ -diff -ur psutils-1.17.orig/epsffit.c psutils-1.17/epsffit.c ---- psutils-1.17.orig/epsffit.c 2006-01-17 22:16:42.000000000 +0100 -+++ psutils-1.17/epsffit.c 2008-02-01 12:23:16.000000000 +0100 -@@ -39,7 +39,7 @@ - exit(1); - } - --void main(int argc, char **argv) -+int main(int argc, char **argv) - { - int bbfound = 0; /* %%BoundingBox: found */ - int urx, ury, llx, lly; -@@ -185,5 +185,5 @@ - } else - message(FATAL, "no %%%%BoundingBox:\n"); - -- exit(0); -+ return 0; - } -diff -ur psutils-1.17.orig/psbook.c psutils-1.17/psbook.c ---- psutils-1.17.orig/psbook.c 2006-01-17 22:16:42.000000000 +0100 -+++ psutils-1.17/psbook.c 2008-02-01 12:23:16.000000000 +0100 -@@ -32,7 +32,7 @@ - } - - --void main(int argc, char *argv[]) -+int main(int argc, char *argv[]) - { - int signature = 0; - int currentpg, maxpage; -@@ -107,5 +107,5 @@ - } - writetrailer(); - -- exit(0); -+ return 0; - } -diff -ur psutils-1.17.orig/pserror.c psutils-1.17/pserror.c ---- psutils-1.17.orig/pserror.c 1997-03-11 23:53:01.000000000 +0100 -+++ psutils-1.17/pserror.c 2008-02-01 12:23:16.000000000 +0100 -@@ -24,7 +24,7 @@ - void message(int flags, char *format, ...) - { - va_list args ; -- static column = 0 ; /* current screen column for message wrap */ -+ static int column = 0 ; /* current screen column for message wrap */ - char msgbuf[MAX_MESSAGE] ; /* buffer in which to put the message */ - char *bufptr = msgbuf ; /* message buffer pointer */ - -diff -ur psutils-1.17.orig/psnup.c psutils-1.17/psnup.c ---- psutils-1.17.orig/psnup.c 2006-01-17 22:16:42.000000000 +0100 -+++ psutils-1.17/psnup.c 2008-02-01 12:23:16.000000000 +0100 -@@ -66,7 +66,7 @@ - return (0); - } - --void main(int argc, char *argv[]) -+int main(int argc, char *argv[]) - { - int horiz, vert, rotate, column, flip, leftright, topbottom; - int nup = 1; -@@ -331,6 +331,6 @@ - pstops(nup, 1, 0, specs, draw); /* do page rearrangement */ - } - -- exit(0); -+ return 0; - } - -diff -ur psutils-1.17.orig/psresize.c psutils-1.17/psresize.c ---- psutils-1.17.orig/psresize.c 2006-01-17 22:16:42.000000000 +0100 -+++ psutils-1.17/psresize.c 2008-02-01 12:23:16.000000000 +0100 -@@ -46,7 +46,7 @@ - #define MIN(x,y) ((x) > (y) ? (y) : (x)) - #define MAX(x,y) ((x) > (y) ? (x) : (y)) - --void main(int argc, char *argv[]) -+int main(int argc, char *argv[]) - { - double scale, rscale; /* page scale */ - double waste, rwaste; /* amount wasted */ -@@ -175,6 +175,6 @@ - - pstops(1, 1, 0, specs, 0.0); /* do page rearrangement */ - -- exit(0); -+ return 0; - } - -diff -ur psutils-1.17.orig/psselect.c psutils-1.17/psselect.c ---- psutils-1.17.orig/psselect.c 2006-01-17 22:16:42.000000000 +0100 -+++ psutils-1.17/psselect.c 2008-02-01 12:23:16.000000000 +0100 -@@ -91,7 +91,7 @@ - } - - --void main(int argc, char *argv[]) -+int main(int argc, char *argv[]) - { - int currentpg, maxpage = 0; - int even = 0, odd = 0, reverse = 0; -@@ -235,5 +235,5 @@ - } - writetrailer(); - -- exit(0); -+ return 0; - } -diff -ur psutils-1.17.orig/pstops.c psutils-1.17/pstops.c ---- psutils-1.17.orig/pstops.c 2006-01-17 22:16:42.000000000 +0100 -+++ psutils-1.17/pstops.c 2008-02-01 12:23:16.000000000 +0100 -@@ -112,7 +112,7 @@ - return (head); - } - --void main(int argc, char *argv[]) -+int main(int argc, char *argv[]) - { - PageSpec *specs = NULL; - int nobinding = 0; -@@ -194,5 +194,5 @@ - - pstops(modulo, pagesperspec, nobinding, specs, draw); - -- exit(0); -+ return 0; - } diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-04-warnings b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-04-warnings deleted file mode 100644 index c8b957a185b..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-04-warnings +++ /dev/null @@ -1,41 +0,0 @@ -diff -ur psutils-1.17.orig/epsffit.c psutils-1.17/epsffit.c ---- psutils-1.17.orig/epsffit.c 2008-02-01 12:23:16.000000000 +0100 -+++ psutils-1.17/epsffit.c 2009-06-24 00:22:15.000000000 +0200 -@@ -42,7 +42,7 @@ - int main(int argc, char **argv) - { - int bbfound = 0; /* %%BoundingBox: found */ -- int urx, ury, llx, lly; -+ int urx = 0, ury = 0, llx = 0, lly = 0; /* avoid uninitialized warning */ - int furx, fury, fllx, flly; - int showpage = 0, centre = 0, rotate = 0, aspect = 0, maximise = 0; - char buf[BUFSIZ]; -diff -ur psutils-1.17.orig/psnup.c psutils-1.17/psnup.c ---- psutils-1.17.orig/psnup.c 2008-02-01 12:23:16.000000000 +0100 -+++ psutils-1.17/psnup.c 2009-06-24 00:18:08.000000000 +0200 -@@ -68,10 +68,11 @@ - - int main(int argc, char *argv[]) - { -- int horiz, vert, rotate, column, flip, leftright, topbottom; -+ int horiz = 0, vert = 0, rotate = 0; /* avoid uninitialized warning */ -+ int column, flip, leftright, topbottom; - int nup = 1; - double draw = 0; /* draw page borders */ -- double scale; /* page scale */ -+ double scale = 0; /* page scale */ - double uscale = 0; /* user supplied scale */ - double ppwid, pphgt; /* paper dimensions */ - double margin, border; /* paper & page margins */ -diff -ur psutils-1.17.orig/pstops.c psutils-1.17/pstops.c ---- psutils-1.17.orig/pstops.c 2008-02-01 12:23:16.000000000 +0100 -+++ psutils-1.17/pstops.c 2009-06-24 00:18:08.000000000 +0200 -@@ -21,7 +21,7 @@ - char pagelabel[BUFSIZ] ; - int pageno ; - --void usage(void) -+static void usage(void) - { - fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); - fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-05-const b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-05-const deleted file mode 100644 index ce8b5ca4920..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-05-const +++ /dev/null @@ -1,114 +0,0 @@ -diff -ur psutils-1.17.orig/pserror.c psutils-1.17/pserror.c ---- psutils-1.17.orig/pserror.c 2008-02-01 12:23:16.000000000 +0100 -+++ psutils-1.17/pserror.c 2009-09-01 13:40:27.000000000 +0200 -@@ -21,7 +21,7 @@ - #define MAX_FORMAT 16 /* maximum format length */ - #define MAX_COLUMN 78 /* maximum column to print upto */ - --void message(int flags, char *format, ...) -+void message(int flags, const char *format, ...) - { - va_list args ; - static int column = 0 ; /* current screen column for message wrap */ -diff -ur psutils-1.17.orig/pserror.h psutils-1.17/pserror.h ---- psutils-1.17.orig/pserror.h 1997-03-11 23:53:02.000000000 +0100 -+++ psutils-1.17/pserror.h 2009-08-22 22:53:17.000000000 +0200 -@@ -17,4 +17,4 @@ - #define WARN (MESSAGE_NL|MESSAGE_PROGRAM) - #define LOG 0 - --extern void message(int flags, char *format, ...) ; -+extern void message(int flags, const char *format, ...) ; -diff -ur psutils-1.17.orig/psspec.c psutils-1.17/psspec.c ---- psutils-1.17.orig/psspec.c 1997-03-11 23:53:04.000000000 +0100 -+++ psutils-1.17/psspec.c 2009-08-27 14:47:26.000000000 +0200 -@@ -91,7 +91,7 @@ - return (num); - } - --static char *prologue[] = { /* PStoPS procset */ -+static const char *prologue[] = { /* PStoPS procset */ - #ifndef SHOWPAGE_LOAD - "userdict begin", - "[/showpage/erasepage/copypage]{dup where{pop dup load", /* prevent */ -@@ -138,7 +138,7 @@ - { - int thispg, maxpage; - int pageindex = 0; -- char **pro; -+ const char **pro; - - scanpages(); - -@@ -214,7 +214,6 @@ - } - writestring("userdict/PStoPSmatrix matrix currentmatrix put\n"); - if (width > 0 && height > 0) { -- char buffer[BUFSIZ]; - writestring("userdict/PStoPSclip{0 0 moveto\n"); - sprintf(buffer, " %f 0 rlineto 0 %f rlineto -%f 0 rlineto\n", - width, height, width); -diff -ur psutils-1.17.orig/psutil.c psutils-1.17/psutil.c ---- psutils-1.17.orig/psutil.c 2006-01-17 22:16:42.000000000 +0100 -+++ psutils-1.17/psutil.c 2009-09-01 13:43:52.000000000 +0200 -@@ -65,7 +65,7 @@ - }; - - /* return pointer to paper size struct or NULL */ --Paper* findpaper(char *name) -+Paper* findpaper(const char *name) - { - Paper *pp; - for (pp = papersizes; PaperName(pp); pp++) { -@@ -233,14 +233,14 @@ - - /* Output routines. These all update the global variable bytes with the number - * of bytes written */ --void writestring(char *s) -+void writestring(const char *s) - { - fputs(s, outfile); - bytes += strlen(s); - } - - /* write page comment */ --void writepageheader(char *label, int page) -+void writepageheader(const char *label, int page) - { - if (verbose) - message(LOG, "[%d] ", page); -diff -ur psutils-1.17.orig/psutil.h psutils-1.17/psutil.h ---- psutils-1.17.orig/psutil.h 1997-03-11 23:53:04.000000000 +0100 -+++ psutils-1.17/psutil.h 2009-08-22 22:55:59.000000000 +0200 -@@ -17,7 +17,7 @@ - /* paper size structure; configurability and proper paper resources will have - to wait until version 2 */ - typedef struct papersize { -- char *name; /* name of paper size */ -+ const char *name; /* name of paper size */ - int width, height; /* width, height in points */ - } Paper ; - #define PaperName(p) ((p)->name) -@@ -25,11 +25,11 @@ - #define PaperHeight(p) ((p)->height) - - /* Definitions for functions found in psutil.c */ --extern Paper *findpaper(char *name); -+extern Paper *findpaper(const char *name); - extern FILE *seekable(FILE *fp); - extern void writepage(int p); - extern void seekpage(int p); --extern void writepageheader(char *label, int p); -+extern void writepageheader(const char *label, int p); - extern void writepagesetup(void); - extern void writepagebody(int p); - extern void writeheader(int p); -@@ -39,7 +39,7 @@ - extern void writetrailer(void); - extern void writeemptypage(void); - extern void scanpages(void); --extern void writestring(char *s); -+extern void writestring(const char *s); - - /* These variables are imported from the client program (e.g. psbook, psnup, - etc.) */ diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-07-TEMPDIR b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-07-TEMPDIR deleted file mode 100644 index b71a2f76284..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-07-TEMPDIR +++ /dev/null @@ -1,14 +0,0 @@ -diff -ur psutils-1.17.orig/extractres.pl psutils-1.17/extractres.pl ---- psutils-1.17.orig/extractres.pl 1997-03-11 23:52:53.000000000 +0100 -+++ psutils-1.17/extractres.pl 2011-01-09 17:38:03.000000000 +0100 -@@ -27,6 +27,10 @@ - - if (defined($ENV{TMPDIR})) { # set body file name - $body = "$ENV{TMPDIR}/body$$.ps"; -+} elsif (defined($ENV{TEMP})) { -+ $body = "$ENV{TEMP}/body$$.ps"; -+} elsif (defined($ENV{TMP})) { -+ $body = "$ENV{TMP}/body$$.ps"; - } else { - $body = "body$$.ps"; - } diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-08-non-free b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-08-non-free deleted file mode 100644 index 1ca6840037a..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-08-non-free +++ /dev/null @@ -1,25 +0,0 @@ -diff -ur psutils-1.17.orig/includeres.pl psutils-1.17/includeres.pl ---- psutils-1.17.orig/includeres.pl 2006-01-17 22:16:42.000000000 +0100 -+++ psutils-1.17/includeres.pl 2010-12-20 20:15:37.000000000 +0100 -@@ -4,11 +4,6 @@ - # Copyright (C) Angus J. C. Duggan 1991-1995 - # See file LICENSE for details. - --use File::Basename; -- --$predir = `kpsewhich -progname=dvips -format="other text files" md71_0.ps`; --$inc=`dirname $predir`; -- - $prog = ($0 =~ s=.*/==); - - %extn = ("font", ".pfa", "file", ".ps", "procset", ".ps", # resource extns -@@ -33,8 +28,7 @@ - local($comment, @res) = split(/\s+/); - local($type) = defined($type{$comment}) ? $type{$comment} : shift(@res); - local($name) = &filename(@res); -- if (open(RES, $name) || open(RES, "$name$extn{$type}") || -- open(RES, "$inc/$name") || open(RES, "$inc/$name$extn{$type}")) { -+ if (open(RES, $name) || open(RES, "$name$extn{$type}")) { - while (<RES>) { - print $_; - } diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-09-PERL b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-09-PERL deleted file mode 100644 index f184f3712e5..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-09-PERL +++ /dev/null @@ -1,41 +0,0 @@ - Required for some perl implementations. - -diff -ur psutils-1.17.orig/extractres.pl psutils-1.17/extractres.pl ---- psutils-1.17.orig/extractres.pl 2011-01-09 17:38:03.000000000 +0100 -+++ psutils-1.17/extractres.pl 2011-01-09 17:47:53.000000000 +0100 -@@ -4,7 +4,8 @@ - # Copyright (C) Angus J. C. Duggan 1991-1995 - # See file LICENSE for details. - --$prog = ($0 =~ s=.*/==); -+$0 =~ s=.*/==; -+$prog = $0; - - %resources = (); # list of resources included - %merge = (); # list of resources extracted this time -diff -ur psutils-1.17.orig/includeres.pl psutils-1.17/includeres.pl ---- psutils-1.17.orig/includeres.pl 2010-12-20 20:15:37.000000000 +0100 -+++ psutils-1.17/includeres.pl 2011-01-09 17:47:53.000000000 +0100 -@@ -4,7 +4,8 @@ - # Copyright (C) Angus J. C. Duggan 1991-1995 - # See file LICENSE for details. - --$prog = ($0 =~ s=.*/==); -+$0 =~ s=.*/==; -+$prog = $0; - - %extn = ("font", ".pfa", "file", ".ps", "procset", ".ps", # resource extns - "pattern", ".pat", "form", ".frm", "encoding", ".enc"); -diff -ur psutils-1.17.orig/psmerge.pl psutils-1.17/psmerge.pl ---- psutils-1.17.orig/psmerge.pl 1997-03-11 23:53:02.000000000 +0100 -+++ psutils-1.17/psmerge.pl 2011-01-09 17:47:53.000000000 +0100 -@@ -5,7 +5,8 @@ - # Copyright (C) Angus J. C. Duggan 1991-1995 - # See file LICENSE for details. - --$prog = ($0 =~ s=.*/==); -+$0 =~ s=.*/==; -+$prog = $0; - - while ($ARGV[0] =~ /^-/) { - $_ = shift; diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-10-binary-mode b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-10-binary-mode deleted file mode 100644 index e96839b911d..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-10-binary-mode +++ /dev/null @@ -1,60 +0,0 @@ -diff -ur psutils-1.17.orig/psbook.c psutils-1.17/psbook.c ---- psutils-1.17.orig/psbook.c 2008-02-01 12:23:16.000000000 +0100 -+++ psutils-1.17/psbook.c 2011-09-22 19:16:13.000000000 +0200 -@@ -66,7 +66,7 @@ - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) -- message(FATAL, "can't open input file %s\n", argv[4]); -+ message(FATAL, "can't reset stdin to binary mode\n"); - } - if ( outfile == stdout ) { - int fd = fileno(stdout) ; -diff -ur psutils-1.17.orig/psnup.c psutils-1.17/psnup.c ---- psutils-1.17.orig/psnup.c 2009-06-24 00:18:08.000000000 +0200 -+++ psutils-1.17/psnup.c 2011-09-22 19:16:16.000000000 +0200 -@@ -195,7 +195,7 @@ - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) -- message(FATAL, "can't open input file %s\n", argv[4]); -+ message(FATAL, "can't reset stdin to binary mode\n"); - } - if ( outfile == stdout ) { - int fd = fileno(stdout) ; -diff -ur psutils-1.17.orig/psresize.c psutils-1.17/psresize.c ---- psutils-1.17.orig/psresize.c 2008-02-01 12:23:16.000000000 +0100 -+++ psutils-1.17/psresize.c 2011-09-22 19:16:18.000000000 +0200 -@@ -118,7 +118,7 @@ - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) -- message(FATAL, "can't open input file %s\n", argv[4]); -+ message(FATAL, "can't reset stdin to binary mode\n"); - } - if ( outfile == stdout ) { - int fd = fileno(stdout) ; -diff -ur psutils-1.17.orig/psselect.c psutils-1.17/psselect.c ---- psutils-1.17.orig/psselect.c 2008-02-01 12:23:16.000000000 +0100 -+++ psutils-1.17/psselect.c 2011-09-22 19:16:21.000000000 +0200 -@@ -137,7 +137,7 @@ - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) -- message(FATAL, "can't open input file %s\n", argv[4]); -+ message(FATAL, "can't reset stdin to binary mode\n"); - } - if ( outfile == stdout ) { - int fd = fileno(stdout) ; -diff -ur psutils-1.17.orig/pstops.c psutils-1.17/pstops.c ---- psutils-1.17.orig/pstops.c 2009-06-24 00:18:08.000000000 +0200 -+++ psutils-1.17/pstops.c 2011-09-22 19:16:24.000000000 +0200 -@@ -181,7 +181,7 @@ - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) -- message(FATAL, "can't open input file %s\n", argv[4]); -+ message(FATAL, "can't reset stdin to binary mode\n"); - } - if ( outfile == stdout ) { - int fd = fileno(stdout) ; diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-11-extern b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-11-extern deleted file mode 100644 index 35cd5e92bd8..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-11-extern +++ /dev/null @@ -1,44 +0,0 @@ - Remove extern decls from *.c files. - -diff -ur psutils-1.17.orig/epsffit.c psutils-1.17/epsffit.c ---- psutils-1.17.orig/epsffit.c 2009-06-24 00:22:15.000000000 +0200 -+++ psutils-1.17/epsffit.c 2012-03-29 14:25:12.000000000 +0200 -@@ -23,7 +23,7 @@ - - #include "pserror.h" - #include "patchlev.h" --#include "config.h" -+#include "psutil.h" - - #define MIN(x,y) ((x) > (y) ? (y) : (x)) - #define MAX(x,y) ((x) > (y) ? (x) : (y)) -diff -ur psutils-1.17.orig/pserror.c psutils-1.17/pserror.c ---- psutils-1.17.orig/pserror.c 2009-09-01 13:40:27.000000000 +0200 -+++ psutils-1.17/pserror.c 2012-03-29 14:25:12.000000000 +0200 -@@ -5,8 +5,6 @@ - * Warnings and errors for PS programs - */ - --extern char *program ; /* Defined by main program, giving program name */ -- - #include "psutil.h" - #include "pserror.h" - #include "patchlev.h" -diff -ur psutils-1.17.orig/psutil.c psutils-1.17/psutil.c ---- psutils-1.17.orig/psutil.c 2009-09-01 13:43:52.000000000 +0200 -+++ psutils-1.17/psutil.c 2012-03-29 14:25:12.000000000 +0200 -@@ -23,14 +23,6 @@ - - #define iscomment(x,y) (strncmp(x,y,strlen(y)) == 0) - --extern char *program ; --extern int pages; --extern int verbose; --extern FILE *infile; --extern FILE *outfile; --extern char pagelabel[BUFSIZ]; --extern int pageno; -- - static char buffer[BUFSIZ]; - static long bytes = 0; - static long pagescmt = 0; diff --git a/Build/source/utils/psutils/psutils-1.17/LICENSE b/Build/source/utils/psutils/psutils-1.17/LICENSE deleted file mode 100644 index e5e718ac10c..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ - - PS Utilities Package - -The constituent files of this package listed below are copyright (C) 1991-1995 -Angus J. C. Duggan. - -LICENSE Makefile.msc Makefile.nt Makefile.os2 -Makefile.unix README config.h descrip.mms -epsffit.c epsffit.man extractres.man extractres.pl -fixdlsrps.man fixdlsrps.pl fixfmps.man fixfmps.pl -fixmacps.man fixmacps.pl fixpsditps.man fixpsditps.pl -fixpspps.man fixpspps.pl fixscribeps.man fixscribeps.pl -fixtpps.man fixtpps.pl fixwfwps.man fixwfwps.pl -fixwpps.man fixwpps.pl fixwwps.man fixwwps.pl -getafm getafm.man includeres.man includeres.pl -maketext patchlev.h psbook.c psbook.man -pserror.c pserror.h psmerge.man psmerge.pl -psnup.c psnup.man psresize.c psresize.man -psselect.c psselect.man psspec.c psspec.h -pstops.c pstops.man psutil.c psutil.h -showchar - -They may be copied and used for any purpose (including distribution as part of -a for-profit product), provided: - -1) The original attribution of the programs is clearly displayed in the product - and/or documentation, even if the programs are modified and/or renamed as - part of the product. - -2) The original source code of the programs is provided free of charge (except - for reasonable distribution costs). For a definition of reasonable - distribution costs, see the Gnu General Public License or Larry Wall's - Artistic License (provided with the Perl 4 kit). The GPL and Artistic - License in NO WAY affect this license; they are merely used as examples of - the spirit in which it is intended. - -3) These programs are provided "as-is". No warranty or guarantee of their - fitness for any particular task is provided. Use of these programs is - completely at your own risk. - -Basically, I don't mind how you use the programs so long as you acknowledge -the author, and give people the originals if they want them. - -The included files, md68_0.ps and md71_0.ps (and their uuencoded forms) are -(to the best of my knowledge) copyright Apple Computer, Inc. - - AJCD 4/4/95 diff --git a/Build/source/utils/psutils/psutils-1.17/Makefile.bcc b/Build/source/utils/psutils/psutils-1.17/Makefile.bcc deleted file mode 100644 index 89ab6bbcc04..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/Makefile.bcc +++ /dev/null @@ -1,108 +0,0 @@ -# Makefile for PS utilities release 1 patchlevel 17 -# -# Copyright (C) Angus J. C. Duggan 1991-1996 -# See file LICENSE for details. -# -# updated AJCD 3/1/96 -# -# Multiple makefiles for different OSes are generated from a single master -# now. -# -# There are so many incompatible makes around that putting all of the -# non-standard targets explicitly seems to be the only way of ensuring -# portability. - -# epsffit fits an epsf file to a given bounding box -# psbook rearranges pages into signatures -# psselect selects page ranges -# pstops performs general page rearrangement and merging -# psnup puts multiple logical pages on one physical page -# psresize scales and moves pages to fit on different paper sizes - -PAPER=a4 - -# Makefile for PSUtils under MSDOS - -OS = DOS - -BINDIR = \psutils -SCRIPTDIR = $(BINDIR) -INCLUDEDIR = \psutils\include - -# Flags for Borland C Compiler -CC = bcc -CFLAGS = -DPAPER="$(PAPER)" -DMSDOS -w -v -O - -BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ - psresize.exe -SHELLSCRIPTS = -PERLSCRIPTS = \ - \ - -MANPAGES = \ - \ - \ - \ - -INCLUDES = md68_0.ps md71_0.ps - -all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) - -psutil.obj: psutil.h patchlev.h pserror.h psutil.c - -psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c - -pserror.obj: psutil.h patchlev.h pserror.h pserror.c - -epsffit.obj: epsffit.c pserror.h patchlev.h - -epsffit.exe: epsffit.obj pserror.obj - $(CC) -e epsffit.exe pserror.obj epsffit.obj - -psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj - $(CC) -e psnup.exe psutil.obj psspec.obj pserror.obj psnup.obj - -psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c - -psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj - $(CC) -e psresize.exe psutil.obj psspec.obj pserror.obj psresize.obj - -psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c - -psbook.exe: psbook.obj psutil.obj pserror.obj - $(CC) -e psbook.exe psutil.obj pserror.obj psbook.obj - -psbook.obj: psutil.h patchlev.h pserror.h psbook.c - -psselect.exe: psselect.obj psutil.obj pserror.obj - $(CC) -e psselect.exe psutil.obj pserror.obj psselect.obj - -psselect.obj: psutil.h patchlev.h pserror.h psselect.c - -pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj - $(CC) -e pstops.exe psutil.obj psspec.obj pserror.obj pstops.obj - -pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c - - - -clean: - del *.obj - -veryclean realclean: clean - del $(BIN) $(PERLSCRIPTS) $(MANPAGES) - -install: install.bin install.script install.include - -install.bin: $(BIN) - -mkdir $(BINDIR) - @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) - -install.script: $(PERLSCRIPTS) - -mkdir $(SCRIPTDIR) - @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) - -install.include: $(INCLUDES) - -mkdir $(INCLUDEDIR) - @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) - diff --git a/Build/source/utils/psutils/psutils-1.17/Makefile.msc b/Build/source/utils/psutils/psutils-1.17/Makefile.msc deleted file mode 100644 index 90d1383e5f3..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/Makefile.msc +++ /dev/null @@ -1,108 +0,0 @@ -# Makefile for PS utilities release 1 patchlevel 17 -# -# Copyright (C) Angus J. C. Duggan 1991-1996 -# See file LICENSE for details. -# -# updated AJCD 3/1/96 -# -# Multiple makefiles for different OSes are generated from a single master -# now. -# -# There are so many incompatible makes around that putting all of the -# non-standard targets explicitly seems to be the only way of ensuring -# portability. - -# epsffit fits an epsf file to a given bounding box -# psbook rearranges pages into signatures -# psselect selects page ranges -# pstops performs general page rearrangement and merging -# psnup puts multiple logical pages on one physical page -# psresize scales and moves pages to fit on different paper sizes - -PAPER=a4 - -# Makefile for PSUtils under MSDOS - -OS = DOS - -BINDIR = \psutils -SCRIPTDIR = $(BINDIR) -INCLUDEDIR = \psutils\include - -# Flags for Microsoft C/C++ Compiler -CC = cl -CFLAGS = -DPAPER=\"$(PAPER)\" -DMSDOS -W4 -Zi -Ox - -BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ - psresize.exe -SHELLSCRIPTS = -PERLSCRIPTS = \ - \ - -MANPAGES = \ - \ - \ - \ - -INCLUDES = md68_0.ps md71_0.ps - -all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) - -psutil.obj: psutil.h patchlev.h pserror.h psutil.c - -psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c - -pserror.obj: psutil.h patchlev.h pserror.h pserror.c - -epsffit.obj: epsffit.c pserror.h patchlev.h - -epsffit.exe: epsffit.obj pserror.obj - link -out:epsffit.exe pserror.obj epsffit.obj - -psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj - link -out:psnup.exe psutil.obj psspec.obj pserror.obj psnup.obj - -psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c - -psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj - link -out:psresize.exe psutil.obj psspec.obj pserror.obj psresize.obj - -psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c - -psbook.exe: psbook.obj psutil.obj pserror.obj - link -out:psbook.exe psutil.obj pserror.obj psbook.obj - -psbook.obj: psutil.h patchlev.h pserror.h psbook.c - -psselect.exe: psselect.obj psutil.obj pserror.obj - link -out:psselect.exe psutil.obj pserror.obj psselect.obj - -psselect.obj: psutil.h patchlev.h pserror.h psselect.c - -pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj - link -out:pstops.exe psutil.obj psspec.obj pserror.obj pstops.obj - -pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c - - - -clean: - del *.obj - -veryclean realclean: clean - del $(BIN) $(PERLSCRIPTS) $(MANPAGES) - -install: install.bin install.script install.include - -install.bin: $(BIN) - -mkdir $(BINDIR) - @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) - -install.script: $(PERLSCRIPTS) - -mkdir $(SCRIPTDIR) - @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) - -install.include: $(INCLUDES) - -mkdir $(INCLUDEDIR) - @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) - diff --git a/Build/source/utils/psutils/psutils-1.17/Makefile.nt b/Build/source/utils/psutils/psutils-1.17/Makefile.nt deleted file mode 100644 index 41d9b054d3c..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/Makefile.nt +++ /dev/null @@ -1,146 +0,0 @@ -# Makefile for PS utilities release 1 patchlevel 17 -# -# Copyright (C) Angus J. C. Duggan 1991-1996 -# See file LICENSE for details. -# -# updated AJCD 3/1/96 -# -# Multiple makefiles for different OSes are generated from a single master -# now. -# -# There are so many incompatible makes around that putting all of the -# non-standard targets explicitly seems to be the only way of ensuring -# portability. - -# epsffit fits an epsf file to a given bounding box -# psbook rearranges pages into signatures -# psselect selects page ranges -# pstops performs general page rearrangement and merging -# psnup puts multiple logical pages on one physical page -# psresize scales and moves pages to fit on different paper sizes - -PAPER=a4 - -# Makefile for PSUtils under Windows NT, Microsoft C/C++ Compiler - -OS = WINNT - -BINDIR = \psutils -SCRIPTDIR = $(BINDIR) -INCLUDEDIR = \psutils\include -PERL = perl - -CFLAGS = -DPAPER=\"$(PAPER)\" -DWINNT /W4 - -BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ - psresize.exe -SHELLSCRIPTS = -PERLSCRIPTS = fixfmps.cmd fixmacps.cmd fixpsditps.cmd fixpspps.cmd \ - fixtpps.cmd fixwfwps.cmd fixwpps.cmd fixscribeps.cmd fixwwps.cmd \ - fixdlsrps.cmd extractres.cmd includeres.cmd psmerge.cmd -MANPAGES = \ - \ - \ - \ - -INCLUDES = md68_0.ps md71_0.ps - -all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) - -psutil.obj: psutil.h patchlev.h pserror.h psutil.c - -psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c - -pserror.obj: psutil.h patchlev.h pserror.h pserror.c - -epsffit.obj: epsffit.c pserror.h patchlev.h - -epsffit.exe: epsffit.obj pserror.obj - link -out:epsffit.exe pserror.obj epsffit.obj - -psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj - link -out:psnup.exe psutil.obj psspec.obj pserror.obj psnup.obj - -psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c - -psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj - link -out:psresize.exe psutil.obj psspec.obj pserror.obj psresize.obj - -psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c - -psbook.exe: psbook.obj psutil.obj pserror.obj - link -out:psbook.exe psutil.obj pserror.obj psbook.obj - -psbook.obj: psutil.h patchlev.h pserror.h psbook.c - -psselect.exe: psselect.obj psutil.obj pserror.obj - link -out:psselect.exe psutil.obj pserror.obj psselect.obj - -psselect.obj: psutil.h patchlev.h pserror.h psselect.c - -pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj - link -out:pstops.exe psutil.obj psspec.obj pserror.obj pstops.obj - -pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c - - -psmerge.cmd: psmerge.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -fixfmps.cmd: fixfmps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -fixmacps.cmd: fixmacps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) INCLUDE=$(INCLUDEDIR) $? > $@ - -fixpsditps.cmd: fixpsditps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -fixpspps.cmd: fixpspps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -fixscribeps.cmd: fixscribeps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -fixtpps.cmd: fixtpps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -fixwfwps.cmd: fixwfwps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -fixwpps.cmd: fixwpps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -fixwwps.cmd: fixwwps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -fixdlsrps.cmd: fixdlsrps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -extractres.cmd: extractres.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - -includeres.cmd: includeres.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) INCLUDE=$(INCLUDEDIR) $? > $@ - - -clean: - del *.obj - -veryclean realclean: clean - del $(BIN) $(PERLSCRIPTS) $(MANPAGES) - -install: install.bin install.script install.include - -install.bin: $(BIN) - -mkdir $(BINDIR) - @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) - -install.script: $(PERLSCRIPTS) - -mkdir $(SCRIPTDIR) - @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) - -install.include: $(INCLUDES) - -mkdir $(INCLUDEDIR) - @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) - diff --git a/Build/source/utils/psutils/psutils-1.17/Makefile.os2 b/Build/source/utils/psutils/psutils-1.17/Makefile.os2 deleted file mode 100644 index ba99fcd81f6..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/Makefile.os2 +++ /dev/null @@ -1,245 +0,0 @@ -# Makefile for PS utilities release 1 patchlevel 17 -# -# Copyright (C) Angus J. C. Duggan 1991-1996 -# See file LICENSE for details. -# -# updated AJCD 3/1/96 -# -# Multiple makefiles for different OSes are generated from a single master -# now. -# -# There are so many incompatible makes around that putting all of the -# non-standard targets explicitly seems to be the only way of ensuring -# portability. - -# epsffit fits an epsf file to a given bounding box -# psbook rearranges pages into signatures -# psselect selects page ranges -# pstops performs general page rearrangement and merging -# psnup puts multiple logical pages on one physical page -# psresize scales and moves pages to fit on different paper sizes - -PAPER=a4 - -# Makefile for PSUtils under OS/2, GCC C Compiler - -OS = OS2 - -BINDIR = \psutils -SCRIPTDIR = $(BINDIR) -INCLUDEDIR = /lib/psutils -PERL = perl5 - -BINMODE = 0755 -MANMODE = 0644 -CHMOD = chmod -INSTALL = install -c -m $(BINMODE) -INSTALLMAN = install -c -m $(MANMODE) -MANEXT = 1 -MANDIR = /man/man$(MANEXT) - -CC = gcc -CFLAGS = -DPAPER=\"$(PAPER)\" -DOS2 -Wall -O2 -Zomf -Zmtd -s -Zlinker /PM:VIO - -.c.obj: - $(CC) -o $*.obj $(CFLAGS) -c $< - -BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ - psresize.exe -SHELLSCRIPTS = getafm.cmd showchar.cmd -PERLSCRIPTS = fixfmps.cmd fixmacps.cmd fixpsditps.cmd fixpspps.cmd \ - fixtpps.cmd fixwfwps.cmd fixwpps.cmd fixscribeps.cmd fixwwps.cmd \ - fixdlsrps.cmd extractres.cmd includeres.cmd psmerge.cmd -MANPAGES = psbook.$(MANEXT) psselect.$(MANEXT) pstops.$(MANEXT) epsffit.$(MANEXT) psnup.$(MANEXT) \ - psresize.$(MANEXT) psmerge.$(MANEXT) fixscribeps.$(MANEXT) getafm.$(MANEXT) \ - fixdlsrps.$(MANEXT) fixfmps.$(MANEXT) fixmacps.$(MANEXT) fixpsditps.$(MANEXT) \ - fixpspps.$(MANEXT) fixtpps.$(MANEXT) fixwfwps.$(MANEXT) fixwpps.$(MANEXT) \ - fixwwps.$(MANEXT) extractres.$(MANEXT) includeres.$(MANEXT) -INCLUDES = md68_0.ps md71_0.ps - -all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) - -psutil.obj: psutil.h patchlev.h pserror.h psutil.c - -psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c - -pserror.obj: psutil.h patchlev.h pserror.h pserror.c - -epsffit.obj: epsffit.c pserror.h patchlev.h - -epsffit.exe: epsffit.obj pserror.obj - $(CC) $(CFLAGS) -o epsffit pserror.obj epsffit.obj - -psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj - $(CC) $(CFLAGS) -o psnup psutil.obj psspec.obj pserror.obj psnup.obj - -psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c - -psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj - $(CC) $(CFLAGS) -o psresize psutil.obj psspec.obj pserror.obj psresize.obj - -psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c - -psbook.exe: psbook.obj psutil.obj pserror.obj - $(CC) $(CFLAGS) -o psbook psutil.obj pserror.obj psbook.obj - -psbook.obj: psutil.h patchlev.h pserror.h psbook.c - -psselect.exe: psselect.obj psutil.obj pserror.obj - $(CC) $(CFLAGS) -o psselect psutil.obj pserror.obj psselect.obj - -psselect.obj: psutil.h patchlev.h pserror.h psselect.c - -pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj - $(CC) $(CFLAGS) -o pstops psutil.obj psspec.obj pserror.obj pstops.obj - -pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c - -getafm.cmd: getafm.sh - echo extproc sh $(BINDIR)/$@ >$@ - head -n 2 $? >>$@ - echo shift >>$@ - tail -n +2 $? >>$@ - -showchar.cmd: showchar.sh - echo extproc sh $(BINDIR)/$@ >$@ - head -n 5 $? >>$@ - echo shift >>$@ - tail -n +5 $? >>$@ - -psmerge.cmd: psmerge.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixfmps.cmd: fixfmps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixmacps.cmd: fixmacps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) INCLUDE=$(INCLUDEDIR) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixpsditps.cmd: fixpsditps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixpspps.cmd: fixpspps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixscribeps.cmd: fixscribeps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixtpps.cmd: fixtpps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixwfwps.cmd: fixwfwps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixwpps.cmd: fixwpps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixwwps.cmd: fixwwps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixdlsrps.cmd: fixdlsrps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -extractres.cmd: extractres.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -includeres.cmd: includeres.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) INCLUDE=$(INCLUDEDIR) $? > $@ - $(CHMOD) $(BINMODE) $@ - -epsffit.$(MANEXT): epsffit.man - $(PERL) maketext MAN="$(MANPAGES)" $? > $@ - -psnup.$(MANEXT): psnup.man - $(PERL) maketext MAN="$(MANPAGES)" PAPER=$(PAPER) $? > $@ - -psresize.$(MANEXT): psresize.man - $(PERL) maketext MAN="$(MANPAGES)" PAPER=$(PAPER) $? > $@ - -psbook.$(MANEXT): psbook.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -psselect.$(MANEXT): psselect.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -pstops.$(MANEXT): pstops.man - $(PERL) maketext "MAN=$(MANPAGES)" PAPER=$(PAPER) $? > $@ - -psmerge.$(MANEXT): psmerge.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixfmps.$(MANEXT): fixfmps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixmacps.$(MANEXT): fixmacps.man - $(PERL) maketext "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $? > $@ - -fixpsditps.$(MANEXT): fixpsditps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixpspps.$(MANEXT): fixpspps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixscribeps.$(MANEXT): fixscribeps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixtpps.$(MANEXT): fixtpps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixwfwps.$(MANEXT): fixwfwps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixwpps.$(MANEXT): fixwpps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixwwps.$(MANEXT): fixwwps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixdlsrps.$(MANEXT): fixdlsrps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -extractres.$(MANEXT): extractres.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -includeres.$(MANEXT): includeres.man - $(PERL) maketext "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $? > $@ - -getafm.$(MANEXT): getafm.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -clean: - RM *.obj - -veryclean realclean: clean - RM $(BIN) $(PERLSCRIPTS) $(MANPAGES) - -install: install.bin install.script install.include install.man - -install.bin: $(BIN) - -mkdir $(BINDIR) - @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) - -install.script: $(PERLSCRIPTS) - -mkdir $(SCRIPTDIR) - @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) - -install.include: $(INCLUDES) - -mkdir $(INCLUDEDIR) - @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) - -install.man: $(MANPAGES) - -mkdir $(MANDIR) - @for %1 in ( $(MANPAGES) ); do copy %1 $(MANDIR) - diff --git a/Build/source/utils/psutils/psutils-1.17/Makefile.sc b/Build/source/utils/psutils/psutils-1.17/Makefile.sc deleted file mode 100644 index d2b4c43818e..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/Makefile.sc +++ /dev/null @@ -1,108 +0,0 @@ -# Makefile for PS utilities release 1 patchlevel 17 -# -# Copyright (C) Angus J. C. Duggan 1991-1996 -# See file LICENSE for details. -# -# updated AJCD 3/1/96 -# -# Multiple makefiles for different OSes are generated from a single master -# now. -# -# There are so many incompatible makes around that putting all of the -# non-standard targets explicitly seems to be the only way of ensuring -# portability. - -# epsffit fits an epsf file to a given bounding box -# psbook rearranges pages into signatures -# psselect selects page ranges -# pstops performs general page rearrangement and merging -# psnup puts multiple logical pages on one physical page -# psresize scales and moves pages to fit on different paper sizes - -PAPER=a4 - -# Makefile for PSUtils under MSDOS - -OS = DOS - -BINDIR = \psutils -SCRIPTDIR = $(BINDIR) -INCLUDEDIR = \psutils\include - -# Flags for Symantec C Compiler -CC = sc -CFLAGS = -DPAPER=\"$(PAPER)\" -DMSDOS -g - -BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ - psresize.exe -SHELLSCRIPTS = -PERLSCRIPTS = \ - \ - -MANPAGES = \ - \ - \ - \ - -INCLUDES = md68_0.ps md71_0.ps - -all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) - -psutil.obj: psutil.h patchlev.h pserror.h psutil.c - -psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c - -pserror.obj: psutil.h patchlev.h pserror.h pserror.c - -epsffit.obj: epsffit.c pserror.h patchlev.h - -epsffit.exe: epsffit.obj pserror.obj - $(CC) -oEXE(epsffit) pserror.obj epsffit.obj - -psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj - $(CC) -oEXE(psnup) psutil.obj psspec.obj pserror.obj psnup.obj - -psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c - -psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj - $(CC) -oEXE(psresize) psutil.obj psspec.obj pserror.obj psresize.obj - -psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c - -psbook.exe: psbook.obj psutil.obj pserror.obj - $(CC) -oEXE(psbook) psutil.obj pserror.obj psbook.obj - -psbook.obj: psutil.h patchlev.h pserror.h psbook.c - -psselect.exe: psselect.obj psutil.obj pserror.obj - $(CC) -oEXE(psselect) psutil.obj pserror.obj psselect.obj - -psselect.obj: psutil.h patchlev.h pserror.h psselect.c - -pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj - $(CC) -oEXE(pstops) psutil.obj psspec.obj pserror.obj pstops.obj - -pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c - - - -clean: - del *.obj - -veryclean realclean: clean - del $(BIN) $(PERLSCRIPTS) $(MANPAGES) - -install: install.bin install.script install.include - -install.bin: $(BIN) - -mkdir $(BINDIR) - @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) - -install.script: $(PERLSCRIPTS) - -mkdir $(SCRIPTDIR) - @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) - -install.include: $(INCLUDES) - -mkdir $(INCLUDEDIR) - @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) - diff --git a/Build/source/utils/psutils/psutils-1.17/Makefile.unix b/Build/source/utils/psutils/psutils-1.17/Makefile.unix deleted file mode 100644 index bbe286e0e74..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/Makefile.unix +++ /dev/null @@ -1,248 +0,0 @@ -# Makefile for PS utilities release 1 patchlevel 17 -# -# Copyright (C) Angus J. C. Duggan 1991-1996 -# See file LICENSE for details. -# -# updated AJCD 3/1/96 -# -# Multiple makefiles for different OSes are generated from a single master -# now. -# -# There are so many incompatible makes around that putting all of the -# non-standard targets explicitly seems to be the only way of ensuring -# portability. - -# epsffit fits an epsf file to a given bounding box -# psbook rearranges pages into signatures -# psselect selects page ranges -# pstops performs general page rearrangement and merging -# psnup puts multiple logical pages on one physical page -# psresize scales and moves pages to fit on different paper sizes - -PAPER=a4 - -# Makefile for PSUtils under Unix - -OS = UNIX - -BINDIR = /usr/local/bin -SCRIPTDIR = $(BINDIR) -INCLUDEDIR = /usr/local/share/psutils -PERL = /usr/local/bin/perl - -BINMODE = 0755 -MANMODE = 0644 -CHMOD = chmod -INSTALL = install -c -m $(BINMODE) -INSTALLMAN = install -c -m $(MANMODE) -MANEXT = 1 -MANDIR = /usr/local/share/man/man$(MANEXT) - -CC = gcc -CFLAGS = -DPAPER=\"$(PAPER)\" -DUNIX -O -Wall - -BIN = psbook psselect pstops epsffit psnup \ - psresize -SHELLSCRIPTS = getafm showchar -PERLSCRIPTS = fixfmps fixmacps fixpsditps fixpspps \ - fixtpps fixwfwps fixwpps fixscribeps fixwwps \ - fixdlsrps extractres includeres psmerge -MANPAGES = psbook.$(MANEXT) psselect.$(MANEXT) pstops.$(MANEXT) epsffit.$(MANEXT) psnup.$(MANEXT) \ - psresize.$(MANEXT) psmerge.$(MANEXT) fixscribeps.$(MANEXT) getafm.$(MANEXT) \ - fixdlsrps.$(MANEXT) fixfmps.$(MANEXT) fixmacps.$(MANEXT) fixpsditps.$(MANEXT) \ - fixpspps.$(MANEXT) fixtpps.$(MANEXT) fixwfwps.$(MANEXT) fixwpps.$(MANEXT) \ - fixwwps.$(MANEXT) extractres.$(MANEXT) includeres.$(MANEXT) -INCLUDES = md68_0.ps md71_0.ps - -all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) - -psutil.o: psutil.h patchlev.h pserror.h psutil.c - -psspec.o: psutil.h patchlev.h psspec.h pserror.h psspec.c - -pserror.o: psutil.h patchlev.h pserror.h pserror.c - -epsffit.o: epsffit.c pserror.h patchlev.h - -epsffit: epsffit.o pserror.o - $(CC) $(CCFLAGS) -o epsffit pserror.o epsffit.o - -psnup: psnup.o psutil.o psspec.o pserror.o - $(CC) $(CCFLAGS) -o psnup psutil.o psspec.o pserror.o psnup.o - -psnup.o: psutil.h patchlev.h psspec.h pserror.h psnup.c - -psresize: psresize.o psutil.o pserror.o psspec.o - $(CC) $(CCFLAGS) -o psresize psutil.o psspec.o pserror.o psresize.o - -psresize.o: psutil.h patchlev.h psspec.h pserror.h psresize.c - -psbook: psbook.o psutil.o pserror.o - $(CC) $(CCFLAGS) -o psbook psutil.o pserror.o psbook.o - -psbook.o: psutil.h patchlev.h pserror.h psbook.c - -psselect: psselect.o psutil.o pserror.o - $(CC) $(CCFLAGS) -o psselect psutil.o pserror.o psselect.o - -psselect.o: psutil.h patchlev.h pserror.h psselect.c - -pstops: pstops.o psutil.o psspec.o pserror.o - $(CC) $(CCFLAGS) -o pstops psutil.o psspec.o pserror.o pstops.o - -pstops.o: psutil.h patchlev.h psspec.h pserror.h pstops.c - -getafm: getafm.sh - cp $? $@ - -showchar: showchar.sh - cp $? $@ - -psmerge: psmerge.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixfmps: fixfmps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixmacps: fixmacps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) INCLUDE=$(INCLUDEDIR) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixpsditps: fixpsditps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixpspps: fixpspps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixscribeps: fixscribeps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixtpps: fixtpps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixwfwps: fixwfwps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixwpps: fixwpps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixwwps: fixwwps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -fixdlsrps: fixdlsrps.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -extractres: extractres.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ - $(CHMOD) $(BINMODE) $@ - -includeres: includeres.pl - $(PERL) maketext OS=$(OS) PERL=$(PERL) INCLUDE=$(INCLUDEDIR) $? > $@ - $(CHMOD) $(BINMODE) $@ - -epsffit.$(MANEXT): epsffit.man - $(PERL) maketext MAN="$(MANPAGES)" $? > $@ - -psnup.$(MANEXT): psnup.man - $(PERL) maketext MAN="$(MANPAGES)" PAPER=$(PAPER) $? > $@ - -psresize.$(MANEXT): psresize.man - $(PERL) maketext MAN="$(MANPAGES)" PAPER=$(PAPER) $? > $@ - -psbook.$(MANEXT): psbook.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -psselect.$(MANEXT): psselect.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -pstops.$(MANEXT): pstops.man - $(PERL) maketext "MAN=$(MANPAGES)" PAPER=$(PAPER) $? > $@ - -psmerge.$(MANEXT): psmerge.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixfmps.$(MANEXT): fixfmps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixmacps.$(MANEXT): fixmacps.man - $(PERL) maketext "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $? > $@ - -fixpsditps.$(MANEXT): fixpsditps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixpspps.$(MANEXT): fixpspps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixscribeps.$(MANEXT): fixscribeps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixtpps.$(MANEXT): fixtpps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixwfwps.$(MANEXT): fixwfwps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixwpps.$(MANEXT): fixwpps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixwwps.$(MANEXT): fixwwps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -fixdlsrps.$(MANEXT): fixdlsrps.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -extractres.$(MANEXT): extractres.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -includeres.$(MANEXT): includeres.man - $(PERL) maketext "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $? > $@ - -getafm.$(MANEXT): getafm.man - $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ - -clean: - rm -f *.o - -veryclean realclean: clean - rm -f $(BIN) $(PERLSCRIPTS) $(MANPAGES) - -install: install.bin install.script install.man install.include - -install.bin: $(BIN) - -mkdir $(BINDIR) - @for i in $(BIN); do \ - echo Installing $$i; \ - $(INSTALL) $$i $(BINDIR); \ - done - -install.script: $(PERLSCRIPTS) $(SHELLSCRIPTS) - -mkdir $(SCRIPTDIR) - @for i in $(PERLSCRIPTS) $(SHELLSCRIPTS); do \ - echo Installing $$i; \ - $(INSTALL) $$i $(SCRIPTDIR); \ - done - -install.include: $(INCLUDES) - -mkdir $(INCLUDEDIR) - @for i in $(INCLUDES); do \ - echo Installing $$i; \ - $(INSTALLMAN) $$i $(INCLUDEDIR); \ - done - -install.man: $(MANPAGES) - -mkdir $(MANDIR) - @for i in $(MANPAGES); do \ - echo Installing manual page for $$i; \ - $(INSTALLMAN) $$i $(MANDIR)/$$i; \ - done - diff --git a/Build/source/utils/psutils/psutils-1.17/Makefile.wat b/Build/source/utils/psutils/psutils-1.17/Makefile.wat deleted file mode 100644 index 71e289d6742..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/Makefile.wat +++ /dev/null @@ -1,108 +0,0 @@ -# Makefile for PS utilities release 1 patchlevel 17 -# -# Copyright (C) Angus J. C. Duggan 1991-1996 -# See file LICENSE for details. -# -# updated AJCD 3/1/96 -# -# Multiple makefiles for different OSes are generated from a single master -# now. -# -# There are so many incompatible makes around that putting all of the -# non-standard targets explicitly seems to be the only way of ensuring -# portability. - -# epsffit fits an epsf file to a given bounding box -# psbook rearranges pages into signatures -# psselect selects page ranges -# pstops performs general page rearrangement and merging -# psnup puts multiple logical pages on one physical page -# psresize scales and moves pages to fit on different paper sizes - -PAPER=a4 - -# Makefile for PSUtils under MSDOS - -OS = DOS - -BINDIR = \psutils -SCRIPTDIR = $(BINDIR) -INCLUDEDIR = \psutils\include - -# Flags for Watcom C Compiler -CC = wcc386 -CFLAGS = -dPAPER=\"$(PAPER)\" -dMSDOS -zq -oxt - -BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ - psresize.exe -SHELLSCRIPTS = -PERLSCRIPTS = \ - \ - -MANPAGES = \ - \ - \ - \ - -INCLUDES = md68_0.ps md71_0.ps - -all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) - -psutil.obj: psutil.h patchlev.h pserror.h psutil.c - -psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c - -pserror.obj: psutil.h patchlev.h pserror.h pserror.c - -epsffit.obj: epsffit.c pserror.h patchlev.h - -epsffit.exe: epsffit.obj pserror.obj - wcc386 -epsffite=epsffit.exe pserror.obj epsffit.obj - -psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj - wcc386 -psnupe=psnup.exe psutil.obj psspec.obj pserror.obj psnup.obj - -psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c - -psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj - wcc386 -psresizee=psresize.exe psutil.obj psspec.obj pserror.obj psresize.obj - -psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c - -psbook.exe: psbook.obj psutil.obj pserror.obj - wcc386 -psbooke=psbook.exe psutil.obj pserror.obj psbook.obj - -psbook.obj: psutil.h patchlev.h pserror.h psbook.c - -psselect.exe: psselect.obj psutil.obj pserror.obj - wcc386 -psselecte=psselect.exe psutil.obj pserror.obj psselect.obj - -psselect.obj: psutil.h patchlev.h pserror.h psselect.c - -pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj - wcc386 -pstopse=pstops.exe psutil.obj psspec.obj pserror.obj pstops.obj - -pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c - - - -clean: - del *.obj - -veryclean realclean: clean - del $(BIN) $(PERLSCRIPTS) $(MANPAGES) - -install: install.bin install.script install.include - -install.bin: $(BIN) - -mkdir $(BINDIR) - @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) - -install.script: $(PERLSCRIPTS) - -mkdir $(SCRIPTDIR) - @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) - -install.include: $(INCLUDES) - -mkdir $(INCLUDEDIR) - @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) - diff --git a/Build/source/utils/psutils/psutils-1.17/README b/Build/source/utils/psutils/psutils-1.17/README deleted file mode 100644 index cc2018357d4..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/README +++ /dev/null @@ -1,245 +0,0 @@ -PostScript Utilities Angus Duggan 9th March 1997 - -This archive contains some utilities for manipulating PostScript documents. -Page selection and rearrangement are supported, including arrangement into -signatures for booklet printing, and page merging for n-up printing. - -ENVIRONMENT - -These utilities have been compiled and run on Sun-3 and Sun-4 machines under -SunOS Solaris 2.3, Solaris 2.1, 4.1.3, 4.1.2, 4.1.1 and 4.0.1, HP9000/375 -machines under HPUX 7.0 and HPUX 8.0, Sequent Symmetry machines under Dynix -3.1.4 and PTX 3.2.0, IBM RS/6000, VAX/VMS, Decstation 3100 machines under -Ultrix 4.0, SGI 4k5 under Irix 4.1 and 5.2, and x86 machines under MSDOS 6.0 -and Windows NT 3.5 and 4.0. - -FILES - -The files contained are: --rw-r--r-- 1 angus 2317 Jun 19 1995 LICENSE --rw-r--r-- 1 angus 2899 Mar 09 09:26 Makefile.bcc --rw-r--r-- 1 angus 2915 Mar 09 09:26 Makefile.msc --rw-r--r-- 1 angus 4135 Mar 09 09:26 Makefile.nt --rw-r--r-- 1 angus 7146 Mar 09 09:26 Makefile.os2 --rw-r--r-- 1 angus 2895 Mar 09 09:26 Makefile.sc --rw-r--r-- 1 angus 6913 Mar 09 09:26 Makefile.unix --rw-r--r-- 1 angus 11345 Mar 09 09:20 README --rw-r--r-- 1 angus 678 Nov 02 1995 config.h --rw-r--r-- 1 angus 2373 Jun 19 1995 descrip.mms --rw-r--r-- 1 angus 5773 Mar 14 1996 epsffit.c --rw-r--r-- 1 angus 1291 Nov 02 1995 epsffit.man --rw-r--r-- 1 angus 1236 Nov 02 1995 extractres.man --rw-r--r-- 1 angus 2780 Nov 02 1995 extractres.pl --rw-r--r-- 1 angus 561 Nov 02 1995 fixdlsrps.man --rw-r--r-- 1 angus 1554 Nov 02 1995 fixdlsrps.pl --rw-r--r-- 1 angus 527 Nov 02 1995 fixfmps.man --rw-r--r-- 1 angus 556 Nov 02 1995 fixfmps.pl --rw-r--r-- 1 angus 644 Nov 02 1995 fixmacps.man --rw-r--r-- 1 angus 2170 Nov 02 1995 fixmacps.pl --rw-r--r-- 1 angus 556 Nov 02 1995 fixpsditps.man --rw-r--r-- 1 angus 655 Nov 02 1995 fixpsditps.pl --rw-r--r-- 1 angus 523 Nov 02 1995 fixpspps.man --rw-r--r-- 1 angus 1298 Nov 02 1995 fixpspps.pl --rw-r--r-- 1 angus 531 Nov 02 1995 fixscribeps.man --rw-r--r-- 1 angus 434 Nov 02 1995 fixscribeps.pl --rw-r--r-- 1 angus 553 Nov 02 1995 fixtpps.man --rw-r--r-- 1 angus 663 Nov 02 1995 fixtpps.pl --rw-r--r-- 1 angus 547 Nov 02 1995 fixwfwps.man --rw-r--r-- 1 angus 826 Nov 02 1995 fixwfwps.pl --rw-r--r-- 1 angus 533 Nov 02 1995 fixwpps.man --rw-r--r-- 1 angus 699 Nov 02 1995 fixwpps.pl --rw-r--r-- 1 angus 531 Nov 02 1995 fixwwps.man --rw-r--r-- 1 angus 383 Nov 02 1995 fixwwps.pl --rw-r--r-- 1 angus 711 Apr 06 1995 getafm.man --rwxr-xr-x 1 angus 6482 Jun 19 1995 getafm.sh --rw-r--r-- 1 angus 1107 Nov 02 1995 includeres.man --rw-r--r-- 1 angus 1435 Nov 02 1995 includeres.pl --rw-r--r-- 1 angus 1901 Jan 03 1996 maketext --rw-r--r-- 1 angus 31406 Jun 19 1995 md68_0.ps --rw-r--r-- 1 angus 35734 Jun 19 1995 md71_0.ps --rw-r--r-- 1 angus 132 Nov 02 1995 patchlev.h --rw-r--r-- 1 angus 2875 Nov 02 1995 psbook.c --rw-r--r-- 1 angus 1156 Nov 02 1995 psbook.man --rw-r--r-- 1 angus 3201 Nov 02 1995 pserror.c --rw-r--r-- 1 angus 561 Nov 02 1995 pserror.h --rw-r--r-- 1 angus 957 Nov 02 1995 psmerge.man --rw-r--r-- 1 angus 2028 Nov 02 1995 psmerge.pl --rw-r--r-- 1 angus 10396 Nov 02 1995 psnup.c --rw-r--r-- 1 angus 4002 Nov 02 1995 psnup.man --rw-r--r-- 1 angus 5379 Nov 02 1995 psresize.c --rw-r--r-- 1 angus 1696 Nov 02 1995 psresize.man --rw-r--r-- 1 angus 6096 Jun 05 1996 psselect.c --rw-r--r-- 1 angus 2117 Mar 09 09:12 psselect.man --rw-r--r-- 1 angus 7784 Dec 06 1995 psspec.c --rw-r--r-- 1 angus 877 Feb 21 1996 psspec.h --rw-r--r-- 1 angus 5159 Nov 02 1995 pstops.c --rw-r--r-- 1 angus 4091 Nov 02 1995 pstops.man --rw-r--r-- 1 angus 9323 Mar 04 13:41 psutil.c --rw-r--r-- 1 angus 1494 Nov 02 1995 psutil.h --rwxr-xr-x 1 angus 2685 Jun 19 1995 showchar.sh - - -PROGRAMS - -psbook rearranges pages into signatures -psselect selects pages and page ranges -pstops performs general page rearrangement and selection -psnup put multiple pages per physical sheet of paper -psresize alter document paper size -epsffit fits an EPSF file to a given bounding box - -psselect in modeled after Chris Torek's dviselect program, and pstops is -modeled after Tom Rokicki's dvidvi program. psbook is modeled on my own -dvibook program, which borrows heavily from Chris Torek's dviselect. - -SCRIPTS - -getafm (sh) outputs PostScript to retrieve AFM file from printer -showchar (sh) outputs PostScript to draw a character with metric info -fixdlsrps (perl) filter to fix DviLaser/PS output so that PSUtils works -fixfmps (perl) filter to fix framemaker documents so that psselect etc. work -fixmacps (perl) filter to fix Macintosh documents with saner version of md -fixpsditps (perl) filter to fix Transcript psdit documents to work with PSUtils -fixpspps (perl) filter to fix PSPrint PostScript so that psselect etc. work -fixscribeps (perl) filter to fix Scribe PostScript so that psselect etc. work -fixtpps (perl) filter to fix Troff Tpscript documents -fixwfwps (perl) filter to fix Word for Windows documents for PSUtils -fixwpps (perl) filter to fix WordPerfect documents for PSUtils -fixwwps (perl) filter to fix Windows Write documents for PSUtils -extractres (perl) filter to extract resources from PostScript files -includeres (perl) filter to include resources into PostScript files -psmerge (perl) hack script to merge multiple PostScript files - -INSTALLATION - -UUdecode md71_0.uue and md68_0.uue (if supplied encoded). Copy the most -appropriate makefile to "Makefile", and edit the copy to put in required paths -for BINDIR, SCRIPTDIR, MANDIR, INCLUDEDIR, and PERL. Alter values of MANEXT to -put the manual pages in a different section if desired, change PAPER to set -the default paper size, "make", and "make install". - -BUGS - -The utilities don't check for PS-Adobe-?.? conformance; they assume documents -conform. Utilities need an extra save/restore around whole document on a -SPARCPrinter with NeWSPrint 1.0, because of bugs in the xnews server. - -Bug fixes and suggestions to angus@harlequin.co.uk - -UPDATES - -The definitive archive sites for PSUtils updates are ftp.dcs.ed.ac.uk, in the -directory pub/ajcd/, and ftp.tardis.ed.ac.uk, in the directory users/ajcd. The -latest version will be in psutils.tar.gz older versions may also be in -psutils-*.tar.gz - -NOTE - -This is an interim release; these utilities are currently being re-written -from scratch, with a full DSC-3.0 parser and more extraction, merging, and -inclusion options included. - -WINDOWS USERS - -*Please* make sure that you have selected "Generate DSC Comments" in your -printer driver setup. These utilities need DSC comments to tell where page -boundaries are. - -DVIPS USERS - -The latest versions of dvips have changed the default setting of the DSC -comment flag; you must generate with DSC comments for PSUtils to work. - -ACKNOWLEDGEMENTS - -Bug fixes and suggestions for improvements to PSUtils have come from many -people, including: - - Brian Colfer brianc@labmed.ucsf.edu - Charles A. Finnell finnell@org.mitre.lear - Conrad Kimball cek@com.boeing.sdc - J.W.Hawtin - Jochen Schwarze schwarze@de.isa - Ken Carpenter khc@edu.ksu.eece - Kristian Jorg etxkrjg@se.ericsson.solsta - Larry Weissman larryw@nsr.bioeng.washington.edu - Michael L. Brown brown@wi.extrel.com - Hunter Goatley goathunter@wkuvx1.bitnet - John Interrante interran@uluru.Stanford.edu - Maurizio Cremonesi MAUCREM@imiclvx.earn - Matthew Stier Matthew.Stier@East.Sun.com - Gerry Pratt cca13@seq1.kl.ac.uk - Robert Joop rj@rainbow.in-berlin.de - Johan Vromans jv@mh.nl - Bryan Faubion bryanf@tc.fluke.com - Chris Ritson C.R.Ritson@ncl.ac.uk - Michele Marziani MARZIANI@VAXFE.INFN.IT - Michael I. Schwartz mschwart@diana.cair.du.edu - Chris Ritson C.R.Ritson@newcastle.ac.uk - Joerg Eisenreich - Anreas Borchert borchert@mathematik.uni-ulm.de - Mike Coleman - Dale Scheetz dwarf@polaris.net - Yves Arrouye arrouye@marin.fdn.fr - -(Apologies to anyone who I have left out, it was not intentional.) - -NEWS - -Patchlevel 11 contains some significant enhancements to PSUtils, in -preparation for the eventual release of version 2 (don't hold your breath -waiting for it). These include: - -* Specify paper sizes by name for pstops and psnup. -* Psnup re-written in C to be much more versatile (do any number n-up). -* Epsffit can input broken %%BoundingBox comments which use real numbers. -* Should work on MSDOS and VMS machines as well as Unix. -* Accept more DSC compliant documents (Page labels are better supported). - -Patchlevel 12 was a bug-fix release. - -* Long standing fixmacps bug fixed. -* fixwfwps fixes WFW EPSF files as well as DSC files. -* md71_0.ps and md68_0.ps files were automatically uudecoded. - -Patchlevel 13 contained two new scripts for resource management, and fixes to -the Makefile, page labels, and output chaining. - -* Epsffit can output to a file as well as standard output. -* extractres takes resources out of PostScript files and saves them -* includeres puts resources from a resource library into PostScript files. -* maketext script is now used to do substitutions in Perl scripts and man pages -* page labels in psnup and pstops now show where pages came from. -* page labels in psbook and psselect fixed. -* prologues fixed to be extractable and re-usable -* Makefile doesn't use SUFFIXES any more -* pstops and psnup output can now be chained through each other. -* psresize alters the paper size used by a document -* patchlevel.h shortened to patchlev.h as a concession to MSDOS -* psnup now has -n nup form for compatibility with other n-up programs - -Patchlevel 14 has some minor bug fixes. - -* psselect can take end-relative page ranges -* Makefiles restructured to generate machine specific versions from one source -* MSDOS, Windows NT and OS/2 support -* corrections to psbook output for empty pages when rearranging pstops output - -Patchlevel 15 was a stabilisation release - -* All code converted to ANSI C, improved error and warning procedures -* Portability fixes in the Makefiles -* psnup can take different sized input and output pages -* Minor fixes to fixwpps script -* psselect reversed pages fixed -* maketext and fix scripts updated for Perl 5 - -Patchlevel 16 was a minor bugfix release - -* Piped output and input works correctly in NT - -Patchlevel 17 had some minor bugfixes and improvements - -* Trailer information now put before %%EOF comments if no %%Trailer -* psselect can now add blank pages. -* Piped input works in Linux diff --git a/Build/source/utils/psutils/psutils-1.17/config.h b/Build/source/utils/psutils/psutils-1.17/config.h deleted file mode 100644 index 5f6b398e055..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/config.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - * OS specific configuration for PSUtils - */ - -#if defined(MSDOS) || defined(WINNT) || defined(WIN32) -#define TMPDIR "." -#define OPEN_READ "rb" -#define OPEN_WRITE "wb" -#include <fcntl.h> -#include <io.h> -#else /* ! MSDOS && ! WINNT && ! WIN32 */ -#if defined(OS2) -#define TMPDIR "." -#define OPEN_READ "rb" -#define OPEN_WRITE "wb" -#else /* ! OS2 */ -#define OPEN_READ "r" -#define OPEN_WRITE "w" -#ifdef VMS -#define unlink delete -#define TMPDIR "/tmp" -#else /* assumes UNIX-like OS */ -#include <unistd.h> -#define TMPDIR "/tmp" -#endif /* ! VMS */ -#endif /* ! OS2 */ -#endif /* ! MSDOS && ! WINNT && !WIN32 */ - diff --git a/Build/source/utils/psutils/psutils-1.17/descrip.mms b/Build/source/utils/psutils/psutils-1.17/descrip.mms deleted file mode 100644 index f3f98e5cdac..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/descrip.mms +++ /dev/null @@ -1,63 +0,0 @@ -# -# VMS MMS build file for PS utilities -# -# Hunter Goatley, 16-MAR-1993 14:47 -# -CFLAGS = /NOLIST/OBJECT=$(MMS$TARGET) -LFLAGS = /NOTRACE/EXEC=$(MMS$TARGET) - -.IFDEF __ALPHA__ #If building with Alpha cross-compilers, OBJ -OPTIONS_FILE = #... is defined already -LINKOPT = -CFLAGS = /NOLIST/OBJECT=$(MMS$TARGET)/STANDARD=VAXC -.ELSE -OBJ = .OBJ -EXE = .EXE -OPTIONS_FILE = ,VAXC.OPT -LINKOPT = $(options_file)/OPTIONS -.ENDIF - -# epsffit fits an epsf file to a given bounding box -# psbook rearranges pages into signatures -# psselect selects page ranges -# pstops performs general page rearrangement and merging -# psnup puts multiple logical pages on one physical page - -all : psbook$(exe), psselect$(exe), pstops$(exe), epsffit$(exe), psnup$(exe), psresize$(exe) - @ write sys$output "PSUTILS build complete" - -epsffit$(exe) : epsffit$(obj), pserror$(obj) - $(LINK)$(LFLAGS) epsffit$(obj),pserror$(obj)$(linkopt) - -psnup$(exe) : psnup$(obj), psutil$(obj), psspec$(obj), pserror$(obj) - $(LINK)$(LFLAGS) psnup$(obj),psutil$(obj),psspec$(obj),pserror$(obj)$(linkopt) - -psresize$(exe) : psresize$(obj), psutil$(obj), psspec$(obj), pserror$(obj) - $(LINK)$(LFLAGS) psresize$(obj),psutil$(obj),psspec$(obj),pserror$(obj)$(linkopt) - -psbook$(exe) : psbook$(obj), psutil$(obj)$(options_file), pserror$(obj) - $(LINK)$(LFLAGS) psbook$(obj),psutil$(obj),pserror$(obj)$(linkopt) - -psselect$(exe) : psselect$(obj), psutil$(obj), pserror$(obj) - $(LINK)$(LFLAGS) psselect$(obj),psutil$(obj),pserror$(obj)$(linkopt) - -pstops$(exe) : pstops$(obj), psutil$(obj), psspec$(obj), pserror$(obj) - $(LINK)$(LFLAGS) pstops$(obj),psutil$(obj),psspec$(obj),pserror$(obj)$(linkopt) - -psnup$(obj) : psnup.c, psutil.h patchlev.h psspec.h pserror.h - -psresize$(obj) : psresize.c, psutil.h patchlev.h psspec.h pserror.h - -psbook$(obj) : psbook.c, psutil.h patchlev.h pserror.h - -pstops$(obj) : pstops.c, psutil.h patchlev.h psspec.h pserror.h - -psutil$(obj) : psutil.c, psutil.h patchlev.h pserror.h - -psselect$(obj) : psselect.c, psutil.h patchlev.h pserror.h - -psspec$(obj) : psspec.c, psutil.h patchlev.h psspec.h pserror.h - -clean : - delete/log *$(obj);*,psnup$(exe);*,psresize$(exe);*,psbook$(exe);*,- - psselect$(exe);*,pstops$(exe);*,epsffit$(exe);* diff --git a/Build/source/utils/psutils/psutils-1.17/extractres.pl b/Build/source/utils/psutils/psutils-1.17/extractres.pl deleted file mode 100644 index c3bb1e92495..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/extractres.pl +++ /dev/null @@ -1,101 +0,0 @@ -@PERL@ -# extractres: extract resources from PostScript file -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$0 =~ s=.*/==; -$prog = $0; - -%resources = (); # list of resources included -%merge = (); # list of resources extracted this time -%extn = ("font", ".pfa", "file", ".ps", "procset", ".ps", # resource extns - "pattern", ".pat", "form", ".frm", "encoding", ".enc"); -%type = ("%%BeginFile:", "file", "%%BeginProcSet:", "procset", - "%%BeginFont:", "font"); # resource types - -while (@ARGV) { - $_ = shift; - if (/^-m(erge)?$/) { $merge = 1; } - elsif (/^-/) { - print STDERR "Usage: $prog [-merge] [file]\n"; - exit 1; - } else { - unshift(@ARGV, $_); - last; - } -} - -if (defined($ENV{TMPDIR})) { # set body file name - $body = "$ENV{TMPDIR}/body$$.ps"; -} elsif (defined($ENV{TEMP})) { - $body = "$ENV{TEMP}/body$$.ps"; -} elsif (defined($ENV{TMP})) { - $body = "$ENV{TMP}/body$$.ps"; -} else { - $body = "body$$.ps"; -} - -open(BODY, $body) && die "Temporary file $body already exists"; -open(BODY, ">$body") || die "Can't write file $body"; - -sub filename { # make filename for resource in @_ - local($name); - foreach (@_) { # sanitise name - s/[!()\$\#*&\\\|\`\'\"\~\{\}\[\]\<\>\?]//g; - $name .= $_; - } - $name =~ s@.*/@@; # drop directories - die "Filename not found for resource ", join(" ", @_), "\n" - if $name =~ /^$/; - $name; -} - -$output = STDOUT; # start writing header out -while (<>) { - if (/^%%BeginResource:/ || /^%%BeginFont:/ || /^%%BeginProcSet:/) { - local($comment, @res) = split(/\s+/); # look at resource type - local($type) = defined($type{$comment}) ? $type{$comment} : shift(@res); - local($name) = &filename(@res, $extn{$type}); # make file name - $saveout = $output; - if (!$resources{$name}) { - print "%%IncludeResource: $type ", join(" ", @res), "\n"; - if (!open(RES, $name)) { - open(RES, ">$name") || die "Can't write file $name"; - $resources{$name} = $name; - $merge{$name} = $merge; - $output = RES; - } else { # resource already exists - close(RES); - undef $output; - } - } elsif ($merge{$name}) { - open(RES, ">>$name") || die "Can't append to file $name"; - $output = RES; - } else { # resource already included - undef $output; - } - } elsif (/^%%EndResource/ || /^%%EndFont/ || /^%%EndProcSet/) { - if (defined $output) { - print $output $_; - close($output); - } - $output = $saveout; - next; - } elsif ((/^%%EndProlog/ || /^%%BeginSetup/ || /^%%Page:/)) { - $output = BODY; - } - print $output $_ - if defined $output; -} - -close(BODY); # close body output file - -open(BODY, $body); # reopen body for input -while (<BODY>) { # print it all - print $_; -} -close(BODY); - -unlink($body); # dispose of body file -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/fixdlsrps.man b/Build/source/utils/psutils/psutils-1.17/fixdlsrps.man deleted file mode 100644 index d392691cc83..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixdlsrps.man +++ /dev/null @@ -1,24 +0,0 @@ -.TH FIXDLSRPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -fixdlsrps \- filter to fix DviLaser/PS documents to work with PSUtils -.SH SYNOPSIS -.B fixdlsrps -< -.I dvilaser.ps -> -.I Fixed.ps -.SH DESCRIPTION -.I Fixdlsrps -is a -.I perl -filter which "fixes" PostScript generated from the DviLaser/PS driver so -that it works correctly with Angus Duggan's -.B psutils -package. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/fixdlsrps.pl b/Build/source/utils/psutils/psutils-1.17/fixdlsrps.pl deleted file mode 100644 index 324109d1b50..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixdlsrps.pl +++ /dev/null @@ -1,54 +0,0 @@ -@PERL@ -# fixdlsrps: fix DviLaser/PS document to work with PSUtils -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$nesting = 0; -$page = 1; -$infont = 0; - -@fonts = (); -@body = (); -$header = 1; - -while (<>) { - if (/^XP/) { - $infont++; - push(@fonts, $_); - $infont-- if /PXL.*RP/ || /DN?F.*RP/; - } elsif ($infont) { - push(@fonts, $_); - $infont-- if /PXL.*RP/ || /DN?F.*RP/; - } elsif ((/^%%EndSetup/ || /^%%Page:/) && $header) { - print @body; - @body = ("%%EndSetup\n"); - $header = 0; - } elsif (/^%%EndProlog/ && !$nesting) { - push(@body, - "\$DviLaser begin/GlobalMode{}bdef/LocalMode{}bdef/XP{}def/RP{}def", - "/DoInitialScaling{72.0 Resolution div dup scale}bdef end\n", $_); - } elsif (/^%%BeginPageSetup/ && !$nesting) { - push(@body, "%%Page: $page $page\n", $_, - "Resolution 72 div dup scale Magnification 1000 div dup scale\n", - "/DocumentInitState where {\n", - "/DocumentInitState [ matrix currentmatrix currentlinewidth", - " currentlinecap currentlinejoin currentdash currentgray", - " currentmiterlimit] cvx put}if\n"); - $page++; - } elsif (/^%%BeginDocument:/ || /^%%BeginBinary:/ || /^%%BeginFile:/) { - push(@body, $_); - $nesting++; - } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) { - push(@body, $_); - $nesting--; - } elsif (!/^%%PageBoundingBox:/ && !/^%%Page:/) { - push(@body, $_); - } -} - -print @fonts; -print @body; - -exit 0; -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/fixfmps.man b/Build/source/utils/psutils/psutils-1.17/fixfmps.man deleted file mode 100644 index 2276cfd052e..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixfmps.man +++ /dev/null @@ -1,24 +0,0 @@ -.TH FIXFMPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -fixfmps \- filter to fix Framemaker documents so PSUtils work -.SH SYNOPSIS -.B fixfmps -< -.I Framemaker.ps -> -.I Fixed.ps -.SH DESCRIPTION -.I Fixfmps -is a -.I perl -filter which "fixes" PostScript from Framemaker so -that it works correctly with Angus Duggan's -.B psutils -package. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/fixfmps.pl b/Build/source/utils/psutils/psutils-1.17/fixfmps.pl deleted file mode 100644 index f09a3c04b40..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixfmps.pl +++ /dev/null @@ -1,21 +0,0 @@ -@PERL@ -# fixfmps: get conforming PostScript out of FrameMaker version 2 file -# move all FMDEFINEFONTs to start of pages -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -%fonts=(); - -while (<>) { - if (/^([0-9]+) [0-9]+ .* FMDEFINEFONT$/) { - $fonts{$1} = $_; - } elsif (/^[0-9.]+ [0-9.]+ [0-9]+ FMBEGINPAGE$/) { - print $_, join('',values(%fonts)); - } elsif (m%(.*/PageSize \[paperwidth paperheight\]put )setpagedevice(.*)%) { - print "$1pop$2\n"; - } else { - print $_; - } -} -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/fixmacps.man b/Build/source/utils/psutils/psutils-1.17/fixmacps.man deleted file mode 100644 index ce0ae891e66..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixmacps.man +++ /dev/null @@ -1,27 +0,0 @@ -.TH FIXMACPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -fixmacps \- filter to fix Macintosh documents with saner version of md -.SH SYNOPSIS -.B fixmacps -< -.I Macintosh.ps -> -.I Fixed.ps -.SH DESCRIPTION -.I Fixmacps -is a -.I perl -filter which "fixes" PostScript generated from a Macintosh PC -that it works correctly with Angus Duggan's -.B psutils -package. -.SH FILES -md68_0.ps, md71_0.ps - sanitised versions of the md -prologue. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/fixmacps.pl b/Build/source/utils/psutils/psutils-1.17/fixmacps.pl deleted file mode 100644 index 5ed32467f38..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixmacps.pl +++ /dev/null @@ -1,97 +0,0 @@ -@PERL@ -# fixmacps: swap to sanitised appledict -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -use File::Basename; - -$line = 0; # keep line count -$predir = `kpsewhich -progname=dvips -format="other text files" md71_0.ps`; -$dir=`dirname $predir`; -$prefix = "md"; -$default = "md71_0.ps"; - -while ($_ = shift(@ARGV)) { - if (/^-d(ir)?$/) { $dir = shift(@ARGV); } - elsif (/^-n(ame)?$/) { $prefix = shift(@ARGV); } - else { - unshift(@ARGV, $_); - last; - } -} - -%fonts = (); -$nesting = 0; - -while (<>) { - if (/^%!/) { - if (! $line) { - print; - } - } elsif (/^%%(Begin|Include)ProcSet: "?\(AppleDict md\)"? ([0-9]+) ([0-9]+)$/) { - local($inc, $mdv, $mdr) = ($1, $2, $3); - if (open(SANE, "<$dir/$prefix${mdv}_$mdr.ps") || - open(SANE, "<$dir/$default")) { - $sane = <SANE>; - local($snv, $snr) = - $sane =~ /^%%BeginProcSet: \(AppleDict md\) ([0-9]+) ([0-9]+)$/; - if ($mdv == $snv && $mdr == $snr) { - if ( $inc eq "Include" ) { - print STDERR "Inserting ProcSet \"(AppleDict md)\" $snv $snr\n"; - print $sane; - while(<SANE>) { - print; - } - close(SANE); - } - else { - print STDERR "Substituting ProcSet \"(AppleDict md)\" $snv $snr\n"; - $ignore = 1; - } - } else { - print STDERR "Unrecognised AppleDict version $mdv $mdr\n"; - print "%!\n" if !$line; - print; - } - } else { - print STDERR "Can't find sanitised AppleDict\n"; - print "%!\n" if !$line; - print; - } - } elsif (/^%%EndProcSet/) { - if ($ignore) { - $ignore = 0; - print "%!\n" if !$line; - print $sane; - while(<SANE>) { - print; - } - close(SANE); - } else { - print "%!\n" if !$line; - print; - } - } elsif (/^%%Page:/ && $nesting == 0) { - print $_; - print values(%fonts); - } elsif (/^%%BeginDocument/ || /^%%BeginBinary/ || /^%%BeginFile/) { - print $_; - $nesting++; - } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) { - print $_; - $nesting--; - } else { - if (! $ignore) { - if (/^\{\}mark .*rf$/) { - $fonts{$_} = $_; - print; - } else { - print "%!\n" if !$line; - print; - } - } - } - $line++; -} -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/fixpsditps.man b/Build/source/utils/psutils/psutils-1.17/fixpsditps.man deleted file mode 100644 index 7ff19b34c51..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixpsditps.man +++ /dev/null @@ -1,24 +0,0 @@ -.TH FIXPSDITPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -fixpsditps \- filter to fix Transcript psdit documents so PSUtils work -.SH SYNOPSIS -.B fixpsditps -< -.I psdit.ps -> -.I Fixed.ps -.SH DESCRIPTION -.I Fixpsditps -is a -.I perl -filter which "fixes" PostScript from Transcript's psdit program so -that it works correctly with Angus Duggan's -.B psutils -package. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/fixpsditps.pl b/Build/source/utils/psutils/psutils-1.17/fixpsditps.pl deleted file mode 100644 index a9008f58408..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixpsditps.pl +++ /dev/null @@ -1,25 +0,0 @@ -@PERL@ -# fixpsditps: fix psdit output for use in psutils -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$nesting = 0; - -while (<>) { - if (/^\/p{pop showpage pagesave restore \/pagesave save def}def$/) { - print "/p{pop showpage pagesave restore}def\n"; - } elsif (/^%%BeginDocument/ || /^%%BeginBinary/ || /^%%BeginFile/ ) { - print $_; - $nesting++; - } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) { - print $_; - $nesting--; - } elsif (/^%%Page:/ && $nesting == 0) { - print $_; - print "xi\n"; - } elsif (! /^xi$/) { - print $_; - } -} -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/fixpspps.man b/Build/source/utils/psutils/psutils-1.17/fixpspps.man deleted file mode 100644 index 9a6ed98c87c..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixpspps.man +++ /dev/null @@ -1,24 +0,0 @@ -.TH FIXPSPPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -fixpspps \- filter to fix PSPrint PostScript so PSUtils work -.SH SYNOPSIS -.B fixpspps -< -.I PSPrint.ps -> -.I Fixed.ps -.SH DESCRIPTION -.I Fixpspps -is a -.I perl -filter which "fixes" PostScript from PSPrint so -that it works correctly with Angus Duggan's -.B psutils -package. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/fixpspps.pl b/Build/source/utils/psutils/psutils-1.17/fixpspps.pl deleted file mode 100644 index c10c93e7666..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixpspps.pl +++ /dev/null @@ -1,58 +0,0 @@ -@PERL@ -# mangle PostScript produced by PSPrint to make it almost conforming -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$header = 1; $ignore = 0; -$verbose = 0; -@body = (); -%fonts = (); $font = ""; -$inchar = 0; @char = (); - -while (<>) { - if (/^\@end$/) { - $ignore = 1; - } elsif (/^[0-9]+ \@bop0$/) { - $ignore = 0; - $header = 1; - } elsif ($header) { - if (/^\/([a-z.0-9]+) \@newfont$/) { - if (! defined($fonts{$1})) { - $fonts{$1} = 1; - print; - } elsif ($verbose) { - print STDERR "$font already defined\n"; - } - } elsif (/^([a-z.0-9]+) sf$/) { - $font = $1; - print; - } elsif (/^\[</) { - $inchar = 1; - push (@char, $_); - } elsif ($inchar) { - push (@char, $_); - if (/.*\] ([0-9]+) dc$/) { - if (! defined($fonts{$font,$1})) { - $fonts{$font,$1} = 1; - print (@char); - } elsif ($verbose) { - print STDERR "$font character $1 already defined\n"; - } - $inchar = 0; - @char = (); - } - } elsif (/^([0-9]+) \@bop1$/) { - $header = 0; - push (@body, "%%Page: ? $1\n"); - push (@body, $_); - } else { - print; - } - } elsif (! $ignore) { - push (@body, $_); - } -} -print (@body); -print ("\@end\n"); -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/fixscribeps.man b/Build/source/utils/psutils/psutils-1.17/fixscribeps.man deleted file mode 100644 index 68904461df1..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixscribeps.man +++ /dev/null @@ -1,24 +0,0 @@ -.TH FIXSCRIBEPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -fixscribeps \- filter to fix Scribe documents so PSUtils work -.SH SYNOPSIS -.B fixscribeps -< -.I Scribe.ps -> -.I Fixed.ps -.SH DESCRIPTION -.I Fixscribeps -is a -.I perl -filter which "fixes" PostScript from Scribe so -that it works correctly with Angus Duggan's -.B psutils -package. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/fixscribeps.pl b/Build/source/utils/psutils/psutils-1.17/fixscribeps.pl deleted file mode 100644 index d8ed1e86aa3..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixscribeps.pl +++ /dev/null @@ -1,19 +0,0 @@ -@PERL@ -# fixscribeps: get conforming PostScript out of Scribe -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$inepsf = 0; -$epsfn = 0; -while (<>) { - if (/^([0-9]+ [0-9]+ [0-9]+ PB) (%!.*)/) { - print "$1\n%%BeginDocument: Scribe-EPSF $epsfn 0\n$2\n"; - $inepsf++; - } elsif (/^ PE/ && $inepsf) { - print "%%EndDocument\n", $_; - } else { - print $_; - } -} -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/fixtpps.man b/Build/source/utils/psutils/psutils-1.17/fixtpps.man deleted file mode 100644 index c6309f12cca..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixtpps.man +++ /dev/null @@ -1,24 +0,0 @@ -.TH FIXTPPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -fixtpps \- filter to fix Tpscript documents to work with PSUtils -.SH SYNOPSIS -.B fixtpps -< -.I Tpscript.ps -> -.I Fixed.ps -.SH DESCRIPTION -.I Fixtpps -is a -.I perl -filter which "fixes" PostScript generated from the Troff Tpscript driver so -that it works correctly with Angus Duggan's -.B psutils -package. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/fixtpps.pl b/Build/source/utils/psutils/psutils-1.17/fixtpps.pl deleted file mode 100644 index 29c2cebb15c..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixtpps.pl +++ /dev/null @@ -1,28 +0,0 @@ -@PERL@ -# fixtpps: fix tpscript document to work with PSUtils -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$nesting = 0; -$header = 1; - -while (<>) { - if (/^%%Page:/ && $nesting == 0) { - print $_; - print "save home\n"; - $header = 0; - } elsif (/^%%BeginDocument/ || /^%%BeginBinary/ || /^%%BeginFile/) { - print $_; - $nesting++; - } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) { - print $_; - $nesting--; - } elsif (/save home/) { - s/save home//; - print $_; - } elsif (!$header || (! /^save$/ && ! /^home$/)) { - print $_; - } -} -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/fixwfwps.man b/Build/source/utils/psutils/psutils-1.17/fixwfwps.man deleted file mode 100644 index 42810c26995..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixwfwps.man +++ /dev/null @@ -1,24 +0,0 @@ -.TH FIXWFWPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -fixwfwps \- filter to fix Word for Windows documents so PSUtils work -.SH SYNOPSIS -.B fixwfwps -< -.I WordforWindows.ps -> -.I Fixed.ps -.SH DESCRIPTION -.I Fixwfwps -is a -.I perl -filter which "fixes" PostScript from Word for Windows so -that it works correctly with Angus Duggan's -.B psutils -package. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/fixwfwps.pl b/Build/source/utils/psutils/psutils-1.17/fixwfwps.pl deleted file mode 100644 index 03b0cdaca38..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixwfwps.pl +++ /dev/null @@ -1,33 +0,0 @@ -@PERL@ -# fixwfwps: fix Word for windows PostScript for printing. -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$nesting = 0; -while (<>) { - tr/\000-\010\012-\014\016-\037//d; - foreach (grep($_ ne "", split("\015"))) { - s!/SVDoc\s+save\s+def!!g; - s!SVDoc\s+restore!!g; - if (/^(%!PS-Adobe-\d*\.\d*) EPSF-/ && !$nesting) { - print "$1\n"; - $wfwepsf = 1; - } elsif (/^SS\s*$/ && $wfwepsf) { - print "%%Page: $wfwepsf $wfwepsf\n"; - $wfwepsf++; - print "$_\n"; - } elsif (/^%MSEPS Preamble/) { - print "%%BeginDocument: (Included EPSF)\n"; - print "$_\n"; - $nesting++; - } elsif (/^%MSEPS Trailer/) { - $nesting--; - print "$_\n"; - print "%%EndDocument\n"; - } elsif (! /^%%BoundingBox/) { - print "$_\n"; - } - } -} -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/fixwpps.man b/Build/source/utils/psutils/psutils-1.17/fixwpps.man deleted file mode 100644 index d6ab4a274ed..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixwpps.man +++ /dev/null @@ -1,24 +0,0 @@ -.TH FIXWPPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -fixwpps \- filter to fix WP documents so PSUtils work -.SH SYNOPSIS -.B fixwpps -< -.I WordPerfect.ps -> -.I Fixed.ps -.SH DESCRIPTION -.I Fixwpps -is a -.I perl -filter which "fixes" PostScript from WordPerfect 5.0 and 5.1 so -that it works correctly with Angus Duggan's -.B psutils -package. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/fixwpps.pl b/Build/source/utils/psutils/psutils-1.17/fixwpps.pl deleted file mode 100644 index 059119daf48..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixwpps.pl +++ /dev/null @@ -1,31 +0,0 @@ -@PERL@ -# fixwpps: get semi-conforming PostScript out of WordPerfect 5.0 file -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$page = 1; -$nesting = 0; - -while (<>) { - s/([^\/]_t)([0-9]+)/\1 \2/g; # fix wp 5.0 bug - if (m!/_[be][dp]! || m!_bp \d+ \d+ roll!) { - print $_; - } elsif (/^(.*)(_bp.*)$/) { - print "$1\n" if $1 ne ""; - print "%%Page: $page $page\n"; - print "$2\n"; - $page++; - $nesting++; - } elsif (/_ep$/) { - print $_; - $nesting--; - } elsif (/^(.*)(_ed.*)/) { - print "$1\n" if $1 ne ""; - print "%%Trailer:\n"; - print "$2\n"; - } else { - print $_; - } -} -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/fixwwps.man b/Build/source/utils/psutils/psutils-1.17/fixwwps.man deleted file mode 100644 index 1fb1aea4d9a..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixwwps.man +++ /dev/null @@ -1,24 +0,0 @@ -.TH FIXWWPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -fixwwps \- filter to fix Windows Write documents so PSUtils work -.SH SYNOPSIS -.B fixwwps -< -.I WinWrite.ps -> -.I Fixed.ps -.SH DESCRIPTION -.I Fixwwps -is a -.I perl -filter which "fixes" PostScript from Windows Write so -that it works correctly with Angus Duggan's -.B psutils -package. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/fixwwps.pl b/Build/source/utils/psutils/psutils-1.17/fixwwps.pl deleted file mode 100644 index a0096998b83..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/fixwwps.pl +++ /dev/null @@ -1,20 +0,0 @@ -@PERL@ -# fixwwps: get semi-conforming PostScript out of Windows Write file -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$page = 1; - -while (<>) { - if (/^(%!.*) EPSF-\d.\d/) { - print $1, "\n"; - } elsif (/^SS/) { - print "%%Page: $page $page\n"; - print $_; - $page++; - } else { - print $_; - } -} -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/getafm.man b/Build/source/utils/psutils/psutils-1.17/getafm.man deleted file mode 100644 index 661c8c19f81..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/getafm.man +++ /dev/null @@ -1,29 +0,0 @@ -.TH GETAFM 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -getafm \- create an AFM file for a PostScript font. -.SH SYNOPSIS -.B getafm -.I FontName -> -.I output.ps -.SH DESCRIPTION -.I Getafm -generates a PostScript file which prints an AFM file for a font to the -printer's output channel. The output of -.I getafm -should be sent to a printer, or to GhostScript. For example, -.sp -.ce -getafm Times-Roman | gsnd - >Times-Roman.afm -.sp -.SH AUTHOR -Robert Joop (rj@rainbow.in-berlin.de), Angus Duggan -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. -.SH BUGS -Kerning information is not generated by -.I getafm; -it is best to use original AFM files if possible. diff --git a/Build/source/utils/psutils/psutils-1.17/getafm.sh b/Build/source/utils/psutils/psutils-1.17/getafm.sh deleted file mode 100755 index 1c6cd21cf77..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/getafm.sh +++ /dev/null @@ -1,358 +0,0 @@ -#!/bin/sh - -if [ $# -ne 1 ]; then - echo "usage: $0 font-name | gsnd - >font-name.afm" >&2 - exit 1 -fi - -cat << EOF -%! -% produce .afm for $1 -% (c) 1993 by Robert Joop <rj@rainbow.in-berlin.de> -% inspired by two other versions of this theme which are -% getafm 1.00 (c) AJCD -% and getafm.ps by an unknown author, -% modified by J. Daniel Smith <dsmith@mailhost.aa.cad.slb.com> - -% Metrics dictionary code added by AJCD, 7/6/93 - -/getafmdict 100 dict dup begin - - /buf 256 string def - /buf2 16 string def - - /prany % dict dictname printname -> dict - { - 2 index 2 index cvn known - { - print % printname - ( ) print - 1 index exch cvn get = - } - { - (Comment /FontInfo contains no /) print - 2 copy eq - { - = % printname - pop % dictname - } - { - exch - print % dictname - (, therefore no ) print - = % printname - } - ifelse - } - ifelse - } - bind def - - /printfontname - { - (FontName)dup prany - } - bind def - - /printfontinfo - { - dup /FontInfo known - { - dup /FontInfo get - (FullName)dup prany - (FamilyName)dup prany - (Weight)dup prany - (ItalicAngle)dup prany - (isFixedPitch)(IsFixedPitch) prany - (UnderlinePosition)dup prany - (UnderlineThickness)dup prany - (Version)(version) prany - (Notice)dup prany - pop - } - { - (Comment Font lacks a /FontInfo!)= - } - ifelse - } - bind def - - /prbbox % llx lly urx ury -> - - { - 4 1 roll 3 1 roll exch % swap top 4 elements - 4 { ( ) print buf cvs print } repeat - } - bind def - - /getbbox % fontdict chardict character -> fontdict chardict llx lly urx ury - { - gsave - 2 index setfont 0 0 moveto - false charpath flattenpath pathbbox - grestore - } - bind def - - /printmiscinfo - { - dup /FontBBox known - { - (FontBBox) print - dup /FontBBox get aload pop prbbox ()= - } - { - (Comment missing required /FontBBox)= - quit - } - ifelse - 2 copy exch get - dup /H known - 1 index /x known and - 1 index /d known and - 1 index /p known and - dup /looksRoman exch def - { - (CapHeight ) print - (H) getbbox - ceiling cvi = pop pop pop - (XHeight ) print - (x) getbbox - ceiling cvi = pop pop pop - (Ascender ) print - (d) getbbox - ceiling cvi = pop pop pop - (Descender ) print - (p) getbbox - pop pop floor cvi = pop - } - { - (Comment font doesn't contain H, x, d and p; therefore no CapHeight, XHeight, Ascender and Descender)= - } - ifelse - pop - dup /Encoding get - [ - [ (ISOLatin1Encoding) /ISOLatin1Encoding ] - [ (AdobeStandardEncoding) /StandardEncoding ] - ] - { - aload pop dup where - { - exch get 2 index eq - { - (EncodingScheme ) print - buf cvs = - } - { - pop - } - ifelse - } - { - pop pop - } - ifelse - } - forall - pop - } - bind def - - /printcharmetric - { - % chardictname fontdict charnamedict encoding charindex charname - - 4 index dup length dict dup begin exch - { - 1 index /FID ne - 2 index /UniqueID ne - and - { - 1 index /Encoding eq { 256 array copy } if - def - } - { pop pop } - ifelse - } - forall - end - dup /Encoding get 32 3 index put - /f2 exch definefont - setfont - - (C ) print - 1 index buf cvs print - - ( ; WX ) print -% Metrics entries are: -% 1 number: which is the character width -% an array of 2 numbers: which are the left sidebearing and width -% an array of 4 numbers: x & y left sidebearing, width and height - dup 5 index % /charname fontdict - dup /Metrics known { - /Metrics get exch 2 copy known { - get dup type /arraytype eq { - dup length 2 eq - {1 get} {2 get} ifelse - } if - round cvi buf cvs print - } { - pop pop ( ) stringwidth pop round cvi buf cvs print - } ifelse - } { - pop pop ( ) stringwidth pop round cvi buf cvs print - } ifelse - - ( ; N ) print - dup buf cvs print - - ( ; B) print - gsave - newpath 0 0 moveto - ( ) true charpath flattenpath pathbbox - grestore - 2 { ceiling cvi 4 1 roll } repeat - 2 { floor cvi 4 1 roll } repeat - prbbox - - looksRoman - { - [ - [ /f [ /i /f /l ] ] - [ /ff [ /i /l ] ] - ] - { - aload pop 1 index 3 index eq - { - { - 1 index buf cvs - length - 1 index buf2 cvs dup length - 2 index add - buf - 4 2 roll putinterval - buf 0 - 3 -1 roll getinterval - dup cvn - 7 index - exch known - { - exch - ( ; L ) print - buf2 cvs print - ( ) print - print - } - { - pop pop - } - ifelse - } - forall - pop - } - { - pop pop - } - ifelse - } - forall - } - if - pop - - ( ;)= - } - bind def - - /printcharmetrics - { - (StartCharMetrics ) print - 2 copy exch get length 1 sub buf cvs = - - 256 dict dup begin - 1 index /Encoding get - { null def } - forall - end - % chardictname fontdict charnamedict - 1 index /Encoding get - 0 1 255 - { - % encoding index - 2 copy get - dup /.notdef eq { pop } { printcharmetric } ifelse - pop % index - } for - - -1 - 3 index 5 index get - { - pop - dup /.notdef eq - { pop } - { - % chardictname fontdict charnamedict encoding charindex charname - dup 4 index exch known - { pop } - { printcharmetric } - ifelse - } - ifelse - } - forall - % charnamedict encoding index - pop pop pop - - (EndCharMetrics)= - } - bind def - - /printfontmetrics - { - (StartFontMetrics 3.0)= - (Comment Produced by getafm 3.0 (which is by rj@rainbow.in-berlin.de))= - - printfontname - printfontinfo - printmiscinfo - printcharmetrics - - (EndFontMetrics)= - } - bind def - -end def - -/getafm -{ - getafmdict begin - save exch - findfont 1000 scalefont - - null - [ /CharDefs /CharData /CharProcs /CharStrings ] - { - 2 index 1 index known { exch } if - pop - } - forall - dup null eq - { - (can't find dictionary with character data!)= - quit - } - if - exch % dictname fontdict - - printfontmetrics - - pop pop - restore - end -} -bind def - -/$1 getafm - -EOF diff --git a/Build/source/utils/psutils/psutils-1.17/includeres.pl b/Build/source/utils/psutils/psutils-1.17/includeres.pl deleted file mode 100644 index 7a1b9653e97..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/includeres.pl +++ /dev/null @@ -1,45 +0,0 @@ -@PERL@ -# includeres: include resources in PostScript file -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$0 =~ s=.*/==; -$prog = $0; - -%extn = ("font", ".pfa", "file", ".ps", "procset", ".ps", # resource extns - "pattern", ".pat", "form", ".frm", "encoding", ".enc"); -%type = ("%%BeginFile:", "file", "%%BeginProcSet:", "procset", - "%%BeginFont:", "font"); # resource types - -sub filename { # make filename for resource in @_ - local($name); - foreach (@_) { # sanitise name - s/[!()\$\#*&\\\|\`\'\"\~\{\}\[\]\<\>\?]//g; - $name .= $_; - } - $name =~ s@.*/@@; # drop directories - die "Filename not found for resource ", join(" ", @_), "\n" - if $name =~ /^$/; - $name; -} - -while (<>) { - if (/^%%IncludeResource:/ || /^%%IncludeFont:/ || /^%%IncludeProcSet:/) { - local($comment, @res) = split(/\s+/); - local($type) = defined($type{$comment}) ? $type{$comment} : shift(@res); - local($name) = &filename(@res); - if (open(RES, $name) || open(RES, "$name$extn{$type}")) { - while (<RES>) { - print $_; - } - close(RES); - } else { - print "%%IncludeResource: ", join(" ", $type, @res), "\n"; - print STDERR "Resource $name not found\n"; - } - } else { - print $_; - } -} -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/maketext b/Build/source/utils/psutils/psutils-1.17/maketext deleted file mode 100644 index b5715b3a25d..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/maketext +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env perl -# maketext: perl filter to substitute names in scripts and man pages. - -%change = (); # names -> substitutions - -# get release and patchlevel for all scripts -open(H, "patchlev.h") || die "can't open patchlev.h"; -while(<H>) { - $change{$1} = $2 if /^\#define\s*(\S*)\s*(\S*)/; -} -close(H); - -$os = "" ; - -%perlstart = ("UNIX", "\#!PERL", - "DOS", "\@rem = '-*- Perl -*-\n\@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n", - "WINNT", "\@rem = '-*- Perl -*-\n\@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n", - "Win32", "\@rem = '-*- Perl -*-\n\@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n", - "OS2", "extproc PERL -x\n\#! PERL\n", - "", "PSUTILS MAKEFILE CONFIGURATION ERROR") ; -%perlend = ("UNIX", "", - "DOS", "__END__\n:endofperl\n", - "WINNT", "__END__\n:endofperl\n", - "Win32", "__END__\n:endofperl\n", - "OS2", "\# End of Script", - "", "PSUTILS MAKEFILE CONFIGURATION ERROR"); - -foreach (@ARGV) { - if (/MAN=(.*)/) { # name.ext name.ext -> name(ext), name(ext) - local(@man) = split(' ', $1); - $change{"MAN"} = join(", ", grep(s/\.(.)/($1)/, @man)); - } elsif (/OS=(.*)/) { # set operating system name - $os = $1 ; - } elsif (/PERL=(.*)/) { # substitute name for value - local($perl) = $1 ; - $change{"PERL"} = $perlstart{$os} ; - $change{"END"} = $perlend{$os} ; - $change{"PERL"} =~ s/PERL/$perl/g ; - $change{"END"} =~ s/PERL/$perl/g ; - } elsif (/(.*)=(.*)/) { # substitute name for value - $change{$1} = $2; - } else { # open file and substitute - local(@change) = keys %change; - open(FILE, $_) || die "can't open $_"; - while ($line = <FILE>) { - grep($line =~ s/\@$_\@/$change{$_}/g, @change); - print $line; - } - close(FILE); - } -} diff --git a/Build/source/utils/psutils/psutils-1.17/patchlev.h.in b/Build/source/utils/psutils/psutils-1.17/patchlev.h.in deleted file mode 100644 index 8f957dcf464..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/patchlev.h.in +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - */ -#define RELEASE 1 -#define PATCHLEVEL 17 diff --git a/Build/source/utils/psutils/psutils-1.17/psbook.c b/Build/source/utils/psutils/psutils-1.17/psbook.c deleted file mode 100644 index 60627e0672f..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/psbook.c +++ /dev/null @@ -1,111 +0,0 @@ -/* psbook.c - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - * - * rearrange pages in conforming PS file for printing in signatures - * - * Usage: - * psbook [-q] [-s<signature>] [infile [outfile]] - */ - -#include "psutil.h" -#include "pserror.h" -#include "patchlev.h" - -char *program ; -int pages ; -int verbose ; -FILE *infile ; -FILE *outfile ; -char pagelabel[BUFSIZ] ; -int pageno ; - -static void usage(void) -{ - fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); - fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); - fprintf(stderr, "Usage: %s [-q] [-s<signature>] [infile [outfile]]\n", - program); - fprintf(stderr, " <signature> must be positive and divisible by 4\n"); - fflush(stderr); - exit(1); -} - - -int main(int argc, char *argv[]) -{ - int signature = 0; - int currentpg, maxpage; - - infile = stdin; - outfile = stdout; - verbose = 1; - for (program = *argv++; --argc; argv++) { - if (argv[0][0] == '-') { - switch (argv[0][1]) { - case 's': /* signature size */ - signature = atoi(*argv+2); - if (signature < 1 || signature % 4) usage(); - break; - case 'q': /* quiet */ - verbose = 0; - break; - case 'v': /* version */ - default: - usage(); - } - } else if (infile == stdin) { - if ((infile = fopen(*argv, OPEN_READ)) == NULL) - message(FATAL, "can't open input file %s\n", *argv); - } else if (outfile == stdout) { - if ((outfile = fopen(*argv, OPEN_WRITE)) == NULL) - message(FATAL, "can't open output file %s\n", *argv); - } else usage(); - } -#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdin to binary mode\n"); - } - if ( outfile == stdout ) { - int fd = fileno(stdout) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdout to binary mode\n"); - } -#endif - if ((infile=seekable(infile))==NULL) - message(FATAL, "can't seek input\n"); - - scanpages(); - - if (!signature) - signature = maxpage = pages+(4-pages%4)%4; - else - maxpage = pages+(signature-pages%signature)%signature; - - /* rearrange pages */ - writeheader(maxpage); - writeprolog(); - writesetup(); - for (currentpg = 0; currentpg < maxpage; currentpg++) { - int actualpg = currentpg - currentpg%signature; - switch(currentpg%4) { - case 0: - case 3: - actualpg += signature-1-(currentpg%signature)/2; - break; - case 1: - case 2: - actualpg += (currentpg%signature)/2; - break; - } - if (actualpg < pages) - writepage(actualpg); - else - writeemptypage(); - } - writetrailer(); - - return 0; -} diff --git a/Build/source/utils/psutils/psutils-1.17/pserror.c b/Build/source/utils/psutils/psutils-1.17/pserror.c deleted file mode 100644 index 1a52824674a..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/pserror.c +++ /dev/null @@ -1,120 +0,0 @@ -/* pserror.c - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - * - * Warnings and errors for PS programs - */ - -#include "psutil.h" -#include "pserror.h" -#include "patchlev.h" - -#include <string.h> - -/* Message functions; there is a single are varargs functions for messages, - warnings, and errors sent to stderr. If called with the flags MESSAGE_EXIT - set, the routine does not return */ - -#define MAX_MESSAGE 256 /* maximum formatted message length */ -#define MAX_FORMAT 16 /* maximum format length */ -#define MAX_COLUMN 78 /* maximum column to print upto */ - -void message(int flags, const char *format, ...) -{ - va_list args ; - static int column = 0 ; /* current screen column for message wrap */ - char msgbuf[MAX_MESSAGE] ; /* buffer in which to put the message */ - char *bufptr = msgbuf ; /* message buffer pointer */ - - if ( (flags & MESSAGE_NL) && column != 0 ) { /* new line if not already */ - putc('\n', stderr) ; - column = 0 ; - } - - if ( flags & MESSAGE_PROGRAM ) { - strcpy(bufptr, program) ; - bufptr += strlen(program) ; - *bufptr++ = ':' ; - *bufptr++ = ' ' ; - } - - va_start(args, format) ; - if ( format != NULL ) { - char c ; - while ( (c = *format++) != '\0' ) { - if (c == '%') { - int done, longform, index ; - char fmtbuf[MAX_FORMAT] ; - longform = index = 0 ; - fmtbuf[index++] = c ; - do { - done = 1 ; - fmtbuf[index++] = c = *format++ ; - fmtbuf[index] = '\0' ; - switch (c) { - case '%': - *bufptr++ = '%' ; - case '\0': - break ; - case 'e': case 'E': case 'f': case 'g': case 'G': - { - double d = va_arg(args, double) ; - sprintf(bufptr, fmtbuf, d) ; - bufptr += strlen(bufptr) ; - } - break ; - case 'c': case 'd': case 'i': case 'o': - case 'p': case 'u': case 'x': case 'X': - if ( longform ) { - long l = va_arg(args, long) ; - sprintf(bufptr, fmtbuf, l) ; - } else { - int i = va_arg(args, int) ; - sprintf(bufptr, fmtbuf, i) ; - } - bufptr += strlen(bufptr) ; - break ; - case 's': - { - char *s = va_arg(args, char *) ; - sprintf(bufptr, fmtbuf, s) ; - bufptr += strlen(bufptr) ; - } - break ; - case 'l': - longform = 1 ; - /* FALLTHRU */ - default: - done = 0 ; - } - } while ( !done ) ; - } else if ( c == '\n' ) { /* write out message so far and reset column */ - int len = bufptr - msgbuf ; /* length of current message */ - *bufptr++ = '\n' ; - *bufptr = '\0' ; - if ( column + len > MAX_COLUMN && column > 0 ) { - putc('\n', stderr) ; - column = 0 ; - } - fputs(bufptr = msgbuf, stderr) ; - column = 0 ; - } else - *bufptr++ = c ; - } - *bufptr = '\0' ; - { - int len = bufptr - msgbuf ; /* length of current message */ - if ( column + len > MAX_COLUMN && column > 0 ) { - putc('\n', stderr) ; - column = 0 ; - } - fputs(msgbuf, stderr) ; - column += len ; - } - fflush(stderr) ; - } - va_end(args) ; - - if ( flags & MESSAGE_EXIT ) /* don't return to program */ - exit(1) ; -} diff --git a/Build/source/utils/psutils/psutils-1.17/pserror.h b/Build/source/utils/psutils/psutils-1.17/pserror.h deleted file mode 100644 index 438f2e5c040..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/pserror.h +++ /dev/null @@ -1,20 +0,0 @@ -/* pserror.h - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - * - * Header file for external functions in pserror.c - */ - -#include <stdarg.h> - -/* message flags */ -#define MESSAGE_NL 1 /* Newline before message if necessary */ -#define MESSAGE_PROGRAM 2 /* announce program name */ -#define MESSAGE_EXIT 4 /* do not return */ - -/* message types */ -#define FATAL (MESSAGE_EXIT|MESSAGE_PROGRAM|MESSAGE_NL) -#define WARN (MESSAGE_NL|MESSAGE_PROGRAM) -#define LOG 0 - -extern void message(int flags, const char *format, ...) ; diff --git a/Build/source/utils/psutils/psutils-1.17/psmerge.man b/Build/source/utils/psutils/psutils-1.17/psmerge.man deleted file mode 100644 index 4bce92da61b..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/psmerge.man +++ /dev/null @@ -1,36 +0,0 @@ -.TH PSMERGE 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" -.SH NAME -psmerge \- filter to merge several PostScript files into one -.SH SYNOPSIS -.B psmerge -[ -.B \-o\fIout.ps\fB -] -[ -.I file.ps ... -] -.SH DESCRIPTION -.I Psmerge -merges PostScript documents into a single document. It only works in the -specific case the the files were created using the same application, with the -same device setup and resources (fonts, procsets, patterns, files, etc) -loaded. - -If the -.B \-o -option is used, output will be sent to the file named, otherwise it will go to -standard output. - -.I Psmerge -will merge multiple files concatenated into a single file as if they -were in separate files. -.SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 -.SH "SEE ALSO" -@MAN@ -.SH TRADEMARKS -.B PostScript -is a trademark of Adobe Systems Incorporated. -.SH BUGS -.I psmerge -is for a very specific case; it does not merge files in the general case. diff --git a/Build/source/utils/psutils/psutils-1.17/psmerge.pl b/Build/source/utils/psutils/psutils-1.17/psmerge.pl deleted file mode 100644 index 881a9926765..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/psmerge.pl +++ /dev/null @@ -1,86 +0,0 @@ -@PERL@ -# psmerge: merge PostScript files produced by same application and setup -# usage: psmerge [-oout.ps] [-thorough] file1.ps file2.ps ... -# -# Copyright (C) Angus J. C. Duggan 1991-1995 -# See file LICENSE for details. - -$0 =~ s=.*/==; -$prog = $0; - -while ($ARGV[0] =~ /^-/) { - $_ = shift; - if (/^-o(.+)/) { - if (!close(STDOUT) || !open(STDOUT, ">$1")) { - print STDERR "$prog: can't open $1 for output\n"; - exit 1; - } - } elsif (/^-t(horough)?$/) { - $thorough = 1; - } else { - print STDERR "Usage: $prog [-oout] [-thorough] file...\n"; - exit 1; - } -} - -$page = 0; -$first = 1; -$nesting = 0; - -@header = (); -$header = 1; - -@trailer = (); -$trailer = 0; - -@pages = (); -@body = (); - -@resources = (); -$inresource = 0; - -while (<>) { - if (/^%%BeginFont:/ || /^%%BeginResource:/ || /^%%BeginProcSet:/) { - $inresource = 1; - push(@resources, $_); - } elsif ($inresource) { - push(@resources, $_); - $inresource = 0 if /^%%EndFont/ || /^%%EndResource/ || /^%%EndProcSet/; - } elsif (/^%%Page:/ && $nesting == 0) { - $header = $trailer = 0; - push(@pages, join("", @body)) if @body; - $page++; - @body = ("%%Page: ($page) $page\n"); - } elsif (/^%%Trailer/ && $nesting == 0) { - push(@trailer, $_); - push(@pages, join("", @body)) if @body; - @body = (); - $trailer = 1; - $header = 0; - } elsif ($header) { - push(@trailer, $_); - push(@pages, join("", @body)) if @body; - @body = (); - $trailer = 1; - $header = 0; - } elsif ($trailer) { - if (/^%!/ || /%%EOF/) { - $trailer = $first = 0; - } elsif ($first) { - push(@trailer, $_); - } - } elsif (/^%%BeginDocument/ || /^%%BeginBinary/ || /^%%BeginFile/) { - push(@body, $_); - $nesting++; - } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) { - push(@body, $_); - $nesting--; - } else { - print $_ if $print; - } -} - -print @trailer; - -exit 0; -@END@ diff --git a/Build/source/utils/psutils/psutils-1.17/psnup.c b/Build/source/utils/psutils/psutils-1.17/psnup.c deleted file mode 100644 index 23fda2c6141..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/psnup.c +++ /dev/null @@ -1,337 +0,0 @@ -/* psnup.c - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - * - * put multiple pages onto one physical sheet of paper - * - * Usage: - * psnup [-q] [-w<dim>] [-h<dim>] [-ppaper] [-b<dim>] [-m<dim>] - * [-l] [-c] [-f] [-sscale] [-d<wid>] [-nup] [in [out]] - * -w<dim> sets the paper width - * -h<dim> sets the paper height - * -ppaper sets the paper size (width and height) by name - * -W<dim> sets the input paper width, if different from output - * -H<dim> sets the input paper height, if different from output - * -Ppaper sets the input paper size, if different from output - * -m<dim> sets the margin around the paper - * -b<dim> sets the border around each page - * -sscale alters the scale at which the pages are displayed - * -l used if pages are in landscape orientation (rot left) - * -r used if pages are in seascape orientation (rot right) - * -c for column-major layout - * -f for flipped (wider than tall) pages - * -d<wid> to draw the page boundaries - */ - -#include "psutil.h" -#include "psspec.h" -#include "pserror.h" -#include "patchlev.h" - -char *program ; -int pages ; -int verbose ; -FILE *infile ; -FILE *outfile ; -char pagelabel[BUFSIZ] ; -int pageno ; - -static void usage(void) -{ - fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); - fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); - fprintf(stderr, "Usage: %s [-q] [-wwidth] [-hheight] [-ppaper] [-Wwidth] [-Hheight] [-Ppaper] [-l] [-r] [-c] [-f] [-mmargin] [-bborder] [-dlwidth] [-sscale] [-nup] [infile [outfile]]\n", - program); - fflush(stderr); - exit(1); -} - -static void argerror(void) -{ - message(FATAL, "bad dimension\n"); -} - -#define MIN(x,y) ((x) > (y) ? (y) : (x)) -#define MAX(x,y) ((x) > (y) ? (x) : (y)) - -/* return next larger exact divisor of number, or 0 if none. There is probably - * a much more efficient method of doing this, but the numbers involved are - * small, so it's not a big loss. */ -static int nextdiv(int n, int m) -{ - while (++n <= m) { - if (m%n == 0) - return (n); - } - return (0); -} - -int main(int argc, char *argv[]) -{ - int horiz = 0, vert = 0, rotate = 0; /* avoid uninitialized warning */ - int column, flip, leftright, topbottom; - int nup = 1; - double draw = 0; /* draw page borders */ - double scale = 0; /* page scale */ - double uscale = 0; /* user supplied scale */ - double ppwid, pphgt; /* paper dimensions */ - double margin, border; /* paper & page margins */ - double vshift, hshift; /* page centring shifts */ - double iwidth, iheight ; /* input paper size */ - double tolerance = 100000; /* layout tolerance */ - Paper *paper; - -#ifdef PAPER - if ( (paper = findpaper(PAPER)) != (Paper *)0 ) { - width = (double)PaperWidth(paper); - height = (double)PaperHeight(paper); - } -#endif - - margin = border = vshift = hshift = column = flip = 0; - leftright = topbottom = 1; - iwidth = iheight = -1 ; - - infile = stdin; - outfile = stdout; - verbose = 1; - for (program = *argv++; --argc; argv++) { - if (argv[0][0] == '-') { - switch (argv[0][1]) { - case 'q': /* quiet */ - verbose = 0; - break; - case 'd': /* draw borders */ - if (argv[0][2]) - draw = singledimen(*argv+2, argerror, usage); - else - draw = 1; - break; - case 'l': /* landscape (rotated left) */ - column = !column; - topbottom = !topbottom; - break; - case 'r': /* seascape (rotated right) */ - column = !column; - leftright = !leftright; - break; - case 'f': /* flipped */ - flip = 1; - break; - case 'c': /* column major layout */ - column = !column; - break; - case 'w': /* page width */ - width = singledimen(*argv+2, argerror, usage); - break; - case 'W': /* input page width */ - iwidth = singledimen(*argv+2, argerror, usage); - break; - case 'h': /* page height */ - height = singledimen(*argv+2, argerror, usage); - break; - case 'H': /* input page height */ - iheight = singledimen(*argv+2, argerror, usage); - break; - case 'm': /* margins around whole page */ - margin = singledimen(*argv+2, argerror, usage); - break; - case 'b': /* border around individual pages */ - border = singledimen(*argv+2, argerror, usage); - break; - case 't': /* layout tolerance */ - tolerance = atof(*argv+2); - break; - case 's': /* override scale */ - uscale = atof(*argv+2); - break; - case 'p': /* output (and by default input) paper type */ - if ( (paper = findpaper(*argv+2)) != (Paper *)0 ) { - width = (double)PaperWidth(paper); - height = (double)PaperHeight(paper); - } else - message(FATAL, "paper size '%s' not recognised\n", *argv+2); - break; - case 'P': /* paper type */ - if ( (paper = findpaper(*argv+2)) != (Paper *)0 ) { - iwidth = (double)PaperWidth(paper); - iheight = (double)PaperHeight(paper); - } else - message(FATAL, "paper size '%s' not recognised\n", *argv+2); - break; - case 'n': /* n-up, for compatibility with other psnups */ - if (argc >= 2) { - argv++; - argc--; - if ((nup = atoi(*argv)) < 1) - message(FATAL, "-n %d too small\n", nup); - } else - message(FATAL, "argument expected for -n\n"); - break; - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - nup = atoi(*argv+1); - break; - case 'v': /* version */ - default: - usage(); - } - } else if (infile == stdin) { - if ((infile = fopen(*argv, OPEN_READ)) == NULL) - message(FATAL, "can't open input file %s\n", *argv); - } else if (outfile == stdout) { - if ((outfile = fopen(*argv, OPEN_WRITE)) == NULL) - message(FATAL, "can't open output file %s\n", *argv); - } else usage(); - } -#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdin to binary mode\n"); - } - if ( outfile == stdout ) { - int fd = fileno(stdout) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdout to binary mode\n"); - } -#endif - if ((infile=seekable(infile))==NULL) - message(FATAL, "can't seek input\n"); - - if (width <= 0 || height <= 0) - message(FATAL, "page width and height must be set\n"); - - /* subtract paper margins from height & width */ - ppwid = width - margin*2; - pphgt = height - margin*2; - - if (ppwid <= 0 || pphgt <= 0) - message(FATAL, "paper margins are too large\n"); - - /* set default values of input height & width */ - if ( iwidth > 0 ) - width = iwidth ; - if ( iheight > 0 ) - height = iheight ; - - /* Finding the best layout is an optimisation problem. We try all of the - * combinations of width*height in both normal and rotated form, and - * minimise the wasted space. */ - { - double best = tolerance; - int hor; - for (hor = 1; hor; hor = nextdiv(hor, nup)) { - int ver = nup/hor; - /* try normal orientation first */ - double scl = MIN(pphgt/(height*ver), ppwid/(width*hor)); - double optim = (ppwid-scl*width*hor)*(ppwid-scl*width*hor) + - (pphgt-scl*height*ver)*(pphgt-scl*height*ver); - if (optim < best) { - best = optim; - /* recalculate scale to allow for internal borders */ - scale = MIN((pphgt-2*border*ver)/(height*ver), - (ppwid-2*border*hor)/(width*hor)); - hshift = (ppwid/hor - width*scale)/2; - vshift = (pphgt/ver - height*scale)/2; - horiz = hor; vert = ver; - rotate = flip; - } - /* try rotated orientation */ - scl = MIN(pphgt/(width*hor), ppwid/(height*ver)); - optim = (pphgt-scl*width*hor)*(pphgt-scl*width*hor) + - (ppwid-scl*height*ver)*(ppwid-scl*height*ver); - if (optim < best) { - best = optim; - /* recalculate scale to allow for internal borders */ - scale = MIN((pphgt-2*border*hor)/(width*hor), - (ppwid-2*border*ver)/(height*ver)); - hshift = (ppwid/ver - height*scale)/2; - vshift = (pphgt/hor - width*scale)/2; - horiz = ver; vert = hor; - rotate = !flip; - } - } - - /* fail if nothing better than worst tolerance was found */ - if (best == tolerance) - message(FATAL, "can't find acceptable layout for %d-up\n", nup); - } - - if (flip) { /* swap width & height for clipping */ - double tmp = width; - width = height; - height = tmp; - } - - if (rotate) { /* rotate leftright and topbottom orders */ - int tmp = topbottom; - topbottom = !leftright; - leftright = tmp; - column = !column; - } - - /* now construct specification list and run page rearrangement procedure */ - { - int page = 0; - PageSpec *specs, *tail; - - tail = specs = newspec(); - - while (page < nup) { - int up, across; /* page index */ - - if (column) { - if (leftright) /* left to right */ - across = page/vert; - else /* right to left */ - across = horiz-1-page/vert; - if (topbottom) /* top to bottom */ - up = vert-1-page%vert; - else /* bottom to top */ - up = page%vert; - } else { - if (leftright) /* left to right */ - across = page%horiz; - else /* right to left */ - across = horiz-1-page%horiz; - if (topbottom) /* top to bottom */ - up = vert-1-page/horiz; - else /* bottom to top */ - up = page/horiz; - } - if (rotate) { - tail->xoff = margin + (across+1)*ppwid/horiz - hshift; - tail->rotate = 90; - tail->flags |= ROTATE; - } else { - tail->xoff = margin + across*ppwid/horiz + hshift; - } - tail->pageno = page; - if (uscale > 0) - tail->scale = uscale; - else - tail->scale = scale; - tail->flags |= SCALE; - tail->yoff = margin + up*pphgt/vert + vshift; - tail->flags |= OFFSET; - if (++page < nup) { - tail->flags |= ADD_NEXT; - tail->next = newspec(); - tail = tail->next; - } - } - - pstops(nup, 1, 0, specs, draw); /* do page rearrangement */ - } - - return 0; -} - diff --git a/Build/source/utils/psutils/psutils-1.17/psresize.c b/Build/source/utils/psutils/psutils-1.17/psresize.c deleted file mode 100644 index a0c86980b9b..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/psresize.c +++ /dev/null @@ -1,180 +0,0 @@ -/* psresize.c - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - * - * alter pagesize of document - * - * Usage: - * psresize [-q] [-w<dim>] [-h<dim>] [-ppaper] [-W<dim>] [-H<dim>] - * [-Ppaper] [in [out]] - * -w<dim> sets the output paper width - * -h<dim> sets the output paper height - * -ppaper sets the output paper size (width and height) by name - * -W<dim> sets the input paper width - * -H<dim> sets the input paper height - * -Ppaper sets the input paper size (width and height) by name - */ - -#include "psutil.h" -#include "psspec.h" -#include "pserror.h" -#include "patchlev.h" - -char *program ; -int pages ; -int verbose ; -FILE *infile ; -FILE *outfile ; -char pagelabel[BUFSIZ] ; -int pageno ; - -static void usage(void) -{ - fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); - fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); - fprintf(stderr, "Usage: %s [-q] [-wwidth] [-hheight] [-ppaper] [-Wwidth] [-Hheight] [-Ppaper] [infile [outfile]]\n", - program); - fflush(stderr); - exit(1); -} - -static void argerror(void) -{ - message(FATAL, "bad dimension\n"); -} - -#define MIN(x,y) ((x) > (y) ? (y) : (x)) -#define MAX(x,y) ((x) > (y) ? (x) : (y)) - -int main(int argc, char *argv[]) -{ - double scale, rscale; /* page scale */ - double waste, rwaste; /* amount wasted */ - double vshift, hshift; /* page centring shifts */ - int rotate; - double inwidth = -1; - double inheight = -1; - Paper *paper; - PageSpec *specs; - -#ifdef PAPER - if ( (paper = findpaper(PAPER)) != (Paper *)0 ) { - inwidth = width = (double)PaperWidth(paper); - inheight = height = (double)PaperHeight(paper); - } -#endif - - vshift = hshift = 0; - rotate = 0; - - infile = stdin; - outfile = stdout; - verbose = 1; - for (program = *argv++; --argc; argv++) { - if (argv[0][0] == '-') { - switch (argv[0][1]) { - case 'q': /* quiet */ - verbose = 0; - break; - case 'w': /* page width */ - width = singledimen(*argv+2, argerror, usage); - break; - case 'h': /* page height */ - height = singledimen(*argv+2, argerror, usage); - break; - case 'p': /* paper type */ - if ( (paper = findpaper(*argv+2)) != (Paper *)0 ) { - width = (double)PaperWidth(paper); - height = (double)PaperHeight(paper); - } else - message(FATAL, "paper size '%s' not recognised\n", *argv+2); - break; - case 'W': /* input page width */ - inwidth = singledimen(*argv+2, argerror, usage); - break; - case 'H': /* input page height */ - inheight = singledimen(*argv+2, argerror, usage); - break; - case 'P': /* input paper type */ - if ( (paper = findpaper(*argv+2)) != (Paper *)0 ) { - inwidth = (double)PaperWidth(paper); - inheight = (double)PaperHeight(paper); - } else - message(FATAL, "paper size '%s' not recognised\n", *argv+2); - break; - case 'v': /* version */ - default: - usage(); - } - } else if (infile == stdin) { - if ((infile = fopen(*argv, OPEN_READ)) == NULL) - message(FATAL, "can't open input file %s\n", *argv); - } else if (outfile == stdout) { - if ((outfile = fopen(*argv, OPEN_WRITE)) == NULL) - message(FATAL, "can't open output file %s\n", *argv); - } else usage(); - } -#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdin to binary mode\n"); - } - if ( outfile == stdout ) { - int fd = fileno(stdout) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdout to binary mode\n"); - } -#endif - if ((infile=seekable(infile))==NULL) - message(FATAL, "can't seek input\n"); - - if (width <= 0 || height <= 0) - message(FATAL, "output page width and height must be set\n"); - - if (inwidth <= 0 || inheight <= 0) - message(FATAL, "input page width and height must be set\n"); - - /* try normal orientation first */ - scale = MIN(width/inwidth, height/inheight); - waste = (width-scale*inwidth)*(width-scale*inwidth) + - (height-scale*inheight)*(height-scale*inheight); - hshift = (width - inwidth*scale)/2; - vshift = (height - inheight*scale)/2; - - /* try rotated orientation */ - rscale = MIN(height/inwidth, width/inheight); - rwaste = (height-scale*inwidth)*(height-scale*inwidth) + - (width-scale*inheight)*(width-scale*inheight); - if (rwaste < waste) { - double tmp = width; - scale = rscale; - hshift = (width + inheight*scale)/2; - vshift = (height - inwidth*scale)/2; - rotate = 1; - width = height; - height = tmp; - } - - width /= scale; - height /= scale; - - /* now construct specification list and run page rearrangement procedure */ - specs = newspec(); - - if (rotate) { - specs->rotate = 90; - specs->flags |= ROTATE; - } - specs->pageno = 0; - specs->scale = scale; - specs->flags |= SCALE; - specs->xoff = hshift; - specs->yoff = vshift; - specs->flags |= OFFSET; - - pstops(1, 1, 0, specs, 0.0); /* do page rearrangement */ - - return 0; -} - diff --git a/Build/source/utils/psutils/psutils-1.17/psspec.h b/Build/source/utils/psutils/psutils-1.17/psspec.h deleted file mode 100644 index ce796f5407a..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/psspec.h +++ /dev/null @@ -1,30 +0,0 @@ -/* psspec.h - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - * - * routines for page rearrangement specs - */ - -/* pagespec flags */ -#define ADD_NEXT (0x01) -#define ROTATE (0x02) -#define SCALE (0x04) -#define OFFSET (0x08) -#define GSAVE (ROTATE|SCALE|OFFSET) - -typedef struct pagespec { - int reversed, pageno, flags, rotate; - double xoff, yoff, scale; - struct pagespec *next; -} PageSpec ; - -extern double width, height; - -extern PageSpec *newspec(void); -extern int parseint(char **sp, void (*errorfn)(void)); -extern double parsedouble(char **sp, void (*errorfn)(void)); -extern double parsedimen(char **sp, void (*errorfn)(void)); -extern double singledimen(char *str, void (*errorfn)(void), - void (*usagefn)(void)); -extern void pstops(int modulo, int pps, int nobind, PageSpec *specs, - double draw); diff --git a/Build/source/utils/psutils/psutils-1.17/pstops.c b/Build/source/utils/psutils/psutils-1.17/pstops.c deleted file mode 100644 index 2b768da63d2..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/pstops.c +++ /dev/null @@ -1,198 +0,0 @@ -/* pstops.c - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - * - * rearrange pages in conforming PS file for printing in signatures - * - * Usage: - * pstops [-q] [-b] [-d] [-w<dim>] [-h<dim>] [-ppaper] <pagespecs> [infile [outfile]] - */ - -#include "psutil.h" -#include "psspec.h" -#include "pserror.h" -#include "patchlev.h" - -char *program ; -int pages ; -int verbose ; -FILE *infile ; -FILE *outfile ; -char pagelabel[BUFSIZ] ; -int pageno ; - -static void usage(void) -{ - fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); - fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); - fprintf(stderr, "Usage: %s [-q] [-b] [-wwidth] [-hheight] [-dlwidth] [-ppaper] <pagespecs> [infile [outfile]]\n", - program); - fflush(stderr); - exit(1); -} - -static void argerror(void) -{ - fprintf(stderr, "%s: page specification error:\n", program); - fprintf(stderr, " <pagespecs> = [modulo:]<spec>\n"); - fprintf(stderr, " <spec> = [-]pageno[@scale][L|R|U][(xoff,yoff)][,spec|+spec]\n"); - fprintf(stderr, " modulo>=1, 0<=pageno<modulo\n"); - fflush(stderr); - exit(1); -} - -static int modulo = 1; -static int pagesperspec = 1; - -static PageSpec *parsespecs(char *str) -{ - PageSpec *head, *tail; - int other = 0; - int num = -1; - - head = tail = newspec(); - while (*str) { - if (isdigit(*str)) { - num = parseint(&str, argerror); - } else { - switch (*str++) { - case ':': - if (other || head != tail || num < 1) argerror(); - modulo = num; - num = -1; - break; - case '-': - tail->reversed = !tail->reversed; - break; - case '@': - if (num < 0) argerror(); - tail->scale *= parsedouble(&str, argerror); - tail->flags |= SCALE; - break; - case 'l': case 'L': - tail->rotate += 90; - tail->flags |= ROTATE; - break; - case 'r': case 'R': - tail->rotate -= 90; - tail->flags |= ROTATE; - break; - case 'u': case 'U': - tail->rotate += 180; - tail->flags |= ROTATE; - break; - case '(': - tail->xoff += parsedimen(&str, argerror); - if (*str++ != ',') argerror(); - tail->yoff += parsedimen(&str, argerror); - if (*str++ != ')') argerror(); - tail->flags |= OFFSET; - break; - case '+': - tail->flags |= ADD_NEXT; - case ',': - if (num < 0 || num >= modulo) argerror(); - if ((tail->flags & ADD_NEXT) == 0) - pagesperspec++; - tail->pageno = num; - tail->next = newspec(); - tail = tail->next; - num = -1; - break; - default: - argerror(); - } - other = 1; - } - } - if (num >= modulo) - argerror(); - else if (num >= 0) - tail->pageno = num; - return (head); -} - -int main(int argc, char *argv[]) -{ - PageSpec *specs = NULL; - int nobinding = 0; - double draw = 0; - Paper *paper; - -#ifdef PAPER - if ( (paper = findpaper(PAPER)) != (Paper *)0 ) { - width = (double)PaperWidth(paper); - height = (double)PaperHeight(paper); - } -#endif - - infile = stdin; - outfile = stdout; - verbose = 1; - for (program = *argv++; --argc; argv++) { - if (argv[0][0] == '-') { - switch (argv[0][1]) { - case 'q': /* quiet */ - verbose = 0; - break; - case 'd': /* draw borders */ - if (argv[0][2]) - draw = singledimen(*argv+2, argerror, usage); - else - draw = 1; - break; - case 'b': /* no bind operator */ - nobinding = 1; - break; - case 'w': /* page width */ - width = singledimen(*argv+2, argerror, usage); - break; - case 'h': /* page height */ - height = singledimen(*argv+2, argerror, usage); - break; - case 'p': /* paper type */ - if ( (paper = findpaper(*argv+2)) != (Paper *)0 ) { - width = (double)PaperWidth(paper); - height = (double)PaperHeight(paper); - } else - message(FATAL, "paper size '%s' not recognised\n", *argv+2); - break; - case 'v': /* version */ - usage(); - default: - if (specs == NULL) - specs = parsespecs(*argv); - else - usage(); - } - } else if (specs == NULL) - specs = parsespecs(*argv); - else if (infile == stdin) { - if ((infile = fopen(*argv, OPEN_READ)) == NULL) - message(FATAL, "can't open input file %s\n", *argv); - } else if (outfile == stdout) { - if ((outfile = fopen(*argv, OPEN_WRITE)) == NULL) - message(FATAL, "can't open output file %s\n", *argv); - } else usage(); - } - if (specs == NULL) - usage(); -#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdin to binary mode\n"); - } - if ( outfile == stdout ) { - int fd = fileno(stdout) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdout to binary mode\n"); - } -#endif - if ((infile=seekable(infile))==NULL) - message(FATAL, "can't seek input\n"); - - pstops(modulo, pagesperspec, nobinding, specs, draw); - - return 0; -} diff --git a/Build/source/utils/psutils/psutils-1.17/psutil.h b/Build/source/utils/psutils/psutils-1.17/psutil.h deleted file mode 100644 index 0ca9012e499..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/psutil.h +++ /dev/null @@ -1,52 +0,0 @@ -/* psutil.h - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - * - * utilities for PS programs - */ - -#include <stdio.h> -#include <stdlib.h> -#include <ctype.h> - -#include "config.h" - -/* types for describing document; this is a step towards version 2 */ -typedef long Fileptr ; - -/* paper size structure; configurability and proper paper resources will have - to wait until version 2 */ -typedef struct papersize { - const char *name; /* name of paper size */ - int width, height; /* width, height in points */ -} Paper ; -#define PaperName(p) ((p)->name) -#define PaperWidth(p) ((p)->width) -#define PaperHeight(p) ((p)->height) - -/* Definitions for functions found in psutil.c */ -extern Paper *findpaper(const char *name); -extern FILE *seekable(FILE *fp); -extern void writepage(int p); -extern void seekpage(int p); -extern void writepageheader(const char *label, int p); -extern void writepagesetup(void); -extern void writepagebody(int p); -extern void writeheader(int p); -extern int writepartprolog(void); -extern void writeprolog(void); -extern void writesetup(void); -extern void writetrailer(void); -extern void writeemptypage(void); -extern void scanpages(void); -extern void writestring(const char *s); - -/* These variables are imported from the client program (e.g. psbook, psnup, - etc.) */ -extern char *program ; -extern int pages; -extern int verbose; -extern FILE *infile; -extern FILE *outfile; -extern char pagelabel[BUFSIZ]; -extern int pageno; diff --git a/Build/source/utils/psutils/psutils-1.17/showchar.sh b/Build/source/utils/psutils/psutils-1.17/showchar.sh deleted file mode 100755 index e685e99ae8c..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/showchar.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/sh -# showchar: show character with information -# usage: -# showchar Font-Name Char-Name | lpr -Pprinter - -if [ $# != 2 ]; then - echo "Usage: `basename $0` Font-Name Char-Name" >&2 - exit 1 -fi - -cat <<EOF -%! -% Get character metrics and bounding box for $1 -/ns 30 string def -/fname /$1 def -/cname /$2 def -/fn fname findfont 1000 scalefont def -/thin 0.7 def -/reduction 2.0 def - -/sn { ns cvs show } def -/sc { (\()show exch sn (,)show sn (\))show } def - -/Times-Roman findfont 10 scalefont setfont - -72 242 translate % one inch in, 3 1/2 inch up -newpath 0 0 moveto -gsave % print character name - 0 468 rmoveto - ($2 from font $1 displayed on `date` by `basename $0` 1.00 (C) AJCD 1991) - show -grestore - -gsave - thin setlinewidth % cross hairs - -9 0 rmoveto 18 0 rlineto - -9 -9 rmoveto 0 18 rlineto - stroke % position info - -9 -9 moveto ((0,0)) stringwidth pop neg 0 rmoveto - ((0,0)) show -grestore - -% create encoding with a single character at all positions -/MyEncoding 256 array def - -0 1 255 { % fill out with notdefs - MyEncoding exch cname put -} for - -fn dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding MyEncoding def - currentdict -end /newfont exch definefont -/fn exch def -/en MyEncoding def - -gsave % draw character (enlarged) - .75 setgray - fn 1 reduction div scalefont setfont - (\000) show -grestore - -% show character info -fn /Metrics known { - dup fn /Metrics get exch get - dup type /arraytype eq { - dup length 2 eq - {1 get 0} {dup 2 get exch 3 get} ifelse - } { - round 0 - } ifelse -} { - gsave - fn setfont (\000) stringwidth round exch round exch - grestore -} ifelse -gsave % show width - thin setlinewidth - 2 copy - reduction div exch reduction div exch rlineto - gsave - 1 1 rmoveto sc - grestore - -4 -3 rlineto 0 6 rmoveto 4 -3 rlineto - stroke -grestore - -gsave - gsave % get bounding box - fn setfont - (\000) true charpath flattenpath pathbbox - grestore - thin setlinewidth - 3 index reduction div % put coords on top of stack - 3 index reduction div - 3 index reduction div - 3 index reduction div - 3 index 3 index moveto - gsave % llx lly - 0 -9 rmoveto 7 index 7 index sc - grestore - 1 index 3 index lineto - gsave % urx lly - 0 -9 rmoveto 5 index 7 index sc - grestore - 1 index 1 index lineto - gsave % urx ury - 0 9 rmoveto 5 index 5 index sc - grestore - 3 index 1 index lineto - gsave % llx ury - 0 9 rmoveto 7 index 5 index sc - grestore - closepath stroke -grestore -showpage -EOF diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/ChangeLog b/Build/source/utils/psutils/psutils-1.21-PATCHES/ChangeLog index 3236283e03e..89455af35fa 100644 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/ChangeLog +++ b/Build/source/utils/psutils/psutils-1.21-PATCHES/ChangeLog @@ -1,3 +1,16 @@ +2013-10-25 Peter Breitenlohner <peb@mppmu.mpg.de> + + Import psutils-1.21. + + * patch-01-WIN32, patch-02-PERL, patch-03-main-is-int, + patch-04-warnings, patch-05-const, patch-07-TEMPDIR, + patch-08-non-free, patch-09-PERL, patch-11-extern: All removed + because either obsolete or included upstream. + + * patch-01-backport (new): Backport from git repository. + * patch-10-binary-mode: Adapted (from Akira). + * patch-11-WIN32 (new): LFS defines for native WIN32 and MinGW. + 2012-08-26 Peter Breitenlohner <peb@mppmu.mpg.de> * patch-01-WIN32: Adapt to W32TeX (from Akira Kakuto). diff --git a/Build/source/utils/psutils/psutils-1.21-PATCHES/TL-Changes b/Build/source/utils/psutils/psutils-1.21-PATCHES/TL-Changes new file mode 100644 index 00000000000..96528b891a5 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21-PATCHES/TL-Changes @@ -0,0 +1,6 @@ +Changes applied to the psutils-1.21 tree as obtained from: + https://github.com/rrthomas/psutils/archive/v1.21.tar.gz + +Remove: + .gitignore + diff --git a/Build/source/utils/psutils/psutils-1.21-PATCHES/patch-01-backport b/Build/source/utils/psutils/psutils-1.21-PATCHES/patch-01-backport new file mode 100644 index 00000000000..1eca478234d --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21-PATCHES/patch-01-backport @@ -0,0 +1,12 @@ +diff -ur psutils-1.21/psspec.c ../../psutils-git/psspec.c +--- psutils-1.21/psspec.c 2013-10-21 23:28:08.000000000 +0200 ++++ ../../psutils-git/psspec.c 2013-10-24 09:54:36.000000000 +0200 +@@ -6,6 +6,8 @@ + * See file LICENSE for details. + */ + ++#include "config.h" ++ + #include "psutil.h" + #include "psspec.h" + diff --git a/Build/source/utils/psutils/psutils-1.21-PATCHES/patch-10-binary-mode b/Build/source/utils/psutils/psutils-1.21-PATCHES/patch-10-binary-mode new file mode 100644 index 00000000000..ddb38186dc2 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21-PATCHES/patch-10-binary-mode @@ -0,0 +1,164 @@ +diff -ur psutils-1.21.orig/epsffit.c psutils-1.21/epsffit.c +--- psutils-1.21.orig/epsffit.c 2013-10-21 23:28:08.000000000 +0200 ++++ psutils-1.21/epsffit.c 2013-10-25 13:06:05.000000000 +0200 +@@ -17,7 +17,9 @@ + #include <stdlib.h> + #include <string.h> + #include <ctype.h> ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif + + #include "psutil.h" + +@@ -37,6 +39,9 @@ + FILE *output = stdout; + int opt; + ++ SET_BINARY(stdin); ++ SET_BINARY(stdout); ++ + program = *argv; + + while((opt = getopt(argc, argv, "csramv")) != EOF) { +diff -ur psutils-1.21.orig/psbook.c psutils-1.21/psbook.c +--- psutils-1.21.orig/psbook.c 2013-10-21 23:28:08.000000000 +0200 ++++ psutils-1.21/psbook.c 2013-10-25 13:06:05.000000000 +0200 +@@ -7,9 +7,9 @@ + */ + + #include "config.h" +- ++#ifdef HAVE_UNISTD_H + #include <unistd.h> +- ++#endif + #include "psutil.h" + + const char *syntax = "[-q] [-sSIGNATURE] [INFILE [OUTFILE]]\n SIGNATURE must be positive and divisible by 4\n"; +@@ -23,6 +23,9 @@ + int currentpg, maxpage; + int opt; + ++ SET_BINARY(stdin); ++ SET_BINARY(stdout); ++ + verbose = 1; + program = *argv; + +diff -ur psutils-1.21.orig/psnup.c psutils-1.21/psnup.c +--- psutils-1.21.orig/psnup.c 2013-10-21 23:28:08.000000000 +0200 ++++ psutils-1.21/psnup.c 2013-10-25 13:06:05.000000000 +0200 +@@ -7,8 +7,9 @@ + */ + + #include "config.h" +- ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif + #include <string.h> + #include <paper.h> + +@@ -49,6 +50,9 @@ + int opt; + const struct paper *paper = NULL; + ++ SET_BINARY(stdin); ++ SET_BINARY(stdout); ++ + set_paper_size(NULL); + + margin = border = vshift = hshift = column = flip = 0; +diff -ur psutils-1.21.orig/psresize.c psutils-1.21/psresize.c +--- psutils-1.21.orig/psresize.c 2013-10-21 23:28:08.000000000 +0200 ++++ psutils-1.21/psresize.c 2013-10-25 13:06:05.000000000 +0200 +@@ -7,8 +7,9 @@ + */ + + #include "config.h" +- ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif + #include <paper.h> + + #include "psutil.h" +@@ -32,6 +33,9 @@ + int opt; + const struct paper *paper = NULL; + ++ SET_BINARY(stdin); ++ SET_BINARY(stdout); ++ + set_paper_size(NULL); + + vshift = hshift = 0; +diff -ur psutils-1.21.orig/psselect.c psutils-1.21/psselect.c +--- psutils-1.21.orig/psselect.c 2013-10-21 23:28:08.000000000 +0200 ++++ psutils-1.21/psselect.c 2013-10-25 13:06:05.000000000 +0200 +@@ -7,9 +7,9 @@ + */ + + #include "config.h" +- ++#ifdef HAVE_UNISTD_H + #include <unistd.h> +- ++#endif + #include "psutil.h" + + const char *syntax = "[-q] [-e] [-o] [-r] [-pPAGES] [INFILE [OUTFILE]]\n"; +@@ -88,6 +88,9 @@ + int pass, all; + PageRange *pagerange = NULL; + ++ SET_BINARY(stdin); ++ SET_BINARY(stdout); ++ + verbose = 1; + program = *argv; + +diff -ur psutils-1.21.orig/pstops.c psutils-1.21/pstops.c +--- psutils-1.21.orig/pstops.c 2013-10-21 23:28:08.000000000 +0200 ++++ psutils-1.21/pstops.c 2013-10-25 13:06:05.000000000 +0200 +@@ -7,8 +7,9 @@ + */ + + #include "config.h" +- ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif + #include <string.h> + #include <paper.h> + +@@ -107,6 +108,9 @@ + const struct paper *paper = NULL; + int opt; + ++ SET_BINARY(stdin); ++ SET_BINARY(stdout); ++ + set_paper_size(NULL); + + verbose = 1; +diff -ur psutils-1.21.orig/psutil.h psutils-1.21/psutil.h +--- psutils-1.21.orig/psutil.h 2013-10-21 23:28:08.000000000 +0200 ++++ psutils-1.21/psutil.h 2013-10-25 13:06:05.000000000 +0200 +@@ -21,6 +21,15 @@ + #define WARN (MESSAGE_NL|MESSAGE_PROGRAM) + #define LOG 0 + ++/* change mode of a file pointer on Windows */ ++#if defined(WIN32) ++#include <io.h> ++#include <fcntl.h> ++#define SET_BINARY(fp) (void)_setmode(fileno(fp), _O_BINARY) ++#else /* !WIN32 */ ++#define SET_BINARY(fp) (void)0 ++#endif ++ + /* Definitions for functions found in psutil.c */ + extern void usage(void); + extern void message(int flags, const char *format, ...); diff --git a/Build/source/utils/psutils/psutils-1.21-PATCHES/patch-11-WIN32 b/Build/source/utils/psutils/psutils-1.21-PATCHES/patch-11-WIN32 new file mode 100644 index 00000000000..a30f877cfad --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21-PATCHES/patch-11-WIN32 @@ -0,0 +1,22 @@ +diff -ur psutils-1.21.orig/psutil.h psutils-1.21/psutil.h +--- psutils-1.21.orig/psutil.h 2013-10-25 13:06:05.000000000 +0200 ++++ psutils-1.21/psutil.h 2013-10-25 13:29:41.000000000 +0200 +@@ -26,6 +26,18 @@ + #include <io.h> + #include <fcntl.h> + #define SET_BINARY(fp) (void)_setmode(fileno(fp), _O_BINARY) ++#undef off_t ++#undef ftello ++#undef fseeko ++#if defined(__MINGW32__) ++#define off_t off64_t ++#define ftello ftello64 ++#define fseeko fseeko64 ++#else ++#define off_t __int64 ++#define xfseeko xfseek64 ++#define xftello xftell64 ++#endif + #else /* !WIN32 */ + #define SET_BINARY(fp) (void)0 + #endif diff --git a/Build/source/utils/psutils/psutils-1.21/LICENSE b/Build/source/utils/psutils/psutils-1.21/LICENSE new file mode 100644 index 00000000000..cf532202464 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/LICENSE @@ -0,0 +1,27 @@ + PS Utilities Package + +PSUtils is copyright (C) 1991-1997 Angus J. C. Duggan, and (c) 2012-2013 +Reuben Thomas <rrt@sc3d.org> + +It may be copied and used for any purpose (including distribution as part of +a for-profit product), provided: + +1) The original attribution of the programs is clearly displayed in the product + and/or documentation, even if the programs are modified and/or renamed as + part of the product. + +2) The original source code of the programs is provided free of charge (except + for reasonable distribution costs). For a definition of reasonable + distribution costs, see the Gnu General Public License or Larry Wall's + Artistic License (provided with the Perl 4 kit). The GPL and Artistic + License in NO WAY affect this license; they are merely used as examples of + the spirit in which it is intended. + +3) These programs are provided "as-is". No warranty or guarantee of their + fitness for any particular task is provided. Use of these programs is + completely at your own risk. + +Basically, I don't mind how you use the programs so long as you acknowledge +the author, and give people the originals if they want them. + + AJCD 4/4/95 diff --git a/Build/source/utils/psutils/psutils-1.21/Makefile.am b/Build/source/utils/psutils/psutils-1.21/Makefile.am new file mode 100644 index 00000000000..a3d6f727979 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/Makefile.am @@ -0,0 +1,42 @@ +# Makefile for PS utilities +# +# Copyright (C) Reuben Thomas 2012 +# See LICENSE for license + +SUBDIRS = lib + +ACLOCAL_AMFLAGS = -I m4 + +AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) + +noinst_LIBRARIES = libpsutils.a +libpsutils_a_SOURCES = psutil.c psspec.c +libpsutils_a_LIBADD = $(LIBPAPER) +LDADD = libpsutils.a + +bin_PROGRAMS = psbook psselect pstops epsffit psnup psresize + +bin_SCRIPTS = psjoin extractres + +man_MANS = psutils.1 \ + psbook.1 psselect.1 pstops.1 epsffit.1 psnup.1 psresize.1 \ + psjoin.1 extractres.1 includeres.1 + +EXTRA_DIST = m4/gnulib-cache.m4 \ + psutil.h psspec.h \ + $(bin_SCRIPTS) \ + $(man_MANS) + +all: includeres + +includeres: extractres + $(RM) $@ && $(LN_S) extractres $@ + +install-exec-hook: + cd $(DESTDIR)$(bindir); $(RM) includeres; $(LN_S) extractres includeres + +uninstall-hook: + $(RM) $(DESTDIR)$(bindir)/includeres + +clean-local: + $(RM) includeres diff --git a/Build/source/utils/psutils/psutils-1.21/README b/Build/source/utils/psutils/psutils-1.21/README new file mode 100644 index 00000000000..81b72f8b859 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/README @@ -0,0 +1,89 @@ +PostScript Utilities + +Web site: https://github.com/rrthomas/psutils +Maintainer: Reuben Thomas <rrt@sc3d.org> + +PSUtils is a suite of utilities for manipulating PostScript documents +produced according to the Document Structuring Conventions (some older +software may need to be configured to produce DSC-conformant +PostScript; if PSUtils doesn't work, check your documentation). It is +possible to select and rearrange pages, including arrangement into +signatures for booklet printing, and page merging for n-up printing. + +PSUtils should work in any POSIX environment with libpaper (support on +non-POSIX systems may be provided by gnulib). + +libpaper: http://packages.qa.debian.org/libp/libpaper.html +Ghostscript: http://www.ghostscript.com/ + + +PROGRAMS + +psbook rearrange pages into signatures +psselect select pages and page ranges +pstops perform general page rearrangement and selection +psnup put multiple pages on to one page +psresize alter document paper size +epsffit fit an EPSF file to a given bounding box +extractres filter to extract resources from PostScript files +includeres filter to include resources into PostScript files +psjoin concatenate multiple PostScript files + +psselect in modeled on Chris Torek's dviselect, as is psbook, via +Angus Duggan's dvibook; pstops is modeled on Tom Rokicki's dvidvi. + + +INSTALLATION + +./configure && make && make install + +Run ./configure --help for options. + + +BUGS + +The utilities don't check for PS-Adobe-?.? conformance; they assume documents +conform. + +Please send bug reports, patches and suggestions to the bug tracker or +maintainer (see the top of this file). + + +ACKNOWLEDGEMENTS + +PSUtils was written by Angus Duggan, who maintained it up to release 1 +patchlevel 17. + +Bug fixes and suggestions for improvements to PSUtils have come from many +people, including: + + Brian Colfer brianc@labmed.ucsf.edu + Charles A. Finnell finnell@org.mitre.lear + Conrad Kimball cek@com.boeing.sdc + J. W. Hawtin + Jochen Schwarze schwarze@de.isa + Ken Carpenter khc@edu.ksu.eece + Kristian Jorg etxkrjg@se.ericsson.solsta + Larry Weissman larryw@nsr.bioeng.washington.edu + Michael L. Brown brown@wi.extrel.com + Hunter Goatley goathunter@wkuvx1.bitnet + John Interrante interran@uluru.Stanford.edu + Maurizio Cremonesi MAUCREM@imiclvx.earn + Matthew Stier Matthew.Stier@East.Sun.com + Gerry Pratt cca13@seq1.kl.ac.uk + Robert Joop rj@rainbow.in-berlin.de + Johan Vromans jv@mh.nl + Bryan Faubion bryanf@tc.fluke.com + Chris Ritson C.R.Ritson@ncl.ac.uk + Michele Marziani MARZIANI@VAXFE.INFN.IT + Michael I. Schwartz mschwart@diana.cair.du.edu + Chris Ritson C.R.Ritson@newcastle.ac.uk + Joerg Eisenreich + Andreas Borchert borchert@mathematik.uni-ulm.de + Mike Coleman + Dale Scheetz dwarf@polaris.net + Yves Arrouye arrouye@marin.fdn.fr + Stanislav Brabec utx@penguin.cz + Reuben Thomas rrt@sc3d.org + +(Apologies to anyone left out; it was not intentional.) diff --git a/Build/source/utils/psutils/psutils-1.21/bootstrap b/Build/source/utils/psutils/psutils-1.21/bootstrap new file mode 100755 index 00000000000..92f6bc212ea --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/bootstrap @@ -0,0 +1,3107 @@ +#! /bin/sh +# Print a version string. +scriptversion=2011-08-19.18; # UTC + +# Bootstrap this package from checked-out sources. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# 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 3 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, see <http://www.gnu.org/licenses/>. + +# Originally written by Paul Eggert. The canonical version of this +# script is maintained as build-aux/bootstrap in gnulib, however, to +# be useful to your project, you should place a copy of it under +# version control in the top-level directory of your project. The +# intent is that all customization can be done with a bootstrap.conf +# file also maintained in your version control; gnulib comes with a +# template build-aux/bootstrap.conf to get you started. + +# Please report bugs or propose patches to bug-gnulib@gnu.org. + + +## ================================================================== ## +## ## +## DO NOT EDIT THIS FILE, CUSTOMIZE IT USING A BOOTSTRAP.CONF ## +## ## +## ================================================================== ## + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase denotes values stored in the environment. These +# variables should generally be overridden by the user - however, we do +# set them to `true' in some parts of this script to prevent them being +# called at the wrong time by other tools that we call (`autoreconf', +# for example). +# +# We also allow `LIBTOOLIZE' and `M4' to be overridden, and export the +# result for child processes, but they are handled by the function +# `func_find_tool' and not defaulted in this section. + +: "${ACLOCAL=aclocal}" +: "${AUTOCONF=autoconf}" +: "${AUTOHEADER=autoheader}" +: "${AUTOM4TE=autom4te}" +: "${AUTOHEADER=autoheader}" +: "${AUTOMAKE=automake}" +: "${AUTOPOINT=autopoint}" +: "${AUTORECONF=autoreconf}" +: "${CMP=cmp}" +: "${CONFIG_SHELL=/bin/sh}" +: "${DIFF=diff}" +: "${EGREP=egrep}" +: "${FGREP=fgrep}" +: "${GIT=git}" +: "${GREP=grep}" +: "${LN_S=ln -s}" +: "${RM=rm}" +: "${SED=sed}" + +export ACLOCAL +export AUTOCONF +export AUTOHEADER +export AUTOM4TE +export AUTOHEADER +export AUTOMAKE +export AUTOPOINT +export AUTORECONF + + +## -------------- ## +## Configuration. ## +## -------------- ## + +# Short help message in response to `-h'. Add to this in `bootstrap.conf' +# if you accept any additional options. +usage_message="Bootstrap this package from the checked-out sources. + +Common Bootstrap Options: + -c, --copy copy files instead of creating symbolic links. + --debug enable verbose shell tracing + -n, --dry-run print commands rather than running them + -f, --force attempt to bootstrap even if the sources seem not to have + been checked out. + --gnulib-srcdir=DIRNAME + specify a local directory where gnulib sources reside. + Use this if you already have the gnulib sources on your + machine, and don't want to waste your bandwidth + downloading them again. Defaults to \$GNULIB_SRCDIR. + --skip-git do not fetch files from remote repositories + --skip-po do not download po files. + -v, --verbose verbosely report processing + --version print version information and exit + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -h, --help print short or long help message and exit +" + +# Warning categories used by `bootstrap', append others if you use them +# in your `bootstrap.conf'. +warning_categories="recommend settings upgrade" + +# Additional text appended to `usage_message' in response to `--help'. +long_help_message=" +Warning categories include: + \`all' show all warnings + \`none' turn off all the warnings + \`error' warnings are treated as fatal errors + \`recommend' show warnings about missing recommended packages + \`settings' show warnings about missing \`bootstrap.conf' settings + \`upgrade' show warnings about out-dated files + +If the file $progpath.conf exists in the same directory as this script, its +contents are read as shell variables to configure the bootstrap. + +For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR +are honored. + +Running without arguments will suffice in most cases. +" + +# A newline delimited list of triples of programs (that respond to +# --version), the minimum version numbers required (or just `-' in the +# version field if any version will be sufficient) and homepage URLs +# to help locate missing packages. +buildreq= + +# Name of a file containing instructions on installing missing packages +# required in `buildreq'. +buildreq_readme=README-hacking + +# These are extracted from AC_INIT in configure.ac, though you can +# override those values in `bootstrap.conf' if you prefer. +build_aux= +macro_dir= +package= +package_name= +package_version= +package_bugreport= + +# These are extracted from `gnulib-cache.m4', or else fall-back +# automatically on the gnulib defaults; unless you set the values +# manually in `bootstrap.conf'. +doc_base= +gnulib_mk= +gnulib_name= +local_gl_dir= +source_base= +tests_base= + +# The list of gnulib modules required at `gnulib-tool' time. If you +# check `gnulib-cache.m4' into your repository, then this list will be +# extracted automatically. +gnulib_modules= + +# Extra gnulib files that are not in modules, which override files of +# the same name installed by other bootstrap tools. +gnulib_non_module_files=" + build-aux/compile + build-aux/install-sh + build-aux/missing + build-aux/mdate-sh + build-aux/texinfo.tex + build-aux/depcomp + build-aux/config.guess + build-aux/config.sub + doc/INSTALL +" + +# Relative path to the local gnulib submodule, and url to the upstream +# git repository. If you have a gnulib entry in your .gitmodules file, +# these values are ignored. +gnulib_path= +gnulib_url= + +# Additional gnulib-tool options to use. +gnulib_tool_options=" + --no-changelog +" + +# bootstrap removes any macro-files that are not included by aclocal.m4, +# except for files listed in this variable which are always kept. +gnulib_precious=" + gnulib-tool.m4 +" + +# When truncating long commands for display, always allow at least this +# many characters before truncating. +min_cmd_len=160 + +# The command to download all .po files for a specified domain into +# a specified directory. Fill in the first %s is the domain name, and +# the second with the destination directory. Use rsync's -L and -r +# options because the latest/%s directory and the .po files within are +# all symlinks. +po_download_command_format=\ +"rsync --delete --exclude '*.s1' -Lrtvz \ +'translationproject.org::tp/latest/%s/' '%s'" + +# Other locale categories that need message catalogs. +extra_locale_categories= + +# Additional xgettext options to use. Gnulib might provide you with an +# extensive list of additional options to append to this, but gettext +# 0.16.1 and newer appends them automaticaly, so you can safely ignore +# the complaints from `gnulib-tool' if your $configure_ac states: +# +# AM_GNU_GETTEXT_VERSION([0.16.1]) +xgettext_options=" + --flag=_:1:pass-c-format + --flag=N_:1:pass-c-format +" + +# Package copyright holder for gettext files. Defaults to FSF if unset. +copyright_holder= + +# File that should exist in the top directory of a checked out hierarchy, +# but not in a distribution tarball. +checkout_only_file= + +# Whether to use copies instead of symlinks by default (if set to true, +# the --copy option has no effect). +copy=false + +# Set this to ".cvsignore .gitignore" in `bootstrap.conf' if you want +# those files to be generated in directories like `lib/', `m4/', and `po/', +# or set it to "auto" to make this script select which to use based +# on which version control system (if any) is used in the source directory. +# Or set it to "none" to ignore VCS ignore files entirely. Default is +# "auto". +vc_ignore= + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# NLS nuisances. +LANGUAGE=C +export LANGUAGE + +# Ensure file names are sorted consistently across platforms. +LC_ALL=C +export LC_ALL + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. +if (eval 'x=a; x+=" b"; test "x$x" = "xa b"') 2>/dev/null +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# `func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_funcs " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a coll to `func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_funcs " in + *" $1 "*) ;; + *) func_fatal_error "Error: \`$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`echo "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_funcs " in + *" $1 "*) ;; + *) func_fatal_error "Error: \`$1' does not support hook funcions.n" ;; + esac + + eval hook_funcs="\$$1_hooks" + + # shift away the first argument (FUNC_NAME) + shift + func_run_hooks_result=${1+"$@"} + + for hook_func in $hook_funcs; do + eval $hook_func '"$@"' + + # store returned options list back into positional + # parameters for next `cmd' execution. + eval set dummy "$func_run_hooks_result"; shift + done +} + + +## ------------------- ## +## Hookable functions. ## +## ------------------- ## + +# After `bootstrap.conf' has been sourced, execution proceeds by calling +# `func_bootstrap'. Where a function is decorated with `func_hookable +# func_name', you will find a matching `func_run_hooks func_name' which +# executes all functions added with `func_add_hook func_name my_func'. +# +# You might notice that many of these functions begin with a series of +# `$require_foo' lines. See the docu-comments at the start of the +# `Resource management' section for a description of what these are. + + +# func_bootstrap [ARG]... +# ----------------------- +# All the functions called inside func_bootstrap are hookable. See the +# the individual implementations for details. +func_bootstrap () +{ + $debug_cmd + + # Save the current positional parameters to prevent them being + # corrupted by calls to `set' in `func_init'. + func_quote_for_eval ${1+"$@"} + my_saved_positional_parameters="$func_quote_for_eval_result" + + # initialisation + func_init + + # option processing + eval func_options "$my_saved_positional_parameters" + + # post-option preparation + func_prep + + # reconfigure the package + func_reconfigure + + # finalisation + func_fini +} + + +# func_init +# --------- +# Any early initialisations can be hooked to this function. Consider +# whether you can hook onto `func_prep' instead, because if you hook +# any slow to execute code in here, it will also add to the time before +# `./bootstrap --version' can respond. +func_hookable func_init +func_init () +{ + $debug_cmd + + func_run_hooks func_init +} + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options+"$func_parse_options_result"} + + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} + + # save modified positional parameters for caller + func_options_result="$func_run_hooks_result" +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in `func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + warning_func=func_error + + # Option defaults: + opt_copy=${copy-false} + opt_dry_run=false + opt_force=false + opt_gnulib_srcdir="$GNULIB_SRCDIR" + opt_skip_git=false + opt_skip_po=false + opt_warning= + opt_verbose=false + + func_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result="$func_run_hooks_result" +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +# +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in `func_run_hooks_result', escaped suitably for `eval'. Like +# this: +# +# my_silent_option () +# { +# $debug_cmd +# +# case $1 in +# --silent|-s) opt_silent=:; shift ;; +# esac +# +# func_quote_for_eval ${1+"$@"} +# func_run_hooks_result="$func_quote_for_eval_result" +# } +# func_add_hook func_parse_options my_silent_option +# +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + func_parse_options_result= + + # this just eases exit handling + while test $# -gt 0; do + + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift + + opt="$1" + shift + case $opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: ;; + --copy|-c) opt_copy=: ;; + --force|-f) opt_force=: ;; + + --gnulib-srcdir) + test $# = 0 && func_missing_arg $opt && break + opt_gnulib_srcdir="$1" + shift + ;; + + --skip-git) opt_skip_git=: ;; + --skip-po) opt_skip_po=: ;; + --verbose|-v) opt_verbose=: ;; + + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $opt && break + case " $1 " in + " all ") + opt_warning=" $warning_categories" + ;; + " none ") + opt_warning=" none" + warning_func=: + ;; + " error ") + warning_func=func_fatal_error + ;; + *" $warning_categories "*) + func_append_u opt_warning " $1" + ;; + *) + func_fatal_error \ + "Error: unsupported warning category: \`$1'" + ;; + esac + shift + ;; + + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options: + --*=*) + func_split_equals "$opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-c*|-f*|-n*|-v*|-x*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) set dummy "$opt"; shift; break ;; + -*) func_fatal_help "unrecognised option: \`$opt'" ;; + *) set dummy "$opt"; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result="$func_quote_for_eval_result" +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # display all warnings if -W was not given + test -n "$opt_warning" || opt_warning="$warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + + # Validate options. + test $# -gt 0 \ + && func_fatal_help "too many arguments" + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_validate_options_result="$func_quote_for_eval_result" +} + + +# func_prep +# --------- +# Function to perform preparation for remaining bootstrap process. If +# your hooked code relies on the outcome of `func_options' hook it here +# rather than to `func_init'. +# +# All the functions called inside func_prep are hookable. See the +# individual implementations for details. +func_hookable func_prep +func_prep () +{ + $debug_cmd + + $require_bootstrap_uptodate + $require_buildtools_uptodate + $require_checkout_only_file + + $require_gnulib_merge_changelog + + # fetch update files from the translation project + func_update_translations + + func_run_hooks func_prep +} + + +# func_update_translations +# ------------------------ +# Update package po files and translations. +func_hookable func_update_translations +func_update_translations () +{ + $debug_cmd + + $opt_skip_po || { + test -d po && { + $require_package + + func_update_po_files po $package || exit $? + } + + func_run_hooks func_update_translations + } +} + + +# func_reconfigure +# ---------------- +# Reconfigure the current package by running the appropriate autotools in a +# suitable order. +func_hookable func_reconfigure +func_reconfigure () +{ + $debug_cmd + + # Released `autopoint' has the tendency to install macros that have + # been obsoleted in current `gnulib., so run this before `gnulib-tool'. + func_autopoint + + # Autoreconf runs `aclocal' before `libtoolize', which causes spurious + # warnings if the initial `aclocal' is confused by the libtoolized + # (or worse: out-of-date) macro directory. + func_libtoolize + + # If you need to do anything after `gnulib-tool' is done, but before + # `autoreconf' runs, you don't need to override this whole function, + # because `func_gnulib_tool' is hookable. + func_gnulib_tool + + func_autoreconf + + func_run_hooks func_reconfigure +} + + +# func_gnulib_tool +# ---------------- +# Run `gnulib-tool' to fetch gnulib modules into the current package. +# +# It's assumed that since you are using gnulib's `bootstrap' script, +# you're also using gnulib elsewhere in your package. If not, then +# you can replace this function in `bootstrap.conf' with: +# +# func_gnulib_tool () { :; } +# +# (although the function returns immediately if $gnulib_tool is set to +# true in any case). +func_hookable func_gnulib_tool +func_gnulib_tool () +{ + $debug_cmd + + $require_gnulib_tool + $require_libtoolize + + test true = "$gnulib_tool" || { + if test -n "$gnulib_modules"; then + $require_gnulib_cache + $require_build_aux + $require_macro_dir + + # Try not to pick up any stale values from `gnulib-cache.m4'. + rm -f "$gnulib_cache" + + gnulib_mode="--import" + + # `gnulib_modules' and others are maintained in `bootstrap.conf`: + # Use `gnulib --import` to fetch gnulib modules. + test -n "$build_aux" \ + && func_append_u gnulib_tool_options " --aux-dir=$build_aux" + test -n "$macro_dir" \ + && func_append_u gnulib_tool_options " --m4-base=$macro_dir" + test -n "$doc_base" \ + && func_append_u gnulib_tool_options " --doc-base=$doc_base" + test -n "$gnulib_name" \ + && func_append_u gnulib_tool_options " --lib=$gnulib_name" + test -n "$local_gl_dir" \ + && func_append_u gnulib_tool_options " --local-dir=$local_gl_dir" + test -n "$source_base" \ + && func_append_u gnulib_tool_options " --source-base=$source_base" + test -n "$gnulib_mk" \ + && func_append_u gnulib_tool_options " --makefile-name=$gnulib_mk" + test -n "$tests_base" && { + func_append_u gnulib_tool_options " --tests-base=$tests_base" + func_append_u gnulib_tool_options " --with-tests" + } + else + + # `gnulib_modules' and others are cached in `gnulib-cache.m4': + # Use `gnulib --update' to fetch gnulib modules. + gnulib_mode="--update" + fi + + # Add a sensible default libtool option to gnulib_tool_options. + case " $gnulib_tool_options " in + *" --no-libtool "*|*" --libtool "*) ;; + *) if test true = "$LIBTOOLIZE"; then + func_append_u gnulib_tool_options " --no-libtool" + else + func_append_u gnulib_tool_options " --libtool" + fi + ;; + esac + + $opt_copy || func_append_u gnulib_tool_options " --symbolic" + + func_append_u gnulib_tool_options " $gnulib_mode" + func_append gnulib_tool_options " $gnulib_modules" + + # The embedded echo is to squash whitespace before display. + gnulib_cmd=`echo $gnulib_tool $gnulib_tool_options` + + func_show_eval "$gnulib_cmd" 'exit $?' + } + + func_run_hooks func_gnulib_tool +} + + +# func_fini +# --------- +# Function to perform all finalisation for the bootstrap process. +func_hookable func_fini +func_fini () +{ + $debug_cmd + + func_install_gnulib_non_module_files + func_gettext_configuration + func_clean_dangling_symlinks + func_clean_unused_macros + func_skip_po_recommendation + + func_run_hooks func_fini + + func_echo "Done. Now you can run './configure'." +} + + +# func_gettext_configuration +# -------------------------- +# Edit configuration values into po/Makevars. +func_hookable func_gettext_configuration +func_gettext_configuration () +{ + $debug_cmd + + $require_autopoint + + test true = "$AUTOPOINT" || { + $require_copyright_holder + $require_extra_locale_categories + $require_package_bugreport + + # Escape xgettext options for sed Makevars generation below. + # We have to delete blank lines in a separate script so that we don't + # append \\\ to the penultimate line, and then delete the last empty + # line, which messes up the variable substitution later in this + # function. Note that adding a literal \\\ requires double escaping + # here, once for the execution subshell, and again for the assignment, + # which is why there are actually 12 (!!) backslashes in the script. + my_xgettext_options=`echo "$xgettext_options$nl" |$SED '/^$/d' |$SED ' + $b + s|$| \\\\\\\\\\\\|'` + + # Create gettext configuration. + func_echo "Creating po/Makevars from po/Makevars.template ..." + $RM -f po/Makevars + $SED ' + /^EXTRA_LOCALE_CATEGORIES *=/s|=.*|= '"$extra_locale_categories"'| + /^COPYRIGHT_HOLDER *=/s|=.*|= '"$copyright_holder"'| + /^MSGID_BUGS_ADDRESS *=/s|=.*|= '"$package_bugreport"'| + /^XGETTEXT_OPTIONS *=/{ + s|$| \\| + a\ + '"$my_xgettext_options"' \\\ + $${end_of_xgettext_options+} + } + ' po/Makevars.template >po/Makevars || exit 1 + } + + func_run_hooks func_gettext_configuration +} + + + +## --------------- ## +## Core functions. ## +## --------------- ## + +# This section contains the main functions called from the `Hookable +# functions' (shown above), and are the ones you're most likely +# to want to replace with your own implementations in `bootstrap.conf'. + + +# func_autopoint +# -------------- +# If this package uses gettext, then run `autopoint'. +func_autopoint () +{ + $debug_cmd + + $require_autopoint + + test true = "$AUTOPOINT" \ + || func_show_eval "$AUTOPOINT --force" 'exit $?' +} + + +# func_libtoolize +# --------------- +# If this package uses libtool, then run `libtoolize'. +func_libtoolize () +{ + $debug_cmd + + $require_libtoolize + + test true = "$LIBTOOLIZE" || { + my_libtoolize_options= + $opt_copy && func_append my_libtoolize_options " --copy" + $opt_force && func_append my_libtoolize_options " --force" + $opt_verbose || func_append my_libtoolize_options " --quiet" + func_show_eval "$LIBTOOLIZE$my_libtoolize_options" 'exit $?' + } +} + + +# func_autoreconf +# --------------- +# Being careful not to re-run `autopoint' or `libtoolize', and not to +# try to run `autopoint', `libtoolize' or `autoheader' on packages that +# don't use them, defer to `autoreconf' for execution of the remaining +# autotools to bootstrap this package. +func_autoreconf () +{ + $debug_cmd + + $require_autoheader + $require_build_aux # automake and others put files in here + $require_macro_dir # aclocal and others put files in here + + # We ran these manually already, and autoreconf won't exec `:' + save_AUTOPOINT="$AUTOPOINT"; AUTOPOINT=true + save_LIBTOOLIZE="$LIBTOOLIZE"; LIBTOOLIZE=true + + my_autoreconf_options= + $opt_copy || func_append my_autoreconf_options " --symlink" + $opt_force && func_append my_autoreconf_options " --force" + $opt_verbose && func_append my_autoreconf_options " --verbose" + func_show_eval "$AUTORECONF$my_autoreconf_options --install" 'exit $?' + + AUTOPOINT="$save_AUTOPOINT" + LIBTOOLIZE="$save_LIBTOOLIZE" +} + + +# func_install_gnulib_non_module_files +# ------------------------------------ +# Get additional non-module files from gnulib, overriding existing files. +func_install_gnulib_non_module_files () +{ + $debug_cmd + + $require_build_aux + $require_gnulib_path + + test -n "$gnulib_non_module_files" && { + if test -n "$gnulib_path"; then + maybe_exit_cmd=: + + for file in $gnulib_non_module_files; do + case $file in + */COPYING*) dest=COPYING;; + */INSTALL) dest=INSTALL;; + build-aux/*) dest=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;; + *) dest=$file;; + esac + + # Be sure to show all copying errors before bailing out + if test -f "$gnulib_path/$file"; then + func_symlink_to_dir "$gnulib_path" $file $dest + else + func_error "Error: \`$gnulib_path/$file' does not exist" + maybe_exit_cmd="exit $EXIT_FAILURE" + fi + done + + $maybe_exit_cmd + else + func_warning recommend "\ +Unable to link \`\$gnulib_non_module_files', please provide the +location of a complete \`gnulib' tree by setting \`gnulib_path' in +your \`bootstrap.conf' or with the \`--gnulib-srcdir' option - or +else specify the location of your \`git' binary by setting \`GIT' +in the environment so that a fresh \`gnulib' submodule can be cloned." + fi + } +} + + +# func_check_configuration VARNAME [CONFIGURE_MACRO] +# -------------------------------------------------- +func_check_configuration () +{ + $debug_cmd + + $require_configure_ac + + eval 'test -n "$'$1'"' || { + my_error_msg="Error: please set \`$1' in \`bootstrap.conf'" + test -n "$2" \ + && func_append my_error_msg " + or add the following (or similar) to your \`$configure_ac': + $2" + + func_fatal_error "$my_error_msg" + } +} + + +# func_clean_dangling_symlinks +# ---------------------------- +# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some +# gnulib-populated directories. Such .m4 files would cause aclocal to +# fail. The following requires GNU find 4.2.3 or newer. Considering +# the usual portability constraints of this script, that may seem a very +# demanding requirement, but it should be ok. Ignore any failure, +# which is fine, since this is only a convenience to help developers +# avoid the relatively unusual case in which a symlinked-to .m4 file is +# git-removed from gnulib between successive runs of this script. +func_clean_dangling_symlinks () +{ + $debug_cmd + + $require_macro_dir + $require_source_base + + func_verbose "cleaning dangling symlinks" + + find "$macro_dir" "$source_base" \ + -depth \( -name '*.m4' -o -name '*.[ch]' \) \ + -type l -xtype l -delete > /dev/null 2>&1 +} + + +# func_clean_unused_macros +# ------------------------ +# Autopoint can result in over-zealously adding macros into $macro_dir +# even though they are not actually used, for example tests to help +# build the `intl' directory even though you have specified +# `AM_GNU_GETTEXT([external])' in your configure.ac. This function +# looks removes any macro files that can be found in gnulib, but +# are not `m4_include'd by `aclocal.m4'. +func_clean_unused_macros () +{ + $debug_cmd + + $require_gnulib_path + $require_macro_dir + + test -n "$gnulib_path" && test -f aclocal.m4 && { + aclocal_m4s=`find . -name aclocal.m4 -print` + + # We use `ls|grep' instead of `ls *.m4' to avoid exceeding + # command line length limits in some shells. + for file in `cd $macro_dir && ls -1 |grep '\.m4$'`; do + + # Remove a macro file when aclocal.m4 does not m4_include it... + func_grep_q 'm4_include([[]'$macro_dir/$file'])' $aclocal_m4s \ + || test ! -f $gnulib_path/m4/$file || { + + # ...and there is an identical file in gnulib... + if func_cmp_s $gnulib_path/m4/$file $macro_dir/$file; then + + # ...and it's not in the precious list (`echo' is needed + # here to squash whitespace for the match expression). + case " "`echo $gnulib_precious`" " in + *" $file "*) ;; + *) rm -f $macro_dir/$file + func_verbose \ + "removing unused gnulib file \`$macro_dir/$file'" + esac + fi + } + done + } +} + + +# func_skip_po_recommendation +# --------------------------- +# If there is a po directory, and `--skip-po' wasn't passed, let the +# user know that they can use `--skip-po' on subsequent invocations. +func_skip_po_recommendation () +{ + test ! -d po \ + || $opt_skip_po \ + || func_warning recommend "\ +If your pofiles are up-to-date, you can rerun bootstrap +as \`$progname --skip-po' to avoid redownloading." +} + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Where a variable already has a non- +# empty value (as set by the package's `bootstrap.conf'), that value is +# used in preference to deriving the default. Call them using their +# associated `require_*' variable to ensure that they are executed, at +# most, once. + + +# require_checkout_only_file +# -------------------------- +# Bail out if this package only bootstraps properly from a repository +# checkout. +require_checkout_only_file=func_require_checkout_only_file +func_require_checkout_only_file () +{ + $debug_cmd + + test -n "$checkout_only_file" && test ! -f "$checkout_only_file" \ + && func_fatal_error "\ +Error: Bootstrapping from a non-checked-out distribution is risky." + + require_checkout_only_file=: +} + + +# require_aclocal_amflags +# ----------------------- +# Ensure `$aclocal_amflags' has a sensible default, extracted from +# `Makefile.am' if necessary. +require_aclocal_amflags=func_require_aclocal_amflags +func_require_aclocal_amflags () +{ + $debug_cmd + + $require_makefile_am + + my_sed_extract_aclocal_amflags='s|#.*$|| + /^[ ]*ACLOCAL_AMFLAGS[ ]*=/ { + s|^.*=[ ]*\(.*\)|aclocal_amflags="\1"| + p + }' + + my_aclocal_flags_cmd=`$SED -n "$my_sed_extract_aclocal_amflags" \ + "$makefile_am"` + eval "$my_aclocal_flags_cmd" + + func_verbose "ACLOCAL_AMFLAGS='$aclocal_amflags'" + + require_aclocal_amflags=: +} + + +# require_autobuild_buildreq +# -------------------------- +# Try to find whether the bootstrap requires autobuild. +require_autobuild_buildreq=func_require_autobuild_buildreq +func_require_autobuild_buildreq () +{ + $debug_cmd + + printf "$buildreq"| func_grep_q '^[ ]*autobuild' || { + $require_configure_ac + + func_extract_trace AB_INIT + test -n "$func_extract_trace_result" && { + func_append buildreq 'autobuild - http://josefsson.org/autobuild/ +' + func_verbose "auto-adding \`autobuild' to build requirements" + } + } + + require_autobuild_buildreq=: +} + + +# require_autoconf_buildreq +# require_gettext_buildreq +# require_libtoolize_buildreq +# --------------------------- +# Try to find the minimum compatible version of autoconf/libtool +# required to bootstrap successfully, and add it to `$buildreq'. +for tool in autoconf libtoolize gettext; do + b=$tool + v=require_${tool}_buildreq + f=func_$v + case $tool in + autoconf) m=AC_PREREQ ;; + libtoolize) m=LT_PREREQ; b=libtool ;; + gettext) m=AM_GNU_GETTEXT_VERSION ;; + esac + + eval $v'='$f' + '$f' () + { + $debug_cmd + + # The following is ignored if undefined, but might be necessary + # in order for `func_find_tool` to run. + ${require_'$tool'-:} + + printf "$buildreq" | func_grep_q '\''^[ ]*'$tool\'' || { + $require_configure_ac + + func_extract_trace '$m' + my_version="$func_extract_trace_result" + test -n "$my_version" && { + func_append buildreq "\ + '$tool' $my_version http://www.gnu.org/s/'$b' +" + func_verbose \ + "auto-adding \`'$tool'-$my_version'\'' to build requirements" + } + } + + '$v'=: + } +' +done + + +# require_autoheader +# ------------------ +# Skip autoheader if it's not needed. +require_autoheader=func_require_autoheader +func_require_autoheader () +{ + $debug_cmd + + test true = "$AUTOHEADER" || { + func_extract_trace AC_CONFIG_HEADERS + test -n "$func_extract_trace_result" \ + || func_extract_trace AC_CONFIG_HEADER + + test -n "$func_extract_trace_result" || { + AUTOHEADER=true + + func_verbose "export AUTOHEADER='$AUTOHEADER'" + + # Make sure the search result is visible to subshells + export AUTOHEADER + } + } + + require_autoheader=: +} + + +# require_automake_buildreq +# ------------------------- +# Try to find the minimum compatible version of automake required to +# bootstrap successfully, and add it to `$buildreq'. +require_automake_buildreq=func_require_automake_buildreq +func_require_automake_buildreq () +{ + $debug_cmd + + # if automake is not already listed in $buildreq... + printf "$buildreq"| func_grep_q automake || { + func_extract_trace AM_INIT_AUTOMAKE + + # ...and AM_INIT_AUTOMAKE is declared... + test -n "$func_extract_trace_result" && { + automake_version=`echo "$func_extract_trace_result" \ + |$SED 's|[^0-9]*||; s| .*$||'` + test -n "$automake_version" || automake_version="-" + + func_append buildreq "\ + automake $automake_version http://www.gnu.org/s/automake +" + func_verbose \ + "auto-adding \`automake-$automake_version' to build requirements" + } + } + + require_automake_buildreq=: +} + + +# require_autopoint +# ----------------- +# Skip autopoint if it's not needed. +require_autopoint=func_require_autopoint +func_require_autopoint () +{ + $debug_cmd + + test true = "$AUTOPOINT" || { + func_extract_trace AM_GNU_GETTEXT_VERSION + + test -n "$func_extract_trace_result" || { + AUTOPOINT=true + + func_verbose "export AUTOPOINT='$AUTOPOINT'" + + # Make sure the search result is visible to subshells + export AUTOPOINT + } + } + + require_autopoint=: +} + + +# func_require_bootstrap_uptodate +# ------------------------------- +# Complain if the version of bootstrap in the gnulib directory differs +# from the one we are running. +require_bootstrap_uptodate=func_require_bootstrap_uptodate +func_require_bootstrap_uptodate () +{ + $debug_cmd + + $require_gnulib_path + + test x = x"$gnulib_path" \ + || func_cmp_s $progpath $gnulib_path/build-aux/bootstrap \ + || func_warning upgrade "\ +\`$progpath' differs from \`./$gnulib_path/build-aux/bootstrap', +please consider adopting the canonical version from gnulib." + + require_bootstrap_uptodate=: +} + + +# require_build_aux +# ----------------- +# Ensure that `$build_aux' is set, and if it doesn't already point to an +# existing directory, create one. +require_build_aux=func_require_build_aux +func_require_build_aux () +{ + $debug_cmd + + test -n "$build_aux" || { + $require_configure_ac + + func_extract_trace AC_CONFIG_AUX_DIR + build_aux="$func_extract_trace_result" + func_check_configuration build_aux \ + "AC_CONFIG_AUX_DIR([name of a directory for build scripts])" + + func_verbose "build_aux='$build_aux'" + } + + $require_vc_ignore_files + + # If the build_aux directory doesn't exist, create it now, and mark it + # as ignored for the VCS. + if test ! -d "$build_aux"; then + func_show_eval "mkdir '$build_aux'" + + test -n "$vc_ignore_files" \ + || func_insert_sorted_if_absent "$build_aux" $vc_ignore_files + fi + + require_build_aux=: +} + + +# func_require_buildtools_uptodate +# -------------------------------- +# Ensure all the packages listed in BUILDREQS are available on the build +# machine at the minimum versions or better. +require_buildtools_uptodate=func_require_buildtools_uptodate +func_require_buildtools_uptodate () +{ + $debug_cmd + + $require_autobuild_buildreq + $require_autoconf_buildreq + $require_automake_buildreq + $require_libtoolize_buildreq + $require_gettext_buildreq + + test -n "$buildreq" && { + func_check_versions $buildreq + $func_check_versions_result || { + test -n "$buildreq_readme" \ + && test -f "$buildreq_readme" \ + && func_error "\ +Error: $buildreq_readme explains how to obtain these prerequisite programs: +" + func_strtable 7 11 12 36 \ + "Program" "Min_version" "Homepage" $buildreq + func_fatal_error "$func_strtable_result" + } + } + + require_buildtools_uptodate=: +} + + +# require_configure_ac +# -------------------- +# Ensure that there is a `configure.ac' or `configure.in' file in the +# current directory, and that `$configure_ac' contains its name. +require_configure_ac=func_require_configure_ac +func_require_configure_ac () +{ + $debug_cmd + + test -n "$configure_ac" || { + for configure_ac in configure.ac configure.in; do + test -f $configure_ac && break + done + + <$configure_ac + } + + func_verbose "found \`$configure_ac'" + + require_configure_ac=: +} + + +# require_copyright_holder +# ------------------------ +# Ensure there is a sensible non-empty default value in `$copyright_holder'. +require_copyright_holder=func_require_copyright_holder +func_require_copyright_holder () +{ + $debug_cmd + + test -n "$copyright_holder" || { + copyright_holder='Free Software Foundation, Inc.' + func_warning settings "\ +Please set copyright_holder explicitly in \`bootstrap.conf'; +defaulting to \`$copyright_holder'." + } + + require_copyright_holder=: +} + + +# require_dotgitmodules +# --------------------- +# Ensure we have a `.gitmodules' file, with appropriate `gnulib' settings. +require_dotgitmodules=func_require_dotgitmodules +func_require_dotgitmodules () +{ + $debug_cmd + + $require_git + + test true = "$GIT" || { + # A gnulib entry in .gitmodules always takes precedence. + my_path="`$GIT config --file .gitmodules submodule.gnulib.path 2>/dev/null`" + + test -n "$my_path" || { + $require_vc_ignore_files + + func_verbose "creating \`.gitmodules'" + + # If the .gitmodules file doesn't exist, create it now, and mark + # it as ignored for the VCS. + test -n "$gnulib_path" || gnulib_path=gnulib + test -n "$gnulib_url" || gnulib_url=git://git.sv.gnu.org/gnulib + + { + echo '[submodule "gnulib"]' + echo " path = $gnulib_path" + echo " url = $gnulib_url" + } >> .gitmodules + + test -n "$vc_ignore_files" \ + || func_insert_sorted_if_absent ".gitmodules" $vc_ignore_files + } + } + + require_dotgitmodules=: +} + + +# require_extra_locale_categories +# ------------------------------- +# Ensure there is a default value in `$extra_locale_categories' +require_extra_locale_categories=func_require_extra_locale_categories +func_require_extra_locale_categories () +{ + $debug_cmd + + # Defaults to empty, so run with whatever value may have been set in + # `bootstrap.conf'. + require_extra_locale_categories=: +} + + +# require_git +# ----------- +# Ignore git if it's not available, or we're not in a git checkout tree. +require_git=func_require_git +func_require_git () +{ + $debug_cmd + + $opt_skip_git && GIT=true + + test true = "$GIT" || { + if test -f .gitignore && ($GIT --version) >/dev/null 2>&1; then :; else + GIT=true + fi + } + + func_verbose "GIT='$GIT'" + + require_git=: +} + + +# require_gnu_m4 +# -------------- +# Search for GNU M4, and export it in $M4. +require_gnu_m4=func_require_gnu_m4 +func_require_gnu_m4 () +{ + $debug_cmd + + test -n "$M4" || { + # Find the first m4 binary that responds to --version. + func_find_tool M4 gm4 gnum4 m4 + } + + test -n "$M4" || func_fatal_error "\ +Error: Please install GNU M4, or \`export M4=/path/to/gnu/m4'." + + func_verbose "export M4='$M4'" + + # Make sure the search result is visible to subshells + export M4 + + require_gnu_m4=: +} + + +# require_gnulib_cache +# -------------------- +# Ensure there is a non-empty default for `$gnulib_cache', and that it +# names an existing file. +require_gnulib_cache=func_require_gnulib_cache +func_require_gnulib_cache () +{ + $debug_cmd + + $require_macro_dir + + test -n "$gnulib_cache" \ + || gnulib_cache="$macro_dir/gnulib-cache.m4" + + func_verbose "found \`$gnulib_cache'" + + require_gnulib_cache=: +} + + +# require_gnulib_files_already_present +# ------------------------------------ +# If we have no means to update imported gnulib files, then try to +# ensure at least that this tree already has files from a previous +# `gnulib-tool' run. +require_gnulib_files_already_present=func_require_gnulib_files_already_present +func_require_gnulib_files_already_present () +{ + $debug_cmd + + $require_build_aux + $require_macro_dir + $require_gnulib_mk + $require_source_base + + # As a heuristic, only bail out if any of the following + # are missing. + my_gnulib_files_already_present=" + $build_aux/install-sh + $macro_dir/00gnulib.m4 + $source_base/${gnulib_mk:-Makefile.am} + " + + $opt_dry_run || { + for my_file in $my_gnulib_files_already_present; do + test -f "$my_file" || func_fatal_error "\ +Error: Can't find, copy or download required gnulib files, + please provide the location of a complete \`gnulib' tree + by setting \`gnulib_path' in your \`bootstrap.conf' or + with the \`--gnulib-srcdir' option - or else specify the + location of your \`git' binary by setting \`GIT' in the + environment so that a fresh \`gnulib' submodule can be + cloned." + done + } + + require_gnulib_files_already_present=: +} + + +# require_gnulib_merge_changelog +# ------------------------------ +# See if we can use gnulib's git-merge-changelog merge driver. +require_gnulib_merge_changelog=func_require_gnulib_merge_changelog +func_require_gnulib_merge_changelog () +{ + $debug_cmd + + test -f ChangeLog && { + $require_git + + test true = "$GIT" || { + if $GIT config merge.merge-changelog.driver >/dev/null ; then + : + elif (git-merge-changelog --version) >/dev/null 2>&1 ; then + func_echo "initializing git-merge-changelog driver" + $GIT config merge.merge-changelog.name 'GNU-style ChangeLog merge driver' + $GIT config merge.merge-changelog.driver 'git-merge-changelog %O %A %B' + else + func_warning recommend \ + "Consider installing git-merge-changelog from gnulib." + fi + } + } + + require_gnulib_merge_changelog=: +} + + +# require_gnulib_mk +# ----------------- +# Ensure gnulib_mk has a sensible value, extracted from `gnulib-cache.m4' +# if possible, otherwise letting `gnulib-tool' pick a default. +require_gnulib_mk=func_require_gnulib_mk +func_require_gnulib_mk () +{ + $debug_cmd + + test -n "$gnulib_mk" || { + $require_gnulib_cache + $require_macro_dir + + func_extract_trace "gl_MAKEFILE_NAME" "$gnulib_cache" + gnulib_mk="$func_extract_trace_result" + + test -n "$gnulib_mk" && func_verbose "gnulib_mk='$gnulib_mk'" + } + + require_gnulib_mk=: +} + + +# require_gnulib_path +# require_gnulib_url +# ------------------- +# Ensure `gnulib_path' and `gnulib_url' are set. +require_gnulib_path=func_require_dotgitmodules_parameters +require_gnulib_url=func_require_dotgitmodules_parameters +func_require_dotgitmodules_parameters () +{ + $debug_cmd + + $require_git + + if test true = "$GIT"; then + # If we can't find git (or if the user specified `--skip-git'), + # then use an existing gnulib directory specified with + # `--gnulib-srcdir' if possible. + test -n "$gnulib_path" \ + || test ! -x "$opt_gnulib_srcdir/gnulib-tool" \ + || gnulib_path="$opt_gnulib_srcdir" + fi + + $require_dotgitmodules + + # Extract the parameters with sed, since git may be missing + test -n "$gnulib_path" \ + || gnulib_path=`sed -e '/^.submodule "gnulib".$/,${ + /[ ]*path *= */{ + s,[ ]*,,g;s,^[^=]*=,,;p + } + };d' .gitmodules | sed 1q` + test -n "$gnulib_url" \ + || gnulib_url=`sed -e '/^.submodule "gnulib".$/,${ + /[ ]*url *= */{ + s,[ ]*,,g;s,^[^=]*=,,;p + } + };d' .gitmodules | sed 1q` + + func_verbose "gnulib_path='$gnulib_path'" + func_verbose "gnulib_url='$gnulib_url'" + + require_gnulib_path=: + require_gnulib_url=: +} + + +# require_gnulib_submodule +# ------------------------ +# Ensure that there is a current gnulib submodule at `$gnulib_path'. +require_gnulib_submodule=func_require_gnulib_submodule +func_require_gnulib_submodule () +{ + $debug_cmd + + $require_git + + if test true = "$GIT"; then + func_warning recommend \ + "No \`git' found; imported gnulib modules may be outdated." + else + $require_gnulib_path + $require_gnulib_url + + if test -f .gitmodules && test -f "$gnulib_path/gnulib-tool"; then + func_show_eval "$GIT submodule update" \ + 'func_fatal_error "Error: Unable to update gnulib submodule."' + + elif test -n "$opt_gnulib_srcdir"; then + # Older git can't clone into an empty directory. + rmdir "$gnulib_path" 2>/dev/null + func_show_eval "$GIT clone --reference '$opt_gnulib_srcdir' \ + '$gnulib_url' '$gnulib_path'" \ + && func_show_eval "$GIT submodule init" \ + && func_show_eval "$GIT submodule update" \ + || func_fatal_error "Error: Unable to fetch gnulib submodule." + + # Without --gnulib-srcdir, and no existing checked out submodule, we + # create a new shallow clone of the remote gnulib repository. + else + trap func_cleanup_gnulib 1 2 13 15 + + shallow= + $GIT clone -h 2>&1 |func_grep_q -- --depth \ + && shallow='--depth 2' + + func_show_eval "$GIT clone $shallow '$gnulib_url' '$gnulib_path'" \ + func_cleanup_gnulib + + trap - 1 2 13 15 + fi + fi + + require_gnulib_submodule=: +} + + +# require_gnulib_tool +# ------------------- +# Ensure that `$gnulib_tool' is set, and points to an executable file, +# or else fall back to using the binary `true' if the main gnulib +# files appear to have been imported already. +require_gnulib_tool=func_require_gnulib_tool +func_require_gnulib_tool () +{ + $debug_cmd + + $require_gnulib_submodule + + test true = "$gnulib_tool" || { + $require_gnulib_path + + test -n "$gnulib_tool" \ + || gnulib_tool="$gnulib_path/gnulib-tool" + + test -x "$gnulib_tool" || { + $require_gnulib_files_already_present + + gnulib_tool=true + func_warning recommend \ + "No \`gnulib-tool' found; gnulib modules may be missing." + } + + test true = "$gnulib_tool" \ + || func_verbose "found \`$gnulib_tool'" + } + + require_gnulib_tool=: +} + + +# require_libtoolize +# ------------------ +# Skip libtoolize if it's not needed. +require_libtoolize=func_require_libtoolize +func_require_libtoolize () +{ + $debug_cmd + + # Unless we're not searching for libtool use by this package, set + # LIBTOOLIZE to true if none of `LT_INIT', `AC_PROG_LIBTOOL' and + # `AM_PROG_LIBTOOL' are used in configure. + test true = "$LIBTOOLIZE" || { + func_extract_trace LT_INIT + test -n "$func_extract_trace_result"||func_extract_trace AC_PROG_LIBTOOL + test -n "$func_extract_trace_result"||func_extract_trace AM_PROG_LIBTOOL + test -n "$func_extract_trace_result"||LIBTOOLIZE=true + } + + test -n "$LIBTOOLIZE" || { + # Find libtoolize, named glibtoolize in Mac Ports, but prefer + # user-installed libtoolize to ancient glibtoolize shipped by + # Apple with Mac OS X when Mac Ports is not installed. + func_find_tool LIBTOOLIZE libtoolize glibtoolize + } + + func_verbose "export LIBTOOLIZE='$LIBTOOLIZE'" + + # Make sure the search result is visible to subshells + export LIBTOOLIZE + + require_libtoolize=: +} + + +# require_macro_dir +# ----------------- +# Ensure that `$macro_dir' is set, and if it doesn't already point to an +# existing directory, create one. +require_macro_dir=func_require_macro_dir +func_require_macro_dir () +{ + $debug_cmd + + # Sometimes this is stored in `configure.ac'. + test -n "$macro_dir" || { + func_extract_trace AC_CONFIG_MACRO_DIR + macro_dir="$func_extract_trace_result" + } + + # Otherwise we might find it in `Makefile.am'. + test -n "$macro_dir" || { + $require_aclocal_amflags + + my_sed_scan='s|^.*-I[ ]*\([^ ]*\) .*|\1|' + + # Trailing space in echo is required by the sed script. + macro_dir=`echo "$aclocal_amflags " |$SED "$my_sed_scan"` + } + + func_verbose "macro_dir='$macro_dir'" + + func_check_configuration macro_dir \ + "AC_CONFIG_MACRO_DIR([name of a directory for configure m4 files])" + + $require_vc_ignore_files + + # If the macro_dir directory doesn't exist, create it now, and mark it + # as ignored for the VCS. + if test ! -d "$macro_dir"; then + mkdir "$macro_dir" || func_permissions_error "$macro_dir" + + test -n "$vc_ignore_files" \ + || func_insert_sorted_if_absent "$macro_dir" $vc_ignore_files + fi + + require_macro_dir=: +} + + +# require_makefile_am +# ------------------- +# Ensure there is a `Makefile.am' in the current directory. +# names an existing file. +require_makefile_am=func_require_makefile_am +func_require_makefile_am () +{ + $debug_cmd + + test -n "$makefile_am" \ + || makefile_am="Makefile.am" + + <"$makefile_am" + + func_verbose "found \`$makefile_am'" + + require_makefile_am=: +} + + +# require_package +# --------------- +# Ensure that `$package' contains a sensible default value. +require_package=func_require_package +func_require_package () +{ + $debug_cmd + + test -n "$package" || { + $require_package_name + + package=`echo "$package_name" \ + |$SED 's/GNU //;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` + } + + func_verbose "package='$package'" + + require_package=: +} + + +# require_package_bugreport +# ------------------------- +# Ensure that this has a sensible value, extracted from `configure.ac' +# if appropriate (and possible!). +require_package_bugreport=func_require_package_bugreport +func_require_package_bugreport () +{ + $debug_cmd + + func_extract_trace AC_INIT + + save_ifs="$IFS" + IFS=: + set dummy $func_extract_trace_result + IFS="$save_ifs" + shift + + test -n "$package_bugreport" || package_bugreport="$3" + func_check_configuration package_bugreport \ + "AC_INIT([$package_name], [$package_version], [bug-$package@gnu.org])" + func_verbose "package_bugreport='$package_bugreport'" + + require_package_bugreport=: +} + + +# require_package_name +# -------------------- +# Ensure that this has a sensible value, extracted from `configure.ac' +# if appropriate (and possible!). +require_package_name=func_require_package_name +func_require_package_name () +{ + $debug_cmd + + func_extract_trace AC_INIT + + save_ifs="$IFS" + IFS=: + set dummy $func_extract_trace_result + IFS="$save_ifs" + shift + + test -n "$package_name" || package_name="$1" + func_check_configuration package_name \ + "AC_INIT([name of your package], [package version number])" + func_verbose "package_name='$package_name'" + + require_package_name=: +} + + +# require_package_version +# ----------------------- +# Ensure that this has a sensible value, extracted from `configure.ac' +# if appropriate (and possible!). While we might have set all the +# parameters extracted from AC_INIT at once, `package_version' in +# particular is not necessarily available as early as the others, since +# `git-version-gen' is often involved, and until then we can't rely on +# getting a correct version number from an AC_INIT extraction. +require_package_version=func_require_package_version +func_require_package_version () +{ + $debug_cmd + + func_extract_trace AC_INIT + + save_ifs="$IFS" + IFS=: + set dummy $func_extract_trace_result + IFS="$save_ifs" + shift + + test -n "$package_version" || package_version="$2" + func_check_configuration package_version \ + "AC_INIT([$package_name], [package version number])" + func_verbose "package_version='$package_version'" + + require_package_version=: +} + + +# require_source_base +# ------------------- +# Ensure that source_base has a sensible value, extracted from +# `gnulib-cache.m4' if possible. +require_source_base=func_require_source_base +func_require_source_base () + { + $debug_cmd + + $require_gnulib_cache + + test -f "$gnulib_cache" && test x = "x$source_base" && { + $require_macro_dir + + func_extract_trace "gl_SOURCE_BASE" "$gnulib_cache" + + source_base="$func_extract_trace_result" + + func_verbose "source_base='$source_base'" + } + + # Only prevent repeated calls if we found something... + # gnulib-cache.m4 might arrive before the next call. + test -n "$source_base" && require_source_base=: +} + + +# require_vc_ignore_files +# ----------------------- +# Ensure that `$vc_ignore' has been processed to list VCS ignore files +# in `$vc_ignore_files' +require_vc_ignore_files=func_require_vc_ignore_files +func_require_vc_ignore_files () +{ + $debug_cmd + + test -n "$vc_ignore" || vc_ignore=auto + + if test auto = "$vc_ignore" && test x = x"$vc_ignore_files"; then + vc_ignore_files= + test -d .git && vc_ignore_files=.gitignore + test -d CVS && vc_ignore_files="$vc_ignore_files .cvsignore" + else + vc_ignore_files="$vc_ignore" + fi + + func_verbose "vc_ignore_files='$vc_ignore_files'" + + require_vc_ignore_files=: +} + + +## ------------------## +## Helper functions. ## +## ------------------## + +# This section contains the helper functions used by the rest of `bootstrap'. + +# func_len STRING +# --------------- +# STRING may not start with a hyphen. +if (eval 'x=123; test x${#x} = "x3"') 2>/dev/null +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo 0` + } +fi + + +# func_unset VAR +# -------------- +# Portably unset VAR. +func_unset () +{ + { eval $1=; unset $1; } +} +unset=func_unset + + +# func_cmp_s FILE1 FILE2 +# ---------------------- +# Return non-zero exit status unless FILE1 and FILE2 are identical, without +# output. +func_cmp_s () +{ + $debug_cmd + + # This function relies on non-zero exit status, which will cause the + # program to exit when running in `set -e' mode. + $CMP "$@" >/dev/null 2>&1 +} + + +# func_grep_q EXPRESSION [FILENAME..]. +# ------------------------------------ +# Check whether EXPRESSION matches any line of any listed FILENAME, +# without output. +func_grep_q () +{ + $debug_cmd + + # This function relies on non-zero exit status, which will cause the + # program to exit when running in `set -e' mode. + $GREP "$@" >/dev/null 2>&1 +} + + +# func_append_u VAR VALUE +# ----------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_u options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_u () +{ + $debug_cmd + + eval my_current_value='`echo $'$1'`' + my_delim=`expr "$2" : '\(.\)'` + + case $my_delim$my_current_value$my_delim in + *"$2$my_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_strpad STR WIDTH CHAR +# -------------------------- +# Trim STR, or pad with CHAR to force a total length of WIDTH. +func_strpad () +{ + $debug_cmd + + my_width=`expr "$2" - 1` + func_strpad_result=`echo "$1" |$SED ' + :a + s|^.\{0,'"$my_width"'\}$|&'"$3"'| + ta + '` +} + + +# func_strrpad STR WIDTH CHAR +# --------------------------- +# Trim STR, or right-justify-pad with CHAR to force a total length of +# WIDTH. +func_strrpad () +{ + $debug_cmd + + my_width=`expr "$2" - 1` + func_strrpad_result=`echo "$1" |$SED ' + :a + s|^.\{0,'"$my_width"'\}$|'"$3"'&| + ta + '` +} + + +# func_strrow INDENT FIELD WIDTH [FIELDn WIDTHn]... +# ------------------------------------------------- +# Return a string containing each FIELD left justified to WIDTH, with +# the whole thing indented by INDENT spaces. This function is used to +# render one row of aligned columns for a table by func_strtable(). +func_strrow () +{ + $debug_cmd + + func_strrow_linelen="$1"; shift + + my_row= + while test $# -gt 0; do + func_strrow_linelen=`expr $func_strrow_linelen + $2` + func_strpad "$1" $2 " " + func_append my_row "$func_strpad_result" + shift; shift + done + + func_strrpad "$my_row" $func_strrow_linelen " " + func_strrow_result="$func_strrpad_result" +} + + +# func_strtable INDENT WIDTH1...WIDTHn HEADER1...HEADERn FIELD1...FIELDn +# ---------------------------------------------------------------------- +# Generate a string of newline-separated rows arranged in lined-up +# columns of the given WIDTHs, with the entire table indented by INDENT +# spaces. The number of columns is determined by the number of integer +# valued WIDTH arguments following INDENT. The next set (i.e. a number +# of arguments equal to the number of WIDTH arguments) of fields are +# treated as the table's column HEADERs, and are separated from the +# remainder of the table by an indented row of `-' characters. Remaining +# arguments are each aligned below the next available header, wrapping +# to a new row as necessary. Finally another row of `-' characters is +# added to mark the end of the table. +# +# For example an unindented 3 column table with 2 rows of data would be +# generated by this call: +# +# func_strtable 3 20 10 25 \ +# Header1 Header2 Header3 \ +# Row1Col1 Row1Col2 Row1Col3 \ +# Row2Col1 Row2Col2 Row2Col3 +# +# returning the following string: +# +# " Header1 Header2 Header3 +# ------------------------------------------------------- +# Row1Col1 Row1Col2 Row1Col3 +# Row2Col1 Row2Col2 Row2Col3 +# -------------------------------------------------------" +func_strtable () +{ + $debug_cmd + + # Save the indent value, we'll need it for each row we render. + my_indent="$1"; shift + + # Collect remaining numeric args into a list for reuse between + # members of each row when we call func_strrow later. + my_widths="$1"; shift + while test 0 -lt `expr "$1" : '[1-9][0-9]*$'`; do + func_append my_widths " $1"; shift + done + + # Extract the same number of positional parameters as there are + # width elements - we'll do the header rows separately so that + # we can insert a divider line. + my_header="$my_indent" + for my_width in $my_widths; do + func_append my_header " $1 $my_width"; shift + done + func_strrow $my_header + + # Strip off the indent, and make a divider with `-' chars, then + # reindent. + my_divider=`echo "$func_strrow_result" \ + |$SED 's|[^ ]|-|g + :a + s|- |--|g + ta + '` + + # Append the header and divider to the running result. + func_append func_strtable_result "\ +$func_strrow_result +$my_divider +" + + # The remaining rows are zipped between the width values we + # unwound earlier just like the header row above. + while test $# -gt 0; do + my_row="$my_indent" + for my_width in $my_widths; do + func_append my_row " $1 $my_width"; shift + done + func_strrow $my_row + func_append func_strtable_result "\ +$func_strrow_result +" + done + + # Mark the end of the table with a final divider line. + func_append func_strtable_result "$my_divider" +} + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message, taking newlines into account. +func_echo () +{ + my_message="$*" + + save_IFS="$IFS" + IFS="$nl" + for my_line in $my_message; do + IFS="$save_IFS" + echo "$progname: $my_line" + done + IFS="$save_IFS" +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + my_message="$*" + + save_IFS="$IFS" + IFS="$nl" + for my_line in $my_message; do + IFS="$save_IFS" + echo "$progname: $bold_on$my_line$bold_off" 1>&2 + done + IFS="$save_IFS" +} + +# Allow display of bold text on terminals that support it +bold_on= +bold_off= +if test -t 1; then + if test -n "`tput bold 2>/dev/null`" \ + && test -n "`tput sgr0 2>/dev/null`" + then + bold_on=`tput bold` + bold_off=`tput sgr0` + fi +fi + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_internal_error ARG... +# -------------------------- +# Echo program name prefixed message to standard error, and exit. +func_internal_error () +{ + func_fatal_error "INTERNAL ERROR: " ${1+"$@"} " + Please report this bug to \`bug-gnulib@gnu.org' + in as much detail as possible." +} + + +# func_permissions_error FILE-OR-DIRECTORY +# ---------------------------------------- +# Echo program name prefixed permissions error message to standard +# error, and exit. +func_permissions_error () +{ + $debug_cmd + + func_fatal_error "Error: Failed to create \`$1', check permissions." +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY. +func_warning () +{ + $debug_cmd + + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category \`$1'" ;; + esac + + my_category="$1" + shift + + case " $opt_warning " in + *" $my_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + func_error ${1+"$@"} + func_fatal_error "$fatal_help" +} +fatal_help="Try \`$progname --help' for more information." ## default + + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + cat <<EOF +$progname $scriptversion +EOF + $SED -n '/(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + }' < "$progpath" + + exit $? +} + + +# func_usage [NOEXIT] +# ------------------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + echo "$progpath [OPTION]..." + echo "" + echo "$usage_message" + + my_ret=$? + test -n "$1" || { + echo "Run \`$progname --help | more' for full usage" + exit $my_ret + } +} + + +# func_help [NOEXIT] +# ------------------ +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $debug_cmd + + func_usage noexit + echo "$long_help_message" + + my_ret=$? + test -n "$1" || exit $my_ret +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Error: Missing argument for \`$1'." + exit_cmd=exit +} + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if (eval 'x=-abc; y=${x#??}; z=${x%$y}; test x$y$z = xbc-a') 2>/dev/null +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the `=' sign. +if (eval 'x='--ab=cd'; y=${x#*=}; z=${x%%=*}; test x$y$z = xcd--ab') 2>/dev/null +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs="" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*)'` + func_split_equals_rhs="" + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' +func_quote_for_eval () +{ + $debug_cmd + + func_quote_for_eval_result= + + while test $# -gt 0; do + case $1 in + *[\\\`\"\$]*) + my_unquoted_arg=`printf "$1" | $SED "$sed_quote_subst"` ;; + *) + my_unquoted_arg="$1" ;; + esac + + case $my_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_quoted_arg="\"$my_unquoted_arg\"" + ;; + *) + my_quoted_arg="$my_unquoted_arg" ;; + esac + test -n "$func_quote_for_eval_result" \ + && func_append func_quote_for_eval_result " " + func_append func_quote_for_eval_result "$my_quoted_arg" + shift + done +} + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_eval $my_cmd + eval func_truncate_cmd $func_quote_for_eval_result + func_echo "running: $func_truncate_cmd_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_truncate_cmd CMD [ARG]... +# ------------------------------ +# For unreasonably long commands (such as a gnulib-tool invocation with +# the full module list for import), truncate CMD after the second non- +# option ARG. +func_truncate_cmd () +{ + $debug_cmd + + my_last_arg_opt_p=false + func_truncate_cmd_result= + + set dummy "$@"; shift + + while test $# -gt 0; do + my_opt="$1"; shift + + test -n "$func_truncate_cmd_result" \ + && func_append func_truncate_cmd_result ' ' + func_append func_truncate_cmd_result "$my_opt" + + func_len "x$func_truncate_cmd_result" + + case $my_opt in + -*) my_last_arg_opt_p=: ;; + *) $my_last_arg_opt_p \ + || test $min_cmd_len -gt $func_len_result \ + || break + my_last_arg_opt_p=false + ;; + esac + done + + test $# -gt 0 && func_append func_truncate_cmd_result "..." +} + + +# func_extract_trace MACRO_NAME [FILENAME]... +# ------------------------------------------- +# set `$func_extract_trace_result' to a colon delimited list of +# arguments to MACRO_NAME in FILENAME. If no FILENAME is not given, +# then `configure.ac' is assumed. +func_extract_trace () +{ + $debug_cmd + + $require_configure_ac + $require_gnu_m4 + + my_macro="$1"; shift + test $# -gt 0 || { + set dummy $configure_ac + shift + } + + # Generate an error if the first file is missing + <"$1" + + # Sadly, we can't use `autom4te' tracing to extract macro + # arguments, because it complains about things we want to + # ignore at bootstrap time - like missing m4_include files; + # AC_PREREQ being newer than the installed autoconf; and + # returns nothing when tracing `AM_INIT_AUTOMAKE' when + # aclocal hasn't been generated yet. + # + # The following tries to emulate a less persnickety version + # of (and due to not having to wait for Perl startup on + # every invocation, it's probably faster too): + # + # autom4te --language=Autoconf --trace=$my_macro:\$% "$@" + # + # First we give a minimal set of macro declarations to M4 + # to prime it for reading Autoconf macros, while still + # providing some of the functionality generally used at + # m4-time to supply dynamic arguments to Autocof functions, + # but without following `m4_s?include' files. + # + # We discard M4's stdout, but the M4 trace output from reading + # our "autoconf.mini" followed by any other files passed to + # this function is then scanned by sed to transform it into + # a colon delimited argument list assigned to a shell variable. + # + # Finally, we `eval' the sed generated assignment to get + # the result back into this script for further use by callers + # of this function. + + func_extract_trace_result= + eval `echo ' + # Initialisation. + m4_changequote([,]) + m4_define([m4_copy], [m4_define([$2], m4_defn([$1]))]) + m4_define([m4_rename], [m4_copy([$1], [$2])m4_undefine([$1])]) + + # Disable these macros. + m4_undefine([m4_dnl]) + m4_undefine([m4_include]) + m4_undefine([m4_m4exit]) + m4_undefine([m4_m4wrap]) + m4_undefine([m4_maketemp]) + + # Copy and rename macros not handled by "m4 --prefix". + m4_define([dnl], [m4_builtin([dnl])]) + m4_copy([m4_define], [m4_defun]) + m4_rename([m4_ifelse], [m4_if]) + m4_ifdef([m4_mkstemp], [m4_undefine([m4_mkstemp])]) + m4_rename([m4_patsubst], [m4_bpatsubst]) + m4_rename([m4_regexp], [m4_bregexp]) + + # "m4sugar.mini" - useful m4-time macros for dynamic arguments. + # If we discover packages that need more m4 macros defined in + # order to bootstrap correctly, add them here: + m4_define([m4_bmatch], + [m4_if([$#], 0, [], [$#], 1, [], [$#], 2, [$2], + [m4_if(m4_bregexp([$1], [$2]), -1, + [$0([$1], m4_shift3($@))], [$3])])]) + m4_define([m4_ifndef], [m4_ifdef([$1], [$3], [$2])]) + m4_define([m4_ifset], + [m4_ifdef([$1], [m4_ifval(m4_defn([$1]), [$2], [$3])], [$3])]) + m4_define([m4_require], [$1]) + m4_define([m4_shift3], [m4_shift(m4shift(m4shift($@)))]) + + # "autoconf.mini" - things from autoconf macros we care about. + m4_copy([m4_defun], [AC_DEFUN]) + + # Dummy definition for the macro we want to trace. + # AM_INIT_AUTOMAKE at least produces no trace without this. + AC_DEFUN(['"$my_macro"'])' \ + |$M4 -daq --prefix --trace="$my_macro" - "$@" 2>&1 1>/dev/null \ + |$SED -n 's|#.*$|| + /^m4trace: -1- '"$my_macro"'/ { + s|^m4trace: -1- '"$my_macro"'[([]*|func_extract_trace_result='\''| + s|], [[]|:|g + s|[])]*$|:'\''| + s|[^'\'']$|\&'\''| + p + }'` + + # Leave the ':' sentinel in place for successfully traced macros + # without arguments, otherwise remove it so that the results of + # single-argument macros can be used without additional parsing. + test : = "$func_extract_trace_result" \ + || func_extract_trace_result=`echo "$func_extract_trace_result" |$SED 's|:$||'` +} + + +# func_insert_sorted_if_absent STR FILE... +# ---------------------------------------- +# If $STR is not already on a line by itself in $FILE, insert it, +# sorting the new contents of the file and replacing $FILE with the result. +func_insert_sorted_if_absent () +{ + $debug_cmd + + str=$1 + shift + + for file + do + test -f $file || touch $file + + func_grep_q "$str" "$file" \ + && func_verbose "inserting \`$str' into \`$file'" + + echo "$str" | sort -u - $file | func_cmp_s - $file \ + || echo "$str" | sort -u - $file -o $file \ + || func_permissions_error "$file" + done +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () # sort -V is not generally available +{ + $debug_cmd + + ver1="$1" + ver2="$2" + + # split on '.' and compare each component + i=1 + while : ; do + p1=`echo "$ver1" | cut -d. -f$i` + p2=`echo "$ver2" | cut -d. -f$i` + if test ! "$p1"; then + echo "$1 $2" + break + elif test ! "$p2"; then + echo "$2 $1" + break + elif test ! "$p1" = "$p2"; then + if test "$p1" -gt "$p2" 2>/dev/null; then # numeric comparison + echo "$2 $1" + elif test "$p2" -gt "$p1" 2>/dev/null; then # numeric comparison + echo "$1 $2" + else # numeric, then lexicographic comparison + lp=`printf "$p1\n$p2\n" | sort -n | tail -n1` + if test "$lp" = "$p2"; then + echo "$1 $2" + else + echo "$2 $1" + fi + fi + break + fi + i=`expr $i + 1` + done +} + + +# func_get_version APP +# -------------------- +# echo the version number (if any) of APP, which is looked up along your +# PATH. +func_get_version () +{ + $debug_cmd + + app=$1 + + { $app --version || $app --version </dev/null; } >/dev/null 2>&1 \ + || return 1 + + $app --version 2>&1 | + $SED -n '# extract version within line + s|.*[v ]\{1,\}\([0-9]\{1,\}\.[.a-z0-9-]*\).*|\1| + t done + + # extract version at start of line + s|^\([0-9]\{1,\}\.[.a-z0-9-]*\).*|\1| + t done + + d + + :done + #the following essentially does s|5.005|5.5| + s|\.0*\([1-9]\)|.\1|g + p + q' +} + + +# func_check_versions APP1 VER1 URL1 ...[APPN VERN URLN] +# ------------------------------------------------------ +func_check_versions () +{ + $debug_cmd + + func_check_versions_result=: + + while test $# -gt 0; do + my_app="$1"; shift + my_reqver="$1"; shift + my_url="$1"; shift + + # Honor $APP variables ($TAR, $AUTOCONF, etc.) + my_appvar=`echo $my_app | tr '[a-z]' '[A-Z]'` + test "$my_appvar" = TAR && my_appvar=AMTAR + eval "my_app=\${$my_appvar-$my_app}" + my_instver=`func_get_version $my_app` + + test ! "$my_instver" \ + || func_verbose "found \`$my_app' version $my_instver" + + # Fail if --version didn't work. + if test ! "$my_instver"; then + func_error "Error: \`$my_app' not found" + func_check_versions_result=false + + # Fail if a new version than what we have is required. + elif test ! "$my_reqver" = "-"; then + my_newer=`func_sort_ver $my_reqver $my_instver | cut -d' ' -f2` + test ! "$my_newer" = "$my_instver" && { + func_error "\ +Error: \`$my_app' version == $my_instver is too old + \`$my_app' version >= $my_reqver is required" + func_check_versions_result=false + } + fi + done +} + + +# func_cleanup_gnulib +# ------------------- +# Recursively delete everything below the path in the global variable +# GNULIB_PATH. +func_cleanup_gnulib () +{ + $debug_cmd + + status=$? + $RM -fr "$gnulib_path" + exit $status +} + + +# func_symlink_to_dir SRCDIR FILENAME [DEST_FILENAME] +# --------------------------------------------------- +# Make a symlink from FILENAME in SRCDIR to the current directory, +# optionally calling the symlink DEST_FILENAME. +func_symlink_to_dir () +{ + $debug_cmd + + $require_vc_ignore_files + + src=$1/$2 + dst=${3-$2} + + test -f "$src" && { + + # If the destination directory doesn't exist, create it. + # This is required at least for "lib/uniwidth/cjk.h". + dst_dir=`dirname "$dst"` + if ! test -d "$dst_dir"; then + mkdir -p "$dst_dir" + + # If we've just created a directory like lib/uniwidth, + # tell version control system(s) it's ignorable. + # FIXME: for now, this does only one level + parent=`dirname "$dst_dir"` + for dot_ig in x $vc_ignore_files; do + test $dot_ig = x && continue + ig=$parent/$dot_ig + func_insert_sorted_if_absent `echo "$dst_dir" |$SED 's|.*/||'` $ig + done + fi + + if $opt_copy; then + { + test ! -h "$dst" \ + || func_show_eval "$RM -f '$dst'" + } \ + && test -f "$dst" \ + && func_cmp_s "$src" "$dst" \ + && func_echo "copying file \`$src'" \ + && cp -fp "$src" "$dst" + else + test -h "$dst" \ + && src_ls=`ls -diL "$src" 2>/dev/null` \ + && set $src_ls && src_i=$1 \ + && dst_ls=`ls -diL "$dst" 2>/dev/null` \ + && set $dst_ls && dst_i=$1 \ + && test "$src_i" = "$dst_i" \ + || { + dot_dots= + case $src in + /*) ;; + *) + case /$dst/ in + *//* | */../* | */./* | /*/*/*/*/*/) + func_fatal_error "\ +Error: Invalid symlink calculation: $src -> $dst" + ;; + /*/*/*/*/) dot_dots=../../../;; + /*/*/*/) dot_dots=../../;; + /*/*/) dot_dots=../;; + esac + ;; + esac + + func_echo "linking file \`$src'" + ln -fs "$dot_dots$src" "$dst" + } + fi + } +} + + +# func_download_po_files SUBDIR DOMAIN +# ------------------------------------ +func_download_po_files () +{ + $debug_cmd + + func_echo "getting translations into $1 for $2..." + cmd=`printf "$po_download_command_format" "$2" "$1"` + eval "$cmd" +} + + +# func_find_tool ENVVAR NAMES... +# ------------------------------ +# Search for a required program. Use the value of ENVVAR, if set, +# otherwise find the first of the NAMES that can be run (i.e., +# supports --version). If found, set ENVVAR to the program name, +# die otherwise. +func_find_tool () +{ + $debug_cmd + + find_tool_envvar=$1 + shift + find_tool_names=$@ + eval "find_tool_res=\$$find_tool_envvar" + if test x"$find_tool_res" = x; then + for i + do + if ($i --version </dev/null) >/dev/null 2>&1; then + find_tool_res=$i + break + fi + done + else + find_tool_error_prefix="\$$find_tool_envvar: " + fi + test x"$find_tool_res" = x && func_fatal_error "\ +Error: One of these is required: + $find_tool_names" + + ($find_tool_res --version </dev/null) >/dev/null 2>&1 \ + || func_fatal_error "\ +Error: ${find_tool_error_prefix}Cannot run \`$find_tool_res --version'" + + eval "$find_tool_envvar=\$find_tool_res" + eval "export $find_tool_envvar" +} + + +# func_update_po_files PO_DIR DOMAIN +# ---------------------------------- +# Mirror .po files to $po_dir/.reference and copy only the new +# or modified ones into $po_dir. Also update $po_dir/LINGUAS. +# Note po files that exist locally only are left in $po_dir but will +# not be included in LINGUAS and hence will not be distributed. +func_update_po_files () +{ + $debug_cmd + + # Directory containing primary .po files. + # Overwrite them only when we're sure a .po file is new. + po_dir=$1 + domain=$2 + + # Mirror *.po files into this dir. + # Usually contains *.s1 checksum files. + ref_po_dir="$po_dir/.reference" + + test -d $ref_po_dir || mkdir $ref_po_dir || return + func_download_po_files $ref_po_dir $domain \ + && ls "$ref_po_dir"/*.po 2>/dev/null | + $SED 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return + + # Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6. + func_find_tool SHA1SUM sha1sum gsha1sum shasum + + langs=`cd $ref_po_dir && echo *.po|$SED 's|\.po||g'` + test "$langs" = '*' && langs=x + for po in $langs; do + case $po in x) continue;; esac + new_po="$ref_po_dir/$po.po" + cksum_file="$ref_po_dir/$po.s1" + if ! test -f "$cksum_file" || + ! test -f "$po_dir/$po.po" || + ! $SHA1SUM -c --status "$cksum_file" \ + < "$new_po" > /dev/null; then + echo "updated $po_dir/$po.po..." + cp "$new_po" "$po_dir/$po.po" \ + && $SHA1SUM < "$new_po" > "$cksum_file" + fi + done +} + + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Allow overriding, eg to get a function call trace: +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash bootstrap +debug_cmd="${debug_cmd-:}" +exit_cmd=: + +dirname='s|/[^/]*$||' +basename='s|^.*/||' + +nl=' +' + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" |$SED "$basename"` + +## -------------------------------------------------- ## +## Source package customisations in `bootstrap.conf'. ## +## -------------------------------------------------- ## + +# Override the default configuration, if necessary. +# Make sure that bootstrap.conf is sourced from the current directory +# if we were invoked as "sh bootstrap". +case "$0" in + */*) test -r "$0.conf" && . "$0.conf" ;; + *) test -r "$0.conf" && . ./"$0.conf" ;; +esac + + +## ------------------------------- ## +## Actually perform the bootstrap. ## +## ------------------------------- ## + +func_bootstrap ${1+"$@"} + +# The End. +exit $exit_status + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/Build/source/utils/psutils/psutils-1.21/bootstrap.conf b/Build/source/utils/psutils/psutils-1.21/bootstrap.conf new file mode 100644 index 00000000000..2925724bad0 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/bootstrap.conf @@ -0,0 +1,104 @@ +# bootstrap.conf (psutils) +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010 Gary V. Vaughan. + +# This file is part of psutils. +# See LICENSE for license. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# Additional gnulib-tool options to use. +gnulib_tool_options=' + --no-changelog +' + +# gnulib modules used by this package. +gnulib_modules=' + warnings + manywarnings + fstat +' + +# Extra gnulib files that are not in modules, which override files of +# the same name installed by other bootstrap tools. +gnulib_non_module_files=' + build-aux/config.guess + build-aux/config.sub + build-aux/install-sh +' + +# The not-synced with gnulib warning is bogus until upstream adopts +# the saner bootstrap script. +require_bootstrap_uptodate=: + +## --------------- ## +## Hook functions. ## +## --------------- ## + +# psutils_ignore_gnulib_ignore +# ---------------------------- +# gnulib-tool updates m4/.gitignore and lib/.gitignore, and keeping +# generated files under version control does not make sense. Since +# lib is entirely ignored, we only need to prepopulate the m4 ignore +# files with generated files not tracked by gnulib-tool. +psutils_ignore_gnulib_ignore () +{ + $debug_cmd + + $require_macro_dir + + if test -f "$macro_dir/.gitignore" ; then + : + else + func_verbose "creating initial \`$macro_dir/.gitignore'" + cat > $macro_dir/.gitignore <<\EOF +# files created by bootstrap, but that gnulib doesn't track +*~ +/.gitignore +/gnulib-cache.m4 +/gnulib-comp.m4 +/libtool.m4 +/ltoptions.m4 +/ltsugar.m4 +/ltversion.m4 +/lt~obsolete.m4 +EOF + fi +} +func_add_hook func_prep psutils_ignore_gnulib_ignore + + +# psutils_force_changelog +# ----------------------- +# Automake requires that ChangeLog exist. +psutils_force_changelog () +{ + $debug_cmd + + touch ChangeLog || exit 1 +} +func_add_hook func_gnulib_tool psutils_force_changelog + + +# psutils_finish +# ---------------------- +# Configure script does not require ChangeLog. +# Copy dummy.c with correct license. +psutils_finish () +{ + $debug_cmd + + cp -fp ./dummy.c $source_base/ + rm ChangeLog || exit 1 +} +func_add_hook func_fini psutils_finish + + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# End: diff --git a/Build/source/utils/psutils/psutils-1.21/configure.ac b/Build/source/utils/psutils/psutils-1.21/configure.ac new file mode 100644 index 00000000000..40f2ab20683 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/configure.ac @@ -0,0 +1,80 @@ +dnl Process this file with autoconf to produce a configure script + +AC_INIT(psutils, 1.21, rrt@sc3d.org) +AC_CONFIG_AUX_DIR([build-aux]) + +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +dnl Check for programs +AC_PROG_CC +gl_EARLY +AC_PROG_LN_S +AM_PROG_AR + +AC_USE_SYSTEM_EXTENSIONS +AC_ARG_ENABLE([gcc-warnings], + [AS_HELP_STRING([--enable-gcc-warnings], + [turn on lots of GCC warnings (for developers)])], + [case $enableval in + yes|no) ;; + *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;; + esac + gl_gcc_warnings=$enableval], + [gl_gcc_warnings=no] +) + +if test "$gl_gcc_warnings" = yes; then + gl_WARN_ADD([-Werror], [WERROR_CFLAGS]) + + # Set up the list of undesired warnings. + nw= + nw="$nw -Wundef" # All compiler preprocessors support #if UNDEF + nw="$nw -Wtraditional" # All compilers nowadays support ANSI C + nw="$nw -Wstrict-overflow" # Use a lower level (see below). + nw="$nw -Wconversion" # These warnings usually don’t point to mistakes. + nw="$nw -Wsign-conversion" # Likewise. + nw="$nw -Waggregate-return" # We do this on purpose. + nw="$nw -Wtraditional-conversion" # Don't care. + nw="$nw -Wpadded" # Don't care. + nw="$nw -Wc++-compat" # Don't care. + nw="$nw -Woverlength-strings" # Don't care. + nw="$nw -Wmissing-format-attribute" # Don't care. + nw="$nw -Wshadow" # Don't care. + nw="$nw -Wunreachable-code" # Seems buggy. + nw="$nw -Wsystem-headers" # glibc headers fail as of glibc 2.15, gcc 4.7 + nw="$nw -Wall" + nw="$nw -Wunused-macros" # those macros might come in handy later + + gl_MANYWARN_ALL_GCC([warnings]) + + # Enable all GCC warnings not in this list. + gl_MANYWARN_COMPLEMENT([warnings], [$warnings], [$nw]) + for w in $warnings; do + gl_WARN_ADD([$w]) + done + + # Add an extra warning + gl_WARN_ADD([-Wstrict-overflow=1]) + # Add some more safety measures + gl_WARN_ADD([-D_FORTIFY_SOURCE=2]) + gl_WARN_ADD([-fmudflap]) +fi + +gl_INIT + +dnl Check for header files +AC_HEADER_STDC +AC_CHECK_HEADER([paper.h], [], [AC_MSG_FAILURE([cannot find libpaper header])]) + +dnl Check for libraries +AC_PROG_RANLIB +AC_CHECK_LIB([paper], [paperinfo], [], + [AC_MSG_FAILURE([cannot find libpaper library])]) + +dnl Generate output files +AC_CONFIG_MACRO_DIR(m4) +AC_CONFIG_HEADER(config.h) +AC_CONFIG_FILES(Makefile lib/Makefile) +AC_OUTPUT diff --git a/Build/source/utils/psutils/psutils-1.21/dummy.c b/Build/source/utils/psutils/psutils-1.21/dummy.c new file mode 100644 index 00000000000..061a78c34b2 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/dummy.c @@ -0,0 +1,30 @@ +/* A dummy file, to prevent empty libraries from breaking builds. + + This file is in the public domain. -- Bruno Haible */ + +/* Some systems, reportedly OpenBSD and Mac OS X, refuse to create + libraries without any object files. You might get an error like: + + > ar cru .libs/libgl.a + > ar: no archive members specified + + Compiling this file, and adding its object file to the library, will + prevent the library from being empty. */ + +/* Some systems, such as Solaris with cc 5.0, refuse to work with libraries + that don't export any symbol. You might get an error like: + + > cc ... libgnu.a + > ild: (bad file) garbled symbol table in archive ../gllib/libgnu.a + + Compiling this file, and adding its object file to the library, will + prevent the library from exporting no symbols. */ + +#ifdef __sun +/* This declaration ensures that the library will export at least 1 symbol. */ +int gl_dummy_symbol; +#else +/* This declaration is solely to ensure that after preprocessing + this file is never empty. */ +typedef int dummy; +#endif diff --git a/Build/source/utils/psutils/psutils-1.17/epsffit.man b/Build/source/utils/psutils/psutils-1.21/epsffit.1 index 9f1bf66beb1..3519cd3576d 100644 --- a/Build/source/utils/psutils/psutils-1.17/epsffit.man +++ b/Build/source/utils/psutils/psutils-1.21/epsffit.1 @@ -1,4 +1,4 @@ -.TH EPSFFIT 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.TH EPSFFIT 1 "PSUtils" .SH NAME epsffit \- fit encapsulated PostScript file (EPSF) into constrained size .SH SYNOPSIS @@ -43,9 +43,9 @@ box better. .IP \fB\-s\fP 1i Add a \fIshowpage\fP at the end of the file to force the image to print. .SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 +Written by Angus J. C. Duggan. .SH "SEE ALSO" -@MAN@ +psutils(1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/epsffit.c b/Build/source/utils/psutils/psutils-1.21/epsffit.c index e49010cfbf4..8ff3f7ec3ee 100644 --- a/Build/source/utils/psutils/psutils-1.17/epsffit.c +++ b/Build/source/utils/psutils/psutils-1.21/epsffit.c @@ -1,14 +1,9 @@ /* epsffit.c - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. + * Fit EPSF file into constrained size * - * fit epsf file into constrained size - * Usage: - * epsffit [-c] [-r] [-a] [-s] llx lly urx ury [infile [outfile]] - * -c centres the image in the bounding box given - * -r rotates the image by 90 degrees anti-clockwise - * -a alters the aspect ratio to fit the bounding box - * -s adds a showpage at the end of the image + * (c) Reuben Thomas 2012 + * (c) Angus J. C. Duggan 1991-1997 + * See file LICENSE for details. * * Added filename spec (from Larry Weissman) 5 Feb 93 * Accepts double %%BoundingBox input, outputs proper BB, 4 Jun 93. (I don't @@ -16,84 +11,74 @@ * outputs PostScript. */ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif -#include "pserror.h" -#include "patchlev.h" #include "psutil.h" -#define MIN(x,y) ((x) > (y) ? (y) : (x)) -#define MAX(x,y) ((x) > (y) ? (x) : (y)) +const char *syntax = "[-c] [-r] [-a] [-m] [-s] LLX LLY URX URY [INFILE [OUTFILE]]\n"; -char *program; +const char *argerr_message = ""; -static void usage(void) -{ - fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); - fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); - fprintf(stderr, "Usage: %s [-c] [-r] [-a] [-s] llx lly urx ury [infile [outfile]]\n", - program); - exit(1); -} - -int main(int argc, char **argv) +int +main(int argc, char **argv) { int bbfound = 0; /* %%BoundingBox: found */ - int urx = 0, ury = 0, llx = 0, lly = 0; /* avoid uninitialized warning */ + int urx = 0, ury = 0, llx = 0, lly = 0; int furx, fury, fllx, flly; int showpage = 0, centre = 0, rotate = 0, aspect = 0, maximise = 0; char buf[BUFSIZ]; - FILE *input; - FILE *output; - - program = *argv++; argc--; - - while (argc > 0 && argv[0][0] == '-') { - switch (argv[0][1]) { - case 'c': centre = 1; break; - case 's': showpage = 1; break; - case 'r': rotate = 1; break; - case 'a': aspect = 1; break; - case 'm': maximise = 1; break; - case 'v': - default: usage(); - } - argc--; - argv++; + FILE *input = stdin; + FILE *output = stdout; + int opt; + + SET_BINARY(stdin); + SET_BINARY(stdout); + + program = *argv; + + while((opt = getopt(argc, argv, "csramv")) != EOF) { + switch(opt) { + case 'c': centre = 1; break; + case 's': showpage = 1; break; + case 'r': rotate = 1; break; + case 'a': aspect = 1; break; + case 'm': maximise = 1; break; + case 'v': + default: + usage(); + break; + } } - if (argc < 4 || argc > 6) usage(); - fllx = atoi(argv[0]); - flly = atoi(argv[1]); - furx = atoi(argv[2]); - fury = atoi(argv[3]); - - if (argc > 4) { - if(!(input = fopen(argv[4], OPEN_READ))) - message(FATAL, "can't open input file %s\n", argv[4]); - } else { -#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdin to binary mode\n"); -#endif - input = stdin ; - } - - if (argc > 5) { - if(!(output = fopen(argv[5], OPEN_WRITE))) - message(FATAL, "can't open output file %s\n", argv[5]); - } else { -#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - int fd = fileno(stdout) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdout to binary mode\n"); -#endif - output = stdout ; - } + if ((argc - optind) < 4 || (argc - optind) > 6) usage(); + + fllx = atoi(argv[optind++]); + flly = atoi(argv[optind++]); + furx = atoi(argv[optind++]); + fury = atoi(argv[optind++]); + + /* Be defensive */ + if((argc - optind) < 0 || (argc - optind) > 2) usage(); + + if ((argc - optind) > 0) { + if(!(input = fopen(argv[optind], "rb"))) + message(FATAL, "can't open input file %s\n", argv[optind]); + optind++; + } + + if ((argc - optind) > 0) { + if(!(output = fopen(argv[optind], "wb"))) + message(FATAL, "can't open output file %s\n", argv[optind]); + optind++; + } while (fgets(buf, BUFSIZ, input)) { if (buf[0] == '%' && (buf[1] == '%' || buf[1] == '!')) { diff --git a/Build/source/utils/psutils/psutils-1.21/extractres b/Build/source/utils/psutils/psutils-1.21/extractres new file mode 100755 index 00000000000..87f8377b34d --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/extractres @@ -0,0 +1,117 @@ +#!/usr/bin/env perl +# extractres: extract resources from PostScript file +# includeres: add resources to a PostScript file +# +# (c) Reuben Thomas 2012 +# (c) Angus J. C. Duggan 1991-1997 +# See file LICENSE for details. + +use strict; +use warnings; + +use File::Basename; +use Getopt::Long; + +my $prog = basename($0); + +# Resource extensions +my %extn = ("font" => ".pfa", "file" => ".ps", "procset" => ".ps", + "pattern" => ".pat", "form" => ".frm", "encoding" => ".enc"); +# Resource types +my %type = ("%%BeginFile:" => "file", "%%BeginProcSet:" => "procset", + "%%BeginFont:" => "font"); + +sub filename { # make filename for resource in @_ + my $name; + foreach (@_) { # sanitise name + s/[!()\$\#*&\\\|\`\'\"\~\{\}\[\]\<\>\?]//g; + $name .= $_; + } + $name =~ s@.*/@@; # drop directories + die "$prog: filename not found for resource ", join(" ", @_), "\n" + if $name =~ /^$/; + return $name; +} + +sub extract { + my %resources = (); # list of resources included + my %merge = (); # list of resources extracted this time + + my $merge; + unless (GetOptions('merge' => \$merge)) { + print STDERR "Usage: $prog [-merge] [FILE]\n"; + exit 1; + } + + my $prolog = ""; + my $body = ""; + my $resource = ""; + my $output = \$prolog; + my $saveout; + while (<>) { + if (/^%%BeginResource:/ || /^%%BeginFont:/ || /^%%BeginProcSet:/) { + my ($comment, @res) = split(/\s+/); # look at resource type + my $type = defined($type{$comment}) ? $type{$comment} : shift(@res); + my $name = filename(@res, $extn{$type}); # make file name + $saveout = $output; + if (!defined($resources{$name})) { + $prolog .= "%%IncludeResource: $type " . join(" ", @res) . "\n"; + if (!-e $name) { + open RES, ">$name" || die "$prog: can't write file `$name'\n"; + $resources{$name} = ""; + $merge{$name} = $merge; + $output = \$resources{$name}; + } else { # resource already exists + close(RES); + undef $output; + } + } elsif ($merge{$name}) { + open RES, ">>$name" || die "$prog: can't append to file `$name'\n"; + $resources{$name} = ""; + $output = \$resources{$name}; + } else { # resource already included + undef $output; + } + } elsif (/^%%EndResource/ || /^%%EndFont/ || /^%%EndProcSet/) { + if (defined $output) { + $$output .= $_; + print RES $$output; + } + $output = $saveout; + next; + } elsif ((/^%%EndProlog/ || /^%%BeginSetup/ || /^%%Page:/)) { + $output = \$body; + } + $$output .= $_ if defined $output; + } + + print $prolog . $body; +} + +sub include { + while (<>) { + if (/^%%IncludeResource:/ || /^%%IncludeFont:/ || /^%%IncludeProcSet:/) { + my ($comment, @res) = split(/\s+/); + my $type = defined($type{$comment}) ? $type{$comment} : shift(@res); + my $name = filename(@res); + if (open(RES, $name) || open(RES, "$name$extn{$type}")) { + print do { local $/; <RES> }; + close(RES); + } else { + print "%%IncludeResource: ", join(" ", $type, @res), "\n"; + print STDERR "$prog: resource `$name' not found\n"; + } + } else { + print $_; + } + } +} + +# Perform function according to name +if ($prog eq "extractres") { + extract(); +} elsif ($prog eq "includeres") { + include(); +} else { + die "$prog: I need to be called `extractres' or `includeres'\n"; +} diff --git a/Build/source/utils/psutils/psutils-1.17/extractres.man b/Build/source/utils/psutils/psutils-1.21/extractres.1 index e0702233827..33d96f7cb0e 100644 --- a/Build/source/utils/psutils/psutils-1.17/extractres.man +++ b/Build/source/utils/psutils/psutils-1.21/extractres.1 @@ -1,4 +1,4 @@ -.TH EXTRACTRES 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.TH EXTRACTRES 1 "PSUtils" .SH NAME extractres \- filter to extract resources from a PostScript document .SH SYNOPSIS @@ -34,9 +34,9 @@ The option combines the resources of the same name into one file; this must be used for some programs which download fonts a bit at a time. .SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 +Written by Angus J. C. Duggan. .SH "SEE ALSO" -@MAN@ +psutils(1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/includeres.man b/Build/source/utils/psutils/psutils-1.21/includeres.1 index df36e8468c4..281dc187146 100644 --- a/Build/source/utils/psutils/psutils-1.17/includeres.man +++ b/Build/source/utils/psutils/psutils-1.21/includeres.1 @@ -1,4 +1,4 @@ -.TH INCLUDERES 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.TH INCLUDERES 1 "PSUtils" .SH NAME includeres \- filter to include resources in a PostScript document .SH SYNOPSIS @@ -9,11 +9,10 @@ includeres \- filter to include resources in a PostScript document .I output.ps .SH DESCRIPTION .I Includeres -includes resources (fonts, procsets, patterns, files, etc) in place of +includes resources (fonts, procsets, patterns, files, etc.) in place of .I %%IncludeResource -comments in a PostScript document. The resources are searched for in the -current directory and the system default directory under the resource name, -and with an appropriate extension. +comments in a PostScript document. The resources are searched for +under the resource name, and with an appropriate extension. The pipeline .sp .ce @@ -27,9 +26,9 @@ or .I pstops safely. .SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 +Written by Angus J. C. Duggan. .SH "SEE ALSO" -@MAN@ +psutils(1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/psbook.man b/Build/source/utils/psutils/psutils-1.21/psbook.1 index 6f5ad6d7927..53fd770a5e4 100644 --- a/Build/source/utils/psutils/psutils-1.17/psbook.man +++ b/Build/source/utils/psutils/psutils-1.21/psbook.1 @@ -1,4 +1,4 @@ -.TH PSBOOK 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.TH PSBOOK 1 "PSUtils" .SH NAME psbook \- rearrange pages in PostScript file into signatures .SH SYNOPSIS @@ -31,9 +31,9 @@ Psbook normally prints the page numbers of the pages rearranged; the .I \-q option suppresses this. .SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 +Written by Angus J. C. Duggan. .SH "SEE ALSO" -@MAN@ +psutils(1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.21/psbook.c b/Build/source/utils/psutils/psutils-1.21/psbook.c new file mode 100644 index 00000000000..b77c223d229 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/psbook.c @@ -0,0 +1,106 @@ +/* psbook.c + * (c) Reuben Thomas 2012 + * (c) Angus J. C. Duggan 1991-1997 + * See file LICENSE for details. + * + * rearrange pages in conforming PS file for printing in signatures + */ + +#include "config.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#include "psutil.h" + +const char *syntax = "[-q] [-sSIGNATURE] [INFILE [OUTFILE]]\n SIGNATURE must be positive and divisible by 4\n"; + +const char *argerr_message = ""; + +int +main(int argc, char *argv[]) +{ + int signature = 0; + int currentpg, maxpage; + int opt; + + SET_BINARY(stdin); + SET_BINARY(stdout); + + verbose = 1; + program = *argv; + + while((opt = getopt(argc, argv, "vqs:")) != EOF) { + switch(opt) { + case 's': /* signature size */ + signature = atoi(optarg); + if (signature < 1 || signature % 4) usage(); + break; + case 'q': /* quiet */ + verbose = 0; + break; + case 'v': /* version */ + default: + usage(); + break; + } + } + + infile = stdin; + outfile = stdout; + + /* Be defensive */ + if((argc - optind) < 0 || (argc - optind) > 2) usage(); + + if (optind != argc) { + /* User specified an input file */ + if ((infile = fopen(argv[optind], "rb")) == NULL) + message(FATAL, "can't open input file %s\n", argv[optind]); + optind++; + } + + if (optind != argc) { + /* User specified an output file */ + if ((outfile = fopen(argv[optind], "wb")) == NULL) + message(FATAL, "can't open output file %s\n", argv[optind]); + optind++; + } + + if(optind != argc) usage(); + + if ((infile=seekable(infile))==NULL) + message(FATAL, "can't seek input\n"); + + scanpages(NULL); + + if (!signature) + signature = maxpage = pages+(4-pages%4)%4; + else + maxpage = pages+(signature-pages%signature)%signature; + + /* rearrange pages */ + writeheader(maxpage, NULL); + writeprolog(); + writesetup(); + for (currentpg = 0; currentpg < maxpage; currentpg++) { + int actualpg = currentpg - currentpg%signature; + switch(currentpg%4) { + case 0: + case 3: + actualpg += signature-1-(currentpg%signature)/2; + break; + case 1: + case 2: + actualpg += (currentpg%signature)/2; + break; + default: /* Avoid a compiler warning */ + break; + } + if (actualpg < pages) + writepage(actualpg); + else + writeemptypage(); + } + writetrailer(); + + return 0; +} diff --git a/Build/source/utils/psutils/psutils-1.21/psjoin b/Build/source/utils/psutils/psutils-1.21/psjoin new file mode 100755 index 00000000000..21dfaffeef3 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/psjoin @@ -0,0 +1,220 @@ +#!/usr/bin/env perl +# +# psjoin - concatenate PostScript files +# +# version 0.2, 2002-07-18 +# version 0.3, 2003-11-30 +# version 0.31, 2013-10-20 +# +# versions up to 0.3 by Tom Sato <VEF00200@nifty.ne.jp>, http://homepage3.nifty.com/tsato/ +# versions from 0.31 by Reuben Thomas <rrt@sc3d.org> + +use strict; +use warnings; + +use Getopt::Long; + +my $version = 0.31; + +sub usage { + my ($exit_code) = @_; + print STDERR <<END; +Usage: psjoin [OPTION...] FILENAME... +Concatenate PostScript files + + --even, -a force each file to take an even number of pages + --save, -s try to close unclosed save operators + --strip, -p do not strip prolog or trailer from input files + --help, -h print this help, then exit + --version,-V print version information and exit +END + exit $exit_code; +} + +my $force_even = 0; +my $force_save = 0; +my $dont_strip = 0; +my $save = "save %psjoin\n"; +my $restore = "restore %psjoin\n"; +my ($help_flag, $version_flag); + +GetOptions( + "even|a" => \$force_even, + "save|s" => \$force_save, + "strip|p" => \$dont_strip, + "help|h" => \$help_flag, + "version|V" => \$version_flag, + ) or usage(1); + +if ($help_flag) { + usage(0); +} elsif ($version_flag) { + print "psjoin (version $version)\n"; + print "(c) Tom Sato <VEF00200\@nifty.ne.jp> and Reuben Thomas <rrt\@sc3d.org>\n"; + exit 0; +} + +if ($force_save) { + $save = "/#psjoin-save# save def %psjoin\n"; + $restore = "#psjoin-save# restore %psjoin\n"; +} +my (@prolog, $prolog_inx, @trailer, @comments, @pages); +if ($dont_strip) { + $prolog_inx = 9999; + $prolog[$prolog_inx] = "% [ psjoin: don't strip ]\n"; + $trailer[$prolog_inx] = "% [ psjoin: don't strip ]\n"; +} else { + for (my $i = 0; $i <= $#ARGV; $i++) { + open(IN, $ARGV[$i]) || die "$0: can't open \"$ARGV[$i]\" ($!)"; + + my $in_comment = 1; + my $in_prolog = 1; + my $in_trailer = 0; + $comments[$i] = ""; + $prolog[$i] = ""; + $trailer[$i] = ""; + $pages[$i] = 0; + while (<IN>) { + next if /^%%BeginDocument/ .. /^%%EndDocument/; + + if ($in_comment) { + next if /^%!PS-Adobe-/; + next if /^%%Title/; + next if /^%%Pages/; + next if /^%%Creator/; + $in_comment = 0 if /^%%EndComments/; + $comments[$i] .= $_; + next; + } elsif ($in_prolog) { + if (/^%%Page:/) { + $in_prolog = 0; + } else { + $prolog[$i] .= $_; + next; + } + } + + $in_trailer = 1 if /^%%Trailer/; + if ($in_trailer) { + $trailer[$i] .= $_; + next; + } + + $pages[$i]++ if /^%%Page:/; + } + close(IN); + + if ($prolog[$i]) { + for (my $j = 0; $j < $i; $j++) { + if ($prolog[$j] eq $prolog[$i]) { + $pages[$j] += $pages[$i]; + last; + } + } + } + } + + my $largest = 0; + $prolog_inx = 0; + for (my $i = 0; $i <= $#ARGV; $i++) { + my $size = length($prolog[$i]) * $pages[$i]; + if ($largest < $size) { + $largest = $size; + $prolog_inx = $i; + } + } +} + +print <<END; +%!PS-Adobe-3.0 +%%Title: @ARGV +%%Creator: psjoin $version +%%Pages: (atend) +END +print $comments[$prolog_inx]; + +print "\n$prolog[$prolog_inx]"; +for (my $i = 0; $i <= $#ARGV; $i++) { + $prolog[$i] =~ s/^%%/% %%/; + $prolog[$i] =~ s/\n%%/\n% %%/g; + $trailer[$i] =~ s/^%%/% %%/; + $trailer[$i] =~ s/\n%%/\n% %%/g; +} + +my $total_pages = 0; +for (my $i = 0; $i <= $#ARGV; $i++) { + print "\n% [ psjoin: file = $ARGV[$i] ]\n"; + if ($prolog[$i] ne $prolog[$prolog_inx]) { + print "% [ psjoin: Prolog/Trailer will be inserted in each page ]\n"; + } else { + print "% [ psjoin: common Prolog/Trailer will be used ]\n"; + } + + my $in_comment = 1 if !$dont_strip; + my $in_prolog = 1 if !$dont_strip; + my $in_trailer = 0; + my $saved = 0; + my $pages = 0; + + open(IN, $ARGV[$i]) || die "$0: can't open \"$ARGV[$i]\" ($!)"; + while (<IN>) { + if (/^%%BeginDocument/ .. /^%%EndDocument/) { + # s/^(%[%!])/% \1/; + print $_; + } else { + if ($in_comment) { + $in_comment = 0 if /^%%EndComments/; + } elsif ($in_prolog) { + if (/^%%Page:/) { + $in_prolog = 0; + } else { + next; + } + } + $in_trailer = 1 if !$dont_strip && /^%%Trailer/; + next if $in_trailer; + + if (/^%%Page:/) { + if ($saved) { + print $trailer[$i]; + print $restore; + $saved = 0; + } + + $pages++; + $total_pages++; + print "\n"; + print "%%Page: ($i-$pages) $total_pages\n"; + if ($prolog[$i] ne $prolog[$prolog_inx]) { + print $save; + print $prolog[$i]; + $saved = 1; + } elsif ($force_save) { + print $save; + } + } else { + s/^(%[%!])/% $1/; + print $_; + } + } + } + close(IN); + + if ($force_even && $pages % 2 != 0) { + $pages++; + $total_pages++; + print <<END; + +%%Page: ($i-E) $total_pages +% [ psjoin: empty page inserted to force even pages ] +showpage +END + } + + print $trailer[$i] if $saved; + print $restore if $saved || $force_save; +} + +print "\n%%Trailer\n"; +print $trailer[$prolog_inx]; +print "\n%%Pages: $total_pages\n%%EOF"; diff --git a/Build/source/utils/psutils/psutils-1.21/psjoin.1 b/Build/source/utils/psutils/psutils-1.21/psjoin.1 new file mode 100644 index 00000000000..c048d4708e8 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/psjoin.1 @@ -0,0 +1,18 @@ +.TH PSJOIN "1" "November 2003" "psjoin 0.3" "User Commands" +.SH NAME +psjoin \- psjoin +.SH SYNOPSIS +.B psjoin +[ \fIoptions\fR... ] \fIfilenames\fR... +.SH DESCRIPTION +psjoin \- concatenate PostScript files (version 0.3) +by Tom Sato <VEF00200@nifty.ne.jp>, http://member.nifty.ne.jp/tsato/ +.SS "Option:" +.HP +\fB\-a\fR: align first page of each documents to odd page +.HP +\fB\-s\fR: try to close unclosed save operators +.HP +\fB\-p\fR: not strip prolog/trailer of the input files +.HP +\fB\-h\fR: display help diff --git a/Build/source/utils/psutils/psutils-1.17/psnup.man b/Build/source/utils/psutils/psutils-1.21/psnup.1 index 3edd10b4f40..200b4eb6406 100644 --- a/Build/source/utils/psutils/psutils-1.17/psnup.man +++ b/Build/source/utils/psutils/psutils-1.21/psnup.1 @@ -1,4 +1,4 @@ -.TH PSNUP 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.TH PSNUP 1 "PSUtils" .SH NAME psnup \- multiple pages per sheet .SH SYNOPSIS @@ -32,7 +32,7 @@ psnup \- multiple pages per sheet ] [ .B \-s\fIscale\fR ] [ -.B \-\fInup\fR +.B \-n\fIup\fR ] [ .B \-q ] [ @@ -50,22 +50,17 @@ The .I \-w option gives the paper width, and the .I \-h -option gives the paper height, -normally specified in -.B "cm" +option gives the paper height, specified in +.BR pt , +.BR mm , +.BR cm , or -.B "in" -to convert -PostScript's points (1/72 of an inch) -to centimeters or inches. +.BR in . The .I \-p -option can be used as an alternative, to set the paper size to -.B a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto -or -.B 10x14. -The default paper size is -.B @PAPER@. +option can be used instead, to set the paper size; otherwise a default value is used. +See +.BR papersize (5). The .I \-W, \-H, and @@ -149,9 +144,9 @@ on the first output page and pages 2 then 3 of the input document on the second output page. .SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 +Written by Angus J. C. Duggan. .SH "SEE ALSO" -@MAN@ +psutils(1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.21/psnup.c b/Build/source/utils/psutils/psutils-1.21/psnup.c new file mode 100644 index 00000000000..cfbe5f6968a --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/psnup.c @@ -0,0 +1,318 @@ +/* psnup.c + * Put multiple pages on to one page + * + * (c) Reuben Thomas 2012 + * (c) Angus J. C. Duggan 1991-1997 + * See file LICENSE for details. + */ + +#include "config.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#include <string.h> +#include <paper.h> + +#include "psutil.h" +#include "psspec.h" + +const char *syntax = "[-q] [-wWIDTH] [-hHEIGHT] [-pPAPER] [-WWIDTH] [-HHEIGHT] [-PPAPER] [-l] [-r] [-c] [-f] [-mMARGIN] [-bBORDER] [-dLWIDTH] [-sSCALE] [-NUP] [INFILE [OUTFILE]]\n"; + +const char *argerr_message = "bad dimension\n"; + +/* return next larger exact divisor of number, or 0 if none. There is probably + * a much more efficient method of doing this, but the numbers involved are + * small, so it's not a big loss. */ +_GL_ATTRIBUTE_CONST static int nextdiv(int n, int m) +{ + while (++n <= m) { + if (m%n == 0) + return (n); + } + return (0); +} + +int +main(int argc, char *argv[]) +{ + int horiz = 0, vert = 0, rotate = 0, column = 0; + int flip = 0, leftright = 0, topbottom = 0; + int nup = 1; + double draw = 0; /* draw page borders */ + double scale = 1.0; /* page scale */ + double uscale = 0; /* user supplied scale */ + double ppwid, pphgt; /* paper dimensions */ + double margin, border; /* paper & page margins */ + double vshift, hshift; /* page centring shifts */ + double iwidth, iheight ; /* input paper size */ + double tolerance = 100000; /* layout tolerance */ + off_t sizeheaders[20]; /* headers to remove */ + int opt; + const struct paper *paper = NULL; + + SET_BINARY(stdin); + SET_BINARY(stdout); + + set_paper_size(NULL); + + margin = border = vshift = hshift = column = flip = 0; + leftright = topbottom = 1; + iwidth = iheight = -1 ; + + verbose = 1; + program = *argv; + + while((opt = + getopt(argc, argv, + "qd::lrfcw:W:h:H:m:b:t:s:p:P:n:1::2::3::4::5::6::7::8::9::")) + != EOF) { + switch(opt) { + case 'q': /* quiet */ + verbose = 0; + break; + case 'd': /* draw borders */ + if (optarg) + draw = singledimen(optarg); + else + draw = 1; + break; + case 'l': /* landscape (rotated left) */ + column = !column; + topbottom = !topbottom; + break; + case 'r': /* seascape (rotated right) */ + column = !column; + leftright = !leftright; + break; + case 'f': /* flipped */ + flip = 1; + break; + case 'c': /* column major layout */ + column = !column; + break; + case 'w': /* page width */ + width = singledimen(optarg); + break; + case 'W': /* input page width */ + iwidth = singledimen(optarg); + break; + case 'h': /* page height */ + height = singledimen(optarg); + break; + case 'H': /* input page height */ + iheight = singledimen(optarg); + break; + case 'm': /* margins around whole page */ + margin = singledimen(optarg); + break; + case 'b': /* border around individual pages */ + border = singledimen(optarg); + break; + case 't': /* layout tolerance */ + tolerance = atof(optarg); + break; + case 's': /* override scale */ + uscale = atof(optarg); + break; + case 'p': /* output (and by default input) paper type */ + if ( (paper = paperinfo(optarg)) != NULL ) { + width = paperpswidth(paper); + height = paperpsheight(paper); + } else + message(FATAL, "paper size '%s' not recognised\n", optarg); + break; + case 'P': /* paper type */ + if ( (paper = paperinfo(optarg)) != NULL ) { + iwidth = paperpswidth(paper); + iheight = paperpsheight(paper); + } else + message(FATAL, "paper size '%s' not recognised\n", optarg); + break; + case 'n': /* n-up, for compatibility with other psnups */ + if ((nup = atoi(optarg)) < 1) + message(FATAL, "-n %d too small\n", nup); + break; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if(optarg) { + char *valuestr = (char *) malloc(strlen(optarg) + 2); + valuestr[0] = opt; + strcpy(&(valuestr[1]), optarg); + + /* really should check that valuestr is only digits here...*/ + if ((nup = atoi(valuestr)) < 1) + message(FATAL, "-n %d too small\n", nup); + free(valuestr); + } else { + nup = (opt - '0'); + } + break; + case 'v': /* version */ + default: + usage(); + } + } + + infile = stdin; + outfile = stdout; + + /* Be defensive */ + if((argc - optind) < 0 || (argc - optind) > 2) usage(); + + if (optind != argc) { + /* User specified an input file */ + if ((infile = fopen(argv[optind], "rb")) == NULL) + message(FATAL, "can't open input file %s\n", argv[optind]); + optind++; + } + + if (optind != argc) { + /* User specified an output file */ + if ((outfile = fopen(argv[optind], "wb")) == NULL) + message(FATAL, "can't open output file %s\n", argv[optind]); + optind++; + } + + if (optind != argc) usage(); + + if ((infile=seekable(infile))==NULL) + message(FATAL, "can't seek input\n"); + + if (width <= 0 || height <= 0) + message(FATAL, "page width and height must be set\n"); + + /* subtract paper margins from height & width */ + ppwid = width - margin*2; + pphgt = height - margin*2; + + if (ppwid <= 0 || pphgt <= 0) + message(FATAL, "paper margins are too large\n"); + + scanpages(sizeheaders); + + /* set default values of input height & width */ + if ( iwidth > 0 && width == -1 ) + width = iwidth ; + if ( iheight > 0 && height == -1 ) + height = iheight ; + + /* Finding the best layout is an optimisation problem. We try all of the + * combinations of width*height in both normal and rotated form, and + * minimise the wasted space. */ + { + double best = tolerance; + int hor; + for (hor = 1; hor; hor = nextdiv(hor, nup)) { + int ver = nup/hor; + /* try normal orientation first */ + double scl = MIN(pphgt/(height*ver), ppwid/(width*hor)); + double optim = (ppwid-scl*width*hor)*(ppwid-scl*width*hor) + + (pphgt-scl*height*ver)*(pphgt-scl*height*ver); + if (optim < best) { + best = optim; + /* recalculate scale to allow for internal borders */ + scale = MIN((pphgt-2*border*ver)/(height*ver), + (ppwid-2*border*hor)/(width*hor)); + hshift = (ppwid/hor - width*scale)/2; + vshift = (pphgt/ver - height*scale)/2; + horiz = hor; vert = ver; + rotate = flip; + } + /* try rotated orientation */ + scl = MIN(pphgt/(width*hor), ppwid/(height*ver)); + optim = (pphgt-scl*width*hor)*(pphgt-scl*width*hor) + + (ppwid-scl*height*ver)*(ppwid-scl*height*ver); + if (optim < best) { + best = optim; + /* recalculate scale to allow for internal borders */ + scale = MIN((pphgt-2*border*hor)/(width*hor), + (ppwid-2*border*ver)/(height*ver)); + hshift = (ppwid/ver - height*scale)/2; + vshift = (pphgt/hor - width*scale)/2; + horiz = ver; vert = hor; + rotate = !flip; + } + } + + /* fail if nothing better than worst tolerance was found */ + if (best == tolerance) + message(FATAL, "can't find acceptable layout for %d-up\n", nup); + } + + if (flip) { /* swap width & height for clipping */ + double tmp = width; + width = height; + height = tmp; + } + + if (rotate) { /* rotate leftright and topbottom orders */ + int tmp = topbottom; + topbottom = !leftright; + leftright = tmp; + column = !column; + } + + /* now construct specification list and run page rearrangement procedure */ + { + int page = 0; + PageSpec *specs, *tail; + + tail = specs = newspec(); + + while (page < nup) { + int up, across; /* page index */ + + if (column) { + if (leftright) /* left to right */ + across = page/vert; + else /* right to left */ + across = horiz-1-page/vert; + if (topbottom) /* top to bottom */ + up = vert-1-page%vert; + else /* bottom to top */ + up = page%vert; + } else { + if (leftright) /* left to right */ + across = page%horiz; + else /* right to left */ + across = horiz-1-page%horiz; + if (topbottom) /* top to bottom */ + up = vert-1-page/horiz; + else /* bottom to top */ + up = page/horiz; + } + if (rotate) { + tail->xoff = margin + (across+1)*ppwid/horiz - hshift; + tail->rotate = 90; + tail->flags |= ROTATE; + } else { + tail->xoff = margin + across*ppwid/horiz + hshift; + } + tail->pageno = page; + if (uscale > 0) + tail->scale = uscale; + else + tail->scale = scale; + tail->flags |= SCALE; + tail->yoff = margin + up*pphgt/vert + vshift; + tail->flags |= OFFSET; + if (++page < nup) { + tail->flags |= ADD_NEXT; + tail->next = newspec(); + tail = tail->next; + } + } + + pstops_write(nup, 1, 0, specs, draw, sizeheaders); /* do page rearrangement */ + } + + return 0; +} + diff --git a/Build/source/utils/psutils/psutils-1.17/psresize.man b/Build/source/utils/psutils/psutils-1.21/psresize.1 index f7ba9cb3093..3e5e751b194 100644 --- a/Build/source/utils/psutils/psutils-1.17/psresize.man +++ b/Build/source/utils/psutils/psutils-1.21/psresize.1 @@ -1,6 +1,6 @@ -.TH PSRESIZE 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.TH PSRESIZE 1 "PSUtils" .SH NAME -psresize \- multiple pages per sheet +psresize \- rescales and centers a document for new output paper size .SH SYNOPSIS .B psresize [ @@ -41,12 +41,9 @@ PostScript's points (1/72 of an inch) to centimeters or inches. The .I \-p -option can be used as an alternative, to set the output paper size to -.B a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto -or -.B 10x14. -The default output paper size is -.B @PAPER@. +option can be used instead, to set the paper size; otherwise a default value is used. +See +.BR papersize (5). .PP The .I \-W @@ -55,9 +52,9 @@ option gives the input paper width, and the option gives the input paper height. The .I \-P -option can be used as an alternative, to set the input paper size. -The default input paper size is -.B @PAPER@. +option can be used instead, to set the paper size; otherwise a default value is used. +See +.BR papersize (5). .PP .I Psresize normally prints the page numbers of the pages output; the @@ -70,9 +67,9 @@ letter size paper: psresize -PA4 -pletter in.ps out.ps .sp .SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 +Written by Angus J. C. Duggan. .SH "SEE ALSO" -@MAN@ +psutils(1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.21/psresize.c b/Build/source/utils/psutils/psutils-1.21/psresize.c new file mode 100644 index 00000000000..bd1f961488b --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/psresize.c @@ -0,0 +1,162 @@ +/* psresize.c + * Alter page size of document + * + * (c) Reuben Thomas 2012 + * (c) Angus J. C. Duggan 1991-1997 + * See file LICENSE for details. + */ + +#include "config.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#include <paper.h> + +#include "psutil.h" +#include "psspec.h" + +const char *syntax = "[-q] [-wWIDTH] [-hHEIGHT] [-pPAPER] [-WWIDTH] [-HHEIGHT] [-PPAPER] [INFILE [OUTFILE]]\n"; + +const char *argerr_message = "bad dimension\n"; + +int +main(int argc, char *argv[]) +{ + double scale, rscale; /* page scale */ + double waste, rwaste; /* amount wasted */ + double vshift, hshift; /* page centring shifts */ + int rotate; + double inwidth = -1; + double inheight = -1; + off_t sizeheaders[20]; /* headers to remove */ + PageSpec *specs; + int opt; + const struct paper *paper = NULL; + + SET_BINARY(stdin); + SET_BINARY(stdout); + + set_paper_size(NULL); + + vshift = hshift = 0; + rotate = 0; + + verbose = 1; + + program = *argv; + + while((opt = getopt(argc, argv, + "qw:h:p:W:H:P:")) != EOF) { + switch(opt) { + + case 'q': /* quiet */ + verbose = 0; + break; + case 'w': /* page width */ + width = singledimen(optarg); + break; + case 'h': /* page height */ + height = singledimen(optarg); + break; + case 'p': /* paper type */ + if ( (paper = paperinfo(optarg)) != NULL ) { + width = paperpswidth(paper); + height = paperpsheight(paper); + } else + message(FATAL, "paper size '%s' not recognised\n", optarg); + break; + case 'W': /* input page width */ + inwidth = singledimen(optarg); + break; + case 'H': /* input page height */ + inheight = singledimen(optarg); + break; + case 'P': /* input paper type */ + if ( (paper = paperinfo(optarg)) != NULL ) { + inwidth = paperpswidth(paper); + inheight = paperpsheight(paper); + } else + message(FATAL, "paper size '%s' not recognised\n", optarg); + break; + case 'v': /* version */ + default: + usage(); + } + } + + infile = stdin; + outfile = stdout; + + /* Be defensive */ + if((argc - optind) < 0 || (argc - optind) > 2) usage(); + + if (optind != argc) { + /* User specified an input file */ + if ((infile = fopen(argv[optind], "rb")) == NULL) + message(FATAL, "can't open input file %s\n", argv[optind]); + optind++; + } + + if (optind != argc) { + /* User specified an output file */ + if ((outfile = fopen(argv[optind], "wb")) == NULL) + message(FATAL, "can't open output file %s\n", argv[optind]); + optind++; + } + + if (optind != argc) usage(); + + if ((infile=seekable(infile))==NULL) + message(FATAL, "can't seek input\n"); + + if (width <= 0 || height <= 0) + message(FATAL, "output page width and height must be set\n"); + + scanpages(sizeheaders); + + if (inwidth <= 0 || inheight <= 0) + message(FATAL, "input page width and height must be set\n"); + + /* try normal orientation first */ + scale = MIN(width/inwidth, height/inheight); + waste = (width-scale*inwidth)*(width-scale*inwidth) + + (height-scale*inheight)*(height-scale*inheight); + hshift = (width - inwidth*scale)/2; + vshift = (height - inheight*scale)/2; + + /* try rotated orientation */ + rscale = MIN(height/inwidth, width/inheight); + rwaste = (height-scale*inwidth)*(height-scale*inwidth) + + (width-scale*inheight)*(width-scale*inheight); + if (rwaste < waste) { + double tmp = width; + scale = rscale; + hshift = (width + inheight*scale)/2; + vshift = (height - inwidth*scale)/2; + rotate = 1; + width = height; + height = tmp; + } + + width /= scale; + height /= scale; + + /* now construct specification list and run page rearrangement procedure */ + specs = newspec(); + + if (rotate) { + specs->rotate = 90; + specs->flags |= ROTATE; + } + specs->pageno = 0; + specs->scale = scale; + specs->flags |= SCALE; + specs->xoff = hshift; + specs->yoff = vshift; + specs->flags |= OFFSET; + + pstops_write(1, 1, 0, specs, 0.0, sizeheaders); /* do page rearrangement */ + + return 0; +} + diff --git a/Build/source/utils/psutils/psutils-1.17/psselect.man b/Build/source/utils/psutils/psutils-1.21/psselect.1 index 5311db233e3..be1260a7a51 100644 --- a/Build/source/utils/psutils/psutils-1.17/psselect.man +++ b/Build/source/utils/psutils/psutils-1.21/psselect.1 @@ -1,4 +1,4 @@ -.TH PSSELECT 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.TH PSSELECT 1 "PSUtils" .SH NAME psselect \- select pages from a PostScript file .SH SYNOPSIS @@ -73,9 +73,9 @@ The page number given to is the number of the page counting from the start or end of the file, starting at one. The actual page number in the document may be different. .SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 +Written by Angus J. C. Duggan. .SH "SEE ALSO" -@MAN@ +psutils(1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.17/psselect.c b/Build/source/utils/psutils/psutils-1.21/psselect.c index baa8e15efdb..8166f5942f9 100644 --- a/Build/source/utils/psutils/psutils-1.17/psselect.c +++ b/Build/source/utils/psutils/psutils-1.21/psselect.c @@ -1,35 +1,20 @@ /* psselect.c - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. - * - * rearrange pages in conforming PS file for printing in signatures + * Rearrange pages in conforming PS file for printing in signatures * - * Usage: - * psselect [-q] [-e] [-o] [-r] [-p<pages>] [infile [outfile]] + * (c) Reuben Thomas 2012 + * (c) Angus J. C. Duggan 1991-1997 + * See file LICENSE for details. */ +#include "config.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #include "psutil.h" -#include "pserror.h" -#include "patchlev.h" - -char *program ; -int pages ; -int verbose ; -FILE *infile ; -FILE *outfile ; -char pagelabel[BUFSIZ] ; -int pageno ; - -static void usage(void) -{ - fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); - fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); - fprintf(stderr, - "Usage: %s [-q] [-e] [-o] [-r] [-p<pages>] [infile [outfile]]\n", - program); - fflush(stderr); - exit(1); -} + +const char *syntax = "[-q] [-e] [-o] [-r] [-pPAGES] [INFILE [OUTFILE]]\n"; + +const char *argerr_message = ""; typedef struct pgrange { int first, last; @@ -52,6 +37,9 @@ static PageRange *addrange(char *str, PageRange *rp) { int first=0; int sign; + + if(!str) return NULL; + sign = (*str == '_' && ++str) ? -1 : 1; if (isdigit(*str)) { first = sign*atoi(str); @@ -75,80 +63,93 @@ static PageRange *addrange(char *str, PageRange *rp) if (isdigit(*str)) { int last = sign*atoi(str); while (isdigit(*str)) str++; - switch (*str) { - case '\0': + if (*str == '\0') return (makerange(first, last, rp)); - case ',': + if (*str == ',') return (addrange(str+1, makerange(first, last, rp))); - } } else if (*str == '\0') return (makerange(first, -1, rp)); else if (*str == ',') return (addrange(str+1, makerange(first, -1, rp))); + default: /* Avoid a compiler warning */ + break; } message(FATAL, "invalid page range\n"); return (PageRange *)0 ; } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { + int opt; int currentpg, maxpage = 0; int even = 0, odd = 0, reverse = 0; int pass, all; PageRange *pagerange = NULL; + SET_BINARY(stdin); + SET_BINARY(stdout); + + verbose = 1; + program = *argv; + + while((opt = getopt(argc, argv, "eorqvp:")) != EOF) { + switch(opt) { + case 'e': /* even pages */ + even = 1; + break; + case 'o': /* odd pages */ + odd = 1; + break; + case 'r': /* reverse */ + reverse = 1; + break; + case 'p': /* page spec */ + pagerange = addrange(optarg, pagerange); + break; + case 'q': /* quiet */ + verbose = 0; + break; + case 'v': /* version */ + default: + usage(); + break; + } + } + infile = stdin; outfile = stdout; - verbose = 1; - for (program = *argv++; --argc; argv++) { - if (argv[0][0] == '-') { - switch (argv[0][1]) { - case 'e': /* even pages */ - even = 1; - break; - case 'o': /* odd pages */ - odd = 1; - break; - case 'r': /* reverse */ - reverse = 1; - break; - case 'p': /* page spec */ - pagerange = addrange(*argv+2, pagerange); - break; - case 'q': /* quiet */ - verbose = 0; - break; - case 'v': /* version */ - default: - usage(); - } - } else if (pagerange == NULL && !reverse && !even && !odd) { - pagerange = addrange(*argv, NULL); - } else if (infile == stdin) { - if ((infile = fopen(*argv, OPEN_READ)) == NULL) - message(FATAL, "can't open input file %s\n", *argv); - } else if (outfile == stdout) { - if ((outfile = fopen(*argv, OPEN_WRITE)) == NULL) - message(FATAL, "can't open output file %s\n", *argv); - } else usage(); + + /* If we haven't gotten a page range yet, we better get one now */ + if (pagerange == NULL && !reverse && !even && !odd) { + pagerange = addrange(argv[optind], NULL); + optind++; } -#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - if ( infile == stdin ) { - int fd = fileno(stdin) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdin to binary mode\n"); - } - if ( outfile == stdout ) { - int fd = fileno(stdout) ; - if ( setmode(fd, O_BINARY) < 0 ) - message(FATAL, "can't reset stdout to binary mode\n"); - } -#endif + + /* Be defensive */ + if((argc - optind) < 0 || (argc - optind) > 2) usage(); + + if (optind != argc) { + /* User specified an input file */ + if ((infile = fopen(argv[optind], "rb")) == NULL) + message(FATAL, "can't open input file %s\n", argv[optind]); + optind++; + } + + if (optind != argc) { + /* User specified an output file */ + if ((outfile = fopen(argv[optind], "wb")) == NULL) + message(FATAL, "can't open output file %s\n", argv[optind]); + optind++; + } + + if(optind != argc) usage(); + if ((infile=seekable(infile))==NULL) message(FATAL, "can't seek input\n"); - scanpages(); + scanpages(NULL); /* select all pages or all in range if odd or even not set */ all = !(odd || even); @@ -197,7 +198,7 @@ int main(int argc, char *argv[]) for (pass = 0; pass < 2; pass++) { PageRange *r; if (pass) { /* write header on second pass */ - writeheader(maxpage); + writeheader(maxpage, NULL); writeprolog(); writesetup(); } diff --git a/Build/source/utils/psutils/psutils-1.17/psspec.c b/Build/source/utils/psutils/psutils-1.21/psspec.c index 304d2a28d43..9ec2e2e3a18 100644 --- a/Build/source/utils/psutils/psutils-1.17/psspec.c +++ b/Build/source/utils/psutils/psutils-1.21/psspec.c @@ -1,14 +1,15 @@ /* psspec.c - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. + * Page spec routines for page rearrangement * - * page spec routines for page rearrangement + * (c) Reuben Thomas 2012 + * (c) Angus J. C. Duggan 1991-1997 + * See file LICENSE for details. */ +#include "config.h" + #include "psutil.h" #include "psspec.h" -#include "pserror.h" -#include "patchlev.h" #include <string.h> @@ -21,7 +22,7 @@ PageSpec *newspec(void) PageSpec *temp = (PageSpec *)malloc(sizeof(PageSpec)); if (temp == NULL) message(FATAL, "out of memory\n"); - temp->reversed = temp->pageno = temp->flags = temp->rotate = 0; + temp->pageno = temp->flags = temp->rotate = 0; temp->scale = 1; temp->xoff = temp->yoff = 0; temp->next = NULL; @@ -29,33 +30,33 @@ PageSpec *newspec(void) } /* dimension parsing routines */ -int parseint(char **sp, void (*errorfn)(void)) +int parseint(char **sp) { char *s = *sp; int num = atoi(s); while (isdigit(*s)) s++; - if (*sp == s) (*errorfn)() ; + if (*sp == s) argerror(); *sp = s; return (num); } -double parsedouble(char **sp, void (*errorfn)(void)) +double parsedouble(char **sp) { char *s = *sp; double num = atof(s); while (isdigit(*s) || *s == '-' || *s == '.') s++; - if (*sp == s) (*errorfn)() ; + if (*sp == s) argerror(); *sp = s; return (num); } -double parsedimen(char **sp, void (*errorfn)(void)) +double parsedimen(char **sp) { - double num = parsedouble(sp, errorfn); + double num = parsedouble(sp); char *s = *sp; if (strncmp(s, "pt", 2) == 0) { @@ -84,27 +85,21 @@ double parsedimen(char **sp, void (*errorfn)(void)) return (num); } -double singledimen(char *str, void (*errorfn)(void), void (*usagefn)(void)) +double singledimen(char *str) { - double num = parsedimen(&str, errorfn); - if (*str) (*usagefn)(); + double num = parsedimen(&str); + if (*str) usage(); return (num); } static const char *prologue[] = { /* PStoPS procset */ -#ifndef SHOWPAGE_LOAD - "userdict begin", - "[/showpage/erasepage/copypage]{dup where{pop dup load", /* prevent */ - " type/operatortype eq{1 array cvx dup 0 3 index cvx put", /* binding */ - " bind def}{pop}ifelse}{pop}ifelse}forall", /* in prolog */ -#else + /* Wrap these up with our own versions. We have to */ "userdict begin", - "[/showpage/copypage/erasepage]{dup 10 string cvs dup", - " length 6 add string dup 0 (PStoPS) putinterval dup", - " 6 4 -1 roll putinterval 2 copy cvn dup where", - " {pop pop pop}{exch load def}ifelse cvx cvn 1 array cvx", - " dup 0 4 -1 roll put def}forall", -#endif + "[/showpage/erasepage/copypage]{dup where{pop dup load", + " type/operatortype eq{ /PStoPSenablepage cvx 1 index" + " load 1 array astore cvx {} bind /ifelse cvx 4 array" + " astore cvx def}{pop}ifelse}{pop}ifelse}forall" + " /PStoPSenablepage true def", "[/letter/legal/executivepage/a4/a4small/b5/com10envelope", /* nullify */ " /monarchenvelope/c5envelope/dlenvelope/lettersmall/note", /* paper */ " /folio/quarto/a5]{dup where{dup wcheck{exch{}put}", /* operators */ @@ -134,23 +129,23 @@ static const char *prologue[] = { /* PStoPS procset */ NULL }; -void pstops(int modulo, int pps, int nobind, PageSpec *specs, double draw) +void pstops(int modulo, int pps, int nobind, PageSpec *specs, double draw) { + + scanpages(NULL); + pstops_write(modulo, pps, nobind, specs, draw, NULL); +} + +void pstops_write(int modulo, int pps, int nobind, PageSpec *specs, double draw, off_t *ignorelist) { int thispg, maxpage; int pageindex = 0; const char **pro; - scanpages(); - maxpage = ((pages+modulo-1)/modulo)*modulo; /* rearrange pages: doesn't cope properly with loaded definitions */ - writeheader((maxpage/modulo)*pps); -#ifndef SHOWPAGE_LOAD + writeheadermedia((maxpage/modulo)*pps, ignorelist, width, height); writestring("%%BeginProcSet: PStoPS"); -#else - writestring("%%BeginProcSet: PStoPS-spload"); -#endif if (nobind) writestring("-nobind"); writestring(" 1 15\n"); @@ -174,7 +169,7 @@ void pstops(int modulo, int pps, int nobind, PageSpec *specs, double draw) for (ps = specs; ps != NULL; ps = ps->next) { int actualpg; int add_next = ((ps->flags & ADD_NEXT) != 0); - if (ps->reversed) + if (ps->flags & REVERSED) actualpg = maxpage-thispg-modulo+ps->pageno; else actualpg = thispg+ps->pageno; @@ -186,7 +181,7 @@ void pstops(int modulo, int pps, int nobind, PageSpec *specs, double draw) char sep = '('; do { *eob++ = sep; - if (np->reversed) + if (np->flags & REVERSED) sprintf(eob, "%d", maxpage-thispg-modulo+np->pageno); else sprintf(eob, "%d", thispg+np->pageno); @@ -208,6 +203,14 @@ void pstops(int modulo, int pps, int nobind, PageSpec *specs, double draw) sprintf(buffer, "%d rotate\n", ps->rotate); writestring(buffer); } + if (ps->flags & HFLIP) { + sprintf(buffer, "[ -1 0 0 1 %f 0 ] concat\n", width*ps->scale); + writestring(buffer); + } + if (ps->flags & VFLIP) { + sprintf(buffer, "[ 1 0 0 -1 0 %f ] concat\n", height*ps->scale); + writestring(buffer); + } if (ps->flags & SCALE) { sprintf(buffer, "%f dup scale\n", ps->scale); writestring(buffer); @@ -225,13 +228,8 @@ void pstops(int modulo, int pps, int nobind, PageSpec *specs, double draw) } } } - if (add_next) { -#ifndef SHOWPAGE_LOAD - writestring("/showpage{}def/copypage{}def/erasepage{}def\n"); -#else - writestring("/PStoPSshowpage{}store/PStoPScopypage{}store/PStoPSerasepage{}store\n"); -#endif - } + if (add_next) + writestring("/PStoPSenablepage false def\n"); if (actualpg < pages) { writepagesetup(); writestring("PStoPSxform concat\n"); diff --git a/Build/source/utils/psutils/psutils-1.21/psspec.h b/Build/source/utils/psutils/psutils-1.21/psspec.h new file mode 100644 index 00000000000..e62d1cfd3f2 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/psspec.h @@ -0,0 +1,35 @@ +/* psspec.h + * Page spec routines for page rearrangement + * + * (c) Reuben Thomas 2012 + * (c) Angus J. C. Duggan 1991-1997 + * See file LICENSE for details. + */ + +/* pagespec flags */ +#define ADD_NEXT (0x01) +#define ROTATE (0x02) +#define HFLIP (0x04) +#define VFLIP (0x08) +#define SCALE (0x10) +#define OFFSET (0x20) +#define REVERSED (0x40) +#define GSAVE (ROTATE|HFLIP|VFLIP|SCALE|OFFSET) + +typedef struct pagespec { + int pageno, flags, rotate; + double xoff, yoff, scale; + struct pagespec *next; +} PageSpec ; + +extern double width, height; + +extern PageSpec *newspec(void); +extern int parseint(char **sp); +extern double parsedouble(char **sp); +extern double parsedimen(char **sp); +extern double singledimen(char *str); +extern void pstops(int modulo, int pps, int nobind, PageSpec *specs, + double draw); +extern void pstops_write(int modulo, int pps, int nobind, PageSpec *specs, + double draw, off_t *ignorelist); diff --git a/Build/source/utils/psutils/psutils-1.17/pstops.man b/Build/source/utils/psutils/psutils-1.21/pstops.1 index 350af6c2990..1a65d1e92ee 100644 --- a/Build/source/utils/psutils/psutils-1.17/pstops.man +++ b/Build/source/utils/psutils/psutils-1.21/pstops.1 @@ -1,4 +1,4 @@ -.TH PSTOPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.TH PSTOPS 1 "PSUtils" .SH NAME pstops \- shuffle pages in a PostScript file .SH SYNOPSIS @@ -43,7 +43,7 @@ follow the syntax: .I = spec[+specs][,specs] .TP .I spec -.I = [-]pageno[L][R][U][@scale][(xoff,yoff)] +.I = [-]pageno[L][R][U][H][V][@scale][(xoff,yoff)] .RE .sp .I modulo @@ -74,8 +74,9 @@ to convert to centimetres or inches, or the flag or .B "h" to specify as a multiple of the width or height. -The optional parameters \fIL\fR, \fIR\fR, and \fIU\fR rotate the page left, -right, or upside-down. +The optional parameters \fIL\fR, \fIR\fR, \fIU\fR, \fIH\fR and \fIV\fR +rotate the page left, right, or upside-down, and flip (mirror) page +horizontally or vertically. The optional .I scale parameter scales the page by the fraction specified. @@ -85,15 +86,20 @@ the document, instead of the start. If page \fIspec\fRs are separated by .B \+ the pages will be merged into one page; if they are separated by -.B \, +.B , they will be on separate pages. If there is only one page specification, with .I pageno zero, the \fIpageno\fR may be omitted. -The shift, rotation, and scaling are performed +The shift, rotation, and scaling are applied +to the PostScript transformation matrix in that order regardless of which order they appear on the command line. +The matrix accumulates the individual transformations. +The effect on the image is to first scale with respect to an origin +at the lower left corner, then rotate about the same origin, and +finally shift. .PP The .I \-w @@ -107,12 +113,6 @@ dimension specifier. These dimensions are also used (after scaling) to set the clipping path for each page. The .I \-p -option can be used as an alternative, to set the paper size to -.B a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto -or -.B 10x14. -The default paper size is -.B @PAPER@. .PP The .I \-b @@ -136,7 +136,7 @@ This section contains some sample re-arrangements. To put two pages on one sheet (of A4 paper), the pagespec to use is: .sp .ce -2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm) +"2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)" .sp To select all of the odd pages in reverse order, use: .sp @@ -146,18 +146,18 @@ To select all of the odd pages in reverse order, use: To re-arrange pages for printing 2-up booklets, use .sp .ce -4:-3L@.7(21cm,0)+0L@.7(21cm,14.85cm) +"4:-3L@.7(21cm,0)+0L@.7(21cm,14.85cm)" .sp for the front sides, and .sp .ce -4:1L@.7(21cm,0)+-2L@.7(21cm,14.85cm) +"4:1L@.7(21cm,0)+-2L@.7(21cm,14.85cm)" .sp for the reverse sides (or join them with a comma for duplex printing). .SH AUTHOR -Copyright (C) Angus J. C. Duggan 1991-1995 +Written by Angus J. C. Duggan. .SH "SEE ALSO" -@MAN@ +psutils(1) .SH TRADEMARKS .B PostScript is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils-1.21/pstops.c b/Build/source/utils/psutils/psutils-1.21/pstops.c new file mode 100644 index 00000000000..cb1f658c80a --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/pstops.c @@ -0,0 +1,212 @@ +/* pstops.c + * Rearrange pages in conforming PS file + * + * (c) Reuben Thomas 2012 + * (c) Angus J. C. Duggan 1991-1997 + * See file LICENSE for details. + */ + +#include "config.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#include <string.h> +#include <paper.h> + +#include "psutil.h" +#include "psspec.h" + +const char *syntax = "[-q] [-b] [-wWIDTH] [-hHEIGHT] [-dLWIDTH] [-pPAPER] PAGESPECS [INFILE [OUTFILE]]\n"; + +const char *argerr_message = "%page specification error:\n" + " pagespecs = [modulo:]spec\n" + " spec = [-]pageno[@scale][L|R|U|H|V][(xoff,yoff)][,spec|+spec]\n" + " modulo >= 1, 0 <= pageno < modulo\n"; + +static int modulo = 1; +static int pagesperspec = 1; + +static PageSpec *parsespecs(char *str) +{ + PageSpec *head, *tail; + unsigned long spec_count = 0; + long num = -1; + + head = tail = newspec(); + while (*str) { + if (isdigit(*str)) { + num = parseint(&str); + } else { + switch (*str++) { + case ':': + if (spec_count || head != tail || num < 1) argerror(); + modulo = num; + num = -1; + break; + case '-': + tail->flags ^= REVERSED; + break; + case '@': + tail->scale *= parsedouble(&str); + tail->flags |= SCALE; + break; + case 'l': case 'L': + tail->rotate += 90; + tail->flags |= ROTATE; + break; + case 'r': case 'R': + tail->rotate -= 90; + tail->flags |= ROTATE; + break; + case 'u': case 'U': + tail->rotate += 180; + tail->flags |= ROTATE; + break; + case 'h': case 'H': + tail->flags ^= HFLIP; + break; + case 'v': case 'V': + tail->flags ^= VFLIP; + break; + case '(': + tail->xoff += parsedimen(&str); + if (*str++ != ',') argerror(); + tail->yoff += parsedimen(&str); + if (*str++ != ')') argerror(); + tail->flags |= OFFSET; + break; + case '+': + tail->flags |= ADD_NEXT; + case ',': + if (num < 0 || num >= modulo) argerror(); + if ((tail->flags & ADD_NEXT) == 0) + pagesperspec++; + tail->pageno = num; + tail->next = newspec(); + tail = tail->next; + num = -1; + break; + default: + argerror(); + } + spec_count++; + } + } + if (num >= modulo) + argerror(); + else if (num >= 0) + tail->pageno = num; + return (head); +} + +int +main(int argc, char *argv[]) +{ + PageSpec *specs = NULL; + int nobinding = 0; + double draw = 0; + const struct paper *paper = NULL; + int opt; + + SET_BINARY(stdin); + SET_BINARY(stdout); + + set_paper_size(NULL); + + verbose = 1; + + program = *argv; + + while((opt = getopt(argc, argv, "qd::bw:h:p:v0123456789")) != EOF) { + switch(opt) { + case 'q': /* quiet */ + verbose = 0; + break; + case 'd': /* draw borders */ + if(optarg) + draw = singledimen(optarg); + else + draw = 1; + break; + case 'b': /* no bind operator */ + nobinding = 1; + break; + case 'w': /* page width */ + width = singledimen(optarg); + break; + case 'h': /* page height */ + height = singledimen(optarg); + break; + case 'p': /* paper type */ + if ( (paper = paperinfo(optarg)) != NULL ) { + width = paperpswidth(paper); + height = paperpsheight(paper); + } else + message(FATAL, "paper size '%s' not recognised\n", optarg); + break; + case 'v': /* version */ + usage(); + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (specs == NULL) { + char *spec_txt = malloc((optarg ? strlen(optarg) : 0) + 3); + if(!spec_txt) message(FATAL, "no memory for spec allocation\n"); + spec_txt[0] = '-'; + spec_txt[1] = opt; + spec_txt[2] = 0; + if (optarg) strcat(spec_txt, optarg); + specs = parsespecs(spec_txt); + free(spec_txt); + } else { + usage(); + } + break; + default: + usage(); + break; + } + } + + if (specs == NULL) { + if(optind == argc) usage(); + specs = parsespecs(argv[optind]); + optind++; + } + + infile = stdin; + outfile = stdout; + + /* Be defensive */ + if((argc - optind) < 0 || (argc - optind) > 2) usage(); + + if (optind != argc) { + /* User specified an input file */ + if ((infile = fopen(argv[optind], "rb")) == NULL) + message(FATAL, "can't open input file %s\n", argv[optind]); + optind++; + } + + if (optind != argc) { + /* User specified an output file */ + if ((outfile = fopen(argv[optind], "wb")) == NULL) + message(FATAL, "can't open output file %s\n", argv[optind]); + optind++; + } + + if (optind != argc || specs == NULL) usage(); + + if ((infile=seekable(infile))==NULL) + message(FATAL, "can't seek input\n"); + + pstops(modulo, pagesperspec, nobinding, specs, draw); + + return 0; +} diff --git a/Build/source/utils/psutils/psutils-1.17/psutil.c b/Build/source/utils/psutils/psutils-1.21/psutil.c index 094e84853fd..a6ef8456b6f 100644 --- a/Build/source/utils/psutils/psutils-1.17/psutil.c +++ b/Build/source/utils/psutils/psutils-1.21/psutil.c @@ -1,101 +1,120 @@ /* psutil.c - * Copyright (C) Angus J. C. Duggan 1991-1995 - * See file LICENSE for details. + * PSUtils utility functions * - * utilities for PS programs + * (c) Reuben Thomas 2012 + * (c) Angus J. C. Duggan 1991-1997 + * See file LICENSE for details. */ -/* - * AJCD 6/4/93 - * Changed to using ftell() and fseek() only (no length calculations) - * Hunter Goatley 31-MAY-1993 23:33 - * Fixed VMS support. - * Hunter Goatley 2-MAR-1993 14:41 - * Added VMS support. - */ +#include "config.h" + +#define _FILE_OFFSET_BITS 64 + #include "psutil.h" -#include "pserror.h" -#include "patchlev.h" +#include "psspec.h" #include <string.h> #include <sys/types.h> #include <sys/stat.h> +#include <stdio.h> +#include <paper.h> #define iscomment(x,y) (strncmp(x,y,strlen(y)) == 0) +char *program; +int pages; +int verbose; +FILE *infile; +FILE *outfile; +char pagelabel[BUFSIZ]; +int pageno; + static char buffer[BUFSIZ]; static long bytes = 0; -static long pagescmt = 0; -static long headerpos = 0; -static long endsetup = 0; -static long beginprocset = 0; /* start of pstops procset */ -static long endprocset = 0; +static off_t pagescmt = 0; +static off_t headerpos = 0; +static off_t endsetup = 0; +static off_t beginprocset = 0; /* start of pstops procset */ +static off_t endprocset = 0; static int outputpage = 0; static int maxpages = 100; -static long *pageptr; - -/* list of paper sizes supported */ -static Paper papersizes[] = { - { "a3", 842, 1191 }, /* 29.7cm * 42cm */ - { "a4", 595, 842 }, /* 21cm * 29.7cm */ - { "a5", 421, 595 }, /* 14.85cm * 21cm */ - { "b5", 516, 729 }, /* 18.2cm * 25.72cm */ - { "A3", 842, 1191 }, /* 29.7cm * 42cm */ - { "A4", 595, 842 }, /* 21cm * 29.7cm */ - { "A5", 421, 595 }, /* 14.85cm * 21cm */ - { "B5", 516, 729 }, /* 18.2cm * 25.72cm */ - { "letter", 612, 792 }, /* 8.5in * 11in */ - { "legal", 612, 1008 }, /* 8.5in * 14in */ - { "ledger", 1224, 792 }, /* 17in * 11in */ - { "tabloid", 792, 1224 }, /* 11in * 17in */ - { "statement", 396, 612 }, /* 5.5in * 8.5in */ - { "executive", 540, 720 }, /* 7.6in * 10in */ - { "folio", 612, 936 }, /* 8.5in * 13in */ - { "quarto", 610, 780 }, /* 8.5in * 10.83in */ - { "10x14", 720, 1008 }, /* 10in * 14in */ - { NULL, 0, 0 } -}; - -/* return pointer to paper size struct or NULL */ -Paper* findpaper(const char *name) +static off_t *pageptr; + +_Noreturn void usage(void) { - Paper *pp; - for (pp = papersizes; PaperName(pp); pp++) { - if (strcmp(PaperName(pp), name) == 0) { - return pp; - } - } - return (Paper *)NULL; + fprintf(stderr, "%s %s\n", program, PACKAGE_VERSION); + fprintf(stderr, COPYRIGHT_STRING); + fprintf(stderr, "Usage: %s %s", program, syntax); + fflush(stderr); + exit(1); +} + +void argerror(void) +{ + message(FATAL, argerr_message); +} + +/* Message function: for messages, warnings, and errors sent to stderr. + If called with the flag MESSAGE_EXIT set, the routine does not return. */ +void message(int flags, const char *format, ...) +{ + va_list args ; + + if ( flags & MESSAGE_PROGRAM ) + fprintf(stderr, "%s: ", program) ; + + if ( (flags & MESSAGE_NL) ) + putc('\n', stderr) ; + + va_start(args, format) ; + vfprintf(stderr, format, args); + va_end(args) ; + + if ( flags & MESSAGE_EXIT ) /* don't return to program */ + exit(1) ; +} + +static void maybe_init_libpaper(void) +{ + static int libpaper_initted = 0; + if (!libpaper_initted) { + paperinit(); + libpaper_initted = 1; + } +} + +void set_paper_size(const char *paper_name) +{ + const struct paper *paper = get_paper(paper_name); + if (paper) { + width = paperpswidth(paper); + height = paperpsheight(paper); + } +} + +const struct paper *get_paper(const char *paper_name) +{ + maybe_init_libpaper(); + if (paper_name == NULL) + paper_name = systempapername(); + if (paper_name) + return paperinfo(paper_name); + return NULL; } /* Make a file seekable, using temporary files if necessary */ FILE *seekable(FILE *fp) { -#ifndef MSDOS FILE *ft; long r, w ; -#endif char *p; char buffer[BUFSIZ] ; -#if defined(WINNT) || defined(WIN32) - struct _stat fs ; -#else - long fpos; -#endif - -#if defined(WINNT) || defined(WIN32) - if (_fstat(fileno(fp), &fs) == 0 && (fs.st_mode&_S_IFREG) != 0) - return (fp); -#else - if ((fpos = ftell(fp)) >= 0) - if (!fseek(fp, 0L, SEEK_END) && !fseek(fp, fpos, SEEK_SET)) + off_t fpos; + + if ((fpos = ftello(fp)) >= 0) + if (!fseeko(fp, (off_t) 0, SEEK_END) && !fseeko(fp, fpos, SEEK_SET)) return (fp); -#endif -#if defined(MSDOS) - message(FATAL, "input is not seekable\n"); - return (NULL) ; -#else if ((ft = tmpfile()) == NULL) return (NULL); @@ -113,54 +132,98 @@ FILE *seekable(FILE *fp) /* discard the input file, and rewind the temporary */ (void) fclose(fp); - if (fseek(ft, 0L, SEEK_SET) != 0) + if (fseeko(ft, (off_t) 0, SEEK_SET) != 0) return (NULL) ; return (ft); -#endif } -/* copy input file from current position upto new position to output file */ -static int fcopy(long upto) +/* copy input file from current position upto new position to output file, + * ignoring the lines starting at something ignorelist points to */ +static int fcopy(off_t upto, off_t *ignorelist) { - long here = ftell(infile); - while (here < upto) { - if ((fgets(buffer, BUFSIZ, infile) == NULL) || - (fputs(buffer, outfile) == EOF)) - return(0); - here = ftell(infile); - bytes += strlen(buffer); - } - return (1); + off_t here = ftello(infile); + off_t bytes_left; + + if (ignorelist != NULL) { + while (*ignorelist > 0 && *ignorelist < here) + ignorelist++; + + while (*ignorelist > 0 && *ignorelist < upto) { + int r = fcopy(*ignorelist, NULL); + if (!r || fgets(buffer, BUFSIZ, infile) == NULL) + return 0; + ignorelist++; + here = ftello(infile); + while (*ignorelist > 0 && *ignorelist < here) + ignorelist++; + } + } + bytes_left = upto - here; + + while (bytes_left > 0) { + size_t rw_result; + const size_t numtocopy = (bytes_left > BUFSIZ) ? BUFSIZ : bytes_left; + rw_result = fread(buffer, 1, numtocopy, infile); + if (rw_result < numtocopy) return (0); + rw_result = fwrite(buffer, 1, numtocopy, outfile); + if (rw_result < numtocopy) return (0); + bytes_left -= numtocopy; + bytes += numtocopy; + } + return (1); } /* build array of pointers to start/end of pages */ -void scanpages(void) +void scanpages(off_t *sizeheaders) { register char *comment = buffer+2; register int nesting = 0; - register long int record; + register off_t record; + + if (sizeheaders) + *sizeheaders = 0; - if ((pageptr = (long *)malloc(sizeof(long)*maxpages)) == NULL) + if ((pageptr = (off_t *)malloc(sizeof(off_t)*maxpages)) == NULL) message(FATAL, "out of memory\n"); pages = 0; - fseek(infile, 0L, SEEK_SET); - while (record = ftell(infile), fgets(buffer, BUFSIZ, infile) != NULL) + fseeko(infile, (off_t) 0, SEEK_SET); + while (record = ftello(infile), fgets(buffer, BUFSIZ, infile) != NULL) if (*buffer == '%') { if (buffer[1] == '%') { if (nesting == 0 && iscomment(comment, "Page:")) { if (pages >= maxpages-1) { maxpages *= 2; - if ((pageptr = (long *)realloc((char *)pageptr, - sizeof(long)*maxpages)) == NULL) + if ((pageptr = (off_t *)realloc((char *)pageptr, + sizeof(off_t)*maxpages)) == NULL) message(FATAL, "out of memory\n"); } pageptr[pages++] = record; + } else if (headerpos == 0 && iscomment(comment, "BoundingBox:")) { + if (sizeheaders) { + *(sizeheaders++) = record; + *sizeheaders = 0; + } + } else if (headerpos == 0 && iscomment(comment, "HiResBoundingBox:")) { + if (sizeheaders) { + *(sizeheaders++) = record; + *sizeheaders = 0; + } + } else if (headerpos == 0 && iscomment(comment,"DocumentPaperSizes:")) { + if (sizeheaders) { + *(sizeheaders++) = record; + *sizeheaders = 0; + } + } else if (headerpos == 0 && iscomment(comment,"DocumentMedia:")) { + if (sizeheaders) { + *(sizeheaders++) = record; + *sizeheaders = 0; + } } else if (headerpos == 0 && iscomment(comment, "Pages:")) pagescmt = record; else if (headerpos == 0 && iscomment(comment, "EndComments")) - headerpos = ftell(infile); + headerpos = ftello(infile); else if (iscomment(comment, "BeginDocument") || iscomment(comment, "BeginBinary") || iscomment(comment, "BeginFile")) @@ -172,23 +235,23 @@ void scanpages(void) else if (nesting == 0 && iscomment(comment, "EndSetup")) endsetup = record; else if (nesting == 0 && iscomment(comment, "BeginProlog")) - headerpos = ftell(infile); + headerpos = ftello(infile); else if (nesting == 0 && iscomment(comment, "BeginProcSet: PStoPS")) beginprocset = record; else if (beginprocset && !endprocset && iscomment(comment, "EndProcSet")) - endprocset = ftell(infile); + endprocset = ftello(infile); else if (nesting == 0 && (iscomment(comment, "Trailer") || iscomment(comment, "EOF"))) { - fseek(infile, record, SEEK_SET); + fseeko(infile, record, SEEK_SET); break; } } else if (headerpos == 0 && buffer[1] != '!') headerpos = record; } else if (headerpos == 0) headerpos = record; - pageptr[pages] = ftell(infile); + pageptr[pages] = ftello(infile); if (endsetup == 0 || endsetup > pageptr[0]) endsetup = pageptr[0]; } @@ -196,7 +259,7 @@ void scanpages(void) /* seek a particular page */ void seekpage(int p) { - fseek(infile, pageptr[p], SEEK_SET); + fseeko(infile, pageptr[p], SEEK_SET); if (fgets(buffer, BUFSIZ, infile) != NULL && iscomment(buffer, "%%Page:")) { char *start, *end; @@ -213,6 +276,8 @@ void seekpage(int p) case ')': paren--; break; + default: + break; } } else for (end = start; !isspace(*end); end++); @@ -260,7 +325,7 @@ void writepagesetup(void) /* write the body of a page */ void writepagebody(int p) { - if (!fcopy(pageptr[p+1])) + if (!fcopy(pageptr[p+1], NULL)) message(FATAL, "I/O error writing page %d\n", outputpage); } @@ -273,26 +338,37 @@ void writepage(int p) } /* write from start of file to end of header comments */ -void writeheader(int p) +void writeheader(int p, off_t *ignore) { - fseek(infile, 0L, SEEK_SET); + writeheadermedia(p, ignore, -1, -1); +} + +void writeheadermedia(int p, off_t *ignore, double width, double height) +{ + fseeko(infile, (off_t) 0, SEEK_SET); if (pagescmt) { - if (!fcopy(pagescmt) || fgets(buffer, BUFSIZ, infile) == NULL) + if (!fcopy(pagescmt, ignore) || fgets(buffer, BUFSIZ, infile) == NULL) message(FATAL, "I/O error in header\n"); + if (width > -1 && height > -1) { + sprintf(buffer, "%%%%DocumentMedia: plain %d %d 0 () ()\n", (int) width, (int) height); + writestring(buffer); + sprintf(buffer, "%%%%BoundingBox: 0 0 %d %d\n", (int) width, (int) height); + writestring(buffer); + } sprintf(buffer, "%%%%Pages: %d 0\n", p); writestring(buffer); } - if (!fcopy(headerpos)) + if (!fcopy(headerpos, ignore)) message(FATAL, "I/O error in header\n"); } /* write prologue to end of setup section excluding PStoPS procset */ int writepartprolog(void) { - if (beginprocset && !fcopy(beginprocset)) + if (beginprocset && !fcopy(beginprocset, NULL)) message(FATAL, "I/O error in prologue\n"); if (endprocset) - fseek(infile, endprocset, SEEK_SET); + fseeko(infile, endprocset, SEEK_SET); writeprolog(); return !beginprocset; } @@ -300,21 +376,21 @@ int writepartprolog(void) /* write prologue up to end of setup section */ void writeprolog(void) { - if (!fcopy(endsetup)) + if (!fcopy(endsetup, NULL)) message(FATAL, "I/O error in prologue\n"); } /* write from end of setup to start of pages */ void writesetup(void) { - if (!fcopy(pageptr[0])) + if (!fcopy(pageptr[0], NULL)) message(FATAL, "I/O error in prologue\n"); } /* write trailer */ void writetrailer(void) { - fseek(infile, pageptr[pages], SEEK_SET); + fseeko(infile, pageptr[pages], SEEK_SET); while (fgets(buffer, BUFSIZ, infile) != NULL) { writestring(buffer); } diff --git a/Build/source/utils/psutils/psutils-1.21/psutil.h b/Build/source/utils/psutils/psutils-1.21/psutil.h new file mode 100644 index 00000000000..4cd2f22eebb --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/psutil.h @@ -0,0 +1,82 @@ +/* psutil.h + * PSUtils utility functions + * + * (c) Reuben Thomas 2012 + * (c) Angus J. C. Duggan 1991-1997 + * See file LICENSE for details. + */ +#define _FILE_OFFSET_BITS 64 +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> +#include <stdarg.h> + +/* message flags */ +#define MESSAGE_NL 1 /* Newline before message if necessary */ +#define MESSAGE_PROGRAM 2 /* announce program name */ +#define MESSAGE_EXIT 4 /* do not return */ + +/* message types */ +#define FATAL (MESSAGE_EXIT|MESSAGE_PROGRAM|MESSAGE_NL) +#define WARN (MESSAGE_NL|MESSAGE_PROGRAM) +#define LOG 0 + +/* change mode of a file pointer on Windows */ +#if defined(WIN32) +#include <io.h> +#include <fcntl.h> +#define SET_BINARY(fp) (void)_setmode(fileno(fp), _O_BINARY) +#undef off_t +#undef ftello +#undef fseeko +#if defined(__MINGW32__) +#define off_t off64_t +#define ftello ftello64 +#define fseeko fseeko64 +#else +#define off_t __int64 +#define xfseeko xfseek64 +#define xftello xftell64 +#endif +#else /* !WIN32 */ +#define SET_BINARY(fp) (void)0 +#endif + +/* Definitions for functions found in psutil.c */ +extern void usage(void); +extern void message(int flags, const char *format, ...); +extern void argerror(void); +extern void set_paper_size(const char *paper_name); +const struct paper *get_paper(const char *paper_name); +extern FILE *seekable(FILE *fp); +extern void writepage(int p); +extern void seekpage(int p); +extern void writepageheader(const char *label, int p); +extern void writepagesetup(void); +extern void writepagebody(int p); +extern void writeheader(int p, off_t *ignorelist); +extern void writeheadermedia(int p, off_t *ignorelist, double width, double height); +extern int writepartprolog(void); +extern void writeprolog(void); +extern void writesetup(void); +extern void writetrailer(void); +extern void writeemptypage(void); +extern void scanpages(off_t *sizeheaders); +extern void writestring(const char *s); + +/* These variables are exported to the client program */ +extern char *program ; +extern int pages; +extern int verbose; +extern FILE *infile; +extern FILE *outfile; +extern char pagelabel[BUFSIZ]; +extern int pageno; + +/* Variables imported from the client program */ +extern const char *syntax; +extern const char *argerr_message; + +/* Useful macros */ +#define MIN(x,y) ((x) > (y) ? (y) : (x)) +#define COPYRIGHT_STRING "(c) Reuben Thomas <rrt@sc3d.org> 2012\n(c) Angus J. C. Duggan 1991-1997\nSee file LICENSE for details.\n" diff --git a/Build/source/utils/psutils/psutils-1.21/psutils.1 b/Build/source/utils/psutils/psutils-1.21/psutils.1 new file mode 100644 index 00000000000..5ddc7b94925 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.21/psutils.1 @@ -0,0 +1,13 @@ +.TH PSUTILS 1 "PSUtils" +.SH NAME +PSUtils \- utilities +.SH DESCRIPTION +PSUtils is a set of utilities for manipulating PostScript +documents which follow the Adobe Document Structuring Conventions. +.SH AUTHOR +Written by Angus J. C. Duggan. +.SH "SEE ALSO" +psbook(1), psselect(1), pstops(1), epsffit(1), psnup(1), psresize(1), psjoin(1), extractres(1), includeres(1) +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/psutils.test b/Build/source/utils/psutils/psutils.test index 1ceefb5b229..fdcfdb8c9cf 100755 --- a/Build/source/utils/psutils/psutils.test +++ b/Build/source/utils/psutils/psutils.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 2011 Peter Breitenlohner <tex-live@tug.org> +# Copyright (C) 2011-2013 Peter Breitenlohner <tex-live@tug.org> # You may freely use, modify and/or distribute this file. failed= @@ -24,13 +24,13 @@ rm -rf play* && echo "psresize tests OK" \ || failed="$failed psresize" -./psnup -2 playsel.ps playnup.ps \ +./psnup -pa4 -2 playsel.ps playnup.ps \ 2>playnup.2 \ && diff playnup.2 $srcdir/tests/playnup.2 \ && echo "psnup tests OK" \ || failed="$failed psnup" -./pstops '2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)' playsel.ps playps.ps \ +./pstops -pa4 '2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)' playsel.ps playps.ps \ 2>playps.2 \ && diff playps.2 $srcdir/tests/playps.2 \ && echo "pstops tests OK" \ diff --git a/Build/source/utils/psutils/tests/playnup.2 b/Build/source/utils/psutils/tests/playnup.2 index d1ff375b517..0c486cfccc1 100644 --- a/Build/source/utils/psutils/tests/playnup.2 +++ b/Build/source/utils/psutils/tests/playnup.2 @@ -1 +1 @@ -[1] [2] [3] [4] [5] [6] Wrote 6 pages, 16645 bytes +[1] [2] [3] [4] [5] [6] Wrote 6 pages, 16644 bytes diff --git a/Build/source/utils/psutils/tests/playps.2 b/Build/source/utils/psutils/tests/playps.2 index d1ff375b517..548507ce9e0 100644 --- a/Build/source/utils/psutils/tests/playps.2 +++ b/Build/source/utils/psutils/tests/playps.2 @@ -1 +1 @@ -[1] [2] [3] [4] [5] [6] Wrote 6 pages, 16645 bytes +[1] [2] [3] [4] [5] [6] Wrote 6 pages, 16696 bytes diff --git a/Build/source/utils/psutils/tests/playres.ps b/Build/source/utils/psutils/tests/playres.ps index 1966e9ed065..c64265ad217 100644 --- a/Build/source/utils/psutils/tests/playres.ps +++ b/Build/source/utils/psutils/tests/playres.ps @@ -2,17 +2,16 @@ %%Creator: dvips(k) 5.98 Copyright 2009 Radical Eye Software %%Title: play.dvi %%CreationDate: Fri Sep 23 19:01:22 2011 +%%DocumentMedia: plain 595 844 0 () () +%%BoundingBox: 0 0 595 844 %%Pages: 11 0 %%PageOrder: Ascend -%%BoundingBox: 0 0 596 842 %%DocumentFonts: Times-Roman -%%DocumentPaperSizes: a4 %%EndComments %%BeginProcSet: PStoPS 1 15 userdict begin [/showpage/erasepage/copypage]{dup where{pop dup load - type/operatortype eq{1 array cvx dup 0 3 index cvx put - bind def}{pop}ifelse}{pop}ifelse}forall + type/operatortype eq{ /PStoPSenablepage cvx 1 index load 1 array astore cvx {} bind /ifelse cvx 4 array astore cvx def}{pop}ifelse}{pop}ifelse}forall /PStoPSenablepage true def [/letter/legal/executivepage/a4/a4small/b5/com10envelope /monarchenvelope/c5envelope/dlenvelope/lettersmall/note /folio/quarto/a5]{dup where{dup wcheck{exch{}put} @@ -277,11 +276,11 @@ userdict/PStoPSxform PStoPSmatrix matrix currentmatrix %%Page: (0) 1 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 15 4 bop 330 423 a Fb(5)2834 b(5)1622 3275 @@ -290,11 +289,11 @@ PStoPSsaved restore %%Page: (1) 2 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 16 5 bop 330 419 a Fb(6)2834 b(6)1622 3264 @@ -303,11 +302,11 @@ PStoPSsaved restore %%Page: (2) 3 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 17 6 bop 330 419 a Fb(7)2834 b(7)1622 3266 @@ -316,11 +315,11 @@ PStoPSsaved restore %%Page: (3) 4 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 18 7 bop 330 419 a Fb(8)2834 b(8)1622 3264 @@ -329,11 +328,11 @@ PStoPSsaved restore %%Page: (4) 5 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 19 8 bop 330 419 a Fb(9)2834 b(9)1622 3261 @@ -342,11 +341,11 @@ PStoPSsaved restore %%Page: (5) 6 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 20 9 bop 330 419 a Fb(10)2668 b(10)1415 @@ -355,11 +354,11 @@ PStoPSsaved restore %%Page: (6) 7 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 21 10 bop 330 419 a Fb(11)2668 b(11)1415 @@ -368,11 +367,11 @@ PStoPSsaved restore %%Page: (7) 8 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 22 11 bop 330 419 a Fb(12)2668 b(12)1415 @@ -381,11 +380,11 @@ PStoPSsaved restore %%Page: (8) 9 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 23 12 bop 330 419 a Fb(13)2668 b(13)1415 @@ -394,11 +393,11 @@ PStoPSsaved restore %%Page: (9) 10 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 24 13 bop 330 419 a Fb(14)2668 b(14)1415 @@ -407,11 +406,11 @@ PStoPSsaved restore %%Page: (10) 11 userdict/PStoPSsaved save put PStoPSmatrix setmatrix -0.271378 0.000000 translate -0.706651 dup scale +0.000000 0.971879 translate +0.704762 dup scale userdict/PStoPSmatrix matrix currentmatrix put userdict/PStoPSclip{0 0 moveto - 595.768067 0 rlineto 0 842.000000 rlineto -595.768067 0 rlineto + 595.275591 0 rlineto 0 844.647799 rlineto -595.275591 0 rlineto closepath}put initclip PStoPSxform concat TeXDict begin 25 14 bop 330 423 a Fb(15)2668 b(15)1415 diff --git a/Build/source/utils/psutils/version.ac b/Build/source/utils/psutils/version.ac new file mode 100644 index 00000000000..43e11b6bf7d --- /dev/null +++ b/Build/source/utils/psutils/version.ac @@ -0,0 +1,11 @@ +dnl +dnl Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org> +dnl +dnl This file is free software; the copyright holder +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl +dnl -------------------------------------------------------- +dnl +dnl m4-include this file to define the current psutils version +m4_define([psutils_version], [1.21]) |