[darcs-users] darcs patch: Replace Autoconf.hs with consistent use of CPP.

Eric Kow kowey at darcs.net
Thu Feb 19 10:00:22 UTC 2009


> Thu Feb 19 17:45:16 EST 2009  Trent W. Buck <trentbuck at gmail.com>
>   * Replace Autoconf.hs with consistent use of CPP.
>   
>   It's annoying how recording a patch causes a bunch of unrelated
>   modules like SHA1 to be recompiled, simply because they use *other*
>   variables exported by Autoconf.

Ok in principle, but a quick implementation question:

Replace Autoconf.hs with consistent use of CPP.
-----------------------------------------------
> -{-# INLINE have_libcurl #-}
> -have_libcurl :: Bool
> -#ifdef HAVE_CURL
> -have_libcurl = True
> -#else
> -have_libcurl = False
> -#endif

Perhaps it would make sense to move definitions like this to the modules
in which they are used....

> +#if defined(HAVE_LIBWWW) || defined(HAVE_LIBCURL) || defined(HAVE_HTTP)
>  import URL ( copyUrl, copyUrlFirst, waitUrl )
> hunk ./src/Darcs/External.hs 71
> +#endif
>  import Ssh ( getSSH, copySSH, copySSHs, SSHCmd(..) )
>  import URL ( Cachable(..) )
>  import Exec ( exec, Redirect(..), withoutNonBlock )
> hunk ./src/Darcs/External.hs 222
>               `catch` \_ -> return Nothing
>  
>  speculateRemote :: String -> FilePath -> IO () -- speculations are always Cachable
> +#if defined(HAVE_LIBWWW) || defined(HAVE_LIBCURL) || defined(HAVE_HTTP)

thereby avoiding the duplication of our ifdefs?

It also seems like that would be a less invasive change

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090219/839ec46c/attachment.pgp>


More information about the darcs-users mailing list