-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
87 lines (64 loc) · 2.63 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
AC_INIT([ugrep-indexer],[1.0.0],[https://github.com/Genivia/ugrep-indexer/issues],[ugrep],[https://ugrep.com])
AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip])
AC_CONFIG_HEADERS([config.h])
AC_COPYRIGHT([Copyright (C) 2023 Robert van Engelen, Genivia Inc.])
AC_CONFIG_MACRO_DIR([m4])
# if CXXFLAGS is undefined, set it to our preferred default flags
: ${CXXFLAGS="-Wall -Wextra -Wunused -O2"}
: ${CFLAGS="-Wall -Wextra -Wunused -O2"}
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX([11],[ext],[mandatory])
AC_HEADER_DIRENT
AC_STRUCT_DIRENT_D_INO
AC_STRUCT_DIRENT_D_TYPE
AX_PTHREAD
AC_CHECK_MEMBERS([struct stat.st_atim, struct stat.st_mtim, struct stat.st_ctim])
AC_CHECK_MEMBERS([struct stat.st_atimespec, struct stat.st_mtimespec, struct stat.st_ctimespec])
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_PROG_CXX
AM_PROG_AR
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
AC_CANONICAL_HOST
PLATFORM=${host}
AC_SUBST(PLATFORM)
AX_CHECK_ZLIB([], [echo "recommended zlib not found: ugrep-indexer option -z is disabled"])
if test -n "${zlib_places}"; then
AX_CHECK_BZ2LIB([], [echo "recommended libbz2 not found: ugrep-indexer option -z cannot index .bz and .bz2 files"])
AX_CHECK_LZMALIB([], [echo "recommended liblzma not found: ugrep-indexer option -z cannot index .lzma and .xz files"])
AX_CHECK_LZ4LIB([], [echo "optional liblz4 not found: install if you want ugrep-indexer option -z to index .lz4 files"])
AX_CHECK_ZSTDLIB([], [echo "optional libzstd not found: install if you want ugrep-indexer option -z to index .zst files"])
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_7zip="$enableval"],
[with_7zip="yes"])
AC_MSG_CHECKING(for --disable-7zip)
if test "x$with_7zip" = "xyes"; then
AC_MSG_RESULT(no)
CPPFLAGS="$CPPFLAGS -I../lzma/C"
LDFLAGS="$LDFLAGS -L../lzma/C"
LIBS="-lviiz $LIBS"
else
EXTRA_CFLAGS="-DWITH_NO_7ZIP ${EXTRA_CFLAGS}"
AC_MSG_RESULT(yes)
fi
fi
AM_CONDITIONAL([ENABLE_7ZIP],[test "x$with_7zip" = "xyes"])
AC_SUBST(EXTRA_CFLAGS)
AC_CONFIG_FILES([Makefile src/Makefile lzma/C/Makefile])
AC_OUTPUT