ugrep/ugrep-4.5.0-fix-bzip3-configure.patch

176 lines
5.2 KiB
Diff

From 3c4abe68cce1b9d5202b3b1f63e7de169f3f7c93 Mon Sep 17 00:00:00 2001
From: Robert van Engelen <genivia-inc@users.noreply.github.com>
Date: Fri, 5 Jan 2024 16:26:10 -0500
Subject: [PATCH 1/2] fix bzip3/7zip detection interference
---
configure | 46 +++++++++++++++++++++++-----------------------
configure.ac | 24 ++++++++++++------------
2 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/configure b/configure
index 3cb96da2..12649f50 100755
--- a/configure
+++ b/configure
@@ -796,8 +796,8 @@ with_lzma
with_lz4
with_zstd
with_brotli
-enable_7zip
with_bzip3
+enable_7zip
with_bash_completion_dir
with_fish_completion_dir
with_zsh_completion_dir
@@ -8764,28 +8764,6 @@ printf "%s\n" "#define HAVE_LIBBROTLI 1" >>confdefs.h
fi
-# Check whether --enable-7zip was given.
-if test ${enable_7zip+y}
-then :
- enableval=$enable_7zip; with_no_7zip="yes"
-else $as_nop
- with_no_7zip="no"
-fi
-
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --disable-7zip" >&5
-printf %s "checking for --disable-7zip... " >&6; }
-if test "x$with_no_7zip" = "xno"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
- CPPFLAGS="$CPPFLAGS -I../lzma/C"
- LDFLAGS="$LDFLAGS -L../lzma/C"
- LIBS="-lviiz $LIBS"
-else
- EXTRA_CFLAGS="-DWITH_NO_7ZIP ${EXTRA_CFLAGS}"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
-fi
-
# Check whether --with-bzip3 was given.
if test ${with_bzip3+y}
@@ -8933,6 +8911,28 @@ fi
fi
+# Check whether --enable-7zip was given.
+if test ${enable_7zip+y}
+then :
+ enableval=$enable_7zip; with_no_7zip="yes"
+else $as_nop
+ with_no_7zip="no"
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --disable-7zip" >&5
+printf %s "checking for --disable-7zip... " >&6; }
+if test "x$with_no_7zip" = "xno"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ CPPFLAGS="$CPPFLAGS -I../lzma/C"
+ LDFLAGS="$LDFLAGS -L../lzma/C"
+ LIBS="-lviiz $LIBS"
+else
+ EXTRA_CFLAGS="-DWITH_NO_7ZIP ${EXTRA_CFLAGS}"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+fi
+
fi
diff --git a/configure.ac b/configure.ac
index bb557e92..c54d530d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,6 +82,18 @@ AX_CHECK_ZSTDLIB([], [echo "optional libzstd not found: install if you want ugre
AX_CHECK_BROTLILIB([], [echo "optional brotli library not found: install if you want ugrep option -z to search .br files"])
+AC_ARG_WITH(bzip3,
+ [AS_HELP_STRING([--with-bzip3],
+ [to enable bzip3 library to decompress .bz3 files])],
+ [with_bzip3_library="$withval"],
+ [with_bzip3_library=""])
+if test "x$with_bzip3_library" != "x"; then
+ if test "x$with_bzip3" = "xyes"; then
+ unset with_bzip3
+ fi
+ AX_CHECK_BZIP3LIB([], [echo "optional libbzip3 not found: install if you want ugrep option -z to search .bz3 files"])
+fi
+
AC_ARG_ENABLE(7zip,
[AS_HELP_STRING([--disable-7zip],
[to disable 7zip and no longer search .7z files (7z requires more memory and takes long to decompress)])],
@@ -98,18 +110,6 @@ else
AC_MSG_RESULT(yes)
fi
-AC_ARG_WITH(bzip3,
- [AS_HELP_STRING([--with-bzip3],
- [to enable bzip3 library to decompress .bz3 files])],
- [with_bzip3_library="$withval"],
- [with_bzip3_library=""])
-if test "x$with_bzip3_library" != "x"; then
- if test "x$with_bzip3" = "xyes"; then
- unset with_bzip3
- fi
- AX_CHECK_BZIP3LIB([], [echo "optional libbzip3 not found: install if you want ugrep option -z to search .bz3 files"])
-fi
-
fi
AC_ARG_WITH([bash-completion-dir],
From 7da2fba26253d33f9d6aafd9facc325e2aa419af Mon Sep 17 00:00:00 2001
From: Robert van Engelen <genivia-inc@users.noreply.github.com>
Date: Fri, 5 Jan 2024 16:32:00 -0500
Subject: [PATCH 2/2] fix #10 --disable-7zip
---
configure | 6 +++---
configure.ac | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/configure b/configure
index 12649f50..30db0e1f 100755
--- a/configure
+++ b/configure
@@ -8914,14 +8914,14 @@ fi
# Check whether --enable-7zip was given.
if test ${enable_7zip+y}
then :
- enableval=$enable_7zip; with_no_7zip="yes"
+ enableval=$enable_7zip; with_7zip="$enableval"
else $as_nop
- with_no_7zip="no"
+ with_7zip="yes"
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --disable-7zip" >&5
printf %s "checking for --disable-7zip... " >&6; }
-if test "x$with_no_7zip" = "xno"; then
+if test "x$with_7zip" = "xyes"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
CPPFLAGS="$CPPFLAGS -I../lzma/C"
diff --git a/configure.ac b/configure.ac
index c54d530d..4d7e93b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,10 +97,10 @@ fi
AC_ARG_ENABLE(7zip,
[AS_HELP_STRING([--disable-7zip],
[to disable 7zip and no longer search .7z files (7z requires more memory and takes long to decompress)])],
- [with_no_7zip="yes"],
- [with_no_7zip="no"])
+ [with_7zip="$enableval"],
+ [with_7zip="yes"])
AC_MSG_CHECKING(for --disable-7zip)
-if test "x$with_no_7zip" = "xno"; then
+if test "x$with_7zip" = "xyes"; then
AC_MSG_RESULT(no)
CPPFLAGS="$CPPFLAGS -I../lzma/C"
LDFLAGS="$LDFLAGS -L../lzma/C"