cabal configure screw-up

Frederik Eaton frederik at
Sat Aug 20 20:14:33 EDT 2005

Hi Ross,

I'm experiencing the following problem. I'm trying to use a
'configure' script which is not a 'sh' script, but Cabal assumes that
all 'configure' scripts are 'sh' scripts regardless of what '#!' line
they start with. Isaac says this is your doing. What is the reason for

The lines are in cabal/Distribution/Simple.hs:

    where defaultPostConf :: Args -> ConfigFlags -> LocalBuildInfo -> IO ExitCode
          defaultPostConf args flags lbi
              = do let prefix_opt pref opts =
                           ("--prefix=" ++ pref) : opts
                   confExists <- doesFileExist "configure"
                   if confExists then do
                       rawSystemVerbose (configVerbose flags) "sh"
                           ("configure" : maybe id prefix_opt (configPrefix flags) args)
                       return ()
                       no_extra_flags args
                   return ExitSuccess

Note that if a file doesn't have any '#!' line at all then (at least
on my system) it is executed with /bin/sh. So when you run something
explicitly with /bin/sh, you are ONLY affecting things which
explicitly ask to be run with something other than /bin/sh. Isaac
refuses to let me fix this until you speak up because he's afraid it
might break the fptools build, so, ...



More information about the Libraries mailing list