Re: How about some AC_MSG for dlopen?
Daiki Ueno <[email protected]> Wed, 21 Aug 2024 09:49:11 +0900
| Newsgroups | gmane.network.gnutls.general |
|---|---|
| Message-ID | <[email protected]> |
Andreas Metzler <[email protected]> writes: > On 2024-08-19 Daiki Ueno <[email protected]> wrote: >> Andreas Metzler <[email protected]> writes: >> > On 2024-08-17 Daiki Ueno <[email protected]> wrote: >> >> Andreas Metzler <[email protected]> writes: > >> >> > ./configure is quiet about whether dlopening librariers is supported, >> >> > would it make sense to a) add messages and perhaps b) provide a switch >> >> > to force use of linking instead? > [...] >> I would prefer to have the option per library, because some of the >> libraries are less likely to be available than the others (e.g., >> tpm2-tss vs. zlib). > [...] > > Per-library quadstate ends up being rather wordy, see attached example > for handling zlib that way. I have thought about it but cannot see a > substantial abbreviation potential ad_hoc, there are 8 cases to handle. > - Do you want me follow-up, extending this approach to brotli/zstd/tpm? Thanks. A couple of comments: - It would be simpler to use AC_MSG_CHECKING/AC_MSG_RESULT for ENABLE_DLOPEN rather than AC_MSG_NOTICE - Perhaps we could drop the non-pkgconfig detection logic for zlib, as the library supports pkgconfig since August 2006 - I would first normalize the argument for --with-*, something like: AC_ARG_WITH(zstd, AS_HELP_STRING([--without-zstd], [disable zstd compression support]), with_zstd=$withval, with_zstd=yes) AS_CASE([$with_zstd], [yes], [AM_COND_IF([ENABLE_DLOPEN], [with_zstd=dlopen], [with_zstd=link])], [dlopen], [AM_COND_IF([ENABLE_DLOPEN], [:], [AC_MSG_ERROR([[ *** *** Unable to dlopen ZSTD, try --with-zstd=link. *** ]])])], [link], [:], [no], [:], [AC_MSG_ERROR([[Unknown argument $with_zstd for --with-zstd]])]) So afterwards $with_zstd should only be dlopen, link, or no. - Perhaps we might want to provide a autoconf macro or two for common tasks, in m4/hooks.m4, to avoid code duplication Regards, -- Daiki Ueno