automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: making part of package optional at ./configure time


From: Ralf Wildenhues
Subject: Re: making part of package optional at ./configure time
Date: Mon, 18 Sep 2006 09:34:03 +0200
User-agent: Mutt/1.5.13 (2006-09-01)

Hello Mick,

* mick wrote on Sun, Sep 17, 2006 at 08:36:15AM CEST:
> I am trying to make the inclusion of a module of my program an option 
> configurable in ./configure but can't get it right.
> 
> At the moment I have 
> in configure.ac
> ....
> AC_ARG_ENABLE(webcam,
>   [  --disable-webcam        disable use of webcam])
> AC_ARG_ENABLE(voice,
>   [  --disable-voice         disable use of voice])
> ....
> AC_DEFINE([USE_WEBCAM], [], [enable/disable webcam broadcaster])
> AC_DEFINE([USE_VOICE], [], [enable/disable voice chat])

Use something like
  AC_ARG_ENABLE([webcam],
    [AS_HELP_STRING([--disable-webcam], [disable use of webcam])],
    [AC_DEFINE([USE_WEBCAM], [1], [enable/disable webcam broadcaster])])

If you have some sources that don't need to be compiled at all in some
case (and you use Automake), you can follow this by

  AM_CONDITIONAL([COND_WEBCAM], [test "$enable_webcam" != no])

and put in Makefile.am something like

  bin_PROGRAMS = foo
  foo_SOURCES = foo1.c ...
  if COND_WEBCAM
  foo_SOURCES += foo_webcam.c ...
  endif

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]