-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
111 lines (89 loc) · 3.44 KB
/
Copy pathconfigure.ac
File metadata and controls
111 lines (89 loc) · 3.44 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
AC_PREREQ([2.69])
AC_INIT([acceptarium], [m4_esyscmd(build-aux/git-version-gen .tarball-version)], [caleb@alerque.com])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign tar-pax dist-zstd dist-zip no-dist-gzip no-dependencies color-tests])
AM_SILENT_RULES([yes])
# Load up re-usable m4 bits shared across Caleb's projects
QUE_GIT_VERSION
QUE_TRANSFORM_PACKAGE_NAME
QUE_DEVELOPER_MODE
QUE_DIST_CHECKSUMS
# Check for and set variables for tooling used during our build process
AC_PROG_AWK
AC_PROG_GREP
AC_PROG_SED
AX_REQUIRE_PROG(env)
AX_REQUIRE_PROG(zsh)
AC_ARG_ENABLE([tui],
AS_HELP_STRING([--disable-tui],
[Disable TUI mode]))
AM_CONDITIONAL([TUI], [test "x$enable_tui" != "xno"])
AC_ARG_WITH([git],
AS_HELP_STRING([--without-git],
[Compile without git vcs support used to track projects]))
AM_CONDITIONAL([GIT], [test "x$with_git" != "xno"])
AC_ARG_WITH([git-annex],
AS_HELP_STRING([--without-git-annex],
[Compile without git-annex support used as default storage driver]))
AM_CONDITIONAL([GIT_ANNEX], [test "x$with_git_annex" != "xno"])
AC_ARG_WITH([ollama],
AS_HELP_STRING([--with-ollama],
[Compile with ollama support for local LLM inference operations]))
AM_CONDITIONAL([OLLAMA], [test "x$with_ollama" == "xyes"])
AC_ARG_WITH([tesseract],
AS_HELP_STRING([--with-tesseract],
[Compile with support for tesseract as an OCR provider]))
AM_CONDITIONAL([TESSERACT], [test "x$with_tesseract" == "xyes"])
AC_ARG_WITH([imagemagick],
AS_HELP_STRING([--with-imagemagick],
[Compile with support for using ImageMagick to add PDF support to OCR providers]))
AM_CONDITIONAL([IMAGEMAGICK], [test "x$with_imagemagick" == "xyes"])
AM_COND_IF([DEVELOPER_MODE], [
AX_REQUIRE_PROG([just])
# Release tooling
AX_REQUIRE_PROG([cargo-deny])
AX_REQUIRE_PROG([cargo-msrv])
AX_REQUIRE_PROG([cargo-set-version])
AX_REQUIRE_PROG([git-cliff])
AX_REQUIRE_PROG([reuse])
AX_REQUIRE_PROG([taplo])
AX_REQUIRE_PROG([typos])
])
AM_COND_IF([TUI], [
PKG_CHECK_MODULES(CHAFA, chafa)
])
AM_COND_IF([GIT], [
AX_REQUIRE_PROG([git])
])
AM_COND_IF([GIT_ANNEX], [
AX_REQUIRE_PROG([git])
AX_REQUIRE_PROG([git-annex])
])
AM_COND_IF([OLLAMA], [
AX_REQUIRE_PROG([ollama])
])
AM_COND_IF([TESSERACT], [
AX_REQUIRE_PROG([tesseract])
])
AM_COND_IF([IMAGEMAGICK], [
AX_REQUIRE_PROG([magick])
])
QUE_RUST_BOILERPLATE
# Avoid the need for `--datarootdir=$(cd ..; pwd)` to run directly from
# an uninstalled build in the source directory
AM_COND_IF([DEVELOPER_MODE], [
datarootdir="$(cd ..; pwd)"
])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([lib/functions.zsh])
AC_DEFUN([ACCEPTARIUM_SCRIPT], [AC_CONFIG_FILES([scripts/$1], [chmod +x scripts/$1])])
ACCEPTARIUM_SCRIPT([debug.zsh])
AC_OUTPUT
# Avoid the perceived need to run automake again when building from source
# tarballs. The assorted AM include macros assume two passes are needed to
# generate a makefile since one pass has to generate the includes and the
# second one inlines them, but we're distributing a ready-to-use version and
# hence one pass is enough. We can skip ahead and assume the Makefile template
# is ready to go an this point, avoiding the need for autotools at all.
AM_COND_IF([SOURCE_IS_DIST], [touch -r aminclude.am Makefile.in])