From: Mike Rapoport Date: Mon, 24 Jun 2019 05:25:07 +0000 (+0300) Subject: scripts/sphinx-pre-install: fix out-of-tree build X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=8c69b77a0175d6e14df9cdf386a8b69f6cfa2c6a;p=openwrt%2Fstaging%2Fblogic.git scripts/sphinx-pre-install: fix out-of-tree build Build of htmldocs fails for out-of-tree builds: $ make V=1 O=~/build/kernel/ htmldocs make -C /home/rppt/build/kernel -f /home/rppt/git/linux-docs/Makefile htmldocs make[1]: Entering directory '/home/rppt/build/kernel' make -f /home/rppt/git/linux-docs/scripts/Makefile.build obj=scripts/basic rm -f .tmp_quiet_recordmcount make -f /home/rppt/git/linux-docs/scripts/Makefile.build obj=Documentation htmldocs Can't open Documentation/conf.py at /home/rppt/git/linux-docs/scripts/sphinx-pre-install line 230. /home/rppt/git/linux-docs/Documentation/Makefile:80: recipe for target 'htmldocs' failed make[2]: *** [htmldocs] Error 2 The scripts/sphinx-pre-install is trying to open files in the current directory which is $KBUILD_OUTPUT rather than in $srctree. Fix it. Signed-off-by: Mike Rapoport Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Corbet --- diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install index 0b44d51c4991..f230e65329a2 100755 --- a/scripts/sphinx-pre-install +++ b/scripts/sphinx-pre-install @@ -5,8 +5,11 @@ use strict; # Copyright (c) 2017-2019 Mauro Carvalho Chehab # -my $conf = "Documentation/conf.py"; -my $requirement_file = "Documentation/sphinx/requirements.txt"; +my $prefix = "./"; +$prefix = "$ENV{'srctree'}/" if ($ENV{'srctree'}); + +my $conf = $prefix . "Documentation/conf.py"; +my $requirement_file = $prefix . "Documentation/sphinx/requirements.txt"; my $virtenv_prefix = "sphinx_"; #