diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-05 12:14:43 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-05 12:14:43 -0800 |
commit | c52082c6e4811958dd741d67e1178b4e36a09923 (patch) | |
tree | 00c2155f76040b27c1217916ab03df5b8696da6d /configure.ac | |
parent | 77e3b389eb92b8d8f94f5b83c1d3d7cd4db5b037 (diff) | |
download | xorg-lib-libXpm-c52082c6e4811958dd741d67e1178b4e36a09923.tar.gz |
open-zfile: Make compress & uncompress commands optional
If compress is not found, we disable writing to .Z files,
but leave the rest of the compression code active.
If uncompress is not found, we use gzip to read .Z files.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 61a5f08..60f959c 100644 --- a/configure.ac +++ b/configure.ac @@ -52,9 +52,8 @@ AM_CONDITIONAL(USE_GETTEXT, test "x$USE_GETTEXT" = "xyes") dnl Helper macro to find absolute path to program and add a #define for it AC_DEFUN([XPM_PATH_PROG],[ AC_PATH_PROG([$1], [$2], []) -AS_IF([test "x$$1" = "x"], - [AC_MSG_ERROR([$2 not found, set $1 or use --disable-open-zfile])]) -AC_DEFINE_UNQUOTED([$1], ["$$1"], [Path to $2]) +AS_IF([test "x$$1" = "x"], [$3], + [AC_DEFINE_UNQUOTED([$1], ["$$1"], [Path to $2])]) ]) dnl End of AC_DEFUN([XPM_PATH_PROG]... # Optional feature: When a filename ending in .Z or .gz is requested, @@ -74,9 +73,17 @@ AM_CONDITIONAL(COMPRESSED_PIXMAPS, test "x$OPEN_ZFILE" = "xyes") if test x$OPEN_ZFILE = xno ; then AC_DEFINE(NO_ZPIPE, 1, [Define to 1 to disable decompression via pipes]) else - XPM_PATH_PROG([XPM_PATH_COMPRESS], [compress]) + # gzip is absolutely required for the compressed file handling code + XPM_PATH_PROG([XPM_PATH_GZIP], [gzip], + [AC_MSG_ERROR([gzip not found, set XPM_PATH_GZIP or use --disable-open-zfile])]) + + # if compress is not found, we disable writing to .Z files, + # but leave the rest of the compression code active + XPM_PATH_PROG([XPM_PATH_COMPRESS], [compress], + [AC_MSG_WARN([compress not found, disabling writing of .Z files])]) + # if uncompress is not found, we use gzip to read .Z files XPM_PATH_PROG([XPM_PATH_UNCOMPRESS], [uncompress]) - XPM_PATH_PROG([XPM_PATH_GZIP], [gzip]) + AC_CHECK_FUNCS([closefrom close_range], [break]) fi |