Re: "make dist" and conditional build of autotool-enabled subpackage.
suzuki toshiya <[email protected]> Wed, 16 Oct 2024 01:34:36 +0900
| Newsgroups | gmane.comp.sysutils.automake.general |
|---|---|
| Message-ID | <[email protected]> |
Dear Zack, Thank you prompt reply, your answer looks quite reasonable. I would execute AC_CONFIG_SUBDIRS() unconditionally, if there's no way to escape :-) I never had an idea making Y/configure skip the detailed check by passing "--with-system-Y", sounds very smart. I would try. Thanks again! mpsuzuki On 2024/10/16 1:07, Zack Weinberg wrote: > On Tue, Oct 15, 2024, at 10:38 AM, suzuki toshiya wrote: >> I'm looking for a combination of the target to include sub-packages >> which is built conditionally. >> >> A package "X" include a libary "Y" as a subpackage, like > ... >> Y is often installed as an external or system library, so X/configure >> calls AC_CONFIG_SUBDIRS([Y]) in some cases, not always. > > You need to call AC_CONFIG_SUBDIRS([Y]) unconditionally. Many things > break if you call it conditionally, not just what you have already > tripped over. Not only this, but Y's configure script needs to actually > run and its Makefiles need to be generated unconditionally. (The basic > _issue_ is what you've already tripped over: Automake needs to know > _statically_ all of the files included in package X. But many other > things besides "make dist" depend on this.) > > Instead, I suggest that you have Y detect when it is being configured > as an embedded subpackage that will not actually be used. For example, > if X decides to build Y based on the value of a --with-system-Y > configure switch, Y's configure.ac can itself respond to --with-system-Y > by skipping all its system probes and using Automake conditionals to > avoid building the library. As I recall, AC_CONFIG_SUBDIRS([Y]) will > pass --with-system-Y down to Y's configure.ac, so you don't need to do > anything special there. > > zw >