Skip to content

Commit

Permalink
fix bzip3/7zip detection interference
Browse files Browse the repository at this point in the history
  • Loading branch information
genivia-inc committed Jan 5, 2024
1 parent 24a24d0 commit 2e8ee34
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 39 deletions.
46 changes: 23 additions & 23 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -770,8 +770,8 @@ with_lzma
with_lz4
with_zstd
with_brotli
enable_7zip
with_bzip3
enable_7zip
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -7638,28 +7638,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}
Expand Down Expand Up @@ -7807,6 +7785,28 @@ fi

fi

# Check whether --enable-7zip was given.
if test ${enable_7zip+y}
then :
enableval=$enable_7zip; with_7zip="$enableval"
else $as_nop
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_7zip" = "xyes"; 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


Expand Down
30 changes: 15 additions & 15 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,25 @@ 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-indexer option -z to index .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-indexer option -z to index .bz3 files"])
fi

AC_ARG_ENABLE(7zip,
[AS_HELP_STRING([--disable-7zip],
[to disable 7zip and no longer index .7z files])],
[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"
Expand All @@ -63,18 +75,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-indexer option -z to index .bz3 files"])
fi

fi

AC_SUBST(EXTRA_CFLAGS)
Expand Down
20 changes: 19 additions & 1 deletion lzma/C/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ build_triplet = @build@
host_triplet = @host@
subdir = lzma/C
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_brotlilib.m4 \
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_boost_regex.m4 \
$(top_srcdir)/m4/ax_check_brotlilib.m4 \
$(top_srcdir)/m4/ax_check_bz2lib.m4 \
$(top_srcdir)/m4/ax_check_bzip3lib.m4 \
$(top_srcdir)/m4/ax_check_lz4lib.m4 \
$(top_srcdir)/m4/ax_check_lzmalib.m4 \
$(top_srcdir)/m4/ax_check_pcre2.m4 \
$(top_srcdir)/m4/ax_check_zlib.m4 \
$(top_srcdir)/m4/ax_check_zstdlib.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
Expand Down Expand Up @@ -210,13 +212,17 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@
BASH_COMPLETION_DIR = @BASH_COMPLETION_DIR@
BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
Expand All @@ -228,6 +234,10 @@ ECHO_T = @ECHO_T@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
FISH_COMPLETION_CFLAGS = @FISH_COMPLETION_CFLAGS@
FISH_COMPLETION_DIR = @FISH_COMPLETION_DIR@
FISH_COMPLETION_LIBS = @FISH_COMPLETION_LIBS@
GREP_PATH = @GREP_PATH@
HAVE_CXX11 = @HAVE_CXX11@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
Expand All @@ -250,14 +260,22 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PLATFORM = @PLATFORM@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SIMD_AVX2_FLAGS = @SIMD_AVX2_FLAGS@
SIMD_AVX512BW_FLAGS = @SIMD_AVX512BW_FLAGS@
SIMD_FLAGS = @SIMD_FLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
ZSH_COMPLETION_DIR = @ZSH_COMPLETION_DIR@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
Expand Down

0 comments on commit 2e8ee34

Please sign in to comment.