summaryrefslogtreecommitdiff
path: root/src/cups
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2011-05-03 10:28:02 +0100
committerRoger Leigh <rleigh@debian.org>2011-05-03 10:28:02 +0100
commit15578e218035547ca17e25ef351fbe56bc55a4ae (patch)
tree06a97de2b9f0d9e04ee05d5ff806ef7c53a2003e /src/cups
parent4bc88c4aa9026d5c679008a4dbbb8ec4d9a901bd (diff)
Imported Upstream version 5.2.7
Diffstat (limited to 'src/cups')
-rw-r--r--src/cups/Makefile.am45
-rw-r--r--src/cups/Makefile.in521
-rw-r--r--src/cups/genppd.c1994
-rw-r--r--src/cups/rastertoprinter.c6
-rwxr-xr-xsrc/cups/test-ppds21
5 files changed, 1473 insertions, 1114 deletions
diff --git a/src/cups/Makefile.am b/src/cups/Makefile.am
index bebc47f..f395aa0 100644
--- a/src/cups/Makefile.am
+++ b/src/cups/Makefile.am
@@ -1,4 +1,4 @@
-## $Id: Makefile.am,v 1.119 2009/04/11 16:16:20 rlk Exp $
+## $Id: Makefile.am,v 1.120 2011/01/17 23:20:51 rlk Exp $
## Copyright (C) 2000 Roger Leigh
##
## This program is free software; you can redistribute it and/or modify
@@ -45,7 +45,9 @@ endif
LOCAL_CPPFLAGS = $(GUTENPRINT_CFLAGS) $(CUPS_CFLAGS)
-STP_ENV= STP_MODULE_PATH=$(top_builddir)/src/main/.libs:$(top_builddir)/src/main STP_DATA_PATH=$(top_srcdir)/src/xml STP_LOCALEDIR=$(top_srcdir)/src/cups/catalog
+STP_NONLS_ENV= STP_MODULE_PATH=$(top_builddir)/src/main/.libs:$(top_builddir)/src/main STP_DATA_PATH=$(top_srcdir)/src/xml
+
+STP_ENV= $(STP_NONLS_ENV) STP_LOCALEDIR=$(top_srcdir)/src/cups/catalog
## Programs
@@ -175,7 +177,7 @@ install-data-hook:
-rmdir `dirname $(DESTDIR)$(pkglibdir)`
-rmdir `dirname $(DESTDIR)$(pkgsysconfdir)`
-.PHONY: ppd ppd-stamp-pre ppd-stamp-nonls ppd-stamp-nls ppd-stamp-phony
+.PHONY: ppd ppd-stamp-pre ppd-stamp-nonls ppd-stamp-nls ppd-stamp-phony ppd-catalog-clean ppd-clean
all-local: $(INSTALL_DATA_LOCAL_DEPS)
@@ -188,10 +190,15 @@ ppd-stamp: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ $(t
ppd-stamp-phony: $(PPD)
-ppd-stamp-pre:
+ppd-catalog-clean:
+ -$(RM) -r catalog
+
+ppd-clean:
-$(RM) -r ppd
-ppd-catalog:
+ppd-stamp-pre: ppd-catalog-clean ppd-clean
+
+ppd-catalog: ppd-catalog-clean
$(mkdir_p) catalog
for file in $(srcdir)/../../po/*.po; do \
lang=`basename $$file .po`; \
@@ -201,28 +208,32 @@ ppd-catalog:
ppd-nonls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
$(mkdir_p) ppd/C
- LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -l C -p ppd/C
+ $(MAKE) ppd-catalog-clean
+ LC_ALL= LANG= LANGUAGE= $(STP_NONLS_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -l C -p ppd/C
-ppd-global: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ ppd-catalog
- $(mkdir_p) ppd/Global
+ppd-global: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
@echo "Global PPDs:"
+ $(mkdir_p) ppd/Global
+ $(MAKE) ppd-catalog
LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -p ppd/Global
- -$(RM) -r catalog
+ $(MAKE) ppd-catalog-clean
-ppd-global-ln: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ ppd-catalog
- $(mkdir_p) ppd/Global
+ppd-global-ln: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
@echo "Global PPDs (localized numbers for testing):"
+ $(mkdir_p) ppd/Global
+ $(MAKE) ppd-catalog
LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -p ppd/Global -N
- -$(RM) -r catalog
+ $(MAKE) ppd-catalog-clean
-ppd-nls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ ppd-catalog ppd-nonls
+ppd-nls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ ppd-nonls
$(mkdir_p) ppd
+ $(MAKE) ppd-catalog
for language in `$(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ -L` ; do \
mkdir ppd/$$language ; \
echo "$$language:" ; \
LC_ALL=$$language LANG=$$language LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -l $$language -p ppd/$$language; \
done
- -$(RM) -r catalog
+ $(MAKE) ppd-catalog-clean
dist-hook:
for dir in commands ; do \
@@ -236,8 +247,7 @@ dist-hook:
fi \
done
-clean-local:
- -$(RM) -r ppd
+clean-local: ppd-catalog-clean ppd-clean
## Clean
@@ -253,6 +263,3 @@ EXTRA_DIST = \
command.txt \
command.types \
test-ppds
-
-
-
diff --git a/src/cups/Makefile.in b/src/cups/Makefile.in
index 29ce8e8..50a1c36 100644
--- a/src/cups/Makefile.in
+++ b/src/cups/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -23,6 +24,7 @@
VPATH = @srcdir@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -66,15 +68,12 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = Info.plist cups-genppdupdate \
test-rastertogutenprint
+CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(cupsexec_driverdir)" \
"$(DESTDIR)$(cupsexec_filterdir)" "$(DESTDIR)$(sbindir)" \
"$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkgdatadir)" \
"$(DESTDIR)$(pkgsysconfdir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-cupsexec_driverPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-cupsexec_filterPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS) $(cupsexec_driver_PROGRAMS) \
$(cupsexec_filter_PROGRAMS) $(sbin_PROGRAMS)
am_commandtocanon_OBJECTS = commandtocanon.$(OBJEXT)
@@ -121,11 +120,32 @@ rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LINK =
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS) \
$(LDFLAGS) -o $@
-sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
SCRIPTS = $(noinst_SCRIPTS) $(sbin_SCRIPTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp
am__depfiles_maybe = depfiles
+am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -145,17 +165,11 @@ DIST_SOURCES = $(commandtocanon_SOURCES) $(commandtoepson_SOURCES) \
$(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) \
$(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) \
$(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES)
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-pkgdataDATA_INSTALL = $(INSTALL_DATA)
-pkgsysconfDATA_INSTALL = $(INSTALL_DATA)
DATA = $(pkgdata_DATA) $(pkgsysconf_DATA)
ETAGS = etags
CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = $(cups_conf_datadir)
pkglibdir = $(cups_conf_serverbin)
@@ -276,6 +290,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
@@ -375,7 +390,8 @@ cupsexec_filterdir = $(pkglibdir)/filter
@CUPS_PPDS_AT_TOP_LEVEL_TRUE@cups_modeldir = $(pkgdatadir)/model/
@CUPS_PPDS_AT_TOP_LEVEL_TRUE@DONT_UNINSTALL_PPDS = true
LOCAL_CPPFLAGS = $(GUTENPRINT_CFLAGS) $(CUPS_CFLAGS)
-STP_ENV = STP_MODULE_PATH=$(top_builddir)/src/main/.libs:$(top_builddir)/src/main STP_DATA_PATH=$(top_srcdir)/src/xml STP_LOCALEDIR=$(top_srcdir)/src/cups/catalog
+STP_NONLS_ENV = STP_MODULE_PATH=$(top_builddir)/src/main/.libs:$(top_builddir)/src/main STP_DATA_PATH=$(top_srcdir)/src/xml
+STP_ENV = $(STP_NONLS_ENV) STP_LOCALEDIR=$(top_srcdir)/src/cups/catalog
@BUILD_GLOBALIZED_CUPS_PPDS_FALSE@@BUILD_TRANSLATED_CUPS_PPDS_TRUE@PPD = $(PPD_NLS_1)
@BUILD_GLOBALIZED_CUPS_PPDS_TRUE@@BUILD_TRANSLATED_CUPS_PPDS_TRUE@PPD = ppd-global
@BUILD_TRANSLATED_CUPS_PPDS_FALSE@PPD = ppd-nonls
@@ -428,14 +444,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cups/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/cups/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cups/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/cups/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -453,6 +469,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
Info.plist: $(top_builddir)/config.status $(srcdir)/Info.plist.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
cups-genppdupdate: $(top_builddir)/config.status $(srcdir)/cups-genppdupdate.in
@@ -462,115 +479,175 @@ test-rastertogutenprint: $(top_builddir)/config.status $(srcdir)/test-rastertogu
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
- else :; fi; \
- done
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ 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; \
+ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
install-cupsexec_driverPROGRAMS: $(cupsexec_driver_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(cupsexec_driverdir)" || $(MKDIR_P) "$(DESTDIR)$(cupsexec_driverdir)"
- @list='$(cupsexec_driver_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(cupsexec_driverPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(cupsexec_driverdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(cupsexec_driverPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(cupsexec_driverdir)/$$f" || exit 1; \
- else :; fi; \
- done
+ @list='$(cupsexec_driver_PROGRAMS)'; test -n "$(cupsexec_driverdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ 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; \
+ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(cupsexec_driverdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(cupsexec_driverdir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-cupsexec_driverPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(cupsexec_driver_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(cupsexec_driverdir)/$$f'"; \
- rm -f "$(DESTDIR)$(cupsexec_driverdir)/$$f"; \
- done
+ @list='$(cupsexec_driver_PROGRAMS)'; test -n "$(cupsexec_driverdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(cupsexec_driverdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(cupsexec_driverdir)" && rm -f $$files
clean-cupsexec_driverPROGRAMS:
- @list='$(cupsexec_driver_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(cupsexec_driver_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
install-cupsexec_filterPROGRAMS: $(cupsexec_filter_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(cupsexec_filterdir)" || $(MKDIR_P) "$(DESTDIR)$(cupsexec_filterdir)"
- @list='$(cupsexec_filter_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(cupsexec_filterPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(cupsexec_filterdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(cupsexec_filterPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(cupsexec_filterdir)/$$f" || exit 1; \
- else :; fi; \
- done
+ @list='$(cupsexec_filter_PROGRAMS)'; test -n "$(cupsexec_filterdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ 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; \
+ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(cupsexec_filterdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(cupsexec_filterdir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-cupsexec_filterPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(cupsexec_filter_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(cupsexec_filterdir)/$$f'"; \
- rm -f "$(DESTDIR)$(cupsexec_filterdir)/$$f"; \
- done
+ @list='$(cupsexec_filter_PROGRAMS)'; test -n "$(cupsexec_filterdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(cupsexec_filterdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(cupsexec_filterdir)" && rm -f $$files
clean-cupsexec_filterPROGRAMS:
- @list='$(cupsexec_filter_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(cupsexec_filter_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
- else :; fi; \
- done
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ 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; \
+ else { print "f", $$3 "/" $$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_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
- rm -f "$(DESTDIR)$(sbindir)/$$f"; \
- done
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
clean-sbinPROGRAMS:
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
commandtocanon$(EXEEXT): $(commandtocanon_OBJECTS) $(commandtocanon_DEPENDENCIES)
@rm -f commandtocanon$(EXEEXT)
$(LINK) $(commandtocanon_OBJECTS) $(commandtocanon_LDADD) $(LIBS)
@@ -592,22 +669,37 @@ rastertogutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT
install-sbinSCRIPTS: $(sbin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
- @list='$(sbin_SCRIPTS)'; for p in $$list; do \
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f $$d$$p; then \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
- $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \
- else :; fi; \
- done
+ 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)$(sbindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-sbinSCRIPTS:
@$(NORMAL_UNINSTALL)
- @list='$(sbin_SCRIPTS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
- rm -f "$(DESTDIR)$(sbindir)/$$f"; \
- done
+ @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -627,77 +719,77 @@ distclean-compile:
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o: genppd.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o -MD -MP -MF $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o `test -f 'genppd.c' || echo '$(srcdir)/'`genppd.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genppd.c' object='cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o `test -f 'genppd.c' || echo '$(srcdir)/'`genppd.c
cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj: genppd.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj -MD -MP -MF $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj `if test -f 'genppd.c'; then $(CYGPATH_W) 'genppd.c'; else $(CYGPATH_W) '$(srcdir)/genppd.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genppd.c' object='cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj `if test -f 'genppd.c'; then $(CYGPATH_W) 'genppd.c'; else $(CYGPATH_W) '$(srcdir)/genppd.c'; fi`
cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.o: i18n.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.o -MD -MP -MF $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.o `test -f 'i18n.c' || echo '$(srcdir)/'`i18n.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='i18n.c' object='cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.o `test -f 'i18n.c' || echo '$(srcdir)/'`i18n.c
cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.obj: i18n.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.obj -MD -MP -MF $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.obj `if test -f 'i18n.c'; then $(CYGPATH_W) 'i18n.c'; else $(CYGPATH_W) '$(srcdir)/i18n.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo $(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='i18n.c' object='cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.obj `if test -f 'i18n.c'; then $(CYGPATH_W) 'i18n.c'; else $(CYGPATH_W) '$(srcdir)/i18n.c'; fi`
gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o: genppd.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o -MD -MP -MF $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o `test -f 'genppd.c' || echo '$(srcdir)/'`genppd.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genppd.c' object='gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o `test -f 'genppd.c' || echo '$(srcdir)/'`genppd.c
gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj: genppd.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj -MD -MP -MF $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj `if test -f 'genppd.c'; then $(CYGPATH_W) 'genppd.c'; else $(CYGPATH_W) '$(srcdir)/genppd.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genppd.c' object='gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj `if test -f 'genppd.c'; then $(CYGPATH_W) 'genppd.c'; else $(CYGPATH_W) '$(srcdir)/genppd.c'; fi`
gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.o: i18n.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.o -MD -MP -MF $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.o `test -f 'i18n.c' || echo '$(srcdir)/'`i18n.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='i18n.c' object='gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.o `test -f 'i18n.c' || echo '$(srcdir)/'`i18n.c
gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.obj: i18n.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.obj -MD -MP -MF $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.obj `if test -f 'i18n.c'; then $(CYGPATH_W) 'i18n.c'; else $(CYGPATH_W) '$(srcdir)/i18n.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Tpo $(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='i18n.c' object='gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-i18n.obj `if test -f 'i18n.c'; then $(CYGPATH_W) 'i18n.c'; else $(CYGPATH_W) '$(srcdir)/i18n.c'; fi`
@@ -710,51 +802,57 @@ clean-libtool:
install-pkgdataDATA: $(pkgdata_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
- @list='$(pkgdata_DATA)'; for p in $$list; do \
+ @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
- $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \
done
uninstall-pkgdataDATA:
@$(NORMAL_UNINSTALL)
- @list='$(pkgdata_DATA)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
- rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
- done
+ @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files
install-pkgsysconfDATA: $(pkgsysconf_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgsysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgsysconfdir)"
- @list='$(pkgsysconf_DATA)'; for p in $$list; do \
+ @list='$(pkgsysconf_DATA)'; test -n "$(pkgsysconfdir)" || list=; \
+ for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f=$(am__strip_dir) \
- echo " $(pkgsysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgsysconfdir)/$$f'"; \
- $(pkgsysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgsysconfdir)/$$f"; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgsysconfdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgsysconfdir)" || exit $$?; \
done
uninstall-pkgsysconfDATA:
@$(NORMAL_UNINSTALL)
- @list='$(pkgsysconf_DATA)'; for p in $$list; do \
- f=$(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(pkgsysconfdir)/$$f'"; \
- rm -f "$(DESTDIR)$(pkgsysconfdir)/$$f"; \
- done
+ @list='$(pkgsysconf_DATA)'; test -n "$(pkgsysconfdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(pkgsysconfdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(pkgsysconfdir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
@@ -762,37 +860,43 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
- @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list=' $(TESTS) '; \
+ $(am__tty_colors); \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
@@ -801,49 +905,63 @@ check-TESTS: $(TESTS)
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
- *$$ws$$tst$$ws*) \
+ *[\ \ ]$$tst[\ \ ]*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
- echo "XPASS: $$tst"; \
+ col=$$red; res=XPASS; \
;; \
*) \
- echo "PASS: $$tst"; \
+ col=$$grn; res=PASS; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
- *$$ws$$tst$$ws*) \
+ *[\ \ ]$$tst[\ \ ]*) \
xfail=`expr $$xfail + 1`; \
- echo "XFAIL: $$tst"; \
+ col=$$lgn; res=XFAIL; \
;; \
*) \
failed=`expr $$failed + 1`; \
- echo "FAIL: $$tst"; \
+ col=$$red; res=FAIL; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
- echo "SKIP: $$tst"; \
+ col=$$blu; res=SKIP; \
fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
- banner="All $$all tests passed"; \
+ banner="$$All$$all $$tests passed"; \
else \
- banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
- banner="$$failed of $$all tests failed"; \
+ banner="$$failed of $$all $$tests failed"; \
else \
- banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
- skipped="($$skip tests were not run)"; \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
@@ -854,11 +972,15 @@ check-TESTS: $(TESTS)
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
- echo "$$dashes"; \
+ if test "$$failed" -eq 0; then \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
- echo "$$dashes"; \
+ echo "$$dashes$$std"; \
test "$$failed" -eq 0; \
else :; fi
@@ -878,13 +1000,17 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -920,6 +1046,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@@ -944,6 +1071,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -952,23 +1081,32 @@ install-data-am: install-data-local install-pkgdataDATA \
install-pkgsysconfDATA
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am: install-binPROGRAMS install-cupsexec_driverPROGRAMS \
install-cupsexec_filterPROGRAMS install-sbinPROGRAMS \
install-sbinSCRIPTS
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -994,7 +1132,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-cupsexec_driverPROGRAMS \
uninstall-pkgdataDATA uninstall-pkgsysconfDATA \
uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS
-.MAKE: install-am install-data-am install-strip
+.MAKE: check-am install-am install-data-am install-strip
.PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \
clean clean-binPROGRAMS clean-cupsexec_driverPROGRAMS \
@@ -1085,7 +1223,7 @@ install-data-hook:
-rmdir `dirname $(DESTDIR)$(pkglibdir)`
-rmdir `dirname $(DESTDIR)$(pkgsysconfdir)`
-.PHONY: ppd ppd-stamp-pre ppd-stamp-nonls ppd-stamp-nls ppd-stamp-phony
+.PHONY: ppd ppd-stamp-pre ppd-stamp-nonls ppd-stamp-nls ppd-stamp-phony ppd-catalog-clean ppd-clean
all-local: $(INSTALL_DATA_LOCAL_DEPS)
@@ -1098,10 +1236,15 @@ ppd-stamp: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ $(t
ppd-stamp-phony: $(PPD)
-ppd-stamp-pre:
+ppd-catalog-clean:
+ -$(RM) -r catalog
+
+ppd-clean:
-$(RM) -r ppd
-ppd-catalog:
+ppd-stamp-pre: ppd-catalog-clean ppd-clean
+
+ppd-catalog: ppd-catalog-clean
$(mkdir_p) catalog
for file in $(srcdir)/../../po/*.po; do \
lang=`basename $$file .po`; \
@@ -1111,28 +1254,32 @@ ppd-catalog:
ppd-nonls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
$(mkdir_p) ppd/C
- LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -l C -p ppd/C
+ $(MAKE) ppd-catalog-clean
+ LC_ALL= LANG= LANGUAGE= $(STP_NONLS_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -l C -p ppd/C
-ppd-global: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ ppd-catalog
- $(mkdir_p) ppd/Global
+ppd-global: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
@echo "Global PPDs:"
+ $(mkdir_p) ppd/Global
+ $(MAKE) ppd-catalog
LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -p ppd/Global
- -$(RM) -r catalog
+ $(MAKE) ppd-catalog-clean
-ppd-global-ln: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ ppd-catalog
- $(mkdir_p) ppd/Global
+ppd-global-ln: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
@echo "Global PPDs (localized numbers for testing):"
+ $(mkdir_p) ppd/Global
+ $(MAKE) ppd-catalog
LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -p ppd/Global -N
- -$(RM) -r catalog
+ $(MAKE) ppd-catalog-clean
-ppd-nls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ ppd-catalog ppd-nonls
+ppd-nls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ ppd-nonls
$(mkdir_p) ppd
+ $(MAKE) ppd-catalog
for language in `$(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ -L` ; do \
mkdir ppd/$$language ; \
echo "$$language:" ; \
LC_ALL=$$language LANG=$$language LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -l $$language -p ppd/$$language; \
done
- -$(RM) -r catalog
+ $(MAKE) ppd-catalog-clean
dist-hook:
for dir in commands ; do \
@@ -1146,8 +1293,8 @@ dist-hook:
fi \
done
-clean-local:
- -$(RM) -r ppd
+clean-local: ppd-catalog-clean ppd-clean
+
# 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.
.NOEXPORT:
diff --git a/src/cups/genppd.c b/src/cups/genppd.c
index 7568abf..4e85388 100644
--- a/src/cups/genppd.c
+++ b/src/cups/genppd.c
@@ -1,5 +1,5 @@
- /*
- * "$Id: genppd.c,v 1.179 2009/10/05 12:37:30 rlk Exp $"
+/*
+ * "$Id: genppd.c,v 1.186 2011/03/13 19:28:50 rlk Exp $"
*
* PPD file generation program for the CUPS drivers.
*
@@ -85,13 +85,21 @@ static const char *gzext = "";
* Some applications use the XxYdpi tags rather than the actual
* hardware resolutions to decide what resolution to print at. Some
* applications get very unhappy if the vertical resolution exceeds
- * a certain amount. Some of those applications even get very happy if
+ * a certain amount. Some of those applications even get very unhappy if
* the PPD file even contains a resolution that exceeds that limit.
+ * And they're not even free source applications.
* Feh.
*/
#define MAXIMUM_SAFE_PPD_Y_RESOLUTION (720)
#define MAXIMUM_SAFE_PPD_X_RESOLUTION (1500)
+typedef enum
+{
+ PPD_STANDARD = 0,
+ PPD_SIMPLIFIED = 1,
+ PPD_NO_COLOR_OPTS = 2
+} ppd_type_t;
+
/*
* Note:
*
@@ -166,7 +174,10 @@ static int list_ppds(const char *argv0);
#else /* !CUPS_DRIVER_INTERFACE */
static int generate_ppd(const char *prefix, int verbose,
const stp_printer_t *p, const char *language,
- int simplified);
+ ppd_type_t ppd_type);
+static int generate_model_ppds(const char *prefix, int verbose,
+ const stp_printer_t *printer,
+ const char *language, int which_ppds);
static void help(void);
static void printlangs(char** langs);
static void printmodels(int verbose);
@@ -184,7 +195,7 @@ static void print_group_open(gzFile fp, stp_parameter_class_t p_class,
const stp_string_list_t *po);
static int write_ppd(gzFile fp, const stp_printer_t *p,
const char *language, const char *ppd_location,
- int simplified);
+ ppd_type_t ppd_type, const char *filename);
/*
@@ -288,7 +299,8 @@ cat_ppd(const char *uri) /* I - Driver URI */
char *s;
char filename[1024], /* Filename */
ppd_location[1024]; /* Installed location */
-
+ const char *infix = "";
+ ppd_type_t ppd_type = PPD_STANDARD;
if ((status = httpSeparateURI(HTTP_URI_CODING_ALL, uri,
scheme, sizeof(scheme),
@@ -320,23 +332,32 @@ cat_ppd(const char *uri) /* I - Driver URI */
return (1);
}
+ if (strcmp(resource + 1, "simple") == 0)
+ {
+ infix = ".sim";
+ ppd_type = PPD_SIMPLIFIED;
+ }
+ else if (strcmp(resource + 1, "nocolor") == 0)
+ {
+ infix = ".nc";
+ ppd_type = PPD_NO_COLOR_OPTS;
+ }
+
/*
* This isn't really the right thing to do. We really shouldn't
* be embedding filenames in automatically generated PPD files, but
* if the user ever decides to go back from generated PPD files to
* static PPD files we'll need to have this for genppdupdate to work.
*/
- snprintf(filename, sizeof(filename) - 1, "%s/stp-%s.%s%s%s%s",
- "ppd", hostname, GUTENPRINT_RELEASE_VERSION,
- strcmp(resource + 1, "simple") ? "" : ".sim", ppdext, gzext);
- snprintf(ppd_location, sizeof(ppd_location) - 1, "%s%s%s/%s",
+ snprintf(filename, sizeof(filename) - 1, "stp-%s.%s%s%s",
+ hostname, GUTENPRINT_RELEASE_VERSION, infix, ppdext);
+ snprintf(ppd_location, sizeof(ppd_location) - 1, "%s%s%s/ppd/%s%s",
cups_modeldir,
cups_modeldir[strlen(cups_modeldir) - 1] == '/' ? "" : "/",
lang ? lang : "C",
- filename);
+ filename, gzext);
- return (write_ppd(stdout, p, lang, ppd_location,
- !strcmp(resource + 1, "simple")));
+ return (write_ppd(stdout, p, lang, ppd_location, ppd_type, filename));
}
/*
@@ -387,6 +408,19 @@ list_ppds(const char *argv0) /* I - Name of program */
stp_printer_get_long_name(printer),
device_id ? device_id : "");
#endif
+
+#ifdef GENERATE_NOCOLOR_PPDS
+ printf("\"%s://%s/nocolor\" "
+ "%s "
+ "\"%s\" "
+ "\"%s" CUPS_PPD_NICKNAME_STRING VERSION " No color options\" "
+ "\"%s\"\n",
+ scheme, stp_printer_get_driver(printer),
+ "en",
+ stp_printer_get_manufacturer(printer),
+ stp_printer_get_long_name(printer),
+ device_id ? device_id : "");
+#endif
}
return (0);
@@ -412,7 +446,8 @@ main(int argc, /* I - Number of command-line arguments */
char **models = NULL; /* Models to output, all if NULL */
int opt_printlangs = 0; /* Print available translations */
int opt_printmodels = 0;/* Print available models */
- int which_ppds = 2; /* Simplified PPD's = 1, full = 2 */
+ int which_ppds = 2; /* Simplified PPD's = 1, full = 2,
+ no color opts = 4 */
/*
* Parse command-line args...
@@ -422,7 +457,7 @@ main(int argc, /* I - Number of command-line arguments */
for (;;)
{
- if ((i = getopt(argc, argv, "23hvqc:p:l:LMVd:saN")) == -1)
+ if ((i = getopt(argc, argv, "23hvqc:p:l:LMVd:saNC")) == -1)
break;
switch (i)
@@ -470,6 +505,9 @@ main(int argc, /* I - Number of command-line arguments */
case 'a':
which_ppds = 3;
break;
+ case 'C':
+ which_ppds |= 4;
+ break;
case 'N':
localize_numbers = !localize_numbers;
break;
@@ -548,12 +586,9 @@ main(int argc, /* I - Number of command-line arguments */
if (printer)
{
- if ((which_ppds & 1) &&
- generate_ppd(prefix, verbose, printer, language, 1))
- return (1);
- if ((which_ppds & 2) &&
- generate_ppd(prefix, verbose, printer, language, 0))
- return (1);
+ if (generate_model_ppds(prefix, verbose, printer, language,
+ which_ppds))
+ return 1;
}
else
{
@@ -571,12 +606,9 @@ main(int argc, /* I - Number of command-line arguments */
if (printer)
{
- if ((which_ppds & 1) &&
- generate_ppd(prefix, verbose, printer, language, 1))
- return (1);
- if ((which_ppds & 2) &&
- generate_ppd(prefix, verbose, printer, language, 0))
- return (1);
+ if (generate_model_ppds(prefix, verbose, printer, language,
+ which_ppds))
+ return 1;
}
}
}
@@ -586,6 +618,23 @@ main(int argc, /* I - Number of command-line arguments */
return (0);
}
+static int
+generate_model_ppds(const char *prefix, int verbose,
+ const stp_printer_t *printer, const char *language,
+ int which_ppds)
+{
+ if ((which_ppds & 1) &&
+ generate_ppd(prefix, verbose, printer, language, PPD_SIMPLIFIED))
+ return (1);
+ if ((which_ppds & 2) &&
+ generate_ppd(prefix, verbose, printer, language, PPD_STANDARD))
+ return (1);
+ if ((which_ppds & 4) &&
+ generate_ppd(prefix, verbose, printer, language, PPD_NO_COLOR_OPTS))
+ return (1);
+ return 0;
+}
+
/*
* 'generate_ppd()' - Generate a PPD file.
*/
@@ -596,14 +645,14 @@ generate_ppd(
int verbose, /* I - Verbosity level */
const stp_printer_t *p, /* I - Driver */
const char *language, /* I - Primary language */
- int simplified) /* I - 1 = simplified options */
+ ppd_type_t ppd_type) /* I - full, simplified, no color */
{
int status; /* Exit status */
gzFile fp; /* File to write to */
char filename[1024], /* Filename */
ppd_location[1024]; /* Installed location */
struct stat dir; /* Prefix dir status */
-
+ const char *ppd_infix;
/*
* Skip the PostScript drivers...
@@ -638,9 +687,21 @@ generate_ppd(
* stp-escp2-ex.5.0.ppd.gz
*/
+ switch (ppd_type)
+ {
+ case PPD_SIMPLIFIED:
+ ppd_infix = ".sim";
+ break;
+ case PPD_NO_COLOR_OPTS:
+ ppd_infix = ".nc";
+ break;
+ default:
+ ppd_infix = "";
+ }
+
snprintf(filename, sizeof(filename) - 1, "%s/stp-%s.%s%s%s%s",
prefix, stp_printer_get_driver(p), GUTENPRINT_RELEASE_VERSION,
- simplified ? ".sim" : "", ppdext, gzext);
+ ppd_infix, ppdext, gzext);
/*
* Open the PPD file...
@@ -664,7 +725,12 @@ generate_ppd(
language ? language : "C",
basename(filename));
- status = write_ppd(fp, p, language, ppd_location, simplified);
+ snprintf(filename, sizeof(filename) - 1, "stp-%s.%s%s%s",
+ stp_printer_get_driver(p), GUTENPRINT_RELEASE_VERSION,
+ ppd_infix, ppdext);
+
+ status = write_ppd(fp, p, language, ppd_location, ppd_type,
+ basename(filename));
gzclose(fp);
@@ -821,6 +887,12 @@ is_special_option(const char *name) /* I - Option name */
return 0;
}
+/*
+ * strlen returns the number of characters. PPD file limitations are
+ * defined in bytes. So we need something to count bytes, not merely
+ * characters.
+ */
+
static size_t
bytelen(const char *buffer)
{
@@ -830,150 +902,31 @@ bytelen(const char *buffer)
return answer;
}
-static void
-print_group(
- gzFile fp, /* I - File to write to */
- const char *what,
- stp_parameter_class_t p_class, /* I - Option class */
- stp_parameter_level_t p_level, /* I - Option level */
- const char *language, /* I - Language */
- const stp_string_list_t *po) /* I - Message catalog */
-{
- char buf[64];
- const char *class = stp_i18n_lookup(po, parameter_class_names[p_class]);
- const char *level = stp_i18n_lookup(po, parameter_level_names[p_level]);
- size_t bytes = bytelen(class) + bytelen(level);
- snprintf(buf, 40, "%s%s%s", class, bytes < 39 ? " " : "", level);
- gzprintf(fp, "*%sGroup: C%dL%d/%s\n", what, p_class, p_level, buf);
- if (language && !strcmp(language, "C") && !strcmp(what, "Open"))
- {
- char **all_langs = getlangs();/* All languages */
- const char *lang;
- int langnum;
-
- for (langnum = 0; all_langs[langnum]; langnum ++)
- {
- const stp_string_list_t *altpo;
-
- lang = all_langs[langnum];
-
- if (!strcmp(lang, "C") || !strcmp(lang, "en"))
- continue;
- if ((altpo = stp_i18n_load(lang)) != NULL)
- {
- class = stp_i18n_lookup(altpo, parameter_class_names[p_class]);
- level = stp_i18n_lookup(altpo, parameter_level_names[p_level]);
- bytes = bytelen(class) + bytelen(level);
- snprintf(buf, 40, "%s%s%s", class, bytes < 39 ? " " : "", level);
- gzprintf(fp, "*%s.Translation C%dL%d/%s: \"\"\n",
- lang, p_class, p_level, buf);
- }
- }
- }
- gzputs(fp, "\n");
-}
-
/*
- * 'print_group_close()' - Close a UI group.
+ * Use our localization routine to correctly do localization on all
+ * systems. The standard lookup routine has trouble creating multi-locale
+ * files on many systems, and on some systems there's not even a reliable
+ * way to use something other than the system locale.
*/
+#ifdef _
+#undef _
+#endif
+#define _(x) stp_i18n_lookup(po, x)
-static void
-print_group_close(
- gzFile fp, /* I - File to write to */
- stp_parameter_class_t p_class, /* I - Option class */
- stp_parameter_level_t p_level, /* I - Option level */
- const char *language, /* I - language */
- const stp_string_list_t *po) /* I - Message catalog */
-{
- print_group(fp, "Close", p_class, p_level, NULL, NULL);
-}
-
-
-/*
- * 'print_group_open()' - Open a new UI group.
- */
+#define PPD_MAX_SHORT_NICKNAME (31)
static void
-print_group_open(
- gzFile fp, /* I - File to write to */
- stp_parameter_class_t p_class, /* I - Option class */
- stp_parameter_level_t p_level, /* I - Option level */
- const char *language, /* I - language */
- const stp_string_list_t *po) /* I - Message catalog */
+print_ppd_header(gzFile fp, ppd_type_t ppd_type, int model, const char *driver,
+ const char *family, const char *long_name,
+ const char *manufacturer, const char *device_id,
+ const char *ppd_location,
+ const char *language, const stp_string_list_t *po,
+ char **all_langs)
{
- print_group(fp, "Open", p_class, p_level, language ? language : "C", po);
-}
-
-
-/*
- * 'write_ppd()' - Write a PPD file.
- */
-
-int /* O - Exit status */
-write_ppd(
- gzFile fp, /* I - File to write to */
- const stp_printer_t *p, /* I - Printer driver */
- const char *language, /* I - Primary language */
- const char *ppd_location, /* I - Location of PPD file */
- int simplified) /* I - 1 = simplified options */
-{
- int i, j, k, l; /* Looping vars */
- int num_opts; /* Number of printer options */
- int xdpi, ydpi; /* Resolution info */
- stp_vars_t *v; /* Variable info */
- int width, height, /* Page information */
- bottom, left,
- top, right;
- const char *driver; /* Driver name */
- const char *family; /* Printer family */
- int model; /* Internal model ID */
- const char *long_name; /* Driver long name */
- const char *manufacturer; /* Manufacturer of printer */
- const char *device_id; /* IEEE1284 device ID */
- const stp_vars_t *printvars; /* Printer option names */
- paper_t *the_papers; /* Media sizes */
- int cur_opt; /* Current option */
- int variable_sizes; /* Does the driver support variable sizes? */
- int min_width, /* Min/max custom size */
- min_height,
- max_width,
- max_height;
- char dimstr[255]; /* Dimension string */
- stp_parameter_t desc;
- stp_parameter_list_t param_list;
- const stp_param_string_t *opt;
- int has_quality_parameter = 0;
- int printer_is_color = 0;
- int maximum_level = simplified ?
- STP_PARAMETER_LEVEL_BASIC : STP_PARAMETER_LEVEL_ADVANCED4;
- char *default_resolution = NULL; /* Default resolution mapped name */
- stp_string_list_t *resolutions = stp_string_list_create();
- char **all_langs = getlangs();/* All languages */
- const stp_string_list_t *po = stp_i18n_load(language);
- /* Message catalog */
-
-
- /*
- * Initialize driver-specific variables...
- */
-
- driver = stp_printer_get_driver(p);
- family = stp_printer_get_family(p);
- model = stp_printer_get_model(p);
- long_name = stp_printer_get_long_name(p);
- manufacturer = stp_printer_get_manufacturer(p);
- device_id = stp_printer_get_device_id(p);
- printvars = stp_printer_get_defaults(p);
- the_papers = NULL;
- cur_opt = 0;
-
+ char short_long_name[(PPD_MAX_SHORT_NICKNAME) + 1];
/*
* Write a standard header...
*/
-
-#undef _
-#define _(x) stp_i18n_lookup(po, x)
-
gzputs(fp, "*PPD-Adobe: \"4.3\"\n");
gzputs(fp, "*% PPD file for CUPS/Gutenprint.\n");
gzputs(fp, "*% Copyright 1993-2008 by Mike Sweet and Robert Krawitz.\n");
@@ -1001,7 +954,6 @@ write_ppd(
gzputs(fp, "*LanguageEncoding: UTF-8\n");
else
gzputs(fp, "*LanguageEncoding: ISOLatin1\n");
-
/*
* Strictly speaking, the PCFileName attribute should be a 12 character
* max (12345678.ppd) filename, as a requirement of the old PPD spec.
@@ -1011,7 +963,7 @@ write_ppd(
gzprintf(fp, "*PCFileName: \"STP%05d.PPD\"\n",
stp_get_printer_index_by_driver(driver) +
- simplified ? stp_printer_model_count() : 0);
+ ((int) ppd_type * stp_printer_model_count()));
gzprintf(fp, "*Manufacturer: \"%s\"\n", manufacturer);
/*
@@ -1031,7 +983,9 @@ write_ppd(
*/
gzprintf(fp, "*ModelName: \"%s\"\n", long_name);
- gzprintf(fp, "*ShortNickName: \"%s\"\n", long_name);
+ strncpy(short_long_name, long_name, PPD_MAX_SHORT_NICKNAME);
+ short_long_name[PPD_MAX_SHORT_NICKNAME] = '\0';
+ gzprintf(fp, "*ShortNickName: \"%s\"\n", short_long_name);
/*
* The Windows driver download stuff has problems with NickName fields
@@ -1045,37 +999,24 @@ write_ppd(
*/
gzprintf(fp, "*NickName: \"%s%s%s%s\"\n",
long_name, CUPS_PPD_NICKNAME_STRING, VERSION,
- simplified ? " Simplified" : "");
+ (ppd_type == PPD_SIMPLIFIED ? " Simplified" :
+ ppd_type == PPD_NO_COLOR_OPTS ? " No Color Options" : ""));
if (cups_ppd_ps_level == 2)
gzputs(fp, "*PSVersion: \"(2017.000) 550\"\n");
else
gzputs(fp, "*PSVersion: \"(3010.000) 0\"\n");
gzprintf(fp, "*LanguageLevel: \"%d\"\n", cups_ppd_ps_level);
+}
- /* Set Job Mode to "Job" as this enables the Duplex option */
- v = stp_vars_create_copy(printvars);
- stp_set_string_parameter(v, "JobMode", "Job");
-
- /* Assume that color printers are inkjets and should have pages reversed */
- stp_describe_parameter(v, "PrintingMode", &desc);
- if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
- {
- if (stp_string_list_is_present(desc.bounds.str, "Color"))
- {
- printer_is_color = 1;
- gzputs(fp, "*ColorDevice: True\n");
- }
- else
- {
- printer_is_color = 0;
- gzputs(fp, "*ColorDevice: False\n");
- }
- if (strcmp(desc.deflt.str, "Color") == 0)
- gzputs(fp, "*DefaultColorSpace: RGB\n");
- else
- gzputs(fp, "*DefaultColorSpace: Gray\n");
- }
- stp_parameter_description_destroy(&desc);
+static void
+print_ppd_header_3(gzFile fp, ppd_type_t ppd_type, int model, const char *driver,
+ const char *family, const char *long_name,
+ const char *manufacturer, const char *device_id,
+ const char *ppd_location,
+ const char *language, const stp_string_list_t *po,
+ char **all_langs)
+{
+ int i;
gzputs(fp, "*FileSystem: False\n");
gzputs(fp, "*LandscapeOrientation: Plus90\n");
gzputs(fp, "*TTRasterizer: Type42\n");
@@ -1107,96 +1048,108 @@ write_ppd(
if (!strcmp(prefix, " "))
gzputs(fp, "\"\n");
}
+}
- /* Macintosh color management */
- gzputs(fp, "*cupsICCProfile Gray../Grayscale: \"/System/Library/ColorSync/Profiles/sRGB Profile.icc\"\n");
- gzputs(fp, "*cupsICCProfile RGB../Color: \"/System/Library/ColorSync/Profiles/sRGB Profile.icc\"\n");
- gzputs(fp, "*cupsICCProfile CMYK../Color: \"/System/Library/ColorSync/Profiles/Generic CMYK Profile.icc\"\n");
- gzputs(fp, "*APSupportsCustomColorMatching: true\n");
- gzputs(fp, "*APCustomColorMatchingProfile: sRGB\n");
-
- gzputs(fp, "\n");
+static void
+print_ppd_header_2(gzFile fp, ppd_type_t ppd_type, int model, const char *driver,
+ const char *family, const char *long_name,
+ const char *manufacturer, const char *device_id,
+ const char *ppd_location,
+ const char *language, const stp_string_list_t *po,
+ char **all_langs)
+{
gzprintf(fp, "*StpDriverName: \"%s\"\n", driver);
gzprintf(fp, "*StpDriverModelFamily: \"%d_%s\"\n", model, family);
gzprintf(fp, "*StpPPDLocation: \"%s\"\n", ppd_location);
gzprintf(fp, "*StpLocale: \"%s\"\n", language ? language : "C");
+}
- /*
- * Get the page sizes from the driver...
- */
+static void
+print_page_sizes(gzFile fp, stp_vars_t *v, int simplified,
+ const stp_string_list_t *po)
+{
+ int variable_sizes = 0;
+ stp_parameter_t desc;
+ int num_opts;
+ paper_t *the_papers;
+ int i;
+ int width, height, /* Page information */
+ bottom, left,
+ top, right;
+ int min_width, /* Min/max custom size */
+ min_height,
+ max_width,
+ max_height;
+ const stp_param_string_t *opt;
+ int cur_opt = 0;
- if (printer_is_color)
- stp_set_string_parameter(v, "PrintingMode", "Color");
- else
- stp_set_string_parameter(v, "PrintingMode", "BW");
- stp_set_string_parameter(v, "ChannelBitDepth", "8");
- variable_sizes = 0;
stp_describe_parameter(v, "PageSize", &desc);
num_opts = stp_string_list_count(desc.bounds.str);
the_papers = stp_malloc(sizeof(paper_t) * num_opts);
-
for (i = 0; i < num_opts; i++)
- {
- const stp_papersize_t *papersize;
- opt = stp_string_list_param(desc.bounds.str, i);
- papersize = stp_get_papersize_by_name(opt->name);
-
- if (!papersize)
{
- printf("Unable to lookup size %s!\n", opt->name);
- continue;
- }
+ const stp_papersize_t *papersize;
+ opt = stp_string_list_param(desc.bounds.str, i);
+ papersize = stp_get_papersize_by_name(opt->name);
- if (strcmp(opt->name, "Custom") == 0)
- {
- variable_sizes = 1;
- continue;
+ if (!papersize)
+ {
+ printf("Unable to lookup size %s!\n", opt->name);
+ continue;
+ }
+
+ if (strcmp(opt->name, "Custom") == 0)
+ {
+ variable_sizes = 1;
+ continue;
+ }
+ if (simplified && num_opts >= 10 &&
+ (papersize->paper_unit == PAPERSIZE_ENGLISH_EXTENDED ||
+ papersize->paper_unit == PAPERSIZE_METRIC_EXTENDED))
+ continue;
+
+ width = papersize->width;
+ height = papersize->height;
+
+ if (width <= 0 || height <= 0)
+ continue;
+
+ stp_set_string_parameter(v, "PageSize", opt->name);
+
+ stp_get_media_size(v, &width, &height);
+ stp_get_maximum_imageable_area(v, &left, &right, &bottom, &top);
+
+ if (left < 0)
+ left = 0;
+ if (right > width)
+ right = width;
+ if (bottom > height)
+ bottom = height;
+ if (top < 0)
+ top = 0;
+
+ the_papers[cur_opt].name = opt->name;
+ the_papers[cur_opt].text = stp_i18n_lookup(po, opt->text);
+ the_papers[cur_opt].width = width;
+ the_papers[cur_opt].height = height;
+ the_papers[cur_opt].left = left;
+ the_papers[cur_opt].right = right;
+ the_papers[cur_opt].bottom = height - bottom;
+ the_papers[cur_opt].top = height - top;
+
+ cur_opt++;
+ stp_clear_string_parameter(v, "PageSize");
}
- if (simplified && num_opts >= 10 &&
- (papersize->paper_unit == PAPERSIZE_ENGLISH_EXTENDED ||
- papersize->paper_unit == PAPERSIZE_METRIC_EXTENDED))
- continue;
-
- width = papersize->width;
- height = papersize->height;
-
- if (width <= 0 || height <= 0)
- continue;
-
- stp_set_string_parameter(v, "PageSize", opt->name);
-
- stp_get_media_size(v, &width, &height);
- stp_get_maximum_imageable_area(v, &left, &right, &bottom, &top);
-
- if (left < 0)
- left = 0;
- if (right > width)
- right = width;
- if (bottom > height)
- bottom = height;
- if (top < 0)
- top = 0;
-
- the_papers[cur_opt].name = opt->name;
- the_papers[cur_opt].text = stp_i18n_lookup(po, opt->text);
- the_papers[cur_opt].width = width;
- the_papers[cur_opt].height = height;
- the_papers[cur_opt].left = left;
- the_papers[cur_opt].right = right;
- the_papers[cur_opt].bottom = height - bottom;
- the_papers[cur_opt].top = height - top;
-
- cur_opt++;
- stp_clear_string_parameter(v, "PageSize");
- }
- /*
- * The VariablePaperSize attribute is obsolete, however some popular
- * applications still look for it to provide custom page size support.
- */
+ /*
+ * The VariablePaperSize attribute is obsolete, however some popular
+ * applications still look for it to provide custom page size support.
+ */
gzprintf(fp, "*VariablePaperSize: %s\n\n", variable_sizes ? "true" : "false");
+ if (stp_parameter_has_category_value(v, &desc, "Color", "Yes"))
+ gzputs(fp, "*ColorKeyWords: \"PageSize\"\n");
gzprintf(fp, "*OpenUI *PageSize/%s: PickOne\n", _("Media Size"));
gzputs(fp, "*OPOptionHints PageSize: \"dropdown\"\n");
gzputs(fp, "*OrderDependency: 10 AnySetup *PageSize\n");
@@ -1206,86 +1159,90 @@ write_ppd(
gzprintf(fp, "*DefaultPageSize: %s\n", desc.deflt.str);
gzprintf(fp, "*StpDefaultPageSize: %s\n", desc.deflt.str);
for (i = 0; i < cur_opt; i ++)
- {
- gzprintf(fp, "*PageSize %s", the_papers[i].name);
- gzprintf(fp, "/%s:\t\"<</PageSize[%d %d]/ImagingBBox null>>setpagedevice\"\n",
- the_papers[i].text, the_papers[i].width, the_papers[i].height);
- }
+ {
+ gzprintf(fp, "*PageSize %s", the_papers[i].name);
+ gzprintf(fp, "/%s:\t\"<</PageSize[%d %d]/ImagingBBox null>>setpagedevice\"\n",
+ the_papers[i].text, the_papers[i].width, the_papers[i].height);
+ }
gzputs(fp, "*CloseUI: *PageSize\n\n");
+ if (stp_parameter_has_category_value(v, &desc, "Color", "Yes"))
+ gzputs(fp, "*ColorKeyWords: \"PageRegion\"\n");
gzprintf(fp, "*OpenUI *PageRegion/%s: PickOne\n", _("Media Size"));
gzputs(fp, "*OPOptionHints PageRegion: \"dropdown\"\n");
gzputs(fp, "*OrderDependency: 10 AnySetup *PageRegion\n");
gzprintf(fp, "*DefaultPageRegion: %s\n", desc.deflt.str);
gzprintf(fp, "*StpDefaultPageRegion: %s\n", desc.deflt.str);
for (i = 0; i < cur_opt; i ++)
- {
- gzprintf(fp, "*PageRegion %s", the_papers[i].name);
- gzprintf(fp, "/%s:\t\"<</PageSize[%d %d]/ImagingBBox null>>setpagedevice\"\n",
- the_papers[i].text, the_papers[i].width, the_papers[i].height);
- }
+ {
+ gzprintf(fp, "*PageRegion %s", the_papers[i].name);
+ gzprintf(fp, "/%s:\t\"<</PageSize[%d %d]/ImagingBBox null>>setpagedevice\"\n",
+ the_papers[i].text, the_papers[i].width, the_papers[i].height);
+ }
gzputs(fp, "*CloseUI: *PageRegion\n\n");
gzprintf(fp, "*DefaultImageableArea: %s\n", desc.deflt.str);
gzprintf(fp, "*StpDefaultImageableArea: %s\n", desc.deflt.str);
for (i = 0; i < cur_opt; i ++)
- {
- gzprintf(fp, "*ImageableArea %s", the_papers[i].name);
- gzprintf(fp, "/%s:\t\"%d %d %d %d\"\n", the_papers[i].text,
- the_papers[i].left, the_papers[i].bottom,
- the_papers[i].right, the_papers[i].top);
- }
+ {
+ gzprintf(fp, "*ImageableArea %s", the_papers[i].name);
+ gzprintf(fp, "/%s:\t\"%d %d %d %d\"\n", the_papers[i].text,
+ the_papers[i].left, the_papers[i].bottom,
+ the_papers[i].right, the_papers[i].top);
+ }
gzputs(fp, "\n");
gzprintf(fp, "*DefaultPaperDimension: %s\n", desc.deflt.str);
gzprintf(fp, "*StpDefaultPaperDimension: %s\n", desc.deflt.str);
for (i = 0; i < cur_opt; i ++)
- {
- gzprintf(fp, "*PaperDimension %s", the_papers[i].name);
- gzprintf(fp, "/%s:\t\"%d %d\"\n",
- the_papers[i].text, the_papers[i].width, the_papers[i].height);
- }
+ {
+ gzprintf(fp, "*PaperDimension %s", the_papers[i].name);
+ gzprintf(fp, "/%s:\t\"%d %d\"\n",
+ the_papers[i].text, the_papers[i].width, the_papers[i].height);
+ }
gzputs(fp, "\n");
if (variable_sizes)
- {
- stp_get_size_limit(v, &max_width, &max_height, &min_width, &min_height);
- stp_set_string_parameter(v, "PageSize", "Custom");
- stp_get_media_size(v, &width, &height);
- stp_get_maximum_imageable_area(v, &left, &right, &bottom, &top);
- if (left < 0)
- left = 0;
- if (top < 0)
- top = 0;
- if (bottom > height)
- bottom = height;
- if (right > width)
- width = right;
-
- gzprintf(fp, "*MaxMediaWidth: \"%d\"\n", max_width);
- gzprintf(fp, "*MaxMediaHeight: \"%d\"\n", max_height);
- gzprintf(fp, "*HWMargins: %d %d %d %d\n",
- left, height - bottom, width - right, top);
- gzputs(fp, "*CustomPageSize True: \"pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice\"\n");
- gzprintf(fp, "*ParamCustomPageSize Width: 1 points %d %d\n",
- min_width, max_width);
- gzprintf(fp, "*ParamCustomPageSize Height: 2 points %d %d\n",
- min_height, max_height);
- gzputs(fp, "*ParamCustomPageSize WidthOffset: 3 points 0 0\n");
- gzputs(fp, "*ParamCustomPageSize HeightOffset: 4 points 0 0\n");
- gzputs(fp, "*ParamCustomPageSize Orientation: 5 int 0 0\n\n");
- stp_clear_string_parameter(v, "PageSize");
- }
+ {
+ stp_get_size_limit(v, &max_width, &max_height, &min_width, &min_height);
+ stp_set_string_parameter(v, "PageSize", "Custom");
+ stp_get_media_size(v, &width, &height);
+ stp_get_maximum_imageable_area(v, &left, &right, &bottom, &top);
+ if (left < 0)
+ left = 0;
+ if (top < 0)
+ top = 0;
+ if (bottom > height)
+ bottom = height;
+ if (right > width)
+ width = right;
+
+ gzprintf(fp, "*MaxMediaWidth: \"%d\"\n", max_width);
+ gzprintf(fp, "*MaxMediaHeight: \"%d\"\n", max_height);
+ gzprintf(fp, "*HWMargins: %d %d %d %d\n",
+ left, height - bottom, width - right, top);
+ gzputs(fp, "*CustomPageSize True: \"pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice\"\n");
+ gzprintf(fp, "*ParamCustomPageSize Width: 1 points %d %d\n",
+ min_width, max_width);
+ gzprintf(fp, "*ParamCustomPageSize Height: 2 points %d %d\n",
+ min_height, max_height);
+ gzputs(fp, "*ParamCustomPageSize WidthOffset: 3 points 0 0\n");
+ gzputs(fp, "*ParamCustomPageSize HeightOffset: 4 points 0 0\n");
+ gzputs(fp, "*ParamCustomPageSize Orientation: 5 int 0 0\n\n");
+ stp_clear_string_parameter(v, "PageSize");
+ }
stp_parameter_description_destroy(&desc);
if (the_papers)
stp_free(the_papers);
+}
- /*
- * Do we support color?
- */
-
+static void
+print_color_setup(gzFile fp, int simplified, int printer_is_color,
+ const stp_string_list_t *po)
+{
+ gzputs(fp, "*ColorKeyWords: \"ColorModel\"\n");
gzprintf(fp, "*OpenUI *ColorModel/%s: PickOne\n", _("Color Model"));
gzputs(fp, "*OPOptionHints ColorModel: \"radiobuttons\"\n");
gzputs(fp, "*OrderDependency: 10 AnySetup *ColorModel\n");
@@ -1349,12 +1306,12 @@ write_ppd(
}
gzputs(fp, "*CloseUI: *ColorModel\n\n");
-
if (!simplified)
{
/*
* 8 or 16 bit color (16 bit is slower)
*/
+ gzputs(fp, "*ColorKeyWords: \"StpColorPrecision\"\n");
gzprintf(fp, "*OpenUI *StpColorPrecision/%s: PickOne\n", _("Color Precision"));
gzputs(fp, "*OPOptionHints StpColorPrecision: \"radiobuttons\"\n");
gzputs(fp, "*OrderDependency: 10 AnySetup *StpColorPrecision\n");
@@ -1367,6 +1324,585 @@ write_ppd(
"/cupsPreferredBitsPerColor 16>>setpagedevice\"\n", _("Best"));
gzputs(fp, "*CloseUI: *StpColorPrecision\n\n");
}
+}
+
+static void
+print_group(
+ gzFile fp, /* I - File to write to */
+ const char *what,
+ stp_parameter_class_t p_class, /* I - Option class */
+ stp_parameter_level_t p_level, /* I - Option level */
+ const char *language, /* I - Language */
+ const stp_string_list_t *po) /* I - Message catalog */
+{
+ char buf[64];
+ const char *class = stp_i18n_lookup(po, parameter_class_names[p_class]);
+ const char *level = stp_i18n_lookup(po, parameter_level_names[p_level]);
+ size_t bytes = bytelen(class) + bytelen(level);
+ snprintf(buf, 40, "%s%s%s", class, bytes < 39 ? " " : "", level);
+ gzprintf(fp, "*%sGroup: C%dL%d/%s\n", what, p_class, p_level, buf);
+ if (language && !strcmp(language, "C") && !strcmp(what, "Open"))
+ {
+ char **all_langs = getlangs();/* All languages */
+ const char *lang;
+ int langnum;
+
+ for (langnum = 0; all_langs[langnum]; langnum ++)
+ {
+ const stp_string_list_t *altpo;
+
+ lang = all_langs[langnum];
+
+ if (!strcmp(lang, "C") || !strcmp(lang, "en"))
+ continue;
+ if ((altpo = stp_i18n_load(lang)) != NULL)
+ {
+ class = stp_i18n_lookup(altpo, parameter_class_names[p_class]);
+ level = stp_i18n_lookup(altpo, parameter_level_names[p_level]);
+ bytes = bytelen(class) + bytelen(level);
+ snprintf(buf, 40, "%s%s%s", class, bytes < 39 ? " " : "", level);
+ gzprintf(fp, "*%s.Translation C%dL%d/%s: \"\"\n",
+ lang, p_class, p_level, buf);
+ }
+ }
+ }
+ gzputs(fp, "\n");
+}
+
+/*
+ * 'print_group_close()' - Close a UI group.
+ */
+
+static void
+print_group_close(
+ gzFile fp, /* I - File to write to */
+ stp_parameter_class_t p_class, /* I - Option class */
+ stp_parameter_level_t p_level, /* I - Option level */
+ const char *language, /* I - language */
+ const stp_string_list_t *po) /* I - Message catalog */
+{
+ print_group(fp, "Close", p_class, p_level, NULL, NULL);
+}
+
+
+/*
+ * 'print_group_open()' - Open a new UI group.
+ */
+
+static void
+print_group_open(
+ gzFile fp, /* I - File to write to */
+ stp_parameter_class_t p_class, /* I - Option class */
+ stp_parameter_level_t p_level, /* I - Option level */
+ const char *language, /* I - language */
+ const stp_string_list_t *po) /* I - Message catalog */
+{
+ print_group(fp, "Open", p_class, p_level, language ? language : "C", po);
+}
+
+static void
+print_one_option(gzFile fp, stp_vars_t *v, const stp_string_list_t *po,
+ ppd_type_t ppd_type, const stp_parameter_t *lparam,
+ const stp_parameter_t *desc)
+{
+ int num_opts;
+ int i;
+ const stp_param_string_t *opt;
+ int printed_default_value = 0;
+ int simplified = ppd_type == PPD_SIMPLIFIED;
+ char dimstr[255]; /* Dimension string */
+ int print_close_ui = 1;
+ int is_color_opt = stp_parameter_has_category_value(v, desc, "Color", "Yes");
+ int skip_color = (ppd_type == PPD_NO_COLOR_OPTS && is_color_opt);
+ if (is_color_opt)
+ gzprintf(fp, "*ColorKeyWords: \"Stp%s\"\n", desc->name);
+ gzprintf(fp, "*OpenUI *Stp%s/%s: PickOne\n",
+ desc->name, stp_i18n_lookup(po, desc->text));
+ gzprintf(fp, "*OrderDependency: 10 AnySetup *Stp%s\n", desc->name);
+ switch (desc->p_type)
+ {
+ case STP_PARAMETER_TYPE_STRING_LIST:
+ num_opts = stp_string_list_count(desc->bounds.str);
+ if (! skip_color)
+ {
+ if (num_opts > 3)
+ gzprintf(fp, "*OPOptionHints Stp%s: \"dropdown\"\n", lparam->name);
+ else
+ gzprintf(fp, "*OPOptionHints Stp%s: \"radiobuttons\"\n", lparam->name);
+ }
+ gzprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
+ desc->name, desc->p_type, desc->is_mandatory, desc->p_class,
+ desc->p_level, desc->channel, 0.0, 0.0, 0.0);
+ if (desc->is_mandatory)
+ {
+ gzprintf(fp, "*DefaultStp%s: %s\n", desc->name, desc->deflt.str);
+ gzprintf(fp, "*StpDefaultStp%s: %s\n", desc->name, desc->deflt.str);
+ }
+ else
+ {
+ gzprintf(fp, "*DefaultStp%s: None\n", desc->name);
+ gzprintf(fp, "*StpDefaultStp%s: None\n", desc->name);
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc->name, "None", _("None"));
+ }
+ for (i = 0; i < num_opts; i++)
+ {
+ opt = stp_string_list_param(desc->bounds.str, i);
+ if (skip_color && strcmp(opt->name, desc->deflt.str) != 0)
+ gzprintf(fp, "*?Stp%s %s/%s: \"\"\n",
+ desc->name, opt->name, stp_i18n_lookup(po, opt->text));
+ else
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n",
+ desc->name, opt->name, stp_i18n_lookup(po, opt->text));
+ }
+ break;
+ case STP_PARAMETER_TYPE_BOOLEAN:
+ gzprintf(fp, "*OPOptionHints Stp%s: \"checkbox\"\n", lparam->name);
+ gzprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
+ desc->name, desc->p_type, desc->is_mandatory, desc->p_class,
+ desc->p_level, desc->channel, 0.0, 0.0,
+ desc->deflt.boolean ? 1.0 : 0.0);
+ if (desc->is_mandatory)
+ {
+ gzprintf(fp, "*DefaultStp%s: %s\n", desc->name,
+ desc->deflt.boolean ? "True" : "False");
+ gzprintf(fp, "*StpDefaultStp%s: %s\n", desc->name,
+ desc->deflt.boolean ? "True" : "False");
+ if (skip_color)
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n",
+ desc->name, desc->deflt.boolean ? "True" : "False",
+ desc->deflt.boolean ? _("Yes") : _("No"));
+ }
+ else
+ {
+ gzprintf(fp, "*DefaultStp%s: None\n", desc->name);
+ gzprintf(fp, "*StpDefaultStp%s: None\n", desc->name);
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc->name, "None", _("None"));
+ }
+ gzprintf(fp, "*%sStp%s %s/%s: \"\"\n",
+ (skip_color ? "?" : ""), desc->name, "False", _("No"));
+ gzprintf(fp, "*%sStp%s %s/%s: \"\"\n",
+ (skip_color ? "?" : ""), desc->name, "True", _("Yes"));
+ break;
+ case STP_PARAMETER_TYPE_DOUBLE:
+ gzprintf(fp, "*OPOptionHints Stp%s: \"slider input spinbox\"\n",
+ lparam->name);
+ gzprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
+ desc->name, desc->p_type, desc->is_mandatory, desc->p_class,
+ desc->p_level, desc->channel, desc->bounds.dbl.lower,
+ desc->bounds.dbl.upper, desc->deflt.dbl);
+ gzprintf(fp, "*DefaultStp%s: None\n", desc->name);
+ gzprintf(fp, "*StpDefaultStp%s: None\n", desc->name);
+ if (!skip_color)
+ {
+ for (i = desc->bounds.dbl.lower * 1000;
+ i <= desc->bounds.dbl.upper * 1000 ; i += 100)
+ {
+ if (desc->deflt.dbl * 1000 == i && desc->is_mandatory)
+ {
+ gzprintf(fp, "*Stp%s None/%.3f: \"\"\n",
+ desc->name, ((double) i) * .001);
+ printed_default_value = 1;
+ }
+ else
+ gzprintf(fp, "*Stp%s %d/%.3f: \"\"\n",
+ desc->name, i, ((double) i) * .001);
+ }
+ }
+ if (!desc->is_mandatory)
+ gzprintf(fp, "*Stp%s None/%s: \"\"\n", desc->name, _("None"));
+ else if (! printed_default_value)
+ gzprintf(fp, "*Stp%s None/%.3f: \"\"\n", desc->name, desc->deflt.dbl);
+ gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc->name);
+
+ /*
+ * Add custom option code and value parameter...
+ */
+
+ gzprintf(fp, "*CustomStp%s True: \"pop\"\n", desc->name);
+ gzprintf(fp, "*ParamCustomStp%s Value/%s: 1 real %.3f %.3f\n\n",
+ desc->name, _("Value"), desc->bounds.dbl.lower,
+ desc->bounds.dbl.upper);
+ if (!simplified && !skip_color)
+ {
+ if (is_color_opt)
+ gzprintf(fp, "*ColorKeyWords: \"StpFine%s\"\n", desc->name);
+ gzprintf(fp, "*OpenUI *StpFine%s/%s %s: PickOne\n",
+ desc->name, stp_i18n_lookup(po, desc->text),
+ _("Fine Adjustment"));
+ gzprintf(fp, "*OPOptionHints StpFine%s: \"hide\"\n", lparam->name);
+ gzprintf(fp, "*StpStpFine%s: %d %d %d %d %d %.3f %.3f %.3f\n",
+ desc->name, STP_PARAMETER_TYPE_INVALID, 0,
+ 0, 0, -1, 0.0, 0.0, 0.0);
+ gzprintf(fp, "*DefaultStpFine%s: None\n", desc->name);
+ gzprintf(fp, "*StpDefaultStpFine%s: None\n", desc->name);
+ gzprintf(fp, "*StpFine%s None/0.000: \"\"\n", desc->name);
+ for (i = 0; i < 100; i += 5)
+ gzprintf(fp, "*StpFine%s %d/%.3f: \"\"\n",
+ desc->name, i, ((double) i) * .001);
+ gzprintf(fp, "*CloseUI: *StpFine%s\n\n", desc->name);
+ }
+ print_close_ui = 0;
+
+ break;
+ case STP_PARAMETER_TYPE_DIMENSION:
+ gzprintf(fp, "*OPOptionHints Stp%s: \"length slider input spinbox\"\n",
+ lparam->name);
+ gzprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
+ desc->name, desc->p_type, desc->is_mandatory,
+ desc->p_class, desc->p_level, desc->channel,
+ (double) desc->bounds.dimension.lower,
+ (double) desc->bounds.dimension.upper,
+ (double) desc->deflt.dimension);
+ if (desc->is_mandatory)
+ {
+ gzprintf(fp, "*DefaultStp%s: %d\n",
+ desc->name, desc->deflt.dimension);
+ gzprintf(fp, "*StpDefaultStp%s: %d\n",
+ desc->name, desc->deflt.dimension);
+ }
+ else
+ {
+ gzprintf(fp, "*DefaultStp%s: None\n", desc->name);
+ gzprintf(fp, "*StpDefaultStp%s: None\n", desc->name);
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc->name, "None", _("None"));
+ }
+ if (!skip_color)
+ {
+ for (i = desc->bounds.dimension.lower;
+ i <= desc->bounds.dimension.upper; i++)
+ {
+ snprintf(dimstr, sizeof(dimstr), _("%.1f mm"),
+ (double)i * 25.4 / 72.0);
+ gzprintf(fp, "*Stp%s %d/%s: \"\"\n", desc->name, i, dimstr);
+ }
+ }
+
+ print_close_ui = 0;
+ gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc->name);
+
+ /*
+ * Add custom option code and value parameter...
+ */
+
+ gzprintf(fp, "*CustomStp%s True: \"pop\"\n", desc->name);
+ gzprintf(fp, "*ParamCustomStp%s Value/%s: 1 points %d %d\n\n",
+ desc->name, _("Value"), desc->bounds.dimension.lower,
+ desc->bounds.dimension.upper);
+
+ break;
+ case STP_PARAMETER_TYPE_INT:
+ gzprintf(fp, "*OPOptionHints Stp%s: \"input spinbox\"\n", lparam->name);
+ gzprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
+ desc->name, desc->p_type, desc->is_mandatory, desc->p_class,
+ desc->p_level, desc->channel,
+ (double) desc->bounds.integer.lower,
+ (double) desc->bounds.integer.upper,
+ (double) desc->deflt.integer);
+ if (desc->is_mandatory)
+ {
+ gzprintf(fp, "*DefaultStp%s: %d\n", desc->name, desc->deflt.integer);
+ gzprintf(fp, "*StpDefaultStp%s: %d\n", desc->name, desc->deflt.integer);
+ if (skip_color)
+ gzprintf(fp, "*Stp%s %d/%d: \"\"\n", desc->name,
+ desc->deflt.integer, desc->deflt.integer);
+ }
+ else
+ {
+ gzprintf(fp, "*DefaultStp%s: None\n", desc->name);
+ gzprintf(fp, "*StpDefaultStp%s: None\n", desc->name);
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc->name, "None", _("None"));
+ }
+ for (i = desc->bounds.integer.lower; i <= desc->bounds.integer.upper; i++)
+ {
+ gzprintf(fp, "*%sStp%s %d/%d: \"\"\n",
+ (skip_color ? "?" : ""), desc->name, i, i);
+ }
+
+ print_close_ui = 0;
+ gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc->name);
+
+ /*
+ * Add custom option code and value parameter...
+ */
+
+ gzprintf(fp, "*CustomStp%s True: \"pop\"\n", desc->name);
+ gzprintf(fp, "*ParamCustomStp%s Value/%s: 1 int %d %d\n\n", desc->name,
+ _("Value"), desc->bounds.dimension.lower,
+ desc->bounds.dimension.upper);
+
+ break;
+ default:
+ break;
+ }
+ if (print_close_ui)
+ gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc->name);
+}
+
+static void
+print_one_localization(gzFile fp, const stp_string_list_t *po,
+ int simplified, const char *lang,
+ const stp_parameter_t *lparam,
+ const stp_parameter_t *desc)
+{
+ int num_opts;
+ int i;
+ const stp_param_string_t *opt;
+ char dimstr[255]; /* Dimension string */
+
+ gzprintf(fp, "*%s.Translation Stp%s/%s: \"\"\n", lang,
+ desc->name, stp_i18n_lookup(po, desc->text));
+ switch (desc->p_type)
+ {
+ case STP_PARAMETER_TYPE_STRING_LIST:
+ if (!desc->is_mandatory)
+ gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc->name,
+ "None", _("None"));
+ num_opts = stp_string_list_count(desc->bounds.str);
+ for (i = 0; i < num_opts; i++)
+ {
+ opt = stp_string_list_param(desc->bounds.str, i);
+ gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang,
+ desc->name, opt->name, stp_i18n_lookup(po, opt->text));
+ }
+ break;
+
+ case STP_PARAMETER_TYPE_BOOLEAN:
+ if (!desc->is_mandatory)
+ gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc->name,
+ "None", _("None"));
+ gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc->name, "False", _("No"));
+ gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc->name, "True", _("Yes"));
+ break;
+
+ case STP_PARAMETER_TYPE_DOUBLE:
+ if (localize_numbers)
+ {
+ for (i = desc->bounds.dbl.lower * 1000;
+ i <= desc->bounds.dbl.upper * 1000; i += 100)
+ {
+ if (desc->deflt.dbl * 1000 == i && desc->is_mandatory)
+ gzprintf(fp, "*%s.Stp%s None/%.3f: \"\"\n", lang,
+ desc->name, ((double) i) * .001);
+ else
+ gzprintf(fp, "*%s.Stp%s %d/%.3f: \"\"\n", lang,
+ desc->name, i, ((double) i) * .001);
+ }
+ }
+ if (!desc->is_mandatory)
+ gzprintf(fp, "*%s.Stp%s None/%s: \"\"\n", lang, desc->name, _("None"));
+ gzprintf(fp, "*%s.ParamCustomStp%s Value/%s: \"\"\n", lang,
+ desc->name, _("Value"));
+ if (!simplified)
+ {
+ gzprintf(fp, "*%s.Translation StpFine%s/%s %s: \"\"\n", lang,
+ desc->name, stp_i18n_lookup(po, desc->text),
+ _("Fine Adjustment"));
+ gzprintf(fp, "*%s.StpFine%s None/%.3f: \"\"\n", lang,
+ desc->name, 0.0);
+ if (localize_numbers)
+ {
+ for (i = 0; i < 100; i += 5)
+ gzprintf(fp, "*%s.StpFine%s %d/%.3f: \"\"\n", lang,
+ desc->name, i, ((double) i) * .001);
+ }
+ }
+ break;
+
+ case STP_PARAMETER_TYPE_DIMENSION:
+ if (!desc->is_mandatory)
+ gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc->name,
+ "None", _("None"));
+ /* Unlike the other fields, dimensions are not strictly numbers */
+ for (i = desc->bounds.dimension.lower;
+ i <= desc->bounds.dimension.upper; i++)
+ {
+ snprintf(dimstr, sizeof(dimstr), _("%.1f mm"),
+ (double)i * 25.4 / 72.0);
+ gzprintf(fp, "*%s.Stp%s %d/%s: \"\"\n", lang,
+ desc->name, i, dimstr);
+ }
+ gzprintf(fp, "*%s.ParamCustomStp%s Value/%s: \"\"\n", lang,
+ desc->name, _("Value"));
+ break;
+
+ case STP_PARAMETER_TYPE_INT:
+ if (!desc->is_mandatory)
+ gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc->name,
+ "None", _("None"));
+ if (localize_numbers)
+ {
+ for (i = desc->bounds.integer.lower;
+ i <= desc->bounds.integer.upper; i++)
+ {
+ gzprintf(fp, "*%s.Stp%s %d/%d: \"\"\n", lang, desc->name, i, i);
+ }
+ }
+ gzprintf(fp, "*%s.ParamCustomStp%s Value/%s: \"\"\n", lang,
+ desc->name, _("Value"));
+ break;
+
+ default:
+ break;
+ }
+}
+
+static void
+print_standard_fonts(gzFile fp)
+{
+ gzputs(fp, "\n*DefaultFont: Courier\n");
+ gzputs(fp, "*Font AvantGarde-Book: Standard \"(001.006S)\" Standard ROM\n");
+ gzputs(fp, "*Font AvantGarde-BookOblique: Standard \"(001.006S)\" Standard ROM\n");
+ gzputs(fp, "*Font AvantGarde-Demi: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font AvantGarde-DemiOblique: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font Bookman-Demi: Standard \"(001.004S)\" Standard ROM\n");
+ gzputs(fp, "*Font Bookman-DemiItalic: Standard \"(001.004S)\" Standard ROM\n");
+ gzputs(fp, "*Font Bookman-Light: Standard \"(001.004S)\" Standard ROM\n");
+ gzputs(fp, "*Font Bookman-LightItalic: Standard \"(001.004S)\" Standard ROM\n");
+ gzputs(fp, "*Font Courier: Standard \"(002.004S)\" Standard ROM\n");
+ gzputs(fp, "*Font Courier-Bold: Standard \"(002.004S)\" Standard ROM\n");
+ gzputs(fp, "*Font Courier-BoldOblique: Standard \"(002.004S)\" Standard ROM\n");
+ gzputs(fp, "*Font Courier-Oblique: Standard \"(002.004S)\" Standard ROM\n");
+ gzputs(fp, "*Font Helvetica: Standard \"(001.006S)\" Standard ROM\n");
+ gzputs(fp, "*Font Helvetica-Bold: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font Helvetica-BoldOblique: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font Helvetica-Narrow: Standard \"(001.006S)\" Standard ROM\n");
+ gzputs(fp, "*Font Helvetica-Narrow-Bold: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font Helvetica-Narrow-BoldOblique: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font Helvetica-Narrow-Oblique: Standard \"(001.006S)\" Standard ROM\n");
+ gzputs(fp, "*Font Helvetica-Oblique: Standard \"(001.006S)\" Standard ROM\n");
+ gzputs(fp, "*Font NewCenturySchlbk-Bold: Standard \"(001.009S)\" Standard ROM\n");
+ gzputs(fp, "*Font NewCenturySchlbk-BoldItalic: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font NewCenturySchlbk-Italic: Standard \"(001.006S)\" Standard ROM\n");
+ gzputs(fp, "*Font NewCenturySchlbk-Roman: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font Palatino-Bold: Standard \"(001.005S)\" Standard ROM\n");
+ gzputs(fp, "*Font Palatino-BoldItalic: Standard \"(001.005S)\" Standard ROM\n");
+ gzputs(fp, "*Font Palatino-Italic: Standard \"(001.005S)\" Standard ROM\n");
+ gzputs(fp, "*Font Palatino-Roman: Standard \"(001.005S)\" Standard ROM\n");
+ gzputs(fp, "*Font Symbol: Special \"(001.007S)\" Special ROM\n");
+ gzputs(fp, "*Font Times-Bold: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font Times-BoldItalic: Standard \"(001.009S)\" Standard ROM\n");
+ gzputs(fp, "*Font Times-Italic: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font Times-Roman: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font ZapfChancery-MediumItalic: Standard \"(001.007S)\" Standard ROM\n");
+ gzputs(fp, "*Font ZapfDingbats: Special \"(001.004S)\" Standard ROM\n");
+}
+
+/*
+ * 'write_ppd()' - Write a PPD file.
+ */
+
+static int /* O - Exit status */
+write_ppd(
+ gzFile fp, /* I - File to write to */
+ const stp_printer_t *p, /* I - Printer driver */
+ const char *language, /* I - Primary language */
+ const char *ppd_location, /* I - Location of PPD file */
+ ppd_type_t ppd_type, /* I - 1 = simplified options */
+ const char *filename) /* I - input filename */
+{
+ int i, j, k, l; /* Looping vars */
+ int num_opts; /* Number of printer options */
+ int xdpi, ydpi; /* Resolution info */
+ stp_vars_t *v; /* Variable info */
+ const char *driver; /* Driver name */
+ const char *family; /* Printer family */
+ int model; /* Internal model ID */
+ const char *long_name; /* Driver long name */
+ const char *manufacturer; /* Manufacturer of printer */
+ const char *device_id; /* IEEE1284 device ID */
+ const stp_vars_t *printvars; /* Printer option names */
+ stp_parameter_t desc;
+ stp_parameter_list_t param_list;
+ const stp_param_string_t *opt;
+ int has_quality_parameter = 0;
+ int printer_is_color = 0;
+ int simplified = ppd_type == PPD_SIMPLIFIED;
+ int skip_color = ppd_type == PPD_NO_COLOR_OPTS;
+ int maximum_level = simplified ?
+ STP_PARAMETER_LEVEL_BASIC : STP_PARAMETER_LEVEL_ADVANCED4;
+ char *default_resolution = NULL; /* Default resolution mapped name */
+ stp_string_list_t *resolutions = stp_string_list_create();
+ char **all_langs = getlangs();/* All languages */
+ const stp_string_list_t *po = stp_i18n_load(language);
+ /* Message catalog */
+
+
+ /*
+ * Initialize driver-specific variables...
+ */
+
+ driver = stp_printer_get_driver(p);
+ family = stp_printer_get_family(p);
+ model = stp_printer_get_model(p);
+ long_name = stp_printer_get_long_name(p);
+ manufacturer = stp_printer_get_manufacturer(p);
+ device_id = stp_printer_get_device_id(p);
+ printvars = stp_printer_get_defaults(p);
+
+ print_ppd_header(fp, ppd_type, model, driver, family, long_name,
+ manufacturer, device_id, ppd_location, language, po,
+ all_langs);
+
+
+ /* Set Job Mode to "Job" as this enables the Duplex option */
+ v = stp_vars_create_copy(printvars);
+ stp_set_string_parameter(v, "JobMode", "Job");
+
+ /* Assume that color printers are inkjets and should have pages reversed */
+ stp_describe_parameter(v, "PrintingMode", &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
+ {
+ if (stp_string_list_is_present(desc.bounds.str, "Color"))
+ {
+ printer_is_color = 1;
+ gzputs(fp, "*ColorDevice: True\n");
+ }
+ else
+ {
+ printer_is_color = 0;
+ gzputs(fp, "*ColorDevice: False\n");
+ }
+ if (strcmp(desc.deflt.str, "Color") == 0)
+ gzputs(fp, "*DefaultColorSpace: RGB\n");
+ else
+ gzputs(fp, "*DefaultColorSpace: Gray\n");
+ }
+ stp_parameter_description_destroy(&desc);
+
+ print_ppd_header_3(fp, ppd_type, model, driver, family, long_name,
+ manufacturer, device_id, ppd_location, language, po,
+ all_langs);
+
+ /* Macintosh color management */
+ gzputs(fp, "*cupsICCProfile Gray../Grayscale: \"/System/Library/ColorSync/Profiles/sRGB Profile.icc\"\n");
+ gzputs(fp, "*cupsICCProfile RGB../Color: \"/System/Library/ColorSync/Profiles/sRGB Profile.icc\"\n");
+ gzputs(fp, "*cupsICCProfile CMYK../Color: \"/System/Library/ColorSync/Profiles/Generic CMYK Profile.icc\"\n");
+ gzputs(fp, "*APSupportsCustomColorMatching: true\n");
+ gzputs(fp, "*APDefaultCustomColorMatchingProfile: sRGB\n");
+ gzputs(fp, "*APCustomColorMatchingProfile: sRGB\n");
+
+ gzputs(fp, "\n");
+
+ print_ppd_header_2(fp, ppd_type, model, driver, family, long_name,
+ manufacturer, device_id, ppd_location, language, po,
+ all_langs);
+
+ /*
+ * Get the page sizes from the driver...
+ */
+
+ if (printer_is_color)
+ stp_set_string_parameter(v, "PrintingMode", "Color");
+ else
+ stp_set_string_parameter(v, "PrintingMode", "BW");
+ stp_set_string_parameter(v, "ChannelBitDepth", "8");
+ print_page_sizes(fp, v, simplified, po);
+
+ /*
+ * Do we support color?
+ */
+
+ print_color_setup(fp, simplified, printer_is_color, po);
/*
* Media types...
@@ -1377,6 +1913,11 @@ write_ppd(
if (num_opts > 0)
{
+ int is_color_opt =
+ stp_parameter_has_category_value(v, &desc, "Color", "Yes");
+ int nocolor = skip_color && is_color_opt;
+ if (is_color_opt)
+ gzprintf(fp, "*ColorKeyWords: \"MediaType\"\n");
gzprintf(fp, "*OpenUI *MediaType/%s: PickOne\n", _("Media Type"));
gzputs(fp, "*OPOptionHints MediaType: \"dropdown\"\n");
gzputs(fp, "*OrderDependency: 10 AnySetup *MediaType\n");
@@ -1389,7 +1930,8 @@ write_ppd(
for (i = 0; i < num_opts; i ++)
{
opt = stp_string_list_param(desc.bounds.str, i);
- gzprintf(fp, "*MediaType %s/%s:\t\"<</MediaType(%s)>>setpagedevice\"\n",
+ gzprintf(fp, "*%sMediaType %s/%s:\t\"<</MediaType(%s)>>setpagedevice\"\n",
+ nocolor && strcmp(opt->name, desc.deflt.str) != 0 ? "?" : "",
opt->name, stp_i18n_lookup(po, opt->text), opt->name);
}
@@ -1406,6 +1948,11 @@ write_ppd(
if (num_opts > 0)
{
+ int is_color_opt =
+ stp_parameter_has_category_value(v, &desc, "Color", "Yes");
+ int nocolor = skip_color && is_color_opt;
+ if (is_color_opt)
+ gzprintf(fp, "*ColorKeyWords: \"InputSlot\"\n");
gzprintf(fp, "*OpenUI *InputSlot/%s: PickOne\n", _("Media Source"));
gzputs(fp, "*OPOptionHints InputSlot: \"dropdown\"\n");
gzputs(fp, "*OrderDependency: 10 AnySetup *InputSlot\n");
@@ -1418,7 +1965,8 @@ write_ppd(
for (i = 0; i < num_opts; i ++)
{
opt = stp_string_list_param(desc.bounds.str, i);
- gzprintf(fp, "*InputSlot %s/%s:\t\"<</MediaClass(%s)>>setpagedevice\"\n",
+ gzprintf(fp, "*%sInputSlot %s/%s:\t\"<</MediaClass(%s)>>setpagedevice\"\n",
+ nocolor && strcmp(opt->name, desc.deflt.str) != 0 ? "?" : "",
opt->name, stp_i18n_lookup(po, opt->text), opt->name);
}
@@ -1433,6 +1981,11 @@ write_ppd(
stp_describe_parameter(v, "Quality", &desc);
if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST && desc.is_active)
{
+ int is_color_opt =
+ stp_parameter_has_category_value(v, &desc, "Color", "Yes");
+ int nocolor = skip_color && is_color_opt;
+ if (is_color_opt)
+ gzprintf(fp, "*ColorKeyWords: \"Quality\"\n");
stp_clear_string_parameter(v, "Resolution");
has_quality_parameter = 1;
num_opts = stp_string_list_count(desc.bounds.str);
@@ -1462,7 +2015,8 @@ write_ppd(
stp_clear_string_parameter(v, "Resolution");
stp_parameter_description_destroy(&res_desc);
}
- gzprintf(fp, "*StpQuality %s/%s:\t\"<</HWResolution[%d %d]/cupsRowFeed %d>>setpagedevice\"\n",
+ gzprintf(fp, "*%sStpQuality %s/%s:\t\"<</HWResolution[%d %d]/cupsRowFeed %d>>setpagedevice\"\n",
+ nocolor && strcmp(opt->name, desc.deflt.str) != 0 ? "?" : "",
opt->name, stp_i18n_lookup(po, opt->text), xdpi, ydpi, i + 1);
}
gzputs(fp, "*CloseUI: *StpQuality\n\n");
@@ -1479,11 +2033,16 @@ write_ppd(
if (!simplified || desc.p_level == STP_PARAMETER_LEVEL_BASIC)
{
+ int is_color_opt =
+ stp_parameter_has_category_value(v, &desc, "Color", "Yes");
+ int nocolor = skip_color && is_color_opt;
stp_string_list_t *res_list = stp_string_list_create();
char res_name[64]; /* Plenty long enough for XXXxYYYdpi */
int resolution_ok;
int tmp_xdpi, tmp_ydpi;
+ if (is_color_opt)
+ gzprintf(fp, "*ColorKeyWords: \"Resolution\"\n");
gzprintf(fp, "*OpenUI *Resolution/%s: PickOne\n", _("Resolution"));
if (num_opts > 3)
gzputs(fp, "*OPOptionHints Resolution: \"resolution radiobuttons\"\n");
@@ -1590,7 +2149,8 @@ write_ppd(
tmp_xdpi /= 2;
} while (!resolution_ok);
stp_string_list_add_string(resolutions, res_name, opt->text);
- gzprintf(fp, "*Resolution %s/%s:\t\"<</HWResolution[%d %d]/cupsCompression %d>>setpagedevice\"\n",
+ gzprintf(fp, "*%sResolution %s/%s:\t\"<</HWResolution[%d %d]/cupsCompression %d>>setpagedevice\"\n",
+ nocolor && strcmp(opt->name, desc.deflt.str) != 0 ? "?" : "",
res_name, stp_i18n_lookup(po, opt->text), xdpi, ydpi, i + 1);
if (strcmp(res_name, opt->name) != 0)
gzprintf(fp, "*StpResolutionMap: %s %s\n", res_name, opt->name);
@@ -1628,6 +2188,10 @@ write_ppd(
num_opts = stp_string_list_count(desc.bounds.str);
if (num_opts > 0)
{
+ int is_color_opt =
+ stp_parameter_has_category_value(v, &desc, "Color", "Yes");
+ if (is_color_opt)
+ gzprintf(fp, "*ColorKeyWords: \"InputSlot\"\n");
gzprintf(fp, "*OpenUI *Duplex/%s: PickOne\n", _("2-Sided Printing"));
gzputs(fp, "*OPOptionHints Duplex: \"radiobuttons\"\n");
gzputs(fp, "*OrderDependency: 10 AnySetup *Duplex\n");
@@ -1673,7 +2237,6 @@ write_ppd(
size_t param_count = stp_parameter_list_count(param_list);
for (l = 0; l < param_count; l++)
{
- int print_close_ui = 1;
const stp_parameter_t *lparam =
stp_parameter_list_param(param_list, l);
if (lparam->p_class != j || lparam->p_level != k ||
@@ -1687,231 +2250,12 @@ write_ppd(
stp_describe_parameter(v, lparam->name, &desc);
if (desc.is_active)
{
- int printed_default_value = 0;
if (!printed_open_group)
{
print_group_open(fp, j, k, language, po);
printed_open_group = 1;
}
- gzprintf(fp, "*OpenUI *Stp%s/%s: PickOne\n",
- desc.name, stp_i18n_lookup(po, desc.text));
- gzprintf(fp, "*OrderDependency: 10 AnySetup *Stp%s\n",
- desc.name);
- switch (desc.p_type)
- {
- case STP_PARAMETER_TYPE_STRING_LIST:
- num_opts = stp_string_list_count(desc.bounds.str);
- if (num_opts > 3)
- gzprintf(fp, "*OPOptionHints Stp%s: \"dropdown\"\n",
- lparam->name);
- else
- gzprintf(fp, "*OPOptionHints Stp%s: \"radiobuttons\"\n",
- lparam->name);
- gzprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
- desc.name, desc.p_type, desc.is_mandatory,
- desc.p_class, desc.p_level, desc.channel,
- 0.0, 0.0, 0.0);
- if (desc.is_mandatory)
- {
- gzprintf(fp, "*DefaultStp%s: %s\n",
- desc.name, desc.deflt.str);
- gzprintf(fp, "*StpDefaultStp%s: %s\n",
- desc.name, desc.deflt.str);
- }
- else
- {
- gzprintf(fp, "*DefaultStp%s: None\n", desc.name);
- gzprintf(fp, "*StpDefaultStp%s: None\n", desc.name);
- gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name,
- "None", _("None"));
- }
- for (i = 0; i < num_opts; i++)
- {
- opt = stp_string_list_param(desc.bounds.str, i);
- gzprintf(fp, "*Stp%s %s/%s: \"\"\n",
- desc.name, opt->name, stp_i18n_lookup(po, opt->text));
- }
- break;
- case STP_PARAMETER_TYPE_BOOLEAN:
- gzprintf(fp, "*OPOptionHints Stp%s: \"checkbox\"\n",
- lparam->name);
- gzprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
- desc.name, desc.p_type, desc.is_mandatory,
- desc.p_class, desc.p_level, desc.channel,
- 0.0, 0.0, desc.deflt.boolean ? 1.0 : 0.0);
- if (desc.is_mandatory)
- {
- gzprintf(fp, "*DefaultStp%s: %s\n", desc.name,
- desc.deflt.boolean ? "True" : "False");
- gzprintf(fp, "*StpDefaultStp%s: %s\n", desc.name,
- desc.deflt.boolean ? "True" : "False");
- }
- else
- {
- gzprintf(fp, "*DefaultStp%s: None\n", desc.name);
- gzprintf(fp, "*StpDefaultStp%s: None\n", desc.name);
- gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name,
- "None", _("None"));
- }
- gzprintf(fp, "*Stp%s %s/%s: \"\"\n",
- desc.name, "False", _("No"));
- gzprintf(fp, "*Stp%s %s/%s: \"\"\n",
- desc.name, "True", _("Yes"));
- break;
- case STP_PARAMETER_TYPE_DOUBLE:
- gzprintf(fp, "*OPOptionHints Stp%s: \"slider input spinbox\"\n",
- lparam->name);
- gzprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
- desc.name, desc.p_type, desc.is_mandatory,
- desc.p_class, desc.p_level, desc.channel,
- desc.bounds.dbl.lower, desc.bounds.dbl.upper,
- desc.deflt.dbl);
- gzprintf(fp, "*DefaultStp%s: None\n", desc.name);
- gzprintf(fp, "*StpDefaultStp%s: None\n", desc.name);
- for (i = desc.bounds.dbl.lower * 1000;
- i <= desc.bounds.dbl.upper * 1000 ; i += 100)
- {
- if (desc.deflt.dbl * 1000 == i && desc.is_mandatory)
- {
- gzprintf(fp, "*Stp%s None/%.3f: \"\"\n",
- desc.name, ((double) i) * .001);
- printed_default_value = 1;
- }
- else
- gzprintf(fp, "*Stp%s %d/%.3f: \"\"\n",
- desc.name, i, ((double) i) * .001);
- }
- if (!desc.is_mandatory)
- gzprintf(fp, "*Stp%s None/%s: \"\"\n",
- desc.name, _("None"));
- else if (! printed_default_value)
- gzprintf(fp, "*Stp%s None/%.3f: \"\"\n",
- desc.name, desc.deflt.dbl);
- gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc.name);
-
- /*
- * Add custom option code and value parameter...
- */
-
- gzprintf(fp, "*CustomStp%s True: \"pop\"\n", desc.name);
- gzprintf(fp, "*ParamCustomStp%s Value/%s: 1 real %.3f %.3f\n\n",
- desc.name, _("Value"), desc.bounds.dbl.lower,
- desc.bounds.dbl.upper);
- if (!simplified)
- {
- gzprintf(fp, "*OpenUI *StpFine%s/%s %s: PickOne\n",
- desc.name, stp_i18n_lookup(po, desc.text), _("Fine Adjustment"));
- gzprintf(fp, "*OPOptionHints StpFine%s: \"hide\"\n",
- lparam->name);
- gzprintf(fp, "*StpStpFine%s: %d %d %d %d %d %.3f %.3f %.3f\n",
- desc.name, STP_PARAMETER_TYPE_INVALID, 0,
- 0, 0, -1, 0.0, 0.0, 0.0);
- gzprintf(fp, "*DefaultStpFine%s:None\n", desc.name);
- gzprintf(fp, "*StpDefaultStpFine%s:None\n", desc.name);
- gzprintf(fp, "*StpFine%s None/0.000: \"\"\n", desc.name);
- for (i = 0; i < 100; i += 5)
- gzprintf(fp, "*StpFine%s %d/%.3f: \"\"\n",
- desc.name, i, ((double) i) * .001);
- gzprintf(fp, "*CloseUI: *StpFine%s\n\n", desc.name);
- }
- print_close_ui = 0;
-
- break;
- case STP_PARAMETER_TYPE_DIMENSION:
- gzprintf(fp, "*OPOptionHints Stp%s: \"length slider input spinbox\"\n",
- lparam->name);
- gzprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
- desc.name, desc.p_type, desc.is_mandatory,
- desc.p_class, desc.p_level, desc.channel,
- (double) desc.bounds.dimension.lower,
- (double) desc.bounds.dimension.upper,
- (double) desc.deflt.dimension);
- if (desc.is_mandatory)
- {
- gzprintf(fp, "*DefaultStp%s: %d\n",
- desc.name, desc.deflt.dimension);
- gzprintf(fp, "*StpDefaultStp%s: %d\n",
- desc.name, desc.deflt.dimension);
- }
- else
- {
- gzprintf(fp, "*DefaultStp%s: None\n", desc.name);
- gzprintf(fp, "*StpDefaultStp%s: None\n", desc.name);
- gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name,
- "None", _("None"));
- }
- for (i = desc.bounds.dimension.lower;
- i <= desc.bounds.dimension.upper; i++)
- {
- snprintf(dimstr, sizeof(dimstr), _("%.1f mm"),
- (double)i * 25.4 / 72.0);
- gzprintf(fp, "*Stp%s %d/%s: \"\"\n",
- desc.name, i, dimstr);
- }
-
- print_close_ui = 0;
- gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc.name);
-
- /*
- * Add custom option code and value parameter...
- */
-
- gzprintf(fp, "*CustomStp%s True: \"pop\"\n", desc.name);
- gzprintf(fp, "*ParamCustomStp%s Value/%s: 1 points %d %d\n\n",
- desc.name, _("Value"),
- desc.bounds.dimension.lower,
- desc.bounds.dimension.upper);
-
- break;
- case STP_PARAMETER_TYPE_INT:
- gzprintf(fp, "*OPOptionHints Stp%s: \"input spinbox\"\n",
- lparam->name);
- gzprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
- desc.name, desc.p_type, desc.is_mandatory,
- desc.p_class, desc.p_level, desc.channel,
- (double) desc.bounds.integer.lower,
- (double) desc.bounds.integer.upper,
- (double) desc.deflt.integer);
- if (desc.is_mandatory)
- {
- gzprintf(fp, "*DefaultStp%s: %d\n",
- desc.name, desc.deflt.integer);
- gzprintf(fp, "*StpDefaultStp%s: %d\n",
- desc.name, desc.deflt.integer);
- }
- else
- {
- gzprintf(fp, "*DefaultStp%s: None\n", desc.name);
- gzprintf(fp, "*StpDefaultStp%s: None\n", desc.name);
- gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name,
- "None", _("None"));
- }
- for (i = desc.bounds.integer.lower;
- i <= desc.bounds.integer.upper; i++)
- {
- gzprintf(fp, "*Stp%s %d/%d: \"\"\n",
- desc.name, i, i);
- }
-
- print_close_ui = 0;
- gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc.name);
-
- /*
- * Add custom option code and value parameter...
- */
-
- gzprintf(fp, "*CustomStp%s True: \"pop\"\n", desc.name);
- gzprintf(fp, "*ParamCustomStp%s Value/%s: 1 int %d %d\n\n",
- desc.name, _("Value"),
- desc.bounds.dimension.lower,
- desc.bounds.dimension.upper);
-
- break;
- default:
- break;
- }
- if (print_close_ui)
- gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc.name);
+ print_one_option(fp, v, po, ppd_type, lparam, &desc);
}
stp_parameter_description_destroy(&desc);
}
@@ -1938,421 +2282,279 @@ write_ppd(
}
stp_parameter_description_destroy(&desc);
-#undef _
-#define _(x) stp_i18n_lookup(altpo, x)
-
if (!language)
- {
- /*
- * Generate globalized PPDs when POSIX language is requested...
- */
-
- const char *lang;
- const stp_string_list_t *altpo;
- int langnum;
-
- for (langnum = 0; all_langs[langnum]; langnum ++)
{
- lang = all_langs[langnum];
-
- if (!strcmp(lang, "C") || !strcmp(lang, "en"))
- continue;
+ /*
+ * Generate globalized PPDs when POSIX language is requested...
+ */
- if ((altpo = stp_i18n_load(lang)) == NULL)
- continue;
+ const char *lang;
+ const stp_string_list_t *savepo = po;
+ int langnum;
- /*
- * Get the page sizes from the driver...
- */
+ for (langnum = 0; all_langs[langnum]; langnum ++)
+ {
+ lang = all_langs[langnum];
- if (printer_is_color)
- stp_set_string_parameter(v, "PrintingMode", "Color");
- else
- stp_set_string_parameter(v, "PrintingMode", "BW");
- stp_set_string_parameter(v, "ChannelBitDepth", "8");
- stp_describe_parameter(v, "PageSize", &desc);
- num_opts = stp_string_list_count(desc.bounds.str);
+ if (!strcmp(lang, "C") || !strcmp(lang, "en"))
+ continue;
- gzprintf(fp, "*%s.Translation PageSize/%s: \"\"\n", lang, _("Media Size"));
- gzprintf(fp, "*%s.Translation PageRegion/%s: \"\"\n", lang, _("Media Size"));
+ if ((po = stp_i18n_load(lang)) == NULL)
+ continue;
- for (i = 0; i < num_opts; i++)
- {
- const stp_papersize_t *papersize;
- opt = stp_string_list_param(desc.bounds.str, i);
- papersize = stp_get_papersize_by_name(opt->name);
+ /*
+ * Get the page sizes from the driver...
+ */
- if (!papersize)
- continue;
+ if (printer_is_color)
+ stp_set_string_parameter(v, "PrintingMode", "Color");
+ else
+ stp_set_string_parameter(v, "PrintingMode", "BW");
+ stp_set_string_parameter(v, "ChannelBitDepth", "8");
+ stp_describe_parameter(v, "PageSize", &desc);
+ num_opts = stp_string_list_count(desc.bounds.str);
-/*
- if (strcmp(opt->name, "Custom") == 0)
- continue;
-*/
+ gzprintf(fp, "*%s.Translation PageSize/%s: \"\"\n", lang, _("Media Size"));
+ gzprintf(fp, "*%s.Translation PageRegion/%s: \"\"\n", lang, _("Media Size"));
- if (simplified && num_opts >= 10 &&
- (papersize->paper_unit == PAPERSIZE_ENGLISH_EXTENDED ||
- papersize->paper_unit == PAPERSIZE_METRIC_EXTENDED))
- continue;
+ for (i = 0; i < num_opts; i++)
+ {
+ const stp_papersize_t *papersize;
+ opt = stp_string_list_param(desc.bounds.str, i);
+ papersize = stp_get_papersize_by_name(opt->name);
- if ((papersize->width <= 0 || papersize->height <= 0) &&
- strcmp(opt->name, "Custom") != 0)
- continue;
+ if (!papersize)
+ continue;
- gzprintf(fp, "*%s.PageSize %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(altpo, opt->text));
- gzprintf(fp, "*%s.PageRegion %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(altpo, opt->text));
- }
+ /*
+ if (strcmp(opt->name, "Custom") == 0)
+ continue;
+ */
- stp_parameter_description_destroy(&desc);
+ if (simplified && num_opts >= 10 &&
+ (papersize->paper_unit == PAPERSIZE_ENGLISH_EXTENDED ||
+ papersize->paper_unit == PAPERSIZE_METRIC_EXTENDED))
+ continue;
- /*
- * Do we support color?
- */
+ if ((papersize->width <= 0 || papersize->height <= 0) &&
+ strcmp(opt->name, "Custom") != 0)
+ continue;
- gzprintf(fp, "*%s.Translation ColorModel/%s: \"\"\n", lang, _("Color Model"));
- gzprintf(fp, "*%s.ColorModel Gray/%s: \"\"\n", lang, _("Grayscale"));
- gzprintf(fp, "*%s.ColorModel Black/%s: \"\"\n", lang, _("Inverted Grayscale"));
+ gzprintf(fp, "*%s.PageSize %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(po, opt->text));
+ gzprintf(fp, "*%s.PageRegion %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(po, opt->text));
+ }
- if (printer_is_color)
- {
- gzprintf(fp, "*%s.ColorModel RGB/%s: \"\"\n", lang, _("RGB Color"));
- gzprintf(fp, "*%s.ColorModel CMY/%s: \"\"\n", lang, _("CMY Color"));
- gzprintf(fp, "*%s.ColorModel CMYK/%s: \"\"\n", lang, _("CMYK"));
- gzprintf(fp, "*%s.ColorModel KCMY/%s: \"\"\n", lang, _("KCMY"));
- }
+ stp_parameter_description_destroy(&desc);
- if (!simplified)
- {
/*
- * 8 or 16 bit color (16 bit is slower)
+ * Do we support color?
*/
- gzprintf(fp, "*%s.Translation StpColorPrecision/%s: \"\"\n", lang, _("Color Precision"));
- gzprintf(fp, "*%s.StpColorPrecision Normal/%s: \"\"\n", lang, _("Normal"));
- gzprintf(fp, "*%s.StpColorPrecision Best/%s: \"\"\n", lang, _("Best"));
- }
- /*
- * Media types...
- */
+ gzprintf(fp, "*%s.Translation ColorModel/%s: \"\"\n", lang, _("Color Model"));
+ gzprintf(fp, "*%s.ColorModel Gray/%s: \"\"\n", lang, _("Grayscale"));
+ gzprintf(fp, "*%s.ColorModel Black/%s: \"\"\n", lang, _("Inverted Grayscale"));
- stp_describe_parameter(v, "MediaType", &desc);
- num_opts = stp_string_list_count(desc.bounds.str);
-
- if (num_opts > 0)
- {
- gzprintf(fp, "*%s.Translation MediaType/%s: \"\"\n", lang, _("Media Type"));
+ if (printer_is_color)
+ {
+ gzprintf(fp, "*%s.ColorModel RGB/%s: \"\"\n", lang, _("RGB Color"));
+ gzprintf(fp, "*%s.ColorModel CMY/%s: \"\"\n", lang, _("CMY Color"));
+ gzprintf(fp, "*%s.ColorModel CMYK/%s: \"\"\n", lang, _("CMYK"));
+ gzprintf(fp, "*%s.ColorModel KCMY/%s: \"\"\n", lang, _("KCMY"));
+ }
- for (i = 0; i < num_opts; i ++)
- {
- opt = stp_string_list_param(desc.bounds.str, i);
- gzprintf(fp, "*%s.MediaType %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(altpo, opt->text));
- }
- }
- stp_parameter_description_destroy(&desc);
+ if (!simplified)
+ {
+ /*
+ * 8 or 16 bit color (16 bit is slower)
+ */
+ gzprintf(fp, "*%s.Translation StpColorPrecision/%s: \"\"\n", lang, _("Color Precision"));
+ gzprintf(fp, "*%s.StpColorPrecision Normal/%s: \"\"\n", lang, _("Normal"));
+ gzprintf(fp, "*%s.StpColorPrecision Best/%s: \"\"\n", lang, _("Best"));
+ }
- /*
- * Input slots...
- */
+ /*
+ * Media types...
+ */
- stp_describe_parameter(v, "InputSlot", &desc);
- num_opts = stp_string_list_count(desc.bounds.str);
+ stp_describe_parameter(v, "MediaType", &desc);
+ num_opts = stp_string_list_count(desc.bounds.str);
- if (num_opts > 0)
- {
- gzprintf(fp, "*%s.Translation InputSlot/%s: \"\"\n", lang, _("Media Source"));
+ if (num_opts > 0)
+ {
+ gzprintf(fp, "*%s.Translation MediaType/%s: \"\"\n", lang, _("Media Type"));
- for (i = 0; i < num_opts; i ++)
- {
- opt = stp_string_list_param(desc.bounds.str, i);
- gzprintf(fp, "*%s.InputSlot %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(altpo, opt->text));
- }
- }
- stp_parameter_description_destroy(&desc);
+ for (i = 0; i < num_opts; i ++)
+ {
+ opt = stp_string_list_param(desc.bounds.str, i);
+ gzprintf(fp, "*%s.MediaType %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(po, opt->text));
+ }
+ }
+ stp_parameter_description_destroy(&desc);
- /*
- * Quality settings
- */
+ /*
+ * Input slots...
+ */
- stp_describe_parameter(v, "Quality", &desc);
- if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST && desc.is_active)
- {
- gzprintf(fp, "*%s.Translation StpQuality/%s: \"\"\n", lang, stp_i18n_lookup(altpo, desc.text));
+ stp_describe_parameter(v, "InputSlot", &desc);
num_opts = stp_string_list_count(desc.bounds.str);
- for (i = 0; i < num_opts; i++)
+
+ if (num_opts > 0)
{
- opt = stp_string_list_param(desc.bounds.str, i);
- gzprintf(fp, "*%s.StpQuality %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(altpo, opt->text));
+ gzprintf(fp, "*%s.Translation InputSlot/%s: \"\"\n", lang, _("Media Source"));
+
+ for (i = 0; i < num_opts; i ++)
+ {
+ opt = stp_string_list_param(desc.bounds.str, i);
+ gzprintf(fp, "*%s.InputSlot %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(po, opt->text));
+ }
}
- }
- stp_parameter_description_destroy(&desc);
+ stp_parameter_description_destroy(&desc);
- /*
- * Resolution
- */
+ /*
+ * Quality settings
+ */
+
+ stp_describe_parameter(v, "Quality", &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST && desc.is_active)
+ {
+ gzprintf(fp, "*%s.Translation StpQuality/%s: \"\"\n", lang, stp_i18n_lookup(po, desc.text));
+ num_opts = stp_string_list_count(desc.bounds.str);
+ for (i = 0; i < num_opts; i++)
+ {
+ opt = stp_string_list_param(desc.bounds.str, i);
+ gzprintf(fp, "*%s.StpQuality %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(po, opt->text));
+ }
+ }
+ stp_parameter_description_destroy(&desc);
- stp_describe_parameter(v, "Resolution", &desc);
- num_opts = stp_string_list_count(resolutions);
+ /*
+ * Resolution
+ */
- if (!simplified || desc.p_level == STP_PARAMETER_LEVEL_BASIC)
- {
- gzprintf(fp, "*%s.Translation Resolution/%s: \"\"\n", lang, _("Resolution"));
- if (has_quality_parameter)
- gzprintf(fp, "*%s.Resolution %s/%s: \"\"\n", lang,
- default_resolution, _("Automatic"));
+ stp_describe_parameter(v, "Resolution", &desc);
+ num_opts = stp_string_list_count(resolutions);
- for (i = 0; i < num_opts; i ++)
+ if (!simplified || desc.p_level == STP_PARAMETER_LEVEL_BASIC)
{
- opt = stp_string_list_param(resolutions, i);
- gzprintf(fp, "*%s.Resolution %s/%s: \"\"\n", lang,
- opt->name, stp_i18n_lookup(altpo, opt->text));
+ gzprintf(fp, "*%s.Translation Resolution/%s: \"\"\n", lang, _("Resolution"));
+ if (has_quality_parameter)
+ gzprintf(fp, "*%s.Resolution %s/%s: \"\"\n", lang,
+ default_resolution, _("Automatic"));
+
+ for (i = 0; i < num_opts; i ++)
+ {
+ opt = stp_string_list_param(resolutions, i);
+ gzprintf(fp, "*%s.Resolution %s/%s: \"\"\n", lang,
+ opt->name, stp_i18n_lookup(po, opt->text));
+ }
}
- }
- stp_parameter_description_destroy(&desc);
+ stp_parameter_description_destroy(&desc);
+
+ /*
+ * OutputOrder
+ */
- /*
- * OutputOrder
- */
+ stp_describe_parameter(v, "OutputOrder", &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
+ {
+ gzprintf(fp, "*%s.Translation OutputOrder/%s: \"\"\n", lang, _("Output Order"));
+ gzprintf(fp, "*%s.OutputOrder Normal/%s: \"\"\n", lang, _("Normal"));
+ gzprintf(fp, "*%s.OutputOrder Reverse/%s: \"\"\n", lang, _("Reverse"));
+ }
+ stp_parameter_description_destroy(&desc);
- stp_describe_parameter(v, "OutputOrder", &desc);
- if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
- {
- gzprintf(fp, "*%s.Translation OutputOrder/%s: \"\"\n", lang, _("Output Order"));
- gzprintf(fp, "*%s.OutputOrder Normal/%s: \"\"\n", lang, _("Normal"));
- gzprintf(fp, "*%s.OutputOrder Reverse/%s: \"\"\n", lang, _("Reverse"));
- }
- stp_parameter_description_destroy(&desc);
+ /*
+ * Duplex
+ * Note that the opt->name strings MUST match those in the printer driver(s)
+ * else the PPD files will not be generated correctly
+ */
- /*
- * Duplex
- * Note that the opt->name strings MUST match those in the printer driver(s)
- * else the PPD files will not be generated correctly
- */
+ stp_describe_parameter(v, "Duplex", &desc);
+ if (desc.is_active && desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
+ {
+ num_opts = stp_string_list_count(desc.bounds.str);
+ if (num_opts > 0)
+ {
+ gzprintf(fp, "*%s.Translation Duplex/%s: \"\"\n", lang, _("2-Sided Printing"));
- stp_describe_parameter(v, "Duplex", &desc);
- if (desc.is_active && desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
- {
- num_opts = stp_string_list_count(desc.bounds.str);
- if (num_opts > 0)
- {
- gzprintf(fp, "*%s.Translation Duplex/%s: \"\"\n", lang, _("2-Sided Printing"));
-
- for (i = 0; i < num_opts; i++)
- {
- opt = stp_string_list_param(desc.bounds.str, i);
- if (strcmp(opt->name, "None") == 0)
- gzprintf(fp, "*%s.Duplex %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(altpo, opt->text));
- else if (strcmp(opt->name, "DuplexNoTumble") == 0)
- gzprintf(fp, "*%s.Duplex %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(altpo, opt->text));
- else if (strcmp(opt->name, "DuplexTumble") == 0)
- gzprintf(fp, "*%s.Duplex %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(altpo, opt->text));
- }
- }
- }
- stp_parameter_description_destroy(&desc);
+ for (i = 0; i < num_opts; i++)
+ {
+ opt = stp_string_list_param(desc.bounds.str, i);
+ if (strcmp(opt->name, "None") == 0)
+ gzprintf(fp, "*%s.Duplex %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(po, opt->text));
+ else if (strcmp(opt->name, "DuplexNoTumble") == 0)
+ gzprintf(fp, "*%s.Duplex %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(po, opt->text));
+ else if (strcmp(opt->name, "DuplexTumble") == 0)
+ gzprintf(fp, "*%s.Duplex %s/%s: \"\"\n", lang, opt->name, stp_i18n_lookup(po, opt->text));
+ }
+ }
+ }
+ stp_parameter_description_destroy(&desc);
- gzprintf(fp, "*%s.Translation StpiShrinkOutput/%s: \"\"\n", lang,
- _("Shrink Page If Necessary to Fit Borders"));
- gzprintf(fp, "*%s.StpiShrinkOutput %s/%s: \"\"\n", lang, "Shrink", _("Shrink (print the whole page)"));
- gzprintf(fp, "*%s.StpiShrinkOutput %s/%s: \"\"\n", lang, "Crop", _("Crop (preserve dimensions)"));
- gzprintf(fp, "*%s.StpiShrinkOutput %s/%s: \"\"\n", lang, "Expand", _("Expand (use maximum page area)"));
+ gzprintf(fp, "*%s.Translation StpiShrinkOutput/%s: \"\"\n", lang,
+ _("Shrink Page If Necessary to Fit Borders"));
+ gzprintf(fp, "*%s.StpiShrinkOutput %s/%s: \"\"\n", lang, "Shrink", _("Shrink (print the whole page)"));
+ gzprintf(fp, "*%s.StpiShrinkOutput %s/%s: \"\"\n", lang, "Crop", _("Crop (preserve dimensions)"));
+ gzprintf(fp, "*%s.StpiShrinkOutput %s/%s: \"\"\n", lang, "Expand", _("Expand (use maximum page area)"));
- param_list = stp_get_parameter_list(v);
+ param_list = stp_get_parameter_list(v);
- for (j = 0; j <= STP_PARAMETER_CLASS_OUTPUT; j++)
- {
- for (k = 0; k <= maximum_level; k++)
+ for (j = 0; j <= STP_PARAMETER_CLASS_OUTPUT; j++)
{
- size_t param_count = stp_parameter_list_count(param_list);
- for (l = 0; l < param_count; l++)
+ for (k = 0; k <= maximum_level; k++)
{
- const stp_parameter_t *lparam =
- stp_parameter_list_param(param_list, l);
- if (lparam->p_class != j || lparam->p_level != k ||
- is_special_option(lparam->name) || lparam->read_only ||
- (lparam->p_type != STP_PARAMETER_TYPE_STRING_LIST &&
- lparam->p_type != STP_PARAMETER_TYPE_BOOLEAN &&
- lparam->p_type != STP_PARAMETER_TYPE_DIMENSION &&
- lparam->p_type != STP_PARAMETER_TYPE_INT &&
- lparam->p_type != STP_PARAMETER_TYPE_DOUBLE))
- continue;
- stp_describe_parameter(v, lparam->name, &desc);
- if (desc.is_active)
+ size_t param_count = stp_parameter_list_count(param_list);
+ for (l = 0; l < param_count; l++)
{
- gzprintf(fp, "*%s.Translation Stp%s/%s: \"\"\n", lang,
- desc.name, stp_i18n_lookup(altpo, desc.text));
- switch (desc.p_type)
- {
- case STP_PARAMETER_TYPE_STRING_LIST:
- if (!desc.is_mandatory)
- gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc.name,
- "None", _("None"));
- num_opts = stp_string_list_count(desc.bounds.str);
- for (i = 0; i < num_opts; i++)
- {
- opt = stp_string_list_param(desc.bounds.str, i);
- gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang,
- desc.name, opt->name, stp_i18n_lookup(altpo, opt->text));
- }
- break;
-
- case STP_PARAMETER_TYPE_BOOLEAN:
- if (!desc.is_mandatory)
- gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc.name,
- "None", _("None"));
- gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang,
- desc.name, "False", _("No"));
- gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang,
- desc.name, "True", _("Yes"));
- break;
-
- case STP_PARAMETER_TYPE_DOUBLE:
- if (localize_numbers)
- {
- for (i = desc.bounds.dbl.lower * 1000;
- i <= desc.bounds.dbl.upper * 1000 ; i += 100)
- {
- if (desc.deflt.dbl * 1000 == i && desc.is_mandatory)
- gzprintf(fp, "*%s.Stp%s None/%.3f: \"\"\n", lang,
- desc.name, ((double) i) * .001);
- else
- gzprintf(fp, "*%s.Stp%s %d/%.3f: \"\"\n", lang,
- desc.name, i, ((double) i) * .001);
- }
- }
- if (!desc.is_mandatory)
- gzprintf(fp, "*%s.Stp%s None/%s: \"\"\n", lang,
- desc.name, _("None"));
- gzprintf(fp, "*%s.ParamCustomStp%s Value/%s: \"\"\n", lang,
- desc.name, _("Value"));
- if (!simplified)
- {
- gzprintf(fp, "*%s.Translation StpFine%s/%s %s: \"\"\n", lang,
- desc.name, stp_i18n_lookup(altpo, desc.text), _("Fine Adjustment"));
- gzprintf(fp, "*%s.StpFine%s None/%.3f: \"\"\n", lang,
- desc.name, 0.0);
- if (localize_numbers)
- {
- for (i = 0; i < 100; i += 5)
- gzprintf(fp, "*%s.StpFine%s %d/%.3f: \"\"\n", lang,
- desc.name, i, ((double) i) * .001);
- }
- }
- break;
-
- case STP_PARAMETER_TYPE_DIMENSION:
- if (!desc.is_mandatory)
- gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc.name,
- "None", _("None"));
- /* Unlike the other fields, dimensions are not strictly numbers */
- for (i = desc.bounds.dimension.lower;
- i <= desc.bounds.dimension.upper; i++)
- {
- snprintf(dimstr, sizeof(dimstr), _("%.1f mm"),
- (double)i * 25.4 / 72.0);
- gzprintf(fp, "*%s.Stp%s %d/%s: \"\"\n", lang,
- desc.name, i, dimstr);
- }
- gzprintf(fp, "*%s.ParamCustomStp%s Value/%s: \"\"\n", lang,
- desc.name, _("Value"));
- break;
-
- case STP_PARAMETER_TYPE_INT:
- if (!desc.is_mandatory)
- gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc.name,
- "None", _("None"));
- if (localize_numbers)
- {
- for (i = desc.bounds.integer.lower;
- i <= desc.bounds.integer.upper; i++)
- {
- gzprintf(fp, "*%s.Stp%s %d/%d: \"\"\n", lang,
- desc.name, i, i);
- }
- }
- gzprintf(fp, "*%s.ParamCustomStp%s Value/%s: \"\"\n", lang,
- desc.name, _("Value"));
- break;
-
- default:
- break;
- }
+ const stp_parameter_t *lparam =
+ stp_parameter_list_param(param_list, l);
+ if (lparam->p_class != j || lparam->p_level != k ||
+ is_special_option(lparam->name) || lparam->read_only ||
+ (lparam->p_type != STP_PARAMETER_TYPE_STRING_LIST &&
+ lparam->p_type != STP_PARAMETER_TYPE_BOOLEAN &&
+ lparam->p_type != STP_PARAMETER_TYPE_DIMENSION &&
+ lparam->p_type != STP_PARAMETER_TYPE_INT &&
+ lparam->p_type != STP_PARAMETER_TYPE_DOUBLE))
+ continue;
+ stp_describe_parameter(v, lparam->name, &desc);
+ if (desc.is_active)
+ print_one_localization(fp, po, simplified, lang,
+ lparam, &desc);
+ stp_parameter_description_destroy(&desc);
}
- stp_parameter_description_destroy(&desc);
}
}
- }
- stp_parameter_list_destroy(param_list);
- stp_describe_parameter(v, "ImageType", &desc);
- if (desc.is_active && desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
- {
- num_opts = stp_string_list_count(desc.bounds.str);
- if (num_opts > 0)
+ stp_parameter_list_destroy(param_list);
+ stp_describe_parameter(v, "ImageType", &desc);
+ if (desc.is_active && desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
{
- for (i = 0; i < num_opts; i++)
+ num_opts = stp_string_list_count(desc.bounds.str);
+ if (num_opts > 0)
{
- opt = stp_string_list_param(desc.bounds.str, i);
- if (strcmp(opt->name, "None") != 0)
- gzprintf(fp, "*%s.APPrinterPreset %s/%s: \"*StpImageType %s\"\n",
- lang, opt->name, opt->text, opt->name);
+ for (i = 0; i < num_opts; i++)
+ {
+ opt = stp_string_list_param(desc.bounds.str, i);
+ if (strcmp(opt->name, "None") != 0)
+ gzprintf(fp, "*%s.APPrinterPreset %s/%s: \"*StpImageType %s\"\n",
+ lang, opt->name, opt->text, opt->name);
+ }
}
}
+ stp_parameter_description_destroy(&desc);
}
- stp_parameter_description_destroy(&desc);
+ po = savepo;
}
- }
if (has_quality_parameter)
stp_free(default_resolution);
stp_string_list_destroy(resolutions);
-#undef _
-#define _(x) x
-
-
/*
* Fonts...
*/
- gzputs(fp, "\n*DefaultFont: Courier\n");
- gzputs(fp, "*Font AvantGarde-Book: Standard \"(001.006S)\" Standard ROM\n");
- gzputs(fp, "*Font AvantGarde-BookOblique: Standard \"(001.006S)\" Standard ROM\n");
- gzputs(fp, "*Font AvantGarde-Demi: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font AvantGarde-DemiOblique: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font Bookman-Demi: Standard \"(001.004S)\" Standard ROM\n");
- gzputs(fp, "*Font Bookman-DemiItalic: Standard \"(001.004S)\" Standard ROM\n");
- gzputs(fp, "*Font Bookman-Light: Standard \"(001.004S)\" Standard ROM\n");
- gzputs(fp, "*Font Bookman-LightItalic: Standard \"(001.004S)\" Standard ROM\n");
- gzputs(fp, "*Font Courier: Standard \"(002.004S)\" Standard ROM\n");
- gzputs(fp, "*Font Courier-Bold: Standard \"(002.004S)\" Standard ROM\n");
- gzputs(fp, "*Font Courier-BoldOblique: Standard \"(002.004S)\" Standard ROM\n");
- gzputs(fp, "*Font Courier-Oblique: Standard \"(002.004S)\" Standard ROM\n");
- gzputs(fp, "*Font Helvetica: Standard \"(001.006S)\" Standard ROM\n");
- gzputs(fp, "*Font Helvetica-Bold: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font Helvetica-BoldOblique: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font Helvetica-Narrow: Standard \"(001.006S)\" Standard ROM\n");
- gzputs(fp, "*Font Helvetica-Narrow-Bold: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font Helvetica-Narrow-BoldOblique: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font Helvetica-Narrow-Oblique: Standard \"(001.006S)\" Standard ROM\n");
- gzputs(fp, "*Font Helvetica-Oblique: Standard \"(001.006S)\" Standard ROM\n");
- gzputs(fp, "*Font NewCenturySchlbk-Bold: Standard \"(001.009S)\" Standard ROM\n");
- gzputs(fp, "*Font NewCenturySchlbk-BoldItalic: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font NewCenturySchlbk-Italic: Standard \"(001.006S)\" Standard ROM\n");
- gzputs(fp, "*Font NewCenturySchlbk-Roman: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font Palatino-Bold: Standard \"(001.005S)\" Standard ROM\n");
- gzputs(fp, "*Font Palatino-BoldItalic: Standard \"(001.005S)\" Standard ROM\n");
- gzputs(fp, "*Font Palatino-Italic: Standard \"(001.005S)\" Standard ROM\n");
- gzputs(fp, "*Font Palatino-Roman: Standard \"(001.005S)\" Standard ROM\n");
- gzputs(fp, "*Font Symbol: Special \"(001.007S)\" Special ROM\n");
- gzputs(fp, "*Font Times-Bold: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font Times-BoldItalic: Standard \"(001.009S)\" Standard ROM\n");
- gzputs(fp, "*Font Times-Italic: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font Times-Roman: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font ZapfChancery-MediumItalic: Standard \"(001.007S)\" Standard ROM\n");
- gzputs(fp, "*Font ZapfDingbats: Special \"(001.004S)\" Standard ROM\n");
-
- gzprintf(fp, "\n*%% End of stp-%s.%s%s%s\n",
- driver, GUTENPRINT_RELEASE_VERSION, simplified ? ".sim" : "",
- ppdext);
+ print_standard_fonts(fp);
+ gzprintf(fp, "\n*%% End of %s\n", filename);
stp_vars_destroy(v);
@@ -2361,5 +2563,5 @@ write_ppd(
/*
- * End of "$Id: genppd.c,v 1.179 2009/10/05 12:37:30 rlk Exp $".
+ * End of "$Id: genppd.c,v 1.186 2011/03/13 19:28:50 rlk Exp $".
*/
diff --git a/src/cups/rastertoprinter.c b/src/cups/rastertoprinter.c
index cf7cc38..38b685e 100644
--- a/src/cups/rastertoprinter.c
+++ b/src/cups/rastertoprinter.c
@@ -1,5 +1,5 @@
/*
- * "$Id: rastertoprinter.c,v 1.136 2008/10/04 17:47:50 rlk Exp $"
+ * "$Id: rastertoprinter.c,v 1.137 2011/04/09 00:19:59 rlk Exp $"
*
* Gutenprint based raster filter for the Common UNIX Printing System.
*
@@ -953,7 +953,7 @@ main(int argc, /* I - Number of command-line arguments */
*(ppd->nickname + strlen(ppd->modelname) +
strlen(CUPS_PPD_NICKNAME_STRING)) != ' ')))
{
- stp_i18n_printf(po, _("ERROR: The PPD version (%d) is not compatible with "
+ stp_i18n_printf(po, _("ERROR: The PPD version (%s) is not compatible with "
"Gutenprint %s.\n"),
ppd->nickname+strlen(ppd->modelname)+strlen(CUPS_PPD_NICKNAME_STRING),
version_id);
@@ -1445,5 +1445,5 @@ Image_width(stp_image_t *image) /* I - Image */
/*
- * End of "$Id: rastertoprinter.c,v 1.136 2008/10/04 17:47:50 rlk Exp $".
+ * End of "$Id: rastertoprinter.c,v 1.137 2011/04/09 00:19:59 rlk Exp $".
*/
diff --git a/src/cups/test-ppds b/src/cups/test-ppds
index a5fa5a7..4e60d2b 100755
--- a/src/cups/test-ppds
+++ b/src/cups/test-ppds
@@ -1,15 +1,18 @@
#!/bin/sh
-if [ "$#" = 0 ] ; then
- echo "Bypassing test-ppds for now due to bugs in cupstestppd!"
- exit 0
- rm -rf ppd ppd-stamp
- make ppd
-fi
+make ppd-clean ppd-global ppd-nls ppd-nonls
+
+# Most non-Macintosh systems won't have the Macintosh-specific profiles
+# installed in Macintosh-specific locations.
+#
+# Also, a number of our media sizes aren't named correctly, but we'll
+# accept those issues rather than cluttering the namespace further and/or
+# changing tag names.
+cupstestppdopts='-I profiles -W sizes'
ppd_count=`find ppd \( -name '*.ppd.gz' -o -name '*.ppd' \) -print | wc -l`
-failures="`find ppd -name '*.ppd*' -print | xargs cupstestppd |grep 'FAIL$' | awk -F: '{print $1}'`"
+failures="`find ppd -name '*.ppd*' -print | xargs cupstestppd $cupstestppdopts |grep 'FAIL$' | awk -F: '{print $1}'`"
if [ -z "$failures" ] ; then
echo "All $ppd_count PPD files pass"
@@ -17,12 +20,12 @@ if [ -z "$failures" ] ; then
fi
# Use this with "normal" PPD files without translated numbers.
-echo $failures | xargs cupstestppd 2>&1 | egrep -v 'Missing "[a-z][a-z](_[A-Z][A-Z])?" translation string for option Stp((Brightness|Contrast|Saturation), choice None|([a-zA-Z0-9]+, choice (-?[0-9]+)))!$' |egrep -v 'Missing cupsICCProfile file'
+#echo $failures | xargs cupstestppd $cupstestppdopts 2>&1 | egrep -v 'Missing "[a-z][a-z](_[A-Z][A-Z])?" translation string for option Stp((Brightness|Contrast|Saturation), choice None|([a-zA-Z0-9]+, choice (-?[0-9]+)))!$' |egrep -v 'Missing cupsICCProfile file'
# Use this with PPD files with translated numbers (genppd -N)
# With normal globalized PPD files this will yield hundreds of megabytes
# of errors.
-#echo $failures | xargs cupstestppd 2>&1 |egrep -v 'Missing cupsICCProfile file'
+echo $failures | xargs cupstestppd $cupstestppdopts 2>&1 |egrep -v 'Missing cupsICCProfile file'
fail_count=`echo "$failures" | wc -l`
echo "$fail_count/$ppd_count fail"