[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: seeking advice for a modular build system
From: |
Ralf Wildenhues |
Subject: |
Re: seeking advice for a modular build system |
Date: |
Thu, 13 Mar 2008 07:28:32 +0100 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
Hello Hans-Christoph, Robert,
* Hans-Christoph Steiner wrote on Tue, Mar 11, 2008 at 03:04:11PM CET:
>
> Ah, ok, I think I figured out what you mean. I wasn't clear with my
> initial description. What I want to enable and disable with flags is
> not which libraries are used for the building (i.e. --with) but which
> Pure Data libraries get built.
>
> Basically, the Pure Data project has about 30ish different libraries,
> each with its own dependencies, named things like 'gem', 'pdp', 'zexy',
> etc. I want to be able to do this:
>
> ./configure --disable-pdp
>
> Then it will build all of the Pure Data libs except 'pdp'. Also, 'pdp'
> depends on a lot of other libraries, so it should enable/disable 'pdp'
> based on which libraries are present in the system.
>
> Does that make sense? I don't think it's a common arrangement, but not
> so unusual.
This is a very common arrangement, and there are a few ways to go about
it. A very complex example is what OpenMPI uses, a rather simple one
would be this untested example:
-- configure.ac snippet --
AC_ARG_ENABLE([pdp], [AS_HELP_STRING([--disable-pdp], [disable pdp library])
# foolib is needed by pdplib so
AC_CHECK_LIB([foolib], [foofunc], [], [enable_pdp=no])
AM_CONDITIONAL([ENABLE_PDP], [test "$enable_pdp" != no])
-- Makefile.am snippet --
if ENABLE_PDP
lib_LTLIBRARIES = libpdp.la
libpdp_la_SOURCES = foo.c ...
endif
Hope that helps.
Cheers,
Ralf