Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp35237ybb; Thu, 19 Mar 2020 16:03:32 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsV+ZImyKEpgk/X3NH0CBXNL0eLm8asTAt5vvd+BWXLGbYI2UFwZhWHVvwZ0XRmxPGMKoIh X-Received: by 2002:aca:fd44:: with SMTP id b65mr3992586oii.119.1584659012104; Thu, 19 Mar 2020 16:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584659012; cv=none; d=google.com; s=arc-20160816; b=m95LfiwL3fb7zH7TK6vJl3d83Jxj75+OpMjU9/80KMAp24YMWVB8UzOzj+FjeiERyH lEiaJgX3pml1x4ZMkQw2VKbQQZj+E/f23iYvHQU5uTEsOH+69TjpEqmcInqgoAzjkRqO xd6rMQoB3zRA8/TOxfGnUTkhBGf9WTDmVn4scaFKZTBgsU/wjEP7xCOwBZKYo07FYafp dHD+DXr+Lld/yIw4YW6Cubv5ZKspJiRI8tzwEfq4fQV7D03UGOAE3lXIUZdAWGbEfrF9 hzGMd+D+MRehyFzju2AepSUUKM0qqvNN07xaNtjYNJT9RN8H8gmjSV322Fwl2BCwT5dw YneA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=wtKkOMzpj5yF3znT+VYDwakqpbRDOd9bsKsjl4H7//g=; b=0Xz4XSaztJtwxpskecIpXKJpGmzcPpfZpPDsZb/nWPYXJYn51eg5xEBjzH2d5F8VIn FIIqgdf7GNpvQ4X30r+J+GSq/Y1ANom3323YmAjsaTsFnZqbSvqpz9lRgWMUiyprQSYW Jzn9W24kLDSOmrxGbOHKVN3noc6Dnk6Cud+61Lh3SdRDadRW1FiBUejOxN1dW+QYPSM0 XIpaY3m2j/yPq/BZ4EgY1FTp9/RB+rrhXlSO31nHO+PGghP4d3UEP43kDr5/K7zpD10q KlCNqpKMxDHkr8LT4NXpTWwcewW57RfRQno9s14BQB1zglgxcxwn9Ng3gQMb7BIKJqyY gWow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=cZNIZJdo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j24si1726692oie.27.2020.03.19.16.03.03; Thu, 19 Mar 2020 16:03:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=cZNIZJdo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727573AbgCSXBX (ORCPT + 99 others); Thu, 19 Mar 2020 19:01:23 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:36534 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727237AbgCSXBW (ORCPT ); Thu, 19 Mar 2020 19:01:22 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02JMw39N111982; Thu, 19 Mar 2020 23:01:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2020-01-29; bh=wtKkOMzpj5yF3znT+VYDwakqpbRDOd9bsKsjl4H7//g=; b=cZNIZJdoCYwNQ2jj+oiAbDILtY7zR06HmPoW58zrquNUj3stxD87WskEBrfksB6LheRG ui4CnzGsqgNkYQLA1ZFB7v9/HqgdyvvhWkS6OBKZhEq1bL2oUfQc8Y3b9iqP2nRa/5y1 izkfVagy8ltlb5M+PP3ZHX6D0Fjv+jcuIWkpOAFodZTYbVgn3HdlMw0ARK5sDcOSyu4g 0Dy8C6baM1H7Vsavb9ll40ns7wLF517kiO6cFKFsjw6zPadKTzCQp6TormidBSo8zFSW EaBdiCrSTv9WJYgd+Z4G8QeZT3QhPOPmSPwZO+qB6iM3TqTcYFNGNbjD13F313VcN3qc ng== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2yub27aw14-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Mar 2020 23:01:20 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02JMwDRM022431; Thu, 19 Mar 2020 23:01:19 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2ys92nh796-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Mar 2020 23:01:19 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 02JN1Ils007236; Thu, 19 Mar 2020 23:01:19 GMT Received: from toshiba-tecra.hsd1.ca.comcast.net (/10.159.250.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 19 Mar 2020 16:01:18 -0700 From: Victor Erminpour To: corbet@lwn.net Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] docs: Prefer 'python3' when building htmldocs Date: Thu, 19 Mar 2020 16:00:42 -0700 Message-Id: <1584658842-778-1-git-send-email-victor.erminpour@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9565 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 mlxscore=0 spamscore=0 bulkscore=0 adultscore=0 suspectscore=1 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003190092 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9565 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 adultscore=0 suspectscore=1 clxscore=1011 priorityscore=1501 lowpriorityscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003190092 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prefer 'python3' and 'sphinx-build-3' when building htmldocs. Building htmldocs fails on systems that don't have 'python' and 'sphinx-build' installed, but do have 'python3' and 'sphinx-build-3' available. Signed-off-by: Victor Erminpour --- Documentation/Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index d77bb607aea4..00c400523e15 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -11,6 +11,7 @@ endif # You can set these variables from the command line. SPHINXBUILD = sphinx-build +SPHINXBUILD3 = sphinx-build-3 SPHINXOPTS = SPHINXDIRS = . _SPHINXDIRS = $(patsubst $(srctree)/Documentation/%/index.rst,%,$(wildcard $(srctree)/Documentation/*/index.rst)) @@ -61,11 +62,23 @@ loop_cmd = $(echo-cmd) $(cmd_$(1)) || exit; # $5 reST source folder relative to $(srctree)/$(src), # e.g. "media" for the linux-tv book-set at ./Documentation/media +HAVE_PYTHON3 := $(shell if which $(PYTHON3) >/dev/null 2>&1; then echo 1; else echo 0; fi) +HAVE_SPHINX3 := $(shell if which $(SPHINXBUILD3) >/dev/null 2>&1; then echo 1; else echo 0; fi) +PYTHON_BIN = $(PYTHON) + +# If we have both python3 and sphinx-build-3, +# prefer python3 over python. +ifeq ($(HAVE_PYTHON3),1) + ifeq ($(HAVE_SPHINX3),1) + PYTHON_BIN = $(PYTHON3) + endif +endif + quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media $2 && \ PYTHONDONTWRITEBYTECODE=1 \ BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \ - $(PYTHON) $(srctree)/scripts/jobserver-exec \ + $(PYTHON_BIN) $(srctree)/scripts/jobserver-exec \ $(SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \ $(SPHINXBUILD) \ -b $2 \