Skip to content

Commit

Permalink
Unbreak library stripping with GHCJS.
Browse files Browse the repository at this point in the history
Fixes haskell#3330 (according to
haskell#3339 (comment)).
  • Loading branch information
23Skidoo committed Apr 14, 2016
1 parent 4168844 commit ad07be6
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Cabal/Distribution/Simple/GHCJS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -699,13 +699,13 @@ installLib verbosity lbi targetDir dynlibTargetDir builtDir _pkg lib clbi = do
whenShared $ copyModuleFiles "dyn_hi"

-- copy the built library files over:
whenVanilla $ installOrdinary builtDir targetDir vanillaLibName
whenProf $ installOrdinary builtDir targetDir profileLibName
whenGHCi $ installOrdinary builtDir targetDir ghciLibName
whenShared $ installShared builtDir dynlibTargetDir sharedLibName
whenVanilla $ installOrdinaryNative builtDir targetDir vanillaLibName
whenProf $ installOrdinaryNative builtDir targetDir profileLibName
whenGHCi $ installOrdinaryNative builtDir targetDir ghciLibName
whenShared $ installSharedNative builtDir dynlibTargetDir sharedLibName

where
install isShared srcDir dstDir name = do
install isShared isJS srcDir dstDir name = do
let src = srcDir </> name
dst = dstDir </> name
createDirectoryIfMissingVerbose verbosity True dstDir
Expand All @@ -714,11 +714,15 @@ installLib verbosity lbi targetDir dynlibTargetDir builtDir _pkg lib clbi = do
then installExecutableFile verbosity src dst
else installOrdinaryFile verbosity src dst

when (stripLibs lbi) $ Strip.stripLib verbosity
(hostPlatform lbi) (withPrograms lbi) dst
when (stripLibs lbi && not isJS) $
Strip.stripLib verbosity
(hostPlatform lbi) (withPrograms lbi) dst

installOrdinary = install False
installShared = install True
installOrdinary = install False True
installShared = install True True

installOrdinaryNative = install False False
installSharedNative = install True False

copyModuleFiles ext =
findModuleFiles [builtDir] [ext] (libModules lib)
Expand Down

0 comments on commit ad07be6

Please sign in to comment.