[alsa-devel] [PATCH] [alsa-utils] Fix build with library options disabled

Takashi Iwai tiwai at suse.de
Tue Jul 1 12:03:10 CEST 2008


At Fri, 27 Jun 2008 14:57:26 -0700,
Sean McNamara wrote:
> 
> Hello,
> 
> It's been a perennial problem with alsa-utils that there is no
> configure option to disable the seq and amidi apps. These apps depend
> on how you configured alsa-lib: If you pass --disable-seq
> --disable-instr to the alsa-lib configure, there does not currently
> exist a configure-time option to allow alsa-utils to build against
> this particular alsa-lib.
> 
> Of course, you could hack makefiles and stuff so it doesn't build seq
> and amidi, but I thought it would be nice to commit changes to the
> configure.in and Makefile.am to upstream, so that we can disable seq
> and amidi the "right" way.
> 
> The attached patches are diffed against the latest revision of
> alsa-utils. With this change, you can:
> 
> 1. Disable building amidi by passing --disable-midi to the configure
> in alsa-utils.
> 2. Disable building seq by passing --disable-seq to the configure in alsa-utils.
> 
> With this change, we can get a "good" build of alsa-utils (albeit,
> missing two of the utilities, which is intended) in the following
> circumstances:
> 
> 1. seq and instr are DISABLED in alsa-lib; seq and midi are DISABLED
> in alsa-utils
> 2. seq and instr are ENABLED in alsa-lib; seq and midi are ENABLED in
> alsa-utils (the default).
> 3. seq and instr are ENABLED in alsa-lib; seq and midi are DISABLED in
> alsa-utils.
> 
> Of course, it does not build cleanly if seq and instr are DISABLED in
> alsa-lib, but seq and midi are ENABLED in alsa-utils.
> 
> Patches are attached -- please let me know if there any issues, and if
> not, could one of the committers please commit them.

Thanks for picking this problem up.

IMO, the right fix would be to let configure check the availability of
each component.  As an easy solution, I foresee: 

A. export (some of) build flags in alsa-lib (or simply define in each
  *.h file), and check the seq and midi flags in alsa-utils configure 

B. alsa-utils configure checks alsa/rawmidi.h and alsa/seq.h, and
  disable the corresponding component accordingly.

The latter is easier (use AC_CHECK_HEADER instead of AC_ARG_ENABLE in
your patch), but maybe the former looks better.


thanks,

Takashi


More information about the Alsa-devel mailing list