Skip to content

Commit

Permalink
Fix bug where we'd try to configure an empty set of pkg-config packages
Browse files Browse the repository at this point in the history
This happened when the lib used pkg-config but the exe did not.
It cropped up in hsSqlite3-0.0.5.
  • Loading branch information
dcoutts committed Nov 1, 2008
1 parent 1ef2235 commit d88c934
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Distribution/Simple/Configure.hs
Expand Up @@ -583,11 +583,12 @@ configurePkgconfigPackages verbosity pkg_descr conf
return exe { buildInfo = buildInfo exe `mappend` bi }

pkgconfigBuildInfo :: [Dependency] -> IO BuildInfo
pkgconfigBuildInfo pkgdeps = do
let pkgs = nub [ display pkg | Dependency pkg _ <- pkgdeps ]
pkgconfigBuildInfo pkgdeps | null pkgs = return mempty
| otherwise = do
ccflags <- pkgconfig ("--cflags" : pkgs)
ldflags <- pkgconfig ("--libs" : pkgs)
return (ccLdOptionsBuildInfo (words ccflags) (words ldflags))
where pkgs = nub [ display pkg | Dependency pkg _ <- pkgdeps ]

-- | Makes a 'BuildInfo' from C compiler and linker flags.
--
Expand Down

0 comments on commit d88c934

Please sign in to comment.