From da8ac70de2bb45092574084d89272e07c75796e2 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 16 Feb 2023 10:06:41 -0800 Subject: Add COMPRESS_FLAGS to pass options to compression command By default, set to -n for gzip to stop recording timestamps and enable reproducible builds, and to empty for all other methods. Will require adding COMPRESS_FLAGS to Makefile.am in each font module to become effective. Signed-off-by: Alan Coopersmith --- fontutil.m4.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fontutil.m4.in b/fontutil.m4.in index ff2f053..43694eb 100644 --- a/fontutil.m4.in +++ b/fontutil.m4.in @@ -248,6 +248,10 @@ AC_DEFUN([XORG_FONT_BDF_UTILS],[ # Offer a --with-compression flag to control what compression method is # used for pcf font files. Offers all the methods currently supported # by libXfont, including no compression. +# +# If COMPRESS_FLAGS is not set, and the compression method has flags needed +# for reproducible builds, such as gzip -n to not record timestamp, will +# set COMPRESS_FLAGS to those options. AC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[ AC_MSG_CHECKING([font compression method]) @@ -261,7 +265,8 @@ AC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[ AC_MSG_RESULT([${compression}]) case ${compression} in *compress) COMPRESS_SUFFIX=".Z" ;; - *gzip) COMPRESS_SUFFIX=".gz" ;; + *gzip) COMPRESS_SUFFIX=".gz" ; + COMPRESS_FLAGS="${COMPRESS_FLAGS--n}" ;; *bzip2) COMPRESS_SUFFIX=".bz2" ;; no|none) COMPRESS_SUFFIX="" ; COMPRESS="cat" ;; *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;; @@ -269,6 +274,9 @@ AC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[ if test x"$COMPRESS_SUFFIX" != "x" ; then XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression}) fi + AC_MSG_CHECKING([options to font compression command]) + AC_MSG_RESULT([${COMPRESS_FLAGS:-none}]) + AC_SUBST([COMPRESS_FLAGS]) AC_SUBST([COMPRESS_SUFFIX]) ]) -- cgit v1.2.1