Commit 14d3b9c9 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fix --print-docdir for relocatable builds; fixes #1226

parent e1038459
......@@ -272,6 +272,11 @@ endif
@echo "cUSER_WAY_OPTS = \"$(USER_WAY_OPTS)\"" >> $(CONFIG_HS)
@echo "cDEFAULT_TMPDIR = \"$(DEFAULT_TMPDIR)\"" >> $(CONFIG_HS)
@echo "cDocDir = \"$(docdir)\"" >> $(CONFIG_HS)
ifeq "$(RelocatableBuild)" "YES"
@echo "cRelocatableBuild = True" >> $(CONFIG_HS)
else
@echo "cRelocatableBuild = False" >> $(CONFIG_HS)
endif
@echo done.
CLEAN_FILES += $(CONFIG_HS)
......
......@@ -96,8 +96,6 @@ main =
exitWith ExitSuccess
ShowSupportedLanguages -> do showSupportedLanguages
exitWith ExitSuccess
ShowDocDir -> do showDocDir
exitWith ExitSuccess
ShowVersion -> do showVersion
exitWith ExitSuccess
ShowNumVersion -> do putStrLn cProjectVersion
......@@ -173,7 +171,7 @@ main =
ShowUsage -> showGhcUsage dflags cli_mode
PrintLibdir -> putStrLn (topDir dflags)
ShowSupportedLanguages -> alreadyHandled
ShowDocDir -> alreadyHandled
ShowDocDir -> showDocDir (topDir dflags)
ShowVersion -> alreadyHandled
ShowNumVersion -> alreadyHandled
ShowInterface f -> doShowIface dflags f
......@@ -477,10 +475,11 @@ showSupportedLanguages :: IO ()
showSupportedLanguages = do mapM_ putStrLn supportedLanguages
exitWith ExitSuccess
showDocDir :: IO ()
showDocDir = do
putStrLn cDocDir
exitWith ExitSuccess
showDocDir :: FilePath -> IO ()
showDocDir topdir = putStrLn docDir
where docDir = if cRelocatableBuild
then topdir ++ "/doc"
else cDocDir
showVersion :: IO ()
showVersion = do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment