[Hackage] #644: Equivalent of autoconf's --without-bla

Hackage trac at galois.com
Tue Mar 16 08:36:48 EDT 2010


#644: Equivalent of autoconf's --without-bla
----------------------------+-----------------------------------------------
  Reporter:  Eelis          |        Owner:         
      Type:  enhancement    |       Status:  new    
  Priority:  normal         |    Milestone:         
 Component:  Cabal library  |      Version:  1.6.0.1
  Severity:  normal         |     Keywords:         
Difficulty:  unknown        |   Ghcversion:         
  Platform:                 |  
----------------------------+-----------------------------------------------
 I have a package comprising multiple executables. One of these is optional
 and has additional dependencies. Because the majority of my users will
 want to use this executable, I want to build it by default. However, users
 who do /not/ need it should have the option of turning off building of the
 executable (removing the need for the additional dependencies).

 My naive approach to accomplish this with Cabal is as follows: I first
 declare a flag corresponding to the executable, with a default value of
 true. I then use:

   executable theexecutable
     if flag(theflag)
       ...
     else
       buildable: False

 This almost does what I need. The problem is that when the user does /not/
 have the dependencies needed for the executable, Cabal actually silently
 sets the flag to false and doesn't build the executable. I realize this is
 part of some clever backtracking/satisfiability scheme which is
 undoubtedly useful in certain cases, but in this case it just gets in the
 way and confuses the hell out of my users who end up missing the
 executable (because they lacked the additional dependencies).

 What I really want is for Cabal to keep its paws off this particular flag,
 so that if the user lacks the dependencies, they get an error (unless they
 manually unset the flag to inhibit building of the executable). In other
 words, all I really want is an equivalent of autoconf's --without-bla
 option. Surely this can't be too hard for Cabal?

-- 
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/644>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects



More information about the cabal-devel mailing list