summaryrefslogtreecommitdiff
blob: 0f7f338ba1144d86adb590fec3ec0c6f0b093436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Index: man-db-2.5.6/src/man.c
===================================================================
--- man-db-2.5.6.orig/src/man.c
+++ man-db-2.5.6/src/man.c
@@ -257,15 +257,19 @@ error_t argp_err_exit_status = FAIL;
 
 static const char args_doc[] = N_("[SECTION] PAGE...");
 
+# ifdef TROFF_IS_GROFF
+#  define MAYBE_HIDDEN 0
+# else
+#  define MAYBE_HIDDEN OPTION_HIDDEN
+# endif
+
 /* Please keep these options in the same order as in parse_opt below. */
 static struct argp_option options[] = {
 	{ "config-file",	'C',	N_("FILE"),	0,		N_("use this user configuration file") },
 	{ "debug",		'd',	0,		0,		N_("emit debugging messages") },
 	{ "default",		'D',	0,		0,		N_("reset all options to their default values") },
-#ifdef TROFF_IS_GROFF
-	{ "warnings",  OPT_WARNINGS,    N_("WARNINGS"), OPTION_ARG_OPTIONAL,
+	{ "warnings",  OPT_WARNINGS,    N_("WARNINGS"), MAYBE_HIDDEN | OPTION_ARG_OPTIONAL,
 									N_("enable warnings from groff") },
-#endif /* TROFF_IS_GROFF */
 
 	{ 0,			0,	0,		0,		N_("Main modes of operation:"),					10 },
 	{ "whatis",		'f',	0,		0,		N_("equivalent to whatis") },
@@ -312,11 +316,6 @@ static struct argp_option options[] = {
 	{ "troff",		't',	0,		0,		N_("use %s to format pages"),					32 },
 	{ "troff-device",	'T',	N_("DEVICE"),	OPTION_ARG_OPTIONAL,
 									N_("use %s with selected device") },
-# ifdef TROFF_IS_GROFF
-#  define MAYBE_HIDDEN 0
-# else
-#  define MAYBE_HIDDEN OPTION_HIDDEN
-# endif
 	{ "html",		'H',	N_("BROWSER"),	MAYBE_HIDDEN | OPTION_ARG_OPTIONAL,
 									N_("use %s or BROWSER to display HTML output"),			33 },
 	{ "gxditview",		'X',	N_("RESOLUTION"),
@@ -362,8 +361,8 @@ static error_t parse_opt (int key, char 
 			colon_sep_section_list = manp = NULL;
 			return 0;
 
-#ifdef TROFF_IS_GROFF
 		case OPT_WARNINGS:
+#ifdef TROFF_IS_GROFF
 			{
 				char *s = xstrdup
 					(arg ? arg : default_roff_warnings);
@@ -380,8 +379,8 @@ static error_t parse_opt (int key, char 
 
 				free (s);
 			}
-			return 0;
 #endif /* TROFF_IS_GROFF */
+			return 0;
 
 		case 'f':
 			external = WHATIS;
@@ -1596,18 +1595,23 @@ static pipeline *make_roff_command (cons
 								  NULL);
 					command_arg (cmd, tmpdev);
 					free (tmpdev);
-				} else if (gxditview) {
+				}
+#ifdef TROFF_IS_GROFF
+				else if (gxditview) {
 					char *tmpdev = appendstr (NULL, "-TX",
 								  gxditview,
 								  NULL);
 					command_arg (cmd, tmpdev);
 					free (tmpdev);
 				}
+#endif /* TROFF_IS_GROFF */
 			}
 
 			if (wants_post) {
+#ifdef TROFF_IS_GROFF
 				if (gxditview)
 					command_arg (cmd, "-X");
+#endif /* TROFF_IS_GROFF */
 
 				if (roff_device && STREQ (roff_device, "ps"))
 					/* Tell grops to guess the page
Index: man-db-2.5.6/configure.ac
===================================================================
--- man-db-2.5.6.orig/configure.ac
+++ man-db-2.5.6/configure.ac
@@ -213,6 +213,7 @@ else
 	AC_CHECK_PROGS(troff, troff gtroff)
 	TROFF=troff
 fi
+AC_SUBST([TROFF])
 if test -n "$troff"
 then
 	AC_DEFINE(HAS_TROFF, 1, [Define if you have troff.])
Index: man-db-2.5.6/manual/Makefile.am
===================================================================
--- man-db-2.5.6.orig/manual/Makefile.am
+++ man-db-2.5.6/manual/Makefile.am
@@ -59,13 +59,13 @@ $(MANUAL).pp: $(ME_FILES) version
 	$(SOELIM) -I$(srcdir) man_db.me | tbl > $@
 
 .pp.dvi:
-	groff -me -Tdvi $< > $@
+	$(TROFF) -me -Tdvi $< > $@
 
 .pp.ps:
-	groff -me -Tps $< > $@
+	$(TROFF) -me -Tps $< > $@
 
 .pp.tdvi:
-	troff -me -Tdvi $< | grodvi -d > $@
+	$(TROFF) -me -Tdvi $< | grodvi -d > $@
 
 .tdvi.tps:
 	dvips -f -t a4 $< > $@
@@ -74,7 +74,7 @@ $(MANUAL).pp: $(ME_FILES) version
 	nroff -me $< > $@
 
 .pp.html:
-	groff -me -Thtml -P-I$* $< > $@
+	$(TROFF) -me -Thtml -P-I$* $< > $@
 
 # Automake defines these targets already, so we need to use -local.
 dvi-local: $(MANUAL).dvi