From cc3f49392384fa02de9c754a3fec069aa24a4843 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 30 Jun 2025 21:35:24 +0200 Subject: Don't change CFLAGS or LDFLAGS for custom Mbed TLS Adding the extra flags to search Mbed TLS in CFLAGS and LDFLAGS directly inhibits AC_PROG_CC from injecting the usual -O2 and -g flags. Instead, we add them to MBEDTLS_* set of variables which are only used to locate Mbed TLS. Then we pass them to the Makefile via AC_SUBSTAC_SUBST(). We also move the LIBSSL_* flags to be early on the order of dillo_LDADD, so that extra -L flags which can be injected from fltk-config or other programs, don't accidentally point to /usr/lib or a similar location where it could race with another installation of Mbed TLS. This mechanism won't work for cases in which Mbed TLS has libraries installed in a location other than the default search path, but works for Arch Linux and Gentoo because the symlink them to the default search path, even if they are installed in a different location. --- src/IO/Makefile.am | 3 ++- src/Makefile.am | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/IO/Makefile.am b/src/IO/Makefile.am index 6d3a5a8b..a00cdcbc 100644 --- a/src/IO/Makefile.am +++ b/src/IO/Makefile.am @@ -2,7 +2,8 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -DDILLO_BINDIR='"$(bindir)/"' \ -DCA_CERTS_FILE='"@CA_CERTS_FILE@"' \ - -DCA_CERTS_DIR='"@CA_CERTS_DIR@"' + -DCA_CERTS_DIR='"@CA_CERTS_DIR@"' \ + @LIBSSL_CPPFLAGS@ AM_CFLAGS = @LIBFLTK_CFLAGS@ AM_CXXFLAGS = @LIBFLTK_CXXFLAGS@ diff --git a/src/Makefile.am b/src/Makefile.am index b34745a7..661a10c8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,8 +20,10 @@ dillo_LDADD = \ $(top_builddir)/dw/libDw-fltk.a \ $(top_builddir)/dw/libDw-core.a \ $(top_builddir)/lout/liblout.a \ + @LIBSSL_LDFLAGS@ @LIBSSL_LIBS@ \ @LIBJPEG_LIBS@ @LIBPNG_LIBS@ @LIBWEBP_LIBS@ @LIBFLTK_LIBS@ @LIBZ_LIBS@ \ - @LIBICONV_LIBS@ @LIBPTHREAD_LIBS@ @LIBX11_LIBS@ @LIBSSL_LIBS@ @BROTLI_LIBS@ + @LIBICONV_LIBS@ @LIBPTHREAD_LIBS@ @LIBX11_LIBS@ \ + @BROTLI_LIBS@ dillo_SOURCES = \ dillo.cc \ -- cgit v1.2.3