From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:55964 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051AbbIAWtc (ORCPT ); Tue, 1 Sep 2015 18:49:32 -0400 Message-ID: <1441147759.9215.44.camel@decadent.org.uk> Subject: [PATCH 2/2] DocBook: Use a fixed encoding for output From: Ben Hutchings Date: Tue, 01 Sep 2015 23:49:19 +0100 In-Reply-To: <1441147632.9215.42.camel@decadent.org.uk> References: <1441147632.9215.42.camel@decadent.org.uk> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-4aq+6euX98NV8REHfRlT" Mime-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Jonathan Corbet Cc: =?ISO-8859-1?Q?J=E9r=E9my?= Bobbio , reproducible-builds@lists.alioth.debian.org, linux-doc@vger.kernel.org, Randy Dunlap , Michal Marek , linux-kbuild --=-4aq+6euX98NV8REHfRlT Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Currently the encoding of documents generated by DocBook depends on the current locale. Make the output reproducible independently of the locale, by setting the encoding to UTF-8 (LC_CTYPE=3DC.UTF-8) by preference, or ASCII (LC_CTYPE=3DC) as a fallback. LC_CTYPE can normally be overridden by LC_ALL, but the top-level Makefile unsets that. Signed-off-by: Ben Hutchings --- Documentation/DocBook/Makefile | 6 ++++++ Makefile | 2 +- scripts/Makefile | 7 +++++-- scripts/check-lc_ctype.c | 6 ++++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 scripts/check-lc_ctype.c diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefil= e index 198e9b5..9af25da 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile @@ -68,6 +68,12 @@ installmandocs: mandocs #External programs used KERNELDOC =3D $(srctree)/scripts/kernel-doc DOCPROC =3D $(objtree)/scripts/docproc +CHECK_LC_CTYPE =3D $(objtree)/scripts/check-lc_ctype + +# Use a fixed encoding - UTF-8 if the C library has support built-in +# or ASCII if not +LC_CTYPE :=3D $(call try-run, LC_CTYPE=3DC.UTF-8 $(CHECK_LC_CTYPE),C.UTF-8= ,C) +export LC_CTYPE =20 XMLTOFLAGS =3D -m $(srctree)/$(src)/stylesheet.xsl XMLTOFLAGS +=3D --skip-validation diff --git a/Makefile b/Makefile index 13270c0..5846c06 100644 --- a/Makefile +++ b/Makefile @@ -1338,7 +1338,7 @@ $(help-board-dirs): help-%: # Documentation targets # ------------------------------------------------------------------------= --- %docs: scripts_basic FORCE - $(Q)$(MAKE) $(build)=3Dscripts build_docproc + $(Q)$(MAKE) $(build)=3Dscripts build_docproc build_check-lc_ctype $(Q)$(MAKE) $(build)=3DDocumentation/DocBook $@ =20 else # KBUILD_EXTMOD diff --git a/scripts/Makefile b/scripts/Makefile index 2016a64..6f0349f 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -7,6 +7,7 @@ # conmakehash: Create chartable # conmakehash: Create arrays for initializing the kernel console tables # docproc: Used in Documentation/DocBook +# check-lc_ctype: Used in Documentation/DocBook =20 HOST_EXTRACFLAGS +=3D -I$(srctree)/tools/include =20 @@ -23,14 +24,16 @@ HOSTCFLAGS_asn1_compiler.o =3D -I$(srctree)/include always :=3D $(hostprogs-y) $(hostprogs-m) =20 # The following hostprogs-y programs are only build on demand -hostprogs-y +=3D unifdef docproc +hostprogs-y +=3D unifdef docproc check-lc_ctype =20 # These targets are used internally to avoid "is up to date" messages -PHONY +=3D build_unifdef build_docproc +PHONY +=3D build_unifdef build_docproc build_check-lc_ctype build_unifdef: $(obj)/unifdef @: build_docproc: $(obj)/docproc @: +build_check-lc_ctype: $(obj)/check-lc_ctype + @: =20 subdir-$(CONFIG_MODVERSIONS) +=3D genksyms subdir-y +=3D mod diff --git a/scripts/check-lc_ctype.c b/scripts/check-lc_ctype.c new file mode 100644 index 0000000..51fe229 --- /dev/null +++ b/scripts/check-lc_ctype.c @@ -0,0 +1,6 @@ +#include + +int main(void) +{ + return !setlocale(LC_CTYPE, ""); +} --=20 Ben Hutchings The first rule of tautology club is the first rule of tautology club. --=-4aq+6euX98NV8REHfRlT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIVAwUAVeYrb+e/yOyVhhEJAQoUjxAAo5zIsBnYMePvtVLHIU1g02UZbBVQOHFr Hao0noed8Ja8IVB/iOJ7Rp+K3Yg3yZFT8FAmfp+loXnScUsoPUxY3itAimN1bjuH eCW4Z8JRRfI1PACSVCA2yxJiIT5AUU4LxBVmeF5QsJnRySzdQQozGSbJgHGt7FPV W4f7sU/JPmg2fzibJhKtZLAmRlTnS+hwbX+TYZfWKTQn+NKo88itCGTSAmvQcWtk hZGdldbrTpwpnxwMGSlhVr1F7tKFjK8d0B8k5XKe4gedt0/vJcM/DXcflPVJqkgJ HsrcWvBaPaPkK7boPXQlyCwNiFibDJPPsh7yLRw7DnljTjjtc5digwmXwsZbbt8X oHvCDJCrQbNdgnK7O3U6GWxaxVDUcf9olRtc4R6yQzqr/4r6WQp80yu8urRa/1Te hsSmq69SqYgqA25hjDZ9kG7ilz1KSCDXbwXAkhYdQr4v77NqzIbbUVKGLKmMtBQZ FcGJbzYtcuTUY/Z+71+OixkPsxDSfIVNQkGJ26KwPuvIUSpZmcODj/HXidq19c0i Dr6GErHS/MCWQqFp7LvNdfMYiAxlWovW3S//OXAOjnW667Nw2zdPAf+hMCrdAoCO gymaYhqq5WwjE+s4K1Z69IWiVaz7r0QuzzDRc3qpA5HIeEF915oGiY5fcDn6fpqf FJcvXWVozJ8= =MzbE -----END PGP SIGNATURE----- --=-4aq+6euX98NV8REHfRlT--