Browse code

doc: enable compilation of -all tool pages

In particular, add documentation configuration system, through the
doc/config.texi file.

Fix trac issue #2374.

Stefano Sabatini authored on 2013/03/20 04:54:26
Showing 8 changed files
... ...
@@ -29,6 +29,7 @@
29 29
 /doc/*.3
30 30
 /doc/*.html
31 31
 /doc/*.pod
32
+/doc/config.texi
32 33
 /doc/avoptions_codec.texi
33 34
 /doc/avoptions_format.texi
34 35
 /doc/examples/decoding_encoding
... ...
@@ -658,6 +658,12 @@ print_config(){
658 658
                 } else if (file ~ /\\.mak\$/) {
659 659
                     n = -v ? \"\" : \"!\";
660 660
                     printf(\"%s%s=yes\\n\", n, c) >>file;
661
+                } else if (file ~ /\\.texi\$/) {
662
+                    pre = -v ? \"\" : \"@c \";
663
+                    yesno = \$2;
664
+                    c2 = tolower(c);
665
+                    gsub(/_/, \"-\", c2);
666
+                    printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
661 667
                 }
662 668
             }
663 669
         }"
... ...
@@ -4406,13 +4412,13 @@ fi
4406 4406
 
4407 4407
 echo "License: $license"
4408 4408
 
4409
-echo "Creating config.mak and config.h..."
4409
+echo "Creating config.mak, config.h, and doc/config.texi..."
4410 4410
 
4411 4411
 test -e Makefile || $ln_s "$source_path/Makefile" .
4412 4412
 
4413 4413
 enabled stripping || strip="echo skipping strip"
4414 4414
 
4415
-config_files="$TMPH config.mak"
4415
+config_files="$TMPH config.mak doc/config.texi"
4416 4416
 
4417 4417
 cat > config.mak <<EOF
4418 4418
 # Automatically generated by configure - do not modify!
... ...
@@ -4564,6 +4570,9 @@ if enabled yasm; then
4564 4564
     printf '' >$TMPASM
4565 4565
 fi
4566 4566
 
4567
+mkdir -p doc
4568
+echo "@c auto-generated by configure" > doc/config.texi
4569
+
4567 4570
 print_config ARCH_   "$config_files" $ARCH_LIST
4568 4571
 print_config HAVE_   "$config_files" $HAVE_LIST
4569 4572
 print_config CONFIG_ "$config_files" $CONFIG_LIST       \
... ...
@@ -6,7 +6,6 @@ LIBRARIES-$(CONFIG_AVFORMAT)   += libavformat
6 6
 LIBRARIES-$(CONFIG_AVDEVICE)   += libavdevice
7 7
 LIBRARIES-$(CONFIG_AVFILTER)   += libavfilter
8 8
 
9
-COMPONENTS-yes = $(PROGS-yes)
10 9
 COMPONENTS-$(CONFIG_AVUTIL)     += ffmpeg-utils
11 10
 COMPONENTS-$(CONFIG_SWSCALE)    += ffmpeg-scaler
12 11
 COMPONENTS-$(CONFIG_SWRESAMPLE) += ffmpeg-resampler
... ...
@@ -15,9 +14,9 @@ COMPONENTS-$(CONFIG_AVFORMAT)   += ffmpeg-formats ffmpeg-protocols
15 15
 COMPONENTS-$(CONFIG_AVDEVICE)   += ffmpeg-devices
16 16
 COMPONENTS-$(CONFIG_AVFILTER)   += ffmpeg-filters
17 17
 
18
-MANPAGES    = $(COMPONENTS-yes:%=doc/%.1)    $(LIBRARIES-yes:%=doc/%.3)
19
-PODPAGES    = $(COMPONENTS-yes:%=doc/%.pod)  $(LIBRARIES-yes:%=doc/%.pod)
20
-HTMLPAGES   = $(COMPONENTS-yes:%=doc/%.html) $(LIBRARIES-yes:%=doc/%.html)     \
18
+MANPAGES    = $(PROGS-yes:%=doc/%.1)    $(PROGS-yes:%=doc/%-all.1)    $(COMPONENTS-yes:%=doc/%.1)    $(LIBRARIES-yes:%=doc/%.3)
19
+PODPAGES    = $(PROGS-yes:%=doc/%.pod)  $(PROGS-yes:%=doc/%-all.pod)  $(COMPONENTS-yes:%=doc/%.pod)  $(LIBRARIES-yes:%=doc/%.pod)
20
+HTMLPAGES   = $(PROGS-yes:%=doc/%.html) $(PROGS-yes:%=doc/%-all.html) $(COMPONENTS-yes:%=doc/%.html) $(LIBRARIES-yes:%=doc/%.html) \
21 21
               doc/developer.html                                        \
22 22
               doc/faq.html                                              \
23 23
               doc/fate.html                                             \
... ...
@@ -59,12 +58,22 @@ $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
59 59
 doc/%.html: TAG = HTML
60 60
 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
61 61
 	$(Q)$(TEXIDEP)
62
-	$(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
62
+	$(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
63
+
64
+doc/%-all.html: TAG = HTML
65
+doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
66
+	$(Q)$(TEXIDEP)
67
+	$(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
63 68
 
64 69
 doc/%.pod: TAG = POD
65 70
 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
66 71
 	$(Q)$(TEXIDEP)
67
-	$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
72
+	$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@
73
+
74
+doc/%-all.pod: TAG = POD
75
+doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
76
+	$(Q)$(TEXIDEP)
77
+	$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
68 78
 
69 79
 doc/%.1 doc/%.3: TAG = MAN
70 80
 doc/%.1: doc/%.pod $(GENTEXI)
... ...
@@ -94,6 +103,9 @@ uninstall-man:
94 94
 
95 95
 clean:: docclean
96 96
 
97
+distclean:: docclean
98
+	$(RM) doc/config.texi
99
+
97 100
 docclean:
98 101
 	$(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
99 102
 	$(RM) -r doc/doxy/html
100 103
new file mode 100644
... ...
@@ -0,0 +1,32 @@
0
+@include config.texi
1
+
2
+@ifset config-avutil
3
+@include syntax.texi
4
+@include eval.texi
5
+@end ifset
6
+
7
+@ifset config-avcodec
8
+@include codecs.texi
9
+@include bitstream_filters.texi
10
+@end ifset
11
+
12
+@ifset config-avformat
13
+@include formats.texi
14
+@include protocols.texi
15
+@end ifset
16
+
17
+@ifset config-avdevice
18
+@include devices.texi
19
+@end ifset
20
+
21
+@ifset config-swresample
22
+@include resampler.texi
23
+@end ifset
24
+
25
+@ifset config-swscale
26
+@include scaler.texi
27
+@end ifset
28
+
29
+@ifset config-avfilter
30
+@include filters.texi
31
+@end ifset
... ...
@@ -1362,9 +1362,19 @@ ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
1362 1362
 @end itemize
1363 1363
 @c man end EXAMPLES
1364 1364
 
1365
+@ifset config-all
1366
+@include all-components.texi
1367
+@end ifset
1368
+
1365 1369
 @chapter See Also
1366 1370
 
1367 1371
 @ifhtml
1372
+@ifset config-all
1373
+@url{ffmpeg.html,ffmpeg}
1374
+@end ifset
1375
+@ifset config-not-all
1376
+@url{ffmpeg-all.html,ffmpeg-all},
1377
+@end ifset
1368 1378
 @url{ffplay.html,ffplay}, @url{ffprobe.html,ffprobe}, @url{ffserver.html,ffserver},
1369 1379
 @url{ffmpeg-utils.html,ffmpeg-utils},
1370 1380
 @url{ffmpeg-scaler.html,ffmpeg-scaler},
... ...
@@ -1378,6 +1388,12 @@ ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
1378 1378
 @end ifhtml
1379 1379
 
1380 1380
 @ifnothtml
1381
+@ifset config-all
1382
+ffmpeg(1),
1383
+@end ifset
1384
+@ifset config-not-all
1385
+ffmpeg-all(1),
1386
+@end ifset
1381 1387
 ffplay(1), ffprobe(1), ffserver(1),
1382 1388
 ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
1383 1389
 ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
... ...
@@ -201,9 +201,19 @@ Seek to percentage in file corresponding to fraction of width.
201 201
 
202 202
 @c man end
203 203
 
204
+@ifset config-all
205
+@include all-components.texi
206
+@end ifset
207
+
204 208
 @chapter See Also
205 209
 
206 210
 @ifhtml
211
+@ifset config-all
212
+@url{ffplay.html,ffplay},
213
+@end ifset
214
+@ifset config-not-all
215
+@url{ffplay-all.html,ffmpeg-all},
216
+@end ifset
207 217
 @url{ffmpeg.html,ffmpeg}, @url{ffprobe.html,ffprobe}, @url{ffserver.html,ffserver},
208 218
 @url{ffmpeg-utils.html,ffmpeg-utils},
209 219
 @url{ffmpeg-scaler.html,ffmpeg-scaler},
... ...
@@ -217,6 +227,12 @@ Seek to percentage in file corresponding to fraction of width.
217 217
 @end ifhtml
218 218
 
219 219
 @ifnothtml
220
+@ifset config-all
221
+ffplay(1),
222
+@end ifset
223
+@ifset config-not-all
224
+ffplay-all(1),
225
+@end ifset
220 226
 ffmpeg(1), ffprobe(1), ffserver(1),
221 227
 ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
222 228
 ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
... ...
@@ -487,9 +487,19 @@ DV, GXF and AVI timecodes are available in format metadata
487 487
 @end itemize
488 488
 @c man end TIMECODE
489 489
 
490
+@ifset config-all
491
+@include all-components.texi
492
+@end ifset
493
+
490 494
 @chapter See Also
491 495
 
492 496
 @ifhtml
497
+@ifset config-all
498
+@url{ffprobe.html,ffprobe},
499
+@end ifset
500
+@ifset config-not-all
501
+@url{ffprobe-all.html,ffprobe-all},
502
+@end ifset
493 503
 @url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay}, @url{ffserver.html,ffserver},
494 504
 @url{ffmpeg-utils.html,ffmpeg-utils},
495 505
 @url{ffmpeg-scaler.html,ffmpeg-scaler},
... ...
@@ -503,6 +513,12 @@ DV, GXF and AVI timecodes are available in format metadata
503 503
 @end ifhtml
504 504
 
505 505
 @ifnothtml
506
+@ifset config-all
507
+ffprobe(1),
508
+@end ifset
509
+@ifset config-not-all
510
+ffprobe-all(1),
511
+@end ifset
506 512
 ffmpeg(1), ffplay(1), ffserver(1),
507 513
 ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
508 514
 ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
... ...
@@ -246,10 +246,20 @@ messages to stdout.
246 246
 @end table
247 247
 @c man end
248 248
 
249
+@ifset config-all
250
+@include all-components.texi
251
+@end ifset
252
+
249 253
 @chapter See Also
250 254
 
251 255
 @ifhtml
252
-The @file{doc/ffserver.conf} example,
256
+@ifset config-all
257
+@url{ffserver.html,ffserver},
258
+@end ifset
259
+@ifset config-not-all
260
+@url{ffserver-all.html,ffserver-all},
261
+@end ifset
262
+the @file{doc/ffserver.conf} example,
253 263
 @url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay}, @url{ffprobe.html,ffprobe},
254 264
 @url{ffmpeg-utils.html,ffmpeg-utils},
255 265
 @url{ffmpeg-scaler.html,ffmpeg-scaler},
... ...
@@ -263,7 +273,13 @@ The @file{doc/ffserver.conf} example,
263 263
 @end ifhtml
264 264
 
265 265
 @ifnothtml
266
-The @file{doc/ffserver.conf} example, ffmpeg(1), ffplay(1), ffprobe(1),
266
+@ifset config-all
267
+ffserver(1),
268
+@end ifset
269
+@ifset config-not-all
270
+ffserver-all(1),
271
+@end ifset
272
+the @file{doc/ffserver.conf} example, ffmpeg(1), ffplay(1), ffprobe(1),
267 273
 ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
268 274
 ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
269 275
 ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)