summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile17
-rwxr-xr-xconfigure16
2 files changed, 24 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 2f41293304..53921b5676 100644
--- a/Makefile
+++ b/Makefile
@@ -282,13 +282,15 @@ OBJECTS += $(OBJECTS-yes)
DEP_FILES = $(patsubst %.S,%.d,$(patsubst %.cpp,%.d,$(patsubst %.c,%.d,$(SOURCES:.m=.d) $(SOURCES:.m=.d))))
-ALL_PRG += mpv$(EXESUF)
-
-INSTALL_TARGETS += check_rst2man \
- install-mpv \
- install-mpv-man
+ALL_TARGETS += mpv$(EXESUF)
INSTALL_NO_MAN_TARGETS += install-mpv
+INSTALL_TARGETS = $(INSTALL_NO_MAN_TARGETS)
+
+ifeq ($(BUILD_MAN),yes)
+ INSTALL_TARGETS += install-mpv-man
+ ALL_TARGETS += DOCS/man/en/mpv.1
+endif
DIRS = . \
audio \
@@ -321,7 +323,7 @@ endif
###### generic rules #######
-all: $(ALL_PRG)
+all: $(ALL_TARGETS)
%.1: %.rst
$(RST2MAN) $< $@
@@ -407,9 +409,6 @@ DOCS/man/en/mpv.1: DOCS/man/en/af.rst \
###### installation / clean / generic rules #######
-check_rst2man:
- @which $(RST2MAN) > /dev/null 2>&1 || (printf "\n\trst2man not found. You need the docutils (>= 0.7) to generate the manpages. Alternatively you can use 'install-no-man' rule.\n\n" && exit 1)
-
install: $(INSTALL_TARGETS)
install-no-man: $(INSTALL_NO_MAN_TARGETS)
diff --git a/configure b/configure
index e494d8df59..e6ead21ef0 100755
--- a/configure
+++ b/configure
@@ -382,6 +382,7 @@ Miscellaneous options:
--target=PLATFORM target platform (i386-linux, arm-linux, etc)
--enable-static build a statically linked binary
--with-install=PATH path to a custom install program
+ --disable-manpage do not build and install manpage [auto]
Advanced options:
--enable-shm enable shm [autodetect]
@@ -499,6 +500,7 @@ def_stream_cache="#define CONFIG_STREAM_CACHE 1"
def_priority="#undef CONFIG_PRIORITY"
def_pthread_cache="#undef PTHREAD_CACHE"
need_shmem=yes
+_build_man=auto
for ac_option do
case "$ac_option" in
--help|-help|-h)
@@ -732,6 +734,9 @@ for ac_option do
--enable-sortsub) _sortsub=yes ;;
--disable-sortsub) _sortsub=no ;;
+ --enable-manpage) _build_man=yes ;;
+ --disable-manpage) _build_man=no ;;
+
*)
echo "Unknown parameter: $ac_option" >&2
exit 1
@@ -917,6 +922,16 @@ if [ -f "$(which rst2man.py)" ] ; then
_rst2man=rst2man.py
fi
+echocheck "whether to build manpages with rst2man"
+if test "$_build_man" = auto ; then
+ _build_man=no
+ command_check "$_rst2man" --version && _build_man=yes
+else
+ _build_man=no
+fi
+echores "$_build_man"
+
+
TMPC="$mplayer_tmpdir/tmp.c"
TMPCPP="$mplayer_tmpdir/tmp.cpp"
TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
@@ -3228,6 +3243,7 @@ EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs $libs_mplaye
GETCH = $_getch
TIMER = $_timer
RST2MAN = $_rst2man
+BUILD_MAN = $_build_man
EXESUF = $_exesuf
EXESUFS_ALL = .exe