Blame SOURCES/0004-configure-add-disable-open-zfile-instead-of-requirin.patch

a4ac63
From d51766c94c6dffa59c087b27b2b20b53ff957b98 Mon Sep 17 00:00:00 2001
a4ac63
From: Alan Coopersmith <alan.coopersmith@oracle.com>
a4ac63
Date: Thu, 5 Jan 2023 15:42:36 -0800
a4ac63
Subject: [PATCH libXpm 4/5] configure: add --disable-open-zfile instead of
a4ac63
 requiring -DNO_ZPIPE
a4ac63
a4ac63
Documents the two compression options in the README, makes their
a4ac63
configure options reflect the interdependency of their implementation,
a4ac63
and makes the configure script report their configuration.
a4ac63
a4ac63
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
a4ac63
---
a4ac63
 README       | 15 +++++++++++++++
a4ac63
 configure.ac | 36 +++++++++++++++++++++++-------------
a4ac63
 2 files changed, 38 insertions(+), 13 deletions(-)
a4ac63
a4ac63
diff --git a/README b/README
a4ac63
index 9d14a39..f532bef 100644
a4ac63
--- a/README
a4ac63
+++ b/README
a4ac63
@@ -23,3 +23,18 @@ For more information on the git code manager, see:
a4ac63
 
a4ac63
         http://wiki.x.org/wiki/GitPage
a4ac63
 
a4ac63
+------------------------------------------------------------------------------
a4ac63
+
a4ac63
+libXpm supports two optional features to handle compressed pixmap files.
a4ac63
+
a4ac63
+--enable-open-zfile makes libXpm recognize file names ending in .Z and .gz
a4ac63
+and open a pipe to the appropriate command to compress the file when writing
a4ac63
+and uncompress the file when reading. This is enabled by default on platforms
a4ac63
+other than MinGW and can be disabled by passing the --disable-open-zfile flag
a4ac63
+to the configure script.
a4ac63
+
a4ac63
+--enable-stat-zfile make libXpm search for a file name with .Z or .gz added
a4ac63
+if it can't find the file it was asked to open.  It relies on the
a4ac63
+--enable-open-zfile feature to open the file, and is enabled by default
a4ac63
+when --enable-open-zfile is enabled, and can be disabled by passing the
a4ac63
+--disable-stat-zfile flag to the configure script.
a4ac63
diff --git a/configure.ac b/configure.ac
a4ac63
index 2feb9ff..4a8d6de 100644
a4ac63
--- a/configure.ac
a4ac63
+++ b/configure.ac
a4ac63
@@ -48,25 +48,35 @@ if test "x$USE_GETTEXT" = "xyes" ; then
a4ac63
 fi
a4ac63
 AM_CONDITIONAL(USE_GETTEXT, test "x$USE_GETTEXT" = "xyes")
a4ac63
 
a4ac63
+# Optional feature: When a filename ending in .Z or .gz is requested,
a4ac63
+# open a pipe to a newly forked compress/uncompress/gzip/gunzip command to
a4ac63
+# handle it.
a4ac63
+AC_MSG_CHECKING([whether to handle compressed pixmaps])
a4ac63
+case $host_os in
a4ac63
+        *mingw*)        zpipe_default="no" ;;
a4ac63
+        *)              zpipe_default="yes" ;;
a4ac63
+esac
a4ac63
+AC_ARG_ENABLE(open-zfile,
a4ac63
+        AS_HELP_STRING([--enable-open-zfile],
a4ac63
+                        [Search for files with .Z & .gz extensions automatically @<:@default=auto@:>@]),
a4ac63
+              [OPEN_ZFILE=$enableval], [OPEN_ZFILE=yes])
a4ac63
+AC_MSG_RESULT([$OPEN_ZFILE])
a4ac63
+if test x$OPEN_ZFILE = xno ; then
a4ac63
+        AC_DEFINE(NO_ZPIPE, 1, [Define to 1 to disable decompression via pipes])
a4ac63
+fi
a4ac63
+
a4ac63
 # Optional feature: When ___.xpm is requested, also look for ___.xpm.Z & .gz
a4ac63
 # Replaces ZFILEDEF = -DSTAT_ZFILE in old Imakefile
a4ac63
+AC_MSG_CHECKING([whether to search for compressed pixmaps])
a4ac63
 AC_ARG_ENABLE(stat-zfile,
a4ac63
-	AS_HELP_STRING([--enable-stat-zfile],
a4ac63
-			[Search for files with .Z & .gz extensions automatically @<:@default=yes@:>@]),
a4ac63
-              [STAT_ZFILE=$enableval], [STAT_ZFILE=yes])
a4ac63
+        AS_HELP_STRING([--enable-stat-zfile],
a4ac63
+                        [Search for files with .Z & .gz extensions automatically @<:@default=auto@:>@]),
a4ac63
+              [STAT_ZFILE=$enableval], [STAT_ZFILE=$OPEN_ZFILE])
a4ac63
+AC_MSG_RESULT([$STAT_ZFILE])
a4ac63
 if test x$STAT_ZFILE = xyes ; then
a4ac63
-	AC_DEFINE(STAT_ZFILE, 1, [Define to 1 to automatically look for files with .Z & .gz extensions])
a4ac63
+        AC_DEFINE(STAT_ZFILE, 1, [Define to 1 to automatically look for files with .Z & .gz extensions])
a4ac63
 fi
a4ac63
 
a4ac63
-
a4ac63
-case $host_os in
a4ac63
-	*mingw*)
a4ac63
-                AC_DEFINE(NO_ZPIPE, 1, [Define to 1 to disable decompression via pipes])
a4ac63
-	;;
a4ac63
-	*)
a4ac63
-	;;
a4ac63
-esac
a4ac63
-
a4ac63
 AC_CONFIG_FILES([Makefile
a4ac63
                  doc/Makefile
a4ac63
                  include/Makefile
a4ac63
-- 
a4ac63
2.39.0
a4ac63