Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix static linking & update vitepress dependencies #42

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Makefile.am: Link only dovecot statically
We only want to link dovecot statically because fully
static builds do not work with modern libc. This breaks
e.g. DNS resolution.
  • Loading branch information
cmouse committed Oct 7, 2024
commit 1390fb0b5ab5d5ab493988d76a891193120fca82
12 changes: 10 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -20,15 +20,23 @@ AC_PROG_CPP
LT_INIT

DC_DOVECOT

AS_IF([test "$DOVECOT_INSTALLED" = 'no'], [
LIBDOVECOT=$abs_dovecotdir/src/lib-dovecot/libdovecot.la
LIBDOVECOT_SSL=$abs_dovecotdir/src/lib-ssl-iostream/libssl_iostream_openssl.la
], [
LIBDOVECOT=$dovecot_pkglibdir/libdovecot.la
LIBDOVECOT_SSL=$dovecot_pkglibdir/libssl_iostream_openssl.la
])
AC_SUBST([LIBDOVECOT_SSL])

CFLAGS="$CFLAGS $EXTRA_CFLAGS"
LIBS="$DOVECOT_LIBS"
BINARY_CFLAGS="$PIE_CFLAGS"
BINARY_LDFLAGS="$PIE_LDFLAGS $RELRO_LDFLAGS"
AC_SUBST(BINARY_CFLAGS)
AC_SUBST(BINARY_LDFLAGS)

AM_CONDITIONAL(STATIC_OPENSSL, test "$enable_shared" != "yes")

AS_IF([test "$AR_FLAGS" = "cru"], [AR_FLAGS="cr"], [])
AC_SUBST([AR_FLAGS])

15 changes: 6 additions & 9 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
bin_PROGRAMS = imaptest

AM_CPPFLAGS = $(LIBDOVECOT_INCLUDE) $(LIBDOVECOT_SMTP_INCLUDE)
AM_CPPFLAGS = $(LIBDOVECOT_INCLUDE) -DSTATIC_OPENSSL=1
imaptest_LDFLAGS = $(AM_LDFLAGS)

imaptest_SOURCES = \
checkpoint.c \
@@ -43,14 +44,10 @@ noinst_HEADERS = \
user.h

imaptest_CFLAGS = $(AM_CPPFLAGS) $(BINARY_CFLAGS)
imaptest_LDADD = $(LIBDOVECOT_SMTP) $(LIBDOVECOT) -lm $(BINARY_LDFLAGS)
imaptest_DEPENDENCIES = $(LIBDOVECOT_SMTP_DEPS) $(LIBDOVECOT_DEPS)

if STATIC_OPENSSL
AM_CPPFLAGS += -DSTATIC_OPENSSL
imaptest_LDADD += $(LIBDOVECOT_OPENSSL) $(DOVECOT_SSL_LIBS)
imaptest_DEPENDENCIES += $(LIBDOVECOT_OPENSSL_DEPS)
endif
imaptest_LDADD = $(LIBDOVECOT) \
$(LIBDOVECOT_SSL) \
-lm $(BINARY_LDFLAGS)
imaptest_LDFLAGS += -static-libtool-libs

EXTRA_DIST = \
tests/append \