Skip to content

Commit

Permalink
imap-hibernate: If not enabled, do not include in settings either
Browse files Browse the repository at this point in the history
  • Loading branch information
catap authored and cmouse committed Nov 28, 2024
1 parent 128c323 commit 600aa7c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 14 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,14 @@ DOVECOT_SOCKPEERCRED
DOVECOT_TYPEOF
DOVECOT_IOLOOP
DOVECOT_NOTIFY
AM_CONDITIONAL([BUILD_IMAP_HIBERNATE], [test "$notify" != kqueue -a "$notify" != none])
AS_CASE(
["$notify"],
[none], [BUILD_IMAP_HIBERNATE=0],
[kqueue], [BUILD_IMAP_HIBERNATE=0],
[BUILD_IMAP_HIBERNATE=1])
AS_IF([test "$BUILD_IMAP_HIBERNATE"=1],
AC_DEFINE(BUILD_IMAP_HIBERNATE,, [Build with imap hibernate]))
AM_CONDITIONAL([BUILD_IMAP_HIBERNATE], [test "$BUILD_IMAP_HIBERNATE" = 1])

DOVECOT_GLIBC

Expand Down Expand Up @@ -732,6 +739,7 @@ non_libdovecot_c_files=
all_files=`find $srcdir/src -name '*.[[ch]]' | grep -v '/src/config/all-settings.c' | grep -v '/src/lib-settings/' | grep -v '/test-' | xargs grep -e 'struct setting_parser_info [[a-z]]' -e 'struct service_settings [[a-z]]' -e '<settings checks>' | sed 's/:.*//' | sort | uniq`
for file in $all_files; do
dir=`echo "$file" | sed 's:/[[^/]]*$::'`
basefile=`basename $file`
if echo "$libdovecot_dirs" | grep "$dir" >/dev/null; then
dnl lib-dovecot
if echo "$file" | grep '\.h$' >/dev/null; then
Expand All @@ -741,7 +749,11 @@ for file in $all_files; do
fi
else
dnl not lib-dovecot
if echo "$file" | grep '\.h$' >/dev/null; then
dnl ignore hibernation if not being built

if test "$BUILD_IMAP_HIBERNATE" = 0 && test "$basefile" = "imap-hibernate-settings.c"; then
continue
elif echo "$file" | grep '\.h$' >/dev/null; then
non_libdovecot_headers="$non_libdovecot_headers $file"
else
non_libdovecot_c_files="$non_libdovecot_c_files $file"
Expand Down
2 changes: 2 additions & 0 deletions src/imap/imap-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ static const struct setting_define imap_setting_defines[] = {
DEF(ENUM, imap_fetch_failure),
DEF(BOOL, imap_metadata),
DEF(BOOL, imap_literal_minus),
#ifdef BUILD_IMAP_HIBERNATE
DEF(TIME, imap_hibernate_timeout),
#endif

DEF(STR, imap_urlauth_host),
DEF(IN_PORT, imap_urlauth_port),
Expand Down

0 comments on commit 600aa7c

Please sign in to comment.