summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog41
-rw-r--r--Makefile.comm1
-rw-r--r--Makefile.in25
-rw-r--r--NEWS10
-rw-r--r--aclocal.m4132
-rwxr-xr-xconfigure402
-rw-r--r--configure.ac3
-rw-r--r--src/roff/troff/input.cpp13
-rw-r--r--tmac/papersize.tmac18
9 files changed, 465 insertions, 180 deletions
diff --git a/ChangeLog b/ChangeLog
index 20d34f6c..8bfd7aa0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2005-02-28 Werner LEMBERG <wl@gnu.org>
+
+ * src/roff/troff/input.cpp (string_iterator::fill): Protect against
+ null pointer.
+
+ * tmac/papersize.tmac: Convert `paper' string contents to lowercase.
+
+ * configure: Regenerated.
+
+ * NEWS: Updated.
+
+2005-02-28 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ Integrate `pdfmark' into normal groff build system;
+ install macro `pdfmark' packages, build and install `pdfroff',
+ and PDF format documentation.
+
+ * Makefile.comm: Add PDFDOCDIR.
+
+ * Makefile.in: (MDEFINES) ALT_AWK_PROGS, ALT_GHOSTSCRIPT_PROGS,
+ pdfdocdir, make_pdfdoc, make_install_pdfdoc: New variables.
+ (unstall_dirs): Add pdfdocdir.
+
+ * aclocal.m4: (GROFF_APPRESDIR_OPTION): use AC_HELP_STRING instead
+ of AS_HELP_STRING.
+ (GROFF_GHOSTSCRIPT_PREFS): New function; support `--with-alt-gs'
+ option, set ALT_GHOSTSCRIPT_PROGS.
+ (GROFF_GHOSTSCRIPT_PATH): Support `--with-gs' option, force use of
+ GROFF_GHOSTSCRIPT_PREFS, set GHOSTSCRIPT.
+ (GROFF_HTML_PROGRAMS): Force use of GROFF_GHOSTSCRIPT_PATH; tidy up.
+ (GROFF_AWK_PREFS): New function; support `--with-alt-awk' option,
+ set ALT_AWK_PROGS.
+ (GROFF_AWK_PATH): New function; support `--with-awk' option, force
+ use of GROFF_AWK_PREFS.
+ (GROFF_PDFDOC_PROGRAMS): New function; force use of GROFF_AWK_PATH
+ and GROFF_GHOSTSCRIPT_PATH, set make_pdfdoc and make_install_pdfdoc.
+
+ * configure.ac: Add AC_PREREQ(2.56), GROFF_PDFDOC_PROGRAMS.
+ Remove GROFF_GHOSTSCRIPT_PATH, (forced by GROFF_PDFDOC_PROGRAMS, and
+ also by modified GROFF_HTML_PROGRAMS).
+
2005-02-27 Gaius Mulley <gaius@glam.ac.uk>
* src/devices/grohtml/html-text.cpp (html_text::do_pre): Preserve
diff --git a/Makefile.comm b/Makefile.comm
index 5ecd73d8..ad631d78 100644
--- a/Makefile.comm
+++ b/Makefile.comm
@@ -148,6 +148,7 @@ extraclean: distclean
-e "s|@DOCDIR@|$(docdir)|g" \
-e "s|@EXAMPLEDIR@|$(exampledir)|g" \
-e "s|@HTMLDOCDIR@|$(htmldocdir)|g" \
+ -e "s|@PDFDOCDIR@|$(pdfdocdir)|g" \
-e "s|@DEVICE@|$(DEVICE)|g" \
-e "s|@DEFAULT_INDEX@|$(indexdir)/$(indexname)|g" \
-e "s|@DEFAULT_INDEX_NAME@|$(indexname)|g" \
diff --git a/Makefile.in b/Makefile.in
index 57428cda..c03b70b3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -44,9 +44,17 @@ revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(top_srcdir)/REVISION`
PAGE=@PAGE@
# The name of the ghostscript program. Normally, gs, on GNU/Linux
-# but it might be different on cygwin systems.
+# but it might be different on MS-DOS/MS-WIN32 systems.
GHOSTSCRIPT=@GHOSTSCRIPT@
+# `ALT_GHOSTSCRIPT_PROGS' specifies a list alternative names,
+# which can be tried if `GHOSTSCRIPT' cannot be found at run time.
+ALT_GHOSTSCRIPT_PROGS=@ALT_GHOSTSCRIPT_PROGS@
+
+# Similarly, `ALT_AWK_PROGS' specifies a list of alternative names,
+# which can be tried at run time, to identify the awk program.
+ALT_AWK_PROGS=@ALT_AWK_PROGS@
+
# Normally the Postscript driver, grops, produces output that conforms
# to version 3.0 of the Adobe Document Structuring Conventions.
# Unfortunately some spoolers and previewers can't handle such output.
@@ -135,6 +143,9 @@ exampledir=$(docdir)/examples
# `htmldocdir' says where to install documentation in HTML format.
htmldocdir=$(docdir)/html
+# `pdfdocdir' says where to install documentation in PDF format.
+pdfdocdir=$(docdir)/pdf
+
# `fontdir' says where to install dev*/*.
fontdir=$(datasubdir)/font
@@ -234,6 +245,11 @@ man7dir=$(manroot)/man$(man7ext)
make_html=@make_html@
make_install_html=@make_install_html@
+# The configure script also checks whether all necessary utility programs
+# for pdfroff are available -- only then we can build PDF documentation.
+make_pdfdoc=@make_pdfdoc@
+make_install_pdfdoc=@make_install_pdfdoc@
+
# DEFINES should include the following:
# -DHAVE_MMAP if you have mmap() and <sys/mman.h>
# -DARRAY_DELETE_NEEDS_SIZE if your C++ doesn't understand `delete []'
@@ -378,6 +394,8 @@ PURIFYCCFLAGS=
# copy of $(MDEFINES) when making individual directories; this could
# cause the argument list to become too long on some systems.
MDEFINES= \
+ "ALT_AWK_PROGS=$(ALT_AWK_PROGS)" \
+ "ALT_GHOSTSCRIPT_PROGS=$(ALT_GHOSTSCRIPT_PROGS)" \
"AR=$(AR)" \
"BROKEN_SPOOLER_FLAGS=$(BROKEN_SPOOLER_FLAGS)" \
"CC=$(CC)" \
@@ -440,6 +458,7 @@ MDEFINES= \
"fontpath=$(fontpath)" \
"g=$(g)" \
"htmldocdir=$(htmldocdir)" \
+ "pdfdocdir=$(pdfdocdir)" \
"indexdir=$(indexdir)" \
"indexext=$(indexext)" \
"indexname=$(indexname)" \
@@ -451,6 +470,8 @@ MDEFINES= \
"localtmacdir=$(localtmacdir)" \
"make_html=$(make_html)" \
"make_install_html=$(make_install_html)" \
+ "make_pdfdoc=$(make_pdfdoc)" \
+ "make_install_pdfdoc=$(make_install_pdfdoc)" \
"man1dir=$(man1dir)" \
"man1ext=$(man1ext)" \
"man5dir=$(man5dir)" \
@@ -713,7 +734,7 @@ uninstall_dirs:
$(tmacdir) $(systemtmacdir) $(localtmacdir) \
$(fontdir) $(localfontdir) $(bindir) \
$(datasubdir) $(dataprogramdir) $(datadir) $(infodir) \
- $(exampledir) $(htmldocdir) $(docdir) \
+ $(exampledir) $(htmldocdir) $(pdfdocdir) $(docdir) \
$(libprogramdir) $(libdir)
.PHONY: check docheck
diff --git a/NEWS b/NEWS
index 0cafe4ac..11798e25 100644
--- a/NEWS
+++ b/NEWS
@@ -87,6 +87,12 @@ o A new script contributed by Mike Bianchi. It compares two groff, nroff,
or troff documents and creates an output with added margin characters
(using `.mc') to indicate the differences.
+Pdfroff
+-------
+
+o A new wrapper script contributed by Keith Marshall to easily create PDF
+ documents with groff.
+
Macro packages
--------------
@@ -146,8 +152,8 @@ o www.tmac
Pdfmark
-------
-o A new macro package (together with a build script) contributed by Keith
- Marshall which implements PDF marks. This is in alpha stage currently.
+o A new macro package contributed by Keith Marshall which implements PDF
+ marks. This is in alpha stage currently.
Miscellaneous
-------------
diff --git a/aclocal.m4 b/aclocal.m4
index a74e6d31..d272bc45 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -60,57 +60,85 @@ AC_DEFUN([GROFF_PROG_YACC],
# The following programs are needed for grohtml.
AC_DEFUN([GROFF_HTML_PROGRAMS],
- [make_html=html
+ [AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH])
+ make_html=html
make_install_html=install_html
missing=
AC_FOREACH([groff_prog],
- [pnmcut pnmcrop pnmtopng psselect pnmtops gs],
+ [pnmcut pnmcrop pnmtopng psselect pnmtops],
[AC_CHECK_PROG(groff_prog, groff_prog, [found], [missing])
if test $[]groff_prog = missing; then
- missing="$missing groff_prog"
+ missing="$missing \`groff_prog'"
fi;])
+ test "$GHOSTSCRIPT" = "missing" && missing="$missing \`gs'"
+
if test -n "$missing"; then
- cnt=0
- for i in $missing
- do
- cnt=`expr $cnt + 1`
- eval "prog$cnt=$i"
- done
- plural="s"
- case $cnt in
- 1)
- plural=""
- progs="\`$prog1'" ;;
- 2)
- progs="\`$prog1' and \`$prog2'" ;;
- 3)
- progs="\`$prog1', \`$prog2', and \`$prog3'" ;;
- 4)
- progs="\`$prog1', \`$prog2', \`$prog3', and \`$prog4'" ;;
- 5)
- progs="\`$prog1', \`$prog2', \`$prog3', \`$prog4', and \`$prog5'" ;;
- 6)
- progs="\`$prog1', \`$prog2', \`$prog3', \`$prog4', \`$prog5', and \`$prog6'" ;;
- esac
+ plural=`set $missing; test $[#] -gt 1 && echo s`
+ missing=`set $missing
+ missing=""
+ while test $[#] -gt 0
+ do
+ case $[#] in
+ 1) missing="$missing$[1]" ;;
+ 2) missing="$missing$[1] and " ;;
+ *) missing="$missing$[1], " ;;
+ esac
+ shift
+ done
+ echo $missing`
make_html=
make_install_html=
- AC_MSG_WARN([
+ AC_MSG_WARN([missing program$plural:
The program$plural
- $progs
- can't be found in the path, thus the HTML backend of groff (grohtml)
- won't work properly. Consequently, no documentation in HTML format
- is built and installed.
+ $missing
+ cannot be found in the PATH.
+ Consequently, groff's HTML backend (grohtml) will not work properly;
+ therefore, it will neither be possible to prepare, nor to install,
+ documentation in HTML format.
])
fi
AC_SUBST([make_html])
AC_SUBST([make_install_html])])
+# To produce PDF docs, we need both awk and ghostscript.
+
+AC_DEFUN([GROFF_PDFDOC_PROGRAMS],
+ [AC_REQUIRE([GROFF_AWK_PATH])
+ AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH])
+
+ make_pdfdoc=pdfdoc
+ make_install_pdfdoc=install_pdfdoc
+
+ missing=""
+ test "$AWK" = missing && missing="\`awk'"
+ test "$GHOSTSCRIPT" = missing && missing="$missing \`gs'"
+ if test -n "$missing"; then
+ plural=`set $missing; test $[#] -eq 2 && echo s`
+ test x$plural = xs \
+ && missing=`set $missing; echo "$[1] and $[2]"` \
+ || missing=`echo $missing`
+
+ make_pdfdoc=
+ make_install_pdfdoc=
+
+ AC_MSG_WARN([missing program$plural:
+
+ The program$plural $missing cannot be found in the PATH.
+ Consequently, groff's PDF formatter (pdfroff) will not work properly;
+ therefore, it will neither be possible to prepare, nor to install,
+ documentation in PDF format.
+ ])
+ fi
+
+ AC_SUBST([make_pdfdoc])
+ AC_SUBST([make_install_pdfdoc])])
+
# Check whether pnmtops can handle the -nosetpage option.
AC_DEFUN([GROFF_PNMTOPS_NOSETPAGE],
@@ -124,11 +152,49 @@ AC_DEFUN([GROFF_PNMTOPS_NOSETPAGE],
fi
AC_SUBST([pnmtops_nosetpage])])
-# Check location of `gs'.
+# Check location of `gs'; allow `--with-gs=PROG' option to override.
AC_DEFUN([GROFF_GHOSTSCRIPT_PATH],
- [AC_PATH_TOOL(GHOSTSCRIPT, gs gsos2, missing)
- AC_SUBST(GHOSTSCRIPT)])
+ [AC_REQUIRE([GROFF_GHOSTSCRIPT_PREFS])
+ AC_ARG_WITH([gs],
+ [AS_HELP_STRING([--with-gs=PROG],
+ [actual [/path/]name of ghostscript executable])],
+ [GHOSTSCRIPT=$withval],
+ [AC_CHECK_TOOLS(GHOSTSCRIPT, [$ALT_GHOSTSCRIPT_PROGS], [missing])])
+ test "$GHOSTSCRIPT" = "no" && GHOSTSCRIPT=missing])
+
+# Preferences for choice of `gs' program...
+# (allow --with-alt-gs="LIST" to override).
+
+AC_DEFUN([GROFF_GHOSTSCRIPT_PREFS],
+ [AC_ARG_WITH([alt-gs],
+ [AS_HELP_STRING([--with-alt-gs=LIST],
+ [alternative names for ghostscript executable])],
+ [ALT_GHOSTSCRIPT_PROGS="$withval"],
+ [ALT_GHOSTSCRIPT_PROGS="gs gswin32c gsos2"])
+ AC_SUBST([ALT_GHOSTSCRIPT_PROGS])])
+
+# Check location of `awk'; allow `--with-awk=PROG' option to override.
+
+AC_DEFUN([GROFF_AWK_PATH],
+ [AC_REQUIRE([GROFF_AWK_PREFS])
+ AC_ARG_WITH([awk],
+ [AS_HELP_STRING([--with-awk=PROG],
+ [actual [/path/]name of awk executable])],
+ [AWK=$withval],
+ [AC_CHECK_TOOLS(AWK, [$ALT_AWK_PROGS], [missing])])
+ test "$AWK" = "no" && AWK=missing])
+
+# Preferences for choice of `awk' program; allow --with-alt-awk="LIST"
+# to override.
+
+AC_DEFUN([GROFF_AWK_PREFS],
+ [AC_ARG_WITH([alt-awk],
+ [AS_HELP_STRING([--with-alt-awk=LIST],
+ [alternative names for awk executable])],
+ [ALT_AWK_PROGS="$withval"],
+ [ALT_AWK_PROGS="gawk mawk nawk awk"])
+ AC_SUBST([ALT_AWK_PROGS])])
# GROFF_CSH_HACK(if hack present, if not present)
diff --git a/configure b/configure
index e0dfdb5b..845617b1 100755
--- a/configure
+++ b/configure
@@ -540,7 +540,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX TTYDEVDIRS OTHERDEVDIRS CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XDEVDIRS XPROGDIRS XLIBDIRS appresdir LPR LP LPQ PSPRINT DVIPRINT PERLPATH YACC RANLIB ac_ct_RANLIB INSTALL_INFO INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SH_SCRIPT_SED_CMD GREP EGREP LIBC LIBM LIBOBJS BROKEN_SPOOLER_FLAGS PAGE g sys_tmac_prefix tmac_wrap GROFF_PATH_SEPARATOR pnmcut pnmcrop pnmtopng psselect pnmtops gs make_html make_install_html pnmtops_nosetpage GHOSTSCRIPT ac_pt_GHOSTSCRIPT LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX TTYDEVDIRS OTHERDEVDIRS CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XDEVDIRS XPROGDIRS XLIBDIRS appresdir LPR LP LPQ PSPRINT DVIPRINT PERLPATH YACC RANLIB ac_ct_RANLIB INSTALL_INFO INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SH_SCRIPT_SED_CMD GREP EGREP LIBC LIBM LIBOBJS BROKEN_SPOOLER_FLAGS PAGE g sys_tmac_prefix tmac_wrap GROFF_PATH_SEPARATOR ALT_GHOSTSCRIPT_PROGS GHOSTSCRIPT ac_ct_GHOSTSCRIPT pnmcut pnmcrop pnmtopng psselect pnmtops make_html make_install_html ALT_AWK_PROGS AWK ac_ct_AWK make_pdfdoc make_install_pdfdoc pnmtops_nosetpage LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -1088,6 +1088,10 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-x use the X Window System
--with-appresdir=DIR X11 application resource files
+ --with-alt-gs=LIST alternative names for ghostscript executable
+ --with-gs=PROG actual [/path/]name of ghostscript executable
+ --with-alt-awk=LIST alternative names for awk executable
+ --with-awk=PROG actual [/path/]name of awk executable
Some influential environment variables:
CC C compiler command
@@ -1542,6 +1546,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
ac_config_headers="$ac_config_headers src/include/config.h:src/include/config.hin"
@@ -9912,7 +9917,124 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $GROFF_PATH_SEPARATOR" >&5
echo "${ECHO_T}$GROFF_PATH_SEPARATOR" >&6
-make_html=html
+
+# Check whether --with-alt-gs or --without-alt-gs was given.
+if test "${with_alt_gs+set}" = set; then
+ withval="$with_alt_gs"
+ ALT_GHOSTSCRIPT_PROGS="$withval"
+else
+ ALT_GHOSTSCRIPT_PROGS="gs gswin32c gsos2"
+fi;
+
+
+
+# Check whether --with-gs or --without-gs was given.
+if test "${with_gs+set}" = set; then
+ withval="$with_gs"
+ GHOSTSCRIPT=$withval
+else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in $ALT_GHOSTSCRIPT_PROGS
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GHOSTSCRIPT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$GHOSTSCRIPT"; then
+ ac_cv_prog_GHOSTSCRIPT="$GHOSTSCRIPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_GHOSTSCRIPT="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+GHOSTSCRIPT=$ac_cv_prog_GHOSTSCRIPT
+if test -n "$GHOSTSCRIPT"; then
+ echo "$as_me:$LINENO: result: $GHOSTSCRIPT" >&5
+echo "${ECHO_T}$GHOSTSCRIPT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$GHOSTSCRIPT" && break
+ done
+fi
+if test -z "$GHOSTSCRIPT"; then
+ ac_ct_GHOSTSCRIPT=$GHOSTSCRIPT
+ for ac_prog in $ALT_GHOSTSCRIPT_PROGS
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_GHOSTSCRIPT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_GHOSTSCRIPT"; then
+ ac_cv_prog_ac_ct_GHOSTSCRIPT="$ac_ct_GHOSTSCRIPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_GHOSTSCRIPT="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_GHOSTSCRIPT=$ac_cv_prog_ac_ct_GHOSTSCRIPT
+if test -n "$ac_ct_GHOSTSCRIPT"; then
+ echo "$as_me:$LINENO: result: $ac_ct_GHOSTSCRIPT" >&5
+echo "${ECHO_T}$ac_ct_GHOSTSCRIPT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_GHOSTSCRIPT" && break
+done
+
+ if test "x$ac_ct_GHOSTSCRIPT" = x; then
+ GHOSTSCRIPT="missing"
+ else
+ if test "$build" != "$host"; then
+ { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ fi
+ GHOSTSCRIPT=$ac_ct_GHOSTSCRIPT
+ fi
+fi
+
+fi;
+ test "$GHOSTSCRIPT" = "no" && GHOSTSCRIPT=missing
+
+ make_html=html
make_install_html=install_html
missing=
@@ -9953,7 +10075,7 @@ echo "${ECHO_T}no" >&6
fi
if test $pnmcut = missing; then
- missing="$missing pnmcut"
+ missing="$missing \`pnmcut'"
fi;# Extract the first word of "pnmcrop", so it can be a program name with args.
set dummy pnmcrop; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -9991,7 +10113,7 @@ echo "${ECHO_T}no" >&6
fi
if test $pnmcrop = missing; then
- missing="$missing pnmcrop"
+ missing="$missing \`pnmcrop'"
fi;# Extract the first word of "pnmtopng", so it can be a program name with args.
set dummy pnmtopng; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -10029,7 +10151,7 @@ echo "${ECHO_T}no" >&6
fi
if test $pnmtopng = missing; then
- missing="$missing pnmtopng"
+ missing="$missing \`pnmtopng'"
fi;# Extract the first word of "psselect", so it can be a program name with args.
set dummy psselect; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -10067,7 +10189,7 @@ echo "${ECHO_T}no" >&6
fi
if test $psselect = missing; then
- missing="$missing psselect"
+ missing="$missing \`psselect'"
fi;# Extract the first word of "pnmtops", so it can be a program name with args.
set dummy pnmtops; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -10105,190 +10227,152 @@ echo "${ECHO_T}no" >&6
fi
if test $pnmtops = missing; then
- missing="$missing pnmtops"
- fi;# Extract the first word of "gs", so it can be a program name with args.
-set dummy gs; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_gs+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$gs"; then
- ac_cv_prog_gs="$gs" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_gs="found"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_prog_gs" && ac_cv_prog_gs="missing"
-fi
-fi
-gs=$ac_cv_prog_gs
-if test -n "$gs"; then
- echo "$as_me:$LINENO: result: $gs" >&5
-echo "${ECHO_T}$gs" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
- if test $gs = missing; then
- missing="$missing gs"
+ missing="$missing \`pnmtops'"
fi;
+ test "$GHOSTSCRIPT" = "missing" && missing="$missing \`gs'"
+
if test -n "$missing"; then
- cnt=0
- for i in $missing
- do
- cnt=`expr $cnt + 1`
- eval "prog$cnt=$i"
- done
- plural="s"
- case $cnt in
- 1)
- plural=""
- progs="\`$prog1'" ;;
- 2)
- progs="\`$prog1' and \`$prog2'" ;;
- 3)
- progs="\`$prog1', \`$prog2', and \`$prog3'" ;;
- 4)
- progs="\`$prog1', \`$prog2', \`$prog3', and \`$prog4'" ;;
- 5)
- progs="\`$prog1', \`$prog2', \`$prog3', \`$prog4', and \`$prog5'" ;;
- 6)
- progs="\`$prog1', \`$prog2', \`$prog3', \`$prog4', \`$prog5', and \`$prog6'" ;;
- esac
+ plural=`set $missing; test $# -gt 1 && echo s`
+ missing=`set $missing
+ missing=""
+ while test $# -gt 0
+ do
+ case $# in
+ 1) missing="$missing$1" ;;
+ 2) missing="$missing$1 and " ;;
+ *) missing="$missing$1, " ;;
+ esac
+ shift
+ done
+ echo $missing`
make_html=
make_install_html=
- { echo "$as_me:$LINENO: WARNING:
+ { echo "$as_me:$LINENO: WARNING: missing program$plural:
The program$plural
- $progs
- can't be found in the path, thus the HTML backend of groff (grohtml)
- won't work properly. Consequently, no documentation in HTML format
- is built and installed.
+ $missing
+ cannot be found in the PATH.
+ Consequently, groff's HTML backend (grohtml) will not work properly;
+ therefore, it will neither be possible to prepare, nor to install,
+ documentation in HTML format.
" >&5
-echo "$as_me: WARNING:
+echo "$as_me: WARNING: missing program$plural:
The program$plural
- $progs
- can't be found in the path, thus the HTML backend of groff (grohtml)
- won't work properly. Consequently, no documentation in HTML format
- is built and installed.
+ $missing
+ cannot be found in the PATH.
+ Consequently, groff's HTML backend (grohtml) will not work properly;
+ therefore, it will neither be possible to prepare, nor to install,
+ documentation in HTML format.
" >&2;}
fi
-echo "$as_me:$LINENO: checking whether pnmtops can handle the -nosetpage option" >&5
-echo $ECHO_N "checking whether pnmtops can handle the -nosetpage option... $ECHO_C" >&6
- if echo P2 2 2 255 0 1 2 0 | pnmtops -nosetpage > /dev/null 2>&1 ; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- pnmtops_nosetpage="pnmtops -nosetpage"
- else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- pnmtops_nosetpage="pnmtops"
- fi
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gs gsos2", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gs gsos2; ac_word=$2
+# Check whether --with-alt-awk or --without-alt-awk was given.
+if test "${with_alt_awk+set}" = set; then
+ withval="$with_alt_awk"
+ ALT_AWK_PROGS="$withval"
+else
+ ALT_AWK_PROGS="gawk mawk nawk awk"
+fi;
+
+
+
+# Check whether --with-awk or --without-awk was given.
+if test "${with_awk+set}" = set; then
+ withval="$with_awk"
+ AWK=$withval
+else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in $ALT_AWK_PROGS
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_GHOSTSCRIPT+set}" = set; then
+if test "${ac_cv_prog_AWK+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case $GHOSTSCRIPT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GHOSTSCRIPT="$GHOSTSCRIPT" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_GHOSTSCRIPT="$as_dir/$ac_word$ac_exec_ext"
+ ac_cv_prog_AWK="$ac_tool_prefix$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
- ;;
-esac
fi
-GHOSTSCRIPT=$ac_cv_path_GHOSTSCRIPT
-
-if test -n "$GHOSTSCRIPT"; then
- echo "$as_me:$LINENO: result: $GHOSTSCRIPT" >&5
-echo "${ECHO_T}$GHOSTSCRIPT" >&6
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
+ test -n "$AWK" && break
+ done
fi
-if test -z "$ac_cv_path_GHOSTSCRIPT"; then
- ac_pt_GHOSTSCRIPT=$GHOSTSCRIPT
- # Extract the first word of "gs gsos2", so it can be a program name with args.
-set dummy gs gsos2; ac_word=$2
+if test -z "$AWK"; then
+ ac_ct_AWK=$AWK
+ for ac_prog in $ALT_AWK_PROGS
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_ac_pt_GHOSTSCRIPT+set}" = set; then
+if test "${ac_cv_prog_ac_ct_AWK+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case $ac_pt_GHOSTSCRIPT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_GHOSTSCRIPT="$ac_pt_GHOSTSCRIPT" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ if test -n "$ac_ct_AWK"; then
+ ac_cv_prog_ac_ct_AWK="$ac_ct_AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_ac_pt_GHOSTSCRIPT="$as_dir/$ac_word$ac_exec_ext"
+ ac_cv_prog_ac_ct_AWK="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
- ;;
-esac
fi
-ac_pt_GHOSTSCRIPT=$ac_cv_path_ac_pt_GHOSTSCRIPT
-
-if test -n "$ac_pt_GHOSTSCRIPT"; then
- echo "$as_me:$LINENO: result: $ac_pt_GHOSTSCRIPT" >&5
-echo "${ECHO_T}$ac_pt_GHOSTSCRIPT" >&6
+fi
+ac_ct_AWK=$ac_cv_prog_ac_ct_AWK
+if test -n "$ac_ct_AWK"; then
+ echo "$as_me:$LINENO: result: $ac_ct_AWK" >&5
+echo "${ECHO_T}$ac_ct_AWK" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
- if test "x$ac_pt_GHOSTSCRIPT" = x; then
- GHOSTSCRIPT="missing"
+ test -n "$ac_ct_AWK" && break
+done
+
+ if test "x$ac_ct_AWK" = x; then
+ AWK="missing"
else
if test "$build" != "$host"; then
{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
@@ -10298,12 +10382,59 @@ echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet. If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
fi
- GHOSTSCRIPT=$ac_pt_GHOSTSCRIPT
+ AWK=$ac_ct_AWK
fi
-else
- GHOSTSCRIPT="$ac_cv_path_GHOSTSCRIPT"
fi
+fi;
+ test "$AWK" = "no" && AWK=missing
+
+
+
+ make_pdfdoc=pdfdoc
+ make_install_pdfdoc=install_pdfdoc
+
+ missing=""
+ test "$AWK" = missing && missing="\`awk'"
+ test "$GHOSTSCRIPT" = missing && missing="$missing \`gs'"
+ if test -n "$missing"; then
+ plural=`set $missing; test $# -eq 2 && echo s`
+ test x$plural = xs \
+ && missing=`set $missing; echo "$1 and $2"` \
+ || missing=`echo $missing`
+
+ make_pdfdoc=
+ make_install_pdfdoc=
+
+ { echo "$as_me:$LINENO: WARNING: missing program$plural:
+
+ The program$plural $missing cannot be found in the PATH.
+ Consequently, groff's PDF formatter (pdfroff) will not work properly;
+ therefore, it will neither be possible to prepare, nor to install,
+ documentation in PDF format.
+ " >&5
+echo "$as_me: WARNING: missing program$plural:
+
+ The program$plural $missing cannot be found in the PATH.
+ Consequently, groff's PDF formatter (pdfroff) will not work properly;
+ therefore, it will neither be possible to prepare, nor to install,
+ documentation in PDF format.
+ " >&2;}
+ fi
+
+
+
+echo "$as_me:$LINENO: checking whether pnmtops can handle the -nosetpage option" >&5
+echo $ECHO_N "checking whether pnmtops can handle the -nosetpage option... $ECHO_C" >&6
+ if echo P2 2 2 255 0 1 2 0 | pnmtops -nosetpage > /dev/null 2>&1 ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ pnmtops_nosetpage="pnmtops -nosetpage"
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ pnmtops_nosetpage="pnmtops"
+ fi
ac_config_files="$ac_config_files stamp-h"
@@ -10964,17 +11095,22 @@ s,@g@,$g,;t t
s,@sys_tmac_prefix@,$sys_tmac_prefix,;t t
s,@tmac_wrap@,$tmac_wrap,;t t
s,@GROFF_PATH_SEPARATOR@,$GROFF_PATH_SEPARATOR,;t t
+s,@ALT_GHOSTSCRIPT_PROGS@,$ALT_GHOSTSCRIPT_PROGS,;t t
+s,@GHOSTSCRIPT@,$GHOSTSCRIPT,;t t
+s,@ac_ct_GHOSTSCRIPT@,$ac_ct_GHOSTSCRIPT,;t t
s,@pnmcut@,$pnmcut,;t t
s,@pnmcrop@,$pnmcrop,;t t
s,@pnmtopng@,$pnmtopng,;t t
s,@psselect@,$psselect,;t t
s,@pnmtops@,$pnmtops,;t t
-s,@gs@,$gs,;t t
s,@make_html@,$make_html,;t t
s,@make_install_html@,$make_install_html,;t t
+s,@ALT_AWK_PROGS@,$ALT_AWK_PROGS,;t t
+s,@AWK@,$AWK,;t t
+s,@ac_ct_AWK@,$ac_ct_AWK,;t t
+s,@make_pdfdoc@,$make_pdfdoc,;t t
+s,@make_install_pdfdoc@,$make_install_pdfdoc,;t t
s,@pnmtops_nosetpage@,$pnmtops_nosetpage,;t t
-s,@GHOSTSCRIPT@,$GHOSTSCRIPT,;t t
-s,@ac_pt_GHOSTSCRIPT@,$ac_pt_GHOSTSCRIPT,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
diff --git a/configure.ac b/configure.ac
index fccd5c2a..0d8df42b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,6 @@
# Process this file with autoconf to produce a configure script.
AC_INIT
+AC_PREREQ(2.59)
AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin])
AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp])
@@ -91,8 +92,8 @@ GROFF_G
GROFF_TMAC
GROFF_TARGET_PATH_SEPARATOR
GROFF_HTML_PROGRAMS
+GROFF_PDFDOC_PROGRAMS
GROFF_PNMTOPS_NOSETPAGE
-GROFF_GHOSTSCRIPT_PATH
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
AC_CONFIG_FILES([Makefile doc/Makefile src/utils/xtotroff/Makefile])
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 70d23fe4..f4a718b2 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -3398,12 +3398,13 @@ int string_iterator::fill(node **np)
p = bp->s;
}
if (*p == '\0') {
- if (np)
+ if (np) {
*np = nd->copy();
- if (is_diversion())
- (*np)->div_nest_level = input_stack::get_div_level();
- else
- (*np)->div_nest_level = 0;
+ if (is_diversion())
+ (*np)->div_nest_level = input_stack::get_div_level();
+ else
+ (*np)->div_nest_level = 0;
+ }
nd = nd->next;
eptr = ptr = p + 1;
count--;
diff --git a/tmac/papersize.tmac b/tmac/papersize.tmac
index fdfb5801..57403491 100644
--- a/tmac/papersize.tmac
+++ b/tmac/papersize.tmac
@@ -7,9 +7,9 @@
.\" groff ... -dpaper=<format> ...
.\"
.\" Possible values for `format' are the same as the predefined `papersize'
-.\" values (only lowercase; see the groff_font man page) except a7-d7.
-.\" An appended `l' (ell) character denotes landscape orientation.
-.\" Examples: `a4', `c3l', `letterl'.
+.\" values (see the groff_font man page) except a7-d7. An appended `l'
+.\" (ell) character denotes landscape orientation. Examples: `a4', `c3l',
+.\" `letterl'.
.\"
.\" Most output drivers need additional command line switches `-p' and
.\" `-l' to override the default paper length and orientation as set in
@@ -104,6 +104,18 @@
. ds paper-dl-length 22c
. ds paper-dl-width 11c
.
+. \" We assume that letters a-z and A-Z aren't mapped during start-up.
+. tr AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz
+. di lowercase
+. nop \*[paper]
+. br
+. di
+. asciify lowercase
+. chop lowercase
+. tr AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ
+. ds paper \*[lowercase]
+. rm lowercase
+.
. ds paper-p \*[paper]
. ds paper-l \*[paper]
. length paper-n \*[paper]